survey-react-ui 2.5.7 → 2.5.8

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.5.7
2
+ * surveyjs - Survey JavaScript library v2.5.8
3
3
  * Copyright (c) 2015-2026 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, LocalizableString, createPopupViewModel, CssClassBuilder, ActionDropdownViewModel, RendererFactory, doKey2ClickUp, SvgRegistry, settings, createPopupModalViewModel, ScrollViewModel, addIconsToThemeSet, doKey2ClickBlur, doKey2ClickDown, Question, SurveyProgressModel, ProgressButtonsResponsivityManager, PopupSurveyModel, ButtonGroupItemModel, checkLibraryVersion } from 'survey-core';
7
+ import { SurveyModel, Helpers, createSvg, LocalizableString, createPopupViewModel, CssClassBuilder, ActionDropdownViewModel, RendererFactory, doKey2ClickUp, SvgRegistry, PopupModalManager, settings, ScrollViewModel, addIconsToThemeSet, doKey2ClickBlur, doKey2ClickDown, 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';
@@ -1045,14 +1045,20 @@ class SvgBundleComponent extends React.Component {
1045
1045
  }
1046
1046
 
1047
1047
  class PopupModal extends SurveyElementBase {
1048
+ createPopupModalManager() {
1049
+ const modalManager = new PopupModalManager();
1050
+ modalManager.onModalsChangedCallback = () => {
1051
+ this.setState({ changed: this.state.changed + 1 });
1052
+ };
1053
+ return modalManager;
1054
+ }
1048
1055
  constructor(props) {
1049
1056
  super(props);
1057
+ this.modalManager = this.createPopupModalManager();
1050
1058
  this.isInitialized = false;
1051
1059
  this.init = () => {
1052
1060
  if (!this.isInitialized) {
1053
- settings.showDialog = (dialogOptions, rootElement) => {
1054
- return this.showDialog(dialogOptions, rootElement);
1055
- };
1061
+ settings.showDialog = (dialogOptions, rootElement) => this.modalManager.addDialog(dialogOptions, rootElement);
1056
1062
  this.isInitialized = true;
1057
1063
  }
1058
1064
  };
@@ -1082,39 +1088,20 @@ class PopupModal extends SurveyElementBase {
1082
1088
  }
1083
1089
  }
1084
1090
  renderElement() {
1085
- if (!this.model)
1086
- return null;
1087
- return createPortal(React.createElement(PopupContainer, { model: this.model }), this.model.container);
1088
- }
1089
- showDialog(dialogOptions, rootElement) {
1090
- this.model = createPopupModalViewModel(dialogOptions, rootElement);
1091
- const onVisibilityChangedCallback = (_, options) => {
1092
- if (!options.isVisible) {
1093
- this.model.dispose();
1094
- this.model = undefined;
1095
- this.setState({ changed: this.state.changed + 1 });
1096
- }
1097
- };
1098
- this.model.onVisibilityChanged.add(onVisibilityChangedCallback);
1099
- this.model.model.isVisible = true;
1100
- this.setState({ changed: this.state.changed + 1 });
1101
- return this.model;
1091
+ return React.createElement(React.Fragment, null, this.modalManager.getModals().map(model => createPortal(React.createElement(PopupContainer, { model: model }), model.container, model.uniqueId.toString())));
1102
1092
  }
1103
1093
  componentDidMount() {
1104
1094
  PopupModal.addModalDescriptor(this.descriptor);
1105
1095
  }
1106
1096
  componentWillUnmount() {
1107
- if (this.model) {
1108
- this.model.dispose();
1109
- this.model = undefined;
1110
- }
1097
+ this.modalManager.clear();
1111
1098
  PopupModal.removeModalDescriptor(this.descriptor);
1112
1099
  }
1113
1100
  }
1114
1101
  PopupModal.modalDescriptors = [];
1115
1102
 
1116
1103
  /*!
1117
- * surveyjs - Survey JavaScript library v2.5.7
1104
+ * surveyjs - Survey JavaScript library v2.5.8
1118
1105
  * Copyright (c) 2015-2026 Devsoft Baltic OÜ - http://surveyjs.io/
1119
1106
  * License: MIT (http://www.opensource.org/licenses/mit-license.php)
1120
1107
  */
@@ -1184,7 +1171,7 @@ var iconsV1 = {
1184
1171
  };
1185
1172
 
1186
1173
  /*!
1187
- * surveyjs - Survey JavaScript library v2.5.7
1174
+ * surveyjs - Survey JavaScript library v2.5.8
1188
1175
  * Copyright (c) 2015-2026 Devsoft Baltic OÜ - http://surveyjs.io/
1189
1176
  * License: MIT (http://www.opensource.org/licenses/mit-license.php)
1190
1177
  */
@@ -6199,7 +6186,7 @@ ReactElementFactory.Instance.registerElement(LocalizableString.editableRenderer,
6199
6186
  return React.createElement(SurveyLocStringEditor, props);
6200
6187
  });
6201
6188
 
6202
- checkLibraryVersion(`${"2.5.7"}`, "survey-react-ui");
6189
+ checkLibraryVersion(`${"2.5.8"}`, "survey-react-ui");
6203
6190
 
6204
6191
  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, SurveyQuestionImageMap, 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 };
6205
6192
  //# sourceMappingURL=survey-react-ui.mjs.map