survey-js-ui 2.3.11 → 2.3.13

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-js-ui",
3
- "version": "2.3.11",
3
+ "version": "2.3.13",
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",
@@ -31,7 +31,7 @@
31
31
  },
32
32
  "dependencies": {},
33
33
  "peerDependencies": {
34
- "survey-core": "2.3.11",
34
+ "survey-core": "2.3.13",
35
35
  "@types/react-dom": "*",
36
36
  "@types/react": "*"
37
37
  }
package/survey-js-ui.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - Survey JavaScript library v2.3.11
2
+ * surveyjs - Survey JavaScript library v2.3.13
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
  */
@@ -23,7 +23,7 @@ return /******/ (() => { // webpackBootstrap
23
23
  /***/ (function(module) {
24
24
 
25
25
  /*!
26
- * surveyjs - Survey JavaScript library v2.3.11
26
+ * surveyjs - Survey JavaScript library v2.3.13
27
27
  * Copyright (c) 2015-2025 Devsoft Baltic OÜ - http://surveyjs.io/
28
28
  * License: MIT (http://www.opensource.org/licenses/mit-license.php)
29
29
  */
@@ -830,7 +830,7 @@ path.keys().forEach(function (key) {
830
830
  /***/ (function(module) {
831
831
 
832
832
  /*!
833
- * surveyjs - Survey JavaScript library v2.3.11
833
+ * surveyjs - Survey JavaScript library v2.3.13
834
834
  * Copyright (c) 2015-2025 Devsoft Baltic OÜ - http://surveyjs.io/
835
835
  * License: MIT (http://www.opensource.org/licenses/mit-license.php)
836
836
  */
@@ -9374,20 +9374,16 @@ var SurveyElementBase = /** @class */ (function (_super) {
9374
9374
  var _this = _super.call(this, props) || this;
9375
9375
  _this._allowComponentUpdate = true;
9376
9376
  _this.prevStateElements = [];
9377
- _this.propertyValueChangedHandler = function (hash, key, val) {
9378
- if (hash[key] !== val) {
9379
- hash[key] = val;
9380
- if (!_this.canUsePropInState(key))
9381
- return;
9382
- if (_this.isRendering)
9383
- return;
9384
- _this.changedStatePropNameValue = key;
9385
- _this.setState(function (state) {
9386
- var newState = {};
9387
- newState[key] = val;
9388
- return newState;
9389
- });
9390
- }
9377
+ _this.propertyValueChangedHandler = function (stateElement, options) {
9378
+ var key = options.name;
9379
+ if (!_this.canUsePropInState(key) || _this.isRendering)
9380
+ return;
9381
+ _this.changedStatePropNameValue = key;
9382
+ _this.setState(function (state) {
9383
+ var newState = {};
9384
+ newState[key] = options.newValue;
9385
+ return newState;
9386
+ });
9391
9387
  };
9392
9388
  _this.onArrayChangedCallback = function (stateElement, options) {
9393
9389
  if (_this.isRendering)
@@ -9541,44 +9537,20 @@ var SurveyElementBase = /** @class */ (function (_super) {
9541
9537
  SurveyElementBase.prototype.canMakeReact = function (stateElement) {
9542
9538
  return !!stateElement && !!stateElement.iteratePropertiesHash;
9543
9539
  };
9544
- SurveyElementBase.prototype.isCurrentStateElement = function (stateElement) {
9545
- return !!stateElement && !!stateElement.setPropertyValueCoreHandler && stateElement.setPropertyValueCoreHandler === this.propertyValueChangedHandler;
9546
- };
9547
9540
  SurveyElementBase.prototype.makeBaseElementReact = function (stateElement) {
9548
- var _this = this;
9549
9541
  if (!this.canMakeReact(stateElement))
9550
9542
  return;
9551
- stateElement.iteratePropertiesHash(function (hash, key) {
9552
- if (!_this.canUsePropInState(key))
9553
- return;
9554
- var val = hash[key];
9555
- if (Array.isArray(val)) {
9556
- var val = val;
9557
- stateElement.addOnArrayChangedCallback(val, _this.onArrayChangedCallback);
9558
- }
9559
- });
9560
- stateElement.setPropertyValueCoreHandler = this.propertyValueChangedHandler;
9543
+ stateElement.addOnArrayChangedCallback(this.onArrayChangedCallback);
9544
+ stateElement.addOnPropertyValueChangedCallback(this.propertyValueChangedHandler);
9561
9545
  };
9562
9546
  SurveyElementBase.prototype.canUsePropInState = function (key) {
9563
9547
  return true;
9564
9548
  };
9565
9549
  SurveyElementBase.prototype.unMakeBaseElementReact = function (stateElement) {
9566
- var _this = this;
9567
9550
  if (!this.canMakeReact(stateElement))
9568
9551
  return;
9569
- if (!this.isCurrentStateElement(stateElement)) {
9570
- // eslint-disable-next-line no-console
9571
- // console.warn("Looks like the component is bound to another survey element. It is not supported and can lead to issues.");
9572
- // return;
9573
- }
9574
- stateElement.setPropertyValueCoreHandler = undefined;
9575
- stateElement.iteratePropertiesHash(function (hash, key) {
9576
- var val = hash[key];
9577
- if (Array.isArray(val)) {
9578
- var val = val;
9579
- stateElement.removeOnArrayChangedCallback(val, _this.onArrayChangedCallback);
9580
- }
9581
- });
9552
+ stateElement.removeOnPropertyValueChangedCallback(this.propertyValueChangedHandler);
9553
+ stateElement.removeOnArrayChangedCallback(this.onArrayChangedCallback);
9582
9554
  };
9583
9555
  return SurveyElementBase;
9584
9556
  }(react__WEBPACK_IMPORTED_MODULE_0__.Component));
@@ -12770,9 +12742,8 @@ var SurveyRow = /** @class */ (function (_super) {
12770
12742
  this.row.isNeedRender = !this.row.isLazyRendering();
12771
12743
  };
12772
12744
  SurveyRow.prototype.componentWillUnmount = function () {
12773
- var isCurrentStateElement = this.isCurrentStateElement(this.getStateElement());
12774
12745
  _super.prototype.componentWillUnmount.call(this);
12775
- if (isCurrentStateElement) {
12746
+ if (!!this.row) {
12776
12747
  this.row.setRootElement(undefined);
12777
12748
  this.stopLazyRendering();
12778
12749
  }
@@ -13795,7 +13766,7 @@ var preact = react__WEBPACK_IMPORTED_MODULE_0__;
13795
13766
 
13796
13767
 
13797
13768
 
13798
- (0,survey_core__WEBPACK_IMPORTED_MODULE_2__.checkLibraryVersion)("".concat("2.3.11"), "survey-js-ui");
13769
+ (0,survey_core__WEBPACK_IMPORTED_MODULE_2__.checkLibraryVersion)("".concat("2.3.13"), "survey-js-ui");
13799
13770
 
13800
13771
  })();
13801
13772