survey-creator-react 1.9.133 → 1.9.134

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "survey-creator-react",
3
- "version": "1.9.133",
3
+ "version": "1.9.134",
4
4
  "description": "Use SurveyJS Creator to create or edit JSON for SurveyJS Form Library.",
5
5
  "keywords": [
6
6
  "Survey",
@@ -36,9 +36,9 @@
36
36
  }
37
37
  },
38
38
  "dependencies": {
39
- "survey-core": "1.9.133",
40
- "survey-react-ui": "1.9.133",
41
- "survey-creator-core": "1.9.133"
39
+ "survey-core": "1.9.134",
40
+ "survey-react-ui": "1.9.134",
41
+ "survey-creator-core": "1.9.134"
42
42
  },
43
43
  "devDependencies": {}
44
44
  }
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * SurveyJS Creator React v1.9.133
2
+ * SurveyJS Creator React v1.9.134
3
3
  * (c) 2015-2024 Devsoft Baltic OÜ - http://surveyjs.io/
4
4
  * Github: https://github.com/surveyjs/survey-creator
5
5
  * License: https://surveyjs.io/Licenses#SurveyCreator
@@ -183,8 +183,8 @@ var ImageItemValueAdornerComponent = /** @class */ (function (_super) {
183
183
  _this.rootRef = react__WEBPACK_IMPORTED_MODULE_2___default.a.createRef();
184
184
  return _this;
185
185
  }
186
- ImageItemValueAdornerComponent.prototype.createModel = function () {
187
- this.model = new survey_creator_core__WEBPACK_IMPORTED_MODULE_1__["ImageItemValueWrapperViewModel"](this.props.componentData.creator, this.props.question, this.props.item, null, null);
186
+ ImageItemValueAdornerComponent.prototype.createModel = function (props) {
187
+ this.model = new survey_creator_core__WEBPACK_IMPORTED_MODULE_1__["ImageItemValueWrapperViewModel"](props.componentData.creator, props.question, props.item, null, null);
188
188
  };
189
189
  ImageItemValueAdornerComponent.prototype.getUpdatedModelProps = function () {
190
190
  return ["question", "item"];
@@ -299,8 +299,8 @@ var ItemValueAdornerComponent = /** @class */ (function (_super) {
299
299
  };
300
300
  return _this;
301
301
  }
302
- ItemValueAdornerComponent.prototype.createModel = function () {
303
- this.model = new survey_creator_core__WEBPACK_IMPORTED_MODULE_1__["ItemValueWrapperViewModel"](this.props.componentData.creator, this.props.question, this.props.item);
302
+ ItemValueAdornerComponent.prototype.createModel = function (props) {
303
+ this.model = new survey_creator_core__WEBPACK_IMPORTED_MODULE_1__["ItemValueWrapperViewModel"](props.componentData.creator, props.question, props.item);
304
304
  };
305
305
  ItemValueAdornerComponent.prototype.getUpdatedModelProps = function () {
306
306
  return ["question", "item"];
@@ -375,12 +375,12 @@ var LogoImageComponent = /** @class */ (function (_super) {
375
375
  _this.rootRef = react__WEBPACK_IMPORTED_MODULE_1___default.a.createRef();
376
376
  return _this;
377
377
  }
378
- LogoImageComponent.prototype.createModel = function () {
378
+ LogoImageComponent.prototype.createModel = function (props) {
379
379
  var prevRoot = null;
380
380
  if (!!this.model) {
381
381
  prevRoot = this.model.root;
382
382
  }
383
- this.model = new survey_creator_core__WEBPACK_IMPORTED_MODULE_3__["LogoImageViewModel"](this.props.data, prevRoot);
383
+ this.model = new survey_creator_core__WEBPACK_IMPORTED_MODULE_3__["LogoImageViewModel"](props.data, prevRoot);
384
384
  };
385
385
  LogoImageComponent.prototype.getUpdatedModelProps = function () {
386
386
  return ["data"];
@@ -478,10 +478,15 @@ var MatrixCellAdornerComponent = /** @class */ (function (_super) {
478
478
  function MatrixCellAdornerComponent() {
479
479
  return _super !== null && _super.apply(this, arguments) || this;
480
480
  }
481
- MatrixCellAdornerComponent.prototype.createModel = function () {
481
+ MatrixCellAdornerComponent.prototype.createModel = function (props) {
482
482
  var _a;
483
- var data = this.props.componentData;
483
+ var data = props.componentData;
484
+ var prevIsSelected = false;
485
+ if (!!this.model) {
486
+ prevIsSelected = this.model.isSelected;
487
+ }
484
488
  this.model = new survey_creator_core__WEBPACK_IMPORTED_MODULE_2__["MatrixCellWrapperViewModel"](data.creator, data.element, data.question, data.row, data.column || ((_a = data.element.cell) === null || _a === void 0 ? void 0 : _a.column));
489
+ this.model.isSelected = prevIsSelected;
485
490
  };
486
491
  MatrixCellAdornerComponent.prototype.getUpdatedModelProps = function () {
487
492
  return ["componentData"];
@@ -539,23 +544,26 @@ var CreatorModelElement = /** @class */ (function (_super) {
539
544
  Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(CreatorModelElement, _super);
540
545
  function CreatorModelElement(props) {
541
546
  var _this = _super.call(this, props) || this;
542
- _this.createModel();
547
+ _this.createModel(props);
543
548
  return _this;
544
549
  }
545
- CreatorModelElement.prototype.componentDidUpdate = function (prevProps, prevState) {
546
- _super.prototype.componentDidUpdate.call(this, prevProps, prevState);
547
- if (this.needUpdateModel(prevProps)) {
548
- this.createModel();
550
+ CreatorModelElement.prototype.shouldComponentUpdate = function (nextProps, nextState) {
551
+ var result = _super.prototype.shouldComponentUpdate.call(this, nextProps, nextState);
552
+ if (result) {
553
+ if (this.needUpdateModel(nextProps)) {
554
+ this.createModel(nextProps);
555
+ }
549
556
  }
557
+ return result;
550
558
  };
551
- CreatorModelElement.prototype.createModel = function () { };
552
- CreatorModelElement.prototype.needUpdateModel = function (prevProps) {
559
+ CreatorModelElement.prototype.createModel = function (props) { };
560
+ CreatorModelElement.prototype.needUpdateModel = function (nextProps) {
553
561
  var names = this.getUpdatedModelProps();
554
562
  if (!Array.isArray(names))
555
563
  return true;
556
564
  for (var i = 0; i < names.length; i++) {
557
565
  var key = names[i];
558
- if (this.props[key] !== prevProps[key])
566
+ if (this.props[key] !== nextProps[key])
559
567
  return true;
560
568
  }
561
569
  return false;
@@ -744,11 +752,11 @@ var SurveyPageNavigator = /** @class */ (function (_super) {
744
752
  _this.containerRef = react__WEBPACK_IMPORTED_MODULE_4___default.a.createRef();
745
753
  return _this;
746
754
  }
747
- SurveyPageNavigator.prototype.createModel = function () {
755
+ SurveyPageNavigator.prototype.createModel = function (props) {
748
756
  if (this.model) {
749
757
  this.model.dispose();
750
758
  }
751
- this.model = new survey_creator_core__WEBPACK_IMPORTED_MODULE_3__["PageNavigatorViewModel"](this.props.pagesController, this.props.pageEditMode);
759
+ this.model = new survey_creator_core__WEBPACK_IMPORTED_MODULE_3__["PageNavigatorViewModel"](props.pagesController, props.pageEditMode);
752
760
  };
753
761
  SurveyPageNavigator.prototype.getUpdatedModelProps = function () {
754
762
  return ["pagesController", "pageEditMode"];
@@ -1108,9 +1116,9 @@ var SurveyResults = /** @class */ (function (_super) {
1108
1116
  function SurveyResults() {
1109
1117
  return _super !== null && _super.apply(this, arguments) || this;
1110
1118
  }
1111
- SurveyResults.prototype.createModel = function () {
1119
+ SurveyResults.prototype.createModel = function (props) {
1112
1120
  if (this.props.survey) {
1113
- this.model = new survey_creator_core__WEBPACK_IMPORTED_MODULE_2__["SurveyResultsModel"](this.props.survey);
1121
+ this.model = new survey_creator_core__WEBPACK_IMPORTED_MODULE_2__["SurveyResultsModel"](props.survey);
1114
1122
  }
1115
1123
  };
1116
1124
  SurveyResults.prototype.getUpdatedModelProps = function () {
@@ -1442,11 +1450,11 @@ var SurveyLocStringEditor = /** @class */ (function (_super) {
1442
1450
  _this.svStringEditorRef = react__WEBPACK_IMPORTED_MODULE_1___default.a.createRef();
1443
1451
  return _this;
1444
1452
  }
1445
- SurveyLocStringEditor.prototype.createModel = function () {
1453
+ SurveyLocStringEditor.prototype.createModel = function (props) {
1446
1454
  if (this.baseModel) {
1447
1455
  this.baseModel.dispose();
1448
1456
  }
1449
- this.baseModel = new survey_creator_core__WEBPACK_IMPORTED_MODULE_3__["StringEditorViewModelBase"](this.locString, this.creator);
1457
+ this.baseModel = new survey_creator_core__WEBPACK_IMPORTED_MODULE_3__["StringEditorViewModelBase"](props.locStr.locStr, props.locStr.creator);
1450
1458
  };
1451
1459
  SurveyLocStringEditor.prototype.getUpdatedModelProps = function () {
1452
1460
  return ["creator", "locString"];
@@ -1968,8 +1976,8 @@ var CellQuestionAdornerComponent = /** @class */ (function (_super) {
1968
1976
  function CellQuestionAdornerComponent() {
1969
1977
  return _super !== null && _super.apply(this, arguments) || this;
1970
1978
  }
1971
- CellQuestionAdornerComponent.prototype.createModel = function () {
1972
- this.model = new survey_creator_core__WEBPACK_IMPORTED_MODULE_4__["QuestionAdornerViewModel"](this.props.componentData, this.props.question, null);
1979
+ CellQuestionAdornerComponent.prototype.createModel = function (props) {
1980
+ this.model = new survey_creator_core__WEBPACK_IMPORTED_MODULE_4__["QuestionAdornerViewModel"](props.componentData, props.question, null);
1973
1981
  };
1974
1982
  CellQuestionAdornerComponent.prototype.getStateElement = function () {
1975
1983
  return this.model;
@@ -2023,8 +2031,8 @@ var CellQuestionDropdownAdornerComponent = /** @class */ (function (_super) {
2023
2031
  function CellQuestionDropdownAdornerComponent() {
2024
2032
  return _super !== null && _super.apply(this, arguments) || this;
2025
2033
  }
2026
- CellQuestionDropdownAdornerComponent.prototype.createModel = function () {
2027
- this.model = new survey_creator_core__WEBPACK_IMPORTED_MODULE_1__["QuestionAdornerViewModel"](this.props.componentData, this.props.question, null);
2034
+ CellQuestionDropdownAdornerComponent.prototype.createModel = function (props) {
2035
+ this.model = new survey_creator_core__WEBPACK_IMPORTED_MODULE_1__["QuestionAdornerViewModel"](props.componentData, props.question, null);
2028
2036
  };
2029
2037
  CellQuestionDropdownAdornerComponent.prototype.getUpdatedModelProps = function () {
2030
2038
  return ["question", "componentData"];
@@ -2094,8 +2102,8 @@ var CreatorSurveyPageComponent = /** @class */ (function (_super) {
2094
2102
  _this.rootRef = react__WEBPACK_IMPORTED_MODULE_4___default.a.createRef();
2095
2103
  return _this;
2096
2104
  }
2097
- CreatorSurveyPageComponent.prototype.createModel = function () {
2098
- this.model = new survey_creator_core__WEBPACK_IMPORTED_MODULE_3__["PageAdorner"](this.props.creator, this.props.page);
2105
+ CreatorSurveyPageComponent.prototype.createModel = function (props) {
2106
+ this.model = new survey_creator_core__WEBPACK_IMPORTED_MODULE_3__["PageAdorner"](props.creator, props.page);
2099
2107
  };
2100
2108
  CreatorSurveyPageComponent.prototype.getUpdatedModelProps = function () {
2101
2109
  return ["creator", "page"];
@@ -2291,14 +2299,14 @@ var QuestionAdornerComponent = /** @class */ (function (_super) {
2291
2299
  function QuestionAdornerComponent() {
2292
2300
  return _super !== null && _super.apply(this, arguments) || this;
2293
2301
  }
2294
- QuestionAdornerComponent.prototype.createModel = function () {
2302
+ QuestionAdornerComponent.prototype.createModel = function (props) {
2295
2303
  if (this.modelValue) {
2296
2304
  this.modelValue.dispose();
2297
2305
  }
2298
- this.modelValue = this.createQuestionViewModel();
2306
+ this.modelValue = this.createQuestionViewModel(props);
2299
2307
  };
2300
- QuestionAdornerComponent.prototype.createQuestionViewModel = function () {
2301
- return new survey_creator_core__WEBPACK_IMPORTED_MODULE_1__["QuestionAdornerViewModel"](this.props.componentData, this.props.question, null);
2308
+ QuestionAdornerComponent.prototype.createQuestionViewModel = function (props) {
2309
+ return new survey_creator_core__WEBPACK_IMPORTED_MODULE_1__["QuestionAdornerViewModel"](props.componentData, props.question, null);
2302
2310
  };
2303
2311
  QuestionAdornerComponent.prototype.getUpdatedModelProps = function () {
2304
2312
  return ["question", "componentData"];
@@ -2447,8 +2455,8 @@ var QuestionDropdownAdornerComponent = /** @class */ (function (_super) {
2447
2455
  function QuestionDropdownAdornerComponent(props) {
2448
2456
  return _super.call(this, props) || this;
2449
2457
  }
2450
- QuestionDropdownAdornerComponent.prototype.createQuestionViewModel = function () {
2451
- return new survey_creator_core__WEBPACK_IMPORTED_MODULE_2__["QuestionDropdownAdornerViewModel"](this.props.componentData, this.props.question, null);
2458
+ QuestionDropdownAdornerComponent.prototype.createQuestionViewModel = function (props) {
2459
+ return new survey_creator_core__WEBPACK_IMPORTED_MODULE_2__["QuestionDropdownAdornerViewModel"](props.componentData, props.question, null);
2452
2460
  };
2453
2461
  Object.defineProperty(QuestionDropdownAdornerComponent.prototype, "dropdownModel", {
2454
2462
  get: function () {
@@ -2605,8 +2613,8 @@ var QuestionImageAdornerComponent = /** @class */ (function (_super) {
2605
2613
  _this.rootRef = react__WEBPACK_IMPORTED_MODULE_2___default.a.createRef();
2606
2614
  return _this;
2607
2615
  }
2608
- QuestionImageAdornerComponent.prototype.createQuestionViewModel = function () {
2609
- return new survey_creator_core__WEBPACK_IMPORTED_MODULE_1__["QuestionImageAdornerViewModel"](this.props.componentData, this.props.question, null, null);
2616
+ QuestionImageAdornerComponent.prototype.createQuestionViewModel = function (props) {
2617
+ return new survey_creator_core__WEBPACK_IMPORTED_MODULE_1__["QuestionImageAdornerViewModel"](props.componentData, props.question, null, null);
2610
2618
  };
2611
2619
  Object.defineProperty(QuestionImageAdornerComponent.prototype, "imageModel", {
2612
2620
  get: function () {
@@ -2699,11 +2707,11 @@ var QuestionRatingAdornerComponent = /** @class */ (function (_super) {
2699
2707
  function QuestionRatingAdornerComponent() {
2700
2708
  return _super !== null && _super.apply(this, arguments) || this;
2701
2709
  }
2702
- QuestionRatingAdornerComponent.prototype.createModel = function () {
2703
- this.modelValue = this.createQuestionViewModel();
2710
+ QuestionRatingAdornerComponent.prototype.createModel = function (props) {
2711
+ this.modelValue = this.createQuestionViewModel(props);
2704
2712
  };
2705
- QuestionRatingAdornerComponent.prototype.createQuestionViewModel = function () {
2706
- return new survey_creator_core__WEBPACK_IMPORTED_MODULE_2__["QuestionRatingAdornerViewModel"](this.props.componentData, this.props.question, null);
2713
+ QuestionRatingAdornerComponent.prototype.createQuestionViewModel = function (props) {
2714
+ return new survey_creator_core__WEBPACK_IMPORTED_MODULE_2__["QuestionRatingAdornerViewModel"](props.componentData, props.question, null);
2707
2715
  };
2708
2716
  QuestionRatingAdornerComponent.prototype.getUpdatedModelProps = function () {
2709
2717
  return ["question", "componentData"];
@@ -2777,8 +2785,8 @@ var QuestionWidgetAdornerComponent = /** @class */ (function (_super) {
2777
2785
  function QuestionWidgetAdornerComponent() {
2778
2786
  return _super !== null && _super.apply(this, arguments) || this;
2779
2787
  }
2780
- QuestionWidgetAdornerComponent.prototype.createQuestionViewModel = function () {
2781
- return new survey_creator_core__WEBPACK_IMPORTED_MODULE_1__["QuestionAdornerViewModel"](this.props.componentData, this.props.question, null);
2788
+ QuestionWidgetAdornerComponent.prototype.createQuestionViewModel = function (props) {
2789
+ return new survey_creator_core__WEBPACK_IMPORTED_MODULE_1__["QuestionAdornerViewModel"](props.componentData, props.question, null);
2782
2790
  };
2783
2791
  Object.defineProperty(QuestionWidgetAdornerComponent.prototype, "widgetModel", {
2784
2792
  get: function () {
@@ -2828,8 +2836,8 @@ var RowWrapper = /** @class */ (function (_super) {
2828
2836
  function RowWrapper(props) {
2829
2837
  return _super.call(this, props) || this;
2830
2838
  }
2831
- RowWrapper.prototype.createModel = function () {
2832
- this.model = new survey_creator_core__WEBPACK_IMPORTED_MODULE_1__["RowViewModel"](this.props.componentData.creator, this.props.row, null);
2839
+ RowWrapper.prototype.createModel = function (props) {
2840
+ this.model = new survey_creator_core__WEBPACK_IMPORTED_MODULE_1__["RowViewModel"](props.componentData.creator, props.row, null);
2833
2841
  };
2834
2842
  RowWrapper.prototype.getUpdatedModelProps = function () {
2835
2843
  return ["row", "componentData"];
@@ -3415,7 +3423,7 @@ __webpack_require__.r(__webpack_exports__);
3415
3423
  /* harmony import */ var survey_core__WEBPACK_IMPORTED_MODULE_53__ = __webpack_require__(/*! survey-core */ "survey-core");
3416
3424
  /* harmony import */ var survey_core__WEBPACK_IMPORTED_MODULE_53___default = /*#__PURE__*/__webpack_require__.n(survey_core__WEBPACK_IMPORTED_MODULE_53__);
3417
3425
  var Version;
3418
- Version = "".concat("1.9.133");
3426
+ Version = "".concat("1.9.134");
3419
3427
  // import "@survey/creator/survey-creator-core.css";
3420
3428
 
3421
3429
 
@@ -3478,7 +3486,7 @@ Version = "".concat("1.9.133");
3478
3486
 
3479
3487
 
3480
3488
 
3481
- Object(survey_core__WEBPACK_IMPORTED_MODULE_53__["checkLibraryVersion"])("".concat("1.9.133"), "survey-creator-react");
3489
+ Object(survey_core__WEBPACK_IMPORTED_MODULE_53__["checkLibraryVersion"])("".concat("1.9.134"), "survey-creator-react");
3482
3490
 
3483
3491
 
3484
3492
  /***/ }),
@@ -4664,8 +4672,8 @@ var SurveyCreatorToolboxTool = /** @class */ (function (_super) {
4664
4672
  function SurveyCreatorToolboxTool(props) {
4665
4673
  return _super.call(this, props) || this;
4666
4674
  }
4667
- SurveyCreatorToolboxTool.prototype.createModel = function () {
4668
- this.model = new survey_creator_core__WEBPACK_IMPORTED_MODULE_2__["ToolboxToolViewModel"](this.item, this.props.creator);
4675
+ SurveyCreatorToolboxTool.prototype.createModel = function (props) {
4676
+ this.model = new survey_creator_core__WEBPACK_IMPORTED_MODULE_2__["ToolboxToolViewModel"](props.item, props.creator);
4669
4677
  };
4670
4678
  SurveyCreatorToolboxTool.prototype.getUpdatedModelProps = function () {
4671
4679
  return ["creator", "item"];
@@ -4719,9 +4727,9 @@ var SurveyCreatorToolboxItem = /** @class */ (function (_super) {
4719
4727
  function SurveyCreatorToolboxItem(props) {
4720
4728
  return _super.call(this, props) || this;
4721
4729
  }
4722
- SurveyCreatorToolboxItem.prototype.createModel = function () {
4723
- var toolboxItem = this.props.item;
4724
- this.model = new survey_creator_core__WEBPACK_IMPORTED_MODULE_2__["ToolboxToolViewModel"](toolboxItem, this.props.creator);
4730
+ SurveyCreatorToolboxItem.prototype.createModel = function (props) {
4731
+ var toolboxItem = props.item;
4732
+ this.model = new survey_creator_core__WEBPACK_IMPORTED_MODULE_2__["ToolboxToolViewModel"](toolboxItem, props.creator);
4725
4733
  };
4726
4734
  SurveyCreatorToolboxItem.prototype.getUpdatedModelProps = function () {
4727
4735
  return ["creator", "item"];