survey-react 1.10.3 → 1.10.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/defaultV2.css +6 -1
- package/defaultV2.css.map +1 -1
- package/defaultV2.min.css +2 -2
- package/modern.css +1 -1
- package/modern.min.css +1 -1
- package/package.json +1 -1
- package/survey.css +1 -1
- package/survey.min.css +1 -1
- package/survey.react.d.ts +33 -14
- package/survey.react.js +291 -166
- 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.10.
|
2
|
+
* surveyjs - Survey JavaScript library v1.10.5
|
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
|
*/
|
@@ -3970,13 +3970,18 @@ var ProcessValue = /** @class */ (function () {
|
|
3970
3970
|
};
|
3971
3971
|
ProcessValue.prototype.isAnyKeyChanged = function (keys, usedNames) {
|
3972
3972
|
for (var i = 0; i < usedNames.length; i++) {
|
3973
|
-
var
|
3974
|
-
if (
|
3973
|
+
var name_1 = usedNames[i];
|
3974
|
+
if (!name_1)
|
3975
|
+
continue;
|
3976
|
+
var lowerName = name_1.toLowerCase();
|
3977
|
+
if (keys.hasOwnProperty(name_1))
|
3978
|
+
return true;
|
3979
|
+
if (name_1 !== lowerName && keys.hasOwnProperty(lowerName))
|
3975
3980
|
return true;
|
3976
|
-
var firstName = this.getFirstName(
|
3981
|
+
var firstName = this.getFirstName(name_1);
|
3977
3982
|
if (!keys.hasOwnProperty(firstName))
|
3978
3983
|
continue;
|
3979
|
-
if (
|
3984
|
+
if (name_1 === firstName)
|
3980
3985
|
return true;
|
3981
3986
|
var keyValue = keys[firstName];
|
3982
3987
|
if (keyValue == undefined)
|
@@ -3986,9 +3991,9 @@ var ProcessValue = /** @class */ (function () {
|
|
3986
3991
|
return true;
|
3987
3992
|
var v = {};
|
3988
3993
|
v[firstName] = keyValue["oldValue"];
|
3989
|
-
var oldValue = this.getValue(
|
3994
|
+
var oldValue = this.getValue(name_1, v);
|
3990
3995
|
v[firstName] = keyValue["newValue"];
|
3991
|
-
var newValue = this.getValue(
|
3996
|
+
var newValue = this.getValue(name_1, v);
|
3992
3997
|
if (!_helpers__WEBPACK_IMPORTED_MODULE_0__["Helpers"].isTwoValueEquals(oldValue, newValue, false, false, false))
|
3993
3998
|
return true;
|
3994
3999
|
}
|
@@ -5425,6 +5430,7 @@ var defaultV2Css = {
|
|
5425
5430
|
rootFitToContainer: "sd-root-modern--full-container",
|
5426
5431
|
rootWrapper: "sd-root-modern__wrapper",
|
5427
5432
|
rootWrapperFixed: "sd-root-modern__wrapper--fixed",
|
5433
|
+
rootWrapperHasImage: "sd-root-modern__wrapper--has-image",
|
5428
5434
|
rootBackgroundImage: "sd-root_background-image",
|
5429
5435
|
container: "sd-container-modern",
|
5430
5436
|
header: "sd-title sd-container-modern__title",
|
@@ -7315,10 +7321,9 @@ var DragDropDOMAdapter = /** @class */ (function () {
|
|
7315
7321
|
var pageY = event.pageY;
|
7316
7322
|
var clientX = event.clientX;
|
7317
7323
|
var clientY = event.clientY;
|
7318
|
-
|
7319
|
-
|
7320
|
-
|
7321
|
-
}
|
7324
|
+
//https://github.com/surveyjs/survey-creator/issues/5484
|
7325
|
+
rootElementX -= rootElementScrollLeft;
|
7326
|
+
rootElementY -= rootElementScrollTop;
|
7322
7327
|
var shortcutBottomCoordinate = this.getShortcutBottomCoordinate(clientY, shortcutHeight, shortcutYOffset);
|
7323
7328
|
var shortcutRightCoordinate = this.getShortcutRightCoordinate(clientX, shortcutWidth, shortcutXOffset);
|
7324
7329
|
if (shortcutRightCoordinate >= documentRight) { // right boundary
|
@@ -8526,7 +8531,7 @@ var DropdownListModel = /** @class */ (function (_super) {
|
|
8526
8531
|
this.changeSelectionWithKeyboard(false);
|
8527
8532
|
};
|
8528
8533
|
DropdownListModel.prototype.onClear = function (event) {
|
8529
|
-
this.question.clearValue();
|
8534
|
+
this.question.clearValue(true);
|
8530
8535
|
this._popupModel.isVisible = false;
|
8531
8536
|
if (event) {
|
8532
8537
|
event.preventDefault();
|
@@ -9820,8 +9825,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
9820
9825
|
|
9821
9826
|
var Version;
|
9822
9827
|
var ReleaseDate;
|
9823
|
-
Version = "" + "1.10.
|
9824
|
-
ReleaseDate = "" + "2024-05-
|
9828
|
+
Version = "" + "1.10.5";
|
9829
|
+
ReleaseDate = "" + "2024-05-20";
|
9825
9830
|
function checkLibraryVersion(ver, libraryName) {
|
9826
9831
|
if (Version != ver) {
|
9827
9832
|
var str = "survey-core has version '" + Version + "' and " + libraryName
|
@@ -16531,6 +16536,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
16531
16536
|
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./helpers */ "./src/helpers.ts");
|
16532
16537
|
/* harmony import */ var _settings__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./settings */ "./src/settings.ts");
|
16533
16538
|
/* harmony import */ var _console_warnings__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./console-warnings */ "./src/console-warnings.ts");
|
16539
|
+
/* harmony import */ var _conditions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./conditions */ "./src/conditions.ts");
|
16540
|
+
|
16534
16541
|
|
16535
16542
|
|
16536
16543
|
|
@@ -16653,7 +16660,7 @@ function avg(params) {
|
|
16653
16660
|
}
|
16654
16661
|
FunctionFactory.Instance.register("avg", avg);
|
16655
16662
|
function getInArrayParams(params) {
|
16656
|
-
if (params.length
|
16663
|
+
if (params.length < 2 || params.length > 3)
|
16657
16664
|
return null;
|
16658
16665
|
var arr = params[0];
|
16659
16666
|
if (!arr)
|
@@ -16663,16 +16670,22 @@ function getInArrayParams(params) {
|
|
16663
16670
|
var name = params[1];
|
16664
16671
|
if (typeof name !== "string" && !(name instanceof String))
|
16665
16672
|
return null;
|
16666
|
-
|
16673
|
+
var expression = params.length === 3 ? params[2] : undefined;
|
16674
|
+
if (typeof expression !== "string" && !(expression instanceof String)) {
|
16675
|
+
expression = undefined;
|
16676
|
+
}
|
16677
|
+
return { data: arr, name: name, expression: expression };
|
16667
16678
|
}
|
16668
16679
|
function convertToNumber(val) {
|
16669
16680
|
if (typeof val === "string")
|
16670
16681
|
return _helpers__WEBPACK_IMPORTED_MODULE_0__["Helpers"].isNumber(val) ? _helpers__WEBPACK_IMPORTED_MODULE_0__["Helpers"].getNumber(val) : undefined;
|
16671
16682
|
return val;
|
16672
16683
|
}
|
16673
|
-
function processItemInArray(item, name, res, func, needToConvert) {
|
16684
|
+
function processItemInArray(item, name, res, func, needToConvert, condition) {
|
16674
16685
|
if (!item || _helpers__WEBPACK_IMPORTED_MODULE_0__["Helpers"].isValueEmpty(item[name]))
|
16675
16686
|
return res;
|
16687
|
+
if (condition && !condition.run(item))
|
16688
|
+
return res;
|
16676
16689
|
var val = needToConvert ? convertToNumber(item[name]) : 1;
|
16677
16690
|
return func(res, val);
|
16678
16691
|
}
|
@@ -16681,15 +16694,19 @@ function calcInArray(params, func, needToConvert) {
|
|
16681
16694
|
var v = getInArrayParams(params);
|
16682
16695
|
if (!v)
|
16683
16696
|
return undefined;
|
16697
|
+
var condition = !!v.expression ? new _conditions__WEBPACK_IMPORTED_MODULE_3__["ConditionRunner"](v.expression) : undefined;
|
16698
|
+
if (condition && condition.isAsync) {
|
16699
|
+
condition = undefined;
|
16700
|
+
}
|
16684
16701
|
var res = undefined;
|
16685
16702
|
if (Array.isArray(v.data)) {
|
16686
16703
|
for (var i = 0; i < v.data.length; i++) {
|
16687
|
-
res = processItemInArray(v.data[i], v.name, res, func, needToConvert);
|
16704
|
+
res = processItemInArray(v.data[i], v.name, res, func, needToConvert, condition);
|
16688
16705
|
}
|
16689
16706
|
}
|
16690
16707
|
else {
|
16691
16708
|
for (var key in v.data) {
|
16692
|
-
res = processItemInArray(v.data[key], v.name, res, func, needToConvert);
|
16709
|
+
res = processItemInArray(v.data[key], v.name, res, func, needToConvert, condition);
|
16693
16710
|
}
|
16694
16711
|
}
|
16695
16712
|
return res;
|
@@ -31467,6 +31484,9 @@ var InputMaskNumeric = /** @class */ (function (_super) {
|
|
31467
31484
|
}
|
31468
31485
|
return result;
|
31469
31486
|
};
|
31487
|
+
InputMaskNumeric.prototype.numericalCompositionIsEmpty = function (number) {
|
31488
|
+
return !number.integralPart && !number.fractionalPart;
|
31489
|
+
};
|
31470
31490
|
InputMaskNumeric.prototype.displayNumber = function (parsedNumber, insertThousandsSeparator, matchWholeMask) {
|
31471
31491
|
if (insertThousandsSeparator === void 0) { insertThousandsSeparator = true; }
|
31472
31492
|
if (matchWholeMask === void 0) { matchWholeMask = false; }
|
@@ -31571,6 +31591,8 @@ var InputMaskNumeric = /** @class */ (function (_super) {
|
|
31571
31591
|
};
|
31572
31592
|
InputMaskNumeric.prototype.getNumberUnmaskedValue = function (str) {
|
31573
31593
|
var parsedNumber = this.parseNumber(str);
|
31594
|
+
if (this.numericalCompositionIsEmpty(parsedNumber))
|
31595
|
+
return undefined;
|
31574
31596
|
return this.convertNumber(parsedNumber);
|
31575
31597
|
};
|
31576
31598
|
InputMaskNumeric.prototype.getTextAlignment = function () {
|
@@ -39945,15 +39967,18 @@ var Question = /** @class */ (function (_super) {
|
|
39945
39967
|
* @see value
|
39946
39968
|
* @see comment
|
39947
39969
|
*/
|
39948
|
-
Question.prototype.clearValue = function () {
|
39970
|
+
Question.prototype.clearValue = function (keepComment) {
|
39949
39971
|
if (this.value !== undefined) {
|
39950
39972
|
this.value = undefined;
|
39951
39973
|
}
|
39952
|
-
if (!!this.comment) {
|
39974
|
+
if (!!this.comment && keepComment !== true) {
|
39953
39975
|
this.comment = undefined;
|
39954
39976
|
}
|
39955
39977
|
this.setValueChangedDirectly(false);
|
39956
39978
|
};
|
39979
|
+
Question.prototype.clearValueOnly = function () {
|
39980
|
+
this.clearValue(true);
|
39981
|
+
};
|
39957
39982
|
Question.prototype.unbindValue = function () {
|
39958
39983
|
this.clearValue();
|
39959
39984
|
};
|
@@ -40637,6 +40662,8 @@ var Question = /** @class */ (function (_super) {
|
|
40637
40662
|
return new _error__WEBPACK_IMPORTED_MODULE_3__["CustomError"](error, this.survey);
|
40638
40663
|
};
|
40639
40664
|
Question.prototype.removeError = function (error) {
|
40665
|
+
if (!error)
|
40666
|
+
return;
|
40640
40667
|
var errors = this.errors;
|
40641
40668
|
var index = errors.indexOf(error);
|
40642
40669
|
if (index !== -1)
|
@@ -41081,14 +41108,18 @@ var Question = /** @class */ (function (_super) {
|
|
41081
41108
|
Question.prototype.getDesktopRenderAs = function () {
|
41082
41109
|
return "default";
|
41083
41110
|
};
|
41111
|
+
Question.prototype.onBeforeSetCompactRenderer = function () { };
|
41112
|
+
Question.prototype.onBeforeSetDesktopRenderer = function () { };
|
41084
41113
|
Question.prototype.processResponsiveness = function (requiredWidth, availableWidth) {
|
41085
41114
|
availableWidth = Math.round(availableWidth);
|
41086
41115
|
if (Math.abs(requiredWidth - availableWidth) > 2) {
|
41087
41116
|
var oldRenderAs = this.renderAs;
|
41088
41117
|
if (requiredWidth > availableWidth) {
|
41118
|
+
this.onBeforeSetCompactRenderer();
|
41089
41119
|
this.renderAs = this.getCompactRenderAs();
|
41090
41120
|
}
|
41091
41121
|
else {
|
41122
|
+
this.onBeforeSetDesktopRenderer();
|
41092
41123
|
this.renderAs = this.getDesktopRenderAs();
|
41093
41124
|
}
|
41094
41125
|
return oldRenderAs !== this.renderAs;
|
@@ -42317,8 +42348,8 @@ var QuestionSelectBase = /** @class */ (function (_super) {
|
|
42317
42348
|
this.isSettingComment = false;
|
42318
42349
|
}
|
42319
42350
|
};
|
42320
|
-
QuestionSelectBase.prototype.clearValue = function () {
|
42321
|
-
_super.prototype.clearValue.call(this);
|
42351
|
+
QuestionSelectBase.prototype.clearValue = function (keepComment) {
|
42352
|
+
_super.prototype.clearValue.call(this, keepComment);
|
42322
42353
|
this.prevOtherValue = undefined;
|
42323
42354
|
};
|
42324
42355
|
QuestionSelectBase.prototype.updateCommentFromSurvey = function (newValue) {
|
@@ -42575,6 +42606,9 @@ var QuestionSelectBase = /** @class */ (function (_super) {
|
|
42575
42606
|
this.isLockVisibleChoices = !!question && question.name === val;
|
42576
42607
|
if (!!question && question.name !== val) {
|
42577
42608
|
question.removeDependedQuestion(this);
|
42609
|
+
if (this.isDesignMode && !this.isLoadingFromJson && !!val) {
|
42610
|
+
this.setPropertyValue("choicesFromQuestion", undefined);
|
42611
|
+
}
|
42578
42612
|
}
|
42579
42613
|
this.setPropertyValue("choicesFromQuestion", val);
|
42580
42614
|
this.isLockVisibleChoices = false;
|
@@ -42990,7 +43024,7 @@ var QuestionSelectBase = /** @class */ (function (_super) {
|
|
42990
43024
|
}
|
42991
43025
|
}
|
42992
43026
|
}
|
42993
|
-
return strs.join("
|
43027
|
+
return strs.join(_settings__WEBPACK_IMPORTED_MODULE_9__["settings"].choicesSeparator);
|
42994
43028
|
};
|
42995
43029
|
QuestionSelectBase.prototype.getItemDisplayValue = function (item, val) {
|
42996
43030
|
if (item === this.otherItem) {
|
@@ -43524,7 +43558,7 @@ var QuestionSelectBase = /** @class */ (function (_super) {
|
|
43524
43558
|
QuestionSelectBase.prototype.clearIncorrectValuesCore = function () {
|
43525
43559
|
var val = this.value;
|
43526
43560
|
if (this.canClearValueAnUnknown(val)) {
|
43527
|
-
this.clearValue();
|
43561
|
+
this.clearValue(true);
|
43528
43562
|
}
|
43529
43563
|
};
|
43530
43564
|
QuestionSelectBase.prototype.canClearValueAnUnknown = function (val) {
|
@@ -43534,7 +43568,7 @@ var QuestionSelectBase = /** @class */ (function (_super) {
|
|
43534
43568
|
};
|
43535
43569
|
QuestionSelectBase.prototype.clearDisabledValuesCore = function () {
|
43536
43570
|
if (this.isValueDisabled(this.value)) {
|
43537
|
-
this.clearValue();
|
43571
|
+
this.clearValue(true);
|
43538
43572
|
}
|
43539
43573
|
};
|
43540
43574
|
QuestionSelectBase.prototype.clearUnusedValues = function () {
|
@@ -44962,7 +44996,7 @@ var QuestionCheckboxModel = /** @class */ (function (_super) {
|
|
44962
44996
|
this.selectAll();
|
44963
44997
|
}
|
44964
44998
|
else {
|
44965
|
-
this.clearValue();
|
44999
|
+
this.clearValue(true);
|
44966
45000
|
}
|
44967
45001
|
},
|
44968
45002
|
enumerable: false,
|
@@ -45374,7 +45408,7 @@ var QuestionCheckboxModel = /** @class */ (function (_super) {
|
|
45374
45408
|
this.value = null;
|
45375
45409
|
}
|
45376
45410
|
else {
|
45377
|
-
this.clearValue();
|
45411
|
+
this.clearValue(true);
|
45378
45412
|
}
|
45379
45413
|
}
|
45380
45414
|
this.isChangingValueOnClearIncorrect = false;
|
@@ -45405,7 +45439,7 @@ var QuestionCheckboxModel = /** @class */ (function (_super) {
|
|
45405
45439
|
return;
|
45406
45440
|
this.isChangingValueOnClearIncorrect = true;
|
45407
45441
|
if (newValue.length == 0) {
|
45408
|
-
this.clearValue();
|
45442
|
+
this.clearValue(true);
|
45409
45443
|
}
|
45410
45444
|
else {
|
45411
45445
|
this.value = newValue;
|
@@ -47311,9 +47345,9 @@ var QuestionDropdownModel = /** @class */ (function (_super) {
|
|
47311
47345
|
QuestionDropdownModel.prototype.getInputId = function () {
|
47312
47346
|
return this.inputId + "_0";
|
47313
47347
|
};
|
47314
|
-
QuestionDropdownModel.prototype.clearValue = function () {
|
47348
|
+
QuestionDropdownModel.prototype.clearValue = function (keepComment) {
|
47315
47349
|
var _a;
|
47316
|
-
_super.prototype.clearValue.call(this);
|
47350
|
+
_super.prototype.clearValue.call(this, keepComment);
|
47317
47351
|
this.lastSelectedItemValue = null;
|
47318
47352
|
(_a = this.dropdownListModel) === null || _a === void 0 ? void 0 : _a.clear();
|
47319
47353
|
};
|
@@ -47323,7 +47357,7 @@ var QuestionDropdownModel = /** @class */ (function (_super) {
|
|
47323
47357
|
QuestionDropdownModel.prototype.onKeyUp = function (event) {
|
47324
47358
|
var char = event.which || event.keyCode;
|
47325
47359
|
if (char === 46) {
|
47326
|
-
this.clearValue();
|
47360
|
+
this.clearValue(true);
|
47327
47361
|
event.preventDefault();
|
47328
47362
|
event.stopPropagation();
|
47329
47363
|
}
|
@@ -48144,9 +48178,9 @@ var QuestionFileModelBase = /** @class */ (function (_super) {
|
|
48144
48178
|
enumerable: false,
|
48145
48179
|
configurable: true
|
48146
48180
|
});
|
48147
|
-
QuestionFileModelBase.prototype.clearValue = function () {
|
48181
|
+
QuestionFileModelBase.prototype.clearValue = function (keepComment) {
|
48148
48182
|
this.clearOnDeletingContainer();
|
48149
|
-
_super.prototype.clearValue.call(this);
|
48183
|
+
_super.prototype.clearValue.call(this, keepComment);
|
48150
48184
|
};
|
48151
48185
|
QuestionFileModelBase.prototype.clearOnDeletingContainer = function () {
|
48152
48186
|
if (!this.survey)
|
@@ -48471,7 +48505,7 @@ var QuestionFileModel = /** @class */ (function (_super) {
|
|
48471
48505
|
_super.prototype.updateElementCssCore.call(this, cssClasses);
|
48472
48506
|
this.prevFileAction.iconName = this.cssClasses.leftIconId;
|
48473
48507
|
this.nextFileAction.iconName = this.cssClasses.rightIconId;
|
48474
|
-
|
48508
|
+
this.updateCurrentMode();
|
48475
48509
|
};
|
48476
48510
|
QuestionFileModel.prototype.getFileIndexCaption = function () {
|
48477
48511
|
return this.getLocalizationFormatString("indexText", this.indexToShow + 1, this.pagesCount);
|
@@ -49113,11 +49147,6 @@ var QuestionFileModel = /** @class */ (function (_super) {
|
|
49113
49147
|
this.actionsContainer.containerCss = classes.actionsContainer;
|
49114
49148
|
return classes;
|
49115
49149
|
};
|
49116
|
-
//todo remove in v2
|
49117
|
-
QuestionFileModel.prototype.updateElementCss = function (reNew) {
|
49118
|
-
_super.prototype.updateElementCss.call(this, reNew);
|
49119
|
-
this.updateCurrentMode();
|
49120
|
-
};
|
49121
49150
|
QuestionFileModel.prototype.onSurveyLoad = function () {
|
49122
49151
|
_super.prototype.onSurveyLoad.call(this);
|
49123
49152
|
this.updateCurrentMode();
|
@@ -49523,7 +49552,7 @@ var __decorate = (undefined && undefined.__decorate) || function (decorators, ta
|
|
49523
49552
|
|
49524
49553
|
|
49525
49554
|
|
49526
|
-
var
|
49555
|
+
var youtubeDomains = ["www.youtube.com", "m.youtube.com", "youtube.com", "youtu.be"];
|
49527
49556
|
var videoSuffics = [".mp4", ".mov", ".wmv", ".flv", ".avi", ".mkv"];
|
49528
49557
|
var youtubeUrl = "https://www.youtube.com/";
|
49529
49558
|
var youtubeEmbed = "embed";
|
@@ -49531,8 +49560,9 @@ function isUrlYoutubeVideo(url) {
|
|
49531
49560
|
if (!url)
|
49532
49561
|
return false;
|
49533
49562
|
url = url.toLowerCase();
|
49534
|
-
|
49535
|
-
|
49563
|
+
url = url.replace(/^https?:\/\//, "");
|
49564
|
+
for (var i = 0; i < youtubeDomains.length; i++) {
|
49565
|
+
if (url.indexOf(youtubeDomains[i] + "/") === 0)
|
49536
49566
|
return true;
|
49537
49567
|
}
|
49538
49568
|
return false;
|
@@ -49548,7 +49578,7 @@ var QuestionImageModel = /** @class */ (function (_super) {
|
|
49548
49578
|
var _this = _super.call(this, name) || this;
|
49549
49579
|
var locImageLink = _this.createLocalizableString("imageLink", _this, false);
|
49550
49580
|
locImageLink.onGetTextCallback = function (text) {
|
49551
|
-
return getCorrectImageLink(text);
|
49581
|
+
return getCorrectImageLink(text, _this.contentMode == "youtube");
|
49552
49582
|
};
|
49553
49583
|
_this.createLocalizableString("altText", _this, false);
|
49554
49584
|
_this.registerPropertyChangedHandlers(["contentMode", "imageLink"], function () { return _this.calculateRenderedMode(); });
|
@@ -49780,9 +49810,10 @@ var QuestionImageModel = /** @class */ (function (_super) {
|
|
49780
49810
|
return QuestionImageModel;
|
49781
49811
|
}(_questionnonvalue__WEBPACK_IMPORTED_MODULE_0__["QuestionNonValue"]));
|
49782
49812
|
|
49783
|
-
function getCorrectImageLink(val) {
|
49813
|
+
function getCorrectImageLink(val, isYouTube) {
|
49784
49814
|
if (!val || !isUrlYoutubeVideo(val))
|
49785
|
-
return val;
|
49815
|
+
return isYouTube ? "" : val;
|
49816
|
+
//if(!val || !isUrlYoutubeVideo(val)) return val;
|
49786
49817
|
var res = val.toLocaleLowerCase();
|
49787
49818
|
if (res.indexOf(youtubeEmbed) > -1)
|
49788
49819
|
return val;
|
@@ -50056,7 +50087,7 @@ var QuestionImagePickerModel = /** @class */ (function (_super) {
|
|
50056
50087
|
if (!val)
|
50057
50088
|
return;
|
50058
50089
|
if (!Array.isArray(val) || val.length == 0) {
|
50059
|
-
this.clearValue();
|
50090
|
+
this.clearValue(true);
|
50060
50091
|
return;
|
50061
50092
|
}
|
50062
50093
|
var newValue = [];
|
@@ -50068,7 +50099,7 @@ var QuestionImagePickerModel = /** @class */ (function (_super) {
|
|
50068
50099
|
if (newValue.length == val.length)
|
50069
50100
|
return;
|
50070
50101
|
if (newValue.length == 0) {
|
50071
|
-
this.clearValue();
|
50102
|
+
this.clearValue(true);
|
50072
50103
|
}
|
50073
50104
|
else {
|
50074
50105
|
this.value = newValue;
|
@@ -52006,10 +52037,10 @@ var MatrixDropdownRowModelBase = /** @class */ (function () {
|
|
52006
52037
|
this.detailPanel.runCondition(values, newProps);
|
52007
52038
|
}
|
52008
52039
|
};
|
52009
|
-
MatrixDropdownRowModelBase.prototype.clearValue = function () {
|
52040
|
+
MatrixDropdownRowModelBase.prototype.clearValue = function (keepComment) {
|
52010
52041
|
var questions = this.questions;
|
52011
52042
|
for (var i = 0; i < questions.length; i++) {
|
52012
|
-
questions[i].clearValue();
|
52043
|
+
questions[i].clearValue(keepComment);
|
52013
52044
|
}
|
52014
52045
|
};
|
52015
52046
|
MatrixDropdownRowModelBase.prototype.onAnyValueChanged = function (name, questionName) {
|
@@ -53415,23 +53446,7 @@ var QuestionMatrixDropdownModelBase = /** @class */ (function (_super) {
|
|
53415
53446
|
QuestionMatrixDropdownModelBase.prototype.checkIfValueInRowDuplicated = function (checkedRow, cellQuestion) {
|
53416
53447
|
if (!this.generatedVisibleRows)
|
53417
53448
|
return false;
|
53418
|
-
|
53419
|
-
for (var i = 0; i < this.generatedVisibleRows.length; i++) {
|
53420
|
-
var row = this.generatedVisibleRows[i];
|
53421
|
-
if (checkedRow === row)
|
53422
|
-
continue;
|
53423
|
-
if (_helpers__WEBPACK_IMPORTED_MODULE_2__["Helpers"].isTwoValueEquals(row.getValue(cellQuestion.name), cellQuestion.value, true, this.isUniqueCaseSensitive)) {
|
53424
|
-
res = true;
|
53425
|
-
break;
|
53426
|
-
}
|
53427
|
-
}
|
53428
|
-
if (res) {
|
53429
|
-
this.addDuplicationError(cellQuestion);
|
53430
|
-
}
|
53431
|
-
else {
|
53432
|
-
cellQuestion.clearErrors();
|
53433
|
-
}
|
53434
|
-
return res;
|
53449
|
+
return this.isValueInColumnDuplicated(cellQuestion.name, true, checkedRow);
|
53435
53450
|
};
|
53436
53451
|
/**
|
53437
53452
|
* Assigns values to a row.
|
@@ -53769,51 +53784,104 @@ var QuestionMatrixDropdownModelBase = /** @class */ (function (_super) {
|
|
53769
53784
|
QuestionMatrixDropdownModelBase.prototype.isValueDuplicated = function () {
|
53770
53785
|
if (!this.generatedVisibleRows)
|
53771
53786
|
return false;
|
53772
|
-
var
|
53787
|
+
var names = this.getUniqueColumnsNames();
|
53773
53788
|
var res = false;
|
53774
|
-
for (var i = 0; i <
|
53775
|
-
res = this.isValueInColumnDuplicated(
|
53776
|
-
}
|
53777
|
-
return res;
|
53778
|
-
};
|
53779
|
-
QuestionMatrixDropdownModelBase.prototype.isValueInColumnDuplicated = function (column) {
|
53780
|
-
var keyValues = [];
|
53781
|
-
var res = false;
|
53782
|
-
for (var i = 0; i < this.generatedVisibleRows.length; i++) {
|
53783
|
-
res =
|
53784
|
-
this.isValueDuplicatedInRow(this.generatedVisibleRows[i], column, keyValues) || res;
|
53789
|
+
for (var i = 0; i < names.length; i++) {
|
53790
|
+
res = this.isValueInColumnDuplicated(names[i], true) || res;
|
53785
53791
|
}
|
53786
53792
|
return res;
|
53787
53793
|
};
|
53788
|
-
QuestionMatrixDropdownModelBase.prototype.
|
53794
|
+
QuestionMatrixDropdownModelBase.prototype.getUniqueColumnsNames = function () {
|
53789
53795
|
var res = new Array();
|
53790
53796
|
for (var i = 0; i < this.columns.length; i++) {
|
53791
53797
|
if (this.columns[i].isUnique) {
|
53792
|
-
res.push(this.columns[i]);
|
53798
|
+
res.push(this.columns[i].name);
|
53793
53799
|
}
|
53794
53800
|
}
|
53795
53801
|
return res;
|
53796
53802
|
};
|
53797
|
-
QuestionMatrixDropdownModelBase.prototype.
|
53798
|
-
var
|
53799
|
-
if (
|
53800
|
-
|
53801
|
-
|
53802
|
-
|
53803
|
-
|
53804
|
-
|
53805
|
-
|
53803
|
+
QuestionMatrixDropdownModelBase.prototype.isValueInColumnDuplicated = function (columnName, showErrors, row) {
|
53804
|
+
var rows = this.getDuplicatedRows(columnName);
|
53805
|
+
if (showErrors) {
|
53806
|
+
this.showDuplicatedErrorsInRows(rows, columnName);
|
53807
|
+
}
|
53808
|
+
this.removeDuplicatedErrorsInRows(rows, columnName);
|
53809
|
+
return !!row ? rows.indexOf(row) > -1 : rows.length > 0;
|
53810
|
+
};
|
53811
|
+
QuestionMatrixDropdownModelBase.prototype.getDuplicatedRows = function (columnName) {
|
53812
|
+
var keyValues = {};
|
53813
|
+
var res = [];
|
53814
|
+
var rows = this.generatedVisibleRows;
|
53815
|
+
for (var i = 0; i < rows.length; i++) {
|
53816
|
+
var val = undefined;
|
53817
|
+
var question = rows[i].getQuestionByName(columnName);
|
53818
|
+
if (!!question) {
|
53819
|
+
val = question.value;
|
53820
|
+
}
|
53821
|
+
else {
|
53822
|
+
var rowVal = this.getRowValue(i);
|
53823
|
+
val = !!rowVal ? rowVal[columnName] : undefined;
|
53824
|
+
}
|
53825
|
+
if (!this.isValueEmpty(val)) {
|
53826
|
+
if (!this.isUniqueCaseSensitive && typeof val === "string") {
|
53827
|
+
val = val.toLocaleLowerCase();
|
53828
|
+
}
|
53829
|
+
if (!keyValues[val]) {
|
53830
|
+
keyValues[val] = [];
|
53831
|
+
}
|
53832
|
+
keyValues[val].push(rows[i]);
|
53806
53833
|
}
|
53807
53834
|
}
|
53808
|
-
keyValues
|
53809
|
-
|
53835
|
+
for (var key in keyValues) {
|
53836
|
+
if (keyValues[key].length > 1) {
|
53837
|
+
keyValues[key].forEach(function (row) { return res.push(row); });
|
53838
|
+
}
|
53839
|
+
}
|
53840
|
+
return res;
|
53841
|
+
};
|
53842
|
+
QuestionMatrixDropdownModelBase.prototype.showDuplicatedErrorsInRows = function (duplicatedRows, columnName) {
|
53843
|
+
var _this = this;
|
53844
|
+
duplicatedRows.forEach(function (row) {
|
53845
|
+
var question = row.getQuestionByName(columnName);
|
53846
|
+
if (!question && _this.detailPanel.getQuestionByName(columnName)) {
|
53847
|
+
row.showDetailPanel();
|
53848
|
+
if (row.detailPanel) {
|
53849
|
+
question = row.detailPanel.getQuestionByName(columnName);
|
53850
|
+
}
|
53851
|
+
}
|
53852
|
+
if (question) {
|
53853
|
+
row.showDetailPanel();
|
53854
|
+
_this.addDuplicationError(question);
|
53855
|
+
}
|
53856
|
+
});
|
53857
|
+
};
|
53858
|
+
QuestionMatrixDropdownModelBase.prototype.removeDuplicatedErrorsInRows = function (duplicatedRows, columnName) {
|
53859
|
+
var _this = this;
|
53860
|
+
this.generatedVisibleRows.forEach(function (row) {
|
53861
|
+
if (duplicatedRows.indexOf(row) < 0) {
|
53862
|
+
var question = row.getQuestionByName(columnName);
|
53863
|
+
if (question) {
|
53864
|
+
_this.removeDuplicationError(question);
|
53865
|
+
}
|
53866
|
+
}
|
53867
|
+
});
|
53868
|
+
};
|
53869
|
+
QuestionMatrixDropdownModelBase.prototype.getDuplicationError = function (question) {
|
53870
|
+
var errors = question.errors;
|
53871
|
+
for (var i = 0; i < errors.length; i++) {
|
53872
|
+
if (errors[i].getErrorType() === "keyduplicationerror")
|
53873
|
+
return errors[i];
|
53874
|
+
}
|
53875
|
+
return null;
|
53810
53876
|
};
|
53811
53877
|
QuestionMatrixDropdownModelBase.prototype.addDuplicationError = function (question) {
|
53812
|
-
|
53813
|
-
if (!keyError) {
|
53878
|
+
if (!this.getDuplicationError(question)) {
|
53814
53879
|
question.addError(new _error__WEBPACK_IMPORTED_MODULE_10__["KeyDuplicationError"](this.keyDuplicationError, this));
|
53815
53880
|
}
|
53816
53881
|
};
|
53882
|
+
QuestionMatrixDropdownModelBase.prototype.removeDuplicationError = function (question) {
|
53883
|
+
question.removeError(this.getDuplicationError(question));
|
53884
|
+
};
|
53817
53885
|
QuestionMatrixDropdownModelBase.prototype.getFirstQuestionToFocus = function (withError) {
|
53818
53886
|
return this.getFirstCellQuestion(withError);
|
53819
53887
|
};
|
@@ -53959,6 +54027,9 @@ var QuestionMatrixDropdownModelBase = /** @class */ (function (_super) {
|
|
53959
54027
|
this.onCellValueChanged(row, columnName, combine.rowValue);
|
53960
54028
|
}
|
53961
54029
|
}
|
54030
|
+
if (this.getUniqueColumnsNames().indexOf(columnName) > -1) {
|
54031
|
+
this.isValueInColumnDuplicated(columnName, !!rowObj);
|
54032
|
+
}
|
53962
54033
|
};
|
53963
54034
|
QuestionMatrixDropdownModelBase.prototype.getNewValueOnRowChanged = function (row, columnName, newRowValue, isDeletingValue, newValue) {
|
53964
54035
|
var rowValue = this.getRowValueCore(row, newValue, true);
|
@@ -54479,9 +54550,9 @@ var MatrixDropdownColumn = /** @class */ (function (_super) {
|
|
54479
54550
|
* @see isRequired
|
54480
54551
|
* @see readOnly
|
54481
54552
|
*/
|
54482
|
-
get: function () { return this.
|
54553
|
+
get: function () { return this.templateQuestion.visible; },
|
54483
54554
|
set: function (val) {
|
54484
|
-
this.
|
54555
|
+
this.templateQuestion.visible = val;
|
54485
54556
|
},
|
54486
54557
|
enumerable: false,
|
54487
54558
|
configurable: true
|
@@ -56529,7 +56600,7 @@ var QuestionMatrixDropdownRenderedTable = /** @class */ (function (_super) {
|
|
56529
56600
|
QuestionMatrixDropdownRenderedTable.prototype.getMultipleColumnChoices = function (column) {
|
56530
56601
|
var choices = column.templateQuestion.choices;
|
56531
56602
|
if (!!choices && Array.isArray(choices) && choices.length == 0)
|
56532
|
-
return this.matrix.choices;
|
56603
|
+
return [].concat(this.matrix.choices, column.getVisibleMultipleChoices());
|
56533
56604
|
choices = column.getVisibleMultipleChoices();
|
56534
56605
|
if (!choices || !Array.isArray(choices))
|
56535
56606
|
return null;
|
@@ -56709,11 +56780,11 @@ var QuestionMatrixDynamicModel = /** @class */ (function (_super) {
|
|
56709
56780
|
function QuestionMatrixDynamicModel(name) {
|
56710
56781
|
var _this = _super.call(this, name) || this;
|
56711
56782
|
_this.rowCounter = 0;
|
56712
|
-
_this.initialRowCount = 2;
|
56713
56783
|
_this.setRowCountValueFromData = false;
|
56714
56784
|
_this.startDragMatrixRow = function (event, currentTarget) {
|
56715
56785
|
_this.dragDropMatrixRows.startDrag(event, _this.draggedRow, _this, event.target);
|
56716
56786
|
};
|
56787
|
+
_this.initialRowCount = _this.getDefaultPropertyValue("rowCount");
|
56717
56788
|
_this.createLocalizableString("confirmDeleteText", _this, false, "confirmDelete");
|
56718
56789
|
var locAddRowText = _this.createLocalizableString("addRowText", _this);
|
56719
56790
|
locAddRowText.onGetTextCallback = function (text) {
|
@@ -57519,13 +57590,11 @@ var QuestionMatrixDynamicModel = /** @class */ (function (_super) {
|
|
57519
57590
|
}
|
57520
57591
|
return setRowCount < this.minRowCount;
|
57521
57592
|
};
|
57522
|
-
QuestionMatrixDynamicModel.prototype.
|
57523
|
-
var res = _super.prototype.
|
57524
|
-
|
57525
|
-
|
57526
|
-
|
57527
|
-
res.push(column);
|
57528
|
-
}
|
57593
|
+
QuestionMatrixDynamicModel.prototype.getUniqueColumnsNames = function () {
|
57594
|
+
var res = _super.prototype.getUniqueColumnsNames.call(this);
|
57595
|
+
var name = this.keyName;
|
57596
|
+
if (!!name && res.indexOf(name) < 0) {
|
57597
|
+
res.push(name);
|
57529
57598
|
}
|
57530
57599
|
return res;
|
57531
57600
|
};
|
@@ -57590,6 +57659,12 @@ var QuestionMatrixDynamicModel = /** @class */ (function (_super) {
|
|
57590
57659
|
this.setPropertyValueDirectly("rowCount", val.length);
|
57591
57660
|
return true;
|
57592
57661
|
};
|
57662
|
+
QuestionMatrixDynamicModel.prototype.updateValueFromSurvey = function (newValue, clearData) {
|
57663
|
+
if (clearData === void 0) { clearData = false; }
|
57664
|
+
this.setRowCountValueFromData = true;
|
57665
|
+
_super.prototype.updateValueFromSurvey.call(this, newValue, clearData);
|
57666
|
+
this.setRowCountValueFromData = false;
|
57667
|
+
};
|
57593
57668
|
QuestionMatrixDynamicModel.prototype.onBeforeValueChanged = function (val) {
|
57594
57669
|
if (!val || !Array.isArray(val))
|
57595
57670
|
return;
|
@@ -62076,7 +62151,7 @@ var QuestionRadiogroupModel = /** @class */ (function (_super) {
|
|
62076
62151
|
var clearAction = new _actions_action__WEBPACK_IMPORTED_MODULE_3__["Action"]({
|
62077
62152
|
title: this.clearButtonCaption,
|
62078
62153
|
id: "sv-clr-btn-" + this.id,
|
62079
|
-
action: function () { _this.clearValue(); },
|
62154
|
+
action: function () { _this.clearValue(true); },
|
62080
62155
|
innerCss: this.cssClasses.clearButton,
|
62081
62156
|
visible: new _base__WEBPACK_IMPORTED_MODULE_4__["ComputedUpdater"](function () { return _this.canShowClearButton; })
|
62082
62157
|
});
|
@@ -62293,7 +62368,7 @@ var QuestionRankingModel = /** @class */ (function (_super) {
|
|
62293
62368
|
_this.createNewArray("rankingChoices");
|
62294
62369
|
_this.createNewArray("unRankingChoices");
|
62295
62370
|
_this.registerFunctionOnPropertyValueChanged("selectToRankEnabled", function () {
|
62296
|
-
_this.clearValue();
|
62371
|
+
_this.clearValue(true);
|
62297
62372
|
_this.setDragDropRankingChoices();
|
62298
62373
|
_this.updateRankingChoicesSync();
|
62299
62374
|
});
|
@@ -62908,8 +62983,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
62908
62983
|
/* harmony import */ var _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./utils/cssClassBuilder */ "./src/utils/cssClassBuilder.ts");
|
62909
62984
|
/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./base */ "./src/base.ts");
|
62910
62985
|
/* harmony import */ var _utils_utils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./utils/utils */ "./src/utils/utils.ts");
|
62911
|
-
/* harmony import */ var
|
62912
|
-
/* harmony import */ var
|
62986
|
+
/* harmony import */ var _dropdownListModel__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./dropdownListModel */ "./src/dropdownListModel.ts");
|
62987
|
+
/* harmony import */ var _utils_devices__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./utils/devices */ "./src/utils/devices.ts");
|
62988
|
+
/* harmony import */ var _global_variables_utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./global_variables_utils */ "./src/global_variables_utils.ts");
|
62913
62989
|
var __extends = (undefined && undefined.__extends) || (function () {
|
62914
62990
|
var extendStatics = function (d, b) {
|
62915
62991
|
extendStatics = Object.setPrototypeOf ||
|
@@ -62942,6 +63018,7 @@ var __decorate = (undefined && undefined.__decorate) || function (decorators, ta
|
|
62942
63018
|
|
62943
63019
|
|
62944
63020
|
|
63021
|
+
|
62945
63022
|
var RenderedRatingItem = /** @class */ (function (_super) {
|
62946
63023
|
__extends(RenderedRatingItem, _super);
|
62947
63024
|
function RenderedRatingItem(itemValue, locString) {
|
@@ -63023,6 +63100,9 @@ var QuestionRatingModel = /** @class */ (function (_super) {
|
|
63023
63100
|
_this.registerFunctionOnPropertiesValueChanged(["rateColorMode", "scaleColorMode"], function () {
|
63024
63101
|
_this.updateColors(_this.survey.themeVariables);
|
63025
63102
|
});
|
63103
|
+
_this.registerFunctionOnPropertiesValueChanged(["displayMode"], function () {
|
63104
|
+
_this.updateRenderAsBasedOnDisplayMode(true);
|
63105
|
+
});
|
63026
63106
|
_this.registerSychProperties(["autoGenerate"], function () {
|
63027
63107
|
if (!_this.autoGenerate && _this.rateValues.length === 0) {
|
63028
63108
|
_this.setPropertyValue("rateValues", _this.visibleRateValues);
|
@@ -63230,19 +63310,19 @@ var QuestionRatingModel = /** @class */ (function (_super) {
|
|
63230
63310
|
QuestionRatingModel.prototype.updateColors = function (themeVariables) {
|
63231
63311
|
if (this.colorMode === "monochrome")
|
63232
63312
|
return;
|
63233
|
-
if (!
|
63313
|
+
if (!_global_variables_utils__WEBPACK_IMPORTED_MODULE_11__["DomDocumentHelper"].isAvailable())
|
63234
63314
|
return;
|
63235
63315
|
if (QuestionRatingModel.colorsCalculated)
|
63236
63316
|
return;
|
63237
63317
|
function getRGBColor(colorName, varName) {
|
63238
63318
|
var str = !!themeVariables && themeVariables[colorName];
|
63239
63319
|
if (!str) {
|
63240
|
-
var style = getComputedStyle(
|
63320
|
+
var style = getComputedStyle(_global_variables_utils__WEBPACK_IMPORTED_MODULE_11__["DomDocumentHelper"].getDocumentElement());
|
63241
63321
|
str = style.getPropertyValue && style.getPropertyValue(varName);
|
63242
63322
|
}
|
63243
63323
|
if (!str)
|
63244
63324
|
return null;
|
63245
|
-
var canvasElement =
|
63325
|
+
var canvasElement = _global_variables_utils__WEBPACK_IMPORTED_MODULE_11__["DomDocumentHelper"].createElement("canvas");
|
63246
63326
|
if (!canvasElement)
|
63247
63327
|
return null;
|
63248
63328
|
var ctx = canvasElement.getContext("2d");
|
@@ -63438,6 +63518,27 @@ var QuestionRatingModel = /** @class */ (function (_super) {
|
|
63438
63518
|
enumerable: false,
|
63439
63519
|
configurable: true
|
63440
63520
|
});
|
63521
|
+
QuestionRatingModel.prototype.updateRenderAsBasedOnDisplayMode = function (isOnChange) {
|
63522
|
+
if (this.isDesignMode) {
|
63523
|
+
if (isOnChange || this.renderAs === "dropdown") {
|
63524
|
+
this.renderAs = "default";
|
63525
|
+
}
|
63526
|
+
}
|
63527
|
+
else {
|
63528
|
+
if (isOnChange || this.displayMode !== "auto") {
|
63529
|
+
this.renderAs = this.displayMode === "dropdown" ? "dropdown" : "default";
|
63530
|
+
}
|
63531
|
+
}
|
63532
|
+
};
|
63533
|
+
QuestionRatingModel.prototype.onSurveyLoad = function () {
|
63534
|
+
_super.prototype.onSurveyLoad.call(this);
|
63535
|
+
if (this.renderAs === "dropdown" && this.displayMode === "auto") {
|
63536
|
+
this.displayMode = this.renderAs;
|
63537
|
+
}
|
63538
|
+
else {
|
63539
|
+
this.updateRenderAsBasedOnDisplayMode();
|
63540
|
+
}
|
63541
|
+
};
|
63441
63542
|
Object.defineProperty(QuestionRatingModel.prototype, "rateDisplayMode", {
|
63442
63543
|
get: function () {
|
63443
63544
|
return this.rateType;
|
@@ -63493,7 +63594,7 @@ var QuestionRatingModel = /** @class */ (function (_super) {
|
|
63493
63594
|
};
|
63494
63595
|
QuestionRatingModel.prototype.setValueFromClick = function (value) {
|
63495
63596
|
if (this.value === parseFloat(value)) {
|
63496
|
-
this.clearValue();
|
63597
|
+
this.clearValue(true);
|
63497
63598
|
}
|
63498
63599
|
else {
|
63499
63600
|
this.value = value;
|
@@ -63503,7 +63604,7 @@ var QuestionRatingModel = /** @class */ (function (_super) {
|
|
63503
63604
|
}
|
63504
63605
|
};
|
63505
63606
|
QuestionRatingModel.prototype.onItemMouseIn = function (item) {
|
63506
|
-
if (
|
63607
|
+
if (_utils_devices__WEBPACK_IMPORTED_MODULE_10__["IsTouch"])
|
63507
63608
|
return;
|
63508
63609
|
if (this.isReadOnly || !item.itemValue.isEnabled || this.isDesignMode)
|
63509
63610
|
return;
|
@@ -63522,7 +63623,7 @@ var QuestionRatingModel = /** @class */ (function (_super) {
|
|
63522
63623
|
}
|
63523
63624
|
};
|
63524
63625
|
QuestionRatingModel.prototype.onItemMouseOut = function (item) {
|
63525
|
-
if (
|
63626
|
+
if (_utils_devices__WEBPACK_IMPORTED_MODULE_10__["IsTouch"])
|
63526
63627
|
return;
|
63527
63628
|
this.renderedRateItems.forEach(function (item) { return item.highlight = "none"; });
|
63528
63629
|
};
|
@@ -63793,6 +63894,11 @@ var QuestionRatingModel = /** @class */ (function (_super) {
|
|
63793
63894
|
QuestionRatingModel.prototype.supportResponsiveness = function () {
|
63794
63895
|
return true;
|
63795
63896
|
};
|
63897
|
+
QuestionRatingModel.prototype.onBeforeSetCompactRenderer = function () {
|
63898
|
+
if (!this.dropdownListModelValue) {
|
63899
|
+
this.dropdownListModel = new _dropdownListModel__WEBPACK_IMPORTED_MODULE_9__["DropdownListModel"](this);
|
63900
|
+
}
|
63901
|
+
};
|
63796
63902
|
QuestionRatingModel.prototype.getCompactRenderAs = function () {
|
63797
63903
|
return (this.displayMode == "buttons") ? "default" : "dropdown";
|
63798
63904
|
};
|
@@ -63812,6 +63918,9 @@ var QuestionRatingModel = /** @class */ (function (_super) {
|
|
63812
63918
|
});
|
63813
63919
|
Object.defineProperty(QuestionRatingModel.prototype, "dropdownListModel", {
|
63814
63920
|
get: function () {
|
63921
|
+
if (this.renderAs === "dropdown") {
|
63922
|
+
this.onBeforeSetCompactRenderer();
|
63923
|
+
}
|
63815
63924
|
return this.dropdownListModelValue;
|
63816
63925
|
},
|
63817
63926
|
set: function (val) {
|
@@ -63847,6 +63956,7 @@ var QuestionRatingModel = /** @class */ (function (_super) {
|
|
63847
63956
|
if (!this.survey)
|
63848
63957
|
return;
|
63849
63958
|
this.updateColors(this.survey.themeVariables);
|
63959
|
+
this.updateRenderAsBasedOnDisplayMode();
|
63850
63960
|
};
|
63851
63961
|
QuestionRatingModel.prototype.dispose = function () {
|
63852
63962
|
_super.prototype.dispose.call(this);
|
@@ -63877,18 +63987,7 @@ var QuestionRatingModel = /** @class */ (function (_super) {
|
|
63877
63987
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])()
|
63878
63988
|
], QuestionRatingModel.prototype, "displayRateDescriptionsAsExtremeItems", void 0);
|
63879
63989
|
__decorate([
|
63880
|
-
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])(
|
63881
|
-
onSet: function (val, target) {
|
63882
|
-
if (!target.isDesignMode) {
|
63883
|
-
if (val === "dropdown") {
|
63884
|
-
target.renderAs = "dropdown";
|
63885
|
-
}
|
63886
|
-
else {
|
63887
|
-
target.renderAs = "default";
|
63888
|
-
}
|
63889
|
-
}
|
63890
|
-
}
|
63891
|
-
})
|
63990
|
+
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])()
|
63892
63991
|
], QuestionRatingModel.prototype, "displayMode", void 0);
|
63893
63992
|
__decorate([
|
63894
63993
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])()
|
@@ -64467,9 +64566,9 @@ var QuestionSignaturePadModel = /** @class */ (function (_super) {
|
|
64467
64566
|
this.value = (arg === null || arg === void 0 ? void 0 : arg.length) ? arg.map(function (r) { return r.content; })[0] : undefined;
|
64468
64567
|
this.valueIsUpdatingInternally = false;
|
64469
64568
|
};
|
64470
|
-
QuestionSignaturePadModel.prototype.clearValue = function () {
|
64569
|
+
QuestionSignaturePadModel.prototype.clearValue = function (keepComment) {
|
64471
64570
|
this.valueWasChangedFromLastUpload = false;
|
64472
|
-
_super.prototype.clearValue.call(this);
|
64571
|
+
_super.prototype.clearValue.call(this, keepComment);
|
64473
64572
|
this.refreshCanvas();
|
64474
64573
|
};
|
64475
64574
|
QuestionSignaturePadModel.prototype.endLoadingFromJson = function () {
|
@@ -64865,9 +64964,9 @@ var QuestionTagboxModel = /** @class */ (function (_super) {
|
|
64865
64964
|
this.dropdownListModel.dispose();
|
64866
64965
|
}
|
64867
64966
|
};
|
64868
|
-
QuestionTagboxModel.prototype.clearValue = function () {
|
64967
|
+
QuestionTagboxModel.prototype.clearValue = function (keepComment) {
|
64869
64968
|
var _a;
|
64870
|
-
_super.prototype.clearValue.call(this);
|
64969
|
+
_super.prototype.clearValue.call(this, keepComment);
|
64871
64970
|
(_a = this.dropdownListModel) === null || _a === void 0 ? void 0 : _a.clear();
|
64872
64971
|
};
|
64873
64972
|
Object.defineProperty(QuestionTagboxModel.prototype, "showClearButton", {
|
@@ -69750,9 +69849,6 @@ var SurveyQuestionDropdownBase = /** @class */ (function (_super) {
|
|
69750
69849
|
this.renderReadOnlyElement());
|
69751
69850
|
}
|
69752
69851
|
else {
|
69753
|
-
if (!this.question["dropdownListModel"]) {
|
69754
|
-
this.question["dropdownListModel"] = new survey_core__WEBPACK_IMPORTED_MODULE_1__["DropdownListModel"](this.question);
|
69755
|
-
}
|
69756
69852
|
selectElement = react__WEBPACK_IMPORTED_MODULE_0__["createElement"](react__WEBPACK_IMPORTED_MODULE_0__["Fragment"], null,
|
69757
69853
|
this.renderInput(this.question["dropdownListModel"]),
|
69758
69854
|
react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_components_popup_popup__WEBPACK_IMPORTED_MODULE_2__["Popup"], { model: (_b = (_a = this.question) === null || _a === void 0 ? void 0 : _a.dropdownListModel) === null || _b === void 0 ? void 0 : _b.popupModel }));
|
@@ -75050,7 +75146,7 @@ var SurveyQuestionRadiogroup = /** @class */ (function (_super) {
|
|
75050
75146
|
var clearButton = null;
|
75051
75147
|
if (this.question.showClearButtonInContent) {
|
75052
75148
|
clearButton = (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", null,
|
75053
|
-
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("input", { type: "button", className: this.question.cssClasses.clearButton, onClick: function () { return _this.question.clearValue(); }, value: this.question.clearButtonCaption })));
|
75149
|
+
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("input", { type: "button", className: this.question.cssClasses.clearButton, onClick: function () { return _this.question.clearValue(true); }, value: this.question.clearButtonCaption })));
|
75054
75150
|
}
|
75055
75151
|
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("fieldset", { className: this.question.getSelectBaseRootCss(), ref: function (fieldset) { return (_this.setControl(fieldset)); }, role: this.question.a11y_input_ariaRole, "aria-required": this.question.a11y_input_ariaRequired, "aria-label": this.question.a11y_input_ariaLabel, "aria-labelledby": this.question.a11y_input_ariaLabelledBy, "aria-describedby": this.question.a11y_input_ariaDescribedBy, "aria-invalid": this.question.a11y_input_ariaInvalid, "aria-errormessage": this.question.a11y_input_ariaErrormessage },
|
75056
75152
|
this.question.hasColumns
|
@@ -76112,7 +76208,7 @@ var SurveyQuestionSignaturePad = /** @class */ (function (_super) {
|
|
76112
76208
|
return null;
|
76113
76209
|
var cssClasses = this.question.cssClasses;
|
76114
76210
|
return react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: cssClasses.controls },
|
76115
|
-
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("button", { type: "button", className: cssClasses.clearButton, title: this.question.clearButtonCaption, onClick: function () { return _this.question.clearValue(); } }, this.question.cssClasses.clearButtonIconId ? react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_components_svg_icon_svg_icon__WEBPACK_IMPORTED_MODULE_3__["SvgIcon"], { iconName: this.question.cssClasses.clearButtonIconId, size: "auto" }) : react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", null, "\u2716")));
|
76211
|
+
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("button", { type: "button", className: cssClasses.clearButton, title: this.question.clearButtonCaption, onClick: function () { return _this.question.clearValue(true); } }, this.question.cssClasses.clearButtonIconId ? react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_components_svg_icon_svg_icon__WEBPACK_IMPORTED_MODULE_3__["SvgIcon"], { iconName: this.question.cssClasses.clearButtonIconId, size: "auto" }) : react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", null, "\u2716")));
|
76116
76212
|
};
|
76117
76213
|
return SurveyQuestionSignaturePad;
|
76118
76214
|
}(_reactquestion_element__WEBPACK_IMPORTED_MODULE_1__["SurveyQuestionElementBase"]));
|
@@ -77015,6 +77111,7 @@ var settings = {
|
|
77015
77111
|
* A separator used in a shorthand notation that specifies a value and display text for an [`ItemValue`](https://surveyjs.io/form-library/documentation/api-reference/itemvalue) object: `"value|text"`.
|
77016
77112
|
*
|
77017
77113
|
* Default value: `"|"`
|
77114
|
+
* @see [settings.choicesSeparator](https://surveyjs.io/form-library/documentation/api-reference/settings#choicesSeparator)
|
77018
77115
|
*/
|
77019
77116
|
itemValueSeparator: "|",
|
77020
77117
|
/**
|
@@ -77169,6 +77266,13 @@ var settings = {
|
|
77169
77266
|
dontKnowItem: [3],
|
77170
77267
|
otherItem: [4]
|
77171
77268
|
},
|
77269
|
+
/**
|
77270
|
+
* One or several characters used to separate choice options in a list.
|
77271
|
+
*
|
77272
|
+
* Default value: `", "`
|
77273
|
+
* @see [settings.itemValueSeparator](https://surveyjs.io/form-library/documentation/api-reference/settings#itemValueSeparator)
|
77274
|
+
*/
|
77275
|
+
choicesSeparator: ", ",
|
77172
77276
|
/**
|
77173
77277
|
* A list of supported validators by question type.
|
77174
77278
|
*/
|
@@ -79161,7 +79265,7 @@ var SurveyElement = /** @class */ (function (_super) {
|
|
79161
79265
|
configurable: true
|
79162
79266
|
});
|
79163
79267
|
SurveyElement.prototype.getIsAnimationAllowed = function () {
|
79164
|
-
return _super.prototype.getIsAnimationAllowed.call(this) && !!this.survey;
|
79268
|
+
return _super.prototype.getIsAnimationAllowed.call(this) && !!this.survey && !this.survey["isEndLoadingFromJson"];
|
79165
79269
|
};
|
79166
79270
|
SurveyElement.prototype.dispose = function () {
|
79167
79271
|
_super.prototype.dispose.call(this);
|
@@ -81709,7 +81813,8 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
81709
81813
|
SurveyModel.prototype.updateWrapperFormCss = function () {
|
81710
81814
|
this.wrapperFormCss = new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_18__["CssClassBuilder"]()
|
81711
81815
|
.append(this.css.rootWrapper)
|
81712
|
-
.append(this.css.
|
81816
|
+
.append(this.css.rootWrapperHasImage, !!this.backgroundImage)
|
81817
|
+
.append(this.css.rootWrapperFixed, !!this.backgroundImage && this.backgroundImageAttachment === "fixed")
|
81713
81818
|
.toString();
|
81714
81819
|
};
|
81715
81820
|
Object.defineProperty(SurveyModel.prototype, "completedHtml", {
|
@@ -85467,7 +85572,7 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
85467
85572
|
page.name = name;
|
85468
85573
|
return page;
|
85469
85574
|
};
|
85470
|
-
SurveyModel.prototype.questionOnValueChanging = function (valueName, newValue) {
|
85575
|
+
SurveyModel.prototype.questionOnValueChanging = function (valueName, newValue, questionValueName) {
|
85471
85576
|
if (!!this.editingObj) {
|
85472
85577
|
var prop = _jsonobject__WEBPACK_IMPORTED_MODULE_1__["Serializer"].findProperty(this.editingObj.getType(), valueName);
|
85473
85578
|
if (!!prop)
|
@@ -85477,7 +85582,7 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
85477
85582
|
return newValue;
|
85478
85583
|
var options = {
|
85479
85584
|
name: valueName,
|
85480
|
-
question: this.getQuestionByValueName(valueName),
|
85585
|
+
question: this.getQuestionByValueName(questionValueName || valueName),
|
85481
85586
|
value: this.getUnbindValue(newValue),
|
85482
85587
|
oldValue: this.getValue(valueName),
|
85483
85588
|
};
|
@@ -86211,14 +86316,20 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
86211
86316
|
SurveyModel.prototype.setVariable = function (name, newValue) {
|
86212
86317
|
if (!name)
|
86213
86318
|
return;
|
86319
|
+
var oldValue = this.getVariable(name);
|
86214
86320
|
if (!!this.valuesHash) {
|
86215
86321
|
delete this.valuesHash[name];
|
86216
86322
|
}
|
86217
86323
|
name = name.toLowerCase();
|
86218
86324
|
this.variablesHash[name] = newValue;
|
86219
86325
|
this.notifyElementsOnAnyValueOrVariableChanged(name);
|
86220
|
-
|
86221
|
-
|
86326
|
+
if (!_helpers__WEBPACK_IMPORTED_MODULE_0__["Helpers"].isTwoValueEquals(oldValue, newValue)) {
|
86327
|
+
this.runConditionOnValueChanged(name, newValue);
|
86328
|
+
var triggerKeys = {};
|
86329
|
+
triggerKeys[name] = { newValue: newValue, oldValue: oldValue };
|
86330
|
+
this.checkTriggers(triggerKeys, false, false, name);
|
86331
|
+
this.onVariableChanged.fire(this, { name: name, value: newValue });
|
86332
|
+
}
|
86222
86333
|
};
|
86223
86334
|
/**
|
86224
86335
|
* Returns the names of all variables in the survey.
|
@@ -86384,7 +86495,10 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
86384
86495
|
return;
|
86385
86496
|
if (this.checkIsCurrentPageHasErrors(false))
|
86386
86497
|
return;
|
86498
|
+
var curPage = this.currentPage;
|
86387
86499
|
var goNextPage = function () {
|
86500
|
+
if (curPage !== _this.currentPage)
|
86501
|
+
return;
|
86388
86502
|
if (!_this.isLastPage) {
|
86389
86503
|
_this.nextPage();
|
86390
86504
|
}
|
@@ -86423,6 +86537,7 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
86423
86537
|
if (this.isTwoValueEquals(newValue, this.getComment(name)))
|
86424
86538
|
return;
|
86425
86539
|
var commentName = name + this.commentSuffix;
|
86540
|
+
newValue = this.questionOnValueChanging(commentName, newValue, name);
|
86426
86541
|
if (this.isValueEmpty(newValue)) {
|
86427
86542
|
this.deleteDataValueCore(this.valuesHash, commentName);
|
86428
86543
|
}
|
@@ -86449,6 +86564,10 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
86449
86564
|
question: question,
|
86450
86565
|
value: newValue,
|
86451
86566
|
});
|
86567
|
+
question.comment = newValue;
|
86568
|
+
if (question.comment != newValue) {
|
86569
|
+
question.comment = newValue;
|
86570
|
+
}
|
86452
86571
|
}
|
86453
86572
|
};
|
86454
86573
|
/**
|
@@ -87373,32 +87492,34 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
87373
87492
|
}
|
87374
87493
|
}
|
87375
87494
|
else if (this.state === "running" && isStrCiEqual(layoutElement.id, this.progressBarComponentName)) {
|
87376
|
-
|
87377
|
-
|
87378
|
-
|
87379
|
-
|
87380
|
-
|
87381
|
-
|
87382
|
-
if (isStrCiEqual(this.showProgressBar, "belowHeader")) {
|
87383
|
-
isBelowHeader = true;
|
87384
|
-
}
|
87385
|
-
if (container === "header" && !isBelowHeader) {
|
87386
|
-
layoutElement.index = -150;
|
87387
|
-
if (this.isShowProgressBarOnTop && !this.isShowStartingPage) {
|
87388
|
-
containerLayoutElements.push(layoutElement);
|
87495
|
+
if (this.questionsOnPageMode != "singlePage") {
|
87496
|
+
var headerLayoutElement = this.findLayoutElement("advanced-header");
|
87497
|
+
var advHeader = headerLayoutElement && headerLayoutElement.data;
|
87498
|
+
var isBelowHeader = !advHeader || advHeader.hasBackground;
|
87499
|
+
if (isStrCiEqual(this.showProgressBar, "aboveHeader")) {
|
87500
|
+
isBelowHeader = false;
|
87389
87501
|
}
|
87390
|
-
|
87391
|
-
|
87392
|
-
if (!!layoutElement.index) {
|
87393
|
-
delete layoutElement.index;
|
87502
|
+
if (isStrCiEqual(this.showProgressBar, "belowHeader")) {
|
87503
|
+
isBelowHeader = true;
|
87394
87504
|
}
|
87395
|
-
if (
|
87396
|
-
|
87505
|
+
if (container === "header" && !isBelowHeader) {
|
87506
|
+
layoutElement.index = -150;
|
87507
|
+
if (this.isShowProgressBarOnTop && !this.isShowStartingPage) {
|
87508
|
+
containerLayoutElements.push(layoutElement);
|
87509
|
+
}
|
87397
87510
|
}
|
87398
|
-
|
87399
|
-
|
87400
|
-
|
87401
|
-
|
87511
|
+
if (container === "center" && isBelowHeader) {
|
87512
|
+
if (!!layoutElement.index) {
|
87513
|
+
delete layoutElement.index;
|
87514
|
+
}
|
87515
|
+
if (this.isShowProgressBarOnTop && !this.isShowStartingPage) {
|
87516
|
+
containerLayoutElements.push(layoutElement);
|
87517
|
+
}
|
87518
|
+
}
|
87519
|
+
if (container === "footer") {
|
87520
|
+
if (this.isShowProgressBarOnBottom && !this.isShowStartingPage) {
|
87521
|
+
containerLayoutElements.push(layoutElement);
|
87522
|
+
}
|
87402
87523
|
}
|
87403
87524
|
}
|
87404
87525
|
}
|
@@ -87594,7 +87715,11 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
87594
87715
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])()
|
87595
87716
|
], SurveyModel.prototype, "_isCompact", void 0);
|
87596
87717
|
__decorate([
|
87597
|
-
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])(
|
87718
|
+
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])({
|
87719
|
+
onSet: function (newValue, target) {
|
87720
|
+
target.updateCss();
|
87721
|
+
}
|
87722
|
+
})
|
87598
87723
|
], SurveyModel.prototype, "backgroundImage", void 0);
|
87599
87724
|
__decorate([
|
87600
87725
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])()
|