survey-react-ui 2.0.0-rc.8 → 2.0.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "survey-react-ui",
3
- "version": "2.0.0-rc.8",
3
+ "version": "2.0.0",
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",
@@ -18,7 +18,7 @@
18
18
  "module": "fesm/survey-react-ui.js",
19
19
  "typings": "./typings/entries/index.d.ts",
20
20
  "peerDependencies": {
21
- "survey-core": "2.0.0-rc.8",
21
+ "survey-core": "2.0.0",
22
22
  "react": "^16.5.0 || ^17.0.1 || ^18.1.0 || ^19.0.0",
23
23
  "react-dom": "^16.5.0 || ^17.0.1 || ^18.1.0 || ^19.0.0"
24
24
  }
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - Survey JavaScript library v2.0.0-rc.8
2
+ * surveyjs - Survey JavaScript library v2.0.0
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
  */
@@ -28,7 +28,7 @@ __webpack_require__.r(__webpack_exports__);
28
28
  /* harmony export */ icons: () => (/* binding */ iconsV1)
29
29
  /* harmony export */ });
30
30
  /*!
31
- * surveyjs - Survey JavaScript library v2.0.0-rc.8
31
+ * surveyjs - Survey JavaScript library v2.0.0
32
32
  * Copyright (c) 2015-2025 Devsoft Baltic OÜ - http://surveyjs.io/
33
33
  * License: MIT (http://www.opensource.org/licenses/mit-license.php)
34
34
  */
@@ -112,7 +112,7 @@ __webpack_require__.r(__webpack_exports__);
112
112
  /* harmony export */ icons: () => (/* binding */ iconsV2)
113
113
  /* harmony export */ });
114
114
  /*!
115
- * surveyjs - Survey JavaScript library v2.0.0-rc.8
115
+ * surveyjs - Survey JavaScript library v2.0.0
116
116
  * Copyright (c) 2015-2025 Devsoft Baltic OÜ - http://surveyjs.io/
117
117
  * License: MIT (http://www.opensource.org/licenses/mit-license.php)
118
118
  */
@@ -866,9 +866,6 @@ var SurveyAction = /** @class */ (function (_super) {
866
866
  SurveyAction.prototype.getStateElement = function () {
867
867
  return this.item;
868
868
  };
869
- SurveyAction.prototype.shouldComponentUpdate = function (nextProps, nextState) {
870
- return _super.prototype.shouldComponentUpdate.call(this, nextProps, nextState);
871
- };
872
869
  SurveyAction.prototype.renderElement = function () {
873
870
  //refactor
874
871
  var itemClass = this.item.getActionRootCss();
@@ -5174,7 +5171,7 @@ var SurveyQuestionImagePicker = /** @class */ (function (_super) {
5174
5171
  });
5175
5172
  SurveyQuestionImagePicker.prototype.renderElement = function () {
5176
5173
  var cssClasses = this.question.cssClasses;
5177
- return (react__WEBPACK_IMPORTED_MODULE_0__.createElement("fieldset", { className: this.question.getSelectBaseRootCss() },
5174
+ return (react__WEBPACK_IMPORTED_MODULE_0__.createElement("fieldset", { className: this.question.getSelectBaseRootCss(), style: this.question.getContainerStyle() },
5178
5175
  react__WEBPACK_IMPORTED_MODULE_0__.createElement("legend", { className: "sv-hidden" }, this.question.locTitle.renderedHtml),
5179
5176
  this.question.hasColumns ? this.getColumns(cssClasses) : this.getItems(cssClasses)));
5180
5177
  };
@@ -5383,10 +5380,6 @@ var SurveyPage = /** @class */ (function (_super) {
5383
5380
  enumerable: false,
5384
5381
  configurable: true
5385
5382
  });
5386
- // shouldComponentUpdate(nextProps: any, nextState: any): boolean {
5387
- // if(!super.shouldComponentUpdate(nextProps, nextState)) return false;
5388
- // return true;
5389
- // }
5390
5383
  SurveyPage.prototype.renderElement = function () {
5391
5384
  var title = this.renderTitle();
5392
5385
  var description = this.renderDescription();
@@ -7716,6 +7709,21 @@ var SurveyElementBase = /** @class */ (function (_super) {
7716
7709
  var _this = _super.call(this, props) || this;
7717
7710
  _this._allowComponentUpdate = true;
7718
7711
  _this.prevStateElements = [];
7712
+ _this.propertyValueChangedHandler = function (hash, key, val) {
7713
+ if (hash[key] !== val) {
7714
+ hash[key] = val;
7715
+ if (!_this.canUsePropInState(key))
7716
+ return;
7717
+ if (_this.isRendering)
7718
+ return;
7719
+ _this.changedStatePropNameValue = key;
7720
+ _this.setState(function (state) {
7721
+ var newState = {};
7722
+ newState[key] = val;
7723
+ return newState;
7724
+ });
7725
+ }
7726
+ };
7719
7727
  return _this;
7720
7728
  }
7721
7729
  SurveyElementBase.renderLocString = function (locStr, style, key) {
@@ -7824,6 +7832,9 @@ var SurveyElementBase = /** @class */ (function (_super) {
7824
7832
  };
7825
7833
  SurveyElementBase.prototype.unMakeBaseElementsReact = function () {
7826
7834
  var els = this.getStateElements();
7835
+ this.unMakeBaseElementsReactive(els);
7836
+ };
7837
+ SurveyElementBase.prototype.unMakeBaseElementsReactive = function (els) {
7827
7838
  for (var i = 0; i < els.length; i++) {
7828
7839
  this.unMakeBaseElementReact(els[i]);
7829
7840
  }
@@ -7855,6 +7866,9 @@ var SurveyElementBase = /** @class */ (function (_super) {
7855
7866
  SurveyElementBase.prototype.canMakeReact = function (stateElement) {
7856
7867
  return !!stateElement && !!stateElement.iteratePropertiesHash;
7857
7868
  };
7869
+ SurveyElementBase.prototype.isCurrentStateElement = function (stateElement) {
7870
+ return !!stateElement && !!stateElement.setPropertyValueCoreHandler && stateElement.setPropertyValueCoreHandler === this.propertyValueChangedHandler;
7871
+ };
7858
7872
  SurveyElementBase.prototype.makeBaseElementReact = function (stateElement) {
7859
7873
  var _this = this;
7860
7874
  if (!this.canMakeReact(stateElement))
@@ -7877,21 +7891,7 @@ var SurveyElementBase = /** @class */ (function (_super) {
7877
7891
  };
7878
7892
  }
7879
7893
  });
7880
- stateElement.setPropertyValueCoreHandler = function (hash, key, val) {
7881
- if (hash[key] !== val) {
7882
- hash[key] = val;
7883
- if (!_this.canUsePropInState(key))
7884
- return;
7885
- if (_this.isRendering)
7886
- return;
7887
- _this.changedStatePropNameValue = key;
7888
- _this.setState(function (state) {
7889
- var newState = {};
7890
- newState[key] = val;
7891
- return newState;
7892
- });
7893
- }
7894
- };
7894
+ stateElement.setPropertyValueCoreHandler = this.propertyValueChangedHandler;
7895
7895
  };
7896
7896
  SurveyElementBase.prototype.canUsePropInState = function (key) {
7897
7897
  return true;
@@ -7899,6 +7899,11 @@ var SurveyElementBase = /** @class */ (function (_super) {
7899
7899
  SurveyElementBase.prototype.unMakeBaseElementReact = function (stateElement) {
7900
7900
  if (!this.canMakeReact(stateElement))
7901
7901
  return;
7902
+ if (!this.isCurrentStateElement(stateElement)) {
7903
+ // eslint-disable-next-line no-console
7904
+ // console.warn("Looks like the component is bound to another survey element. It is not supported and can lead to issues.");
7905
+ // return;
7906
+ }
7902
7907
  stateElement.setPropertyValueCoreHandler = undefined;
7903
7908
  stateElement.iteratePropertiesHash(function (hash, key) {
7904
7909
  var val = hash[key];
@@ -10783,8 +10788,10 @@ var SurveyRow = /** @class */ (function (_super) {
10783
10788
  };
10784
10789
  SurveyRow.prototype.componentWillUnmount = function () {
10785
10790
  _super.prototype.componentWillUnmount.call(this);
10786
- this.row.setRootElement(undefined);
10787
- this.stopLazyRendering();
10791
+ if (this.isCurrentStateElement(this.getStateElement())) {
10792
+ this.row.setRootElement(undefined);
10793
+ this.stopLazyRendering();
10794
+ }
10788
10795
  };
10789
10796
  SurveyRow.prototype.createElement = function (element, elementIndex) {
10790
10797
  var index = elementIndex ? "-" + elementIndex : 0;
@@ -11565,7 +11572,7 @@ __webpack_require__.r(__webpack_exports__);
11565
11572
 
11566
11573
 
11567
11574
 
11568
- (0,survey_core__WEBPACK_IMPORTED_MODULE_0__.checkLibraryVersion)("".concat("2.0.0-rc.8"), "survey-react-ui");
11575
+ (0,survey_core__WEBPACK_IMPORTED_MODULE_0__.checkLibraryVersion)("".concat("2.0.0"), "survey-react-ui");
11569
11576
 
11570
11577
  })();
11571
11578