survey-react-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.
@@ -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
  */
@@ -103,20 +103,16 @@ class SurveyElementBase extends React.Component {
103
103
  super(props);
104
104
  this._allowComponentUpdate = true;
105
105
  this.prevStateElements = [];
106
- this.propertyValueChangedHandler = (hash, key, val) => {
107
- if (hash[key] !== val) {
108
- hash[key] = val;
109
- if (!this.canUsePropInState(key))
110
- return;
111
- if (this.isRendering)
112
- return;
113
- this.changedStatePropNameValue = key;
114
- this.setState((state) => {
115
- var newState = {};
116
- newState[key] = val;
117
- return newState;
118
- });
119
- }
106
+ this.propertyValueChangedHandler = (stateElement, options) => {
107
+ const key = options.name;
108
+ if (!this.canUsePropInState(key) || this.isRendering)
109
+ return;
110
+ this.changedStatePropNameValue = key;
111
+ this.setState((state) => {
112
+ var newState = {};
113
+ newState[key] = options.newValue;
114
+ return newState;
115
+ });
120
116
  };
121
117
  this.onArrayChangedCallback = (stateElement, options) => {
122
118
  if (this.isRendering)
@@ -242,22 +238,11 @@ class SurveyElementBase extends React.Component {
242
238
  canMakeReact(stateElement) {
243
239
  return !!stateElement && !!stateElement.iteratePropertiesHash;
244
240
  }
245
- isCurrentStateElement(stateElement) {
246
- return !!stateElement && !!stateElement.setPropertyValueCoreHandler && stateElement.setPropertyValueCoreHandler === this.propertyValueChangedHandler;
247
- }
248
241
  makeBaseElementReact(stateElement) {
249
242
  if (!this.canMakeReact(stateElement))
250
243
  return;
251
- stateElement.iteratePropertiesHash((hash, key) => {
252
- if (!this.canUsePropInState(key))
253
- return;
254
- var val = hash[key];
255
- if (Array.isArray(val)) {
256
- var val = val;
257
- stateElement.addOnArrayChangedCallback(val, this.onArrayChangedCallback);
258
- }
259
- });
260
- stateElement.setPropertyValueCoreHandler = this.propertyValueChangedHandler;
244
+ stateElement.addOnArrayChangedCallback(this.onArrayChangedCallback);
245
+ stateElement.addOnPropertyValueChangedCallback(this.propertyValueChangedHandler);
261
246
  }
262
247
  canUsePropInState(key) {
263
248
  return true;
@@ -265,15 +250,8 @@ class SurveyElementBase extends React.Component {
265
250
  unMakeBaseElementReact(stateElement) {
266
251
  if (!this.canMakeReact(stateElement))
267
252
  return;
268
- if (!this.isCurrentStateElement(stateElement)) ;
269
- stateElement.setPropertyValueCoreHandler = undefined;
270
- stateElement.iteratePropertiesHash((hash, key) => {
271
- var val = hash[key];
272
- if (Array.isArray(val)) {
273
- var val = val;
274
- stateElement.removeOnArrayChangedCallback(val, this.onArrayChangedCallback);
275
- }
276
- });
253
+ stateElement.removeOnPropertyValueChangedCallback(this.propertyValueChangedHandler);
254
+ stateElement.removeOnArrayChangedCallback(this.onArrayChangedCallback);
277
255
  }
278
256
  }
279
257
  class ReactSurveyElement extends SurveyElementBase {
@@ -1078,7 +1056,7 @@ class PopupModal extends SurveyElementBase {
1078
1056
  PopupModal.modalDescriptors = [];
1079
1057
 
1080
1058
  /*!
1081
- * surveyjs - Survey JavaScript library v2.3.11
1059
+ * surveyjs - Survey JavaScript library v2.3.13
1082
1060
  * Copyright (c) 2015-2025 Devsoft Baltic OÜ - http://surveyjs.io/
1083
1061
  * License: MIT (http://www.opensource.org/licenses/mit-license.php)
1084
1062
  */
@@ -1148,7 +1126,7 @@ var iconsV1 = {
1148
1126
  };
1149
1127
 
1150
1128
  /*!
1151
- * surveyjs - Survey JavaScript library v2.3.11
1129
+ * surveyjs - Survey JavaScript library v2.3.13
1152
1130
  * Copyright (c) 2015-2025 Devsoft Baltic OÜ - http://surveyjs.io/
1153
1131
  * License: MIT (http://www.opensource.org/licenses/mit-license.php)
1154
1132
  */
@@ -1739,9 +1717,8 @@ class SurveyRow extends SurveyElementBase {
1739
1717
  this.row.isNeedRender = !this.row.isLazyRendering();
1740
1718
  }
1741
1719
  componentWillUnmount() {
1742
- const isCurrentStateElement = this.isCurrentStateElement(this.getStateElement());
1743
1720
  super.componentWillUnmount();
1744
- if (isCurrentStateElement) {
1721
+ if (!!this.row) {
1745
1722
  this.row.setRootElement(undefined);
1746
1723
  this.stopLazyRendering();
1747
1724
  }
@@ -6178,7 +6155,7 @@ ReactElementFactory.Instance.registerElement(LocalizableString.editableRenderer,
6178
6155
  return React.createElement(SurveyLocStringEditor, props);
6179
6156
  });
6180
6157
 
6181
- checkLibraryVersion(`${"2.3.11"}`, "survey-react-ui");
6158
+ checkLibraryVersion(`${"2.3.13"}`, "survey-react-ui");
6182
6159
 
6183
6160
  export { CharacterCounterComponent, ComponentsContainer, Header, HeaderCell, HeaderMobile, List, ListItemContent, ListItemGroup, LoadingIndicatorComponent, LogoImage, MatrixRow, NotifierComponent, Popup, PopupModal, PopupSurvey, QuestionErrorComponent, RatingDropdownItem, RatingItem, RatingItemSmiley, RatingItemStar, ReactElementFactory, ReactQuestionFactory, ReactSurveyElement, ReactSurveyElementsWrapper, Scroll, Skeleton, SliderLabelItem, Survey, SurveyActionBar, SurveyElementBase, SurveyElementErrors, SurveyFileChooseButton, SurveyFileItem, SurveyFilePreview, SurveyFlowPanel, SurveyHeader, SurveyLocStringEditor, SurveyLocStringViewer, SurveyNavigationBase, SurveyNavigationButton, SurveyPage, SurveyPanel, SurveyProgress, SurveyProgressButtons, SurveyProgressToc, SurveyQuestion, SurveyQuestionAndErrorsCell, SurveyQuestionBoolean, SurveyQuestionBooleanCheckbox, SurveyQuestionBooleanRadio, SurveyQuestionButtonGroup, SurveyQuestionButtonGroupDropdown, SurveyQuestionCheckbox, SurveyQuestionCheckboxItem, SurveyQuestionComment, SurveyQuestionCommentItem, SurveyQuestionComposite, SurveyQuestionCustom, SurveyQuestionDropdown, SurveyQuestionDropdownBase, SurveyQuestionDropdownSelect, SurveyQuestionElementBase, SurveyQuestionEmpty, SurveyQuestionExpression, SurveyQuestionFile, SurveyQuestionHtml, SurveyQuestionImage, SurveyQuestionImagePicker, SurveyQuestionMatrix, SurveyQuestionMatrixCell, SurveyQuestionMatrixDetailButton, SurveyQuestionMatrixDropdown, SurveyQuestionMatrixDropdownBase, SurveyQuestionMatrixDropdownCell, SurveyQuestionMatrixDynamic, SurveyQuestionMatrixDynamicAddButton, SurveyQuestionMatrixDynamicDragDropIcon, SurveyQuestionMatrixDynamicRemoveButton, SurveyQuestionMatrixRow, SurveyQuestionMultipleText, SurveyQuestionOptionItem, SurveyQuestionPanelDynamic, SurveyQuestionPanelDynamicAddButton, SurveyQuestionPanelDynamicNextButton, SurveyQuestionPanelDynamicPrevButton, SurveyQuestionPanelDynamicProgressText, SurveyQuestionPanelDynamicRemoveButton, SurveyQuestionRadioItem, SurveyQuestionRadiogroup, SurveyQuestionRanking, SurveyQuestionRankingItem, SurveyQuestionRankingItemContent, SurveyQuestionRating, SurveyQuestionRatingDropdown, SurveyQuestionSignaturePad, SurveyQuestionSlider, SurveyQuestionTagbox, SurveyQuestionTagboxItem, SurveyQuestionText, SurveyRow, SurveyTimerPanel, SurveyWindow, SvgBundleComponent, SvgIcon, TagboxFilterString, TitleActions, TitleElement, attachKey2click };
6184
6161
  //# sourceMappingURL=survey-react-ui.mjs.map