survey-react 1.9.82 → 1.9.83

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.9.82
2
+ * surveyjs - Survey JavaScript library v1.9.83
3
3
  * Copyright (c) 2015-2023 Devsoft Baltic OÜ - http://surveyjs.io/
4
4
  * License: MIT (http://www.opensource.org/licenses/mit-license.php)
5
5
  */
@@ -9532,7 +9532,7 @@ __webpack_require__.r(__webpack_exports__);
9532
9532
  // import "../../main.scss";
9533
9533
  //import "../../modern.scss";
9534
9534
  var Version;
9535
- Version = "" + "1.9.82";
9535
+ Version = "" + "1.9.83";
9536
9536
  function checkLibraryVersion(ver, libraryName) {
9537
9537
  if (Version != ver) {
9538
9538
  var str = "survey-core has version '" + Version + "' and " + libraryName
@@ -33537,9 +33537,7 @@ var Question = /** @class */ (function (_super) {
33537
33537
  }
33538
33538
  };
33539
33539
  Question.prototype.getValidName = function (name) {
33540
- if (!name)
33541
- return name;
33542
- return name.trim().replace(/[\{\}]+/g, "");
33540
+ return makeNameValid(name);
33543
33541
  };
33544
33542
  //IQuestion
33545
33543
  Question.prototype.updateValueFromSurvey = function (newValue) {
@@ -33774,13 +33772,17 @@ var Question = /** @class */ (function (_super) {
33774
33772
  return Question;
33775
33773
  }(_survey_element__WEBPACK_IMPORTED_MODULE_2__["SurveyElement"]));
33776
33774
 
33777
- function removeConverChar(str) {
33778
- if (!!str && str[0] === _settings__WEBPACK_IMPORTED_MODULE_8__["settings"].expressionDisableConversionChar)
33779
- return str.substring(1);
33775
+ function makeNameValid(str) {
33776
+ if (!str)
33777
+ return str;
33778
+ str = str.trim().replace(/[\{\}]+/g, "");
33779
+ while (!!str && str[0] === _settings__WEBPACK_IMPORTED_MODULE_8__["settings"].expressionDisableConversionChar) {
33780
+ str = str.substring(1);
33781
+ }
33780
33782
  return str;
33781
33783
  }
33782
33784
  _jsonobject__WEBPACK_IMPORTED_MODULE_1__["Serializer"].addClass("question", [
33783
- { name: "!name", onSettingValue: function (obj, val) { return removeConverChar(val); } },
33785
+ { name: "!name", onSettingValue: function (obj, val) { return makeNameValid(val); } },
33784
33786
  {
33785
33787
  name: "state",
33786
33788
  default: "default",
@@ -33855,7 +33857,7 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_1__["Serializer"].addClass("question", [
33855
33857
  (!!parent && parent.showQuestionNumbers === "onpanel"));
33856
33858
  },
33857
33859
  },
33858
- { name: "valueName", onSettingValue: function (obj, val) { return removeConverChar(val); } },
33860
+ { name: "valueName", onSettingValue: function (obj, val) { return makeNameValid(val); } },
33859
33861
  "enableIf:condition",
33860
33862
  "defaultValue:value",
33861
33863
  {
@@ -50749,13 +50751,14 @@ _questionfactory__WEBPACK_IMPORTED_MODULE_1__["QuestionFactory"].Instance.regist
50749
50751
  __webpack_require__.r(__webpack_exports__);
50750
50752
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "QuestionRankingModel", function() { return QuestionRankingModel; });
50751
50753
  /* harmony import */ var _dragdrop_ranking_choices__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dragdrop/ranking-choices */ "./src/dragdrop/ranking-choices.ts");
50752
- /* harmony import */ var _jsonobject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./jsonobject */ "./src/jsonobject.ts");
50753
- /* harmony import */ var _questionfactory__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./questionfactory */ "./src/questionfactory.ts");
50754
- /* harmony import */ var _question_checkbox__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./question_checkbox */ "./src/question_checkbox.ts");
50755
- /* harmony import */ var _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils/cssClassBuilder */ "./src/utils/cssClassBuilder.ts");
50756
- /* harmony import */ var _utils_devices__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils/devices */ "./src/utils/devices.ts");
50757
- /* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./helpers */ "./src/helpers.ts");
50758
- /* harmony import */ var _src_settings__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../src/settings */ "./src/settings.ts");
50754
+ /* harmony import */ var _itemvalue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./itemvalue */ "./src/itemvalue.ts");
50755
+ /* harmony import */ var _jsonobject__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./jsonobject */ "./src/jsonobject.ts");
50756
+ /* harmony import */ var _questionfactory__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./questionfactory */ "./src/questionfactory.ts");
50757
+ /* harmony import */ var _question_checkbox__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./question_checkbox */ "./src/question_checkbox.ts");
50758
+ /* harmony import */ var _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils/cssClassBuilder */ "./src/utils/cssClassBuilder.ts");
50759
+ /* harmony import */ var _utils_devices__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./utils/devices */ "./src/utils/devices.ts");
50760
+ /* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./helpers */ "./src/helpers.ts");
50761
+ /* harmony import */ var _src_settings__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../src/settings */ "./src/settings.ts");
50759
50762
  var __extends = (undefined && undefined.__extends) || (function () {
50760
50763
  var extendStatics = function (d, b) {
50761
50764
  extendStatics = Object.setPrototypeOf ||
@@ -50785,6 +50788,7 @@ var __decorate = (undefined && undefined.__decorate) || function (decorators, ta
50785
50788
 
50786
50789
 
50787
50790
 
50791
+
50788
50792
  /**
50789
50793
  * A class that describes the Ranking question type.
50790
50794
  *
@@ -50882,13 +50886,13 @@ var QuestionRankingModel = /** @class */ (function (_super) {
50882
50886
  };
50883
50887
  Object.defineProperty(QuestionRankingModel.prototype, "rootClass", {
50884
50888
  get: function () {
50885
- return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_4__["CssClassBuilder"]()
50889
+ return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_5__["CssClassBuilder"]()
50886
50890
  .append(this.cssClasses.root)
50887
- .append(this.cssClasses.rootMobileMod, _utils_devices__WEBPACK_IMPORTED_MODULE_5__["IsMobile"])
50891
+ .append(this.cssClasses.rootMobileMod, _utils_devices__WEBPACK_IMPORTED_MODULE_6__["IsMobile"])
50888
50892
  .append(this.cssClasses.rootDisabled, this.isReadOnly)
50889
50893
  .append(this.cssClasses.rootDesignMode, !!this.isDesignMode)
50890
50894
  .append(this.cssClasses.itemOnError, this.errors.length > 0)
50891
- .append(this.cssClasses.rootDragHandleAreaIcon, _src_settings__WEBPACK_IMPORTED_MODULE_7__["settings"].rankingDragHandleArea === "icon")
50895
+ .append(this.cssClasses.rootDragHandleAreaIcon, _src_settings__WEBPACK_IMPORTED_MODULE_8__["settings"].rankingDragHandleArea === "icon")
50892
50896
  .toString();
50893
50897
  },
50894
50898
  enumerable: false,
@@ -50897,7 +50901,7 @@ var QuestionRankingModel = /** @class */ (function (_super) {
50897
50901
  QuestionRankingModel.prototype.getItemClassCore = function (item, options) {
50898
50902
  var itemIndex = this.rankingChoices.indexOf(item);
50899
50903
  var dropTargetIndex = this.rankingChoices.indexOf(this.currentDropTarget);
50900
- return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_4__["CssClassBuilder"]()
50904
+ return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_5__["CssClassBuilder"]()
50901
50905
  .append(_super.prototype.getItemClassCore.call(this, item, options))
50902
50906
  .append(this.cssClasses.itemGhostMod, this.currentDropTarget === item)
50903
50907
  .append("sv-dragdrop-movedown", itemIndex === dropTargetIndex + 1 && this.dropTargetNodeMove === "down")
@@ -50919,7 +50923,7 @@ var QuestionRankingModel = /** @class */ (function (_super) {
50919
50923
  configurable: true
50920
50924
  });
50921
50925
  QuestionRankingModel.prototype.getItemIndexClasses = function () {
50922
- return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_4__["CssClassBuilder"]()
50926
+ return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_5__["CssClassBuilder"]()
50923
50927
  .append(this.cssClasses.itemIndex)
50924
50928
  .append(this.cssClasses.itemIndexEmptyMode, this.isEmpty())
50925
50929
  .toString();
@@ -50932,7 +50936,7 @@ var QuestionRankingModel = /** @class */ (function (_super) {
50932
50936
  this.updateRankingChoices();
50933
50937
  };
50934
50938
  QuestionRankingModel.prototype.isAnswerCorrect = function () {
50935
- return _helpers__WEBPACK_IMPORTED_MODULE_6__["Helpers"].isArraysEqual(this.value, this.correctAnswer, false);
50939
+ return _helpers__WEBPACK_IMPORTED_MODULE_7__["Helpers"].isArraysEqual(this.value, this.correctAnswer, false);
50936
50940
  };
50937
50941
  QuestionRankingModel.prototype.onSurveyValueChanged = function (newValue) {
50938
50942
  _super.prototype.onSurveyValueChanged.call(this, newValue);
@@ -50950,16 +50954,13 @@ var QuestionRankingModel = /** @class */ (function (_super) {
50950
50954
  this.value = newValue;
50951
50955
  };
50952
50956
  QuestionRankingModel.prototype.removeFromValueByVisibleChoices = function () {
50953
- var _this = this;
50954
50957
  var newValue = this.value.slice();
50955
- this.value.forEach(function (valueItem, index) {
50956
- var isValueItemToRemove = true;
50957
- _this.visibleChoices.forEach(function (choice) {
50958
- if (choice.value === valueItem)
50959
- isValueItemToRemove = false;
50960
- });
50961
- isValueItemToRemove && newValue.splice(index, 1);
50962
- });
50958
+ var choices = this.visibleChoices;
50959
+ for (var i = this.value.length - 1; i >= 0; i--) {
50960
+ if (!_itemvalue__WEBPACK_IMPORTED_MODULE_1__["ItemValue"].getItemByValue(choices, this.value[i])) {
50961
+ newValue.splice(i, 1);
50962
+ }
50963
+ }
50963
50964
  this.value = newValue;
50964
50965
  };
50965
50966
  Object.defineProperty(QuestionRankingModel.prototype, "rankingChoices", {
@@ -50997,7 +50998,7 @@ var QuestionRankingModel = /** @class */ (function (_super) {
50997
50998
  this.dragDropRankingChoices = new _dragdrop_ranking_choices__WEBPACK_IMPORTED_MODULE_0__["DragDropRankingChoices"](this.survey, null, this.longTap);
50998
50999
  };
50999
51000
  QuestionRankingModel.prototype.isDragStartNodeValid = function (target) {
51000
- if (_src_settings__WEBPACK_IMPORTED_MODULE_7__["settings"].rankingDragHandleArea === "icon") {
51001
+ if (_src_settings__WEBPACK_IMPORTED_MODULE_8__["settings"].rankingDragHandleArea === "icon") {
51001
51002
  return target.classList.contains(this.cssClasses.itemIconHoverMod);
51002
51003
  }
51003
51004
  return true;
@@ -51028,13 +51029,13 @@ var QuestionRankingModel = /** @class */ (function (_super) {
51028
51029
  return false;
51029
51030
  };
51030
51031
  QuestionRankingModel.prototype.getIconHoverCss = function () {
51031
- return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_4__["CssClassBuilder"]()
51032
+ return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_5__["CssClassBuilder"]()
51032
51033
  .append(this.cssClasses.itemIcon)
51033
51034
  .append(this.cssClasses.itemIconHoverMod)
51034
51035
  .toString();
51035
51036
  };
51036
51037
  QuestionRankingModel.prototype.getIconFocusCss = function () {
51037
- return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_4__["CssClassBuilder"]()
51038
+ return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_5__["CssClassBuilder"]()
51038
51039
  .append(this.cssClasses.itemIcon)
51039
51040
  .append(this.cssClasses.itemIconFocusMod)
51040
51041
  .toString();
@@ -51067,15 +51068,15 @@ var QuestionRankingModel = /** @class */ (function (_super) {
51067
51068
  configurable: true
51068
51069
  });
51069
51070
  __decorate([
51070
- Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])({ defaultValue: null })
51071
+ Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])({ defaultValue: null })
51071
51072
  ], QuestionRankingModel.prototype, "currentDropTarget", void 0);
51072
51073
  __decorate([
51073
- Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])({ defaultValue: null })
51074
+ Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])({ defaultValue: null })
51074
51075
  ], QuestionRankingModel.prototype, "dropTargetNodeMove", void 0);
51075
51076
  return QuestionRankingModel;
51076
- }(_question_checkbox__WEBPACK_IMPORTED_MODULE_3__["QuestionCheckboxModel"]));
51077
+ }(_question_checkbox__WEBPACK_IMPORTED_MODULE_4__["QuestionCheckboxModel"]));
51077
51078
 
51078
- _jsonobject__WEBPACK_IMPORTED_MODULE_1__["Serializer"].addClass("ranking", [
51079
+ _jsonobject__WEBPACK_IMPORTED_MODULE_2__["Serializer"].addClass("ranking", [
51079
51080
  { name: "showOtherItem", visible: false, isSerializable: false },
51080
51081
  { name: "otherText", visible: false, isSerializable: false },
51081
51082
  { name: "otherErrorText", visible: false, isSerializable: false },
@@ -51097,9 +51098,9 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_1__["Serializer"].addClass("ranking", [
51097
51098
  ], function () {
51098
51099
  return new QuestionRankingModel("");
51099
51100
  }, "checkbox");
51100
- _questionfactory__WEBPACK_IMPORTED_MODULE_2__["QuestionFactory"].Instance.registerQuestion("ranking", function (name) {
51101
+ _questionfactory__WEBPACK_IMPORTED_MODULE_3__["QuestionFactory"].Instance.registerQuestion("ranking", function (name) {
51101
51102
  var q = new QuestionRankingModel(name);
51102
- q.choices = _questionfactory__WEBPACK_IMPORTED_MODULE_2__["QuestionFactory"].DefaultChoices;
51103
+ q.choices = _questionfactory__WEBPACK_IMPORTED_MODULE_3__["QuestionFactory"].DefaultChoices;
51103
51104
  return q;
51104
51105
  });
51105
51106
 
@@ -51206,8 +51207,20 @@ var QuestionRatingModel = /** @class */ (function (_super) {
51206
51207
  _this.createItemValues("rateValues");
51207
51208
  _this.createRenderedRateItems();
51208
51209
  _this.createLocalizableString("ratingOptionsCaption", _this, false, true);
51209
- _this.registerFunctionOnPropertiesValueChanged(["rateValues", "rateMin", "rateMax", "rateType",
51210
+ _this.registerFunctionOnPropertiesValueChanged(["rateMin", "rateMax", "rateDisplayMode",
51210
51211
  "minRateDescription", "maxRateDescription", "rateStep", "displayRateDescriptionsAsExtremeItems"], function () { return _this.createRenderedRateItems(); });
51212
+ _this.registerFunctionOnPropertiesValueChanged(["rateValues"], function () {
51213
+ _this.autoGenerate = false;
51214
+ _this.createRenderedRateItems();
51215
+ });
51216
+ _this.registerFunctionOnPropertiesValueChanged(["autoGenerate"], function () {
51217
+ if (!_this.autoGenerate && _this.rateValues.length === 0) {
51218
+ _this.setPropertyValue("rateValues", _this.visibleRateValues);
51219
+ }
51220
+ if (_this.autoGenerate)
51221
+ _this.updateRateMax();
51222
+ _this.createRenderedRateItems();
51223
+ });
51211
51224
  _this.createLocalizableString("minRateDescription", _this, true);
51212
51225
  _this.createLocalizableString("maxRateDescription", _this, true);
51213
51226
  _this.initPropertyDependencies();
@@ -51227,6 +51240,8 @@ var QuestionRatingModel = /** @class */ (function (_super) {
51227
51240
  if (this.jsonObj.rateMax !== undefined && this.jsonObj.rateCount !== undefined && this.jsonObj.rateMin === undefined) {
51228
51241
  this.updateRateMin();
51229
51242
  }
51243
+ if (this.jsonObj.autoGenerate === undefined && this.jsonObj.rateValues !== undefined)
51244
+ this.autoGenerate = !this.jsonObj.rateValues.length;
51230
51245
  this.updateRateCount();
51231
51246
  this.createRenderedRateItems();
51232
51247
  };
@@ -51240,6 +51255,9 @@ var QuestionRatingModel = /** @class */ (function (_super) {
51240
51255
  }
51241
51256
  });
51242
51257
  };
51258
+ QuestionRatingModel.prototype.useRateValues = function () {
51259
+ return !!this.rateValues.length && !this.autoGenerate;
51260
+ };
51243
51261
  QuestionRatingModel.prototype.updateRateMax = function () {
51244
51262
  this.rateMax = this.rateMin + this.rateStep * (this.rateCount - 1);
51245
51263
  };
@@ -51247,7 +51265,7 @@ var QuestionRatingModel = /** @class */ (function (_super) {
51247
51265
  this.rateMin = this.rateMax - this.rateStep * (this.rateCount - 1);
51248
51266
  };
51249
51267
  QuestionRatingModel.prototype.updateRateCount = function () {
51250
- if (this.rateValues.length) {
51268
+ if (this.useRateValues()) {
51251
51269
  this.rateCount = this.rateValues.length;
51252
51270
  }
51253
51271
  else {
@@ -51257,7 +51275,7 @@ var QuestionRatingModel = /** @class */ (function (_super) {
51257
51275
  QuestionRatingModel.prototype.initPropertyDependencies = function () {
51258
51276
  var _this = this;
51259
51277
  this.registerSychProperties(["rateCount"], function () {
51260
- if (_this.rateValues.length == 0) {
51278
+ if (!_this.useRateValues()) {
51261
51279
  _this.rateMax = _this.rateMin + _this.rateStep * (_this.rateCount - 1);
51262
51280
  }
51263
51281
  else {
@@ -51372,14 +51390,14 @@ var QuestionRatingModel = /** @class */ (function (_super) {
51372
51390
  configurable: true
51373
51391
  });
51374
51392
  QuestionRatingModel.prototype.itemValuePropertyChanged = function (item, name, oldValue, newValue) {
51375
- if (this.rateValues.length === 0 && newValue !== undefined)
51376
- this.setPropertyValue("rateValues", this.visibleRateValues);
51393
+ if (!this.useRateValues() && newValue !== undefined)
51394
+ this.autoGenerate = false;
51377
51395
  _super.prototype.itemValuePropertyChanged.call(this, item, name, oldValue, newValue);
51378
51396
  };
51379
51397
  QuestionRatingModel.prototype.createRenderedRateItems = function () {
51380
51398
  var _this = this;
51381
51399
  var rateValues = [];
51382
- if (this.rateValues.length > 0) {
51400
+ if (this.useRateValues()) {
51383
51401
  rateValues = this.rateValues;
51384
51402
  }
51385
51403
  else {
@@ -51497,6 +51515,16 @@ var QuestionRatingModel = /** @class */ (function (_super) {
51497
51515
  enumerable: false,
51498
51516
  configurable: true
51499
51517
  });
51518
+ Object.defineProperty(QuestionRatingModel.prototype, "rateType", {
51519
+ get: function () {
51520
+ return this.rateDisplayMode;
51521
+ },
51522
+ set: function (val) {
51523
+ this.rateDisplayMode = val;
51524
+ },
51525
+ enumerable: false,
51526
+ configurable: true
51527
+ });
51500
51528
  Object.defineProperty(QuestionRatingModel.prototype, "isStar", {
51501
51529
  get: function () {
51502
51530
  return this.rateType == "stars";
@@ -51523,7 +51551,7 @@ var QuestionRatingModel = /** @class */ (function (_super) {
51523
51551
  configurable: true
51524
51552
  });
51525
51553
  QuestionRatingModel.prototype.valueToData = function (val) {
51526
- if (this.rateValues.length > 0) {
51554
+ if (this.useRateValues()) {
51527
51555
  var item = _itemvalue__WEBPACK_IMPORTED_MODULE_0__["ItemValue"].getItemByValue(this.rateValues, val);
51528
51556
  return !!item ? item.value : val;
51529
51557
  }
@@ -51564,10 +51592,10 @@ var QuestionRatingModel = /** @class */ (function (_super) {
51564
51592
  QuestionRatingModel.prototype.getItemSmiley = function (item) {
51565
51593
  var icons = ["terrible", "very-poor", "poor", "not-good", "average", "normal", "good", "very-good", "excellent", "perfect"];
51566
51594
  var priority = ["very-good", "not-good", "normal", "good", "average", "excellent", "poor", "perfect", "very-poor", "terrible"];
51567
- var count = this.rateValues.length || this.rateMax - this.rateMin + 1;
51595
+ var count = this.useRateValues() ? this.rateValues.length : this.rateMax - this.rateMin + 1;
51568
51596
  var selectedPriority = priority.slice(0, count);
51569
51597
  var selectedIcons = icons.filter(function (i) { return selectedPriority.indexOf(i) != -1; });
51570
- if (this.rateValues.length == 0) {
51598
+ if (!this.useRateValues()) {
51571
51599
  return selectedIcons[item.value - this.rateMin];
51572
51600
  }
51573
51601
  else {
@@ -51582,7 +51610,7 @@ var QuestionRatingModel = /** @class */ (function (_super) {
51582
51610
  if (highlight === void 0) { highlight = "none"; }
51583
51611
  var isSelected = this.value == item.value;
51584
51612
  if (this.isStar) {
51585
- if (this.rateValues.length == 0) {
51613
+ if (!this.useRateValues()) {
51586
51614
  isSelected = this.value >= item.value;
51587
51615
  }
51588
51616
  else {
@@ -51620,8 +51648,8 @@ var QuestionRatingModel = /** @class */ (function (_super) {
51620
51648
  var hasFixedSize = !this.isStar &&
51621
51649
  !this.isSmiley &&
51622
51650
  (!this.displayRateDescriptionsAsExtremeItems ||
51623
- this.rateValues.length > 0 && item != this.rateValues[0] && item != this.rateValues[this.rateValues.length - 1] ||
51624
- this.rateValues.length == 0 && item.value != this.rateMin && item.value != this.rateMax) &&
51651
+ this.useRateValues() && item != this.rateValues[0] && item != this.rateValues[this.rateValues.length - 1] ||
51652
+ !this.useRateValues() && item.value != this.rateMin && item.value != this.rateMax) &&
51625
51653
  item.locText.calculatedText.length <= 2 &&
51626
51654
  Number.isInteger(Number(item.locText.calculatedText));
51627
51655
  return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_6__["CssClassBuilder"]()
@@ -51749,6 +51777,9 @@ var QuestionRatingModel = /** @class */ (function (_super) {
51749
51777
  }
51750
51778
  return classes;
51751
51779
  };
51780
+ __decorate([
51781
+ Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])({ defaultValue: true })
51782
+ ], QuestionRatingModel.prototype, "autoGenerate", void 0);
51752
51783
  __decorate([
51753
51784
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])({ defaultValue: 5 })
51754
51785
  ], QuestionRatingModel.prototype, "rateCount", void 0);
@@ -51780,8 +51811,8 @@ var QuestionRatingModel = /** @class */ (function (_super) {
51780
51811
  })
51781
51812
  ], QuestionRatingModel.prototype, "displayMode", void 0);
51782
51813
  __decorate([
51783
- Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])({ defaultValue: "number" })
51784
- ], QuestionRatingModel.prototype, "rateType", void 0);
51814
+ Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])({ defaultValue: "labels" })
51815
+ ], QuestionRatingModel.prototype, "rateDisplayMode", void 0);
51785
51816
  __decorate([
51786
51817
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])({ defaultValue: "monochrome" })
51787
51818
  ], QuestionRatingModel.prototype, "smileysColorMode", void 0);
@@ -51790,27 +51821,58 @@ var QuestionRatingModel = /** @class */ (function (_super) {
51790
51821
 
51791
51822
  _jsonobject__WEBPACK_IMPORTED_MODULE_2__["Serializer"].addClass("rating", [
51792
51823
  { name: "showCommentArea:switch", layout: "row", visible: true, category: "general" },
51824
+ {
51825
+ name: "rateDisplayMode",
51826
+ alternativeName: "rateType",
51827
+ default: "labels",
51828
+ category: "rateValues",
51829
+ choices: ["labels", "stars", "smileys"],
51830
+ visibleIndex: 0
51831
+ },
51832
+ {
51833
+ name: "autoGenerate",
51834
+ displayName: "How to specify rate values?",
51835
+ category: "rateValues",
51836
+ default: true,
51837
+ choices: [{ value: true, text: "Generate" }, { value: false, text: "Enter manually" }],
51838
+ visibleIndex: 2
51839
+ },
51793
51840
  {
51794
51841
  name: "rateCount:number",
51795
- default: 5
51842
+ default: 5,
51843
+ category: "rateValues",
51844
+ visibleIndex: 1
51796
51845
  },
51797
51846
  {
51798
51847
  name: "rateValues:itemvalue[]",
51799
51848
  baseValue: function () {
51800
51849
  return _surveyStrings__WEBPACK_IMPORTED_MODULE_5__["surveyLocalization"].getString("choices_Item");
51801
51850
  },
51851
+ category: "rateValues",
51852
+ visibleIf: function (obj) {
51853
+ return !obj.autoGenerate;
51854
+ },
51855
+ visibleIndex: 3
51802
51856
  },
51803
51857
  {
51804
51858
  name: "rateMin:number", default: 1,
51805
51859
  onSettingValue: function (obj, val) {
51806
51860
  return val > obj.rateMax - obj.rateStep ? obj.rateMax - obj.rateStep : val;
51807
- }
51861
+ },
51862
+ visibleIf: function (obj) {
51863
+ return !!obj.autoGenerate;
51864
+ },
51865
+ visibleIndex: 4
51808
51866
  },
51809
51867
  {
51810
51868
  name: "rateMax:number", default: 5,
51811
51869
  onSettingValue: function (obj, val) {
51812
51870
  return val < obj.rateMin + obj.rateStep ? obj.rateMin + obj.rateStep : val;
51813
- }
51871
+ },
51872
+ visibleIf: function (obj) {
51873
+ return !!obj.autoGenerate;
51874
+ },
51875
+ visibleIndex: 5
51814
51876
  },
51815
51877
  {
51816
51878
  name: "rateStep:number", default: 1, minValue: 0.1,
@@ -51820,30 +51882,31 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_2__["Serializer"].addClass("rating", [
51820
51882
  if (val > obj.rateMax - obj.rateMin)
51821
51883
  val = obj.rateMax - obj.rateMin;
51822
51884
  return val;
51823
- }
51885
+ },
51886
+ visibleIf: function (obj) {
51887
+ return !!obj.autoGenerate;
51888
+ },
51889
+ visibleIndex: 6
51824
51890
  },
51825
51891
  {
51826
51892
  name: "minRateDescription",
51827
51893
  alternativeName: "mininumRateDescription",
51828
51894
  serializationProperty: "locMinRateDescription",
51895
+ visibleIndex: 17
51829
51896
  },
51830
51897
  {
51831
51898
  name: "maxRateDescription",
51832
51899
  alternativeName: "maximumRateDescription",
51833
51900
  serializationProperty: "locMaxRateDescription",
51901
+ visibleIndex: 18
51834
51902
  },
51835
- { name: "displayRateDescriptionsAsExtremeItems:boolean", default: false },
51903
+ { name: "displayRateDescriptionsAsExtremeItems:boolean", default: false, visibleIndex: 19 },
51836
51904
  {
51837
51905
  name: "displayMode",
51838
51906
  default: "auto",
51839
51907
  choices: ["auto", "buttons", "dropdown"],
51908
+ visibleIndex: 20
51840
51909
  },
51841
- {
51842
- name: "rateType",
51843
- visible: false,
51844
- default: "number",
51845
- choices: ["numbers", "labels", "stars", "smileys"],
51846
- }
51847
51910
  ], function () {
51848
51911
  return new QuestionRatingModel("");
51849
51912
  }, "question");
@@ -67174,7 +67237,8 @@ var SurveyModel = /** @class */ (function (_super) {
67174
67237
  });
67175
67238
  Object.defineProperty(SurveyModel.prototype, "backgroundImage", {
67176
67239
  /**
67177
- * Gets or sets a survey backgroundImage.
67240
+ * An image to display in the background of the survey or form. Accepts a base64 or URL string value.
67241
+ * @see backgroundOpacity
67178
67242
  */
67179
67243
  get: function () {
67180
67244
  return this.getLocalizableStringText("backgroundImage");
@@ -67196,6 +67260,10 @@ var SurveyModel = /** @class */ (function (_super) {
67196
67260
  this.renderBackgroundImage = ["url(", this.getLocalizableString("backgroundImage").renderedHtml, ")"].join("");
67197
67261
  };
67198
67262
  Object.defineProperty(SurveyModel.prototype, "backgroundOpacity", {
67263
+ /**
67264
+ * A value from 0 to 1 that specifies how transparent the survey background should be: 0 makes the background completely transparent, and 1 makes it opaque.
67265
+ * @see backgroundImage
67266
+ */
67199
67267
  get: function () {
67200
67268
  return this.getPropertyValue("backgroundOpacity");
67201
67269
  },