survey-react-ui 1.12.57 → 1.12.58

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,10 +1,10 @@
1
1
  /*!
2
- * surveyjs - Survey JavaScript library v2.3.15
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);
@@ -438,7 +497,7 @@ class SurveyAction extends SurveyElementBase {
438
497
  const itemComponent = ReactElementFactory.Instance.createElement(this.item.component || "sv-action-bar-item", {
439
498
  item: this.item,
440
499
  });
441
- return (React.createElement("div", { className: itemClass, id: this.item.id, ref: this.ref },
500
+ return (React.createElement("div", { className: itemClass, id: "" + this.item.uniqueId, ref: this.ref },
442
501
  React.createElement("div", { className: "sv-action__content" },
443
502
  separator,
444
503
  itemComponent)));
@@ -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.3.15
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.3.15
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) {
@@ -3668,15 +3728,18 @@ class SurveyQuestionFile extends SurveyQuestionElementBase {
3668
3728
  const video = this.question.isPlayingVideo ? this.renderVideo() : null;
3669
3729
  const fileDecorator = this.question.showFileDecorator ? this.renderFileDecorator() : null;
3670
3730
  const fileNavigator = this.question.fileNavigatorVisible ? (React.createElement(SurveyActionBar, { model: this.question.fileNavigator })) : null;
3731
+ const acceptedTypes = this.question.renderedAcceptedTypes;
3732
+ const className = !this.isDisplayMode ? this.question.cssClasses.fileInput : this.question.getReadOnlyFileCss();
3733
+ const style = this.isDisplayMode ? { color: "transparent" } : {};
3671
3734
  let fileInput;
3672
3735
  if (this.question.isReadOnlyAttr) {
3673
- fileInput = React.createElement("input", { readOnly: true, type: "file", className: !this.isDisplayMode ? this.question.cssClasses.fileInput : this.question.getReadOnlyFileCss(), id: this.question.inputId, ref: input => (this.setControl(input)), style: !this.isDisplayMode ? {} : { color: "transparent" }, multiple: this.question.allowMultiple, placeholder: this.question.title, accept: this.question.acceptedTypes });
3736
+ fileInput = React.createElement("input", { readOnly: true, type: "file", className: className, id: this.question.inputId, ref: input => (this.setControl(input)), style: style, multiple: this.question.allowMultiple, placeholder: this.question.title, accept: acceptedTypes });
3674
3737
  }
3675
3738
  else if (this.question.isDisabledAttr) {
3676
- fileInput = React.createElement("input", { disabled: true, type: "file", className: !this.isDisplayMode ? this.question.cssClasses.fileInput : this.question.getReadOnlyFileCss(), id: this.question.inputId, ref: input => (this.setControl(input)), style: !this.isDisplayMode ? {} : { color: "transparent" }, multiple: this.question.allowMultiple, placeholder: this.question.title, accept: this.question.acceptedTypes });
3739
+ fileInput = React.createElement("input", { disabled: true, type: "file", className: className, id: this.question.inputId, ref: input => (this.setControl(input)), style: style, multiple: this.question.allowMultiple, placeholder: this.question.title, accept: acceptedTypes });
3677
3740
  }
3678
3741
  else if (this.question.hasFileUI) {
3679
- fileInput = React.createElement("input", { type: "file", disabled: this.isDisplayMode, tabIndex: -1, className: !this.isDisplayMode ? this.question.cssClasses.fileInput : this.question.getReadOnlyFileCss(), id: this.question.inputId, ref: input => (this.setControl(input)), style: !this.isDisplayMode ? {} : { color: "transparent" }, "aria-required": this.question.ariaRequired, "aria-label": this.question.ariaLabel, "aria-invalid": this.question.ariaInvalid, "aria-errormessage": this.question.ariaErrormessage, multiple: this.question.allowMultiple, title: this.question.inputTitle, accept: this.question.acceptedTypes, capture: this.question.renderCapture });
3742
+ fileInput = React.createElement("input", { type: "file", disabled: this.isDisplayMode, tabIndex: -1, className: className, id: this.question.inputId, ref: input => (this.setControl(input)), style: style, "aria-required": this.question.ariaRequired, "aria-label": this.question.ariaLabel, "aria-invalid": this.question.ariaInvalid, "aria-errormessage": this.question.ariaErrormessage, multiple: this.question.allowMultiple, title: this.question.inputTitle, accept: acceptedTypes, capture: this.question.renderCapture });
3680
3743
  }
3681
3744
  else {
3682
3745
  fileInput = null;
@@ -4198,7 +4261,7 @@ class MatrixRow extends SurveyElementBase {
4198
4261
  const model = this.model;
4199
4262
  if (!model.visible)
4200
4263
  return null;
4201
- return (React.createElement("tr", { ref: this.root, className: model.className, "data-sv-drop-target-matrix-row": model.dropTargetId, onPointerDown: (event) => this.onPointerDownHandler(event) }, this.props.children));
4264
+ return (React.createElement("tr", { ref: this.root, className: model.className, "data-sv-drop-target-matrix-row": model.dropTargetId }, this.props.children));
4202
4265
  }
4203
4266
  }
4204
4267
  ReactElementFactory.Instance.registerElement("sv-matrix-row", (props) => {
@@ -4209,8 +4272,11 @@ class SurveyQuestionMatrixDynamicDragDropIcon extends ReactSurveyElement {
4209
4272
  get question() {
4210
4273
  return this.props.item.data.question;
4211
4274
  }
4275
+ get row() {
4276
+ return this.props.item.data.row;
4277
+ }
4212
4278
  renderElement() {
4213
- return React.createElement("div", null, this.renderIcon());
4279
+ return React.createElement("div", { onPointerDown: (event) => { this.question.onPointerDown(event.nativeEvent, this.row); } }, this.renderIcon());
4214
4280
  }
4215
4281
  renderIcon() {
4216
4282
  if (this.question.iconDragElement) {
@@ -5914,62 +5980,6 @@ ReactElementFactory.Instance.registerElement("sv-nav-btn", (props) => {
5914
5980
  return React.createElement(SurveyNavigationButton, props);
5915
5981
  });
5916
5982
 
5917
- class SurveyLocStringViewer extends React.Component {
5918
- constructor(props) {
5919
- super(props);
5920
- this.onChangedHandler = (sender, options) => {
5921
- if (this.isRendering)
5922
- return;
5923
- this.setState({ changed: !!this.state && this.state.changed ? this.state.changed + 1 : 1 });
5924
- };
5925
- this.rootRef = React.createRef();
5926
- }
5927
- get locStr() {
5928
- return this.props.locStr;
5929
- }
5930
- get style() {
5931
- return this.props.style;
5932
- }
5933
- componentDidMount() {
5934
- this.reactOnStrChanged();
5935
- }
5936
- componentWillUnmount() {
5937
- if (!this.locStr)
5938
- return;
5939
- this.locStr.onStringChanged.remove(this.onChangedHandler);
5940
- }
5941
- componentDidUpdate(prevProps, prevState) {
5942
- if (!!prevProps.locStr) {
5943
- prevProps.locStr.onStringChanged.remove(this.onChangedHandler);
5944
- }
5945
- this.reactOnStrChanged();
5946
- }
5947
- reactOnStrChanged() {
5948
- if (!this.locStr)
5949
- return;
5950
- this.locStr.onStringChanged.add(this.onChangedHandler);
5951
- }
5952
- render() {
5953
- if (!this.locStr)
5954
- return null;
5955
- this.isRendering = true;
5956
- const strEl = this.renderString();
5957
- this.isRendering = false;
5958
- return strEl;
5959
- }
5960
- renderString() {
5961
- const className = this.locStr.allowLineBreaks ? "sv-string-viewer sv-string-viewer--multiline" : "sv-string-viewer";
5962
- if (this.locStr.hasHtml) {
5963
- let htmlValue = { __html: this.locStr.renderedHtml };
5964
- return React.createElement("span", { ref: this.rootRef, className: className, style: this.style, dangerouslySetInnerHTML: htmlValue });
5965
- }
5966
- return React.createElement("span", { ref: this.rootRef, className: className, style: this.style }, this.locStr.renderedHtml);
5967
- }
5968
- }
5969
- ReactElementFactory.Instance.registerElement(LocalizableString.defaultRenderer, (props) => {
5970
- return React.createElement(SurveyLocStringViewer, props);
5971
- });
5972
-
5973
5983
  class QuestionErrorComponent extends React.Component {
5974
5984
  render() {
5975
5985
  const error = this.props.error;
@@ -6153,7 +6163,7 @@ ReactElementFactory.Instance.registerElement(LocalizableString.editableRenderer,
6153
6163
  return React.createElement(SurveyLocStringEditor, props);
6154
6164
  });
6155
6165
 
6156
- checkLibraryVersion(`${"2.3.15"}`, "survey-react-ui");
6166
+ checkLibraryVersion(`${"2.5.0"}`, "survey-react-ui");
6157
6167
 
6158
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 };
6159
6169
  //# sourceMappingURL=survey-react-ui.mjs.map