survey-react 1.12.34 → 1.12.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/defaultV2.css CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - Survey JavaScript library v1.12.34
2
+ * surveyjs - Survey JavaScript library v1.12.36
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
  */
package/defaultV2.min.css CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - Survey JavaScript library v1.12.34
2
+ * surveyjs - Survey JavaScript library v1.12.36
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
  */
package/modern.css CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - Survey JavaScript library v1.12.34
2
+ * surveyjs - Survey JavaScript library v1.12.36
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
  */
package/modern.min.css CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - Survey JavaScript library v1.12.34
2
+ * surveyjs - Survey JavaScript library v1.12.36
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
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "survey-react",
3
- "version": "1.12.34",
3
+ "version": "1.12.36",
4
4
  "description": "survey.js is a JavaScript Survey Library. It is a modern way to add a survey to your website. It uses JSON for survey metadata and results.",
5
5
  "keywords": [
6
6
  "Survey",
package/survey.css CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - Survey JavaScript library v1.12.34
2
+ * surveyjs - Survey JavaScript library v1.12.36
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
  */
package/survey.min.css CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - Survey JavaScript library v1.12.34
2
+ * surveyjs - Survey JavaScript library v1.12.36
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
  */
package/survey.react.d.ts CHANGED
@@ -3387,6 +3387,7 @@ declare module "packages/survey-core/src/panel" {
3387
3387
  protected _scrollableParent: any;
3388
3388
  protected _updateVisibility: any;
3389
3389
  private get allowRendering();
3390
+ private lazyRenderingTimeout;
3390
3391
  startLazyRendering(rowContainerDiv: HTMLElement, findScrollableContainer?: typeof findScrollableParent): void;
3391
3392
  ensureVisibility(): void;
3392
3393
  stopLazyRendering(): void;
@@ -9238,6 +9239,7 @@ declare module "packages/survey-core/src/question_text" {
9238
9239
  get maskInstance(): IInputMask;
9239
9240
  get inputValue(): string;
9240
9241
  set inputValue(val: string);
9242
+ protected convertToCorrectValue(val: any): any;
9241
9243
  protected onChangeQuestionValue(newValue: any): void;
9242
9244
  private updateInputValue;
9243
9245
  private hasToConvertToUTC;
@@ -17782,6 +17784,7 @@ declare module "packages/survey-core/src/question_checkbox" {
17782
17784
  set isAllSelected(val: boolean);
17783
17785
  toggleSelectAll(): void;
17784
17786
  protected allElementsSelected(): boolean;
17787
+ private isNoneItemsSelected;
17785
17788
  /**
17786
17789
  * Selects all choice items, except "Other" and "None".
17787
17790
  *
@@ -28214,6 +28217,7 @@ declare module "packages/survey-react-ui/src/row" {
28214
28217
  protected canRender(): boolean;
28215
28218
  protected renderElementContent(): React.JSX.Element;
28216
28219
  protected renderElement(): React.JSX.Element;
28220
+ private lazyRenderingTimeout;
28217
28221
  componentDidMount(): void;
28218
28222
  shouldComponentUpdate(nextProps: any, nextState: any): boolean;
28219
28223
  private stopLazyRendering;
package/survey.react.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - Survey JavaScript library v1.12.34
2
+ * surveyjs - Survey JavaScript library v1.12.36
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
  */
@@ -16071,7 +16071,7 @@ var getElement = function (element) {
16071
16071
  };
16072
16072
  function isElementVisible(element, threshold) {
16073
16073
  if (threshold === void 0) { threshold = 0; }
16074
- if (typeof settings.environment === "undefined") {
16074
+ if (typeof settings.environment === "undefined" || !element.offsetHeight) {
16075
16075
  return false;
16076
16076
  }
16077
16077
  var root = settings.environment.root;
@@ -27573,7 +27573,7 @@ var question_matrixdropdowncolumn_MatrixDropdownColumn = /** @class */ (function
27573
27573
  delete json["choices"];
27574
27574
  }
27575
27575
  delete json["itemComponent"];
27576
- if (this.jsonObj && json.type === "rating") {
27576
+ if (this.jsonObj && json.type === "rating" && this.isLoadingFromJson) {
27577
27577
  Object.keys(this.jsonObj).forEach(function (prop) {
27578
27578
  json[prop] = _this.jsonObj[prop];
27579
27579
  });
@@ -30653,6 +30653,7 @@ var question_matrixdropdownbase_QuestionMatrixDropdownModelBase = /** @class */
30653
30653
  if (!!rows) {
30654
30654
  rows.forEach(function (row) { return row.updateElementVisibility(); });
30655
30655
  }
30656
+ this.updateShowTableAndAddRow();
30656
30657
  };
30657
30658
  QuestionMatrixDropdownModelBase.prototype.shouldRunColumnExpression = function () {
30658
30659
  return false;
@@ -36493,7 +36494,7 @@ var panel_QuestionRowModel = /** @class */ (function (_super) {
36493
36494
  _this.stopLazyRendering();
36494
36495
  }
36495
36496
  };
36496
- setTimeout(function () {
36497
+ this.lazyRenderingTimeout = setTimeout(function () {
36497
36498
  if (!!_this._scrollableParent &&
36498
36499
  !!_this._scrollableParent.addEventListener) {
36499
36500
  _this._scrollableParent.addEventListener("scroll", _this._updateVisibility);
@@ -36513,6 +36514,7 @@ var panel_QuestionRowModel = /** @class */ (function (_super) {
36513
36514
  !!this._scrollableParent.removeEventListener) {
36514
36515
  this._scrollableParent.removeEventListener("scroll", this._updateVisibility);
36515
36516
  }
36517
+ clearTimeout(this.lazyRenderingTimeout);
36516
36518
  this._scrollableParent = undefined;
36517
36519
  this._updateVisibility = undefined;
36518
36520
  };
@@ -39834,7 +39836,7 @@ var page_PageModel = /** @class */ (function (_super) {
39834
39836
  if (this.randomizeElements(this.areQuestionsRandomized)) {
39835
39837
  var singleQuestion = (_a = this.survey) === null || _a === void 0 ? void 0 : _a.currentSingleElement;
39836
39838
  if ((singleQuestion === null || singleQuestion === void 0 ? void 0 : singleQuestion.page) === this) {
39837
- this.survey.currentSingleElement = this.elements[0];
39839
+ this.survey.currentSingleElement = this.getFirstVisibleElement();
39838
39840
  }
39839
39841
  }
39840
39842
  };
@@ -45451,8 +45453,13 @@ var survey_SurveyModel = /** @class */ (function (_super) {
45451
45453
  if (!this.currentPage && this.visiblePageCount > 0) {
45452
45454
  this.currentPage = this.visiblePages[0];
45453
45455
  }
45456
+ if (this.isShowingPreview) {
45457
+ this.pages.forEach(function (page) {
45458
+ page.onFirstRendering();
45459
+ });
45460
+ }
45454
45461
  this.pages.forEach(function (page) {
45455
- if (page.hasShown) {
45462
+ if (page.wasRendered) {
45456
45463
  page.updateElementCss(true);
45457
45464
  }
45458
45465
  });
@@ -46876,8 +46883,11 @@ var survey_SurveyModel = /** @class */ (function (_super) {
46876
46883
  if (visibleOnly === void 0) { visibleOnly = false; }
46877
46884
  if (includeDesignTime === void 0) { includeDesignTime = false; }
46878
46885
  if (includeNested === void 0) { includeNested = false; }
46879
- if (includeNested)
46886
+ if (includeNested) {
46880
46887
  includeDesignTime = false;
46888
+ var pages = visibleOnly ? this.visiblePages : this.pages;
46889
+ pages.forEach(function (page) { return page.onFirstRendering(); });
46890
+ }
46881
46891
  var res = [];
46882
46892
  for (var i = 0; i < this.pages.length; i++) {
46883
46893
  this.pages[i].addQuestionsToList(res, visibleOnly, includeDesignTime);
@@ -48938,9 +48948,9 @@ var survey_SurveyModel = /** @class */ (function (_super) {
48938
48948
  var isNeedWaitForPageRendered = this.activePage !== question.page && !question.page.isStartPage;
48939
48949
  if (isNeedWaitForPageRendered) {
48940
48950
  this.currentPage = question.page;
48941
- if (this.isSingleVisibleQuestion && !this.isDesignMode) {
48942
- this.currentSingleElement = question;
48943
- }
48951
+ }
48952
+ if (this.isSingleVisibleQuestion && !this.isDesignMode) {
48953
+ this.currentSingleElement = question;
48944
48954
  }
48945
48955
  if (!isNeedWaitForPageRendered) {
48946
48956
  this.focusQuestionInfo();
@@ -56102,7 +56112,7 @@ var question_text_QuestionTextModel = /** @class */ (function (_super) {
56102
56112
  value = this.maskInstance.getUnmaskedValue(val);
56103
56113
  this._inputValue = this.maskInstance.getMaskedValue(value);
56104
56114
  if (!!value && this.maskSettings.saveMaskedValue) {
56105
- value = this.maskInstance.getMaskedValue(value);
56115
+ value = this._inputValue;
56106
56116
  }
56107
56117
  }
56108
56118
  this.value = value;
@@ -56110,19 +56120,26 @@ var question_text_QuestionTextModel = /** @class */ (function (_super) {
56110
56120
  enumerable: false,
56111
56121
  configurable: true
56112
56122
  });
56123
+ QuestionTextModel.prototype.convertToCorrectValue = function (val) {
56124
+ if (val !== undefined && val !== null && typeof val !== "string" && !this.maskTypeIsEmpty && this.maskSettings.saveMaskedValue) {
56125
+ return this.maskInstance.getMaskedValue(val);
56126
+ }
56127
+ return _super.prototype.convertToCorrectValue.call(this, val);
56128
+ };
56113
56129
  QuestionTextModel.prototype.onChangeQuestionValue = function (newValue) {
56114
56130
  _super.prototype.onChangeQuestionValue.call(this, newValue);
56115
56131
  this.updateInputValue();
56116
56132
  };
56117
56133
  QuestionTextModel.prototype.updateInputValue = function () {
56134
+ var _value = this.value;
56118
56135
  if (this.maskTypeIsEmpty) {
56119
- this._inputValue = this.value;
56136
+ this._inputValue = _value;
56120
56137
  }
56121
56138
  else if (this.maskSettings.saveMaskedValue) {
56122
- this._inputValue = !!this.value ? this.value : this.maskInstance.getMaskedValue("");
56139
+ this._inputValue = (_value !== undefined && _value !== null) ? _value : this.maskInstance.getMaskedValue("");
56123
56140
  }
56124
56141
  else {
56125
- this._inputValue = this.maskInstance.getMaskedValue(this.value);
56142
+ this._inputValue = this.maskInstance.getMaskedValue(_value);
56126
56143
  }
56127
56144
  };
56128
56145
  QuestionTextModel.prototype.hasToConvertToUTC = function (val) {
@@ -58374,11 +58391,8 @@ var question_checkbox_QuestionCheckboxModel = /** @class */ (function (_super) {
58374
58391
  this.isAllSelected = !this.isAllSelected;
58375
58392
  };
58376
58393
  QuestionCheckboxModel.prototype.allElementsSelected = function () {
58377
- var noneItems = this.getNoneItems();
58378
- for (var i = 0; i < noneItems.length; i++) {
58379
- if (this.isItemSelected(noneItems[i]))
58380
- return false;
58381
- }
58394
+ if (this.isNoneItemsSelected())
58395
+ return false;
58382
58396
  var items = this.getVisibleEnableItems();
58383
58397
  if (items.length === 0)
58384
58398
  return false;
@@ -58397,6 +58411,14 @@ var question_checkbox_QuestionCheckboxModel = /** @class */ (function (_super) {
58397
58411
  }
58398
58412
  return true;
58399
58413
  };
58414
+ QuestionCheckboxModel.prototype.isNoneItemsSelected = function () {
58415
+ var noneItems = this.getNoneItems();
58416
+ for (var i = 0; i < noneItems.length; i++) {
58417
+ if (this.isItemSelected(noneItems[i]))
58418
+ return true;
58419
+ }
58420
+ return false;
58421
+ };
58400
58422
  /**
58401
58423
  * Selects all choice items, except "Other" and "None".
58402
58424
  *
@@ -58597,7 +58619,7 @@ var question_checkbox_QuestionCheckboxModel = /** @class */ (function (_super) {
58597
58619
  _super.prototype.onCheckForErrors.call(this, errors, isOnValueChanged, fireCallback);
58598
58620
  if (isOnValueChanged)
58599
58621
  return;
58600
- if (this.minSelectedChoices > 0 && this.checkMinSelectedChoicesUnreached()) {
58622
+ if (this.checkMinSelectedChoicesUnreached()) {
58601
58623
  var minError = new CustomError(this.getLocalizationFormatString("minSelectError", this.minSelectedChoices), this);
58602
58624
  errors.push(minError);
58603
58625
  }
@@ -58658,6 +58680,8 @@ var question_checkbox_QuestionCheckboxModel = /** @class */ (function (_super) {
58658
58680
  return false;
58659
58681
  var val = this.value;
58660
58682
  var len = !Array.isArray(val) ? 0 : val.length;
58683
+ if (len === 1 && this.isNoneItemsSelected())
58684
+ return false;
58661
58685
  return len < this.minSelectedChoices;
58662
58686
  };
58663
58687
  QuestionCheckboxModel.prototype.getItemClassCore = function (item, options) {
@@ -73069,9 +73093,9 @@ Serializer.addClass("currencymask", [
73069
73093
 
73070
73094
  var Version;
73071
73095
  var ReleaseDate;
73072
- Version = "" + "1.12.34";
73096
+ Version = "" + "1.12.36";
73073
73097
  settings.version = Version;
73074
- ReleaseDate = "" + "2025-04-29";
73098
+ ReleaseDate = "" + "2025-05-13";
73075
73099
  function checkLibraryVersion(ver, libraryName) {
73076
73100
  if (Version != ver) {
73077
73101
  var str = "survey-core has version '" + Version + "' and " + libraryName
@@ -83901,7 +83925,7 @@ var row_SurveyRow = /** @class */ (function (_super) {
83901
83925
  }
83902
83926
  if (!!el && !this.row.isNeedRender) {
83903
83927
  var rowContainerDiv = el;
83904
- setTimeout(function () {
83928
+ this.lazyRenderingTimeout = setTimeout(function () {
83905
83929
  _this.row.startLazyRendering(rowContainerDiv);
83906
83930
  }, 10);
83907
83931
  }
@@ -83919,12 +83943,14 @@ var row_SurveyRow = /** @class */ (function (_super) {
83919
83943
  return true;
83920
83944
  };
83921
83945
  SurveyRow.prototype.stopLazyRendering = function () {
83946
+ clearTimeout(this.lazyRenderingTimeout);
83922
83947
  this.row.stopLazyRendering();
83923
83948
  this.row.isNeedRender = !this.row.isLazyRendering();
83924
83949
  };
83925
83950
  SurveyRow.prototype.componentWillUnmount = function () {
83951
+ var isCurrentStateElement = this.isCurrentStateElement(this.getStateElement());
83926
83952
  _super.prototype.componentWillUnmount.call(this);
83927
- if (this.isCurrentStateElement(this.getStateElement())) {
83953
+ if (isCurrentStateElement) {
83928
83954
  this.row.setRootElement(undefined);
83929
83955
  this.stopLazyRendering();
83930
83956
  }