survey-react 1.10.4 → 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/survey.react.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - Survey JavaScript library v1.10.4
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
  */
@@ -5430,6 +5430,7 @@ var defaultV2Css = {
5430
5430
  rootFitToContainer: "sd-root-modern--full-container",
5431
5431
  rootWrapper: "sd-root-modern__wrapper",
5432
5432
  rootWrapperFixed: "sd-root-modern__wrapper--fixed",
5433
+ rootWrapperHasImage: "sd-root-modern__wrapper--has-image",
5433
5434
  rootBackgroundImage: "sd-root_background-image",
5434
5435
  container: "sd-container-modern",
5435
5436
  header: "sd-title sd-container-modern__title",
@@ -8530,7 +8531,7 @@ var DropdownListModel = /** @class */ (function (_super) {
8530
8531
  this.changeSelectionWithKeyboard(false);
8531
8532
  };
8532
8533
  DropdownListModel.prototype.onClear = function (event) {
8533
- this.question.clearValue();
8534
+ this.question.clearValue(true);
8534
8535
  this._popupModel.isVisible = false;
8535
8536
  if (event) {
8536
8537
  event.preventDefault();
@@ -9824,8 +9825,8 @@ __webpack_require__.r(__webpack_exports__);
9824
9825
 
9825
9826
  var Version;
9826
9827
  var ReleaseDate;
9827
- Version = "" + "1.10.4";
9828
- ReleaseDate = "" + "2024-05-15";
9828
+ Version = "" + "1.10.5";
9829
+ ReleaseDate = "" + "2024-05-20";
9829
9830
  function checkLibraryVersion(ver, libraryName) {
9830
9831
  if (Version != ver) {
9831
9832
  var str = "survey-core has version '" + Version + "' and " + libraryName
@@ -39966,15 +39967,18 @@ var Question = /** @class */ (function (_super) {
39966
39967
  * @see value
39967
39968
  * @see comment
39968
39969
  */
39969
- Question.prototype.clearValue = function () {
39970
+ Question.prototype.clearValue = function (keepComment) {
39970
39971
  if (this.value !== undefined) {
39971
39972
  this.value = undefined;
39972
39973
  }
39973
- if (!!this.comment) {
39974
+ if (!!this.comment && keepComment !== true) {
39974
39975
  this.comment = undefined;
39975
39976
  }
39976
39977
  this.setValueChangedDirectly(false);
39977
39978
  };
39979
+ Question.prototype.clearValueOnly = function () {
39980
+ this.clearValue(true);
39981
+ };
39978
39982
  Question.prototype.unbindValue = function () {
39979
39983
  this.clearValue();
39980
39984
  };
@@ -40658,6 +40662,8 @@ var Question = /** @class */ (function (_super) {
40658
40662
  return new _error__WEBPACK_IMPORTED_MODULE_3__["CustomError"](error, this.survey);
40659
40663
  };
40660
40664
  Question.prototype.removeError = function (error) {
40665
+ if (!error)
40666
+ return;
40661
40667
  var errors = this.errors;
40662
40668
  var index = errors.indexOf(error);
40663
40669
  if (index !== -1)
@@ -41102,14 +41108,18 @@ var Question = /** @class */ (function (_super) {
41102
41108
  Question.prototype.getDesktopRenderAs = function () {
41103
41109
  return "default";
41104
41110
  };
41111
+ Question.prototype.onBeforeSetCompactRenderer = function () { };
41112
+ Question.prototype.onBeforeSetDesktopRenderer = function () { };
41105
41113
  Question.prototype.processResponsiveness = function (requiredWidth, availableWidth) {
41106
41114
  availableWidth = Math.round(availableWidth);
41107
41115
  if (Math.abs(requiredWidth - availableWidth) > 2) {
41108
41116
  var oldRenderAs = this.renderAs;
41109
41117
  if (requiredWidth > availableWidth) {
41118
+ this.onBeforeSetCompactRenderer();
41110
41119
  this.renderAs = this.getCompactRenderAs();
41111
41120
  }
41112
41121
  else {
41122
+ this.onBeforeSetDesktopRenderer();
41113
41123
  this.renderAs = this.getDesktopRenderAs();
41114
41124
  }
41115
41125
  return oldRenderAs !== this.renderAs;
@@ -42338,8 +42348,8 @@ var QuestionSelectBase = /** @class */ (function (_super) {
42338
42348
  this.isSettingComment = false;
42339
42349
  }
42340
42350
  };
42341
- QuestionSelectBase.prototype.clearValue = function () {
42342
- _super.prototype.clearValue.call(this);
42351
+ QuestionSelectBase.prototype.clearValue = function (keepComment) {
42352
+ _super.prototype.clearValue.call(this, keepComment);
42343
42353
  this.prevOtherValue = undefined;
42344
42354
  };
42345
42355
  QuestionSelectBase.prototype.updateCommentFromSurvey = function (newValue) {
@@ -42596,6 +42606,9 @@ var QuestionSelectBase = /** @class */ (function (_super) {
42596
42606
  this.isLockVisibleChoices = !!question && question.name === val;
42597
42607
  if (!!question && question.name !== val) {
42598
42608
  question.removeDependedQuestion(this);
42609
+ if (this.isDesignMode && !this.isLoadingFromJson && !!val) {
42610
+ this.setPropertyValue("choicesFromQuestion", undefined);
42611
+ }
42599
42612
  }
42600
42613
  this.setPropertyValue("choicesFromQuestion", val);
42601
42614
  this.isLockVisibleChoices = false;
@@ -43545,7 +43558,7 @@ var QuestionSelectBase = /** @class */ (function (_super) {
43545
43558
  QuestionSelectBase.prototype.clearIncorrectValuesCore = function () {
43546
43559
  var val = this.value;
43547
43560
  if (this.canClearValueAnUnknown(val)) {
43548
- this.clearValue();
43561
+ this.clearValue(true);
43549
43562
  }
43550
43563
  };
43551
43564
  QuestionSelectBase.prototype.canClearValueAnUnknown = function (val) {
@@ -43555,7 +43568,7 @@ var QuestionSelectBase = /** @class */ (function (_super) {
43555
43568
  };
43556
43569
  QuestionSelectBase.prototype.clearDisabledValuesCore = function () {
43557
43570
  if (this.isValueDisabled(this.value)) {
43558
- this.clearValue();
43571
+ this.clearValue(true);
43559
43572
  }
43560
43573
  };
43561
43574
  QuestionSelectBase.prototype.clearUnusedValues = function () {
@@ -44983,7 +44996,7 @@ var QuestionCheckboxModel = /** @class */ (function (_super) {
44983
44996
  this.selectAll();
44984
44997
  }
44985
44998
  else {
44986
- this.clearValue();
44999
+ this.clearValue(true);
44987
45000
  }
44988
45001
  },
44989
45002
  enumerable: false,
@@ -45395,7 +45408,7 @@ var QuestionCheckboxModel = /** @class */ (function (_super) {
45395
45408
  this.value = null;
45396
45409
  }
45397
45410
  else {
45398
- this.clearValue();
45411
+ this.clearValue(true);
45399
45412
  }
45400
45413
  }
45401
45414
  this.isChangingValueOnClearIncorrect = false;
@@ -45426,7 +45439,7 @@ var QuestionCheckboxModel = /** @class */ (function (_super) {
45426
45439
  return;
45427
45440
  this.isChangingValueOnClearIncorrect = true;
45428
45441
  if (newValue.length == 0) {
45429
- this.clearValue();
45442
+ this.clearValue(true);
45430
45443
  }
45431
45444
  else {
45432
45445
  this.value = newValue;
@@ -47332,9 +47345,9 @@ var QuestionDropdownModel = /** @class */ (function (_super) {
47332
47345
  QuestionDropdownModel.prototype.getInputId = function () {
47333
47346
  return this.inputId + "_0";
47334
47347
  };
47335
- QuestionDropdownModel.prototype.clearValue = function () {
47348
+ QuestionDropdownModel.prototype.clearValue = function (keepComment) {
47336
47349
  var _a;
47337
- _super.prototype.clearValue.call(this);
47350
+ _super.prototype.clearValue.call(this, keepComment);
47338
47351
  this.lastSelectedItemValue = null;
47339
47352
  (_a = this.dropdownListModel) === null || _a === void 0 ? void 0 : _a.clear();
47340
47353
  };
@@ -47344,7 +47357,7 @@ var QuestionDropdownModel = /** @class */ (function (_super) {
47344
47357
  QuestionDropdownModel.prototype.onKeyUp = function (event) {
47345
47358
  var char = event.which || event.keyCode;
47346
47359
  if (char === 46) {
47347
- this.clearValue();
47360
+ this.clearValue(true);
47348
47361
  event.preventDefault();
47349
47362
  event.stopPropagation();
47350
47363
  }
@@ -48165,9 +48178,9 @@ var QuestionFileModelBase = /** @class */ (function (_super) {
48165
48178
  enumerable: false,
48166
48179
  configurable: true
48167
48180
  });
48168
- QuestionFileModelBase.prototype.clearValue = function () {
48181
+ QuestionFileModelBase.prototype.clearValue = function (keepComment) {
48169
48182
  this.clearOnDeletingContainer();
48170
- _super.prototype.clearValue.call(this);
48183
+ _super.prototype.clearValue.call(this, keepComment);
48171
48184
  };
48172
48185
  QuestionFileModelBase.prototype.clearOnDeletingContainer = function () {
48173
48186
  if (!this.survey)
@@ -50074,7 +50087,7 @@ var QuestionImagePickerModel = /** @class */ (function (_super) {
50074
50087
  if (!val)
50075
50088
  return;
50076
50089
  if (!Array.isArray(val) || val.length == 0) {
50077
- this.clearValue();
50090
+ this.clearValue(true);
50078
50091
  return;
50079
50092
  }
50080
50093
  var newValue = [];
@@ -50086,7 +50099,7 @@ var QuestionImagePickerModel = /** @class */ (function (_super) {
50086
50099
  if (newValue.length == val.length)
50087
50100
  return;
50088
50101
  if (newValue.length == 0) {
50089
- this.clearValue();
50102
+ this.clearValue(true);
50090
50103
  }
50091
50104
  else {
50092
50105
  this.value = newValue;
@@ -52024,10 +52037,10 @@ var MatrixDropdownRowModelBase = /** @class */ (function () {
52024
52037
  this.detailPanel.runCondition(values, newProps);
52025
52038
  }
52026
52039
  };
52027
- MatrixDropdownRowModelBase.prototype.clearValue = function () {
52040
+ MatrixDropdownRowModelBase.prototype.clearValue = function (keepComment) {
52028
52041
  var questions = this.questions;
52029
52042
  for (var i = 0; i < questions.length; i++) {
52030
- questions[i].clearValue();
52043
+ questions[i].clearValue(keepComment);
52031
52044
  }
52032
52045
  };
52033
52046
  MatrixDropdownRowModelBase.prototype.onAnyValueChanged = function (name, questionName) {
@@ -53433,23 +53446,7 @@ var QuestionMatrixDropdownModelBase = /** @class */ (function (_super) {
53433
53446
  QuestionMatrixDropdownModelBase.prototype.checkIfValueInRowDuplicated = function (checkedRow, cellQuestion) {
53434
53447
  if (!this.generatedVisibleRows)
53435
53448
  return false;
53436
- var res = false;
53437
- for (var i = 0; i < this.generatedVisibleRows.length; i++) {
53438
- var row = this.generatedVisibleRows[i];
53439
- if (checkedRow === row)
53440
- continue;
53441
- if (_helpers__WEBPACK_IMPORTED_MODULE_2__["Helpers"].isTwoValueEquals(row.getValue(cellQuestion.name), cellQuestion.value, true, this.isUniqueCaseSensitive)) {
53442
- res = true;
53443
- break;
53444
- }
53445
- }
53446
- if (res) {
53447
- this.addDuplicationError(cellQuestion);
53448
- }
53449
- else {
53450
- cellQuestion.clearErrors();
53451
- }
53452
- return res;
53449
+ return this.isValueInColumnDuplicated(cellQuestion.name, true, checkedRow);
53453
53450
  };
53454
53451
  /**
53455
53452
  * Assigns values to a row.
@@ -53787,51 +53784,104 @@ var QuestionMatrixDropdownModelBase = /** @class */ (function (_super) {
53787
53784
  QuestionMatrixDropdownModelBase.prototype.isValueDuplicated = function () {
53788
53785
  if (!this.generatedVisibleRows)
53789
53786
  return false;
53790
- var columns = this.getUniqueColumns();
53791
- var res = false;
53792
- for (var i = 0; i < columns.length; i++) {
53793
- res = this.isValueInColumnDuplicated(columns[i]) || res;
53794
- }
53795
- return res;
53796
- };
53797
- QuestionMatrixDropdownModelBase.prototype.isValueInColumnDuplicated = function (column) {
53798
- var keyValues = [];
53787
+ var names = this.getUniqueColumnsNames();
53799
53788
  var res = false;
53800
- for (var i = 0; i < this.generatedVisibleRows.length; i++) {
53801
- res =
53802
- 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;
53803
53791
  }
53804
53792
  return res;
53805
53793
  };
53806
- QuestionMatrixDropdownModelBase.prototype.getUniqueColumns = function () {
53794
+ QuestionMatrixDropdownModelBase.prototype.getUniqueColumnsNames = function () {
53807
53795
  var res = new Array();
53808
53796
  for (var i = 0; i < this.columns.length; i++) {
53809
53797
  if (this.columns[i].isUnique) {
53810
- res.push(this.columns[i]);
53798
+ res.push(this.columns[i].name);
53811
53799
  }
53812
53800
  }
53813
53801
  return res;
53814
53802
  };
53815
- QuestionMatrixDropdownModelBase.prototype.isValueDuplicatedInRow = function (row, column, keyValues) {
53816
- var question = row.getQuestionByColumn(column);
53817
- if (!question || question.isEmpty())
53818
- return false;
53819
- var value = question.value;
53820
- for (var i = 0; i < keyValues.length; i++) {
53821
- if (_helpers__WEBPACK_IMPORTED_MODULE_2__["Helpers"].isTwoValueEquals(value, keyValues[i], true, this.isUniqueCaseSensitive)) {
53822
- this.addDuplicationError(question);
53823
- return true;
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]);
53824
53833
  }
53825
53834
  }
53826
- keyValues.push(value);
53827
- return false;
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;
53828
53876
  };
53829
53877
  QuestionMatrixDropdownModelBase.prototype.addDuplicationError = function (question) {
53830
- var keyError = question.errors.find(function (error) { return error.getErrorType() === "keyduplicationerror"; });
53831
- if (!keyError) {
53878
+ if (!this.getDuplicationError(question)) {
53832
53879
  question.addError(new _error__WEBPACK_IMPORTED_MODULE_10__["KeyDuplicationError"](this.keyDuplicationError, this));
53833
53880
  }
53834
53881
  };
53882
+ QuestionMatrixDropdownModelBase.prototype.removeDuplicationError = function (question) {
53883
+ question.removeError(this.getDuplicationError(question));
53884
+ };
53835
53885
  QuestionMatrixDropdownModelBase.prototype.getFirstQuestionToFocus = function (withError) {
53836
53886
  return this.getFirstCellQuestion(withError);
53837
53887
  };
@@ -53977,6 +54027,9 @@ var QuestionMatrixDropdownModelBase = /** @class */ (function (_super) {
53977
54027
  this.onCellValueChanged(row, columnName, combine.rowValue);
53978
54028
  }
53979
54029
  }
54030
+ if (this.getUniqueColumnsNames().indexOf(columnName) > -1) {
54031
+ this.isValueInColumnDuplicated(columnName, !!rowObj);
54032
+ }
53980
54033
  };
53981
54034
  QuestionMatrixDropdownModelBase.prototype.getNewValueOnRowChanged = function (row, columnName, newRowValue, isDeletingValue, newValue) {
53982
54035
  var rowValue = this.getRowValueCore(row, newValue, true);
@@ -57537,13 +57590,11 @@ var QuestionMatrixDynamicModel = /** @class */ (function (_super) {
57537
57590
  }
57538
57591
  return setRowCount < this.minRowCount;
57539
57592
  };
57540
- QuestionMatrixDynamicModel.prototype.getUniqueColumns = function () {
57541
- var res = _super.prototype.getUniqueColumns.call(this);
57542
- if (!!this.keyName) {
57543
- var column = this.getColumnByName(this.keyName);
57544
- if (!!column && res.indexOf(column) < 0) {
57545
- res.push(column);
57546
- }
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);
57547
57598
  }
57548
57599
  return res;
57549
57600
  };
@@ -62100,7 +62151,7 @@ var QuestionRadiogroupModel = /** @class */ (function (_super) {
62100
62151
  var clearAction = new _actions_action__WEBPACK_IMPORTED_MODULE_3__["Action"]({
62101
62152
  title: this.clearButtonCaption,
62102
62153
  id: "sv-clr-btn-" + this.id,
62103
- action: function () { _this.clearValue(); },
62154
+ action: function () { _this.clearValue(true); },
62104
62155
  innerCss: this.cssClasses.clearButton,
62105
62156
  visible: new _base__WEBPACK_IMPORTED_MODULE_4__["ComputedUpdater"](function () { return _this.canShowClearButton; })
62106
62157
  });
@@ -62317,7 +62368,7 @@ var QuestionRankingModel = /** @class */ (function (_super) {
62317
62368
  _this.createNewArray("rankingChoices");
62318
62369
  _this.createNewArray("unRankingChoices");
62319
62370
  _this.registerFunctionOnPropertyValueChanged("selectToRankEnabled", function () {
62320
- _this.clearValue();
62371
+ _this.clearValue(true);
62321
62372
  _this.setDragDropRankingChoices();
62322
62373
  _this.updateRankingChoicesSync();
62323
62374
  });
@@ -62932,8 +62983,9 @@ __webpack_require__.r(__webpack_exports__);
62932
62983
  /* harmony import */ var _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./utils/cssClassBuilder */ "./src/utils/cssClassBuilder.ts");
62933
62984
  /* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./base */ "./src/base.ts");
62934
62985
  /* harmony import */ var _utils_utils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./utils/utils */ "./src/utils/utils.ts");
62935
- /* harmony import */ var _utils_devices__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./utils/devices */ "./src/utils/devices.ts");
62936
- /* harmony import */ var _global_variables_utils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./global_variables_utils */ "./src/global_variables_utils.ts");
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");
62937
62989
  var __extends = (undefined && undefined.__extends) || (function () {
62938
62990
  var extendStatics = function (d, b) {
62939
62991
  extendStatics = Object.setPrototypeOf ||
@@ -62966,6 +63018,7 @@ var __decorate = (undefined && undefined.__decorate) || function (decorators, ta
62966
63018
 
62967
63019
 
62968
63020
 
63021
+
62969
63022
  var RenderedRatingItem = /** @class */ (function (_super) {
62970
63023
  __extends(RenderedRatingItem, _super);
62971
63024
  function RenderedRatingItem(itemValue, locString) {
@@ -63257,19 +63310,19 @@ var QuestionRatingModel = /** @class */ (function (_super) {
63257
63310
  QuestionRatingModel.prototype.updateColors = function (themeVariables) {
63258
63311
  if (this.colorMode === "monochrome")
63259
63312
  return;
63260
- if (!_global_variables_utils__WEBPACK_IMPORTED_MODULE_10__["DomDocumentHelper"].isAvailable())
63313
+ if (!_global_variables_utils__WEBPACK_IMPORTED_MODULE_11__["DomDocumentHelper"].isAvailable())
63261
63314
  return;
63262
63315
  if (QuestionRatingModel.colorsCalculated)
63263
63316
  return;
63264
63317
  function getRGBColor(colorName, varName) {
63265
63318
  var str = !!themeVariables && themeVariables[colorName];
63266
63319
  if (!str) {
63267
- var style = getComputedStyle(_global_variables_utils__WEBPACK_IMPORTED_MODULE_10__["DomDocumentHelper"].getDocumentElement());
63320
+ var style = getComputedStyle(_global_variables_utils__WEBPACK_IMPORTED_MODULE_11__["DomDocumentHelper"].getDocumentElement());
63268
63321
  str = style.getPropertyValue && style.getPropertyValue(varName);
63269
63322
  }
63270
63323
  if (!str)
63271
63324
  return null;
63272
- var canvasElement = _global_variables_utils__WEBPACK_IMPORTED_MODULE_10__["DomDocumentHelper"].createElement("canvas");
63325
+ var canvasElement = _global_variables_utils__WEBPACK_IMPORTED_MODULE_11__["DomDocumentHelper"].createElement("canvas");
63273
63326
  if (!canvasElement)
63274
63327
  return null;
63275
63328
  var ctx = canvasElement.getContext("2d");
@@ -63541,7 +63594,7 @@ var QuestionRatingModel = /** @class */ (function (_super) {
63541
63594
  };
63542
63595
  QuestionRatingModel.prototype.setValueFromClick = function (value) {
63543
63596
  if (this.value === parseFloat(value)) {
63544
- this.clearValue();
63597
+ this.clearValue(true);
63545
63598
  }
63546
63599
  else {
63547
63600
  this.value = value;
@@ -63551,7 +63604,7 @@ var QuestionRatingModel = /** @class */ (function (_super) {
63551
63604
  }
63552
63605
  };
63553
63606
  QuestionRatingModel.prototype.onItemMouseIn = function (item) {
63554
- if (_utils_devices__WEBPACK_IMPORTED_MODULE_9__["IsTouch"])
63607
+ if (_utils_devices__WEBPACK_IMPORTED_MODULE_10__["IsTouch"])
63555
63608
  return;
63556
63609
  if (this.isReadOnly || !item.itemValue.isEnabled || this.isDesignMode)
63557
63610
  return;
@@ -63570,7 +63623,7 @@ var QuestionRatingModel = /** @class */ (function (_super) {
63570
63623
  }
63571
63624
  };
63572
63625
  QuestionRatingModel.prototype.onItemMouseOut = function (item) {
63573
- if (_utils_devices__WEBPACK_IMPORTED_MODULE_9__["IsTouch"])
63626
+ if (_utils_devices__WEBPACK_IMPORTED_MODULE_10__["IsTouch"])
63574
63627
  return;
63575
63628
  this.renderedRateItems.forEach(function (item) { return item.highlight = "none"; });
63576
63629
  };
@@ -63841,6 +63894,11 @@ var QuestionRatingModel = /** @class */ (function (_super) {
63841
63894
  QuestionRatingModel.prototype.supportResponsiveness = function () {
63842
63895
  return true;
63843
63896
  };
63897
+ QuestionRatingModel.prototype.onBeforeSetCompactRenderer = function () {
63898
+ if (!this.dropdownListModelValue) {
63899
+ this.dropdownListModel = new _dropdownListModel__WEBPACK_IMPORTED_MODULE_9__["DropdownListModel"](this);
63900
+ }
63901
+ };
63844
63902
  QuestionRatingModel.prototype.getCompactRenderAs = function () {
63845
63903
  return (this.displayMode == "buttons") ? "default" : "dropdown";
63846
63904
  };
@@ -63860,6 +63918,9 @@ var QuestionRatingModel = /** @class */ (function (_super) {
63860
63918
  });
63861
63919
  Object.defineProperty(QuestionRatingModel.prototype, "dropdownListModel", {
63862
63920
  get: function () {
63921
+ if (this.renderAs === "dropdown") {
63922
+ this.onBeforeSetCompactRenderer();
63923
+ }
63863
63924
  return this.dropdownListModelValue;
63864
63925
  },
63865
63926
  set: function (val) {
@@ -64505,9 +64566,9 @@ var QuestionSignaturePadModel = /** @class */ (function (_super) {
64505
64566
  this.value = (arg === null || arg === void 0 ? void 0 : arg.length) ? arg.map(function (r) { return r.content; })[0] : undefined;
64506
64567
  this.valueIsUpdatingInternally = false;
64507
64568
  };
64508
- QuestionSignaturePadModel.prototype.clearValue = function () {
64569
+ QuestionSignaturePadModel.prototype.clearValue = function (keepComment) {
64509
64570
  this.valueWasChangedFromLastUpload = false;
64510
- _super.prototype.clearValue.call(this);
64571
+ _super.prototype.clearValue.call(this, keepComment);
64511
64572
  this.refreshCanvas();
64512
64573
  };
64513
64574
  QuestionSignaturePadModel.prototype.endLoadingFromJson = function () {
@@ -64903,9 +64964,9 @@ var QuestionTagboxModel = /** @class */ (function (_super) {
64903
64964
  this.dropdownListModel.dispose();
64904
64965
  }
64905
64966
  };
64906
- QuestionTagboxModel.prototype.clearValue = function () {
64967
+ QuestionTagboxModel.prototype.clearValue = function (keepComment) {
64907
64968
  var _a;
64908
- _super.prototype.clearValue.call(this);
64969
+ _super.prototype.clearValue.call(this, keepComment);
64909
64970
  (_a = this.dropdownListModel) === null || _a === void 0 ? void 0 : _a.clear();
64910
64971
  };
64911
64972
  Object.defineProperty(QuestionTagboxModel.prototype, "showClearButton", {
@@ -69788,9 +69849,6 @@ var SurveyQuestionDropdownBase = /** @class */ (function (_super) {
69788
69849
  this.renderReadOnlyElement());
69789
69850
  }
69790
69851
  else {
69791
- if (!this.question["dropdownListModel"]) {
69792
- this.question["dropdownListModel"] = new survey_core__WEBPACK_IMPORTED_MODULE_1__["DropdownListModel"](this.question);
69793
- }
69794
69852
  selectElement = react__WEBPACK_IMPORTED_MODULE_0__["createElement"](react__WEBPACK_IMPORTED_MODULE_0__["Fragment"], null,
69795
69853
  this.renderInput(this.question["dropdownListModel"]),
69796
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 }));
@@ -75088,7 +75146,7 @@ var SurveyQuestionRadiogroup = /** @class */ (function (_super) {
75088
75146
  var clearButton = null;
75089
75147
  if (this.question.showClearButtonInContent) {
75090
75148
  clearButton = (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", null,
75091
- 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 })));
75092
75150
  }
75093
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 },
75094
75152
  this.question.hasColumns
@@ -76150,7 +76208,7 @@ var SurveyQuestionSignaturePad = /** @class */ (function (_super) {
76150
76208
  return null;
76151
76209
  var cssClasses = this.question.cssClasses;
76152
76210
  return react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: cssClasses.controls },
76153
- 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")));
76154
76212
  };
76155
76213
  return SurveyQuestionSignaturePad;
76156
76214
  }(_reactquestion_element__WEBPACK_IMPORTED_MODULE_1__["SurveyQuestionElementBase"]));
@@ -81755,7 +81813,8 @@ var SurveyModel = /** @class */ (function (_super) {
81755
81813
  SurveyModel.prototype.updateWrapperFormCss = function () {
81756
81814
  this.wrapperFormCss = new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_18__["CssClassBuilder"]()
81757
81815
  .append(this.css.rootWrapper)
81758
- .append(this.css.rootWrapperFixed, this.backgroundImageAttachment === "fixed")
81816
+ .append(this.css.rootWrapperHasImage, !!this.backgroundImage)
81817
+ .append(this.css.rootWrapperFixed, !!this.backgroundImage && this.backgroundImageAttachment === "fixed")
81759
81818
  .toString();
81760
81819
  };
81761
81820
  Object.defineProperty(SurveyModel.prototype, "completedHtml", {
@@ -85513,7 +85572,7 @@ var SurveyModel = /** @class */ (function (_super) {
85513
85572
  page.name = name;
85514
85573
  return page;
85515
85574
  };
85516
- SurveyModel.prototype.questionOnValueChanging = function (valueName, newValue) {
85575
+ SurveyModel.prototype.questionOnValueChanging = function (valueName, newValue, questionValueName) {
85517
85576
  if (!!this.editingObj) {
85518
85577
  var prop = _jsonobject__WEBPACK_IMPORTED_MODULE_1__["Serializer"].findProperty(this.editingObj.getType(), valueName);
85519
85578
  if (!!prop)
@@ -85523,7 +85582,7 @@ var SurveyModel = /** @class */ (function (_super) {
85523
85582
  return newValue;
85524
85583
  var options = {
85525
85584
  name: valueName,
85526
- question: this.getQuestionByValueName(valueName),
85585
+ question: this.getQuestionByValueName(questionValueName || valueName),
85527
85586
  value: this.getUnbindValue(newValue),
85528
85587
  oldValue: this.getValue(valueName),
85529
85588
  };
@@ -86478,6 +86537,7 @@ var SurveyModel = /** @class */ (function (_super) {
86478
86537
  if (this.isTwoValueEquals(newValue, this.getComment(name)))
86479
86538
  return;
86480
86539
  var commentName = name + this.commentSuffix;
86540
+ newValue = this.questionOnValueChanging(commentName, newValue, name);
86481
86541
  if (this.isValueEmpty(newValue)) {
86482
86542
  this.deleteDataValueCore(this.valuesHash, commentName);
86483
86543
  }
@@ -86504,6 +86564,10 @@ var SurveyModel = /** @class */ (function (_super) {
86504
86564
  question: question,
86505
86565
  value: newValue,
86506
86566
  });
86567
+ question.comment = newValue;
86568
+ if (question.comment != newValue) {
86569
+ question.comment = newValue;
86570
+ }
86507
86571
  }
86508
86572
  };
86509
86573
  /**
@@ -87651,7 +87715,11 @@ var SurveyModel = /** @class */ (function (_super) {
87651
87715
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])()
87652
87716
  ], SurveyModel.prototype, "_isCompact", void 0);
87653
87717
  __decorate([
87654
- 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
+ })
87655
87723
  ], SurveyModel.prototype, "backgroundImage", void 0);
87656
87724
  __decorate([
87657
87725
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])()