survey-creator-react 3.2.1 → 3.2.3

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 Creator v3.2.1
2
+ * SurveyJS Creator v3.2.3
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
@@ -755,6 +755,9 @@ ReactElementFactory.Instance.registerElement(
755
755
 
756
756
  class QuestionRatingAdornerComponent extends CreatorModelElement {
757
757
  createModel(props) {
758
+ if (this.modelValue && !this.modelValue.isDisposed) {
759
+ this.modelValue.dispose();
760
+ }
758
761
  this.modelValue = this.createQuestionViewModel(props);
759
762
  }
760
763
  createQuestionViewModel(props) {
@@ -776,6 +779,17 @@ class QuestionRatingAdornerComponent extends CreatorModelElement {
776
779
  getStateElement() {
777
780
  return this.model;
778
781
  }
782
+ componentDidMount() {
783
+ if (this.modelValue.isDisposed) {
784
+ this.createModel(this.props);
785
+ this.forceUpdate();
786
+ }
787
+ super.componentDidMount();
788
+ }
789
+ componentWillUnmount() {
790
+ super.componentWillUnmount();
791
+ this.modelValue.dispose();
792
+ }
779
793
  renderElement() {
780
794
  const model = this.ratingModel;
781
795
  return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", { className: "svc-rating-question-content" }, /* @__PURE__ */ React.createElement(SurveyActionBar, { model: model.rateActionsContainer }), this.props.element));
@@ -1037,7 +1051,7 @@ class CreatorSurveyPageComponent extends CreatorModelElement {
1037
1051
  }
1038
1052
  renderContent() {
1039
1053
  if (!this.model.needRenderContent) {
1040
- return /* @__PURE__ */ React.createElement("div", { className: "svc-page__loading-content" }, /* @__PURE__ */ React.createElement(LoadingIndicatorComponent, null));
1054
+ return /* @__PURE__ */ React.createElement("div", { className: this.model.loadingContentCss }, /* @__PURE__ */ React.createElement(LoadingIndicatorComponent, null));
1041
1055
  }
1042
1056
  return /* @__PURE__ */ React.createElement(
1043
1057
  PageElementContent,
@@ -1049,6 +1063,7 @@ class CreatorSurveyPageComponent extends CreatorModelElement {
1049
1063
  );
1050
1064
  }
1051
1065
  renderHeader() {
1066
+ if (!this.model.needRenderContent) return null;
1052
1067
  const actions = /* @__PURE__ */ React.createElement("div", { className: "svc-page__content-actions" }, /* @__PURE__ */ React.createElement(SurveyActionBar, { model: this.model.actionContainer }), this.model.topActionContainer.hasActions ? /* @__PURE__ */ React.createElement(SurveyActionBar, { model: this.model.topActionContainer }) : null);
1053
1068
  if (this.model.isGhost || !this.model.allowDragging) {
1054
1069
  return actions;
@@ -1064,6 +1079,7 @@ class CreatorSurveyPageComponent extends CreatorModelElement {
1064
1079
  );
1065
1080
  }
1066
1081
  renderFooter() {
1082
+ if (!this.model.needRenderContent) return null;
1067
1083
  return /* @__PURE__ */ React.createElement(SurveyActionBar, { model: this.model.footerActionsBar });
1068
1084
  }
1069
1085
  }
@@ -1309,6 +1325,9 @@ class ItemValueAdornerComponent extends CreatorModelElement {
1309
1325
  this.rootRef = React.createRef();
1310
1326
  }
1311
1327
  createModel(props) {
1328
+ if (this.model && !this.model.isDisposed) {
1329
+ this.model.dispose();
1330
+ }
1312
1331
  this.model = new ItemValueWrapperViewModel(
1313
1332
  props.componentData.creator,
1314
1333
  props.question,
@@ -1329,12 +1348,17 @@ class ItemValueAdornerComponent extends CreatorModelElement {
1329
1348
  }
1330
1349
  }
1331
1350
  componentDidMount() {
1351
+ if (this.model.isDisposed) {
1352
+ this.createModel(this.props);
1353
+ this.forceUpdate();
1354
+ }
1332
1355
  super.componentDidMount();
1333
1356
  this.props.item.setRootElement(this.rootRef.current);
1334
1357
  }
1335
1358
  componentWillUnmount() {
1336
1359
  super.componentWillUnmount();
1337
1360
  this.props.item.setRootElement(void 0);
1361
+ this.model.dispose();
1338
1362
  }
1339
1363
  renderButton(action) {
1340
1364
  return ReactElementFactory.Instance.createElement("sv-action-bar-item", {
@@ -1398,6 +1422,9 @@ class ImageItemValueAdornerComponent extends CreatorModelElement {
1398
1422
  this.rootRef = React.createRef();
1399
1423
  }
1400
1424
  createModel(props) {
1425
+ if (this.model && !this.model.isDisposed) {
1426
+ this.model.dispose();
1427
+ }
1401
1428
  this.model = new ImageItemValueWrapperViewModel(
1402
1429
  props.componentData.creator,
1403
1430
  props.question,
@@ -1416,6 +1443,10 @@ class ImageItemValueAdornerComponent extends CreatorModelElement {
1416
1443
  return this.props.question;
1417
1444
  }
1418
1445
  componentDidMount() {
1446
+ if (this.model.isDisposed) {
1447
+ this.createModel(this.props);
1448
+ this.forceUpdate();
1449
+ }
1419
1450
  super.componentDidMount();
1420
1451
  this.model.itemsRoot = this.rootRef.current;
1421
1452
  }
@@ -1423,6 +1454,10 @@ class ImageItemValueAdornerComponent extends CreatorModelElement {
1423
1454
  super.componentDidUpdate(prevProps, prevState);
1424
1455
  this.model.itemsRoot = this.rootRef.current;
1425
1456
  }
1457
+ componentWillUnmount() {
1458
+ super.componentWillUnmount();
1459
+ this.model.dispose();
1460
+ }
1426
1461
  renderLoadingIndicator() {
1427
1462
  return /* @__PURE__ */ React.createElement("div", { className: "svc-image-item-value__loading" }, /* @__PURE__ */ React.createElement(LoadingIndicatorComponent, null));
1428
1463
  }
@@ -2721,7 +2756,7 @@ const _PageWrapperComponent = class _PageWrapperComponent extends React.Componen
2721
2756
  }
2722
2757
  clearCallback(page) {
2723
2758
  if (!page) return;
2724
- page.unRegisterFunctionOnPropertyValueChanged("name");
2759
+ page.unRegisterFunctionOnPropertyValueChanged("name", this.id);
2725
2760
  }
2726
2761
  componentDidUpdate(prevProps, prevState) {
2727
2762
  if (prevProps.page !== this.props.page) {
@@ -2771,7 +2806,7 @@ class TabJsonEditorTextareaComponent extends SurveyElementBase {
2771
2806
  ref: (input) => setControl(input),
2772
2807
  className: "svc-json-editor-tab__content-area",
2773
2808
  value: this.model.text,
2774
- onChange: (e) => this.model.text = e.target.value,
2809
+ onChange: (e) => this.model.onTextInput(e.target.value),
2775
2810
  onKeyDown: (e) => this.model.checkKey(e, e),
2776
2811
  disabled: this.model.readOnly,
2777
2812
  "aria-label": this.model.ariaLabel
@@ -3615,8 +3650,8 @@ ReactElementFactory.Instance.registerElement("sv-fileedit-button", (props) => {
3615
3650
  });
3616
3651
 
3617
3652
  let Version;
3618
- Version = `${"3.2.1"}`;
3619
- checkLibraryVersion(`${"3.2.1"}`, "survey-creator-react");
3653
+ Version = `${"3.2.3"}`;
3654
+ checkLibraryVersion(`${"3.2.3"}`, "survey-creator-react");
3620
3655
 
3621
3656
  export { ActionButton, AdaptiveToolbox, AddQuestionButtonComponent, CellQuestionAdornerComponent, CellQuestionDropdownAdornerComponent, CollabRowComponent, ComponentContainer, CreatorSurveyPageComponent, FloatingPanelComponent, IconItem, ImageItemValueAdornerComponent, ItemValueAdornerComponent, LogoImageComponent, MatrixCellAdornerComponent, PanelAdornerComponent, PropertyGridComponent, PropertyGridPlaceholderComponent, QuestionAdornerComponent, QuestionBanner, QuestionDropdownAdornerComponent, QuestionEditorContentComponent, QuestionErrorComponent, QuestionImageAdornerComponent, QuestionRatingAdornerComponent, QuestionWidgetAdornerComponent, QuestionWrapperFooter, QuestionWrapperHeader, ReactDragEvent, ReactMouseEvent, RowWrapper, SearchComponent, SideBarDefaultHeader, SideBarLaunchCard, SidebarComponent, SurveyCreator, SurveyCreatorComponent, SurveyCreatorToolboxCategory, SurveyCreatorToolboxItem, SurveyCreatorToolboxItemGroup, SurveyCreatorToolboxTool, SurveyElementEmbeddedSurvey, SurveyLocStringEditor, SurveyLogicOpertor, SurveyNavigation, SurveyQuestionColor, SurveyQuestionFileEditor, SurveyQuestionFileEditorButton, SurveyQuestionLinkValue, SurveyQuestionSpinEditor, SurveyResults, SurveyResultsByRow, SurveySimulator, SurveySpinEditorButton, SwitcherComponent, TabButtonComponent, TabContainerComponent, TabDesignerComponent, TabJsonEditorAceComponent, TabJsonEditorErrorsComponent, TabJsonEditorTextareaComponent, TabLogicComponent, TabPreviewSurveyComponent, TabThemeSurveyComponent, TabTranslationComponent, TabbedMenuComponent, TabbedMenuItemComponent, ToolboxList, TranslateFromAction, TranslationDropdownQuestionComponent, TranslationLineSkeleton, TranslationLocaleItemComponent, VariablesViewerComponent, Version };
3622
3657
  //# sourceMappingURL=survey-creator-react.mjs.map