survey-creator-react 3.2.1 → 3.2.2

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.2
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));
@@ -1309,6 +1323,9 @@ class ItemValueAdornerComponent extends CreatorModelElement {
1309
1323
  this.rootRef = React.createRef();
1310
1324
  }
1311
1325
  createModel(props) {
1326
+ if (this.model && !this.model.isDisposed) {
1327
+ this.model.dispose();
1328
+ }
1312
1329
  this.model = new ItemValueWrapperViewModel(
1313
1330
  props.componentData.creator,
1314
1331
  props.question,
@@ -1329,12 +1346,17 @@ class ItemValueAdornerComponent extends CreatorModelElement {
1329
1346
  }
1330
1347
  }
1331
1348
  componentDidMount() {
1349
+ if (this.model.isDisposed) {
1350
+ this.createModel(this.props);
1351
+ this.forceUpdate();
1352
+ }
1332
1353
  super.componentDidMount();
1333
1354
  this.props.item.setRootElement(this.rootRef.current);
1334
1355
  }
1335
1356
  componentWillUnmount() {
1336
1357
  super.componentWillUnmount();
1337
1358
  this.props.item.setRootElement(void 0);
1359
+ this.model.dispose();
1338
1360
  }
1339
1361
  renderButton(action) {
1340
1362
  return ReactElementFactory.Instance.createElement("sv-action-bar-item", {
@@ -1398,6 +1420,9 @@ class ImageItemValueAdornerComponent extends CreatorModelElement {
1398
1420
  this.rootRef = React.createRef();
1399
1421
  }
1400
1422
  createModel(props) {
1423
+ if (this.model && !this.model.isDisposed) {
1424
+ this.model.dispose();
1425
+ }
1401
1426
  this.model = new ImageItemValueWrapperViewModel(
1402
1427
  props.componentData.creator,
1403
1428
  props.question,
@@ -1416,6 +1441,10 @@ class ImageItemValueAdornerComponent extends CreatorModelElement {
1416
1441
  return this.props.question;
1417
1442
  }
1418
1443
  componentDidMount() {
1444
+ if (this.model.isDisposed) {
1445
+ this.createModel(this.props);
1446
+ this.forceUpdate();
1447
+ }
1419
1448
  super.componentDidMount();
1420
1449
  this.model.itemsRoot = this.rootRef.current;
1421
1450
  }
@@ -1423,6 +1452,10 @@ class ImageItemValueAdornerComponent extends CreatorModelElement {
1423
1452
  super.componentDidUpdate(prevProps, prevState);
1424
1453
  this.model.itemsRoot = this.rootRef.current;
1425
1454
  }
1455
+ componentWillUnmount() {
1456
+ super.componentWillUnmount();
1457
+ this.model.dispose();
1458
+ }
1426
1459
  renderLoadingIndicator() {
1427
1460
  return /* @__PURE__ */ React.createElement("div", { className: "svc-image-item-value__loading" }, /* @__PURE__ */ React.createElement(LoadingIndicatorComponent, null));
1428
1461
  }
@@ -2721,7 +2754,7 @@ const _PageWrapperComponent = class _PageWrapperComponent extends React.Componen
2721
2754
  }
2722
2755
  clearCallback(page) {
2723
2756
  if (!page) return;
2724
- page.unRegisterFunctionOnPropertyValueChanged("name");
2757
+ page.unRegisterFunctionOnPropertyValueChanged("name", this.id);
2725
2758
  }
2726
2759
  componentDidUpdate(prevProps, prevState) {
2727
2760
  if (prevProps.page !== this.props.page) {
@@ -3615,8 +3648,8 @@ ReactElementFactory.Instance.registerElement("sv-fileedit-button", (props) => {
3615
3648
  });
3616
3649
 
3617
3650
  let Version;
3618
- Version = `${"3.2.1"}`;
3619
- checkLibraryVersion(`${"3.2.1"}`, "survey-creator-react");
3651
+ Version = `${"3.2.2"}`;
3652
+ checkLibraryVersion(`${"3.2.2"}`, "survey-creator-react");
3620
3653
 
3621
3654
  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
3655
  //# sourceMappingURL=survey-creator-react.mjs.map