survey-creator-react 2.5.14 → 2.5.16

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
@@ -4,7 +4,7 @@
4
4
  <video src="https://github.com/surveyjs/survey-creator/assets/22315929/884eeb5b-68e6-4d38-a8f9-d2483e6ce386"></video>
5
5
 
6
6
 
7
- [![Build Status](https://dev.azure.com/SurveyJS/SurveyJS%20Integration%20Tests/_apis/build/status/SurveyJS%20Creator?branchName=master)](https://dev.azure.com/SurveyJS/SurveyJS%20Integration%20Tests/_build/latest?definitionId=8&branchName=master)
7
+ [![Build Status](https://dev.azure.com/SurveyJS/V2%20Libraries/_apis/build/status%2Fcreator%2FCreator%20Main?repoName=surveyjs%2Fsurvey-creator&branchName=master)](https://dev.azure.com/SurveyJS/V2%20Libraries/_build/latest?definitionId=149&repoName=surveyjs%2Fsurvey-creator&branchName=master)
8
8
  <a href="https://www.npmjs.com/package/survey-creator"><img alt="NPM Version" src="https://img.shields.io/npm/v/survey-creator.svg" data-canonical-src="https://img.shields.io/npm/v/survey-creator.svg" style="max-width:100%;"></a>
9
9
 
10
10
  A visual designer that enables you and your users to create and modify surveys and forms in your React application.
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * SurveyJS Creator React v2.5.14
2
+ * SurveyJS Creator v2.5.16
3
3
  * (c) 2015-2026 Devsoft Baltic OÜ - http://surveyjs.io/
4
4
  * Github: https://github.com/surveyjs/survey-creator
5
5
  * License: https://surveyjs.io/Licenses#SurveyCreator
@@ -194,17 +194,11 @@ class SurveyCreatorComponent extends SurveyElementBase {
194
194
  }
195
195
  renderActiveTab() {
196
196
  const creator = this.props.creator;
197
- for (var i = 0; i < creator.tabs.length; i++) {
198
- if (creator.tabs[i].id === creator.activeTab) {
199
- return this.renderCreatorTab(creator.tabs[i]);
200
- }
201
- }
202
- return null;
197
+ return this.renderCreatorTab(creator.activeTabMenuItem);
203
198
  }
204
199
  renderCreatorTab(tab) {
205
- if (tab.visible === false) {
200
+ if (!tab)
206
201
  return null;
207
- }
208
202
  const creator = this.props.creator;
209
203
  const component = !!tab.renderTab
210
204
  ? tab.renderTab()
@@ -1024,19 +1018,34 @@ ReactQuestionFactory.Instance.registerQuestion("linkvalue", (props) => {
1024
1018
  });
1025
1019
 
1026
1020
  class SurveyElementEmbeddedSurvey extends SurveyQuestionElementBase {
1021
+ constructor() {
1022
+ super(...arguments);
1023
+ this.rootRef = React.createRef();
1024
+ }
1027
1025
  get embeddedSurvey() {
1028
- return (this.props.element || this.props.question);
1026
+ const element = (this.props.element || this.props.question);
1027
+ if (!element)
1028
+ return null;
1029
+ const survey = element.embeddedSurvey;
1030
+ if (!survey || !survey.currentPage)
1031
+ return null;
1032
+ return survey;
1029
1033
  }
1030
1034
  get creator() {
1031
1035
  return this.props.creator;
1032
1036
  }
1037
+ componentDidMount() {
1038
+ super.componentDidMount();
1039
+ if (this.embeddedSurvey) {
1040
+ this.embeddedSurvey.rootElement = this.rootRef.current;
1041
+ }
1042
+ }
1033
1043
  render() {
1034
- if (!this.embeddedSurvey)
1035
- return null;
1036
- const survey = this.embeddedSurvey.embeddedSurvey;
1037
- if (!survey || !survey.currentPage)
1044
+ const survey = this.embeddedSurvey;
1045
+ if (!survey)
1038
1046
  return null;
1039
- return React.createElement(SurveyPage, { survey: survey, page: survey.currentPage, css: survey.css, creator: this.creator });
1047
+ return React.createElement("div", { style: { display: "contents" }, ref: this.rootRef },
1048
+ React.createElement(SurveyPage, { survey: survey, page: survey.currentPage, css: survey.css, creator: this.creator }));
1040
1049
  }
1041
1050
  }
1042
1051
  ReactQuestionFactory.Instance.registerQuestion("embeddedsurvey", (props) => {
@@ -1605,9 +1614,12 @@ class SearchComponent extends SurveyElementBase {
1605
1614
  if (!this.model.isVisible)
1606
1615
  return null;
1607
1616
  const onChange = (e) => {
1608
- const { root } = settings.environment;
1609
- if (e.target === root.activeElement) {
1610
- this.model.filterString = e.target.value;
1617
+ const target = e.target;
1618
+ const root = (target === null || target === void 0 ? void 0 : target.getRootNode()) || settings.environment.root;
1619
+ if (!(root instanceof Document || root instanceof ShadowRoot))
1620
+ return;
1621
+ if (target === root.activeElement) {
1622
+ this.model.filterString = target.value;
1611
1623
  }
1612
1624
  };
1613
1625
  return (React.createElement("div", { className: "svc-search" },
@@ -2947,8 +2959,8 @@ ReactQuestionFactory.Instance.registerQuestion("sv-boolean-switch", (props) => {
2947
2959
  RendererFactory.Instance.registerRenderer("boolean", "switch", "sv-boolean-switch");
2948
2960
 
2949
2961
  let Version;
2950
- Version = `${"2.5.14"}`;
2951
- checkLibraryVersion(`${"2.5.14"}`, "survey-creator-react");
2962
+ Version = `${"2.5.16"}`;
2963
+ checkLibraryVersion(`${"2.5.16"}`, "survey-creator-react");
2952
2964
 
2953
2965
  export { ActionButton, AdaptiveToolbox, CellQuestionAdornerComponent, CellQuestionDropdownAdornerComponent, ComponentContainer, CreatorSurveyPageComponent, ImageItemValueAdornerComponent, ItemValueAdornerComponent, LogoImageComponent, MatrixCellAdornerComponent, PanelAdornerComponent, PropertyGridComponent, PropertyGridPlaceholderComponent, QuestionAdornerComponent, QuestionBanner, QuestionDropdownAdornerComponent, QuestionEditorContentComponent, QuestionErrorComponent, QuestionImageAdornerComponent, QuestionRatingAdornerComponent, QuestionWidgetAdornerComponent, QuestionWrapperFooter, QuestionWrapperHeader, ReactDragEvent, ReactMouseEvent, RowWrapper, SearchComponent, SideBarDefaultHeader, SidebarComponent, SurveyCreator, SurveyCreatorComponent, SurveyCreatorToolboxCategory, SurveyCreatorToolboxItem, SurveyCreatorToolboxItemGroup, SurveyCreatorToolboxTool, SurveyElementEmbeddedSurvey, SurveyLocStringEditor, SurveyLogicOpertor, SurveyNavigation, SurveyQuestionBooleanSwitch, SurveyQuestionColor, SurveyQuestionFileEditor, SurveyQuestionLinkValue, SurveyQuestionSpinEditor, SurveyQuestionTextWithReset, SurveyResults, SurveyResultsByRow, SurveySimulator, SwitcherComponent, TabButtonComponent, TabDesignerComponent, TabJsonEditorAceComponent, TabJsonEditorErrorsComponent, TabJsonEditorTextareaComponent, TabLogicAddButtonComponent, TabLogicComponent, TabPreviewSurveyComponent, TabPreviewTestSurveyAgainComponent, TabThemeSurveyComponent, TabTranslationComponent, TabbedMenuComponent, TabbedMenuItemComponent, ToolboxList, TranslateFromAction, TranslationLineSkeleton, Version };
2954
2966
  //# sourceMappingURL=survey-creator-react.mjs.map