survey-react-ui 2.4.1 → 2.5.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/README.md CHANGED
@@ -6,9 +6,7 @@
6
6
 
7
7
  [![Build Status](https://dev.azure.com/SurveyJS/SurveyJS%20Integration%20Tests/_apis/build/status/SurveyJS%20Library?branchName=master)](https://dev.azure.com/SurveyJS/SurveyJS%20Integration%20Tests/_build/latest?definitionId=7&branchName=master)
8
8
  [![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat)](LICENSE)
9
- <a href="https://github.com/DevExpress/testcafe">
10
- <img alt="Tested with TestCafe" src="https://img.shields.io/badge/tested%20with-TestCafe-2fa4cf.svg">
11
- </a>
9
+ [![Tested with Playwright](https://img.shields.io/badge/tested%20with-Playwright-2fa4cf.svg)](https://playwright.dev)
12
10
  <a href="https://github.com/surveyjs/survey-library/issues">
13
11
  <img alt="Issues" title="Open Issues" src="https://img.shields.io/github/issues/surveyjs/survey-library.svg">
14
12
  </a>
@@ -1,10 +1,10 @@
1
1
  /*!
2
- * surveyjs - Survey JavaScript library v2.4.1
2
+ * surveyjs - Survey JavaScript library v2.5.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
  */
6
6
 
7
- import { SurveyModel, Helpers, createSvg, createPopupViewModel, CssClassBuilder, ActionDropdownViewModel, RendererFactory, doKey2ClickUp, SvgRegistry, settings, createPopupModalViewModel, ScrollViewModel, doKey2ClickBlur, doKey2ClickDown, addIconsToThemeSet, Question, SurveyProgressModel, ProgressButtonsResponsivityManager, PopupSurveyModel, ButtonGroupItemModel, LocalizableString, checkLibraryVersion } from 'survey-core';
7
+ import { SurveyModel, Helpers, createSvg, LocalizableString, createPopupViewModel, CssClassBuilder, ActionDropdownViewModel, RendererFactory, doKey2ClickUp, SvgRegistry, settings, createPopupModalViewModel, ScrollViewModel, doKey2ClickBlur, doKey2ClickDown, addIconsToThemeSet, Question, SurveyProgressModel, ProgressButtonsResponsivityManager, PopupSurveyModel, ButtonGroupItemModel, checkLibraryVersion } from 'survey-core';
8
8
  export { SurveyModel as Model, SurveyModel, SurveyWindowModel, settings, surveyLocalization, surveyStrings } from 'survey-core';
9
9
  import * as React from 'react';
10
10
  import * as ReactDOM from 'react-dom';
@@ -92,7 +92,7 @@ class SurveyElementBase extends React.Component {
92
92
  return ReactElementFactory.Instance.createElement(locStr.renderAs, {
93
93
  locStr: locStr.renderAsData,
94
94
  style: style,
95
- key: key,
95
+ key: key
96
96
  });
97
97
  }
98
98
  static renderQuestionDescription(question) {
@@ -420,6 +420,65 @@ ReactElementFactory.Instance.registerElement("sv-action-bar-separator", (props)
420
420
  return React.createElement(SurveyActionBarSeparator, props);
421
421
  });
422
422
 
423
+ class SurveyLocStringViewer extends React.Component {
424
+ constructor(props) {
425
+ super(props);
426
+ this.onChangedHandler = (sender, options) => {
427
+ if (this.isRendering)
428
+ return;
429
+ this.setState({ changed: !!this.state && this.state.changed ? this.state.changed + 1 : 1 });
430
+ };
431
+ this.rootRef = React.createRef();
432
+ }
433
+ get locStr() {
434
+ return this.props.locStr;
435
+ }
436
+ get style() {
437
+ return this.props.style;
438
+ }
439
+ get textClass() {
440
+ return this.props.textClass;
441
+ }
442
+ componentDidMount() {
443
+ this.reactOnStrChanged();
444
+ }
445
+ componentWillUnmount() {
446
+ if (!this.locStr)
447
+ return;
448
+ this.locStr.onStringChanged.remove(this.onChangedHandler);
449
+ }
450
+ componentDidUpdate(prevProps, prevState) {
451
+ if (!!prevProps.locStr) {
452
+ prevProps.locStr.onStringChanged.remove(this.onChangedHandler);
453
+ }
454
+ this.reactOnStrChanged();
455
+ }
456
+ reactOnStrChanged() {
457
+ if (!this.locStr)
458
+ return;
459
+ this.locStr.onStringChanged.add(this.onChangedHandler);
460
+ }
461
+ render() {
462
+ if (!this.locStr)
463
+ return null;
464
+ this.isRendering = true;
465
+ const strEl = this.renderString();
466
+ this.isRendering = false;
467
+ return strEl;
468
+ }
469
+ renderString() {
470
+ const className = this.locStr.getStringViewerClassName(this.textClass);
471
+ if (this.locStr.hasHtml) {
472
+ let htmlValue = { __html: this.locStr.renderedHtml };
473
+ return React.createElement("span", { ref: this.rootRef, className: className, style: this.style, dangerouslySetInnerHTML: htmlValue });
474
+ }
475
+ return React.createElement("span", { ref: this.rootRef, className: className, style: this.style }, this.locStr.renderedHtml);
476
+ }
477
+ }
478
+ ReactElementFactory.Instance.registerElement(LocalizableString.defaultRenderer, (props) => {
479
+ return React.createElement(SurveyLocStringViewer, props);
480
+ });
481
+
423
482
  class SurveyAction extends SurveyElementBase {
424
483
  constructor(props) {
425
484
  super(props);
@@ -480,8 +539,7 @@ class SurveyActionBarItem extends SurveyElementBase {
480
539
  renderText() {
481
540
  if (!this.item.hasTitle)
482
541
  return null;
483
- const titleClass = this.item.getActionBarItemTitleCss();
484
- return React.createElement("span", { className: titleClass }, this.item.title);
542
+ return React.createElement(SurveyLocStringViewer, { locStr: this.item.locTitle, textClass: this.item.getActionBarItemTitleCss() });
485
543
  }
486
544
  renderButtonContent() {
487
545
  const text = this.renderText();
@@ -1056,7 +1114,7 @@ class PopupModal extends SurveyElementBase {
1056
1114
  PopupModal.modalDescriptors = [];
1057
1115
 
1058
1116
  /*!
1059
- * surveyjs - Survey JavaScript library v2.4.1
1117
+ * surveyjs - Survey JavaScript library v2.5.0
1060
1118
  * Copyright (c) 2015-2025 Devsoft Baltic OÜ - http://surveyjs.io/
1061
1119
  * License: MIT (http://www.opensource.org/licenses/mit-license.php)
1062
1120
  */
@@ -1126,7 +1184,7 @@ var iconsV1 = {
1126
1184
  };
1127
1185
 
1128
1186
  /*!
1129
- * surveyjs - Survey JavaScript library v2.4.1
1187
+ * surveyjs - Survey JavaScript library v2.5.0
1130
1188
  * Copyright (c) 2015-2025 Devsoft Baltic OÜ - http://surveyjs.io/
1131
1189
  * License: MIT (http://www.opensource.org/licenses/mit-license.php)
1132
1190
  */
@@ -1719,8 +1777,10 @@ class SurveyRow extends SurveyElementBase {
1719
1777
  componentWillUnmount() {
1720
1778
  super.componentWillUnmount();
1721
1779
  if (!!this.row) {
1722
- this.row.setRootElement(undefined);
1723
- this.stopLazyRendering();
1780
+ if (!this.row.hasActiveUISubscribers) {
1781
+ this.row.setRootElement(undefined);
1782
+ this.stopLazyRendering();
1783
+ }
1724
1784
  }
1725
1785
  }
1726
1786
  createElement(element, elementIndex) {
@@ -5920,62 +5980,6 @@ ReactElementFactory.Instance.registerElement("sv-nav-btn", (props) => {
5920
5980
  return React.createElement(SurveyNavigationButton, props);
5921
5981
  });
5922
5982
 
5923
- class SurveyLocStringViewer extends React.Component {
5924
- constructor(props) {
5925
- super(props);
5926
- this.onChangedHandler = (sender, options) => {
5927
- if (this.isRendering)
5928
- return;
5929
- this.setState({ changed: !!this.state && this.state.changed ? this.state.changed + 1 : 1 });
5930
- };
5931
- this.rootRef = React.createRef();
5932
- }
5933
- get locStr() {
5934
- return this.props.locStr;
5935
- }
5936
- get style() {
5937
- return this.props.style;
5938
- }
5939
- componentDidMount() {
5940
- this.reactOnStrChanged();
5941
- }
5942
- componentWillUnmount() {
5943
- if (!this.locStr)
5944
- return;
5945
- this.locStr.onStringChanged.remove(this.onChangedHandler);
5946
- }
5947
- componentDidUpdate(prevProps, prevState) {
5948
- if (!!prevProps.locStr) {
5949
- prevProps.locStr.onStringChanged.remove(this.onChangedHandler);
5950
- }
5951
- this.reactOnStrChanged();
5952
- }
5953
- reactOnStrChanged() {
5954
- if (!this.locStr)
5955
- return;
5956
- this.locStr.onStringChanged.add(this.onChangedHandler);
5957
- }
5958
- render() {
5959
- if (!this.locStr)
5960
- return null;
5961
- this.isRendering = true;
5962
- const strEl = this.renderString();
5963
- this.isRendering = false;
5964
- return strEl;
5965
- }
5966
- renderString() {
5967
- const className = this.locStr.allowLineBreaks ? "sv-string-viewer sv-string-viewer--multiline" : "sv-string-viewer";
5968
- if (this.locStr.hasHtml) {
5969
- let htmlValue = { __html: this.locStr.renderedHtml };
5970
- return React.createElement("span", { ref: this.rootRef, className: className, style: this.style, dangerouslySetInnerHTML: htmlValue });
5971
- }
5972
- return React.createElement("span", { ref: this.rootRef, className: className, style: this.style }, this.locStr.renderedHtml);
5973
- }
5974
- }
5975
- ReactElementFactory.Instance.registerElement(LocalizableString.defaultRenderer, (props) => {
5976
- return React.createElement(SurveyLocStringViewer, props);
5977
- });
5978
-
5979
5983
  class QuestionErrorComponent extends React.Component {
5980
5984
  render() {
5981
5985
  const error = this.props.error;
@@ -6159,7 +6163,7 @@ ReactElementFactory.Instance.registerElement(LocalizableString.editableRenderer,
6159
6163
  return React.createElement(SurveyLocStringEditor, props);
6160
6164
  });
6161
6165
 
6162
- checkLibraryVersion(`${"2.4.1"}`, "survey-react-ui");
6166
+ checkLibraryVersion(`${"2.5.0"}`, "survey-react-ui");
6163
6167
 
6164
6168
  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 };
6165
6169
  //# sourceMappingURL=survey-react-ui.mjs.map