survey-core 1.12.18 → 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 +166 -63
  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 +3 -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 +3 -1
package/survey.core.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - Survey JavaScript library v1.12.18
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
  };
@@ -27088,6 +27104,7 @@ var question_matrixdropdownrendered_QuestionMatrixDropdownRenderedTable = /** @c
27088
27104
  var res = new question_matrixdropdownrendered_QuestionMatrixDropdownRenderedCell();
27089
27105
  res.cell = cell;
27090
27106
  res.row = cell.row;
27107
+ res.column = cell.column;
27091
27108
  res.question = cell.question;
27092
27109
  res.matrix = this.matrix;
27093
27110
  res.item = choiceItem;
@@ -36183,8 +36200,10 @@ var panel_PanelModelBase = /** @class */ (function (_super) {
36183
36200
  PanelModelBase.prototype.onElementStartWithNewLineChanged = function (element) {
36184
36201
  if (this.locCountRowUpdates > 0)
36185
36202
  return;
36203
+ this.blockAnimations();
36186
36204
  this.updateRowsBeforeElementRemoved(element);
36187
36205
  this.updateRowsOnElementAdded(element);
36206
+ this.releaseAnimations();
36188
36207
  };
36189
36208
  PanelModelBase.prototype.updateRowsVisibility = function (element) {
36190
36209
  var rows = this.rows;
@@ -38358,11 +38377,6 @@ function createTOCListModel(survey, onAction) {
38358
38377
  var items = getTOCItems(survey, onAction);
38359
38378
  var listOptions = {
38360
38379
  items: items,
38361
- onSelectionChanged: function (item) {
38362
- if (!!item.action()) {
38363
- listModel.selectedItem = item;
38364
- }
38365
- },
38366
38380
  searchEnabled: false,
38367
38381
  locOwner: survey,
38368
38382
  };
@@ -38395,7 +38409,6 @@ function getTOCItems(survey, onAction) {
38395
38409
  if (page.isPage) {
38396
38410
  return survey.tryNavigateToPage(page);
38397
38411
  }
38398
- return tryFocusPage(survey, page);
38399
38412
  },
38400
38413
  visible: new ComputedUpdater(function () {
38401
38414
  return page.isVisible && !(page["isStartPage"]);
@@ -42275,7 +42288,17 @@ var survey_SurveyModel = /** @class */ (function (_super) {
42275
42288
  enumerable: false,
42276
42289
  configurable: true
42277
42290
  });
42278
- 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) {
42279
42302
  if (this.isDesignMode)
42280
42303
  return false;
42281
42304
  var index = this.visiblePages.indexOf(page);
@@ -42283,10 +42306,8 @@ var survey_SurveyModel = /** @class */ (function (_super) {
42283
42306
  return false;
42284
42307
  if (index === this.currentPageNo)
42285
42308
  return false;
42286
- if (index < this.currentPageNo || this.checkErrorsMode === "onComplete" || this.validationAllowSwitchPages) {
42287
- this.currentPageNo = index;
42309
+ if (index < this.currentPageNo || this.checkErrorsMode === "onComplete" || this.validationAllowSwitchPages)
42288
42310
  return true;
42289
- }
42290
42311
  if (!this.validateCurrentPage())
42291
42312
  return false;
42292
42313
  for (var i = this.currentPageNo + 1; i < index; i++) {
@@ -42295,7 +42316,6 @@ var survey_SurveyModel = /** @class */ (function (_super) {
42295
42316
  return false;
42296
42317
  page_1.passed = true;
42297
42318
  }
42298
- this.currentPage = page;
42299
42319
  return true;
42300
42320
  };
42301
42321
  SurveyModel.prototype.updateCurrentPage = function () {
@@ -43838,14 +43858,14 @@ var survey_SurveyModel = /** @class */ (function (_super) {
43838
43858
  this.setPropertyValue("isValidatingOnServer", val);
43839
43859
  this.onIsValidatingOnServerChanged();
43840
43860
  };
43841
- SurveyModel.prototype.createServerValidationOptions = function (doComplete, isPreview) {
43861
+ SurveyModel.prototype.createServerValidationOptions = function (doComplete, isPreview, page) {
43842
43862
  var self = this;
43843
43863
  var options = {
43844
43864
  data: {},
43845
43865
  errors: {},
43846
43866
  survey: this,
43847
43867
  complete: function () {
43848
- self.completeServerValidation(options, isPreview);
43868
+ self.completeServerValidation(options, isPreview, page);
43849
43869
  },
43850
43870
  };
43851
43871
  if (doComplete && this.isValidateOnComplete) {
@@ -43865,7 +43885,7 @@ var survey_SurveyModel = /** @class */ (function (_super) {
43865
43885
  return options;
43866
43886
  };
43867
43887
  SurveyModel.prototype.onIsValidatingOnServerChanged = function () { };
43868
- SurveyModel.prototype.doServerValidation = function (doComplete, isPreview) {
43888
+ SurveyModel.prototype.doServerValidation = function (doComplete, isPreview, page) {
43869
43889
  var _this = this;
43870
43890
  if (isPreview === void 0) { isPreview = false; }
43871
43891
  if (!this.onServerValidateQuestions ||
@@ -43877,14 +43897,14 @@ var survey_SurveyModel = /** @class */ (function (_super) {
43877
43897
  var isFunc = typeof this.onServerValidateQuestions === "function";
43878
43898
  this.serverValidationEventCount = !isFunc ? this.onServerValidateQuestions.length : 1;
43879
43899
  if (isFunc) {
43880
- this.onServerValidateQuestions(this, this.createServerValidationOptions(doComplete, isPreview));
43900
+ this.onServerValidateQuestions(this, this.createServerValidationOptions(doComplete, isPreview, page));
43881
43901
  }
43882
43902
  else {
43883
- this.onServerValidateQuestions.fireByCreatingOptions(this, function () { return _this.createServerValidationOptions(doComplete, isPreview); });
43903
+ this.onServerValidateQuestions.fireByCreatingOptions(this, function () { return _this.createServerValidationOptions(doComplete, isPreview, page); });
43884
43904
  }
43885
43905
  return true;
43886
43906
  };
43887
- SurveyModel.prototype.completeServerValidation = function (options, isPreview) {
43907
+ SurveyModel.prototype.completeServerValidation = function (options, isPreview, page) {
43888
43908
  if (this.serverValidationEventCount > 1) {
43889
43909
  this.serverValidationEventCount--;
43890
43910
  if (!!options && !!options.errors && Object.keys(options.errors).length === 0)
@@ -43919,10 +43939,15 @@ var survey_SurveyModel = /** @class */ (function (_super) {
43919
43939
  this.showPreviewCore();
43920
43940
  }
43921
43941
  else {
43922
- if (self.isLastPage)
43923
- self.doComplete();
43924
- else
43925
- 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
+ }
43926
43951
  }
43927
43952
  }
43928
43953
  };
@@ -45907,6 +45932,22 @@ var survey_SurveyModel = /** @class */ (function (_super) {
45907
45932
  return;
45908
45933
  if (!question.validate(false) && !question.supportGoNextPageError())
45909
45934
  return;
45935
+ if (!!this.currentSingleQuestion) {
45936
+ var curQuestion_1 = this.currentSingleQuestion;
45937
+ var goNextQuestion = function () {
45938
+ if (curQuestion_1 !== _this.currentSingleQuestion)
45939
+ return;
45940
+ if (!_this.isLastElement) {
45941
+ _this.performNext();
45942
+ }
45943
+ else {
45944
+ if (_this.allowCompleteSurveyAutomatic) {
45945
+ _this.tryCompleteOrShowPreview();
45946
+ }
45947
+ }
45948
+ };
45949
+ surveyTimerFunctions.safeTimeOut(goNextQuestion, settings.autoAdvanceDelay);
45950
+ }
45910
45951
  var questions = this.getCurrentPageQuestions();
45911
45952
  if (questions.indexOf(question) < 0)
45912
45953
  return;
@@ -45926,16 +45967,19 @@ var survey_SurveyModel = /** @class */ (function (_super) {
45926
45967
  _this.nextPage();
45927
45968
  }
45928
45969
  else {
45929
- if (_this.isShowPreviewBeforeComplete) {
45930
- _this.showPreview();
45931
- }
45932
- else {
45933
- _this.tryComplete();
45934
- }
45970
+ _this.tryCompleteOrShowPreview();
45935
45971
  }
45936
45972
  };
45937
45973
  surveyTimerFunctions.safeTimeOut(goNextPage, settings.autoAdvanceDelay);
45938
45974
  };
45975
+ SurveyModel.prototype.tryCompleteOrShowPreview = function () {
45976
+ if (this.isShowPreviewBeforeComplete) {
45977
+ this.showPreview();
45978
+ }
45979
+ else {
45980
+ this.tryComplete();
45981
+ }
45982
+ };
45939
45983
  /**
45940
45984
  * Returns a comment value from a question with a specified `name`.
45941
45985
  * @param name A question name.
@@ -53768,6 +53812,11 @@ var question_text_QuestionTextModel = /** @class */ (function (_super) {
53768
53812
  this.setRenderedMinMax(values, properties);
53769
53813
  }
53770
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
+ };
53771
53820
  QuestionTextModel.prototype.isLayoutTypeSupported = function (layoutType) {
53772
53821
  return true;
53773
53822
  };
@@ -61196,24 +61245,24 @@ var question_rating_QuestionRatingModel = /** @class */ (function (_super) {
61196
61245
  function QuestionRatingModel(name) {
61197
61246
  var _this = _super.call(this, name) || this;
61198
61247
  _this._syncPropertiesChanging = false;
61248
+ _this.iCounter = 0;
61199
61249
  _this.createItemValues("rateValues");
61200
- _this.createRenderedRateItems();
61201
61250
  _this.createLocalizableString("ratingOptionsCaption", _this, false, true);
61202
61251
  _this.registerFunctionOnPropertiesValueChanged(["rateMin", "rateMax",
61203
- "minRateDescription", "maxRateDescription", "rateStep", "displayRateDescriptionsAsExtremeItems"], function () { return _this.createRenderedRateItems(); });
61252
+ "minRateDescription", "maxRateDescription", "rateStep", "displayRateDescriptionsAsExtremeItems"], function () { return _this.resetRenderedItems(); });
61204
61253
  _this.registerFunctionOnPropertiesValueChanged(["rateType"], function () {
61205
61254
  _this.setIconsToRateValues();
61206
- _this.createRenderedRateItems();
61255
+ _this.resetRenderedItems();
61207
61256
  _this.updateRateCount();
61208
61257
  });
61209
61258
  _this.registerFunctionOnPropertiesValueChanged(["rateValues"], function () {
61210
61259
  _this.setIconsToRateValues();
61211
- _this.createRenderedRateItems();
61260
+ _this.resetRenderedItems();
61212
61261
  });
61213
61262
  _this.registerSychProperties(["rateValues"], function () {
61214
61263
  _this.autoGenerate = _this.rateValues.length == 0;
61215
61264
  _this.setIconsToRateValues();
61216
- _this.createRenderedRateItems();
61265
+ _this.resetRenderedItems();
61217
61266
  });
61218
61267
  _this.registerFunctionOnPropertiesValueChanged(["rateColorMode", "scaleColorMode"], function () {
61219
61268
  _this.updateColors(_this.survey.themeVariables);
@@ -61229,7 +61278,7 @@ var question_rating_QuestionRatingModel = /** @class */ (function (_super) {
61229
61278
  _this.rateValues.splice(0, _this.rateValues.length);
61230
61279
  _this.updateRateMax();
61231
61280
  }
61232
- _this.createRenderedRateItems();
61281
+ _this.resetRenderedItems();
61233
61282
  });
61234
61283
  _this.createLocalizableString("minRateDescription", _this, true)
61235
61284
  .onStringChanged.add(function (sender, options) {
@@ -61260,7 +61309,6 @@ var question_rating_QuestionRatingModel = /** @class */ (function (_super) {
61260
61309
  this.autoGenerate = !this.jsonObj.rateValues.length;
61261
61310
  this.updateRateCount();
61262
61311
  this.setIconsToRateValues();
61263
- this.createRenderedRateItems();
61264
61312
  };
61265
61313
  QuestionRatingModel.prototype.registerSychProperties = function (names, func) {
61266
61314
  var _this = this;
@@ -61364,7 +61412,6 @@ var question_rating_QuestionRatingModel = /** @class */ (function (_super) {
61364
61412
  },
61365
61413
  set: function (val) {
61366
61414
  this.setPropertyValue("rateValues", val);
61367
- this.createRenderedRateItems();
61368
61415
  },
61369
61416
  enumerable: false,
61370
61417
  configurable: true
@@ -61473,6 +61520,7 @@ var question_rating_QuestionRatingModel = /** @class */ (function (_super) {
61473
61520
  QuestionRatingModel.normalColorLight = getRGBColor("--sjs-special-yellow-light", "--sd-rating-normal-color-light");
61474
61521
  QuestionRatingModel.goodColorLight = getRGBColor("--sjs-special-green-light", "--sd-rating-good-color-light");
61475
61522
  this.colorsCalculated = true;
61523
+ this.resetRenderedItems();
61476
61524
  };
61477
61525
  QuestionRatingModel.prototype.getDisplayValueCore = function (keysAsText, value) {
61478
61526
  if (!this.useRateValues)
@@ -61493,22 +61541,55 @@ var question_rating_QuestionRatingModel = /** @class */ (function (_super) {
61493
61541
  this.autoGenerate = false;
61494
61542
  _super.prototype.itemValuePropertyChanged.call(this, item, name, oldValue, newValue);
61495
61543
  };
61496
- QuestionRatingModel.prototype.createRenderedRateItems = function () {
61497
- var _this = this;
61498
- var rateValues = [];
61499
- if (this.useRateValues()) {
61500
- 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
+ });
61501
61558
  }
61502
61559
  else {
61503
- rateValues = this.createRateValues();
61560
+ isChanged = itemvalue_ItemValue.runConditionsForItems(this.rateValues, undefined, undefined, values, properties, true);
61504
61561
  }
61505
- if (this.autoGenerate) {
61506
- 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
+ }
61507
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();
61508
61585
  if (this.rateType == "smileys" && rateValues.length > 10)
61509
61586
  rateValues = rateValues.slice(0, 10);
61510
- this.visibleChoicesValue = rateValues.map(function (i, idx) { return _this.getRatingItemValue(i, idx); });
61511
- 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) {
61512
61593
  var renderedItem = null;
61513
61594
  if (_this.displayRateDescriptionsAsExtremeItems) {
61514
61595
  if (i == 0)
@@ -61521,6 +61602,39 @@ var question_rating_QuestionRatingModel = /** @class */ (function (_super) {
61521
61602
  return renderedItem;
61522
61603
  });
61523
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
+ });
61524
61638
  QuestionRatingModel.prototype.createRateValues = function () {
61525
61639
  var res = [];
61526
61640
  var value = this.rateMin;
@@ -61994,13 +62108,6 @@ var question_rating_QuestionRatingModel = /** @class */ (function (_super) {
61994
62108
  QuestionRatingModel.prototype.isItemSelected = function (item) {
61995
62109
  return item.value == this.value;
61996
62110
  };
61997
- Object.defineProperty(QuestionRatingModel.prototype, "visibleChoices", {
61998
- get: function () {
61999
- return this.visibleChoicesValue;
62000
- },
62001
- enumerable: false,
62002
- configurable: true
62003
- });
62004
62111
  Object.defineProperty(QuestionRatingModel.prototype, "readOnlyText", {
62005
62112
  get: function () {
62006
62113
  if (this.readOnly)
@@ -62069,7 +62176,6 @@ var question_rating_QuestionRatingModel = /** @class */ (function (_super) {
62069
62176
  QuestionRatingModel.prototype.themeChanged = function (theme) {
62070
62177
  this.colorsCalculated = false;
62071
62178
  this.updateColors(theme.cssVariables);
62072
- this.createRenderedRateItems();
62073
62179
  };
62074
62180
  QuestionRatingModel.prototype.setSurveyImpl = function (value, isLight) {
62075
62181
  _super.prototype.setSurveyImpl.call(this, value, isLight);
@@ -62095,9 +62201,6 @@ var question_rating_QuestionRatingModel = /** @class */ (function (_super) {
62095
62201
  question_rating_decorate([
62096
62202
  jsonobject_property()
62097
62203
  ], QuestionRatingModel.prototype, "rateCount", void 0);
62098
- question_rating_decorate([
62099
- propertyArray()
62100
- ], QuestionRatingModel.prototype, "renderedRateItems", void 0);
62101
62204
  question_rating_decorate([
62102
62205
  jsonobject_property({ defaultValue: false })
62103
62206
  ], QuestionRatingModel.prototype, "hasMinRateDescription", void 0);
@@ -70805,9 +70908,9 @@ Serializer.addClass("currencymask", [
70805
70908
 
70806
70909
  var Version;
70807
70910
  var ReleaseDate;
70808
- Version = "" + "1.12.18";
70911
+ Version = "" + "1.12.20";
70809
70912
  settings.version = Version;
70810
- ReleaseDate = "" + "2025-01-10";
70913
+ ReleaseDate = "" + "2025-01-21";
70811
70914
  function checkLibraryVersion(ver, libraryName) {
70812
70915
  if (Version != ver) {
70813
70916
  var str = "survey-core has version '" + Version + "' and " + libraryName