survey-core 1.12.19 → 1.12.20

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.
Files changed (222) hide show
  1. package/defaultV2.css +1 -1
  2. package/defaultV2.fontless.css +1 -1
  3. package/defaultV2.fontless.min.css +1 -1
  4. package/defaultV2.min.css +1 -1
  5. package/i18n/arabic.js +1 -1
  6. package/i18n/arabic.min.js +1 -1
  7. package/i18n/basque.js +1 -1
  8. package/i18n/basque.min.js +1 -1
  9. package/i18n/bulgarian.js +1 -1
  10. package/i18n/bulgarian.min.js +1 -1
  11. package/i18n/burmese.js +1 -1
  12. package/i18n/burmese.min.js +1 -1
  13. package/i18n/catalan.js +1 -1
  14. package/i18n/catalan.min.js +1 -1
  15. package/i18n/croatian.js +1 -1
  16. package/i18n/croatian.min.js +1 -1
  17. package/i18n/czech.js +1 -1
  18. package/i18n/czech.min.js +1 -1
  19. package/i18n/danish.js +1 -1
  20. package/i18n/danish.min.js +1 -1
  21. package/i18n/dutch.js +1 -1
  22. package/i18n/dutch.min.js +1 -1
  23. package/i18n/english.js +1 -1
  24. package/i18n/english.min.js +1 -1
  25. package/i18n/estonian.js +1 -1
  26. package/i18n/estonian.min.js +1 -1
  27. package/i18n/finnish.js +1 -1
  28. package/i18n/finnish.min.js +1 -1
  29. package/i18n/french.js +1 -1
  30. package/i18n/french.min.js +1 -1
  31. package/i18n/georgian.js +1 -1
  32. package/i18n/georgian.min.js +1 -1
  33. package/i18n/german.js +1 -1
  34. package/i18n/german.min.js +1 -1
  35. package/i18n/greek.js +1 -1
  36. package/i18n/greek.min.js +1 -1
  37. package/i18n/hebrew.js +1 -1
  38. package/i18n/hebrew.min.js +1 -1
  39. package/i18n/hindi.js +1 -1
  40. package/i18n/hindi.min.js +1 -1
  41. package/i18n/hungarian.js +1 -1
  42. package/i18n/hungarian.min.js +1 -1
  43. package/i18n/icelandic.js +1 -1
  44. package/i18n/icelandic.min.js +1 -1
  45. package/i18n/index.js +1 -1
  46. package/i18n/index.min.js +1 -1
  47. package/i18n/indonesian.js +1 -1
  48. package/i18n/indonesian.min.js +1 -1
  49. package/i18n/italian.js +1 -1
  50. package/i18n/italian.min.js +1 -1
  51. package/i18n/japanese.js +1 -1
  52. package/i18n/japanese.min.js +1 -1
  53. package/i18n/kazakh.js +1 -1
  54. package/i18n/kazakh.min.js +1 -1
  55. package/i18n/korean.js +1 -1
  56. package/i18n/korean.min.js +1 -1
  57. package/i18n/latvian.js +1 -1
  58. package/i18n/latvian.min.js +1 -1
  59. package/i18n/lithuanian.js +1 -1
  60. package/i18n/lithuanian.min.js +1 -1
  61. package/i18n/macedonian.js +1 -1
  62. package/i18n/macedonian.min.js +1 -1
  63. package/i18n/malay.js +1 -1
  64. package/i18n/malay.min.js +1 -1
  65. package/i18n/nl-BE.js +1 -1
  66. package/i18n/nl-BE.min.js +1 -1
  67. package/i18n/norwegian.js +1 -1
  68. package/i18n/norwegian.min.js +1 -1
  69. package/i18n/persian.js +1 -1
  70. package/i18n/persian.min.js +1 -1
  71. package/i18n/philippines.js +1 -1
  72. package/i18n/philippines.min.js +1 -1
  73. package/i18n/polish.js +1 -1
  74. package/i18n/polish.min.js +1 -1
  75. package/i18n/portuguese-br.js +1 -1
  76. package/i18n/portuguese-br.min.js +1 -1
  77. package/i18n/portuguese.js +1 -1
  78. package/i18n/portuguese.min.js +1 -1
  79. package/i18n/romanian.js +1 -1
  80. package/i18n/romanian.min.js +1 -1
  81. package/i18n/russian.js +1 -1
  82. package/i18n/russian.min.js +1 -1
  83. package/i18n/serbian.js +1 -1
  84. package/i18n/serbian.min.js +1 -1
  85. package/i18n/simplified-chinese.js +1 -1
  86. package/i18n/simplified-chinese.min.js +1 -1
  87. package/i18n/slovak.js +1 -1
  88. package/i18n/slovak.min.js +1 -1
  89. package/i18n/spanish.js +1 -1
  90. package/i18n/spanish.min.js +1 -1
  91. package/i18n/swahili.js +1 -1
  92. package/i18n/swahili.min.js +1 -1
  93. package/i18n/swedish.js +1 -1
  94. package/i18n/swedish.min.js +1 -1
  95. package/i18n/tajik.js +1 -1
  96. package/i18n/tajik.min.js +1 -1
  97. package/i18n/telugu.js +1 -1
  98. package/i18n/telugu.min.js +1 -1
  99. package/i18n/thai.js +1 -1
  100. package/i18n/thai.min.js +1 -1
  101. package/i18n/traditional-chinese.js +1 -1
  102. package/i18n/traditional-chinese.min.js +1 -1
  103. package/i18n/turkish.js +1 -1
  104. package/i18n/turkish.min.js +1 -1
  105. package/i18n/ukrainian.js +1 -1
  106. package/i18n/ukrainian.min.js +1 -1
  107. package/i18n/urdu.js +1 -1
  108. package/i18n/urdu.min.js +1 -1
  109. package/i18n/vietnamese.js +1 -1
  110. package/i18n/vietnamese.min.js +1 -1
  111. package/i18n/welsh.js +1 -1
  112. package/i18n/welsh.min.js +1 -1
  113. package/icons/iconsV1.js +1 -1
  114. package/icons/iconsV1.min.js +1 -1
  115. package/icons/iconsV2.js +1 -1
  116. package/icons/iconsV2.min.js +1 -1
  117. package/modern.css +1 -1
  118. package/modern.fontless.css +1 -1
  119. package/modern.fontless.min.css +1 -1
  120. package/modern.min.css +1 -1
  121. package/package.json +1 -1
  122. package/plugins/bootstrap-integration/index.js +1 -1
  123. package/plugins/bootstrap-integration/index.min.js +1 -1
  124. package/plugins/bootstrap-material-integration/index.js +1 -1
  125. package/plugins/bootstrap-material-integration/index.min.js +1 -1
  126. package/survey.core.js +138 -57
  127. package/survey.core.js.map +1 -1
  128. package/survey.core.min.js +3 -3
  129. package/survey.css +1 -1
  130. package/survey.i18n.js +1 -1
  131. package/survey.i18n.min.js +1 -1
  132. package/survey.min.css +1 -1
  133. package/themes/borderless-dark-panelless.js +1 -1
  134. package/themes/borderless-dark-panelless.min.js +1 -1
  135. package/themes/borderless-dark.js +1 -1
  136. package/themes/borderless-dark.min.js +1 -1
  137. package/themes/borderless-light-panelless..js +1 -1
  138. package/themes/borderless-light-panelless..min.js +1 -1
  139. package/themes/borderless-light.js +1 -1
  140. package/themes/borderless-light.min.js +1 -1
  141. package/themes/contrast-dark-panelless.js +1 -1
  142. package/themes/contrast-dark-panelless.min.js +1 -1
  143. package/themes/contrast-dark.js +1 -1
  144. package/themes/contrast-dark.min.js +1 -1
  145. package/themes/contrast-light-panelless.js +1 -1
  146. package/themes/contrast-light-panelless.min.js +1 -1
  147. package/themes/contrast-light.js +1 -1
  148. package/themes/contrast-light.min.js +1 -1
  149. package/themes/default-dark-panelless.js +1 -1
  150. package/themes/default-dark-panelless.min.js +1 -1
  151. package/themes/default-dark.js +1 -1
  152. package/themes/default-dark.min.js +1 -1
  153. package/themes/default-light-panelless.js +1 -1
  154. package/themes/default-light-panelless.min.js +1 -1
  155. package/themes/default-light.js +1 -1
  156. package/themes/default-light.min.js +1 -1
  157. package/themes/doubleborder-dark-panelless.js +1 -1
  158. package/themes/doubleborder-dark-panelless.min.js +1 -1
  159. package/themes/doubleborder-dark.js +1 -1
  160. package/themes/doubleborder-dark.min.js +1 -1
  161. package/themes/doubleborder-light-panelles.js +1 -1
  162. package/themes/doubleborder-light-panelles.min.js +1 -1
  163. package/themes/doubleborder-light.js +1 -1
  164. package/themes/doubleborder-light.min.js +1 -1
  165. package/themes/flat-dark-panelless.js +1 -1
  166. package/themes/flat-dark-panelless.min.js +1 -1
  167. package/themes/flat-dark.js +1 -1
  168. package/themes/flat-dark.min.js +1 -1
  169. package/themes/flat-light-panelless.js +1 -1
  170. package/themes/flat-light-panelless.min.js +1 -1
  171. package/themes/flat-light.js +1 -1
  172. package/themes/flat-light.min.js +1 -1
  173. package/themes/index.js +1 -1
  174. package/themes/index.min.js +1 -1
  175. package/themes/layered-dark-panelless.js +1 -1
  176. package/themes/layered-dark-panelless.min.js +1 -1
  177. package/themes/layered-dark.js +1 -1
  178. package/themes/layered-dark.min.js +1 -1
  179. package/themes/layered-light-panelless.js +1 -1
  180. package/themes/layered-light-panelless.min.js +1 -1
  181. package/themes/layered-light.js +1 -1
  182. package/themes/layered-light.min.js +1 -1
  183. package/themes/plain-dark-panelless.js +1 -1
  184. package/themes/plain-dark-panelless.min.js +1 -1
  185. package/themes/plain-dark.js +1 -1
  186. package/themes/plain-dark.min.js +1 -1
  187. package/themes/plain-light-panelless.js +1 -1
  188. package/themes/plain-light-panelless.min.js +1 -1
  189. package/themes/plain-light.js +1 -1
  190. package/themes/plain-light.min.js +1 -1
  191. package/themes/sharp-dark-panelless.js +1 -1
  192. package/themes/sharp-dark-panelless.min.js +1 -1
  193. package/themes/sharp-dark.js +1 -1
  194. package/themes/sharp-dark.min.js +1 -1
  195. package/themes/sharp-light-panelless.js +1 -1
  196. package/themes/sharp-light-panelless.min.js +1 -1
  197. package/themes/sharp-light.js +1 -1
  198. package/themes/sharp-light.min.js +1 -1
  199. package/themes/solid-dark-panelless.js +1 -1
  200. package/themes/solid-dark-panelless.min.js +1 -1
  201. package/themes/solid-dark.js +1 -1
  202. package/themes/solid-dark.min.js +1 -1
  203. package/themes/solid-light-panelless.js +1 -1
  204. package/themes/solid-light-panelless.min.js +1 -1
  205. package/themes/solid-light.js +1 -1
  206. package/themes/solid-light.min.js +1 -1
  207. package/themes/three-dimensional-dark-panelless.js +1 -1
  208. package/themes/three-dimensional-dark-panelless.min.js +1 -1
  209. package/themes/three-dimensional-dark.js +1 -1
  210. package/themes/three-dimensional-dark.min.js +1 -1
  211. package/themes/three-dimensional-light-panelless.js +1 -1
  212. package/themes/three-dimensional-light-panelless.min.js +1 -1
  213. package/themes/three-dimensional-light.js +1 -1
  214. package/themes/three-dimensional-light.min.js +1 -1
  215. package/ts3.4/typings/packages/survey-core/src/question.d.ts +1 -0
  216. package/ts3.4/typings/packages/survey-core/src/question_rating.d.ts +11 -4
  217. package/ts3.4/typings/packages/survey-core/src/question_text.d.ts +1 -0
  218. package/ts3.4/typings/packages/survey-core/src/survey.d.ts +2 -1
  219. package/typings/packages/survey-core/src/question.d.ts +1 -0
  220. package/typings/packages/survey-core/src/question_rating.d.ts +11 -4
  221. package/typings/packages/survey-core/src/question_text.d.ts +1 -0
  222. package/typings/packages/survey-core/src/survey.d.ts +2 -1
package/survey.core.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - Survey JavaScript library v1.12.19
2
+ * surveyjs - Survey JavaScript library v1.12.20
3
3
  * Copyright (c) 2015-2025 Devsoft Baltic OÜ - http://surveyjs.io/
4
4
  * License: MIT (http://www.opensource.org/licenses/mit-license.php)
5
5
  */
@@ -8694,8 +8694,15 @@ var base_Base = /** @class */ (function () {
8694
8694
  if (!!calcFunc) {
8695
8695
  var newVal = calcFunc();
8696
8696
  if (newVal !== undefined) {
8697
- this.setPropertyValueDirectly(name, newVal);
8698
- return newVal;
8697
+ if (Array.isArray(newVal)) {
8698
+ var array = this.createNewArray(name);
8699
+ array.splice.apply(array, base_spreadArray([0, 0], newVal));
8700
+ return array;
8701
+ }
8702
+ else {
8703
+ this.setPropertyValueDirectly(name, newVal);
8704
+ return newVal;
8705
+ }
8699
8706
  }
8700
8707
  }
8701
8708
  var propDefaultValue = this.getDefaultPropertyValue(name);
@@ -17808,7 +17815,7 @@ var question_Question = /** @class */ (function (_super) {
17808
17815
  this.ensureSetValueExpressionRunner();
17809
17816
  if (!this.setValueExpressionRunner)
17810
17817
  return false;
17811
- return new conditionProcessValue_ProcessValue().isAnyKeyChanged(keys, this.setValueExpressionRunner.getVariables());
17818
+ return this.canExecuteTriggerByKeys(keys, this.setValueExpressionRunner);
17812
17819
  };
17813
17820
  Question.prototype.addTriggerInfo = function (name, canRun, doComplete) {
17814
17821
  var info = new TriggerExpressionInfo(name, canRun, doComplete);
@@ -17835,11 +17842,17 @@ var question_Question = /** @class */ (function (_super) {
17835
17842
  else {
17836
17843
  info.runner.expression = expression;
17837
17844
  }
17838
- if (!new conditionProcessValue_ProcessValue().isAnyKeyChanged(keys, info.runner.getVariables()) && !info.runSecondCheck(keys))
17845
+ if (!this.canExecuteTriggerByKeys(keys, info.runner) && !info.runSecondCheck(keys))
17839
17846
  return;
17840
17847
  info.isRunning = true;
17841
17848
  info.runner.run(this.getDataFilteredValues(), this.getDataFilteredProperties());
17842
17849
  };
17850
+ Question.prototype.canExecuteTriggerByKeys = function (keys, runner) {
17851
+ var vars = runner.getVariables();
17852
+ if ((!vars || vars.length === 0) && runner.hasFunction())
17853
+ return true;
17854
+ return new conditionProcessValue_ProcessValue().isAnyKeyChanged(keys, vars);
17855
+ };
17843
17856
  Question.prototype.runTriggers = function (name, value, keys) {
17844
17857
  var _this = this;
17845
17858
  if (this.isSettingQuestionValue || (this.parentQuestion && this.parentQuestion.getValueName() === name))
@@ -26321,6 +26334,9 @@ var question_matrixdropdownrendered_QuestionMatrixDropdownRenderedTable = /** @c
26321
26334
  },
26322
26335
  getEnterOptions: function (_, info) {
26323
26336
  return { cssClass: _this.cssClasses.rowEnter, onBeforeRunAnimation: onBeforeRunAnimation, onAfterRunAnimation: onAfterRunAnimation };
26337
+ },
26338
+ getKey: function (item) {
26339
+ return item.id;
26324
26340
  }
26325
26341
  };
26326
26342
  };
@@ -38361,11 +38377,6 @@ function createTOCListModel(survey, onAction) {
38361
38377
  var items = getTOCItems(survey, onAction);
38362
38378
  var listOptions = {
38363
38379
  items: items,
38364
- onSelectionChanged: function (item) {
38365
- if (!!item.action()) {
38366
- listModel.selectedItem = item;
38367
- }
38368
- },
38369
38380
  searchEnabled: false,
38370
38381
  locOwner: survey,
38371
38382
  };
@@ -38398,7 +38409,6 @@ function getTOCItems(survey, onAction) {
38398
38409
  if (page.isPage) {
38399
38410
  return survey.tryNavigateToPage(page);
38400
38411
  }
38401
- return tryFocusPage(survey, page);
38402
38412
  },
38403
38413
  visible: new ComputedUpdater(function () {
38404
38414
  return page.isVisible && !(page["isStartPage"]);
@@ -42278,7 +42288,17 @@ var survey_SurveyModel = /** @class */ (function (_super) {
42278
42288
  enumerable: false,
42279
42289
  configurable: true
42280
42290
  });
42281
- SurveyModel.prototype.tryNavigateToPage = function (page) {
42291
+ SurveyModel.prototype.tryNavigateToPage = function (page /*, serverValidationRes?: (res: boolean)=> void*/) {
42292
+ if (!this.performValidationOnPageChanging(page))
42293
+ return false;
42294
+ var index = this.visiblePages.indexOf(page);
42295
+ var res = index < this.currentPageNo || !this.doServerValidation(false, false, page);
42296
+ if (res) {
42297
+ this.currentPage = page;
42298
+ }
42299
+ return res;
42300
+ };
42301
+ SurveyModel.prototype.performValidationOnPageChanging = function (page) {
42282
42302
  if (this.isDesignMode)
42283
42303
  return false;
42284
42304
  var index = this.visiblePages.indexOf(page);
@@ -42286,10 +42306,8 @@ var survey_SurveyModel = /** @class */ (function (_super) {
42286
42306
  return false;
42287
42307
  if (index === this.currentPageNo)
42288
42308
  return false;
42289
- if (index < this.currentPageNo || this.checkErrorsMode === "onComplete" || this.validationAllowSwitchPages) {
42290
- this.currentPageNo = index;
42309
+ if (index < this.currentPageNo || this.checkErrorsMode === "onComplete" || this.validationAllowSwitchPages)
42291
42310
  return true;
42292
- }
42293
42311
  if (!this.validateCurrentPage())
42294
42312
  return false;
42295
42313
  for (var i = this.currentPageNo + 1; i < index; i++) {
@@ -42298,7 +42316,6 @@ var survey_SurveyModel = /** @class */ (function (_super) {
42298
42316
  return false;
42299
42317
  page_1.passed = true;
42300
42318
  }
42301
- this.currentPage = page;
42302
42319
  return true;
42303
42320
  };
42304
42321
  SurveyModel.prototype.updateCurrentPage = function () {
@@ -43841,14 +43858,14 @@ var survey_SurveyModel = /** @class */ (function (_super) {
43841
43858
  this.setPropertyValue("isValidatingOnServer", val);
43842
43859
  this.onIsValidatingOnServerChanged();
43843
43860
  };
43844
- SurveyModel.prototype.createServerValidationOptions = function (doComplete, isPreview) {
43861
+ SurveyModel.prototype.createServerValidationOptions = function (doComplete, isPreview, page) {
43845
43862
  var self = this;
43846
43863
  var options = {
43847
43864
  data: {},
43848
43865
  errors: {},
43849
43866
  survey: this,
43850
43867
  complete: function () {
43851
- self.completeServerValidation(options, isPreview);
43868
+ self.completeServerValidation(options, isPreview, page);
43852
43869
  },
43853
43870
  };
43854
43871
  if (doComplete && this.isValidateOnComplete) {
@@ -43868,7 +43885,7 @@ var survey_SurveyModel = /** @class */ (function (_super) {
43868
43885
  return options;
43869
43886
  };
43870
43887
  SurveyModel.prototype.onIsValidatingOnServerChanged = function () { };
43871
- SurveyModel.prototype.doServerValidation = function (doComplete, isPreview) {
43888
+ SurveyModel.prototype.doServerValidation = function (doComplete, isPreview, page) {
43872
43889
  var _this = this;
43873
43890
  if (isPreview === void 0) { isPreview = false; }
43874
43891
  if (!this.onServerValidateQuestions ||
@@ -43880,14 +43897,14 @@ var survey_SurveyModel = /** @class */ (function (_super) {
43880
43897
  var isFunc = typeof this.onServerValidateQuestions === "function";
43881
43898
  this.serverValidationEventCount = !isFunc ? this.onServerValidateQuestions.length : 1;
43882
43899
  if (isFunc) {
43883
- this.onServerValidateQuestions(this, this.createServerValidationOptions(doComplete, isPreview));
43900
+ this.onServerValidateQuestions(this, this.createServerValidationOptions(doComplete, isPreview, page));
43884
43901
  }
43885
43902
  else {
43886
- this.onServerValidateQuestions.fireByCreatingOptions(this, function () { return _this.createServerValidationOptions(doComplete, isPreview); });
43903
+ this.onServerValidateQuestions.fireByCreatingOptions(this, function () { return _this.createServerValidationOptions(doComplete, isPreview, page); });
43887
43904
  }
43888
43905
  return true;
43889
43906
  };
43890
- SurveyModel.prototype.completeServerValidation = function (options, isPreview) {
43907
+ SurveyModel.prototype.completeServerValidation = function (options, isPreview, page) {
43891
43908
  if (this.serverValidationEventCount > 1) {
43892
43909
  this.serverValidationEventCount--;
43893
43910
  if (!!options && !!options.errors && Object.keys(options.errors).length === 0)
@@ -43922,10 +43939,15 @@ var survey_SurveyModel = /** @class */ (function (_super) {
43922
43939
  this.showPreviewCore();
43923
43940
  }
43924
43941
  else {
43925
- if (self.isLastPage)
43926
- self.doComplete();
43927
- else
43928
- self.doNextPage();
43942
+ if (page) {
43943
+ this.currentPage = page;
43944
+ }
43945
+ else {
43946
+ if (self.isLastPage)
43947
+ self.doComplete();
43948
+ else
43949
+ self.doNextPage();
43950
+ }
43929
43951
  }
43930
43952
  }
43931
43953
  };
@@ -53790,6 +53812,11 @@ var question_text_QuestionTextModel = /** @class */ (function (_super) {
53790
53812
  this.setRenderedMinMax(values, properties);
53791
53813
  }
53792
53814
  };
53815
+ QuestionTextModel.prototype.getDisplayValueCore = function (keysAsText, value) {
53816
+ if (!this.maskTypeIsEmpty && !helpers_Helpers.isValueEmpty(value))
53817
+ return this.maskInstance.getMaskedValue(value);
53818
+ return _super.prototype.getDisplayValueCore.call(this, keysAsText, value);
53819
+ };
53793
53820
  QuestionTextModel.prototype.isLayoutTypeSupported = function (layoutType) {
53794
53821
  return true;
53795
53822
  };
@@ -61218,24 +61245,24 @@ var question_rating_QuestionRatingModel = /** @class */ (function (_super) {
61218
61245
  function QuestionRatingModel(name) {
61219
61246
  var _this = _super.call(this, name) || this;
61220
61247
  _this._syncPropertiesChanging = false;
61248
+ _this.iCounter = 0;
61221
61249
  _this.createItemValues("rateValues");
61222
- _this.createRenderedRateItems();
61223
61250
  _this.createLocalizableString("ratingOptionsCaption", _this, false, true);
61224
61251
  _this.registerFunctionOnPropertiesValueChanged(["rateMin", "rateMax",
61225
- "minRateDescription", "maxRateDescription", "rateStep", "displayRateDescriptionsAsExtremeItems"], function () { return _this.createRenderedRateItems(); });
61252
+ "minRateDescription", "maxRateDescription", "rateStep", "displayRateDescriptionsAsExtremeItems"], function () { return _this.resetRenderedItems(); });
61226
61253
  _this.registerFunctionOnPropertiesValueChanged(["rateType"], function () {
61227
61254
  _this.setIconsToRateValues();
61228
- _this.createRenderedRateItems();
61255
+ _this.resetRenderedItems();
61229
61256
  _this.updateRateCount();
61230
61257
  });
61231
61258
  _this.registerFunctionOnPropertiesValueChanged(["rateValues"], function () {
61232
61259
  _this.setIconsToRateValues();
61233
- _this.createRenderedRateItems();
61260
+ _this.resetRenderedItems();
61234
61261
  });
61235
61262
  _this.registerSychProperties(["rateValues"], function () {
61236
61263
  _this.autoGenerate = _this.rateValues.length == 0;
61237
61264
  _this.setIconsToRateValues();
61238
- _this.createRenderedRateItems();
61265
+ _this.resetRenderedItems();
61239
61266
  });
61240
61267
  _this.registerFunctionOnPropertiesValueChanged(["rateColorMode", "scaleColorMode"], function () {
61241
61268
  _this.updateColors(_this.survey.themeVariables);
@@ -61251,7 +61278,7 @@ var question_rating_QuestionRatingModel = /** @class */ (function (_super) {
61251
61278
  _this.rateValues.splice(0, _this.rateValues.length);
61252
61279
  _this.updateRateMax();
61253
61280
  }
61254
- _this.createRenderedRateItems();
61281
+ _this.resetRenderedItems();
61255
61282
  });
61256
61283
  _this.createLocalizableString("minRateDescription", _this, true)
61257
61284
  .onStringChanged.add(function (sender, options) {
@@ -61282,7 +61309,6 @@ var question_rating_QuestionRatingModel = /** @class */ (function (_super) {
61282
61309
  this.autoGenerate = !this.jsonObj.rateValues.length;
61283
61310
  this.updateRateCount();
61284
61311
  this.setIconsToRateValues();
61285
- this.createRenderedRateItems();
61286
61312
  };
61287
61313
  QuestionRatingModel.prototype.registerSychProperties = function (names, func) {
61288
61314
  var _this = this;
@@ -61386,7 +61412,6 @@ var question_rating_QuestionRatingModel = /** @class */ (function (_super) {
61386
61412
  },
61387
61413
  set: function (val) {
61388
61414
  this.setPropertyValue("rateValues", val);
61389
- this.createRenderedRateItems();
61390
61415
  },
61391
61416
  enumerable: false,
61392
61417
  configurable: true
@@ -61495,6 +61520,7 @@ var question_rating_QuestionRatingModel = /** @class */ (function (_super) {
61495
61520
  QuestionRatingModel.normalColorLight = getRGBColor("--sjs-special-yellow-light", "--sd-rating-normal-color-light");
61496
61521
  QuestionRatingModel.goodColorLight = getRGBColor("--sjs-special-green-light", "--sd-rating-good-color-light");
61497
61522
  this.colorsCalculated = true;
61523
+ this.resetRenderedItems();
61498
61524
  };
61499
61525
  QuestionRatingModel.prototype.getDisplayValueCore = function (keysAsText, value) {
61500
61526
  if (!this.useRateValues)
@@ -61515,22 +61541,55 @@ var question_rating_QuestionRatingModel = /** @class */ (function (_super) {
61515
61541
  this.autoGenerate = false;
61516
61542
  _super.prototype.itemValuePropertyChanged.call(this, item, name, oldValue, newValue);
61517
61543
  };
61518
- QuestionRatingModel.prototype.createRenderedRateItems = function () {
61519
- var _this = this;
61520
- var rateValues = [];
61521
- if (this.useRateValues()) {
61522
- rateValues = this.rateValues;
61544
+ QuestionRatingModel.prototype.runConditionCore = function (values, properties) {
61545
+ _super.prototype.runConditionCore.call(this, values, properties);
61546
+ this.runRateItesmCondition(values, properties);
61547
+ };
61548
+ QuestionRatingModel.prototype.runRateItesmCondition = function (values, properties) {
61549
+ var _a;
61550
+ if (!this.useRateValues())
61551
+ return;
61552
+ var isChanged = false;
61553
+ if ((_a = this.survey) === null || _a === void 0 ? void 0 : _a.areInvisibleElementsShowing) {
61554
+ this.rateValues.forEach(function (item) {
61555
+ isChanged = isChanged || !item.isVisible;
61556
+ item.setIsVisible(item, true);
61557
+ });
61523
61558
  }
61524
61559
  else {
61525
- rateValues = this.createRateValues();
61560
+ isChanged = itemvalue_ItemValue.runConditionsForItems(this.rateValues, undefined, undefined, values, properties, true);
61526
61561
  }
61527
- if (this.autoGenerate) {
61528
- this.rateMax = rateValues[rateValues.length - 1].value;
61562
+ if (isChanged) {
61563
+ this.resetRenderedItems();
61564
+ if (!this.isEmpty() && !this.isReadOnly) {
61565
+ var item = itemvalue_ItemValue.getItemByValue(this.rateValues, this.value);
61566
+ if (item && !item.isVisible) {
61567
+ this.clearValue();
61568
+ }
61569
+ }
61529
61570
  }
61571
+ };
61572
+ QuestionRatingModel.prototype.getRateValuesCore = function () {
61573
+ if (!this.useRateValues())
61574
+ return this.createRateValues();
61575
+ var items = new Array();
61576
+ this.rateValues.forEach(function (item) {
61577
+ if (item.isVisible) {
61578
+ items.push(item);
61579
+ }
61580
+ });
61581
+ return items;
61582
+ };
61583
+ QuestionRatingModel.prototype.calculateRateValues = function () {
61584
+ var rateValues = this.getRateValuesCore();
61530
61585
  if (this.rateType == "smileys" && rateValues.length > 10)
61531
61586
  rateValues = rateValues.slice(0, 10);
61532
- this.visibleChoicesValue = rateValues.map(function (i, idx) { return _this.getRatingItemValue(i, idx); });
61533
- this.renderedRateItems = rateValues.map(function (v, i) {
61587
+ return rateValues;
61588
+ };
61589
+ QuestionRatingModel.prototype.calculateRenderedRateItems = function () {
61590
+ var _this = this;
61591
+ var rateValues = this.calculateRateValues();
61592
+ return rateValues.map(function (v, i) {
61534
61593
  var renderedItem = null;
61535
61594
  if (_this.displayRateDescriptionsAsExtremeItems) {
61536
61595
  if (i == 0)
@@ -61543,6 +61602,39 @@ var question_rating_QuestionRatingModel = /** @class */ (function (_super) {
61543
61602
  return renderedItem;
61544
61603
  });
61545
61604
  };
61605
+ QuestionRatingModel.prototype.calculateVisibleChoices = function () {
61606
+ var _this = this;
61607
+ var rateValues = this.calculateRateValues();
61608
+ return rateValues.map(function (i, idx) { return _this.getRatingItemValue(i, idx); });
61609
+ };
61610
+ QuestionRatingModel.prototype.resetRenderedItems = function () {
61611
+ if (this.autoGenerate) {
61612
+ var rateValues = this.getRateValuesCore();
61613
+ this.rateMax = rateValues[rateValues.length - 1].value;
61614
+ }
61615
+ if (Array.isArray(this.getPropertyValueWithoutDefault("renderedRateItems"))) {
61616
+ this.setArrayPropertyDirectly("renderedRateItems", this.calculateRenderedRateItems());
61617
+ }
61618
+ if (Array.isArray(this.getPropertyValueWithoutDefault("visibleChoices"))) {
61619
+ this.setArrayPropertyDirectly("visibleChoices", this.calculateVisibleChoices);
61620
+ }
61621
+ };
61622
+ Object.defineProperty(QuestionRatingModel.prototype, "renderedRateItems", {
61623
+ get: function () {
61624
+ var _this = this;
61625
+ return this.getPropertyValue("renderedRateItems", undefined, function () { return _this.calculateRenderedRateItems(); });
61626
+ },
61627
+ enumerable: false,
61628
+ configurable: true
61629
+ });
61630
+ Object.defineProperty(QuestionRatingModel.prototype, "visibleChoices", {
61631
+ get: function () {
61632
+ var _this = this;
61633
+ return this.getPropertyValue("visibleChoices", undefined, function () { return _this.calculateVisibleChoices(); });
61634
+ },
61635
+ enumerable: false,
61636
+ configurable: true
61637
+ });
61546
61638
  QuestionRatingModel.prototype.createRateValues = function () {
61547
61639
  var res = [];
61548
61640
  var value = this.rateMin;
@@ -62016,13 +62108,6 @@ var question_rating_QuestionRatingModel = /** @class */ (function (_super) {
62016
62108
  QuestionRatingModel.prototype.isItemSelected = function (item) {
62017
62109
  return item.value == this.value;
62018
62110
  };
62019
- Object.defineProperty(QuestionRatingModel.prototype, "visibleChoices", {
62020
- get: function () {
62021
- return this.visibleChoicesValue;
62022
- },
62023
- enumerable: false,
62024
- configurable: true
62025
- });
62026
62111
  Object.defineProperty(QuestionRatingModel.prototype, "readOnlyText", {
62027
62112
  get: function () {
62028
62113
  if (this.readOnly)
@@ -62091,7 +62176,6 @@ var question_rating_QuestionRatingModel = /** @class */ (function (_super) {
62091
62176
  QuestionRatingModel.prototype.themeChanged = function (theme) {
62092
62177
  this.colorsCalculated = false;
62093
62178
  this.updateColors(theme.cssVariables);
62094
- this.createRenderedRateItems();
62095
62179
  };
62096
62180
  QuestionRatingModel.prototype.setSurveyImpl = function (value, isLight) {
62097
62181
  _super.prototype.setSurveyImpl.call(this, value, isLight);
@@ -62117,9 +62201,6 @@ var question_rating_QuestionRatingModel = /** @class */ (function (_super) {
62117
62201
  question_rating_decorate([
62118
62202
  jsonobject_property()
62119
62203
  ], QuestionRatingModel.prototype, "rateCount", void 0);
62120
- question_rating_decorate([
62121
- propertyArray()
62122
- ], QuestionRatingModel.prototype, "renderedRateItems", void 0);
62123
62204
  question_rating_decorate([
62124
62205
  jsonobject_property({ defaultValue: false })
62125
62206
  ], QuestionRatingModel.prototype, "hasMinRateDescription", void 0);
@@ -70827,9 +70908,9 @@ Serializer.addClass("currencymask", [
70827
70908
 
70828
70909
  var Version;
70829
70910
  var ReleaseDate;
70830
- Version = "" + "1.12.19";
70911
+ Version = "" + "1.12.20";
70831
70912
  settings.version = Version;
70832
- ReleaseDate = "" + "2025-01-15";
70913
+ ReleaseDate = "" + "2025-01-21";
70833
70914
  function checkLibraryVersion(ver, libraryName) {
70834
70915
  if (Version != ver) {
70835
70916
  var str = "survey-core has version '" + Version + "' and " + libraryName