survey-creator-core 1.9.110 → 1.9.112

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.
Files changed (126) hide show
  1. package/fonts.fontless.css +1 -1
  2. package/fonts.fontless.min.css +1 -1
  3. package/i18n/arabic.js +1717 -0
  4. package/i18n/arabic.js.map +1 -0
  5. package/i18n/arabic.min.js +7 -0
  6. package/i18n/bulgarian.js +1354 -0
  7. package/i18n/bulgarian.js.map +1 -0
  8. package/i18n/bulgarian.min.js +7 -0
  9. package/i18n/croatian.js +1801 -0
  10. package/i18n/croatian.js.map +1 -0
  11. package/i18n/croatian.min.js +7 -0
  12. package/i18n/czech.js +1356 -0
  13. package/i18n/czech.js.map +1 -0
  14. package/i18n/czech.min.js +7 -0
  15. package/i18n/danish.js +1992 -0
  16. package/i18n/danish.js.map +1 -0
  17. package/i18n/danish.min.js +7 -0
  18. package/i18n/dutch.js +1787 -0
  19. package/i18n/dutch.js.map +1 -0
  20. package/i18n/dutch.min.js +7 -0
  21. package/i18n/english.js +1244 -0
  22. package/i18n/english.js.map +1 -0
  23. package/i18n/english.min.js +7 -0
  24. package/i18n/finnish.js +1807 -0
  25. package/i18n/finnish.js.map +1 -0
  26. package/i18n/finnish.min.js +7 -0
  27. package/i18n/french.js +1864 -0
  28. package/i18n/french.js.map +1 -0
  29. package/i18n/french.min.js +7 -0
  30. package/i18n/german.js +1527 -0
  31. package/i18n/german.js.map +1 -0
  32. package/i18n/german.min.js +7 -0
  33. package/i18n/hungarian.js +1961 -0
  34. package/i18n/hungarian.js.map +1 -0
  35. package/i18n/hungarian.min.js +7 -0
  36. package/i18n/index.js +45735 -0
  37. package/i18n/index.js.map +1 -0
  38. package/i18n/index.min.js +7 -0
  39. package/i18n/indonesian.js +1961 -0
  40. package/i18n/indonesian.js.map +1 -0
  41. package/i18n/indonesian.min.js +7 -0
  42. package/i18n/italian.js +1549 -0
  43. package/i18n/italian.js.map +1 -0
  44. package/i18n/italian.min.js +7 -0
  45. package/i18n/japanese.js +1806 -0
  46. package/i18n/japanese.js.map +1 -0
  47. package/i18n/japanese.min.js +7 -0
  48. package/i18n/korean.js +2011 -0
  49. package/i18n/korean.js.map +1 -0
  50. package/i18n/korean.min.js +7 -0
  51. package/i18n/malay.js +1760 -0
  52. package/i18n/malay.js.map +1 -0
  53. package/i18n/malay.min.js +7 -0
  54. package/i18n/mongolian.js +1448 -0
  55. package/i18n/mongolian.js.map +1 -0
  56. package/i18n/mongolian.min.js +7 -0
  57. package/i18n/norwegian.js +1811 -0
  58. package/i18n/norwegian.js.map +1 -0
  59. package/i18n/norwegian.min.js +7 -0
  60. package/i18n/persian.js +1746 -0
  61. package/i18n/persian.js.map +1 -0
  62. package/i18n/persian.min.js +7 -0
  63. package/i18n/polish.js +2079 -0
  64. package/i18n/polish.js.map +1 -0
  65. package/i18n/polish.min.js +7 -0
  66. package/i18n/portuguese.js +1457 -0
  67. package/i18n/portuguese.js.map +1 -0
  68. package/i18n/portuguese.min.js +7 -0
  69. package/i18n/russian.js +1868 -0
  70. package/i18n/russian.js.map +1 -0
  71. package/i18n/russian.min.js +7 -0
  72. package/i18n/simplified-chinese.js +1948 -0
  73. package/i18n/simplified-chinese.js.map +1 -0
  74. package/i18n/simplified-chinese.min.js +7 -0
  75. package/i18n/slovak.js +1760 -0
  76. package/i18n/slovak.js.map +1 -0
  77. package/i18n/slovak.min.js +7 -0
  78. package/i18n/spanish.js +1573 -0
  79. package/i18n/spanish.js.map +1 -0
  80. package/i18n/spanish.min.js +7 -0
  81. package/i18n/swedish.js +1985 -0
  82. package/i18n/swedish.js.map +1 -0
  83. package/i18n/swedish.min.js +7 -0
  84. package/i18n/tajik.js +1037 -0
  85. package/i18n/tajik.js.map +1 -0
  86. package/i18n/tajik.min.js +7 -0
  87. package/i18n/traditional-chinese.js +2084 -0
  88. package/i18n/traditional-chinese.js.map +1 -0
  89. package/i18n/traditional-chinese.min.js +7 -0
  90. package/i18n/turkish.js +1802 -0
  91. package/i18n/turkish.js.map +1 -0
  92. package/i18n/turkish.min.js +7 -0
  93. package/package.json +2 -2
  94. package/survey-creator-core.css +619 -582
  95. package/survey-creator-core.fontless.css +618 -581
  96. package/survey-creator-core.fontless.css.map +1 -1
  97. package/survey-creator-core.fontless.min.css +37 -37
  98. package/survey-creator-core.i18n.js +2566 -18
  99. package/survey-creator-core.i18n.js.map +1 -1
  100. package/survey-creator-core.i18n.min.js +2 -2
  101. package/survey-creator-core.js +1499 -370
  102. package/survey-creator-core.js.map +1 -1
  103. package/survey-creator-core.min.css +38 -38
  104. package/survey-creator-core.min.js +46 -46
  105. package/typings/components/tabs/designer-plugin.d.ts +1 -1
  106. package/typings/components/tabs/logic-actions-model.d.ts +9 -1
  107. package/typings/components/tabs/test-plugin.d.ts +2 -0
  108. package/typings/components/tabs/theme-builder.d.ts +33 -0
  109. package/typings/components/tabs/theme-plugin.d.ts +7 -0
  110. package/typings/components/tabs/themes.d.ts +1 -0
  111. package/typings/components/tabs/translation-plugin.d.ts +0 -1
  112. package/typings/components/tabs/translation-theme.d.ts +1 -0
  113. package/typings/components/tabs/translation.d.ts +36 -1
  114. package/typings/creator-base.d.ts +172 -110
  115. package/typings/creator-options.d.ts +14 -2
  116. package/typings/creator-settings.d.ts +13 -0
  117. package/typings/custom-questions/question-file.d.ts +5 -0
  118. package/typings/editorLocalization.d.ts +48 -0
  119. package/typings/localization/english.d.ts +48 -0
  120. package/typings/plugins/undo-redo/undo-redo-manager.d.ts +3 -0
  121. package/typings/property-grid/index.d.ts +1 -5
  122. package/typings/property-grid/matrices.d.ts +6 -3
  123. package/typings/questionconverter.d.ts +4 -3
  124. package/typings/survey-elements.d.ts +1 -0
  125. package/typings/survey-helper.d.ts +2 -1
  126. package/typings/toolbox.d.ts +2 -0
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * SurveyJS Creator v1.9.110
2
+ * SurveyJS Creator v1.9.112
3
3
  * (c) 2015-2023 Devsoft Baltic OÜ - http://surveyjs.io/
4
4
  * Github: https://github.com/surveyjs/survey-creator
5
5
  * License: https://surveyjs.io/Licenses#SurveyCreator
@@ -130,7 +130,7 @@ License: MIT
130
130
  /***/ (function(module, exports, __webpack_require__) {
131
131
 
132
132
  /*!
133
- * surveyjs - Survey JavaScript library v1.9.110
133
+ * surveyjs - Survey JavaScript library v1.9.112
134
134
  * Copyright (c) 2015-2023 Devsoft Baltic OÜ - http://surveyjs.io/
135
135
  * License: MIT (http://www.opensource.org/licenses/mit-license.php)
136
136
  */
@@ -5536,6 +5536,9 @@ var ItemValueWrapperViewModel = /** @class */ (function (_super) {
5536
5536
  };
5537
5537
  Object.defineProperty(ItemValueWrapperViewModel.prototype, "allowRemove", {
5538
5538
  get: function () {
5539
+ var minChoices = this.creator.minimumChoicesCount;
5540
+ if (minChoices > 0 && minChoices >= this.question.choices.length)
5541
+ return false;
5539
5542
  var isNew = !this.question.isItemInList(this.item);
5540
5543
  return !this.creator.readOnly && this.canTouchItems && (this.allowItemOperations.allowDelete) && !isNew;
5541
5544
  },
@@ -7033,9 +7036,7 @@ var QuestionAdornerViewModel = /** @class */ (function (_super) {
7033
7036
  _this.dragDropHelper.startDragSurveyElement(event, element, isElementSelected);
7034
7037
  return true;
7035
7038
  };
7036
- _this.questionTypeSelectorModel = _this.creator.getQuestionTypeSelectorModel(function (type) {
7037
- _this.currentAddQuestionType = type;
7038
- }, _this.surveyElement instanceof survey_core__WEBPACK_IMPORTED_MODULE_1__["PanelModelBase"] ? _this.surveyElement : null);
7039
+ _this.questionTypeSelectorModel = _this.creator.getQuestionTypeSelectorModel(function (type) { _this.currentAddQuestionType = type; }, _this.surveyElement);
7039
7040
  _this.actionContainer.sizeMode = "small";
7040
7041
  if (surveyElement.isQuestion &&
7041
7042
  !!surveyElement["setCanShowOptionItemCallback"]) {
@@ -7238,7 +7239,10 @@ var QuestionAdornerViewModel = /** @class */ (function (_super) {
7238
7239
  };
7239
7240
  QuestionAdornerViewModel.prototype.getConvertToTypesActions = function () {
7240
7241
  var _this = this;
7241
- var convertClasses = _questionconverter__WEBPACK_IMPORTED_MODULE_3__["QuestionConverter"].getConvertToClasses(this.currentType, this.creator.toolbox.itemNames, true);
7242
+ var availableItems = this.creator.getAvailableToolboxItems(this.element, false);
7243
+ var itemNames = [];
7244
+ availableItems.forEach(function (item) { return itemNames.push(item.typeName); });
7245
+ var convertClasses = _questionconverter__WEBPACK_IMPORTED_MODULE_3__["QuestionConverter"].getConvertToClasses(this.currentType, itemNames, true);
7242
7246
  var res = [];
7243
7247
  var lastItem = null;
7244
7248
  convertClasses.forEach(function (className) {
@@ -7337,10 +7341,10 @@ var QuestionAdornerViewModel = /** @class */ (function (_super) {
7337
7341
  id: "isrequired",
7338
7342
  ariaChecked: new survey_core__WEBPACK_IMPORTED_MODULE_1__["ComputedUpdater"](function () { return _this.isRequired; }),
7339
7343
  ariaRole: "checkbox",
7340
- css: new survey_core__WEBPACK_IMPORTED_MODULE_1__["ComputedUpdater"](function () { return _this.isRequired ? "sv-action-bar-item--secondary" : ""; }),
7344
+ css: "sv-action-bar-item--secondary",
7341
7345
  title: this.creator.getLocString("pe.isRequired"),
7342
7346
  visibleIndex: 20,
7343
- iconName: new survey_core__WEBPACK_IMPORTED_MODULE_1__["ComputedUpdater"](function () { return _this.isRequired ? "icon-switch-active_16x16" : "icon-switch-inactive_16x16"; }),
7347
+ iconName: "icon-required",
7344
7348
  iconSize: 16,
7345
7349
  action: function () {
7346
7350
  if (_this.creator.isCanModifyProperty(_this.surveyElement, "isRequired")) {
@@ -7348,11 +7352,10 @@ var QuestionAdornerViewModel = /** @class */ (function (_super) {
7348
7352
  }
7349
7353
  }
7350
7354
  });
7351
- this.surveyElement.registerFunctionOnPropertyValueChanged("isRequired", function (value) {
7352
- requiredAction.iconName = value ? "icon-switch-active_16x16" : "icon-switch-inactive_16x16";
7353
- requiredAction.css = value ? "sv-action-bar-item--secondary" : "";
7354
- requiredAction.innerItem.iconName = requiredAction.iconName;
7355
- }, "isRequiredAdorner");
7355
+ requiredAction.innerCss = new survey_core__WEBPACK_IMPORTED_MODULE_1__["ComputedUpdater"](function () { return new survey_core__WEBPACK_IMPORTED_MODULE_1__["CssClassBuilder"]().append("svc-required-action").append("svc-required-action--active", _this.isRequired).toString(); });
7356
+ requiredAction.innerItem.title = new survey_core__WEBPACK_IMPORTED_MODULE_1__["ComputedUpdater"](function () {
7357
+ return _this.isRequired ? _this.creator.getLocString("pe.removeRequiredMark") : _this.creator.getLocString("pe.markRequired");
7358
+ });
7356
7359
  return requiredAction;
7357
7360
  };
7358
7361
  QuestionAdornerViewModel.prototype.buildActions = function (items) {
@@ -9047,9 +9050,6 @@ var TabDesignerPlugin = /** @class */ (function () {
9047
9050
  });
9048
9051
  this.toolboxTab = this.creator.sidebar.addTab("toolbox", "svc-toolbox", creator);
9049
9052
  this.creator.onPropertyChanged.add(function (sender, options) {
9050
- if (options.name === "isMobileView") {
9051
- _this.updatePropertyGridTabCaption();
9052
- }
9053
9053
  if (options.name === "toolboxLocation") {
9054
9054
  if (_this.toolboxTab.visible && options.newVal !== "sidebar") {
9055
9055
  _this.propertyGridTab.visible = true;
@@ -9057,13 +9057,9 @@ var TabDesignerPlugin = /** @class */ (function () {
9057
9057
  _this.toolboxTab.visible = options.newVal === "sidebar";
9058
9058
  }
9059
9059
  });
9060
- this.propertyGrid.onPropertyChanged.add(function (sender, options) {
9061
- if (options.name === "selectedElementName") {
9062
- _this.updatePropertyGridTabCaption();
9063
- }
9064
- });
9065
9060
  this.createActions().forEach(function (action) { return creator.toolbar.actions.push(action); });
9066
9061
  creator.registerShortcut("delete", {
9062
+ affectedTab: "designer",
9067
9063
  hotKey: {
9068
9064
  keyCode: 46,
9069
9065
  },
@@ -9091,9 +9087,6 @@ var TabDesignerPlugin = /** @class */ (function () {
9091
9087
  var _this = this;
9092
9088
  return new survey_core__WEBPACK_IMPORTED_MODULE_1__["ComputedUpdater"](function () { return _this.creator.activeTab === "designer"; });
9093
9089
  };
9094
- TabDesignerPlugin.prototype.updatePropertyGridTabCaption = function () {
9095
- this.propertyGridTab.caption = this.creator.isMobileView ? this.propertyGrid.selectedElementName : "";
9096
- };
9097
9090
  TabDesignerPlugin.prototype.activate = function () {
9098
9091
  this.model = new _designer__WEBPACK_IMPORTED_MODULE_4__["TabDesignerViewModel"](this.creator);
9099
9092
  this.creator.sidebar.activeTab = this.propertyGridTab.id;
@@ -9166,12 +9159,20 @@ var TabDesignerPlugin = /** @class */ (function () {
9166
9159
  locTooltipName: "ed.saveSurveyTooltip",
9167
9160
  showTitle: false
9168
9161
  });
9162
+ this.designerAction = new survey_core__WEBPACK_IMPORTED_MODULE_1__["Action"]({
9163
+ id: "svd-designer",
9164
+ iconName: "icon-config",
9165
+ visible: this.createVisibleUpdater(),
9166
+ active: true,
9167
+ locTitleName: "ed.designer",
9168
+ showTitle: false,
9169
+ action: function () { }
9170
+ });
9169
9171
  this.previewAction = new survey_core__WEBPACK_IMPORTED_MODULE_1__["Action"]({
9170
9172
  id: "svd-preview",
9171
9173
  iconName: "icon-preview",
9172
- needSeparator: true,
9173
9174
  action: function () {
9174
- _this.creator.makeNewViewActive("test");
9175
+ _this.creator.makeNewViewActive(_this.creator.showThemeTab ? "theme" : "test");
9175
9176
  },
9176
9177
  visible: this.createVisibleUpdater(),
9177
9178
  locTitleName: "ed.testSurvey",
@@ -9198,8 +9199,9 @@ var TabDesignerPlugin = /** @class */ (function () {
9198
9199
  this.creator.sidebar.activeTab = this.propertyGridTab.id;
9199
9200
  };
9200
9201
  TabDesignerPlugin.prototype.addFooterActions = function () {
9201
- this.creator.footerToolbar.actions.push(this.surveySettingsAction);
9202
+ this.creator.footerToolbar.actions.push(this.designerAction);
9202
9203
  this.creator.footerToolbar.actions.push(this.previewAction);
9204
+ this.creator.footerToolbar.actions.push(this.surveySettingsAction);
9203
9205
  };
9204
9206
  return TabDesignerPlugin;
9205
9207
  }());
@@ -9921,13 +9923,14 @@ var TabJsonEditorTextareaPlugin = /** @class */ (function (_super) {
9921
9923
  /*!****************************************************!*\
9922
9924
  !*** ./src/components/tabs/logic-actions-model.ts ***!
9923
9925
  \****************************************************/
9924
- /*! exports provided: LogicActionModelBase, LogicActionModel, LogicActionTriggerModel */
9926
+ /*! exports provided: LogicActionModelBase, LogicActionModel, LogicActionSetValueModel, LogicActionTriggerModel */
9925
9927
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
9926
9928
 
9927
9929
  "use strict";
9928
9930
  __webpack_require__.r(__webpack_exports__);
9929
9931
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LogicActionModelBase", function() { return LogicActionModelBase; });
9930
9932
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LogicActionModel", function() { return LogicActionModel; });
9933
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LogicActionSetValueModel", function() { return LogicActionSetValueModel; });
9931
9934
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LogicActionTriggerModel", function() { return LogicActionTriggerModel; });
9932
9935
  /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./src/entries/helpers.ts");
9933
9936
  /* harmony import */ var survey_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! survey-core */ "survey-core");
@@ -9948,6 +9951,8 @@ var LogicActionModelBase = /** @class */ (function () {
9948
9951
  }
9949
9952
  LogicActionModelBase.createActionModel = function (panel, logicAction, logicType, selectorElementsHash) {
9950
9953
  if (!!logicType && logicType.hasSelectorChoices) {
9954
+ if (logicType.name.indexOf("_setValue") > -1)
9955
+ return new LogicActionSetValueModel(panel, logicAction, logicType, selectorElementsHash);
9951
9956
  return new LogicActionModel(panel, logicAction, logicType, selectorElementsHash);
9952
9957
  }
9953
9958
  else {
@@ -10021,6 +10026,39 @@ var LogicActionModel = /** @class */ (function (_super) {
10021
10026
  return LogicActionModel;
10022
10027
  }(LogicActionModelBase));
10023
10028
 
10029
+ var LogicActionSetValueModel = /** @class */ (function (_super) {
10030
+ Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(LogicActionSetValueModel, _super);
10031
+ function LogicActionSetValueModel() {
10032
+ return _super !== null && _super.apply(this, arguments) || this;
10033
+ }
10034
+ LogicActionSetValueModel.prototype.updatePanelElements = function (selectedElement, choices) {
10035
+ _super.prototype.updatePanelElements.call(this, selectedElement, choices);
10036
+ this.getValueIfQuestion().placeholder = _editorLocalization__WEBPACK_IMPORTED_MODULE_2__["editorLocalization"].getString("ed.lg.setValueExpressionPlaceholder");
10037
+ this.getValueIfPanel().visible = true;
10038
+ this.setValueExpressionValue();
10039
+ };
10040
+ LogicActionSetValueModel.prototype.afterUpdateInitialLogicAction = function () {
10041
+ var selectedElement = this.getElementBySelectorName(this.panel);
10042
+ if (!!selectedElement) {
10043
+ selectedElement.setValueExpression = this.panel.getQuestionByName("setValueExpression").value;
10044
+ }
10045
+ };
10046
+ LogicActionSetValueModel.prototype.setValueExpressionValue = function () {
10047
+ var selectedElement = this.getElementBySelectorName(this.panel);
10048
+ if (!!selectedElement) {
10049
+ this.getValueIfQuestion().value = selectedElement.setValueExpression;
10050
+ }
10051
+ };
10052
+ LogicActionSetValueModel.prototype.getValueIfPanel = function () { return this.panel.getElementByName("setValueIfPanel"); };
10053
+ LogicActionSetValueModel.prototype.getValueIfQuestion = function () { return this.panel.getQuestionByName("setValueExpression"); };
10054
+ LogicActionSetValueModel.prototype.resetElements = function () {
10055
+ _super.prototype.resetElements.call(this);
10056
+ this.getValueIfPanel().visible = false;
10057
+ this.getValueIfQuestion().clearValue();
10058
+ };
10059
+ return LogicActionSetValueModel;
10060
+ }(LogicActionModel));
10061
+
10024
10062
  var LogicActionTriggerModel = /** @class */ (function (_super) {
10025
10063
  Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(LogicActionTriggerModel, _super);
10026
10064
  function LogicActionTriggerModel(panel, logicAction, logicType) {
@@ -10377,6 +10415,8 @@ __webpack_require__.r(__webpack_exports__);
10377
10415
  /* harmony import */ var _logic_theme__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./logic-theme */ "./src/components/tabs/logic-theme.ts");
10378
10416
  /* harmony import */ var _utils_utils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../utils/utils */ "./src/utils/utils.ts");
10379
10417
  /* harmony import */ var _logic_actions_model__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./logic-actions-model */ "./src/components/tabs/logic-actions-model.ts");
10418
+ /* harmony import */ var _property_grid_theme_property_grid__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../property-grid-theme/property-grid */ "./src/property-grid-theme/property-grid.ts");
10419
+
10380
10420
 
10381
10421
 
10382
10422
 
@@ -10588,6 +10628,16 @@ var LogicItemEditor = /** @class */ (function (_super) {
10588
10628
  type: "panel",
10589
10629
  visible: false
10590
10630
  },
10631
+ {
10632
+ name: "setValueIfPanel",
10633
+ visible: false,
10634
+ type: "panel",
10635
+ elements: [{
10636
+ name: "setValueExpression",
10637
+ type: "comment",
10638
+ titleLocation: "hidden"
10639
+ }]
10640
+ }
10591
10641
  ]
10592
10642
  }
10593
10643
  ]
@@ -10634,28 +10684,38 @@ var LogicItemEditor = /** @class */ (function (_super) {
10634
10684
  cssClasses.error.root = "svc-logic-operator__error";
10635
10685
  cssClasses.onError = "svc-logic-operator--error";
10636
10686
  }
10637
- if (question.name === "elementSelector" || question.name === "setToName" || question.name === "fromName" || question.name === "gotoName") {
10687
+ var selectorsNames = ["elementSelector", "setToName", "fromName", "gotoName"];
10688
+ if (selectorsNames.indexOf(question.name) > -1) {
10638
10689
  question.allowRootStyle = false;
10690
+ if (question.name === "setToName" || question.name === "fromName") {
10691
+ question.titleLocation = "left";
10692
+ question.startWithNewLine = false;
10693
+ }
10639
10694
  cssClasses.control += " svc-logic-operator svc-logic-operator--question";
10640
10695
  cssClasses.error.root = "svc-logic-operator__error";
10641
10696
  cssClasses.onError = "svc-logic-operator--error";
10642
10697
  }
10643
- if (question.name === "setToName" || question.name === "fromName") {
10644
- question.allowRootStyle = false;
10645
- question.titleLocation = "left";
10646
- question.startWithNewLine = false;
10647
- cssClasses.error.root = "svc-logic-operator__error";
10648
- cssClasses.onError = "svc-logic-operator--error";
10649
- }
10650
10698
  if (question.name === "setValue" || question.isContentElement) {
10651
10699
  Object(_utils_utils__WEBPACK_IMPORTED_MODULE_8__["assignDefaultV2Classes"])(cssClasses, question.getType());
10652
10700
  cssClasses.mainRoot += " svc-logic-question-value sd-element--with-frame";
10653
10701
  }
10702
+ var parentName = question.parent.name;
10703
+ if (selectorsNames.indexOf(question.name) < 0 && (parentName === "triggerEditorPanel" || parentName === "setValueIfPanel")) {
10704
+ var qType = question.getType();
10705
+ Object(_utils_utils__WEBPACK_IMPORTED_MODULE_8__["assignDefaultV2Classes"])(cssClasses, qType);
10706
+ if (!survey_core__WEBPACK_IMPORTED_MODULE_1__["defaultV2Css"][qType]) {
10707
+ Object(_utils_utils__WEBPACK_IMPORTED_MODULE_8__["copyCssClasses"])(cssClasses, _property_grid_theme_property_grid__WEBPACK_IMPORTED_MODULE_10__["propertyGridCss"].question);
10708
+ Object(_utils_utils__WEBPACK_IMPORTED_MODULE_8__["copyCssClasses"])(cssClasses, _property_grid_theme_property_grid__WEBPACK_IMPORTED_MODULE_10__["propertyGridCss"][qType]);
10709
+ }
10710
+ var els = question.parent.elements.filter(function (el) { return selectorsNames.indexOf(el.name) < 0 && el.name !== "expression"; });
10711
+ if ((question.name !== "runExpression" && qType !== "comment") || (Array.isArray(els) && els.length > 1)) {
10712
+ cssClasses.mainRoot += " svc-logic-question-value sd-element--with-frame";
10713
+ }
10714
+ }
10654
10715
  if (question.name === "removeAction") {
10655
10716
  question.allowRootStyle = false;
10656
10717
  cssClasses.mainRoot += " svc-logic-condition-remove-question";
10657
10718
  }
10658
- // cssClasses.mainRoot = "sd-question sd-row__question";
10659
10719
  if (question.name === "panel") {
10660
10720
  cssClasses.root += " svc-logic-paneldynamic";
10661
10721
  cssClasses.buttonAdd += " svc-logic-operator--action ";
@@ -10666,10 +10726,11 @@ var LogicItemEditor = /** @class */ (function (_super) {
10666
10726
  }
10667
10727
  };
10668
10728
  LogicItemEditor.prototype.onUpdatePanelCssClasses = function (options) {
10669
- if (options.panel.name === "triggerEditorPanel") {
10729
+ var name = options.panel.name;
10730
+ if (name === "triggerEditorPanel" || name === "setValueIfPanel") {
10670
10731
  options.cssClasses.panel.container += " svc-logic_trigger-editor";
10671
10732
  }
10672
- if (options.panel.name === "triggerQuestionsPanel") {
10733
+ if (name === "triggerQuestionsPanel") {
10673
10734
  options.panel.allowRootStyle = false;
10674
10735
  options.cssClasses.panel.container += " svc-logic_trigger-questions";
10675
10736
  }
@@ -12397,6 +12458,25 @@ var SurveyLogicTypes = /** @class */ (function () {
12397
12458
  baseClass: "question",
12398
12459
  propertyName: "requiredIf",
12399
12460
  },
12461
+ {
12462
+ name: "question_resetValue",
12463
+ baseClass: "question",
12464
+ propertyName: "resetValueIf",
12465
+ },
12466
+ {
12467
+ name: "question_setValue",
12468
+ baseClass: "question",
12469
+ propertyName: "setValueIf",
12470
+ getDisplayText: function (element, formatStr, lt) {
12471
+ return getDisplayTextForSetValueIf(element, formatStr, lt);
12472
+ }
12473
+ },
12474
+ {
12475
+ name: "question_setValueExpression",
12476
+ baseClass: "question",
12477
+ propertyName: "setValueExpression",
12478
+ showInUI: false,
12479
+ },
12400
12480
  {
12401
12481
  name: "column_visibility",
12402
12482
  baseClass: "matrixdropdowncolumn",
@@ -12412,6 +12492,25 @@ var SurveyLogicTypes = /** @class */ (function () {
12412
12492
  baseClass: "matrixdropdowncolumn",
12413
12493
  propertyName: "requiredIf",
12414
12494
  },
12495
+ {
12496
+ name: "column_resetValue",
12497
+ baseClass: "matrixdropdowncolumn",
12498
+ propertyName: "resetValueIf",
12499
+ },
12500
+ {
12501
+ name: "column_setValue",
12502
+ baseClass: "matrixdropdowncolumn",
12503
+ propertyName: "setValueIf",
12504
+ getDisplayText: function (element, formatStr, lt) {
12505
+ return getDisplayTextForSetValueIf(element, formatStr, lt);
12506
+ }
12507
+ },
12508
+ {
12509
+ name: "column_setValueExpression",
12510
+ baseClass: "matrixdropdowncolumn",
12511
+ propertyName: "setValueExpression",
12512
+ showInUI: false,
12513
+ },
12415
12514
  {
12416
12515
  name: "expression_expression",
12417
12516
  baseClass: "expression",
@@ -12553,6 +12652,14 @@ var SurveyLogicTypes = /** @class */ (function () {
12553
12652
  return SurveyLogicTypes;
12554
12653
  }());
12555
12654
 
12655
+ function getDisplayTextForSetValueIf(element, formatStr, lt) {
12656
+ var name = lt.formatElName(element["name"]);
12657
+ var exp = element["setValueExpression"];
12658
+ if (!exp) {
12659
+ return getLogicString("trigger_setvalueEmptyText")["format"](name);
12660
+ }
12661
+ return formatStr["format"](name, exp);
12662
+ }
12556
12663
 
12557
12664
 
12558
12665
  /***/ }),
@@ -13748,6 +13855,10 @@ var TabTestPlugin = /** @class */ (function () {
13748
13855
  TabTestPlugin.prototype.setPreviewTheme = function (themeName) {
13749
13856
  this.simulatorTheme = survey_core__WEBPACK_IMPORTED_MODULE_1__["surveyCss"][themeName] || survey_core__WEBPACK_IMPORTED_MODULE_1__["surveyCss"][survey_core__WEBPACK_IMPORTED_MODULE_1__["defaultV2ThemeName"]];
13750
13857
  };
13858
+ TabTestPlugin.prototype.createVisibleUpdater = function () {
13859
+ var _this = this;
13860
+ return new survey_core__WEBPACK_IMPORTED_MODULE_1__["ComputedUpdater"](function () { return _this.creator.activeTab === "test"; });
13861
+ };
13751
13862
  TabTestPlugin.prototype.activate = function () {
13752
13863
  var _this = this;
13753
13864
  this.model = new _test__WEBPACK_IMPORTED_MODULE_4__["TestSurveyTabViewModel"](this.creator, this.simulatorTheme);
@@ -13925,18 +14036,26 @@ var TabTestPlugin = /** @class */ (function () {
13925
14036
  this.designerAction = new survey_core__WEBPACK_IMPORTED_MODULE_1__["Action"]({
13926
14037
  id: "svd-designer",
13927
14038
  iconName: "icon-config",
13928
- needSeparator: true,
13929
14039
  action: function () { _this.creator.makeNewViewActive("designer"); },
13930
- // active: <any>new ComputedUpdater<boolean>(() => this.creator.activeTab === "test"),
13931
- visible: new survey_core__WEBPACK_IMPORTED_MODULE_1__["ComputedUpdater"](function () {
13932
- return (_this.creator.activeTab === "test");
13933
- }),
14040
+ visible: this.createVisibleUpdater(),
13934
14041
  locTitleName: "ed.designer",
13935
14042
  showTitle: false
13936
14043
  });
14044
+ this.previewAction = new survey_core__WEBPACK_IMPORTED_MODULE_1__["Action"]({
14045
+ id: "svd-preview",
14046
+ iconName: "icon-preview",
14047
+ active: true,
14048
+ visible: this.createVisibleUpdater(),
14049
+ locTitleName: "ed.testSurvey",
14050
+ showTitle: false,
14051
+ action: function () { }
14052
+ });
13937
14053
  this.prevPageAction = new survey_core__WEBPACK_IMPORTED_MODULE_1__["Action"]({
13938
14054
  id: "prevPage",
13939
14055
  iconName: "icon-arrow-left_16x16",
14056
+ needSeparator: new survey_core__WEBPACK_IMPORTED_MODULE_1__["ComputedUpdater"](function () {
14057
+ return _this.creator.isMobileView;
14058
+ }),
13940
14059
  visible: false
13941
14060
  });
13942
14061
  this.nextPageAction = new survey_core__WEBPACK_IMPORTED_MODULE_1__["Action"]({
@@ -13947,12 +14066,12 @@ var TabTestPlugin = /** @class */ (function () {
13947
14066
  return items;
13948
14067
  };
13949
14068
  TabTestPlugin.prototype.addFooterActions = function () {
13950
- this.creator.footerToolbar.actions.push(this.testAgainAction);
13951
- this.invisibleToggleAction && (this.creator.footerToolbar.actions.push(this.invisibleToggleAction));
13952
- this.languageSelectorAction && (this.creator.footerToolbar.actions.push(this.languageSelectorAction));
14069
+ this.creator.footerToolbar.actions.push(this.designerAction);
14070
+ this.creator.footerToolbar.actions.push(this.previewAction);
13953
14071
  this.creator.footerToolbar.actions.push(this.prevPageAction);
13954
14072
  this.creator.footerToolbar.actions.push(this.nextPageAction);
13955
- this.creator.footerToolbar.actions.push(this.designerAction);
14073
+ this.invisibleToggleAction && (this.creator.footerToolbar.actions.push(this.invisibleToggleAction));
14074
+ // this.languageSelectorAction && (this.creator.footerToolbar.actions.push(this.languageSelectorAction));
13956
14075
  };
13957
14076
  return TabTestPlugin;
13958
14077
  }());
@@ -14043,12 +14162,8 @@ var TestSurveyTabViewModel = /** @class */ (function (_super) {
14043
14162
  TestSurveyTabViewModel.prototype.updateSimulatorSurvey = function (json, theme) {
14044
14163
  var _this = this;
14045
14164
  var newSurvey = this.surveyProvider.createSurvey(json || {}, "test", this);
14046
- if (this.surveyProvider.showThemeTab) {
14047
- newSurvey.applyTheme(this.surveyProvider.theme);
14048
- }
14049
- else {
14050
- newSurvey.setCss(theme, false);
14051
- }
14165
+ newSurvey.applyTheme(this.surveyProvider.theme);
14166
+ newSurvey.setCss(theme, false);
14052
14167
  newSurvey.fitToContainer = true;
14053
14168
  newSurvey.addLayoutElement({
14054
14169
  id: "complete-customization",
@@ -14412,6 +14527,9 @@ var ThemeBuilder = /** @class */ (function (_super) {
14412
14527
  _this.themeEditorSurveyValue = _this.createThemeEditorSurvey();
14413
14528
  _this.loadTheme(_this.surveyProvider.theme);
14414
14529
  _this.undoRedoManager = new _plugins_undo_redo_undo_redo_manager__WEBPACK_IMPORTED_MODULE_10__["UndoRedoManager"]();
14530
+ _this.surveyProvider.onPropertyChanged.add(function (sender, options) {
14531
+ _this.creatorPropertyChanged(sender, options);
14532
+ });
14415
14533
  return _this;
14416
14534
  }
14417
14535
  Object.defineProperty(ThemeBuilder.prototype, "themeCssCustomizations", {
@@ -14458,7 +14576,8 @@ var ThemeBuilder = /** @class */ (function (_super) {
14458
14576
  });
14459
14577
  Object.defineProperty(ThemeBuilder.prototype, "isPageToolbarVisible", {
14460
14578
  get: function () {
14461
- return this.pages.visibleActions.length > 0 && !this.surveyProvider.isMobileView;
14579
+ // return this.pages.visibleActions.length > 0 && !this.surveyProvider.isMobileView;
14580
+ return false;
14462
14581
  },
14463
14582
  enumerable: false,
14464
14583
  configurable: true
@@ -14499,7 +14618,7 @@ var ThemeBuilder = /** @class */ (function (_super) {
14499
14618
  Object(_utils_utils__WEBPACK_IMPORTED_MODULE_6__["assign"])(effectiveThemeCssVariables, _themes__WEBPACK_IMPORTED_MODULE_11__["Themes"]["default-light"].cssVariables || {}, this.findSuitableTheme(this.themeName).cssVariables || {});
14500
14619
  Object(_utils_utils__WEBPACK_IMPORTED_MODULE_6__["assign"])(effectiveThemeCssVariables, theme.cssVariables || {}, this.themeCssVariablesChanges);
14501
14620
  var effectiveTheme = {};
14502
- Object(_utils_utils__WEBPACK_IMPORTED_MODULE_6__["assign"])(effectiveTheme, theme, { cssVariables: effectiveThemeCssVariables });
14621
+ Object(_utils_utils__WEBPACK_IMPORTED_MODULE_6__["assign"])(effectiveTheme, theme, { cssVariables: effectiveThemeCssVariables, themeName: this.themeName, colorPalette: this.themePalette, isPanelless: this.themeMode === "lightweight" });
14503
14622
  this.surveyProvider.theme = effectiveTheme;
14504
14623
  this.initializeColorCalculator();
14505
14624
  this.loadThemeIntoPropertyGrid();
@@ -14527,6 +14646,7 @@ var ThemeBuilder = /** @class */ (function (_super) {
14527
14646
  this.setTheme(theme);
14528
14647
  };
14529
14648
  ThemeBuilder.prototype.updateSimulatorSurvey = function (json, theme) {
14649
+ var _this = this;
14530
14650
  var newSurvey = this.surveyProvider.createSurvey(json || {}, "theme", this);
14531
14651
  newSurvey.setCss(theme, false);
14532
14652
  newSurvey.fitToContainer = true;
@@ -14569,6 +14689,7 @@ var ThemeBuilder = /** @class */ (function (_super) {
14569
14689
  });
14570
14690
  this.survey.onPageVisibleChanged.add(function (sender, options) {
14571
14691
  self.updatePageItem(options.page);
14692
+ _this.updatePrevNextPageActionState();
14572
14693
  });
14573
14694
  };
14574
14695
  ThemeBuilder.prototype.setJSON = function (json, currTheme) {
@@ -14580,18 +14701,25 @@ var ThemeBuilder = /** @class */ (function (_super) {
14580
14701
  }
14581
14702
  this.updateSimulatorSurvey(json, currTheme);
14582
14703
  };
14704
+ ThemeBuilder.prototype.creatorPropertyChanged = function (sender, options) {
14705
+ if (options.name === "isMobileView") {
14706
+ this.updateVisibilityOfPropertyGridGroups();
14707
+ }
14708
+ };
14583
14709
  ThemeBuilder.prototype.initialize = function (json, options) {
14584
- this.blockThemeChangedNotifications += 1;
14710
+ this.blockChanges = true;
14585
14711
  try {
14586
14712
  this.setJSON(json, this.startThemeClasses);
14587
14713
  this.updatePageList();
14714
+ this.updatePropertyGridEditors(this.themeEditorSurvey);
14588
14715
  this.updatePropertyGridEditorsAvailability();
14716
+ this.buildActions();
14589
14717
  if (options.showPagesInTestSurveyTab !== undefined) {
14590
14718
  this.showPagesInTestSurveyTab = options.showPagesInTestSurveyTab;
14591
14719
  }
14592
14720
  }
14593
14721
  finally {
14594
- this.blockThemeChangedNotifications -= 1;
14722
+ this.blockChanges = false;
14595
14723
  }
14596
14724
  };
14597
14725
  ThemeBuilder.prototype.updatePageItem = function (page) {
@@ -14639,8 +14767,69 @@ var ThemeBuilder = /** @class */ (function (_super) {
14639
14767
  ThemeBuilder.prototype.testAgain = function () {
14640
14768
  this.setJSON(this.json, this.simulator.survey.css);
14641
14769
  this.updatePageList();
14770
+ this.updatePropertyGridEditors(this.themeEditorSurvey);
14642
14771
  this.show();
14643
14772
  };
14773
+ ThemeBuilder.prototype.buildActions = function () {
14774
+ var _this = this;
14775
+ var pageActions = [];
14776
+ var setNearPage = function (isNext) {
14777
+ var currentIndex = _this.survey.currentPageNo;
14778
+ var shift = isNext ? 1 : -1;
14779
+ var newIndex = currentIndex + shift;
14780
+ if (_this.survey.state === "starting" && isNext) {
14781
+ newIndex = 0;
14782
+ }
14783
+ var nearPage = _this.survey.visiblePages[newIndex];
14784
+ if (!isNext && currentIndex === 0 && _this.survey.firstPageIsStarted
14785
+ && _this.survey.pages.length > 0) {
14786
+ nearPage = _this.survey.pages[0];
14787
+ }
14788
+ var pageIndex = _this.survey.pages.indexOf(nearPage);
14789
+ _this.activePage = _this.survey.pages[pageIndex];
14790
+ };
14791
+ if (this.prevPageAction) {
14792
+ this.prevPageAction.visible = new survey_core__WEBPACK_IMPORTED_MODULE_2__["ComputedUpdater"](function () {
14793
+ var isRunning = _this.survey.state === "running";
14794
+ var isActiveTab = _this.surveyProvider.activeTab === "theme";
14795
+ return _this.surveyProvider.isMobileView && Object(_utils_utils__WEBPACK_IMPORTED_MODULE_6__["notShortCircuitAnd"])(_this.isRunning, isActiveTab, _this.pageListItems.length > 1) && isRunning;
14796
+ });
14797
+ this.prevPageAction.iconName = new survey_core__WEBPACK_IMPORTED_MODULE_2__["ComputedUpdater"](function () {
14798
+ return _this.surveyProvider.isMobileView ? "icon-arrow-left" : "icon-arrow-left_16x16";
14799
+ });
14800
+ this.prevPageAction.iconSize = new survey_core__WEBPACK_IMPORTED_MODULE_2__["ComputedUpdater"](function () {
14801
+ return _this.surveyProvider.isMobileView ? 24 : 16;
14802
+ });
14803
+ this.prevPageAction.action = function () { return setNearPage(false); };
14804
+ pageActions.push(this.prevPageAction);
14805
+ }
14806
+ if (this.nextPageAction) {
14807
+ this.nextPageAction.visible = new survey_core__WEBPACK_IMPORTED_MODULE_2__["ComputedUpdater"](function () {
14808
+ var isRunning = _this.survey.state === "running";
14809
+ var isActiveTab = _this.surveyProvider.activeTab === "theme";
14810
+ return _this.surveyProvider.isMobileView && Object(_utils_utils__WEBPACK_IMPORTED_MODULE_6__["notShortCircuitAnd"])(_this.isRunning, isActiveTab, _this.pageListItems.length > 1) && isRunning;
14811
+ });
14812
+ this.nextPageAction.iconName = new survey_core__WEBPACK_IMPORTED_MODULE_2__["ComputedUpdater"](function () {
14813
+ return _this.surveyProvider.isMobileView ? "icon-arrow-right" : "icon-arrow-right_16x16";
14814
+ });
14815
+ this.nextPageAction.iconSize = new survey_core__WEBPACK_IMPORTED_MODULE_2__["ComputedUpdater"](function () {
14816
+ return _this.surveyProvider.isMobileView ? 24 : 16;
14817
+ });
14818
+ this.nextPageAction.action = function () { return setNearPage(true); };
14819
+ pageActions.push(this.nextPageAction);
14820
+ }
14821
+ this.pages.actions = pageActions;
14822
+ this.pages.containerCss = "sv-action-bar--pages";
14823
+ this.updatePrevNextPageActionState();
14824
+ };
14825
+ ThemeBuilder.prototype.updatePrevNextPageActionState = function () {
14826
+ if (!this.prevPageAction || !this.survey)
14827
+ return;
14828
+ var isPrevEnabled = this.survey.firstPageIsStarted && this.survey.state !== "starting" || (!this.survey.firstPageIsStarted && !this.survey.isFirstPage);
14829
+ this.prevPageAction.enabled = isPrevEnabled;
14830
+ var isNextEnabled = this.survey && this.survey.visiblePages.indexOf(this.activePage) !== this.survey.visiblePages.length - 1;
14831
+ this.nextPageAction.enabled = isNextEnabled;
14832
+ };
14644
14833
  Object.defineProperty(ThemeBuilder.prototype, "availableThemes", {
14645
14834
  get: function () {
14646
14835
  return [].concat(this._availableThemes);
@@ -14669,6 +14858,12 @@ var ThemeBuilder = /** @class */ (function (_super) {
14669
14858
  }
14670
14859
  return null;
14671
14860
  };
14861
+ ThemeBuilder.prototype.getPredefinedColorsItemValues = function () {
14862
+ var _this = this;
14863
+ return Object.keys(_themes__WEBPACK_IMPORTED_MODULE_11__["PredefinedColors"][this.themePalette]).map(function (colorName) {
14864
+ return new survey_core__WEBPACK_IMPORTED_MODULE_2__["ItemValue"](_themes__WEBPACK_IMPORTED_MODULE_11__["PredefinedColors"][_this.themePalette][colorName], Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_3__["getLocString"])("theme.colors." + colorName));
14865
+ });
14866
+ };
14672
14867
  ThemeBuilder.prototype.initializeColorCalculator = function () {
14673
14868
  if (!this.currentTheme.cssVariables["--sjs-primary-backcolor"] ||
14674
14869
  !this.currentTheme.cssVariables["--sjs-primary-backcolor-light"] ||
@@ -14703,6 +14898,22 @@ var ThemeBuilder = /** @class */ (function (_super) {
14703
14898
  }
14704
14899
  return false;
14705
14900
  };
14901
+ ThemeBuilder.prototype.headerViewContainerPropertiesChanged = function (options) {
14902
+ var headerSettings = options.value[0];
14903
+ this.survey.headerView = headerSettings["headerView"];
14904
+ this.surveyProvider.survey.headerView = headerSettings["headerView"];
14905
+ if (headerSettings["headerView"] === "basic") {
14906
+ this.survey.logoPosition = headerSettings["logoPosition"];
14907
+ this.surveyProvider.survey.logoPosition = headerSettings["logoPosition"];
14908
+ }
14909
+ else {
14910
+ this.currentTheme.header = this.getCoverJson(headerSettings);
14911
+ this.setCoverCssVariables(headerSettings);
14912
+ }
14913
+ this.updateSimulatorTheme();
14914
+ this.raiseThemeChanged();
14915
+ this.raiseThemeModified(options);
14916
+ };
14706
14917
  ThemeBuilder.prototype.cssVariablePropertiesChanged = function (options) {
14707
14918
  var _a, _b;
14708
14919
  if (options.name.indexOf("--") === 0) {
@@ -14789,6 +15000,9 @@ var ThemeBuilder = /** @class */ (function (_super) {
14789
15000
  }
14790
15001
  return;
14791
15002
  }
15003
+ if (options.name === "headerViewContainer") {
15004
+ _this.headerViewContainerPropertiesChanged(options);
15005
+ }
14792
15006
  _this.cssVariablePropertiesChanged(options);
14793
15007
  _this.blockThemeChangedNotifications += 1;
14794
15008
  _this.updateDependentQuestionValues(options);
@@ -14813,21 +15027,33 @@ var ThemeBuilder = /** @class */ (function (_super) {
14813
15027
  };
14814
15028
  ThemeBuilder.prototype.findSuitableTheme = function (themeName) {
14815
15029
  var probeThemeFullName = Object(_themes__WEBPACK_IMPORTED_MODULE_11__["getThemeFullName"])({ themeName: themeName, colorPalette: this.themePalette, isPanelless: this.themeMode === "lightweight" });
14816
- var suitableTheme = _themes__WEBPACK_IMPORTED_MODULE_11__["Themes"][probeThemeFullName];
14817
- if (!!suitableTheme) {
14818
- return suitableTheme;
15030
+ return Object(_themes__WEBPACK_IMPORTED_MODULE_11__["findSuitableTheme"])(themeName, probeThemeFullName);
15031
+ };
15032
+ ThemeBuilder.prototype.getCoverJson = function (headerSettings) {
15033
+ var result = {};
15034
+ survey_core__WEBPACK_IMPORTED_MODULE_2__["Serializer"].getProperties("cover").map(function (pr) { return pr.name; })
15035
+ .filter(function (key) { return headerSettings[key] !== undefined && headerSettings[key] !== null; })
15036
+ .forEach(function (key) {
15037
+ result[key] = headerSettings[key];
15038
+ });
15039
+ result["backgroundImageOpacity"] = headerSettings["backgroundImageOpacity"] / 100;
15040
+ return result;
15041
+ };
15042
+ ThemeBuilder.prototype.setCoverCssVariables = function (headerSettings) {
15043
+ var coverBackgroundColorValue = "trasparent";
15044
+ if (headerSettings["backgroundColorSwitch"] === "accentColor") {
15045
+ coverBackgroundColorValue = this.currentTheme.cssVariables["--sjs-primary-backcolor"];
14819
15046
  }
14820
- var appropriateThemeNames = Object.keys(_themes__WEBPACK_IMPORTED_MODULE_11__["Themes"]).filter(function (fullName) { return fullName.indexOf(themeName) === 0; });
14821
- for (var _i = 0, appropriateThemeNames_1 = appropriateThemeNames; _i < appropriateThemeNames_1.length; _i++) {
14822
- var fullThemeName = appropriateThemeNames_1[_i];
14823
- if (fullThemeName.indexOf(themeName + "-" + this.themePalette) === 0) {
14824
- probeThemeFullName = themeName + "-" + this.themePalette;
14825
- }
14826
- if (fullThemeName.indexOf(themeName + "-" + this.themePalette + (this.themeMode === "lightweight" ? "-panelless" : "")) === 0) {
14827
- probeThemeFullName = themeName + "-" + this.themePalette + (this.themeMode === "lightweight" ? "-panelless" : "");
14828
- }
15047
+ else if (headerSettings["backgroundColorSwitch"] === "custom") {
15048
+ coverBackgroundColorValue = headerSettings.backgroundColor;
15049
+ }
15050
+ this.themeCssVariablesChanges["--sjs-cover-backcolor"] = coverBackgroundColorValue;
15051
+ if (!!headerSettings["titleForecolor"]) {
15052
+ this.themeCssVariablesChanges["--sjs-cover-title-forecolor"] = headerSettings.titleForecolor;
15053
+ }
15054
+ if (!!headerSettings["descriptionForecolor"]) {
15055
+ this.themeCssVariablesChanges["--sjs-cover-description-forecolor"] = headerSettings.descriptionForecolor;
14829
15056
  }
14830
- return _themes__WEBPACK_IMPORTED_MODULE_11__["Themes"][probeThemeFullName] || _themes__WEBPACK_IMPORTED_MODULE_11__["Themes"][appropriateThemeNames[0]];
14831
15057
  };
14832
15058
  ThemeBuilder.prototype.loadThemeIntoPropertyGrid = function () {
14833
15059
  this.blockChanges = true;
@@ -14844,6 +15070,62 @@ var ThemeBuilder = /** @class */ (function (_super) {
14844
15070
  this.blockChanges = false;
14845
15071
  }
14846
15072
  };
15073
+ ThemeBuilder.prototype.getBackgroundColorSwitchByValue = function (backgroundColor) {
15074
+ if (!backgroundColor)
15075
+ return "none";
15076
+ if (backgroundColor === this.currentTheme.cssVariables["--sjs-primary-backcolor"])
15077
+ return "accentColor";
15078
+ return "custom";
15079
+ };
15080
+ ThemeBuilder.prototype.updateVisibilityOfPropertyGridGroups = function () {
15081
+ var page = this.themeEditorSurvey.pages[0];
15082
+ page.getElementByName("groupHeader").visible = this.surveyProvider.isMobileView ? false : _creator_settings__WEBPACK_IMPORTED_MODULE_7__["settings"].theme.allowEditHeaderSettings;
15083
+ page.getElementByName("groupAdvanced").visible = !this.surveyProvider.isMobileView;
15084
+ };
15085
+ ThemeBuilder.prototype.setCoverPropertiesFromSurvey = function (panel) {
15086
+ panel.getQuestionByName("headerView").value = this.survey.headerView;
15087
+ panel.getQuestionByName("logoPosition").value = this.survey.logoPosition;
15088
+ panel.getQuestionByName("logoPositionX").readOnly = !this.survey.logo;
15089
+ panel.getQuestionByName("logoPositionY").readOnly = !this.survey.logo;
15090
+ panel.getQuestionByName("logoPosition").readOnly = !this.survey.logo;
15091
+ panel.getQuestionByName("titlePositionX").readOnly = !this.survey.title;
15092
+ panel.getQuestionByName("titlePositionY").readOnly = !this.survey.title;
15093
+ panel.getQuestionByName("descriptionPositionX").readOnly = !this.survey.description;
15094
+ panel.getQuestionByName("descriptionPositionY").readOnly = !this.survey.description;
15095
+ };
15096
+ ThemeBuilder.prototype.setCoverColorsFromThemeVariables = function (question, cssVariable) {
15097
+ if (!!question && !!cssVariable) {
15098
+ question.value = cssVariable;
15099
+ }
15100
+ };
15101
+ ThemeBuilder.prototype.updateHeaderViewContainerEditors = function (themeCssVariables) {
15102
+ var _this = this;
15103
+ this.updateVisibilityOfPropertyGridGroups();
15104
+ var headerViewContainerQuestion = this.themeEditorSurvey.getQuestionByName("headerViewContainer");
15105
+ var panel = headerViewContainerQuestion.panels[0];
15106
+ panel.getQuestionByName("backgroundColor").choices = this.getPredefinedColorsItemValues();
15107
+ if (!!this.survey) {
15108
+ this.setCoverPropertiesFromSurvey(panel);
15109
+ }
15110
+ if (!!this.currentTheme.header) {
15111
+ Object.keys(this.currentTheme.header).forEach(function (key) {
15112
+ var question = panel.getQuestionByName(key);
15113
+ if (!!question && key === "backgroundImageOpacity") {
15114
+ question.value = _this.currentTheme.header[key] * 100;
15115
+ }
15116
+ else if (question) {
15117
+ question.value = _this.currentTheme.header[key];
15118
+ }
15119
+ });
15120
+ this.setCoverColorsFromThemeVariables(panel.getQuestionByName("titleForecolor"), themeCssVariables["--sjs-cover-title-forecolor"] || themeCssVariables["--sjs-general-dim-forecolor"]);
15121
+ this.setCoverColorsFromThemeVariables(panel.getQuestionByName("descriptionForecolor"), themeCssVariables["--sjs-cover-description-forecolor"] || themeCssVariables["--sjs-general-dim-forecolor-light"]);
15122
+ this.setCoverColorsFromThemeVariables(panel.getQuestionByName("backgroundColor"), themeCssVariables["--sjs-cover-backcolor"]);
15123
+ var backgroundColorValue = themeCssVariables["--sjs-cover-backcolor"];
15124
+ if (!!backgroundColorValue) {
15125
+ panel.getQuestionByName("backgroundColorSwitch").value = this.getBackgroundColorSwitchByValue(backgroundColorValue);
15126
+ }
15127
+ }
15128
+ };
14847
15129
  ThemeBuilder.prototype.updatePropertyGridEditorsAvailability = function () {
14848
15130
  var isCustomTheme = _themes__WEBPACK_IMPORTED_MODULE_11__["PredefinedThemes"].indexOf(this.themeName) === -1;
14849
15131
  this.themeEditorSurvey.getQuestionByName("themeMode").readOnly = isCustomTheme;
@@ -14874,6 +15156,7 @@ var ThemeBuilder = /** @class */ (function (_super) {
14874
15156
  themeEditorSurvey.getQuestionByName("backgroundImageAttachment").value = this.backgroundImageAttachment;
14875
15157
  themeEditorSurvey.getQuestionByName("generalPrimaryColor").value = themeEditorSurvey.getQuestionByName("--sjs-primary-backcolor").value;
14876
15158
  themeEditorSurvey.getQuestionByName("generalBackcolorDimColor").value = themeEditorSurvey.getQuestionByName("--sjs-general-backcolor-dim").value;
15159
+ this.updateHeaderViewContainerEditors(newCssVariables);
14877
15160
  Object(_theme_custom_questions_element_settings__WEBPACK_IMPORTED_MODULE_9__["elementSettingsFromCssVariable"])(themeEditorSurvey.getQuestionByName("questionPanel"), newCssVariables, newCssVariables["--sjs-general-backcolor"], newCssVariables["--sjs-general-backcolor-dark"]);
14878
15161
  Object(_theme_custom_questions_element_settings__WEBPACK_IMPORTED_MODULE_9__["elementSettingsFromCssVariable"])(themeEditorSurvey.getQuestionByName("editorPanel"), newCssVariables, newCssVariables["--sjs-general-backcolor-dim-light"], newCssVariables["--sjs-general-backcolor-dim-dark"]);
14879
15162
  Object(_theme_custom_questions_font_settings__WEBPACK_IMPORTED_MODULE_8__["fontsettingsFromCssVariable"])(themeEditorSurvey.getQuestionByName("surveyTitle"), newCssVariables);
@@ -14893,7 +15176,7 @@ var ThemeBuilder = /** @class */ (function (_super) {
14893
15176
  }
14894
15177
  themeEditorSurvey.getAllQuestions().forEach(function (question) {
14895
15178
  if (["color", "colorsettings"].indexOf(question.getType()) !== -1) {
14896
- question.choices = Object.keys(_themes__WEBPACK_IMPORTED_MODULE_11__["PredefinedColors"][_this.themePalette]).map(function (colorName) { return new survey_core__WEBPACK_IMPORTED_MODULE_2__["ItemValue"](_themes__WEBPACK_IMPORTED_MODULE_11__["PredefinedColors"][_this.themePalette][colorName], Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_3__["getLocString"])("theme.colors." + colorName)); });
15179
+ question.choices = _this.getPredefinedColorsItemValues();
14897
15180
  }
14898
15181
  });
14899
15182
  };
@@ -14917,6 +15200,7 @@ var ThemeBuilder = /** @class */ (function (_super) {
14917
15200
  questionErrorLocation: "bottom",
14918
15201
  elements: [{
14919
15202
  type: "panel",
15203
+ name: "groupGeneral",
14920
15204
  state: "expanded",
14921
15205
  title: Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_3__["getLocString"])("theme.groupGeneral"),
14922
15206
  elements: [
@@ -14953,16 +15237,204 @@ var ThemeBuilder = /** @class */ (function (_super) {
14953
15237
  defaultValue: "panels"
14954
15238
  }
14955
15239
  ]
14956
- },
15240
+ }
15241
+ ]
15242
+ }, {
15243
+ type: "panel",
15244
+ name: "groupHeader",
15245
+ state: "collapsed",
15246
+ title: Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_3__["getLocString"])("theme.groupHeader"),
15247
+ elements: [
14957
15248
  {
14958
15249
  type: "panel",
14959
15250
  elements: [
14960
15251
  {
14961
- type: "color",
14962
- name: "generalPrimaryColor",
14963
- title: Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_3__["getLocString"])("theme.primaryColor"),
14964
- descriptionLocation: "hidden",
14965
- },
15252
+ "type": "paneldynamic",
15253
+ "name": "headerViewContainer",
15254
+ "titleLocation": "hidden",
15255
+ "allowAddPanel": false,
15256
+ "allowRemovePanel": false,
15257
+ "panelCount": 1,
15258
+ "defaultValue": [
15259
+ {
15260
+ "headerView": "basic",
15261
+ "logoPosition": "right",
15262
+ "inheritWidthFrom": "survey",
15263
+ "backgroundColorSwitch": "none",
15264
+ "backgroundImageFit": "cover",
15265
+ "backgroundImageOpacity": 100,
15266
+ "overlapEnabled": false,
15267
+ "logoPositionX": "right",
15268
+ "logoPositionY": "top",
15269
+ "titlePositionX": "left",
15270
+ "titlePositionY": "bottom",
15271
+ "descriptionPositionX": "left",
15272
+ "descriptionPositionY": "bottom",
15273
+ "textAreaWidth": 512,
15274
+ "height": 256
15275
+ }
15276
+ ],
15277
+ "templateElements": [
15278
+ {
15279
+ type: "panel",
15280
+ questionTitleLocation: "top",
15281
+ elements: [
15282
+ {
15283
+ type: "buttongroup",
15284
+ name: "headerView",
15285
+ title: Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_3__["getLocString"])("theme.headerView"),
15286
+ choices: [
15287
+ { value: "basic", text: Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_3__["getLocString"])("theme.headerViewBasic") },
15288
+ { value: "advanced", text: Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_3__["getLocString"])("theme.headerViewAdvanced") }
15289
+ ]
15290
+ },
15291
+ {
15292
+ type: "buttongroup",
15293
+ name: "logoPosition",
15294
+ title: Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_3__["getLocString"])("theme.logoPosition"),
15295
+ visibleIf: "{panel.headerView} = 'basic'",
15296
+ choices: [
15297
+ { value: "left", text: Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_3__["getLocString"])("theme.horizontalAlignmentLeft") },
15298
+ { value: "right", text: Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_3__["getLocString"])("theme.horizontalAlignmentRight") }
15299
+ ],
15300
+ },
15301
+ {
15302
+ type: "spinedit",
15303
+ name: "height",
15304
+ title: Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_3__["getLocString"])("p.height"),
15305
+ descriptionLocation: "hidden",
15306
+ visibleIf: "{panel.headerView} = 'advanced'",
15307
+ unit: "px",
15308
+ min: 0
15309
+ },
15310
+ {
15311
+ type: "buttongroup",
15312
+ name: "inheritWidthFrom",
15313
+ title: Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_3__["getLocString"])("theme.coverInheritWidthFrom"),
15314
+ choices: [
15315
+ { value: "survey", text: Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_3__["getLocString"])("theme.coverInheritWidthFromSurvey") },
15316
+ { value: "page", text: Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_3__["getLocString"])("theme.coverInheritWidthFromPage") }
15317
+ ],
15318
+ visibleIf: "{panel.headerView} = 'advanced'",
15319
+ },
15320
+ {
15321
+ type: "spinedit",
15322
+ name: "textAreaWidth",
15323
+ title: Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_3__["getLocString"])("theme.coverTextAreaWidth"),
15324
+ descriptionLocation: "hidden",
15325
+ visibleIf: "{panel.headerView} = 'advanced'",
15326
+ unit: "px",
15327
+ min: 0
15328
+ }
15329
+ ]
15330
+ }, {
15331
+ type: "panel",
15332
+ questionTitleLocation: "top",
15333
+ visibleIf: "{panel.headerView} = 'advanced'",
15334
+ elements: [
15335
+ {
15336
+ type: "buttongroup",
15337
+ name: "backgroundColorSwitch",
15338
+ title: Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_3__["getLocString"])("theme.coverBackgroundColorSwitch"),
15339
+ choices: [
15340
+ { value: "none", text: Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_3__["getLocString"])("theme.coverBackgroundColorNone") },
15341
+ { value: "accentColor", text: Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_3__["getLocString"])("theme.coverBackgroundColorAccentColor") },
15342
+ { value: "custom", text: Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_3__["getLocString"])("theme.coverBackgroundColorCustom") },
15343
+ ],
15344
+ },
15345
+ {
15346
+ type: "color",
15347
+ name: "backgroundColor",
15348
+ enableIf: "{panel.backgroundColorSwitch} = 'custom'",
15349
+ titleLocation: "hidden",
15350
+ descriptionLocation: "hidden",
15351
+ },
15352
+ {
15353
+ type: "panel",
15354
+ title: Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_3__["getLocString"])("theme.backgroundImage"),
15355
+ elements: [
15356
+ {
15357
+ type: "fileedit",
15358
+ storeDataAsText: false,
15359
+ name: "backgroundImage",
15360
+ titleLocation: "hidden",
15361
+ acceptedTypes: "image/*",
15362
+ placeholder: "Browse..."
15363
+ },
15364
+ {
15365
+ type: "buttongroup",
15366
+ name: "backgroundImageFit",
15367
+ enableIf: "{panel.backgroundImage} notempty",
15368
+ titleLocation: "hidden",
15369
+ choices: [
15370
+ { value: "cover", text: Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_3__["getLocString"])("theme.backgroundImageFitCover") },
15371
+ { value: "fill", text: Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_3__["getLocString"])("theme.backgroundImageFitFill") },
15372
+ { value: "contain", text: Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_3__["getLocString"])("theme.backgroundImageFitContain") },
15373
+ { value: "tile", text: Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_3__["getLocString"])("theme.backgroundImageFitTile") },
15374
+ ],
15375
+ },
15376
+ {
15377
+ type: "spinedit",
15378
+ name: "backgroundImageOpacity",
15379
+ enableIf: "{panel.backgroundImage} notempty",
15380
+ titleLocation: "left",
15381
+ title: Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_3__["getLocString"])("theme.backgroundOpacity"),
15382
+ descriptionLocation: "hidden",
15383
+ unit: "%",
15384
+ min: 0,
15385
+ max: 100,
15386
+ step: 5
15387
+ },
15388
+ ]
15389
+ },
15390
+ {
15391
+ type: "color",
15392
+ name: "titleForecolor",
15393
+ title: Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_3__["getLocString"])("theme.coverTitleForecolor"),
15394
+ descriptionLocation: "hidden",
15395
+ },
15396
+ {
15397
+ type: "colorsettings",
15398
+ name: "descriptionForecolor",
15399
+ title: Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_3__["getLocString"])("theme.coverDescriptionForecolor"),
15400
+ descriptionLocation: "hidden",
15401
+ },
15402
+ {
15403
+ type: "boolean",
15404
+ name: "overlapEnabled",
15405
+ renderAs: "checkbox",
15406
+ title: Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_3__["getLocString"])("theme.coverOverlapEnabled"),
15407
+ titleLocation: "hidden",
15408
+ descriptionLocation: "hidden",
15409
+ }
15410
+ ]
15411
+ }, {
15412
+ type: "panel",
15413
+ questionTitleLocation: "top",
15414
+ visibleIf: "{panel.headerView} = 'advanced'",
15415
+ elements: [
15416
+ this.getHorizontalAlignment("logoPositionX", Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_3__["getLocString"])("theme.logoPosition"), "right"),
15417
+ this.getVerticalAlignment("logoPositionY", "top"),
15418
+ this.getHorizontalAlignment("titlePositionX", Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_3__["getLocString"])("theme.coverTitlePosition"), "left"),
15419
+ this.getVerticalAlignment("titlePositionY", "bottom"),
15420
+ this.getHorizontalAlignment("descriptionPositionX", Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_3__["getLocString"])("theme.coverDescriptionPosition"), "left"),
15421
+ this.getVerticalAlignment("descriptionPositionY", "bottom"),
15422
+ ]
15423
+ }
15424
+ ]
15425
+ }
15426
+ ]
15427
+ }
15428
+ ]
15429
+ }, {
15430
+ type: "panel",
15431
+ name: "groupBackground",
15432
+ state: "collapsed",
15433
+ title: Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_3__["getLocString"])("theme.groupBackground"),
15434
+ elements: [
15435
+ {
15436
+ type: "panel",
15437
+ elements: [
14966
15438
  {
14967
15439
  type: "color",
14968
15440
  name: "generalBackcolorDimColor",
@@ -14979,7 +15451,6 @@ var ThemeBuilder = /** @class */ (function (_super) {
14979
15451
  storeDataAsText: false,
14980
15452
  name: "backgroundImage",
14981
15453
  titleLocation: "hidden",
14982
- maxSize: this.surveyProvider.onUploadFile.isEmpty ? 65536 : undefined,
14983
15454
  acceptedTypes: "image/*",
14984
15455
  placeholder: "Browse..."
14985
15456
  },
@@ -15020,6 +15491,24 @@ var ThemeBuilder = /** @class */ (function (_super) {
15020
15491
  step: 5
15021
15492
  },
15022
15493
  ]
15494
+ }
15495
+ ]
15496
+ }
15497
+ ]
15498
+ }, {
15499
+ type: "panel",
15500
+ name: "groupAppearance",
15501
+ state: "collapsed",
15502
+ title: Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_3__["getLocString"])("theme.groupAppearance"),
15503
+ elements: [
15504
+ {
15505
+ type: "panel",
15506
+ elements: [
15507
+ {
15508
+ type: "color",
15509
+ name: "generalPrimaryColor",
15510
+ title: Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_3__["getLocString"])("theme.primaryColor"),
15511
+ descriptionLocation: "hidden",
15023
15512
  },
15024
15513
  {
15025
15514
  type: "spinedit",
@@ -15094,6 +15583,7 @@ var ThemeBuilder = /** @class */ (function (_super) {
15094
15583
  ]
15095
15584
  }, {
15096
15585
  type: "panel",
15586
+ name: "groupAdvanced",
15097
15587
  title: Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_3__["getLocString"])("theme.groupAdvanced"),
15098
15588
  state: "collapsed",
15099
15589
  elements: [
@@ -15332,6 +15822,32 @@ var ThemeBuilder = /** @class */ (function (_super) {
15332
15822
  };
15333
15823
  return themeEditorSurveyJSON;
15334
15824
  };
15825
+ ThemeBuilder.prototype.getHorizontalAlignment = function (questionName, title, defaultValue) {
15826
+ return {
15827
+ type: "buttongroup",
15828
+ name: questionName,
15829
+ title: title,
15830
+ choices: [
15831
+ { value: "left", text: Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_3__["getLocString"])("theme.horizontalAlignmentLeft") },
15832
+ { value: "center", text: Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_3__["getLocString"])("theme.horizontalAlignmentCenter") },
15833
+ { value: "right", text: Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_3__["getLocString"])("theme.horizontalAlignmentRight") },
15834
+ ],
15835
+ defaultValue: defaultValue
15836
+ };
15837
+ };
15838
+ ThemeBuilder.prototype.getVerticalAlignment = function (questionName, defaultValue) {
15839
+ return {
15840
+ type: "buttongroup",
15841
+ name: questionName,
15842
+ titleLocation: "hidden",
15843
+ choices: [
15844
+ { value: "top", text: Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_3__["getLocString"])("theme.verticalAlignmentTop") },
15845
+ { value: "middle", text: Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_3__["getLocString"])("theme.verticalAlignmentMiddle") },
15846
+ { value: "bottom", text: Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_3__["getLocString"])("theme.verticalAlignmentBottom") },
15847
+ ],
15848
+ defaultValue: defaultValue
15849
+ };
15850
+ };
15335
15851
  ThemeBuilder.prototype.dispose = function () {
15336
15852
  var _a;
15337
15853
  (_a = this.themeEditorSurveyValue) === null || _a === void 0 ? void 0 : _a.dispose();
@@ -15380,6 +15896,7 @@ var ThemeBuilder = /** @class */ (function (_super) {
15380
15896
  survey.currentPage = val;
15381
15897
  }
15382
15898
  }
15899
+ target.updatePrevNextPageActionState();
15383
15900
  }
15384
15901
  })
15385
15902
  ], ThemeBuilder.prototype, "activePage", void 0);
@@ -15874,8 +16391,24 @@ __webpack_require__.r(__webpack_exports__);
15874
16391
 
15875
16392
 
15876
16393
 
16394
+ function getObjectDiffs(obj1, obj2) {
16395
+ if (obj2 === void 0) { obj2 = {}; }
16396
+ var result = {};
16397
+ Object.keys(obj1).forEach(function (key) {
16398
+ if (typeof obj1[key] === "object") {
16399
+ result[key] = getObjectDiffs(obj1[key], obj2[key]);
16400
+ }
16401
+ else {
16402
+ if (obj1[key] !== undefined && obj1[key] != obj2[key]) {
16403
+ result[key] = obj1[key];
16404
+ }
16405
+ }
16406
+ });
16407
+ return result;
16408
+ }
15877
16409
  var ThemeTabPlugin = /** @class */ (function () {
15878
16410
  function ThemeTabPlugin(creator) {
16411
+ var _this = this;
15879
16412
  this.creator = creator;
15880
16413
  this.simulatorTheme = survey_core__WEBPACK_IMPORTED_MODULE_0__["surveyCss"][survey_core__WEBPACK_IMPORTED_MODULE_0__["defaultV2ThemeName"]];
15881
16414
  this._availableThemes = _themes__WEBPACK_IMPORTED_MODULE_4__["PredefinedThemes"];
@@ -15902,7 +16435,35 @@ var ThemeTabPlugin = /** @class */ (function () {
15902
16435
  this.createActions().forEach(function (action) { return creator.toolbar.actions.push(action); });
15903
16436
  this.sidebarTab = this.creator.sidebar.addTab("theme");
15904
16437
  this.sidebarTab.caption = _editorLocalization__WEBPACK_IMPORTED_MODULE_1__["editorLocalization"].getString("ed.themePropertyGridTitle");
16438
+ creator.registerShortcut("undo_theme", {
16439
+ name: "undo",
16440
+ affectedTab: "theme",
16441
+ hotKey: {
16442
+ ctrlKey: true,
16443
+ keyCode: 90,
16444
+ },
16445
+ macOsHotkey: {
16446
+ keyCode: 90,
16447
+ },
16448
+ execute: function () { return _this.undo(); }
16449
+ });
16450
+ creator.registerShortcut("redo_theme", {
16451
+ name: "redo",
16452
+ affectedTab: "theme",
16453
+ hotKey: {
16454
+ ctrlKey: true,
16455
+ keyCode: 89,
16456
+ },
16457
+ macOsHotkey: {
16458
+ keyCode: 89,
16459
+ },
16460
+ execute: function () { return _this.redo(); }
16461
+ });
15905
16462
  }
16463
+ ThemeTabPlugin.prototype.createVisibleUpdater = function () {
16464
+ var _this = this;
16465
+ return new survey_core__WEBPACK_IMPORTED_MODULE_0__["ComputedUpdater"](function () { return _this.creator.activeTab === "theme"; });
16466
+ };
15906
16467
  ThemeTabPlugin.prototype.activate = function () {
15907
16468
  this.model = new _theme_builder__WEBPACK_IMPORTED_MODULE_2__["ThemeBuilder"](this.creator, this.simulatorTheme);
15908
16469
  this.model.simulator.landscape = this.creator.previewOrientation != "portrait";
@@ -15910,10 +16471,6 @@ var ThemeTabPlugin = /** @class */ (function () {
15910
16471
  this.sidebarTab.model = this.model.themeEditorSurvey;
15911
16472
  this.sidebarTab.componentName = "survey-widget";
15912
16473
  this.creator.sidebar.activeTab = this.sidebarTab.id;
15913
- this.themeSettingsAction.visible = true;
15914
- this.resetTheme.visible = true;
15915
- this.importAction.visible = true;
15916
- this.exportAction.visible = true;
15917
16474
  };
15918
16475
  ThemeTabPlugin.prototype.update = function () {
15919
16476
  var _this = this;
@@ -15924,7 +16481,13 @@ var ThemeTabPlugin = /** @class */ (function () {
15924
16481
  };
15925
16482
  this.model.testAgainAction = this.testAgainAction;
15926
16483
  this.model.availableThemes = this.availableThemes;
16484
+ this.model.prevPageAction = this.prevPageAction;
16485
+ this.model.nextPageAction = this.nextPageAction;
15927
16486
  this.model.initialize(this.creator.JSON, options);
16487
+ if (this.creator.showInvisibleElementsInTestSurveyTab) {
16488
+ this.invisibleToggleAction.css = this.model.showInvisibleElements ? "sv-action-bar-item--active" : "";
16489
+ this.invisibleToggleAction.visible = this.model.isRunning;
16490
+ }
15928
16491
  this.updateUndeRedoActions();
15929
16492
  this.model.undoRedoManager.canUndoRedoCallback = function () {
15930
16493
  _this.updateUndeRedoActions();
@@ -15932,6 +16495,7 @@ var ThemeTabPlugin = /** @class */ (function () {
15932
16495
  this.model.show();
15933
16496
  this.model.onPropertyChanged.add(function (sender, options) {
15934
16497
  if (options.name === "isRunning") {
16498
+ _this.invisibleToggleAction && (_this.invisibleToggleAction.visible = _this.model.isRunning);
15935
16499
  _this.testAgainAction.visible = !_this.model.isRunning;
15936
16500
  }
15937
16501
  });
@@ -15958,10 +16522,7 @@ var ThemeTabPlugin = /** @class */ (function () {
15958
16522
  }
15959
16523
  this.sidebarTab.visible = false;
15960
16524
  this.testAgainAction.visible = false;
15961
- this.themeSettingsAction.visible = false;
15962
- this.resetTheme.visible = false;
15963
- this.importAction.visible = false;
15964
- this.exportAction.visible = false;
16525
+ this.invisibleToggleAction && (this.invisibleToggleAction.visible = false);
15965
16526
  return true;
15966
16527
  };
15967
16528
  ThemeTabPlugin.prototype.exportToFile = function (fileName) {
@@ -15985,6 +16546,36 @@ var ThemeTabPlugin = /** @class */ (function () {
15985
16546
  ThemeTabPlugin.prototype.createActions = function () {
15986
16547
  var _this = this;
15987
16548
  var items = [];
16549
+ this.designerAction = new survey_core__WEBPACK_IMPORTED_MODULE_0__["Action"]({
16550
+ id: "svd-designer",
16551
+ iconName: "icon-config",
16552
+ action: function () { _this.creator.makeNewViewActive("designer"); },
16553
+ visible: this.createVisibleUpdater(),
16554
+ locTitleName: "ed.designer",
16555
+ showTitle: false
16556
+ });
16557
+ this.prevPageAction = new survey_core__WEBPACK_IMPORTED_MODULE_0__["Action"]({
16558
+ id: "prevPage",
16559
+ iconName: "icon-arrow-left_16x16",
16560
+ needSeparator: new survey_core__WEBPACK_IMPORTED_MODULE_0__["ComputedUpdater"](function () {
16561
+ return _this.creator.isMobileView;
16562
+ }),
16563
+ visible: false
16564
+ });
16565
+ this.nextPageAction = new survey_core__WEBPACK_IMPORTED_MODULE_0__["Action"]({
16566
+ id: "nextPage",
16567
+ iconName: "icon-arrow-right_16x16",
16568
+ visible: false
16569
+ });
16570
+ this.previewAction = new survey_core__WEBPACK_IMPORTED_MODULE_0__["Action"]({
16571
+ id: "svd-preview",
16572
+ iconName: "icon-preview",
16573
+ active: true,
16574
+ visible: this.createVisibleUpdater(),
16575
+ locTitleName: "ed.testSurvey",
16576
+ showTitle: false,
16577
+ action: function () { }
16578
+ });
15988
16579
  this.testAgainAction = new survey_core__WEBPACK_IMPORTED_MODULE_0__["Action"]({
15989
16580
  id: "testSurveyAgain",
15990
16581
  visible: false,
@@ -15998,7 +16589,7 @@ var ThemeTabPlugin = /** @class */ (function () {
15998
16589
  iconName: "icon-undo",
15999
16590
  locTitleName: "ed.undo",
16000
16591
  showTitle: false,
16001
- visible: new survey_core__WEBPACK_IMPORTED_MODULE_0__["ComputedUpdater"](function () { return _this.creator.activeTab === "theme"; }),
16592
+ visible: this.createVisibleUpdater(),
16002
16593
  action: function () { return _this.undo(); }
16003
16594
  });
16004
16595
  this.redoAction = new survey_core__WEBPACK_IMPORTED_MODULE_0__["Action"]({
@@ -16006,7 +16597,7 @@ var ThemeTabPlugin = /** @class */ (function () {
16006
16597
  iconName: "icon-redo",
16007
16598
  locTitleName: "ed.redo",
16008
16599
  showTitle: false,
16009
- visible: new survey_core__WEBPACK_IMPORTED_MODULE_0__["ComputedUpdater"](function () { return _this.creator.activeTab === "theme"; }),
16600
+ visible: this.createVisibleUpdater(),
16010
16601
  action: function () { return _this.redo(); }
16011
16602
  });
16012
16603
  items.push(this.undoAction);
@@ -16017,9 +16608,7 @@ var ThemeTabPlugin = /** @class */ (function () {
16017
16608
  locTitleName: "ed.themeResetButton",
16018
16609
  locTooltipName: "ed.themeResetButton",
16019
16610
  mode: "small",
16020
- visible: new survey_core__WEBPACK_IMPORTED_MODULE_0__["ComputedUpdater"](function () {
16021
- return (_this.creator.activeTab === "theme");
16022
- }),
16611
+ visible: this.createVisibleUpdater(),
16023
16612
  action: function () {
16024
16613
  _this.model.resetTheme();
16025
16614
  }
@@ -16033,20 +16622,19 @@ var ThemeTabPlugin = /** @class */ (function () {
16033
16622
  _this.creator.setShowSidebar(true, true);
16034
16623
  }
16035
16624
  },
16625
+ visible: this.createVisibleUpdater(),
16036
16626
  active: new survey_core__WEBPACK_IMPORTED_MODULE_0__["ComputedUpdater"](function () { return _this.creator.showSidebar; }),
16037
16627
  pressed: new survey_core__WEBPACK_IMPORTED_MODULE_0__["ComputedUpdater"](function () { return _this.creator.showSidebar; }),
16038
16628
  locTitleName: "ed.themeSettings",
16039
16629
  locTooltipName: "ed.themeSettingsTooltip",
16040
- visible: false,
16041
16630
  showTitle: false
16042
16631
  });
16043
- items.push(this.themeSettingsAction);
16044
16632
  this.importAction = new survey_core__WEBPACK_IMPORTED_MODULE_0__["Action"]({
16045
16633
  id: "svc-theme-import",
16046
16634
  iconName: "icon-load",
16047
16635
  locTitleName: "ed.themeImportButton",
16048
16636
  locTooltipName: "ed.themeImportButton",
16049
- visible: false,
16637
+ visible: this.createVisibleUpdater(),
16050
16638
  mode: "small",
16051
16639
  component: "sv-action-bar-item",
16052
16640
  needSeparator: true,
@@ -16073,7 +16661,7 @@ var ThemeTabPlugin = /** @class */ (function () {
16073
16661
  iconName: "icon-download",
16074
16662
  locTitleName: "ed.themeExportButton",
16075
16663
  locTooltipName: "ed.themeExportButton",
16076
- visible: false,
16664
+ visible: this.createVisibleUpdater(),
16077
16665
  mode: "small",
16078
16666
  component: "sv-action-bar-item",
16079
16667
  action: function () {
@@ -16081,6 +16669,20 @@ var ThemeTabPlugin = /** @class */ (function () {
16081
16669
  }
16082
16670
  });
16083
16671
  items.push(this.exportAction);
16672
+ if (this.creator.showInvisibleElementsInTestSurveyTab) {
16673
+ this.invisibleToggleAction = new survey_core__WEBPACK_IMPORTED_MODULE_0__["Action"]({
16674
+ id: "showInvisible",
16675
+ iconName: "icon-invisible-items",
16676
+ mode: "small",
16677
+ locTitleName: "ts.showInvisibleElements",
16678
+ visible: false,
16679
+ action: function () {
16680
+ _this.model.showInvisibleElements = !_this.model.showInvisibleElements;
16681
+ _this.invisibleToggleAction.css = _this.model.showInvisibleElements ? "sv-action-bar-item--active" : "";
16682
+ _this.invisibleToggleAction.title = Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_1__["getLocString"])(!_this.model.showInvisibleElements ? "ts.showInvisibleElements" : "ts.hideInvisibleElements");
16683
+ }
16684
+ });
16685
+ }
16084
16686
  return items;
16085
16687
  };
16086
16688
  ThemeTabPlugin.prototype.undo = function () {
@@ -16109,8 +16711,12 @@ var ThemeTabPlugin = /** @class */ (function () {
16109
16711
  this.redoAction.enabled = _undoRedoManager.canRedo();
16110
16712
  };
16111
16713
  ThemeTabPlugin.prototype.addFooterActions = function () {
16112
- this.creator.footerToolbar.actions.push(this.testAgainAction);
16113
- this.creator.footerToolbar.actions.push(this.resetTheme);
16714
+ this.creator.footerToolbar.actions.push(this.designerAction);
16715
+ this.creator.footerToolbar.actions.push(this.previewAction);
16716
+ this.creator.footerToolbar.actions.push(this.prevPageAction);
16717
+ this.creator.footerToolbar.actions.push(this.nextPageAction);
16718
+ this.invisibleToggleAction && (this.creator.footerToolbar.actions.push(this.invisibleToggleAction));
16719
+ this.creator.footerToolbar.actions.push(this.themeSettingsAction);
16114
16720
  };
16115
16721
  Object.defineProperty(ThemeTabPlugin.prototype, "availableThemes", {
16116
16722
  get: function () {
@@ -16149,6 +16755,16 @@ var ThemeTabPlugin = /** @class */ (function () {
16149
16755
  }
16150
16756
  }
16151
16757
  };
16758
+ ThemeTabPlugin.prototype.getThemeChanges = function () {
16759
+ var fullTheme = this.creator.theme;
16760
+ var probeThemeFullName = Object(_themes__WEBPACK_IMPORTED_MODULE_4__["getThemeFullName"])(fullTheme);
16761
+ var baseTheme = Object(_themes__WEBPACK_IMPORTED_MODULE_4__["findSuitableTheme"])(fullTheme.themeName, probeThemeFullName);
16762
+ var themeChanges = getObjectDiffs(fullTheme, baseTheme);
16763
+ themeChanges.themeName = fullTheme.themeName || "default";
16764
+ themeChanges.colorPalette = fullTheme.colorPalette || "light";
16765
+ themeChanges.isPanelless = !!fullTheme.isPanelless;
16766
+ return themeChanges;
16767
+ };
16152
16768
  return ThemeTabPlugin;
16153
16769
  }());
16154
16770
 
@@ -16160,7 +16776,7 @@ var ThemeTabPlugin = /** @class */ (function () {
16160
16776
  /*!***************************************!*\
16161
16777
  !*** ./src/components/tabs/themes.ts ***!
16162
16778
  \***************************************/
16163
- /*! exports provided: Themes, PredefinedThemes, getThemeFullName, PredefinedColors */
16779
+ /*! exports provided: Themes, PredefinedThemes, getThemeFullName, PredefinedColors, findSuitableTheme */
16164
16780
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
16165
16781
 
16166
16782
  "use strict";
@@ -16169,6 +16785,7 @@ __webpack_require__.r(__webpack_exports__);
16169
16785
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PredefinedThemes", function() { return PredefinedThemes; });
16170
16786
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getThemeFullName", function() { return getThemeFullName; });
16171
16787
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PredefinedColors", function() { return PredefinedColors; });
16788
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "findSuitableTheme", function() { return findSuitableTheme; });
16172
16789
  /* harmony import */ var _utils_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../utils/utils */ "./src/utils/utils.ts");
16173
16790
  /* harmony import */ var survey_core_themes__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! survey-core/themes */ "./node_modules/survey-core/themes/index.js");
16174
16791
  /* harmony import */ var survey_core_themes__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(survey_core_themes__WEBPACK_IMPORTED_MODULE_1__);
@@ -16177,7 +16794,8 @@ __webpack_require__.r(__webpack_exports__);
16177
16794
  var Themes = {};
16178
16795
  var PredefinedThemes = ["default", "sharp", "borderless", "flat", "plain", "doubleborder", "layered", "solid", "threedimensional", "contrast"];
16179
16796
  function getThemeFullName(theme) {
16180
- var fullThemeName = theme["themeName"] + "-" + (theme["colorPalette"] || "light");
16797
+ var themeName = theme.themeName || "default";
16798
+ var fullThemeName = themeName + "-" + (theme.colorPalette || "light");
16181
16799
  if (theme.isPanelless === true) {
16182
16800
  fullThemeName += "-panelless";
16183
16801
  }
@@ -16212,6 +16830,23 @@ var PredefinedColors = {
16212
16830
  green: "rgba(140, 204, 90, 1)"
16213
16831
  }
16214
16832
  };
16833
+ function findSuitableTheme(themeName, probeThemeFullName) {
16834
+ var suitableTheme = Themes[probeThemeFullName];
16835
+ if (!!suitableTheme) {
16836
+ return suitableTheme;
16837
+ }
16838
+ var appropriateThemeNames = Object.keys(Themes).filter(function (fullName) { return fullName.indexOf(themeName) === 0; });
16839
+ for (var _i = 0, appropriateThemeNames_1 = appropriateThemeNames; _i < appropriateThemeNames_1.length; _i++) {
16840
+ var fullThemeName = appropriateThemeNames_1[_i];
16841
+ if (fullThemeName.indexOf(themeName + "-" + this.themePalette) === 0) {
16842
+ probeThemeFullName = themeName + "-" + this.themePalette;
16843
+ }
16844
+ if (fullThemeName.indexOf(themeName + "-" + this.themePalette + (this.themeMode === "lightweight" ? "-panelless" : "")) === 0) {
16845
+ probeThemeFullName = themeName + "-" + this.themePalette + (this.themeMode === "lightweight" ? "-panelless" : "");
16846
+ }
16847
+ }
16848
+ return Themes[probeThemeFullName] || Themes[appropriateThemeNames[0]];
16849
+ }
16215
16850
 
16216
16851
 
16217
16852
  /***/ }),
@@ -16387,42 +17022,11 @@ var TabTranslationPlugin = /** @class */ (function () {
16387
17022
  }
16388
17023
  });
16389
17024
  items.push(this.mergeLocaleWithDefaultAction);
16390
- this.importCsvAction = new survey_core__WEBPACK_IMPORTED_MODULE_0__["Action"]({
16391
- id: "svc-translation-import",
16392
- iconName: "icon-load",
16393
- locTitleName: "ed.translationImportFromSCVButton",
16394
- locTooltipName: "ed.translationImportFromSCVButton",
16395
- visible: false,
16396
- mode: "small",
16397
- component: "sv-action-bar-item",
16398
- needSeparator: true,
16399
- action: function () {
16400
- if (!document)
16401
- return;
16402
- if (!_this.inputFileElement) {
16403
- _this.inputFileElement = document.createElement("input");
16404
- _this.inputFileElement.type = "file";
16405
- _this.inputFileElement.style.display = "none";
16406
- _this.inputFileElement.onchange = function () {
16407
- _this.model.importFromCSVFileUI(_this.inputFileElement);
16408
- };
16409
- }
16410
- _this.inputFileElement.click();
16411
- }
16412
- });
17025
+ this.importCsvAction = Object(_translation__WEBPACK_IMPORTED_MODULE_2__["createImportCSVAction"])(function () { _this.model.importFromCSVFileDOM(); }, true);
17026
+ this.importCsvAction.visible = false;
16413
17027
  items.push(this.importCsvAction);
16414
- this.exportCsvAction = new survey_core__WEBPACK_IMPORTED_MODULE_0__["Action"]({
16415
- id: "svc-translation-export",
16416
- iconName: "icon-download",
16417
- locTitleName: "ed.translationExportToSCVButton",
16418
- locTooltipName: "ed.translationExportToSCVButton",
16419
- visible: false,
16420
- mode: "small",
16421
- component: "sv-action-bar-item",
16422
- action: function () {
16423
- _this.model.exportToCSVFileUI();
16424
- }
16425
- });
17028
+ this.exportCsvAction = Object(_translation__WEBPACK_IMPORTED_MODULE_2__["createExportCSVAction"])(function () { _this.model.exportToCSVFileUI(); });
17029
+ this.exportCsvAction.visible = false;
16426
17030
  items.push(this.exportCsvAction);
16427
17031
  return items;
16428
17032
  };
@@ -16517,6 +17121,7 @@ var translationCss = {
16517
17121
  logoImage: "st-logo__image",
16518
17122
  headerText: "st-header__text",
16519
17123
  navigationButton: "",
17124
+ bodyNavigationButton: "st-navigation-btn",
16520
17125
  completedPage: "st-completedpage",
16521
17126
  navigation: {
16522
17127
  complete: "st-btn st-footer__complete-btn",
@@ -16826,7 +17431,7 @@ var translationCss = {
16826
17431
  /*!********************************************!*\
16827
17432
  !*** ./src/components/tabs/translation.ts ***!
16828
17433
  \********************************************/
16829
- /*! exports provided: TranslationItemBase, TranslationItemString, TranslationItem, TranslationGroup, Translation */
17434
+ /*! exports provided: TranslationItemBase, TranslationItemString, TranslationItem, TranslationGroup, Translation, TranslationEditor, createImportCSVAction, createExportCSVAction */
16830
17435
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
16831
17436
 
16832
17437
  "use strict";
@@ -16836,6 +17441,9 @@ __webpack_require__.r(__webpack_exports__);
16836
17441
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TranslationItem", function() { return TranslationItem; });
16837
17442
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TranslationGroup", function() { return TranslationGroup; });
16838
17443
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Translation", function() { return Translation; });
17444
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TranslationEditor", function() { return TranslationEditor; });
17445
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createImportCSVAction", function() { return createImportCSVAction; });
17446
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createExportCSVAction", function() { return createExportCSVAction; });
16839
17447
  /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./src/entries/helpers.ts");
16840
17448
  /* harmony import */ var survey_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! survey-core */ "survey-core");
16841
17449
  /* harmony import */ var survey_core__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(survey_core__WEBPACK_IMPORTED_MODULE_1__);
@@ -16906,6 +17514,7 @@ var TranslationItemBase = /** @class */ (function (_super) {
16906
17514
  this.fireOnObjCreating();
16907
17515
  };
16908
17516
  TranslationItemBase.prototype.deleteLocaleStrings = function (locale) { };
17517
+ TranslationItemBase.prototype.applyEditLocale = function (locale) { };
16909
17518
  TranslationItemBase.prototype.fireOnObjCreating = function (obj) {
16910
17519
  if (obj === void 0) { obj = null; }
16911
17520
  if (this.translation) {
@@ -16928,7 +17537,7 @@ var TranslationItemString = /** @class */ (function (_super) {
16928
17537
  }
16929
17538
  TranslationItemString.prototype.onPropertyValueChanged = function (name, oldValue, newValue) {
16930
17539
  _super.prototype.onPropertyValueChanged.call(this, name, oldValue, newValue);
16931
- if (name === "text") {
17540
+ if (!this.isReadOnly && name === "text") {
16932
17541
  this.locString.setLocaleText(this.locale, newValue);
16933
17542
  }
16934
17543
  };
@@ -17007,9 +17616,17 @@ var TranslationItem = /** @class */ (function (_super) {
17007
17616
  !!this.translation.tranlationChangedCallback &&
17008
17617
  this.translation.tranlationChangedCallback(loc, this.name, newValue, this.context);
17009
17618
  };
17619
+ TranslationItem.prototype.applyEditLocale = function (locale) {
17620
+ var itemStr = this.values(locale);
17621
+ if (!!itemStr && !!itemStr.text) {
17622
+ this.setLocText(locale, itemStr.text);
17623
+ }
17624
+ };
17010
17625
  TranslationItem.prototype.values = function (loc) {
17626
+ var _a;
17011
17627
  if (!this.hashValues[loc]) {
17012
17628
  var val = new TranslationItemString(this.locString, loc);
17629
+ val.isReadOnly = !!((_a = this.translation) === null || _a === void 0 ? void 0 : _a.getEditLocale());
17013
17630
  if (!loc) {
17014
17631
  val.placeholder = this.defaultValue;
17015
17632
  }
@@ -17030,7 +17647,22 @@ var TranslationItem = /** @class */ (function (_super) {
17030
17647
  }
17031
17648
  };
17032
17649
  TranslationItem.prototype.toJSON = function () {
17650
+ var _this = this;
17033
17651
  var json = this.locString.getJson();
17652
+ var keys = Object.keys(this.hashValues);
17653
+ if (keys.length > 0) {
17654
+ keys.forEach(function (loc) {
17655
+ var text = _this.hashValues[loc].text;
17656
+ if (!!text) {
17657
+ if (!json)
17658
+ json = {};
17659
+ if (typeof json === "string") {
17660
+ json = { default: json };
17661
+ }
17662
+ json[loc] = text;
17663
+ }
17664
+ });
17665
+ }
17034
17666
  json = this.correctJSON(json);
17035
17667
  if (!json || typeof json === "string")
17036
17668
  return { default: json };
@@ -17061,8 +17693,16 @@ var TranslationItem = /** @class */ (function (_super) {
17061
17693
  TranslationItem.prototype.deleteLocaleStrings = function (locale) {
17062
17694
  this.setLocText(locale, undefined);
17063
17695
  };
17696
+ TranslationItem.prototype.getDefaultLocaleText = function () {
17697
+ var res = this.locString.getLocaleText("");
17698
+ if (!res) {
17699
+ res = this.getPlaceholder("");
17700
+ }
17701
+ return res;
17702
+ };
17064
17703
  TranslationItem.prototype.getPlaceholder = function (locale) {
17065
- var placeholderText = _editorLocalization__WEBPACK_IMPORTED_MODULE_3__["editorLocalization"].getString("ed.translationPlaceHolder", locale);
17704
+ var textLocale = !!locale && locale !== "default" ? locale : survey_core__WEBPACK_IMPORTED_MODULE_1__["surveyLocalization"].defaultLocale;
17705
+ var placeholderText = _editorLocalization__WEBPACK_IMPORTED_MODULE_3__["editorLocalization"].getString("ed.translationPlaceHolder", textLocale);
17066
17706
  if (this.context instanceof survey_core__WEBPACK_IMPORTED_MODULE_1__["SurveyModel"]) {
17067
17707
  return survey_core__WEBPACK_IMPORTED_MODULE_1__["surveyLocalization"].getString(this.name, locale) || placeholderText;
17068
17708
  }
@@ -17286,6 +17926,9 @@ var TranslationGroup = /** @class */ (function (_super) {
17286
17926
  TranslationGroup.prototype.deleteLocaleStrings = function (locale) {
17287
17927
  this.items.forEach(function (item) { return item.deleteLocaleStrings(locale); });
17288
17928
  };
17929
+ TranslationGroup.prototype.applyEditLocale = function (locale) {
17930
+ this.items.forEach(function (item) { return item.applyEditLocale(locale); });
17931
+ };
17289
17932
  TranslationGroup.prototype.fillItems = function () {
17290
17933
  if (this.isItemValueArray(this.obj)) {
17291
17934
  this.createItemValuesLocale();
@@ -17333,7 +17976,7 @@ var TranslationGroup = /** @class */ (function (_super) {
17333
17976
  var properties = survey_core__WEBPACK_IMPORTED_MODULE_1__["Serializer"].getPropertiesByObj(obj);
17334
17977
  for (var i = 0; i < properties.length; i++) {
17335
17978
  var property = properties[i];
17336
- if (!property.isSerializable || !property.isLocalizable)
17979
+ if (!property.isSerializable || !property.isLocalizable || property.type === "url" || property.type === "file")
17337
17980
  continue;
17338
17981
  if (property.readOnly || !property.visible)
17339
17982
  continue;
@@ -17361,12 +18004,16 @@ var TranslationGroup = /** @class */ (function (_super) {
17361
18004
  return true;
17362
18005
  };
17363
18006
  TranslationGroup.prototype.createTranslationItem = function (obj, property) {
18007
+ var _a;
17364
18008
  var defaultValue = this.getDefaultValue(obj, property);
17365
18009
  var locStr = obj[property.serializationProperty];
17366
18010
  if (!locStr)
17367
18011
  return null;
17368
18012
  if (!this.showAllStrings && !defaultValue && locStr.isEmpty)
17369
18013
  return null;
18014
+ var editLocale = (_a = this.translation) === null || _a === void 0 ? void 0 : _a.getEditLocale();
18015
+ if (!!editLocale && !!locStr.getLocaleText(editLocale))
18016
+ return null;
17370
18017
  if (!this.canShowProperty(property, locStr.isEmpty))
17371
18018
  return null;
17372
18019
  return new TranslationItem(property.name, locStr, defaultValue, this.translation, obj, property);
@@ -17414,9 +18061,14 @@ var TranslationGroup = /** @class */ (function (_super) {
17414
18061
  }
17415
18062
  };
17416
18063
  TranslationGroup.prototype.createItemValuesLocale = function () {
18064
+ var _a;
18065
+ var editMode = (_a = this.translation) === null || _a === void 0 ? void 0 : _a.getEditLocale();
17417
18066
  for (var i = 0; i < this.obj.length; i++) {
17418
18067
  var val = this.obj[i];
17419
18068
  var canAdd = this.showAllStrings || !val.locText.isEmpty || isNaN(val.value);
18069
+ if (!!editMode && val.locText.getLocaleText(editMode)) {
18070
+ canAdd = false;
18071
+ }
17420
18072
  if (!canAdd)
17421
18073
  continue;
17422
18074
  var item = new TranslationItem(val.value, val.locText, val.value, this.translation, val);
@@ -17476,6 +18128,21 @@ var Translation = /** @class */ (function (_super) {
17476
18128
  Translation.prototype.getType = function () {
17477
18129
  return "translation";
17478
18130
  };
18131
+ Translation.prototype.getEditLocale = function () { return this.editLocale; };
18132
+ Translation.prototype.setEditMode = function (locale) {
18133
+ this.editLocale = locale;
18134
+ this.addLocale(locale);
18135
+ };
18136
+ Object.defineProperty(Translation.prototype, "isEditMode", {
18137
+ get: function () { return !!this.editLocale; },
18138
+ enumerable: false,
18139
+ configurable: true
18140
+ });
18141
+ Translation.prototype.applyEditLocale = function () {
18142
+ if (!this.isEditMode || !this.root)
18143
+ return;
18144
+ this.root.applyEditLocale(this.editLocale);
18145
+ };
17479
18146
  Translation.prototype.makeObservable = function (onBaseObjCreating) {
17480
18147
  this.onBaseObjCreatingCallback = onBaseObjCreating;
17481
18148
  this.fireOnObjCreating(this);
@@ -17540,6 +18207,17 @@ var Translation = /** @class */ (function (_super) {
17540
18207
  });
17541
18208
  res.onGetMatrixRowActions.add(function (sender, options) {
17542
18209
  Object(_utils_actions__WEBPACK_IMPORTED_MODULE_9__["updateMatrixRemoveAction"])(options.question, options.actions, options.row);
18210
+ if (_this.options.getHasMachineTranslation() && Object(_utils_actions__WEBPACK_IMPORTED_MODULE_9__["findAction"])(options.actions, "remove-row")) {
18211
+ var q = options.question;
18212
+ var rowIndex = q.visibleRows.indexOf(options.row);
18213
+ var locale_1 = q.value[rowIndex].name;
18214
+ options.actions.splice(0, 0, new survey_core__WEBPACK_IMPORTED_MODULE_1__["Action"]({
18215
+ iconName: "icon-language",
18216
+ locTooltipName: "ed.translateUsigAI",
18217
+ location: "end",
18218
+ action: function () { return _this.showTranslationEditor(locale_1); }
18219
+ }));
18220
+ }
17543
18221
  Object(_utils_actions__WEBPACK_IMPORTED_MODULE_9__["updateMatixActionsClasses"])(options.actions);
17544
18222
  });
17545
18223
  return res;
@@ -17568,7 +18246,7 @@ var Translation = /** @class */ (function (_super) {
17568
18246
  confirmDeleteText: _editorLocalization__WEBPACK_IMPORTED_MODULE_3__["editorLocalization"].getString("ed.translationDeleteLanguage"),
17569
18247
  columns: [
17570
18248
  { name: "isSelected", cellType: "boolean", renderAs: "checkbox", enableIf: "localeEnableIf()" },
17571
- { name: "displayName", cellType: "expression", expression: "row.displayName" }
18249
+ { name: "displayName", cellType: "expression", expression: "{row.displayName}" }
17572
18250
  ],
17573
18251
  showHeader: false,
17574
18252
  allowAddRows: false,
@@ -17593,6 +18271,20 @@ var Translation = /** @class */ (function (_super) {
17593
18271
  }
17594
18272
  return [usedLocales, locales];
17595
18273
  };
18274
+ Translation.prototype.importFromCSVFileDOM = function () {
18275
+ var _this = this;
18276
+ if (!document)
18277
+ return;
18278
+ if (!this.inputFileElement) {
18279
+ this.inputFileElement = document.createElement("input");
18280
+ this.inputFileElement.type = "file";
18281
+ this.inputFileElement.style.display = "none";
18282
+ this.inputFileElement.onchange = function () {
18283
+ _this.importFromCSVFileUI(_this.inputFileElement);
18284
+ };
18285
+ }
18286
+ this.inputFileElement.click();
18287
+ };
17596
18288
  Translation.prototype.updateSettingsSurveyLocales = function () {
17597
18289
  var _a = this.getSurveyLocales(), choices = _a[0], locales = _a[1];
17598
18290
  var selectedLocales = [];
@@ -17665,6 +18357,11 @@ var Translation = /** @class */ (function (_super) {
17665
18357
  });
17666
18358
  }
17667
18359
  });
18360
+ survey.onUpdatePanelCssClasses.add(function (sender, options) {
18361
+ if (options.panel["__translationHasIndent"]) {
18362
+ options.cssClasses.panel.content += " st-panel-indent";
18363
+ }
18364
+ });
17668
18365
  survey.currentPage = survey.pages[0];
17669
18366
  return survey;
17670
18367
  };
@@ -17711,14 +18408,15 @@ var Translation = /** @class */ (function (_super) {
17711
18408
  panel.addElement(pnl);
17712
18409
  pnl.title = item.text;
17713
18410
  if (item.hasIndent) {
17714
- pnl.cssClasses.panel.content += " st-panel-indent";
18411
+ pnl["__translationHasIndent"] = true;
17715
18412
  }
17716
18413
  this.addTranslationGroupIntoStringsSurvey(pnl, item);
17717
18414
  }
17718
18415
  };
17719
18416
  Translation.prototype.addLocaleColumns = function (matrix) {
17720
18417
  var locs = this.getSelectedLocales();
17721
- matrix.addColumn("default", this.getLocaleName(""));
18418
+ var defaultColumn = matrix.addColumn("default", this.getLocaleName(""));
18419
+ defaultColumn.readOnly = this.isEditMode;
17722
18420
  for (var i = 0; i < locs.length; i++) {
17723
18421
  matrix.addColumn(locs[i], this.getLocaleName(locs[i]));
17724
18422
  }
@@ -17731,6 +18429,12 @@ var Translation = /** @class */ (function (_super) {
17731
18429
  }
17732
18430
  return res;
17733
18431
  };
18432
+ Translation.prototype.updateStringsSurveyData = function () {
18433
+ var survey = this.stringsSurvey;
18434
+ if (survey) {
18435
+ survey.data = this.getStringsSurveyData(survey);
18436
+ }
18437
+ };
17734
18438
  Translation.prototype.getStringsQuestionData = function (matrix) {
17735
18439
  var res = {};
17736
18440
  for (var i = 0; i < matrix.rows.length; i++) {
@@ -18042,6 +18746,17 @@ var Translation = /** @class */ (function (_super) {
18042
18746
  this.setSelectedLocales([]);
18043
18747
  this.reset();
18044
18748
  };
18749
+ Translation.prototype.createTranslationEditor = function (locale) {
18750
+ var _this = this;
18751
+ var res = new TranslationEditor(this.survey, locale, this.options);
18752
+ res.onApply = function () {
18753
+ _this.reset();
18754
+ };
18755
+ return res;
18756
+ };
18757
+ Translation.prototype.showTranslationEditor = function (locale) {
18758
+ this.createTranslationEditor(locale).showDialog();
18759
+ };
18045
18760
  Translation.prototype.translateItemAfterRender = function (item, el, locale) {
18046
18761
  if (!this.translateItemAfterRenderCallback)
18047
18762
  return;
@@ -18150,6 +18865,156 @@ var Translation = /** @class */ (function (_super) {
18150
18865
  return Translation;
18151
18866
  }(survey_core__WEBPACK_IMPORTED_MODULE_1__["Base"]));
18152
18867
 
18868
+ var TranslationEditor = /** @class */ (function () {
18869
+ function TranslationEditor(survey, locale, options) {
18870
+ this.survey = survey;
18871
+ this.locale = locale;
18872
+ this.options = options;
18873
+ this.translationValue = new Translation(this.survey, options, true);
18874
+ this.translation.setEditMode(locale);
18875
+ this.translation.reset();
18876
+ this.setupNavigationButtons();
18877
+ }
18878
+ Object.defineProperty(TranslationEditor.prototype, "translation", {
18879
+ get: function () { return this.translationValue; },
18880
+ enumerable: false,
18881
+ configurable: true
18882
+ });
18883
+ TranslationEditor.prototype.showDialog = function () {
18884
+ var _this = this;
18885
+ var dialogTitle = _editorLocalization__WEBPACK_IMPORTED_MODULE_3__["editorLocalization"].getString("ed.translationDialogTitle") + " (" + this.translation.getLocaleName(this.locale) + ")";
18886
+ if (this.translation.stringsSurvey.getAllQuestions(true).length === 0) {
18887
+ var locStr = new survey_core__WEBPACK_IMPORTED_MODULE_1__["LocalizableString"](this.translation.stringsSurvey);
18888
+ locStr.text = _editorLocalization__WEBPACK_IMPORTED_MODULE_3__["editorLocalization"].getString("ed.translationNoStrings");
18889
+ var popup = survey_core__WEBPACK_IMPORTED_MODULE_1__["settings"].showDialog({
18890
+ componentName: "sv-string-viewer",
18891
+ data: { locStr: locStr, locString: locStr, model: locStr },
18892
+ onApply: function () { return true; },
18893
+ title: dialogTitle,
18894
+ displayMode: "popup"
18895
+ }, this.options.rootElement);
18896
+ var actions = popup.footerToolbar.actions;
18897
+ actions.splice(1, actions.length - 1);
18898
+ actions[0].title = "OK";
18899
+ return;
18900
+ }
18901
+ var popupModel = survey_core__WEBPACK_IMPORTED_MODULE_1__["settings"].showDialog({
18902
+ componentName: "survey",
18903
+ data: {
18904
+ survey: this.translation.stringsSurvey,
18905
+ model: this.translation.stringsSurvey
18906
+ },
18907
+ onApply: function () {
18908
+ _this.apply();
18909
+ return true;
18910
+ },
18911
+ onCancel: function () {
18912
+ _this.dispose();
18913
+ },
18914
+ cssClass: "sv-property-editor st-translation-dialog",
18915
+ title: dialogTitle,
18916
+ displayMode: this.options.isMobileView ? "overlay" : "popup"
18917
+ }, this.options.rootElement);
18918
+ popupModel.locale = _editorLocalization__WEBPACK_IMPORTED_MODULE_3__["editorLocalization"].currentLocale;
18919
+ };
18920
+ TranslationEditor.prototype.doMachineTranslation = function () {
18921
+ var _this = this;
18922
+ var fromLocale = this.translation.defaultLocale;
18923
+ if (!fromLocale)
18924
+ fromLocale = "en";
18925
+ var items = this.createStringsToTranslate();
18926
+ var strings = [];
18927
+ items.forEach(function (item) {
18928
+ strings.push(item.getDefaultLocaleText());
18929
+ });
18930
+ var callback = function (translatedStrings) {
18931
+ if (!Array.isArray(translatedStrings))
18932
+ return;
18933
+ for (var i = 0; i < Math.min(items.length, translatedStrings.length); i++) {
18934
+ items[i].values(_this.locale).text = translatedStrings[i];
18935
+ }
18936
+ _this.translation.updateStringsSurveyData();
18937
+ };
18938
+ this.options.doMachineTranslation(fromLocale, this.locale, strings, callback);
18939
+ };
18940
+ TranslationEditor.prototype.apply = function () {
18941
+ this.translation.applyEditLocale();
18942
+ if (this.onApply) {
18943
+ this.onApply();
18944
+ }
18945
+ this.dispose();
18946
+ };
18947
+ TranslationEditor.prototype.cancel = function () {
18948
+ this.dispose();
18949
+ };
18950
+ TranslationEditor.prototype.dispose = function () {
18951
+ this.translationValue.dispose();
18952
+ };
18953
+ TranslationEditor.prototype.setupNavigationButtons = function () {
18954
+ var _this = this;
18955
+ var survey = this.translation.stringsSurvey;
18956
+ var actions = survey.navigationBar.actions;
18957
+ actions.splice(0, actions.length);
18958
+ if (this.options.getHasMachineTranslation()) {
18959
+ survey.addNavigationItem(new survey_core__WEBPACK_IMPORTED_MODULE_1__["Action"]({
18960
+ id: "svc-translation-machine",
18961
+ iconName: "icon-language",
18962
+ css: "svc-translation-machine",
18963
+ locTitleName: "ed.translateUsigAI",
18964
+ component: "sv-action-bar-item",
18965
+ action: function () { _this.doMachineTranslation(); }
18966
+ }));
18967
+ }
18968
+ survey.addNavigationItem(createImportCSVAction(function () { _this.translation.importFromCSVFileDOM(); }, false, true));
18969
+ survey.addNavigationItem(createExportCSVAction(function () { _this.translation.exportToCSVFileUI(); }, true));
18970
+ survey.showNavigationButtons = "top";
18971
+ };
18972
+ TranslationEditor.prototype.createStringsToTranslate = function () {
18973
+ var res = new Array();
18974
+ this.addStringsToTranlate(this.translation.root, res);
18975
+ return res;
18976
+ };
18977
+ TranslationEditor.prototype.addStringsToTranlate = function (group, items) {
18978
+ var _this = this;
18979
+ group.items.forEach(function (item) {
18980
+ if (item.isGroup) {
18981
+ _this.addStringsToTranlate(item, items);
18982
+ }
18983
+ else {
18984
+ if (!!item.getDefaultLocaleText()) {
18985
+ items.push(item);
18986
+ }
18987
+ }
18988
+ });
18989
+ };
18990
+ return TranslationEditor;
18991
+ }());
18992
+
18993
+ function createImportCSVAction(action, needSeparator, isInEditor) {
18994
+ if (isInEditor === void 0) { isInEditor = false; }
18995
+ return new survey_core__WEBPACK_IMPORTED_MODULE_1__["Action"]({
18996
+ id: "svc-translation-import",
18997
+ iconName: "icon-load",
18998
+ locTitleName: "ed.translationImportFromSCVButton",
18999
+ locTooltipName: "ed.translationImportFromSCVButton",
19000
+ mode: isInEditor ? "large" : "small",
19001
+ component: "sv-action-bar-item",
19002
+ needSeparator: needSeparator,
19003
+ action: action
19004
+ });
19005
+ }
19006
+ function createExportCSVAction(action, isInEditor) {
19007
+ if (isInEditor === void 0) { isInEditor = false; }
19008
+ return new survey_core__WEBPACK_IMPORTED_MODULE_1__["Action"]({
19009
+ id: "svc-translation-export",
19010
+ iconName: "icon-download",
19011
+ locTitleName: "ed.translationExportToSCVButton",
19012
+ locTooltipName: "ed.translationExportToSCVButton",
19013
+ mode: isInEditor ? "large" : "small",
19014
+ component: "sv-action-bar-item",
19015
+ action: action
19016
+ });
19017
+ }
18153
19018
 
18154
19019
 
18155
19020
  /***/ }),
@@ -18700,7 +19565,6 @@ var CreatorBase = /** @class */ (function (_super) {
18700
19565
  * - `options.questionName`: `String`\
18701
19566
  * The name of a question for which conditions are displayed.
18702
19567
  * - `options.questionName`: `String`\
18703
- * The type of a question for which conditions are displayed.
18704
19568
  * The name of a question for which conditions are displayed.
18705
19569
  * - `options.operator`: `"empty"` | `"notempty"` | `"equal"` | `"notequal"` | `"contains"` | `"notcontains"` | `"anyof"` | `"allof"` | `"greater"` | `"less"` | `"greaterorequal"` | `"lessorequal"`\
18706
19570
  * A condition opeator for which the event is raised.
@@ -18780,24 +19644,50 @@ var CreatorBase = /** @class */ (function (_super) {
18780
19644
  */
18781
19645
  _this.onModified = new CreatorEvent();
18782
19646
  /**
18783
- * The event is called on adding a new question into the survey. Typically, when a user dropped a Question from the Question Toolbox into designer Survey area.
18784
- *- sender the survey creator object that fires the event
18785
- *- options.question a new added survey question. Survey.Question object
18786
- *- options.page the survey Page object where question has been added.
18787
- *- options.reason how question has been added via UI: ADDED_FROM_TOOLBOX, ADDED_FROM_PAGEBUTTON, ELEMENT_COPIED.
19647
+ * An event that is raised when users add a question to the survey. Use this event to customize the question.
19648
+ *
19649
+ * Parameters:
19650
+ *
19651
+ * - `sender`: `CreatorBase`\
19652
+ * A Survey Creator instance that raised the event.
19653
+ * - `options.question`: [`Question`](https://surveyjs.io/form-library/documentation/api-reference/question)\
19654
+ * The question users added.
19655
+ * - `options.page`: [`PageModel`](https://surveyjs.io/form-library/documentation/api-reference/page-model)\
19656
+ * A page to which the question was added.
19657
+ * - `options.reason`: `"DROPPED_FROM_TOOLBOX"` | `"ADDED_FROM_PAGEBUTTON"` | `"ELEMENT_COPIED"`\
19658
+ * A value that indicates how the question was added: dragged from the [Toolbox](https://surveyjs.io/survey-creator/documentation/toolbox-customization), created using the Add Question button, or duplicated.
19659
+ *
19660
+ * [Customize Survey Elements on Creation](https://surveyjs.io/survey-creator/documentation/customize-survey-creation-process#customize-survey-elements-on-creation (linkStyle))
18788
19661
  */
18789
19662
  _this.onQuestionAdded = new CreatorEvent();
18790
19663
  /**
18791
- * The event is called on adding a new panel into the survey. Typically, when a user dropped a Panel from the Question Toolbox into designer Survey area.
18792
- *- sender the survey creator object that fires the event
18793
- *- options.panel a new added survey panel. Survey.Panel object
18794
- *- options.page the survey Page object where question has been added.
19664
+ * An event that is raised when users add a [Panel](https://surveyjs.io/form-library/documentation/api-reference/panel-model) element to the survey. Use this event to customize the panel.
19665
+ *
19666
+ * Parameters:
19667
+ *
19668
+ * - `sender`: `CreatorBase`\
19669
+ * A Survey Creator instance that raised the event.
19670
+ * - `options.panel`: [`PanelModel`](https://surveyjs.io/form-library/documentation/api-reference/panel-model)\
19671
+ * The panel users added.
19672
+ * - `options.page`: [`PageModel`](https://surveyjs.io/form-library/documentation/api-reference/page-model)\
19673
+ * A page to which the panel was added.
19674
+ * - `options.reason`: `"DROPPED_FROM_TOOLBOX"` | `"ADDED_FROM_PAGEBUTTON"` | `"ELEMENT_COPIED"`\
19675
+ * A value that indicates how the panel was added: dragged from the [Toolbox](https://surveyjs.io/survey-creator/documentation/toolbox-customization), created using the Add Question button, or duplicated.
19676
+ *
19677
+ * [Customize Survey Elements on Creation](https://surveyjs.io/survey-creator/documentation/customize-survey-creation-process#customize-survey-elements-on-creation (linkStyle))
18795
19678
  */
18796
19679
  _this.onPanelAdded = new CreatorEvent();
18797
19680
  /**
18798
- * The event is called on adding a new page into the survey.
18799
- *- sender the survey creator object that fires the event
18800
- *- options.page the new survey Page object.
19681
+ * An event that is raised when a new page is added to the survey. Use this event to customize the page.
19682
+ *
19683
+ * Parameters:
19684
+ *
19685
+ * - `sender`: `CreatorBase`\
19686
+ * A Survey Creator instance that raised the event.
19687
+ * - `options.page`: [`PageModel`](https://surveyjs.io/form-library/documentation/api-reference/page-model)\
19688
+ * The page users added.
19689
+ *
19690
+ * [Customize Survey Elements on Creation](https://surveyjs.io/survey-creator/documentation/customize-survey-creation-process#customize-survey-elements-on-creation (linkStyle))
18801
19691
  */
18802
19692
  _this.onPageAdded = new CreatorEvent();
18803
19693
  /**
@@ -18816,21 +19706,35 @@ var CreatorBase = /** @class */ (function (_super) {
18816
19706
  */
18817
19707
  _this.onGetPageActions = new CreatorEvent();
18818
19708
  /**
18819
- * The event is fired when the survey creator is initialized and a survey object (Survey.Survey) is created.
18820
- *- sender the survey creator object that fires the event
18821
- *- options.survey the survey object showing in the creator.
19709
+ * An event that is raised when Survey Creator instantiates a survey for the [Designer](https://surveyjs.io/survey-creator/documentation/end-user-guide#designer-tab) tab. Use this event to customize the survey.
19710
+ *
19711
+ * Parameters:
19712
+ *
19713
+ * - `sender`: `CreatorBase`\
19714
+ * A Survey Creator instance that raised the event.
19715
+ * - `options.survey`: [`SurveyModel`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model)\
19716
+ * A survey to be displayed in the Designer tab.
19717
+ *
19718
+ * [Design Mode Survey Instance](https://surveyjs.io/survey-creator/documentation/customize-survey-creation-process#design-mode-survey-instance (linkStyle))
19719
+ *
19720
+ * > If you want this event raised at startup, assign a survey JSON schema to the [`JSON`](#JSON) property *after* you add a handler to the event. If the JSON schema should be empty, specify the `JSON` property with an empty object.
18822
19721
  */
18823
19722
  _this.onDesignerSurveyCreated = new CreatorEvent();
18824
19723
  /**
18825
- * The event is fired when the survey creator creates survey in Preview tab for testing.
18826
- *- sender the survey creator object that fires the event
18827
- *- options.survey the survey object showing in the "Preview" tab.
19724
+ * An event that is raised when Survey Creator instantiates a survey for the [Preview](https://surveyjs.io/survey-creator/documentation/end-user-guide#preview-tab) tab. Use this event to customize the survey.
19725
+ *
19726
+ * Parameters:
19727
+ *
19728
+ * - `sender`: `CreatorBase`\
19729
+ * A Survey Creator instance that raised the event.
19730
+ * - `options.survey`: [`SurveyModel`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model)\
19731
+ * A survey to be displayed in the Preview tab.
19732
+ *
19733
+ * [Preview Mode Survey Instance](https://surveyjs.io/survey-creator/documentation/customize-survey-creation-process#preview-mode-survey-instance (linkStyle))
19734
+ *
19735
+ * > If you want this event raised at startup, assign a survey JSON schema to the [`JSON`](#JSON) property *after* you add a handler to the event. If the JSON schema should be empty, specify the `JSON` property with an empty object.
18828
19736
  */
18829
19737
  _this.onPreviewSurveyCreated = new CreatorEvent();
18830
- /**
18831
- * Obsolete. Please use onPreviewSurveyCreated event.
18832
- * @see onPreviewSurveyCreated
18833
- */
18834
19738
  _this.onTestSurveyCreated = _this.onPreviewSurveyCreated;
18835
19739
  /**
18836
19740
  * The event is called in case of UI notifications. By default all notifications are done via built-in alert () function.
@@ -18919,6 +19823,27 @@ var CreatorBase = /** @class */ (function (_super) {
18919
19823
  * - `options.text` - A text string to be exported. The string is taken from the current locale. Redefine this property if you want to export a different string.
18920
19824
  */
18921
19825
  _this.onTranslationExportItem = new CreatorEvent();
19826
+ /**
19827
+ * An event that allows you to integrate a machine translation service, such as Google Translate or Microsoft Translator, into Survey Creator.
19828
+ *
19829
+ * Within the event handler, you need to pass translation strings and locale information to the translation service API. The service should return an array of translated strings that you need to pass to the `options.callback` function. If the translation failed, pass an empty array or call this function without arguments.
19830
+ *
19831
+ * Parameters:
19832
+ *
19833
+ * - `sender`: `CreatorBase`\
19834
+ * A Survey Creator instance that raised the event.
19835
+ * - `options.fromLocale`: `string`\
19836
+ * A locale from which you want to translate strings. Contains a locale identifier (`"en"`, `"de"`, etc.).
19837
+ * - `options.toLocale`: `string`\
19838
+ * A locale to which you want to translate strings. Contains a locale identifier (`"en"`, `"de"`, etc.).
19839
+ * - `options.strings`: `Array<string>`\
19840
+ * Strings to translate.
19841
+ * - `options.callback: (strings: Array<string>)`: `Function`\
19842
+ * A callback function that accepts translated strings. If the translation failed, pass an empty array or call this function without arguments.
19843
+ *
19844
+ * > Survey Creator does not include a machine translation service out of the box. Our component only provides a UI for calling the service API.
19845
+ */
19846
+ _this.onMachineTranslate = new CreatorEvent();
18922
19847
  /**
18923
19848
  * An event that is raised before a string translation is changed. Use this event to override a new translation value.
18924
19849
  *
@@ -19007,6 +19932,12 @@ var CreatorBase = /** @class */ (function (_super) {
19007
19932
  * Default value: 0 (unlimited, taken from `settings.propertyGrid.maximumChoicesCount`)
19008
19933
  */
19009
19934
  _this.maximumChoicesCount = _creator_settings__WEBPACK_IMPORTED_MODULE_2__["settings"].propertyGrid.maximumChoicesCount;
19935
+ /**
19936
+ * Limits the minimum number of choices in [Checkbox](https://surveyjs.io/Documentation/Library?id=questioncheckboxmodel), [Dropdown](https://surveyjs.io/Documentation/Library?id=questiondropdownmodel), and [Radiogroup](https://surveyjs.io/Documentation/Library?id=questionradiogroupmodel) questions. Set this property if users should not delete choices below the specified limit.
19937
+ *
19938
+ * Default value: 0 (unlimited, taken from `settings.propertyGrid.minimumChoicesCount`)
19939
+ */
19940
+ _this.minimumChoicesCount = _creator_settings__WEBPACK_IMPORTED_MODULE_2__["settings"].propertyGrid.minimumChoicesCount;
19010
19941
  /**
19011
19942
  * Limits the number of rows that users can add to [Matrix](https://surveyjs.io/Documentation/Library?id=questionmatrixmodel) and [Matrix Dropdown](https://surveyjs.io/Documentation/Library?id=questionmatrixdropdownmodel) questions.
19012
19943
  *
@@ -19014,18 +19945,18 @@ var CreatorBase = /** @class */ (function (_super) {
19014
19945
  */
19015
19946
  _this.maximumRowsCount = _creator_settings__WEBPACK_IMPORTED_MODULE_2__["settings"].propertyGrid.maximumRowsCount;
19016
19947
  /**
19017
- * Limits the number of rate value that users can add to [Rating](https://surveyjs.io/Documentation/Library?id=questionratingmodel) questions.
19948
+ * Limits the number of rate values that users can add to [Rating](https://surveyjs.io/Documentation/Library?id=questionratingmodel) questions.
19018
19949
  *
19019
19950
  * Default value: 0 (unlimited, taken from `settings.propertyGrid.maximumRateValues`)
19020
19951
  */
19021
19952
  _this.maximumRateValues = _creator_settings__WEBPACK_IMPORTED_MODULE_2__["settings"].propertyGrid.maximumRateValues;
19022
19953
  /**
19023
- * Obsolete. Use the [`showPagesInPreviewTab`](https://surveyjs.io/Documentation/Survey-Creator?id=surveycreator#showPagesInPreviewTab) property instead.
19954
+ * Limits the number of nested panels within a [Panel](/form-library/documentation/api-reference/panel-model) element.
19955
+ *
19956
+ * Default value: -1 (unlimited)
19024
19957
  */
19958
+ _this.maxNestedPanels = -1;
19025
19959
  _this.showPagesInTestSurveyTab = true;
19026
- /**
19027
- * Obsolete. Use the [`showSimulatorInPreviewTab`](https://surveyjs.io/Documentation/Survey-Creator?id=surveycreator#showSimulatorInPreviewTab) property instead.
19028
- */
19029
19960
  _this.showSimulatorInTestSurveyTab = true;
19030
19961
  /**
19031
19962
  * A [UI theme](https://surveyjs.io/Documentation/Library?id=get-started-react#configure-styles) used to display the survey in the Preview tab.
@@ -19033,17 +19964,12 @@ var CreatorBase = /** @class */ (function (_super) {
19033
19964
  * Accepted values: `"modern"`, `"default"`, `"defaultV2"`
19034
19965
  *
19035
19966
  * Default value: `"defaultV2"`
19967
+ * @see allowChangeThemeInPreview
19036
19968
  */
19037
19969
  _this.themeForPreview = "defaultV2";
19038
19970
  _this._theme = { cssVariables: {} };
19039
19971
  _this._allowModifyPages = true;
19040
- /**
19041
- * Obsolete. Use the [`showDefaultLanguageInPreviewTab`](https://surveyjs.io/Documentation/Survey-Creator?id=surveycreator#showDefaultLanguageInPreviewTab) property instead.
19042
- */
19043
19972
  _this.showDefaultLanguageInTestSurveyTab = "auto";
19044
- /**
19045
- * Obsolete. Use the [`showInvisibleElementsInPreviewTab`](https://surveyjs.io/Documentation/Survey-Creator?id=surveycreator#showInvisibleElementsInPreviewTab) property instead.
19046
- */
19047
19973
  _this.showInvisibleElementsInTestSurveyTab = true;
19048
19974
  /**
19049
19975
  * Set this property to true if you want to show "page selector" in the toolabar instead of "pages editor"
@@ -19055,6 +19981,7 @@ var CreatorBase = /** @class */ (function (_super) {
19055
19981
  * Default value: `true`
19056
19982
  *
19057
19983
  * [View Demo](https://surveyjs.io/Examples/Creator?id=theme-switcher (linkStyle))
19984
+ * @see themeForPreview
19058
19985
  */
19059
19986
  _this.allowChangeThemeInPreview = true;
19060
19987
  /**
@@ -19070,10 +19997,11 @@ var CreatorBase = /** @class */ (function (_super) {
19070
19997
  *
19071
19998
  * - `sender`: `CreatorBase`\
19072
19999
  * A Survey Creator instance that raised the event.
19073
- * - `options.tabName`: `"designer"` | `"test"` | `"theme"` | `"editor"` | `"embed"` | `"logic"` | `"translation"`\
20000
+ * - `options.tabName`: `"designer"` | `"test"` | `"theme"` | `"editor"` | `"logic"` | `"translation"`\
19074
20001
  * A tab that is going to become active.
19075
20002
  * - `options.allow`: `Boolean`\
19076
20003
  * Specifies whether the active tab can be switched. Set this property to `false` if you want to cancel the switch.
20004
+ * @see makeNewViewActive
19077
20005
  */
19078
20006
  _this.onActiveTabChanging = new CreatorEvent();
19079
20007
  /**
@@ -19083,15 +20011,16 @@ var CreatorBase = /** @class */ (function (_super) {
19083
20011
  *
19084
20012
  * - `sender`: `CreatorBase`\
19085
20013
  * A Survey Creator instance that raised the event.
19086
- * - `options.tabName`: `"designer"` | `"test"` | `"theme"` | `"editor"` | `"embed"` | `"logic"` | `"translation"`\
20014
+ * - `options.tabName`: `"designer"` | `"test"` | `"theme"` | `"editor"` | `"logic"` | `"translation"`\
19087
20015
  * A tab that has become active.
20016
+ * @see makeNewViewActive
19088
20017
  */
19089
20018
  _this.onActiveTabChanged = new CreatorEvent();
19090
20019
  _this.showSidebarValue = true;
19091
20020
  _this.onShowSidebarVisibilityChanged = new CreatorEvent();
19092
20021
  //#region Obsolete properties and functins
19093
20022
  _this.onShowPropertyGridVisiblityChanged = new CreatorEvent();
19094
- //#endregion Obsolete properties and functins
20023
+ //#endregion Obsolete properties and functions
19095
20024
  //#region Undo/Redo
19096
20025
  /**
19097
20026
  * The event is called before undo happens.
@@ -19169,11 +20098,11 @@ var CreatorBase = /** @class */ (function (_super) {
19169
20098
  shown: "svc-notifier--shown"
19170
20099
  });
19171
20100
  _this.onKeyDownHandler = function (event) {
19172
- var shortcut;
19173
- var hotKey;
19174
- Object.keys(_this.shortcuts || {}).forEach(function (key) {
19175
- shortcut = _this.shortcuts[key];
19176
- hotKey = event.metaKey ? shortcut.macOsHotkey : shortcut.hotKey;
20101
+ var availableShortcuts = Object.keys(_this.shortcuts || {})
20102
+ .map(function (key) { return _this.shortcuts[key]; })
20103
+ .filter(function (shortcut) { return !shortcut.affectedTab || shortcut.affectedTab === _this.activeTab; });
20104
+ availableShortcuts.forEach(function (shortcut) {
20105
+ var hotKey = event.metaKey ? shortcut.macOsHotkey : shortcut.hotKey;
19177
20106
  if (!hotKey)
19178
20107
  return;
19179
20108
  if (!!hotKey.ctrlKey !== !!event.ctrlKey)
@@ -19189,9 +20118,11 @@ var CreatorBase = /** @class */ (function (_super) {
19189
20118
  };
19190
20119
  _this.shortcuts = {};
19191
20120
  /**
19192
- * The delay on saving survey JSON on autoSave in ms. It is 500 ms by default.
19193
- * If during this period of time an end-user modify survey, then the last version will be saved only. Set to 0 to save immediately.
19194
- * @see isAutoSave
20121
+ * A delay between changing survey or theme settings and saving the survey or theme JSON schema, measured in milliseconds. Applies only when the [`isAutoSave`](#isAutoSave) property is `true`.
20122
+ *
20123
+ * Default value: 500 (taken from `settings.autoSave.delay`)
20124
+ *
20125
+ * If a user changes the settings once again during the delay, only the latest version will be saved.
19195
20126
  */
19196
20127
  _this.autoSaveDelay = _creator_settings__WEBPACK_IMPORTED_MODULE_2__["settings"].autoSave.delay;
19197
20128
  _this.autoSaveTimerId = null;
@@ -19232,6 +20163,8 @@ var CreatorBase = /** @class */ (function (_super) {
19232
20163
  * Specifies whether to display the Preview tab.
19233
20164
  *
19234
20165
  * Default value: `true`
20166
+ * @see activeTab
20167
+ * @see onPreviewSurveyCreated
19235
20168
  */
19236
20169
  get: function () { return this.showTestSurveyTab; },
19237
20170
  set: function (val) { this.showTestSurveyTab = val; },
@@ -19239,9 +20172,6 @@ var CreatorBase = /** @class */ (function (_super) {
19239
20172
  configurable: true
19240
20173
  });
19241
20174
  Object.defineProperty(CreatorBase.prototype, "allowEditSurveyTitle", {
19242
- /**
19243
- * Obsolete. Use the [`showSurveyTitle`](https://surveyjs.io/Documentation/Survey-Creator?id=surveycreator#showSurveyTitle) property instead.
19244
- */
19245
20175
  get: function () {
19246
20176
  return this.getPropertyValue("allowEditSurveyTitle", true);
19247
20177
  },
@@ -19255,7 +20185,7 @@ var CreatorBase = /** @class */ (function (_super) {
19255
20185
  });
19256
20186
  Object.defineProperty(CreatorBase.prototype, "showSurveyTitle", {
19257
20187
  /**
19258
- * Specifies whether users can see and edit the survey title and related survey properties.
20188
+ * Specifies whether users can see and edit the survey header and related survey properties.
19259
20189
  *
19260
20190
  * Default value: `true`
19261
20191
  */
@@ -19306,7 +20236,19 @@ var CreatorBase = /** @class */ (function (_super) {
19306
20236
  };
19307
20237
  Object.defineProperty(CreatorBase.prototype, "pageEditMode", {
19308
20238
  /**
19309
- * Contains the value of the [`pageEditMode`](https://surveyjs.io/Documentation/Survey-Creator?id=ICreatorOptions#pageEditMode) property specified in the constructor.
20239
+ * Specifies how Survey Creator users edit survey pages.
20240
+ *
20241
+ * Accepted values:
20242
+ *
20243
+ * - `"standard"` (default)
20244
+ * Questions and panels are divided between pages. Users can scroll the design surface to reach a required page.
20245
+ *
20246
+ * - `"single"`
20247
+ * All questions and panels belong to a single page. Users cannot add or remove pages.
20248
+ *
20249
+ * - `"bypage"`
20250
+ * Questions and panels are divided between pages. Users can use the page navigator to switch to a required page.
20251
+ * @see allowModifyPages
19310
20252
  */
19311
20253
  get: function () {
19312
20254
  return this.pageEditModeValue;
@@ -19339,16 +20281,6 @@ var CreatorBase = /** @class */ (function (_super) {
19339
20281
  configurable: true
19340
20282
  });
19341
20283
  Object.defineProperty(CreatorBase.prototype, "showingViewName", {
19342
- /**
19343
- * Returns the current show view name. The possible returns values are:
19344
- * "designer", "editor", "test", "embed", "logic" and "translation".
19345
- * @see showDesigner
19346
- * @see showPreview
19347
- * @see showJsonEditor
19348
- * @see showLogicEditor
19349
- * @see showTranslationEditor
19350
- * @see showEmbedEditor
19351
- */
19352
20284
  get: function () {
19353
20285
  return this.activeTab;
19354
20286
  },
@@ -19423,7 +20355,7 @@ var CreatorBase = /** @class */ (function (_super) {
19423
20355
  };
19424
20356
  Object.defineProperty(CreatorBase.prototype, "showPagesInPreviewTab", {
19425
20357
  /**
19426
- * Specifies whether to show the page selector at the bottom of the Preview tab.
20358
+ * Specifies whether to show a page selector at the bottom of the Preview tab.
19427
20359
  *
19428
20360
  * Default value: `true`
19429
20361
  */
@@ -19434,7 +20366,7 @@ var CreatorBase = /** @class */ (function (_super) {
19434
20366
  });
19435
20367
  Object.defineProperty(CreatorBase.prototype, "showSimulatorInPreviewTab", {
19436
20368
  /**
19437
- * Specifies whether the Preview tab displays the Device button that allows users to preview the survey on different device types.
20369
+ * Specifies whether the Preview tab displays a Device button that allows users to preview the survey on different device types.
19438
20370
  *
19439
20371
  * Default value: `true`
19440
20372
  */
@@ -19452,6 +20384,16 @@ var CreatorBase = /** @class */ (function (_super) {
19452
20384
  enumerable: false,
19453
20385
  configurable: true
19454
20386
  });
20387
+ CreatorBase.prototype.getCurrentTheme = function (content) {
20388
+ if (content === void 0) { content = "full"; }
20389
+ if (content === "full") {
20390
+ return this.theme;
20391
+ }
20392
+ var themePlugin = this.getPlugin("theme");
20393
+ if (!!themePlugin) {
20394
+ return themePlugin.getThemeChanges();
20395
+ }
20396
+ };
19455
20397
  CreatorBase.prototype.raiseThemeChanged = function () {
19456
20398
  this.hasPendingThemeChanges = true;
19457
20399
  var options = {
@@ -19467,6 +20409,7 @@ var CreatorBase = /** @class */ (function (_super) {
19467
20409
  * Specifies whether users can add, edit, and delete survey pages.
19468
20410
  *
19469
20411
  * Default value: `true`
20412
+ * @see pageEditMode
19470
20413
  */
19471
20414
  get: function () {
19472
20415
  return this._allowModifyPages;
@@ -19480,7 +20423,7 @@ var CreatorBase = /** @class */ (function (_super) {
19480
20423
  });
19481
20424
  Object.defineProperty(CreatorBase.prototype, "showDefaultLanguageInPreviewTab", {
19482
20425
  /**
19483
- * Specifies whether the Preview tab displays the language selector.
20426
+ * Specifies whether the Preview tab displays a language selector.
19484
20427
  *
19485
20428
  * Accepted values:
19486
20429
  *
@@ -19488,7 +20431,7 @@ var CreatorBase = /** @class */ (function (_super) {
19488
20431
  * Display the language selector only if the survey is translated into more than one language.
19489
20432
  *
19490
20433
  * - `true`
19491
- * Always display the language selector regardless of how many languages are used in the survey.
20434
+ * Always display the language selector regardless of how many languages the survey uses.
19492
20435
  *
19493
20436
  * - `false`
19494
20437
  * Never display the language selector.
@@ -19496,7 +20439,7 @@ var CreatorBase = /** @class */ (function (_super) {
19496
20439
  * - `"all"`
19497
20440
  * Always display the language selector with [all supported languages](https://github.com/surveyjs/survey-creator/tree/master/packages/survey-creator-core/src/localization).
19498
20441
  *
19499
- * **See also**: [Localization & Globalization](https://surveyjs.io/Documentation/Survey-Creator?id=localization)
20442
+ * [Localization & Globalization](https://surveyjs.io/survey-creator/documentation/survey-localization-translate-surveys-to-different-languages (linkStyle))
19500
20443
  */
19501
20444
  get: function () { return this.showDefaultLanguageInTestSurveyTab; },
19502
20445
  set: function (val) { this.showDefaultLanguageInTestSurveyTab = val; },
@@ -19505,7 +20448,7 @@ var CreatorBase = /** @class */ (function (_super) {
19505
20448
  });
19506
20449
  Object.defineProperty(CreatorBase.prototype, "showInvisibleElementsInPreviewTab", {
19507
20450
  /**
19508
- * Specifies whether the Preview tab displays a checkbox that allows users to show or hide invisible survey elements.
20451
+ * Specifies whether the Preview tab displays a toggle that allows users to show or hide invisible survey elements.
19509
20452
  *
19510
20453
  * Default value: `true`
19511
20454
  */
@@ -19610,9 +20553,17 @@ var CreatorBase = /** @class */ (function (_super) {
19610
20553
  });
19611
20554
  Object.defineProperty(CreatorBase.prototype, "activeTab", {
19612
20555
  /**
19613
- * Get/set the active tab.
19614
- * The following values are available: "designer", "editor", "test", "embed", "logic" and "translation".
19615
- * Please note, not all tabs are visible.
20556
+ * Gets or sets the currently displayed tab.
20557
+ *
20558
+ * Possible values:
20559
+ *
20560
+ * - [`"designer"`](#showDesignerTab)
20561
+ * - [`"test"`](#showPreviewTab)
20562
+ * - [`"theme"`](#showThemeTab)
20563
+ * - [`"editor"`](#showJSONEditorTab)
20564
+ * - [`"logic"`](#showLogicTab)
20565
+ * - [`"translation"`](#showLogicTab)
20566
+ * @see makeNewViewActive
19616
20567
  */
19617
20568
  get: function () {
19618
20569
  return this.viewType;
@@ -19624,21 +20575,22 @@ var CreatorBase = /** @class */ (function (_super) {
19624
20575
  configurable: true
19625
20576
  });
19626
20577
  /**
19627
- * Change the active view/tab. It will return false if it can't change the current tab.
19628
- * @param viewName name of new active view (tab). The following values are available: "designer", "editor", "test", "embed", "logic" and "translation".
20578
+ * Switches the [active tab](#activeTab). Returns `false` if the tab cannot be switched.
20579
+ * @param tabName A tab that you want to make active: `"designer"`, `"test"`, `"theme"`, `"editor"`, `"logic"`, or `"translation"`.
20580
+ * @returns `false` if the active tab cannot be switched, `true` otherwise.
19629
20581
  */
19630
- CreatorBase.prototype.makeNewViewActive = function (viewName) {
20582
+ CreatorBase.prototype.makeNewViewActive = function (tabName) {
19631
20583
  var _this = this;
19632
- if (viewName == this.viewType)
20584
+ if (tabName == this.viewType)
19633
20585
  return false;
19634
20586
  var plugin = this.currentPlugin;
19635
20587
  if (!!plugin && !!plugin.canDeactivateAsync) {
19636
20588
  plugin.canDeactivateAsync(function () {
19637
- _this.switchViewType(viewName);
20589
+ _this.switchViewType(tabName);
19638
20590
  });
19639
20591
  return undefined;
19640
20592
  }
19641
- return this.switchViewType(viewName);
20593
+ return this.switchViewType(tabName);
19642
20594
  };
19643
20595
  CreatorBase.prototype.switchViewType = function (viewName) {
19644
20596
  var _a, _b;
@@ -19919,7 +20871,7 @@ var CreatorBase = /** @class */ (function (_super) {
19919
20871
  var _this = this;
19920
20872
  if (!this.footerToolbar) {
19921
20873
  this.footerToolbar = new survey_core__WEBPACK_IMPORTED_MODULE_1__["ActionContainer"]();
19922
- ["undoredo", "designer", "test"].forEach(function (pluginKey) {
20874
+ ["designer", "undoredo", "test", "theme"].forEach(function (pluginKey) {
19923
20875
  var plugin = _this.getPlugin(pluginKey);
19924
20876
  if (!!plugin && !!plugin["addFooterActions"]) {
19925
20877
  plugin["addFooterActions"]();
@@ -20106,6 +21058,7 @@ var CreatorBase = /** @class */ (function (_super) {
20106
21058
  this.dragDropSurveyElements = new _survey_elements__WEBPACK_IMPORTED_MODULE_24__["DragDropSurveyElements"](null, this);
20107
21059
  var isDraggedFromToolbox = false;
20108
21060
  this.dragDropSurveyElements.onDragStart.add(function (sender, options) {
21061
+ _this.dragDropSurveyElements.maxNestedPanels = _this.maxNestedPanels;
20109
21062
  isDraggedFromToolbox = !sender.draggedElement.parent;
20110
21063
  _this.onDragStart.fire(sender, options);
20111
21064
  _this.startUndoRedoTransaction("drag drop");
@@ -20443,7 +21396,7 @@ var CreatorBase = /** @class */ (function (_super) {
20443
21396
  }
20444
21397
  };
20445
21398
  CreatorBase.prototype.convertQuestion = function (obj, className) {
20446
- var newQuestion = _questionconverter__WEBPACK_IMPORTED_MODULE_5__["QuestionConverter"].convertObject(obj, className, this.getDefaultElementJSON(obj.getType()));
21399
+ var newQuestion = _questionconverter__WEBPACK_IMPORTED_MODULE_5__["QuestionConverter"].convertObject(obj, className, this.getDefaultElementJSON(obj.getType()), this.getDefaultElementJSON(className));
20447
21400
  this.setModified({
20448
21401
  type: "QUESTION_CONVERTED",
20449
21402
  className: className,
@@ -20453,10 +21406,11 @@ var CreatorBase = /** @class */ (function (_super) {
20453
21406
  return newQuestion;
20454
21407
  };
20455
21408
  CreatorBase.prototype.getDefaultElementJSON = function (elType) {
21409
+ var _a;
20456
21410
  if (!this.toolbox)
20457
21411
  return null;
20458
- var item = this.toolbox.getItemByName(elType);
20459
- return !!item ? item.json : null;
21412
+ var json = (_a = this.toolbox.getItemByName(elType)) === null || _a === void 0 ? void 0 : _a.json;
21413
+ return !!json ? survey_core__WEBPACK_IMPORTED_MODULE_1__["Helpers"].createCopy(json) : null;
20460
21414
  };
20461
21415
  CreatorBase.prototype.singlePageJSON = function (json) {
20462
21416
  if (this.pageEditMode === "single") {
@@ -20856,11 +21810,9 @@ var CreatorBase = /** @class */ (function (_super) {
20856
21810
  configurable: true
20857
21811
  });
20858
21812
  /**
20859
- * Collapse certain property editor tab (category) in properties panel/grid
20860
- * name - tab category name
20861
- * @see collapseAllPropertyGridCategories
21813
+ * Collapses a specified category in Property Grid.
21814
+ * @param name A [category name](https://surveyjs.io/survey-creator/documentation/property-grid-customization#category).
20862
21815
  * @see expandPropertyGridCategory
20863
- * @see expandAllPropertyGridCategories
20864
21816
  */
20865
21817
  CreatorBase.prototype.collapsePropertyGridCategory = function (name) {
20866
21818
  if (!!this.designerPropertyGrid) {
@@ -20868,11 +21820,9 @@ var CreatorBase = /** @class */ (function (_super) {
20868
21820
  }
20869
21821
  };
20870
21822
  /**
20871
- * Expand certain property editor tab (category) in properties panel/grid
20872
- * name - tab category name
21823
+ * Expands a specified category in Property Grid.
21824
+ * @param name A [category name](https://surveyjs.io/survey-creator/documentation/property-grid-customization#category).
20873
21825
  * @see collapsePropertyGridCategory
20874
- * @see collapseAllPropertyGridCategories
20875
- * @see expandAllPropertyGridCategories
20876
21826
  */
20877
21827
  CreatorBase.prototype.expandPropertyGridCategory = function (name) {
20878
21828
  if (!!this.designerPropertyGrid) {
@@ -20880,9 +21830,7 @@ var CreatorBase = /** @class */ (function (_super) {
20880
21830
  }
20881
21831
  };
20882
21832
  /**
20883
- * Expand all property editor tabs (categories) in properties panel/grid
20884
- * @see collapsePropertyGridCategory
20885
- * @see expandPropertyGridCategory
21833
+ * Collapses all categories in Property Grid.
20886
21834
  * @see expandAllPropertyGridCategories
20887
21835
  */
20888
21836
  CreatorBase.prototype.collapseAllPropertyGridCategories = function () {
@@ -20891,44 +21839,23 @@ var CreatorBase = /** @class */ (function (_super) {
20891
21839
  }
20892
21840
  };
20893
21841
  /**
20894
- * Expand all property editor tabs (categories) in properties panel/grid
20895
- * @see collapsePropertyGridCategory
21842
+ * Expands all categories in Property Grid.
20896
21843
  * @see collapseAllPropertyGridCategories
20897
- * @see expandPropertyGridCategory
20898
21844
  */
20899
21845
  CreatorBase.prototype.expandAllPropertyGridCategories = function () {
20900
21846
  if (!!this.designerPropertyGrid) {
20901
21847
  this.designerPropertyGrid.expandAllCategories();
20902
21848
  }
20903
21849
  };
20904
- /**
20905
- * @Deprecated Obsolete. Collapse all property editor tabs (categories) in properties panel/grid
20906
- * @see collapseAllPropertyGridCategories
20907
- *
20908
- */
20909
21850
  CreatorBase.prototype.collapseAllPropertyTabs = function () {
20910
21851
  this.collapseAllPropertyGridCategories();
20911
21852
  };
20912
- /**
20913
- * @Deprecated Obsolete. Expand all property editor tabs (categories) in properties panel/grid
20914
- * @see expandAllPropertyGridCategories
20915
- */
20916
21853
  CreatorBase.prototype.expandAllPropertyTabs = function () {
20917
21854
  this.expandAllPropertyGridCategories();
20918
21855
  };
20919
- /**
20920
- * @Deprecated Obsolete. Expand certain property editor tab (category) in properties panel/grid
20921
- * name - tab category name
20922
- * @see expandPropertyGridCategory
20923
- */
20924
21856
  CreatorBase.prototype.expandPropertyTab = function (name) {
20925
21857
  this.expandPropertyGridCategory(name);
20926
21858
  };
20927
- /**
20928
- * @Deprecated Obsolete. Collapse certain property editor tab (category) in properties panel/grid
20929
- * name - tab category name
20930
- * @see collapsePropertyGridCategory
20931
- */
20932
21859
  CreatorBase.prototype.collapsePropertyTab = function (name) {
20933
21860
  this.collapsePropertyGridCategory(name);
20934
21861
  };
@@ -21377,6 +22304,17 @@ var CreatorBase = /** @class */ (function (_super) {
21377
22304
  this.onTranslationExportItem.fire(this, options);
21378
22305
  return options.text;
21379
22306
  };
22307
+ CreatorBase.prototype.getHasMachineTranslation = function () {
22308
+ return !this.onMachineTranslate.isEmpty;
22309
+ };
22310
+ CreatorBase.prototype.doMachineTranslation = function (fromLocale, toLocale, strings, callback) {
22311
+ if (!this.getHasMachineTranslation()) {
22312
+ callback(undefined);
22313
+ }
22314
+ else {
22315
+ this.onMachineTranslate.fire(this, { fromLocale: fromLocale, toLocale: toLocale, strings: strings, callback: callback });
22316
+ }
22317
+ };
21380
22318
  CreatorBase.prototype.doAutoSave = function (saveFunc) {
21381
22319
  var _this = this;
21382
22320
  if (saveFunc === void 0) { saveFunc = function () { return _this.doSave(); }; }
@@ -21497,10 +22435,26 @@ var CreatorBase = /** @class */ (function (_super) {
21497
22435
  enumerable: false,
21498
22436
  configurable: true
21499
22437
  });
21500
- CreatorBase.prototype.getQuestionTypeSelectorModel = function (beforeAdd, panel) {
22438
+ CreatorBase.prototype.getAvailableToolboxItems = function (element, isAddNew) {
22439
+ if (isAddNew === void 0) { isAddNew = true; }
22440
+ var res = [].concat(this.toolbox.items);
22441
+ if (!element || this.maxNestedPanels < 0)
22442
+ return res;
22443
+ if (!isAddNew && element.isPanel)
22444
+ return res;
22445
+ if (this.maxNestedPanels < _survey_helper__WEBPACK_IMPORTED_MODULE_9__["SurveyHelper"].getElementDeepLength(element)) {
22446
+ for (var i = res.length - 1; i >= 0; i--) {
22447
+ if (res[i].isPanel) {
22448
+ res.splice(i, 1);
22449
+ }
22450
+ }
22451
+ }
22452
+ return res;
22453
+ };
22454
+ CreatorBase.prototype.getQuestionTypeSelectorModel = function (beforeAdd, element) {
21501
22455
  var _this = this;
21502
- if (panel === void 0) { panel = null; }
21503
- var availableTypes = this.toolbox.items.map(function (item) {
22456
+ var panel = !!element && element.isPanel ? element : null;
22457
+ var availableTypes = this.getAvailableToolboxItems(element).map(function (item) {
21504
22458
  return _this.createIActionBarItemByClass(item.name, item.title, item.iconName, item.needSeparator);
21505
22459
  });
21506
22460
  var listModel = new survey_core__WEBPACK_IMPORTED_MODULE_1__["ListModel"](availableTypes, function (item) {
@@ -22141,7 +23095,8 @@ var settings = {
22141
23095
  },
22142
23096
  theme: {
22143
23097
  exportFileName: "survey_theme.json",
22144
- fontFamily: "Open Sans"
23098
+ fontFamily: "Open Sans",
23099
+ allowEditHeaderSettings: false,
22145
23100
  },
22146
23101
  operators: {
22147
23102
  empty: [],
@@ -22198,6 +23153,7 @@ var settings = {
22198
23153
  maxCharsInButtonGroup: 25,
22199
23154
  showNavigationButtons: false,
22200
23155
  maximumColumnsCount: 0,
23156
+ minimumChoicesCount: 0,
22201
23157
  maximumChoicesCount: 0,
22202
23158
  maximumRowsCount: 0,
22203
23159
  maximumRateValues: 0,
@@ -22288,9 +23244,13 @@ var EmptySurveyCreatorOptions = /** @class */ (function () {
22288
23244
  this.isMobileView = false;
22289
23245
  this.allowEditExpressionsInTextEditor = true;
22290
23246
  this.maximumColumnsCount = settings.propertyGrid.maximumColumnsCount;
23247
+ this.minimumChoicesCount = settings.propertyGrid.minimumChoicesCount;
22291
23248
  this.maximumChoicesCount = settings.propertyGrid.maximumChoicesCount;
22292
23249
  this.maximumRowsCount = settings.propertyGrid.maximumRowsCount;
22293
23250
  this.maximumRateValues = settings.propertyGrid.maximumRateValues;
23251
+ this.machineTranslationValue = false;
23252
+ this.inplaceEditForValues = false;
23253
+ this.maxNestedPanels = -1;
22294
23254
  }
22295
23255
  EmptySurveyCreatorOptions.prototype.getProcessedTranslationItemText = function (locale, locString, newText, obj) {
22296
23256
  return newText;
@@ -22338,6 +23298,8 @@ var EmptySurveyCreatorOptions = /** @class */ (function () {
22338
23298
  EmptySurveyCreatorOptions.prototype.onLogicGetTitleCallback = function (expression, displayExpression, text, logicItem) { return text; };
22339
23299
  EmptySurveyCreatorOptions.prototype.getTranslationExportedText = function (obj, name, locString, locale, text) { return text; };
22340
23300
  EmptySurveyCreatorOptions.prototype.uploadFiles = function (files, question, uploadingCallback) { };
23301
+ EmptySurveyCreatorOptions.prototype.getHasMachineTranslation = function () { return this.machineTranslationValue; };
23302
+ EmptySurveyCreatorOptions.prototype.doMachineTranslation = function (fromLocale, toLocale, strings, callback) { };
22341
23303
  return EmptySurveyCreatorOptions;
22342
23304
  }());
22343
23305
 
@@ -22587,6 +23549,8 @@ var QuestionFileEditorModel = /** @class */ (function (_super) {
22587
23549
  Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(QuestionFileEditorModel, _super);
22588
23550
  function QuestionFileEditorModel() {
22589
23551
  var _this = _super !== null && _super.apply(this, arguments) || this;
23552
+ _this._renderedValue = "";
23553
+ _this.placeholder = "";
22590
23554
  _this.onKeyDown = function (event) {
22591
23555
  _this.onTextKeyDownHandler(event);
22592
23556
  };
@@ -22602,6 +23566,7 @@ var QuestionFileEditorModel = /** @class */ (function (_super) {
22602
23566
  this.loadedFilesValue = newValue;
22603
23567
  newValue = this.previewValue[0].content;
22604
23568
  }
23569
+ this.updateRenderedValue(newValue);
22605
23570
  _super.prototype.setNewValue.call(this, newValue);
22606
23571
  };
22607
23572
  QuestionFileEditorModel.prototype.loadPreview = function (newValue) {
@@ -22641,6 +23606,24 @@ var QuestionFileEditorModel = /** @class */ (function (_super) {
22641
23606
  callback();
22642
23607
  }
22643
23608
  };
23609
+ QuestionFileEditorModel.prototype.updateRenderedValue = function (value) {
23610
+ var matchBase64 = !!value ? value.match(/^data:((?:\w+\/(?:(?!;).)+)?)((?:;[\w\W]*?[^;])*),/) : null;
23611
+ if (matchBase64) {
23612
+ this.placeholder = matchBase64[0] + "...";
23613
+ this._renderedValue = "";
23614
+ }
23615
+ else {
23616
+ this.placeholder = "";
23617
+ this._renderedValue = value;
23618
+ }
23619
+ };
23620
+ Object.defineProperty(QuestionFileEditorModel.prototype, "renderedValue", {
23621
+ get: function () {
23622
+ return this._renderedValue;
23623
+ },
23624
+ enumerable: false,
23625
+ configurable: true
23626
+ });
22644
23627
  QuestionFileEditorModel.prototype.updateValueFromInputEvent = function (event) {
22645
23628
  if (!survey_core__WEBPACK_IMPORTED_MODULE_1__["Helpers"].isTwoValueEquals(event.target.value, this.value)) {
22646
23629
  this.clear(undefined, false);
@@ -22648,6 +23631,10 @@ var QuestionFileEditorModel = /** @class */ (function (_super) {
22648
23631
  this.value = event.target.value;
22649
23632
  }
22650
23633
  };
23634
+ QuestionFileEditorModel.prototype.onSurveyValueChanged = function (newValue) {
23635
+ _super.prototype.onSurveyValueChanged.call(this, newValue);
23636
+ this.updateRenderedValue(newValue);
23637
+ };
22651
23638
  QuestionFileEditorModel.prototype.onInputChange = function (event) {
22652
23639
  if (event.target !== document.activeElement) {
22653
23640
  this.updateValueFromInputEvent(event);
@@ -22665,6 +23652,12 @@ var QuestionFileEditorModel = /** @class */ (function (_super) {
22665
23652
  QuestionFileEditorModel.prototype.getChooseButtonCss = function () {
22666
23653
  return new survey_core__WEBPACK_IMPORTED_MODULE_1__["CssClassBuilder"]().append(this.cssClasses.chooseButton).append(this.cssClasses.chooseButtonDisabled, this.isInputReadOnly).toString();
22667
23654
  };
23655
+ Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
23656
+ Object(survey_core__WEBPACK_IMPORTED_MODULE_1__["property"])()
23657
+ ], QuestionFileEditorModel.prototype, "_renderedValue", void 0);
23658
+ Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
23659
+ Object(survey_core__WEBPACK_IMPORTED_MODULE_1__["property"])()
23660
+ ], QuestionFileEditorModel.prototype, "placeholder", void 0);
22668
23661
  return QuestionFileEditorModel;
22669
23662
  }(survey_core__WEBPACK_IMPORTED_MODULE_1__["QuestionFileModel"]));
22670
23663
 
@@ -23479,7 +24472,7 @@ var __spreadArray = function (to, from) {
23479
24472
  /*!******************************!*\
23480
24473
  !*** ./src/entries/index.ts ***!
23481
24474
  \******************************/
23482
- /*! exports provided: Version, enStrings, editorLocalization, defaultStrings, localization, QuestionConvertMode, settings, EmptySurveyCreatorOptions, CreatorAction, TabbedMenuItem, TabbedMenuContainer, ToolbarActionContainer, CreatorEvent, CreatorBase, SurveyCreatorModel, StylesManager, initializeDesignTimeSurveyModel, editableStringRendererName, getElementWrapperComponentName, getQuestionContentWrapperComponentName, getElementWrapperComponentData, getItemValueWrapperComponentName, getItemValueWrapperComponentData, isStringEditable, isTextInput, registerAdorner, removeAdorners, CreatorResponsivityManager, AceJsonEditorModel, TabJsonEditorAcePlugin, JsonEditorBaseModel, TabJsonEditorBasePlugin, TextareaJsonEditorModel, TabJsonEditorTextareaPlugin, TestSurveyTabViewModel, TabTestPlugin, createColor, createBoxShadow, parseBoxShadow, DefaultFonts, fontsettingsToCssVariable, fontsettingsFromCssVariable, elementSettingsToCssVariable, elementSettingsFromCssVariable, Themes, PredefinedThemes, getThemeFullName, PredefinedColors, ThemeBuilder, ThemeTabPlugin, initLogicOperator, LogicEvent, SurveyLogic, TranslationItemBase, TranslationItemString, TranslationItem, TranslationGroup, Translation, translationCss, TabTranslationPlugin, initialSettingsAllowShowEmptyTitleInDesignMode, TabDesignerViewModel, TabDesignerPlugin, SurveyLogicUI, TabLogicPlugin, logicCss, ToolboxToolViewModel, PageNavigatorViewModel, PageAdorner, RowViewModel, QuestionAdornerViewModel, QuestionDropdownAdornerViewModel, QuestionImageAdornerViewModel, QuestionRatingAdornerViewModel, ItemValueWrapperViewModel, ImageItemValueWrapperViewModel, MatrixCellWrapperEditSurvey, MatrixCellWrapperViewModel, SurveySimulatorModel, DEFAULT_MONITOR_DPI, simulatorDevices, SurveyResultsItemModel, SurveyResultsModel, LogoImageViewModel, StringItemsNavigatorBase, StringEditorConnector, StringEditorViewModelBase, QuestionEmbeddedSurveyModel, QuestionLinkValueModel, EditorLocalization, getLocString, SurveyJSON5, QuestionSpinEditorModel, QuestionColorModel, QuestionFileEditorModel, ResetValueAdorner, QuestionTextWithResetModel, QuestionCommentWithResetModel, setSurveyJSONForPropertyGrid, PropertyEditorSetupValue, PropertyGridEditorCollection, PropertyGridTitleActionsCreator, PropertyJSONGenerator, PropertyGridModel, PropertyGridEditor, PropertyGridEditorBoolean, PropertyGridEditorStringBase, PropertyGridEditorString, PropertyGridLinkEditor, PropertyGridColorEditor, PropertyGridEditorNumber, PropertyGridEditorImageSize, PropertyGridEditorText, PropertyGridEditorHtml, PropertyGridEditorColor, PropertyGridEditorStringArray, PropertyGridEditorDropdown, PropertyGridEditorSet, PropertyGridEditorPage, PropertyGridEditorQuestion, PropertyGridEditorQuestionSelectBase, PropertyGridEditorQuestionCarryForward, PropertyGridEditorQuestionValue, PropertyGridEditorExpression, PropertyGridEditorCondition, PropertyGridEditorMatrix, PropertyGridEditorMatrixItemValues, PropertyGridEditorMatrixRateValues, PropertyGridEditorMatrixColumns, PropertyGridEditorMatrixPages, PropertyGridEditorMatrixCalculatedValues, PropertyGridEditorMatrixHtmlConditions, PropertyGridEditorMatrixUrlConditions, PropertyGridEditorMatrixMutlipleTextItems, PropertyGridEditorMatrixMultipleTypes, PropertyGridEditorMatrixValidators, PropertyGridEditorMatrixTriggers, PropertyGridEditorBindings, PropertyGridViewModel, ObjectSelectorItem, ObjectSelector, ObjectSelectorModel, PropertyGridEditorQuestionRestfull, PropertyGridValueEditorBase, PropertyGridCellsEditor, PropertyGridValueEditor, PropertyGridRowValueEditor, PropertyGridPanelValueEditor, PropertyGridTriggerValueEditor, PropertyGridTriggerValueInLogicEditor, propertyGridCss, QuestionConverter, svgBundle, SurveyTextWorkerError, SurveyTextWorkerParserError, SurveyTextWorkerJsonError, SurveyTextWorker, JsonDuplicateNameError, QuestionToolboxCategory, QuestionToolboxItem, QuestionToolbox, SidebarModel, SidebarTabModel, getNextItemValue, getNextItemText, getNextValue, findParentNode, focusFirstControl, getFirstNonTextElement, getNodesFromKoComponentInfo, propertyExists, isPropertyVisible, toggleHovered, clearNewLines, select, copyObject, copyCssClasses, assignDefaultV2Classes, wrapTextByCurlyBraces, capitalize, notShortCircuitAnd, imageMimeTypes, getAcceptedTypesByContentMode, getQuestionFromObj, ingectAlpha, convertRgbaToString, parseRgbaFromString, parseColor, HSBToRGB, RGBToHSB, assign, ColorCalculator, SurveyQuestionEditorDefinition, ObjType, SurveyHelper, ResizeManager, UndoRedoPlugin, undoRedoTransaction, ignoreUndoRedo, UndoRedoManager, Transaction, UndoRedoAction, UndoRedoArrayAction, PagesController */
24475
+ /*! exports provided: Version, enStrings, editorLocalization, defaultStrings, localization, QuestionConvertMode, settings, EmptySurveyCreatorOptions, CreatorAction, TabbedMenuItem, TabbedMenuContainer, ToolbarActionContainer, CreatorEvent, CreatorBase, SurveyCreatorModel, StylesManager, initializeDesignTimeSurveyModel, editableStringRendererName, getElementWrapperComponentName, getQuestionContentWrapperComponentName, getElementWrapperComponentData, getItemValueWrapperComponentName, getItemValueWrapperComponentData, isStringEditable, isTextInput, registerAdorner, removeAdorners, CreatorResponsivityManager, AceJsonEditorModel, TabJsonEditorAcePlugin, JsonEditorBaseModel, TabJsonEditorBasePlugin, TextareaJsonEditorModel, TabJsonEditorTextareaPlugin, TestSurveyTabViewModel, TabTestPlugin, createColor, createBoxShadow, parseBoxShadow, DefaultFonts, fontsettingsToCssVariable, fontsettingsFromCssVariable, elementSettingsToCssVariable, elementSettingsFromCssVariable, Themes, PredefinedThemes, getThemeFullName, PredefinedColors, findSuitableTheme, ThemeBuilder, ThemeTabPlugin, initLogicOperator, LogicEvent, SurveyLogic, TranslationItemBase, TranslationItemString, TranslationItem, TranslationGroup, Translation, TranslationEditor, createImportCSVAction, createExportCSVAction, translationCss, TabTranslationPlugin, initialSettingsAllowShowEmptyTitleInDesignMode, TabDesignerViewModel, TabDesignerPlugin, SurveyLogicUI, TabLogicPlugin, logicCss, ToolboxToolViewModel, PageNavigatorViewModel, PageAdorner, RowViewModel, QuestionAdornerViewModel, QuestionDropdownAdornerViewModel, QuestionImageAdornerViewModel, QuestionRatingAdornerViewModel, ItemValueWrapperViewModel, ImageItemValueWrapperViewModel, MatrixCellWrapperEditSurvey, MatrixCellWrapperViewModel, SurveySimulatorModel, DEFAULT_MONITOR_DPI, simulatorDevices, SurveyResultsItemModel, SurveyResultsModel, LogoImageViewModel, StringItemsNavigatorBase, StringEditorConnector, StringEditorViewModelBase, QuestionEmbeddedSurveyModel, QuestionLinkValueModel, EditorLocalization, getLocString, SurveyJSON5, QuestionSpinEditorModel, QuestionColorModel, QuestionFileEditorModel, ResetValueAdorner, QuestionTextWithResetModel, QuestionCommentWithResetModel, setSurveyJSONForPropertyGrid, PropertyEditorSetupValue, PropertyGridEditorCollection, PropertyGridTitleActionsCreator, PropertyJSONGenerator, PropertyGridModel, PropertyGridEditor, PropertyGridEditorBoolean, PropertyGridEditorStringBase, PropertyGridEditorString, PropertyGridLinkEditor, PropertyGridEditorColor, PropertyGridEditorNumber, PropertyGridEditorImageSize, PropertyGridEditorText, PropertyGridEditorHtml, PropertyGridEditorStringArray, PropertyGridEditorDropdown, PropertyGridEditorSet, PropertyGridEditorPage, PropertyGridEditorQuestion, PropertyGridEditorQuestionSelectBase, PropertyGridEditorQuestionCarryForward, PropertyGridEditorQuestionValue, PropertyGridEditorExpression, PropertyGridEditorCondition, PropertyGridEditorMatrix, PropertyGridEditorMatrixItemValues, PropertyGridEditorMatrixRateValues, PropertyGridEditorMatrixColumns, PropertyGridEditorMatrixPages, PropertyGridEditorMatrixCalculatedValues, PropertyGridEditorMatrixHtmlConditions, PropertyGridEditorMatrixUrlConditions, PropertyGridEditorMatrixMutlipleTextItems, PropertyGridEditorMatrixMultipleTypes, PropertyGridEditorMatrixValidators, PropertyGridEditorMatrixTriggers, PropertyGridEditorBindings, PropertyGridViewModel, ObjectSelectorItem, ObjectSelector, ObjectSelectorModel, PropertyGridEditorQuestionRestfull, PropertyGridValueEditorBase, PropertyGridCellsEditor, PropertyGridValueEditor, PropertyGridRowValueEditor, PropertyGridPanelValueEditor, PropertyGridTriggerValueEditor, PropertyGridTriggerValueInLogicEditor, propertyGridCss, QuestionConverter, svgBundle, SurveyTextWorkerError, SurveyTextWorkerParserError, SurveyTextWorkerJsonError, SurveyTextWorker, JsonDuplicateNameError, QuestionToolboxCategory, QuestionToolboxItem, QuestionToolbox, SidebarModel, SidebarTabModel, getNextItemValue, getNextItemText, getNextValue, findParentNode, focusFirstControl, getFirstNonTextElement, getNodesFromKoComponentInfo, propertyExists, isPropertyVisible, toggleHovered, clearNewLines, select, copyObject, copyCssClasses, assignDefaultV2Classes, wrapTextByCurlyBraces, capitalize, notShortCircuitAnd, imageMimeTypes, getAcceptedTypesByContentMode, getQuestionFromObj, ingectAlpha, convertRgbaToString, parseRgbaFromString, parseColor, HSBToRGB, RGBToHSB, assign, ColorCalculator, SurveyQuestionEditorDefinition, ObjType, SurveyHelper, ResizeManager, UndoRedoPlugin, undoRedoTransaction, ignoreUndoRedo, UndoRedoManager, Transaction, UndoRedoAction, UndoRedoArrayAction, PagesController */
23483
24476
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
23484
24477
 
23485
24478
  "use strict";
@@ -23594,6 +24587,8 @@ __webpack_require__.r(__webpack_exports__);
23594
24587
 
23595
24588
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PredefinedColors", function() { return _components_tabs_themes__WEBPACK_IMPORTED_MODULE_14__["PredefinedColors"]; });
23596
24589
 
24590
+ /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "findSuitableTheme", function() { return _components_tabs_themes__WEBPACK_IMPORTED_MODULE_14__["findSuitableTheme"]; });
24591
+
23597
24592
  /* harmony import */ var _components_tabs_theme_builder__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../components/tabs/theme-builder */ "./src/components/tabs/theme-builder.ts");
23598
24593
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "ThemeBuilder", function() { return _components_tabs_theme_builder__WEBPACK_IMPORTED_MODULE_15__["ThemeBuilder"]; });
23599
24594
 
@@ -23618,6 +24613,12 @@ __webpack_require__.r(__webpack_exports__);
23618
24613
 
23619
24614
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Translation", function() { return _components_tabs_translation__WEBPACK_IMPORTED_MODULE_18__["Translation"]; });
23620
24615
 
24616
+ /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TranslationEditor", function() { return _components_tabs_translation__WEBPACK_IMPORTED_MODULE_18__["TranslationEditor"]; });
24617
+
24618
+ /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createImportCSVAction", function() { return _components_tabs_translation__WEBPACK_IMPORTED_MODULE_18__["createImportCSVAction"]; });
24619
+
24620
+ /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createExportCSVAction", function() { return _components_tabs_translation__WEBPACK_IMPORTED_MODULE_18__["createExportCSVAction"]; });
24621
+
23621
24622
  /* harmony import */ var _components_tabs_translation_theme__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../components/tabs/translation-theme */ "./src/components/tabs/translation-theme.ts");
23622
24623
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "translationCss", function() { return _components_tabs_translation_theme__WEBPACK_IMPORTED_MODULE_19__["translationCss"]; });
23623
24624
 
@@ -23750,7 +24751,7 @@ __webpack_require__.r(__webpack_exports__);
23750
24751
 
23751
24752
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PropertyGridLinkEditor", function() { return _property_grid__WEBPACK_IMPORTED_MODULE_48__["PropertyGridLinkEditor"]; });
23752
24753
 
23753
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PropertyGridColorEditor", function() { return _property_grid__WEBPACK_IMPORTED_MODULE_48__["PropertyGridColorEditor"]; });
24754
+ /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PropertyGridEditorColor", function() { return _property_grid__WEBPACK_IMPORTED_MODULE_48__["PropertyGridEditorColor"]; });
23754
24755
 
23755
24756
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PropertyGridEditorNumber", function() { return _property_grid__WEBPACK_IMPORTED_MODULE_48__["PropertyGridEditorNumber"]; });
23756
24757
 
@@ -23760,8 +24761,6 @@ __webpack_require__.r(__webpack_exports__);
23760
24761
 
23761
24762
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PropertyGridEditorHtml", function() { return _property_grid__WEBPACK_IMPORTED_MODULE_48__["PropertyGridEditorHtml"]; });
23762
24763
 
23763
- /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PropertyGridEditorColor", function() { return _property_grid__WEBPACK_IMPORTED_MODULE_48__["PropertyGridEditorColor"]; });
23764
-
23765
24764
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PropertyGridEditorStringArray", function() { return _property_grid__WEBPACK_IMPORTED_MODULE_48__["PropertyGridEditorStringArray"]; });
23766
24765
 
23767
24766
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "PropertyGridEditorDropdown", function() { return _property_grid__WEBPACK_IMPORTED_MODULE_48__["PropertyGridEditorDropdown"]; });
@@ -23965,7 +24964,7 @@ __webpack_require__.r(__webpack_exports__);
23965
24964
  /* harmony import */ var survey_core__WEBPACK_IMPORTED_MODULE_71__ = __webpack_require__(/*! survey-core */ "survey-core");
23966
24965
  /* harmony import */ var survey_core__WEBPACK_IMPORTED_MODULE_71___default = /*#__PURE__*/__webpack_require__.n(survey_core__WEBPACK_IMPORTED_MODULE_71__);
23967
24966
  var Version;
23968
- Version = "" + "1.9.110";
24967
+ Version = "" + "1.9.112";
23969
24968
  //should be loaded before other styles for easier override
23970
24969
  __webpack_require__(/*! ../utils/context-button.scss */ "./src/utils/context-button.scss");
23971
24970
 
@@ -24055,7 +25054,7 @@ __webpack_require__(/*! ../utils/design.scss */ "./src/utils/design.scss");
24055
25054
  __webpack_require__(/*! ../utils/layout.scss */ "./src/utils/layout.scss");
24056
25055
 
24057
25056
  survey_core__WEBPACK_IMPORTED_MODULE_71__["settings"].supportCreatorV2 = true;
24058
- Object(survey_core__WEBPACK_IMPORTED_MODULE_71__["checkLibraryVersion"])("" + "1.9.110", "survey-creator-core");
25057
+ Object(survey_core__WEBPACK_IMPORTED_MODULE_71__["checkLibraryVersion"])("" + "1.9.112", "survey-creator-core");
24059
25058
 
24060
25059
 
24061
25060
  /***/ }),
@@ -24368,6 +25367,7 @@ var map = {
24368
25367
  "./rating.svg": "./src/images/rating.svg",
24369
25368
  "./redo.svg": "./src/images/redo.svg",
24370
25369
  "./remove_16x16.svg": "./src/images/remove_16x16.svg",
25370
+ "./required.svg": "./src/images/required.svg",
24371
25371
  "./reset.svg": "./src/images/reset.svg",
24372
25372
  "./save.svg": "./src/images/save.svg",
24373
25373
  "./select-page.svg": "./src/images/select-page.svg",
@@ -25243,6 +26243,17 @@ module.exports = "<svg viewBox=\"0 0 16 16\" xmlns=\"http://www.w3.org/2000/svg\
25243
26243
 
25244
26244
  /***/ }),
25245
26245
 
26246
+ /***/ "./src/images/required.svg":
26247
+ /*!*********************************!*\
26248
+ !*** ./src/images/required.svg ***!
26249
+ \*********************************/
26250
+ /*! no static exports found */
26251
+ /***/ (function(module, exports) {
26252
+
26253
+ module.exports = "<svg viewBox=\"0 0 16 16\" xmlns=\"http://www.w3.org/2000/svg\"><g clip-path=\"url(#clip0_1564_16728)\"><path d=\"M2.77 14.1393L6.09 9.03927L0 9.18927L0.06 6.51927L6.15 6.88927L2.96 1.68927L5.29 0.379272L8.02 5.81927L10.96 0.489272L13.23 1.84927L9.91 6.94927L16 6.79927L15.94 9.46927L9.85 9.09927L13.04 14.2993L10.71 15.6093L7.98 10.1693L5.04 15.4993L2.77 14.1393Z\"></path></g><defs><clipPath id=\"clip0_1564_16728\"><rect width=\"16\" height=\"16\" fill=\"white\"></rect></clipPath></defs></svg>"
26254
+
26255
+ /***/ }),
26256
+
25246
26257
  /***/ "./src/images/reset.svg":
25247
26258
  /*!******************************!*\
25248
26259
  !*** ./src/images/reset.svg ***!
@@ -26292,6 +27303,8 @@ var enStrings = {
26292
27303
  translationNoStrings: "No strings to translate. Please, change the filter.",
26293
27304
  translationExportToSCVButton: "Export to CSV",
26294
27305
  translationImportFromSCVButton: "Import from CSV",
27306
+ translateUsigAI: "Auto-translate All",
27307
+ translationDialogTitle: "Untranslated strings",
26295
27308
  translationMergeLocaleWithDefault: "Merge {0} with default locale",
26296
27309
  translationPlaceHolder: "Translation...",
26297
27310
  themeExportButton: "Export",
@@ -26322,9 +27335,13 @@ var enStrings = {
26322
27335
  question_visibilityName: "Show (hide) question",
26323
27336
  question_enableName: "Enable (disable) question",
26324
27337
  question_requireName: "Make question required",
27338
+ question_resetValueName: "Reset question value",
27339
+ question_setValueName: "Set question value",
26325
27340
  column_visibilityName: "Show (hide) column",
26326
27341
  column_enableName: "Enable (disable) column",
26327
27342
  column_requireName: "Make column required",
27343
+ column_resetValueName: "Reset column value",
27344
+ column_setValueName: "Set column value",
26328
27345
  trigger_completeName: "Complete survey",
26329
27346
  trigger_setvalueName: "Set answer",
26330
27347
  trigger_copyvalueName: "Copy answer",
@@ -26351,9 +27368,14 @@ var enStrings = {
26351
27368
  question_visibilityText: "make question {0} visible",
26352
27369
  question_enableText: "make question {0} enable",
26353
27370
  question_requireText: "make question {0} required",
27371
+ question_resetValueText: "reset value for question: {0}",
27372
+ question_setValueText: "assign value: {1} to question: {0}",
26354
27373
  column_visibilityText: "make column {0} of question {1} visible",
26355
27374
  column_enableText: "make column {0} of question {1} enable",
26356
27375
  column_requireText: "make column {0} of question {1} required",
27376
+ column_resetValueText: "reset cell value for column: {0}",
27377
+ column_setValueText: "assign cell value: {1} to column: {0}",
27378
+ setValueExpressionPlaceholder: "An expression whose result will be assigned to the target question.",
26357
27379
  trigger_completeText: "survey becomes completed",
26358
27380
  trigger_setvalueText: "set into question: {0} value {1}",
26359
27381
  trigger_setvalueEmptyText: "clear question value: {0}",
@@ -26419,6 +27441,7 @@ var enStrings = {
26419
27441
  fastEntry: "Manual Entry",
26420
27442
  fastEntryNonUniqueError: "Value '{0}' is not unique",
26421
27443
  fastEntryChoicesCountError: "Please limit the number of items from {0} to {1}",
27444
+ fastEntryChoicesMinCountError: "Please enter at least {0} items",
26422
27445
  fastEntryPlaceholder: "You can set data in the following format:\nvalue1|text\nvalue2",
26423
27446
  formEntry: "Form Entry",
26424
27447
  testService: "Test the service",
@@ -26483,6 +27506,8 @@ var enStrings = {
26483
27506
  choicesOrder: "Choices sort order",
26484
27507
  visible: "Visible",
26485
27508
  isRequired: "Required",
27509
+ markRequired: "Mark as required",
27510
+ removeRequiredMark: "Remove the required mark",
26486
27511
  isAllRowRequired: "Require answer for all rows",
26487
27512
  requiredErrorText: "\"Required\" error message",
26488
27513
  startWithNewLine: "Display the question on a new line",
@@ -26564,8 +27589,12 @@ var enStrings = {
26564
27589
  imageHeight: "Image height (in CSS-accepted values)",
26565
27590
  imageWidth: "Image width (in CSS-accepted values)"
26566
27591
  },
27592
+ survey: {
27593
+ title: "Title"
27594
+ },
26567
27595
  page: {
26568
- maxTimeToFinish: "Time limit to finish the page (in seconds)"
27596
+ title: "Title",
27597
+ maxTimeToFinish: "Time limit to finish the page (in seconds)",
26569
27598
  },
26570
27599
  question: {
26571
27600
  page: "Parent page"
@@ -27066,6 +28095,8 @@ var enStrings = {
27066
28095
  descriptionLocation: "Description location",
27067
28096
  defaultValueExpression: "Default value expression",
27068
28097
  requiredIf: "Required if",
28098
+ resetValueIf: "Reset value if",
28099
+ setValueIf: "Set value if",
27069
28100
  validators: "Validators",
27070
28101
  bindings: "Bindings",
27071
28102
  renderAs: "Render as",
@@ -27142,6 +28173,9 @@ var enStrings = {
27142
28173
  "--base-unit": "Base unit",
27143
28174
  groupGeneral: "General",
27144
28175
  groupAdvanced: "Advanced",
28176
+ groupHeader: "Header",
28177
+ groupBackground: "Background",
28178
+ groupAppearance: "Appearance",
27145
28179
  themeName: "Theme",
27146
28180
  themeMode: "Question appearance",
27147
28181
  themeModePanels: "Default",
@@ -27152,11 +28186,16 @@ var enStrings = {
27152
28186
  primaryDefaultColor: "Default",
27153
28187
  primaryDarkColor: "Hover",
27154
28188
  primaryLightColor: "Selected",
28189
+ coverTitleForecolor: "Title forecolor",
28190
+ coverDescriptionForecolor: "Description forecolor",
28191
+ coverOverlapEnabled: "Overlap",
27155
28192
  backgroundDimColor: "Background color",
27156
28193
  backgroundImage: "Background image",
27157
28194
  backgroundImageFitAuto: "Auto",
27158
28195
  backgroundImageFitCover: "Cover",
27159
28196
  backgroundImageFitContain: "Contain",
28197
+ backgroundImageFitFill: "Stretch",
28198
+ backgroundImageFitTile: "Tile",
27160
28199
  backgroundOpacity: "Opacity",
27161
28200
  backgroundImageAttachmentFixed: "Fixed",
27162
28201
  backgroundImageAttachmentScroll: "Scroll",
@@ -27201,6 +28240,26 @@ var enStrings = {
27201
28240
  boxShadowInner: "Inner",
27202
28241
  questionShadow: "Shadow effects",
27203
28242
  editorShadow: "Input element shadow effects",
28243
+ headerView: "View",
28244
+ headerViewBasic: "Basic",
28245
+ headerViewAdvanced: "Advanced",
28246
+ coverInheritWidthFrom: "Content area width",
28247
+ coverInheritWidthFromSurvey: "Same as survey",
28248
+ coverInheritWidthFromPage: "Fit to page",
28249
+ coverTextAreaWidth: "Text width",
28250
+ coverBackgroundColorSwitch: "Background color",
28251
+ coverBackgroundColorNone: "None",
28252
+ coverBackgroundColorAccentColor: "Accent color",
28253
+ coverBackgroundColorCustom: "Custom",
28254
+ horizontalAlignmentLeft: "Left",
28255
+ horizontalAlignmentCenter: "Center",
28256
+ horizontalAlignmentRight: "Right",
28257
+ verticalAlignmentTop: "Top",
28258
+ verticalAlignmentMiddle: "Middle",
28259
+ verticalAlignmentBottom: "Bottom",
28260
+ logoPosition: "Logo Position",
28261
+ coverTitlePosition: "Title Position",
28262
+ coverDescriptionPosition: "Description Position",
27204
28263
  names: {
27205
28264
  "default": "Default",
27206
28265
  "sharp": "Sharp",
@@ -27349,6 +28408,7 @@ var UndoRedoPlugin = /** @class */ (function () {
27349
28408
  this.model = new _undo_redo_controller__WEBPACK_IMPORTED_MODULE_0__["UndoRedoController"](creator);
27350
28409
  this.model.createActions().forEach(function (action) { return creator.toolbar.actions.push(action); });
27351
28410
  creator.registerShortcut("undo", {
28411
+ affectedTab: "designer",
27352
28412
  hotKey: {
27353
28413
  ctrlKey: true,
27354
28414
  keyCode: 90,
@@ -27359,6 +28419,7 @@ var UndoRedoPlugin = /** @class */ (function () {
27359
28419
  execute: function () { return _this.model.undo(); }
27360
28420
  });
27361
28421
  creator.registerShortcut("redo", {
28422
+ affectedTab: "designer",
27362
28423
  hotKey: {
27363
28424
  ctrlKey: true,
27364
28425
  keyCode: 89,
@@ -27377,8 +28438,8 @@ var UndoRedoPlugin = /** @class */ (function () {
27377
28438
  UndoRedoPlugin.prototype.update = function () {
27378
28439
  };
27379
28440
  UndoRedoPlugin.prototype.addFooterActions = function () {
27380
- this.model.undoAction && (this.creator.footerToolbar.actions.push(this.model.undoAction));
27381
- this.model.redoAction && (this.creator.footerToolbar.actions.push(this.model.redoAction));
28441
+ this.model.undoAction && (this.creator.footerToolbar.actions.splice(2, 0, this.model.undoAction));
28442
+ this.model.redoAction && (this.creator.footerToolbar.actions.splice(3, 0, this.model.redoAction));
27382
28443
  };
27383
28444
  return UndoRedoPlugin;
27384
28445
  }());
@@ -27614,6 +28675,9 @@ var UndoRedoController = /** @class */ (function (_super) {
27614
28675
  locTitleName: "ed.undo",
27615
28676
  showTitle: false,
27616
28677
  visible: new survey_core__WEBPACK_IMPORTED_MODULE_1__["ComputedUpdater"](function () { return _this.creator.activeTab === "designer"; }),
28678
+ needSeparator: new survey_core__WEBPACK_IMPORTED_MODULE_1__["ComputedUpdater"](function () {
28679
+ return _this.creator.isMobileView;
28680
+ }),
27617
28681
  action: function () { return _this.undo(); }
27618
28682
  });
27619
28683
  this.redoAction = new survey_core__WEBPACK_IMPORTED_MODULE_1__["Action"]({
@@ -27900,6 +28964,7 @@ var UndoRedoArrayAction = /** @class */ (function () {
27900
28964
  this._index = 0;
27901
28965
  this._itemsToAdd = [];
27902
28966
  this._deletedItems = [];
28967
+ this.survey = _sender.getSurvey();
27903
28968
  this._index = arrayChanges.index;
27904
28969
  this._itemsToAdd = arrayChanges.itemsToAdd;
27905
28970
  this._deletedItems = arrayChanges.deletedItems;
@@ -27908,10 +28973,13 @@ var UndoRedoArrayAction = /** @class */ (function () {
27908
28973
  this.rollback();
27909
28974
  };
27910
28975
  UndoRedoArrayAction.prototype.rollback = function () {
28976
+ this._sender = this.getSenderElement();
28977
+ if (!this._sender)
28978
+ return;
27911
28979
  var array = this._sender[this._propertyName];
27912
28980
  var index = this._index;
27913
28981
  var deleteCount = this._itemsToAdd.length;
27914
- var itemsToAdd = [].concat(this._deletedItems);
28982
+ var itemsToAdd = this.getItemsToAdd();
27915
28983
  this._deletedItems = array.splice.apply(array, [index, deleteCount].concat(itemsToAdd));
27916
28984
  this._itemsToAdd = [].concat(itemsToAdd);
27917
28985
  };
@@ -27935,6 +29003,31 @@ var UndoRedoArrayAction = /** @class */ (function () {
27935
29003
  UndoRedoArrayAction.prototype.tryMerge = function (sender, propertyName, newValue) {
27936
29004
  return false;
27937
29005
  };
29006
+ UndoRedoArrayAction.prototype.getSenderElement = function () {
29007
+ if (!this._sender.isDisposed || !this.survey)
29008
+ return this._sender;
29009
+ var name = this._sender["name"];
29010
+ if (this._sender["isPage"] === true)
29011
+ return this.survey.getPageByName(name);
29012
+ if (this._sender["isPanel"] === true)
29013
+ return this.survey.getPanelByName(name);
29014
+ if (this._sender["isQuestion"] === true)
29015
+ return this.survey.getQuestionByName(name);
29016
+ return this._sender;
29017
+ };
29018
+ UndoRedoArrayAction.prototype.getItemsToAdd = function () {
29019
+ var res = [];
29020
+ for (var i = 0; i < this._deletedItems.length; i++) {
29021
+ var obj = this._deletedItems[i];
29022
+ if (obj.isDisposed && obj.getType) {
29023
+ var json = obj.toJSON();
29024
+ obj = survey_core__WEBPACK_IMPORTED_MODULE_0__["Serializer"].createClass(obj.getType());
29025
+ obj.fromJSON(json);
29026
+ }
29027
+ res.push(obj);
29028
+ }
29029
+ return res;
29030
+ };
27938
29031
  return UndoRedoArrayAction;
27939
29032
  }());
27940
29033
 
@@ -28909,6 +30002,7 @@ var ConditionEditor = /** @class */ (function (_super) {
28909
30002
  name: "conjunction",
28910
30003
  type: "dropdown",
28911
30004
  renderAs: "logicoperator",
30005
+ searchEnabled: false,
28912
30006
  titleLocation: "hidden",
28913
30007
  showOptionsCaption: false,
28914
30008
  visibleIf: "{panelIndex} > 0",
@@ -29789,6 +30883,15 @@ var FastEntryEditorBase = /** @class */ (function (_super) {
29789
30883
  _this.editSurvey.getQuestionByName("question").placeholder =
29790
30884
  _editorLocalization__WEBPACK_IMPORTED_MODULE_3__["editorLocalization"].getString("pe.fastEntryPlaceholder");
29791
30885
  _this.editSurvey.onValidateQuestion.add(function (sender, options) {
30886
+ var minChoiceCount = _this.options.minimumChoicesCount;
30887
+ if (minChoiceCount > 0) {
30888
+ var choicesCount = _this.getChoicesCount();
30889
+ if (minChoiceCount > choicesCount) {
30890
+ options.error = _editorLocalization__WEBPACK_IMPORTED_MODULE_3__["editorLocalization"]
30891
+ .getString("pe.fastEntryChoicesMinCountError")["format"](minChoiceCount);
30892
+ }
30893
+ return;
30894
+ }
29792
30895
  var maxChoicesCount = _this.options.maximumChoicesCount;
29793
30896
  if (maxChoicesCount > 0) {
29794
30897
  var choicesCount = _this.getChoicesCount();
@@ -30011,7 +31114,7 @@ var FastEntryEditor = /** @class */ (function (_super) {
30011
31114
  /*!************************************!*\
30012
31115
  !*** ./src/property-grid/index.ts ***!
30013
31116
  \************************************/
30014
- /*! exports provided: setSurveyJSONForPropertyGrid, PropertyEditorSetupValue, PropertyGridEditorCollection, PropertyGridTitleActionsCreator, PropertyJSONGenerator, PropertyGridModel, PropertyGridEditor, PropertyGridEditorBoolean, PropertyGridEditorStringBase, PropertyGridEditorString, PropertyGridLinkEditor, PropertyGridColorEditor, PropertyGridEditorNumber, PropertyGridEditorImageSize, PropertyGridEditorText, PropertyGridEditorHtml, PropertyGridEditorColor, PropertyGridEditorStringArray, PropertyGridEditorDropdown, PropertyGridEditorSet, PropertyGridEditorPage, PropertyGridEditorQuestion, PropertyGridEditorQuestionSelectBase, PropertyGridEditorQuestionCarryForward, PropertyGridEditorQuestionValue */
31117
+ /*! exports provided: setSurveyJSONForPropertyGrid, PropertyEditorSetupValue, PropertyGridEditorCollection, PropertyGridTitleActionsCreator, PropertyJSONGenerator, PropertyGridModel, PropertyGridEditor, PropertyGridEditorBoolean, PropertyGridEditorStringBase, PropertyGridEditorString, PropertyGridLinkEditor, PropertyGridEditorColor, PropertyGridEditorNumber, PropertyGridEditorImageSize, PropertyGridEditorText, PropertyGridEditorHtml, PropertyGridEditorStringArray, PropertyGridEditorDropdown, PropertyGridEditorSet, PropertyGridEditorPage, PropertyGridEditorQuestion, PropertyGridEditorQuestionSelectBase, PropertyGridEditorQuestionCarryForward, PropertyGridEditorQuestionValue */
30015
31118
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
30016
31119
 
30017
31120
  "use strict";
@@ -30027,12 +31130,11 @@ __webpack_require__.r(__webpack_exports__);
30027
31130
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PropertyGridEditorStringBase", function() { return PropertyGridEditorStringBase; });
30028
31131
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PropertyGridEditorString", function() { return PropertyGridEditorString; });
30029
31132
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PropertyGridLinkEditor", function() { return PropertyGridLinkEditor; });
30030
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PropertyGridColorEditor", function() { return PropertyGridColorEditor; });
31133
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PropertyGridEditorColor", function() { return PropertyGridEditorColor; });
30031
31134
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PropertyGridEditorNumber", function() { return PropertyGridEditorNumber; });
30032
31135
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PropertyGridEditorImageSize", function() { return PropertyGridEditorImageSize; });
30033
31136
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PropertyGridEditorText", function() { return PropertyGridEditorText; });
30034
31137
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PropertyGridEditorHtml", function() { return PropertyGridEditorHtml; });
30035
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PropertyGridEditorColor", function() { return PropertyGridEditorColor; });
30036
31138
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PropertyGridEditorStringArray", function() { return PropertyGridEditorStringArray; });
30037
31139
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PropertyGridEditorDropdown", function() { return PropertyGridEditorDropdown; });
30038
31140
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PropertyGridEditorSet", function() { return PropertyGridEditorSet; });
@@ -31219,12 +32321,10 @@ var PropertyGridLinkEditor = /** @class */ (function (_super) {
31219
32321
  return _super !== null && _super.apply(this, arguments) || this;
31220
32322
  }
31221
32323
  PropertyGridLinkEditor.prototype.fit = function (prop) {
31222
- return ["logo", "imageLink", "backgroundImage"].indexOf(prop.name) > -1;
32324
+ return prop.type === "url" || prop.type === "file";
31223
32325
  };
31224
32326
  PropertyGridLinkEditor.prototype.getJSON = function (obj, prop, options) {
31225
- var _a;
31226
- var maxSize = ((_a = options.onUploadFile) === null || _a === void 0 ? void 0 : _a.isEmpty) ? 65536 : undefined;
31227
- var res = { type: "fileedit", storeDataAsText: false, maxSize: maxSize };
32327
+ var res = { type: "fileedit", storeDataAsText: false };
31228
32328
  return res;
31229
32329
  };
31230
32330
  PropertyGridLinkEditor.prototype.onCreated = function (obj, question, prop, options) {
@@ -31244,19 +32344,19 @@ var PropertyGridLinkEditor = /** @class */ (function (_super) {
31244
32344
  return PropertyGridLinkEditor;
31245
32345
  }(PropertyGridEditor));
31246
32346
 
31247
- var PropertyGridColorEditor = /** @class */ (function (_super) {
31248
- Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(PropertyGridColorEditor, _super);
31249
- function PropertyGridColorEditor() {
32347
+ var PropertyGridEditorColor = /** @class */ (function (_super) {
32348
+ Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(PropertyGridEditorColor, _super);
32349
+ function PropertyGridEditorColor() {
31250
32350
  return _super !== null && _super.apply(this, arguments) || this;
31251
32351
  }
31252
- PropertyGridColorEditor.prototype.fit = function (prop) {
31253
- return ["penColor", "backgroundColor"].indexOf(prop.name) > -1;
32352
+ PropertyGridEditorColor.prototype.fit = function (prop) {
32353
+ return prop.type == "color";
31254
32354
  };
31255
- PropertyGridColorEditor.prototype.getJSON = function (obj, prop, options) {
32355
+ PropertyGridEditorColor.prototype.getJSON = function (obj, prop, options) {
31256
32356
  var res = { type: "color", allowEmptyValue: true };
31257
32357
  return res;
31258
32358
  };
31259
- return PropertyGridColorEditor;
32359
+ return PropertyGridEditorColor;
31260
32360
  }(PropertyGridEditor));
31261
32361
 
31262
32362
  var PropertyGridEditorNumber = /** @class */ (function (_super) {
@@ -31340,20 +32440,6 @@ var PropertyGridEditorHtml = /** @class */ (function (_super) {
31340
32440
  return PropertyGridEditorHtml;
31341
32441
  }(PropertyGridEditorStringBase));
31342
32442
 
31343
- var PropertyGridEditorColor = /** @class */ (function (_super) {
31344
- Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(PropertyGridEditorColor, _super);
31345
- function PropertyGridEditorColor() {
31346
- return _super !== null && _super.apply(this, arguments) || this;
31347
- }
31348
- PropertyGridEditorColor.prototype.fit = function (prop) {
31349
- return prop.type == "color";
31350
- };
31351
- PropertyGridEditorColor.prototype.getJSON = function (obj, prop, options) {
31352
- return { type: "text", inputType: "color" };
31353
- };
31354
- return PropertyGridEditorColor;
31355
- }(PropertyGridEditor));
31356
-
31357
32443
  var PropertyGridEditorStringArray = /** @class */ (function (_super) {
31358
32444
  Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(PropertyGridEditorStringArray, _super);
31359
32445
  function PropertyGridEditorStringArray() {
@@ -31671,7 +32757,6 @@ var PropertyGridEditorQuestionValue = /** @class */ (function (_super) {
31671
32757
  PropertyGridEditorCollection.register(new PropertyGridEditorBoolean());
31672
32758
  PropertyGridEditorCollection.register(new PropertyGridEditorString());
31673
32759
  PropertyGridEditorCollection.register(new PropertyGridEditorNumber());
31674
- PropertyGridEditorCollection.register(new PropertyGridEditorColor());
31675
32760
  PropertyGridEditorCollection.register(new PropertyGridEditorText());
31676
32761
  PropertyGridEditorCollection.register(new PropertyGridEditorHtml());
31677
32762
  PropertyGridEditorCollection.register(new PropertyGridEditorDropdown());
@@ -31683,7 +32768,7 @@ PropertyGridEditorCollection.register(new PropertyGridEditorQuestionValue());
31683
32768
  PropertyGridEditorCollection.register(new PropertyGridEditorQuestionSelectBase());
31684
32769
  PropertyGridEditorCollection.register(new PropertyGridEditorQuestionCarryForward());
31685
32770
  PropertyGridEditorCollection.register(new PropertyGridEditorImageSize());
31686
- PropertyGridEditorCollection.register(new PropertyGridColorEditor());
32771
+ PropertyGridEditorCollection.register(new PropertyGridEditorColor());
31687
32772
  survey_core__WEBPACK_IMPORTED_MODULE_1__["QuestionFactory"].Instance.registerQuestion("buttongroup", function (name) {
31688
32773
  return new survey_core__WEBPACK_IMPORTED_MODULE_1__["QuestionButtonGroupModel"](name);
31689
32774
  });
@@ -31797,17 +32882,18 @@ var PropertyGridEditorMatrix = /** @class */ (function (_super) {
31797
32882
  q.property = survey_core__WEBPACK_IMPORTED_MODULE_1__["Serializer"].findProperty(rowObj.getType(), options.columnName);
31798
32883
  };
31799
32884
  PropertyGridEditorMatrix.prototype.onMatrixCellValueChanged = function (obj, options) {
31800
- var column = options.question.getColumnByName(options.columnName);
31801
- if (!column || !column.isUnique)
31802
- return;
31803
- options.question.visibleRows.forEach(function (row) {
31804
- if (row !== options.row) {
31805
- var q = row.getQuestionByColumnName(options.columnName);
31806
- if (!!q && q.errors.length > 0) {
31807
- q.hasErrors();
32885
+ var matrix = options.question;
32886
+ var column = options.column;
32887
+ if (matrix && column && column.isUnique) {
32888
+ matrix.visibleRows.forEach(function (row) {
32889
+ if (row !== options.row) {
32890
+ var question = row.getQuestionByColumnName(options.columnName);
32891
+ if (question && question.errors.length > 0 && !question.isEmpty()) {
32892
+ matrix.checkIfValueInRowDuplicated(row, question);
32893
+ }
31808
32894
  }
31809
- }
31810
- });
32895
+ });
32896
+ }
31811
32897
  };
31812
32898
  PropertyGridEditorMatrix.prototype.onGetMatrixRowAction = function (obj, options, setObjFunc) {
31813
32899
  var _this = this;
@@ -32026,7 +33112,11 @@ var PropertyGridEditorMatrix = /** @class */ (function (_super) {
32026
33112
  if (this.getShowDetailPanelOnAdding()) {
32027
33113
  res.detailPanelShowOnAdding = true;
32028
33114
  }
33115
+ var minRowCount = this.getMinimumRowCount(obj, prop, options);
32029
33116
  var maxRowCount = this.getMaximumRowCount(obj, prop, options);
33117
+ if (minRowCount > 0) {
33118
+ res.minRowCount = minRowCount;
33119
+ }
32030
33120
  if (maxRowCount > 0) {
32031
33121
  res.maxRowCount = maxRowCount;
32032
33122
  }
@@ -32040,10 +33130,13 @@ var PropertyGridEditorMatrix = /** @class */ (function (_super) {
32040
33130
  }
32041
33131
  return _editorLocalization__WEBPACK_IMPORTED_MODULE_2__["editorLocalization"].getString(locName);
32042
33132
  };
33133
+ PropertyGridEditorMatrix.prototype.getMinimumRowCount = function (obj, prop, options) {
33134
+ return -1;
33135
+ };
32043
33136
  PropertyGridEditorMatrix.prototype.getMaximumRowCount = function (obj, prop, options) {
32044
33137
  return -1;
32045
33138
  };
32046
- PropertyGridEditorMatrix.prototype.filterPropertyNames = function (propNames) {
33139
+ PropertyGridEditorMatrix.prototype.filterPropertyNames = function (propNames, options) {
32047
33140
  return propNames;
32048
33141
  };
32049
33142
  PropertyGridEditorMatrix.prototype.getColumnsJSON = function (obj, prop, propNames, options) {
@@ -32051,7 +33144,7 @@ var PropertyGridEditorMatrix = /** @class */ (function (_super) {
32051
33144
  if (!className) {
32052
33145
  className = prop.baseClassName;
32053
33146
  }
32054
- var res = new _index__WEBPACK_IMPORTED_MODULE_6__["PropertyJSONGenerator"](obj, options).createColumnsJSON(className, this.filterPropertyNames(propNames));
33147
+ var res = new _index__WEBPACK_IMPORTED_MODULE_6__["PropertyJSONGenerator"](obj, options).createColumnsJSON(className, this.filterPropertyNames(propNames, options));
32055
33148
  for (var i = 0; i < res.length; i++) {
32056
33149
  if (res[i].cellType == "comment") {
32057
33150
  res[i].cellType = "text";
@@ -32100,8 +33193,12 @@ var PropertyGridEditorMatrixItemValues = /** @class */ (function (_super) {
32100
33193
  PropertyGridEditorMatrixItemValues.prototype.fit = function (prop) {
32101
33194
  return (prop.isArray && survey_core__WEBPACK_IMPORTED_MODULE_1__["Serializer"].isDescendantOf(prop.className, "itemvalue") && prop.name != "rateValues");
32102
33195
  };
32103
- PropertyGridEditorMatrixItemValues.prototype.filterPropertyNames = function (propNames) {
32104
- return propNames.filter(function (p) { return p != "icon"; });
33196
+ PropertyGridEditorMatrixItemValues.prototype.excludeTextPropertyName = function (propNames, options) {
33197
+ var hideText = options === null || options === void 0 ? void 0 : options.inplaceEditForValues;
33198
+ return !!hideText ? propNames.filter(function (p) { return p !== "text"; }) : propNames;
33199
+ };
33200
+ PropertyGridEditorMatrixItemValues.prototype.filterPropertyNames = function (propNames, options) {
33201
+ return this.excludeTextPropertyName(propNames, options).filter(function (p) { return p != "icon"; });
32105
33202
  };
32106
33203
  PropertyGridEditorMatrixItemValues.prototype.isPropertyEditorSetupEnabled = function (obj, prop, question, options) {
32107
33204
  if (question.showTextView === false)
@@ -32145,6 +33242,11 @@ var PropertyGridEditorMatrixItemValues = /** @class */ (function (_super) {
32145
33242
  res.showHeader = res.columns > 3;
32146
33243
  return res;
32147
33244
  };
33245
+ PropertyGridEditorMatrixItemValues.prototype.getMinimumRowCount = function (obj, prop, options) {
33246
+ if (prop.name === "choices")
33247
+ return options.minimumChoicesCount;
33248
+ return _super.prototype.getMaximumRowCount.call(this, obj, prop, options);
33249
+ };
32148
33250
  PropertyGridEditorMatrixItemValues.prototype.getMaximumRowCount = function (obj, prop, options) {
32149
33251
  if (prop.name === "choices")
32150
33252
  return options.maximumChoicesCount;
@@ -32233,8 +33335,8 @@ var PropertyGridEditorMatrixRateValues = /** @class */ (function (_super) {
32233
33335
  clearAction.visible = false;
32234
33336
  _super.prototype.onGetQuestionTitleActions.call(this, obj, options);
32235
33337
  };
32236
- PropertyGridEditorMatrixRateValues.prototype.filterPropertyNames = function (propNames) {
32237
- return propNames;
33338
+ PropertyGridEditorMatrixRateValues.prototype.filterPropertyNames = function (propNames, options) {
33339
+ return this.excludeTextPropertyName(propNames, options);
32238
33340
  };
32239
33341
  return PropertyGridEditorMatrixRateValues;
32240
33342
  }(PropertyGridEditorMatrixItemValues));
@@ -32880,6 +33982,7 @@ var PropertyGridViewModel = /** @class */ (function (_super) {
32880
33982
  title: this.selectedElementName,
32881
33983
  css: "sv-action--object-selector sv-action-bar-item--secondary",
32882
33984
  component: "sv-action-bar-item-dropdown",
33985
+ disableHide: true,
32883
33986
  action: function () {
32884
33987
  _this.selectorPopupModel.displayMode = _this.creator.isMobileView ? "overlay" : "popup";
32885
33988
  selectorModel.show(_this.selectionController.creator.survey, _this.propertyGridModel.obj, function (obj) {
@@ -33350,6 +34453,9 @@ var SurveyQuestionEditorDefinition = /** @class */ (function () {
33350
34453
  { name: "requiredIf", tab: "logic" },
33351
34454
  { name: "bindings", tab: "logic" },
33352
34455
  { name: "defaultValueExpression", tab: "logic" },
34456
+ { name: "resetValueIf", tab: "logic" },
34457
+ { name: "setValueIf", tab: "logic" },
34458
+ { name: "setValueExpression", tab: "logic" },
33353
34459
  { name: "page", tab: "layout" },
33354
34460
  { name: "startWithNewLine", tab: "layout" },
33355
34461
  { name: "hideNumber", tab: "layout" },
@@ -33663,6 +34769,9 @@ var SurveyQuestionEditorDefinition = /** @class */ (function () {
33663
34769
  { name: "enableIf", tab: "logic" },
33664
34770
  { name: "requiredIf", tab: "logic" },
33665
34771
  { name: "defaultValueExpression", tab: "logic" },
34772
+ { name: "resetValueIf", tab: "logic" },
34773
+ { name: "setValueIf", tab: "logic" },
34774
+ { name: "setValueExpression", tab: "logic" },
33666
34775
  { name: "totalType", tab: "totals" },
33667
34776
  { name: "totalDisplayStyle", tab: "totals" },
33668
34777
  { name: "totalCurrency", tab: "totals" },
@@ -34387,13 +35496,34 @@ __webpack_require__.r(__webpack_exports__);
34387
35496
  /* harmony import */ var survey_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! survey-core */ "survey-core");
34388
35497
  /* harmony import */ var survey_core__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(survey_core__WEBPACK_IMPORTED_MODULE_0__);
34389
35498
  /* harmony import */ var _creator_settings__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./creator-settings */ "./src/creator-settings.ts");
34390
- /* harmony import */ var _toolbox__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toolbox */ "./src/toolbox.ts");
34391
-
34392
35499
 
34393
35500
 
34394
35501
  var QuestionConverter = /** @class */ (function () {
34395
35502
  function QuestionConverter() {
34396
35503
  }
35504
+ Object.defineProperty(QuestionConverter, "convertInfo", {
35505
+ get: function () {
35506
+ if (!QuestionConverter.convertInfoValue) {
35507
+ QuestionConverter.convertInfoValue = {};
35508
+ QuestionConverter.createDefaultQuestionConverterItems();
35509
+ }
35510
+ return QuestionConverter.convertInfoValue;
35511
+ },
35512
+ enumerable: false,
35513
+ configurable: true
35514
+ });
35515
+ QuestionConverter.createDefaultQuestionConverterItems = function () {
35516
+ var classes = survey_core__WEBPACK_IMPORTED_MODULE_0__["Serializer"].getChildrenClasses("selectbase", true);
35517
+ for (var i = 0; i < classes.length; i++) {
35518
+ for (var j = 0; j < classes.length; j++) {
35519
+ if (i == j)
35520
+ continue;
35521
+ QuestionConverter.addConvertInfo(classes[i].name, classes[j].name);
35522
+ }
35523
+ }
35524
+ QuestionConverter.addConvertInfo("text", "comment");
35525
+ QuestionConverter.addConvertInfo("comment", "text");
35526
+ };
34397
35527
  QuestionConverter.addConvertInfo = function (className, convertToClassName) {
34398
35528
  if (!QuestionConverter.convertInfo[className]) {
34399
35529
  QuestionConverter.convertInfo[className] = [];
@@ -34416,24 +35546,29 @@ var QuestionConverter = /** @class */ (function () {
34416
35546
  }
34417
35547
  return !!res ? res : [];
34418
35548
  };
34419
- QuestionConverter.convertObject = function (obj, convertToClass, defaultJSON) {
35549
+ QuestionConverter.convertObject = function (obj, convertToClass, defaultObjJSON, defaultJSON) {
35550
+ if (defaultObjJSON === void 0) { defaultObjJSON = null; }
34420
35551
  if (defaultJSON === void 0) { defaultJSON = null; }
34421
35552
  if (!obj || !obj.parent || convertToClass == obj.getType())
34422
35553
  return null;
34423
- var questionDefaultSettings = _toolbox__WEBPACK_IMPORTED_MODULE_2__["QuestionToolbox"].getQuestionDefaultSettings(convertToClass);
34424
- var newQuestion = survey_core__WEBPACK_IMPORTED_MODULE_0__["QuestionFactory"].Instance.createQuestion(convertToClass, obj.name);
35554
+ var newQuestion = !defaultJSON ? survey_core__WEBPACK_IMPORTED_MODULE_0__["QuestionFactory"].Instance.createQuestion(convertToClass, obj.name) : undefined;
34425
35555
  if (!newQuestion) {
34426
35556
  newQuestion = survey_core__WEBPACK_IMPORTED_MODULE_0__["Serializer"].createClass(convertToClass, {});
34427
35557
  }
34428
- if (newQuestion instanceof survey_core__WEBPACK_IMPORTED_MODULE_0__["QuestionSelectBase"] && (questionDefaultSettings === null || questionDefaultSettings === void 0 ? void 0 : questionDefaultSettings.choices))
34429
- newQuestion.choices = null;
34430
35558
  newQuestion.name = obj.name;
34431
- var json = newQuestion.toJSON();
35559
+ var json = defaultJSON ? survey_core__WEBPACK_IMPORTED_MODULE_0__["Helpers"].createCopy(defaultJSON) : newQuestion.toJSON();
34432
35560
  var qJson = obj.toJSON();
35561
+ if (defaultObjJSON) {
35562
+ for (var key in defaultObjJSON) {
35563
+ if (qJson[key] && survey_core__WEBPACK_IMPORTED_MODULE_0__["Helpers"].isTwoValueEquals(qJson[key], defaultObjJSON[key])) {
35564
+ delete qJson[key];
35565
+ }
35566
+ }
35567
+ }
34433
35568
  for (var key in qJson) {
34434
35569
  json[key] = qJson[key];
34435
35570
  }
34436
- QuestionConverter.updateJSON(json, convertToClass, obj.getType(), defaultJSON);
35571
+ QuestionConverter.updateJSON(json, convertToClass, obj.getType());
34437
35572
  newQuestion.fromJSON(json);
34438
35573
  QuestionConverter.removeValidators(newQuestion);
34439
35574
  var panel = obj.parent;
@@ -34445,37 +35580,12 @@ var QuestionConverter = /** @class */ (function () {
34445
35580
  newQuestion.onSurveyLoad();
34446
35581
  return newQuestion;
34447
35582
  };
34448
- QuestionConverter.updateJSON = function (json, convertToClass, convertFromClass, defaultJSON) {
34449
- QuestionConverter.updateJSONFromQuestionDefaultSettings(json, convertToClass, defaultJSON);
34450
- QuestionConverter.updateJSONForRating(json, convertToClass, defaultJSON);
35583
+ QuestionConverter.updateJSON = function (json, convertToClass, convertFromClass) {
35584
+ QuestionConverter.updateJSONForRating(json, convertToClass);
34451
35585
  QuestionConverter.updateJSONForMatrices(json, convertToClass, convertFromClass);
34452
35586
  QuestionConverter.updateJSONForPanels(json, convertToClass, convertFromClass);
34453
35587
  QuestionConverter.updateJSONForBarrating(json, convertToClass);
34454
35588
  };
34455
- QuestionConverter.updateJSONFromQuestionDefaultSettings = function (json, convertToClass, defaultJSON) {
34456
- var questionDefaultSettings = _toolbox__WEBPACK_IMPORTED_MODULE_2__["QuestionToolbox"].getQuestionDefaultSettings(convertToClass);
34457
- if (!questionDefaultSettings)
34458
- return;
34459
- if (convertToClass === "image" && !json.imageLink) {
34460
- json.imageLink = questionDefaultSettings.imageLink;
34461
- }
34462
- if (convertToClass === "imagepicker" ||
34463
- convertToClass === "dropdown" ||
34464
- convertToClass === "checkbox" ||
34465
- convertToClass === "radiogroup" ||
34466
- convertToClass === "ranking") {
34467
- if (!json.choices) {
34468
- json.choices = questionDefaultSettings.choices;
34469
- }
34470
- }
34471
- else {
34472
- for (var key in questionDefaultSettings) {
34473
- if (!defaultJSON || !defaultJSON[key]) {
34474
- json[key] = questionDefaultSettings[key];
34475
- }
34476
- }
34477
- }
34478
- };
34479
35589
  QuestionConverter.updateJSONForMatrices = function (json, convertToClass, convertFromClass) {
34480
35590
  if (survey_core__WEBPACK_IMPORTED_MODULE_0__["Serializer"].isDescendantOf(convertToClass, "matrix") &&
34481
35591
  survey_core__WEBPACK_IMPORTED_MODULE_0__["Serializer"].isDescendantOf(convertFromClass, "matrixdropdownbase") &&
@@ -34495,12 +35605,9 @@ var QuestionConverter = /** @class */ (function () {
34495
35605
  return "col" + val;
34496
35606
  return val;
34497
35607
  };
34498
- QuestionConverter.updateJSONForRating = function (json, convertToClass, defaultJSON) {
35608
+ QuestionConverter.updateJSONForRating = function (json, convertToClass) {
34499
35609
  if (convertToClass === "rating" && json.choices) {
34500
- if (!defaultJSON || !defaultJSON.choices ||
34501
- !survey_core__WEBPACK_IMPORTED_MODULE_0__["Helpers"].isArraysEqual(defaultJSON.choices, json.choices)) {
34502
- json.rateValues = json.choices;
34503
- }
35610
+ json.rateValues = json.choices;
34504
35611
  }
34505
35612
  if (!!json.rateValues && !survey_core__WEBPACK_IMPORTED_MODULE_0__["Serializer"].isDescendantOf(convertToClass, "matrixdropdownbase")) {
34506
35613
  json.choices = json.rateValues;
@@ -34537,7 +35644,6 @@ var QuestionConverter = /** @class */ (function () {
34537
35644
  }
34538
35645
  }
34539
35646
  };
34540
- QuestionConverter.convertInfo = {};
34541
35647
  return QuestionConverter;
34542
35648
  }());
34543
35649
 
@@ -34562,19 +35668,6 @@ function getAllQuestionTypes(className, includeCurrent) {
34562
35668
  }
34563
35669
  return res;
34564
35670
  }
34565
- function createDefaultQuestionConverterItems() {
34566
- var classes = survey_core__WEBPACK_IMPORTED_MODULE_0__["Serializer"].getChildrenClasses("selectbase", true);
34567
- for (var i = 0; i < classes.length; i++) {
34568
- for (var j = 0; j < classes.length; j++) {
34569
- if (i == j)
34570
- continue;
34571
- QuestionConverter.addConvertInfo(classes[i].name, classes[j].name);
34572
- }
34573
- }
34574
- QuestionConverter.addConvertInfo("text", "comment");
34575
- QuestionConverter.addConvertInfo("comment", "text");
34576
- }
34577
- createDefaultQuestionConverterItems();
34578
35671
 
34579
35672
 
34580
35673
  /***/ }),
@@ -34718,6 +35811,8 @@ __webpack_require__.r(__webpack_exports__);
34718
35811
  /* harmony import */ var survey_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! survey-core */ "survey-core");
34719
35812
  /* harmony import */ var survey_core__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(survey_core__WEBPACK_IMPORTED_MODULE_1__);
34720
35813
  /* harmony import */ var _creator_settings__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./creator-settings */ "./src/creator-settings.ts");
35814
+ /* harmony import */ var _survey_helper__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./survey-helper */ "./src/survey-helper.ts");
35815
+
34721
35816
 
34722
35817
 
34723
35818
 
@@ -34769,6 +35864,7 @@ var DragDropSurveyElements = /** @class */ (function (_super) {
34769
35864
  // protected ghostSurveyElement: IElement = null;
34770
35865
  _this.dragOverIndicatorElement = null;
34771
35866
  _this.isDraggedElementSelected = false;
35867
+ _this.maxNestedPanels = -1;
34772
35868
  _this.doBanDropHere = function () {
34773
35869
  _this.removeDragOverMarker(_this.dragOverIndicatorElement);
34774
35870
  _this.removeDragOverMarker(_this.dropTarget);
@@ -34999,6 +36095,13 @@ var DragDropSurveyElements = /** @class */ (function (_super) {
34999
36095
  if (this.draggedElement.getType() === "paneldynamic" && dropTarget === this.draggedElement.template) {
35000
36096
  return false;
35001
36097
  }
36098
+ if (this.maxNestedPanels >= 0 && this.draggedElement.isPanel) {
36099
+ var len = _survey_helper__WEBPACK_IMPORTED_MODULE_3__["SurveyHelper"].getElementDeepLength(dropTarget);
36100
+ if (this.isEdge && dropTarget.isPanel)
36101
+ len--;
36102
+ if (this.maxNestedPanels < len)
36103
+ return false;
36104
+ }
35002
36105
  if (DragDropSurveyElements.restrictDragQuestionBetweenPages &&
35003
36106
  this.shouldRestricDragQuestionBetweenPages(dropTarget)) {
35004
36107
  return false;
@@ -35560,6 +36663,15 @@ var SurveyHelper = /** @class */ (function () {
35560
36663
  }
35561
36664
  return false;
35562
36665
  };
36666
+ SurveyHelper.getElementDeepLength = function (element) {
36667
+ var res = 0;
36668
+ while (!!element) {
36669
+ if (element.isPanel)
36670
+ res++;
36671
+ element = element.parent;
36672
+ }
36673
+ return res;
36674
+ };
35563
36675
  return SurveyHelper;
35564
36676
  }());
35565
36677
 
@@ -36032,6 +37144,23 @@ var QuestionToolboxItem = /** @class */ (function (_super) {
36032
37144
  QuestionToolboxItem.prototype.toJSON = function () {
36033
37145
  return this.item;
36034
37146
  };
37147
+ Object.defineProperty(QuestionToolboxItem.prototype, "typeName", {
37148
+ get: function () {
37149
+ if (!!this.json && !!this.json.type)
37150
+ return this.json.type;
37151
+ return this.name;
37152
+ },
37153
+ enumerable: false,
37154
+ configurable: true
37155
+ });
37156
+ Object.defineProperty(QuestionToolboxItem.prototype, "isPanel", {
37157
+ get: function () {
37158
+ var type = this.typeName;
37159
+ return !!type && survey_core__WEBPACK_IMPORTED_MODULE_1__["Serializer"].isDescendantOf(type, "panelbase");
37160
+ },
37161
+ enumerable: false,
37162
+ configurable: true
37163
+ });
36035
37164
  return QuestionToolboxItem;
36036
37165
  }(survey_core__WEBPACK_IMPORTED_MODULE_1__["Action"]));
36037
37166
 
@@ -36177,7 +37306,7 @@ var QuestionToolbox = /** @class */ (function (_super) {
36177
37306
  get: function () {
36178
37307
  var res = [];
36179
37308
  for (var i = 0; i < this.items.length; i++) {
36180
- res.push(this.items[i].name);
37309
+ res.push(this.items[i].typeName);
36181
37310
  }
36182
37311
  return res;
36183
37312
  },