survey-creator-core 1.9.110 → 1.9.111

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * SurveyJS Creator v1.9.110
2
+ * SurveyJS Creator v1.9.111
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.111
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;
@@ -12397,6 +12390,11 @@ var SurveyLogicTypes = /** @class */ (function () {
12397
12390
  baseClass: "question",
12398
12391
  propertyName: "requiredIf",
12399
12392
  },
12393
+ {
12394
+ name: "question_resetValue",
12395
+ baseClass: "question",
12396
+ propertyName: "resetValueIf",
12397
+ },
12400
12398
  {
12401
12399
  name: "column_visibility",
12402
12400
  baseClass: "matrixdropdowncolumn",
@@ -12412,6 +12410,11 @@ var SurveyLogicTypes = /** @class */ (function () {
12412
12410
  baseClass: "matrixdropdowncolumn",
12413
12411
  propertyName: "requiredIf",
12414
12412
  },
12413
+ {
12414
+ name: "column_resetValue",
12415
+ baseClass: "matrixdropdowncolumn",
12416
+ propertyName: "resetValueIf",
12417
+ },
12415
12418
  {
12416
12419
  name: "expression_expression",
12417
12420
  baseClass: "expression",
@@ -14581,17 +14584,18 @@ var ThemeBuilder = /** @class */ (function (_super) {
14581
14584
  this.updateSimulatorSurvey(json, currTheme);
14582
14585
  };
14583
14586
  ThemeBuilder.prototype.initialize = function (json, options) {
14584
- this.blockThemeChangedNotifications += 1;
14587
+ this.blockChanges = true;
14585
14588
  try {
14586
14589
  this.setJSON(json, this.startThemeClasses);
14587
14590
  this.updatePageList();
14591
+ this.updatePropertyGridEditors(this.themeEditorSurvey);
14588
14592
  this.updatePropertyGridEditorsAvailability();
14589
14593
  if (options.showPagesInTestSurveyTab !== undefined) {
14590
14594
  this.showPagesInTestSurveyTab = options.showPagesInTestSurveyTab;
14591
14595
  }
14592
14596
  }
14593
14597
  finally {
14594
- this.blockThemeChangedNotifications -= 1;
14598
+ this.blockChanges = false;
14595
14599
  }
14596
14600
  };
14597
14601
  ThemeBuilder.prototype.updatePageItem = function (page) {
@@ -14639,6 +14643,7 @@ var ThemeBuilder = /** @class */ (function (_super) {
14639
14643
  ThemeBuilder.prototype.testAgain = function () {
14640
14644
  this.setJSON(this.json, this.simulator.survey.css);
14641
14645
  this.updatePageList();
14646
+ this.updatePropertyGridEditors(this.themeEditorSurvey);
14642
14647
  this.show();
14643
14648
  };
14644
14649
  Object.defineProperty(ThemeBuilder.prototype, "availableThemes", {
@@ -14669,6 +14674,12 @@ var ThemeBuilder = /** @class */ (function (_super) {
14669
14674
  }
14670
14675
  return null;
14671
14676
  };
14677
+ ThemeBuilder.prototype.getPredefinedColorsItemValues = function () {
14678
+ var _this = this;
14679
+ return Object.keys(_themes__WEBPACK_IMPORTED_MODULE_11__["PredefinedColors"][this.themePalette]).map(function (colorName) {
14680
+ 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));
14681
+ });
14682
+ };
14672
14683
  ThemeBuilder.prototype.initializeColorCalculator = function () {
14673
14684
  if (!this.currentTheme.cssVariables["--sjs-primary-backcolor"] ||
14674
14685
  !this.currentTheme.cssVariables["--sjs-primary-backcolor-light"] ||
@@ -14703,6 +14714,22 @@ var ThemeBuilder = /** @class */ (function (_super) {
14703
14714
  }
14704
14715
  return false;
14705
14716
  };
14717
+ ThemeBuilder.prototype.headerViewContainerPropertiesChanged = function (options) {
14718
+ var headerSettings = options.value[0];
14719
+ this.survey.titleView = headerSettings["headerView"];
14720
+ this.surveyProvider.survey.titleView = headerSettings["headerView"];
14721
+ if (headerSettings["headerView"] === "title") {
14722
+ this.survey.logoPosition = headerSettings["logoPosition"];
14723
+ this.surveyProvider.survey.logoPosition = headerSettings["logoPosition"];
14724
+ }
14725
+ else {
14726
+ this.currentTheme.cover = this.getCoverJson(headerSettings);
14727
+ this.setCoverCssVariables(headerSettings);
14728
+ }
14729
+ this.updateSimulatorTheme();
14730
+ this.raiseThemeChanged();
14731
+ this.raiseThemeModified(options);
14732
+ };
14706
14733
  ThemeBuilder.prototype.cssVariablePropertiesChanged = function (options) {
14707
14734
  var _a, _b;
14708
14735
  if (options.name.indexOf("--") === 0) {
@@ -14789,6 +14816,9 @@ var ThemeBuilder = /** @class */ (function (_super) {
14789
14816
  }
14790
14817
  return;
14791
14818
  }
14819
+ if (options.name === "headerViewContainer") {
14820
+ _this.headerViewContainerPropertiesChanged(options);
14821
+ }
14792
14822
  _this.cssVariablePropertiesChanged(options);
14793
14823
  _this.blockThemeChangedNotifications += 1;
14794
14824
  _this.updateDependentQuestionValues(options);
@@ -14829,6 +14859,29 @@ var ThemeBuilder = /** @class */ (function (_super) {
14829
14859
  }
14830
14860
  return _themes__WEBPACK_IMPORTED_MODULE_11__["Themes"][probeThemeFullName] || _themes__WEBPACK_IMPORTED_MODULE_11__["Themes"][appropriateThemeNames[0]];
14831
14861
  };
14862
+ ThemeBuilder.prototype.getCoverJson = function (headerSettings) {
14863
+ var result = {};
14864
+ survey_core__WEBPACK_IMPORTED_MODULE_2__["Serializer"].getProperties("cover").map(function (pr) { return pr.name; })
14865
+ .filter(function (key) { return headerSettings[key] !== undefined && headerSettings[key] !== null; })
14866
+ .forEach(function (key) {
14867
+ result[key] = headerSettings[key];
14868
+ });
14869
+ result["backgroundImageOpacity"] = headerSettings["backgroundImageOpacity"] / 100;
14870
+ return result;
14871
+ };
14872
+ ThemeBuilder.prototype.setCoverCssVariables = function (headerSettings) {
14873
+ var coverBackgroundColorValue = "trasparent";
14874
+ if (headerSettings["backgroundColorSwitch"] === "accentColor") {
14875
+ coverBackgroundColorValue = this.currentTheme.cssVariables["--sjs-primary-backcolor"];
14876
+ }
14877
+ else if (headerSettings["backgroundColorSwitch"] === "custom") {
14878
+ coverBackgroundColorValue = headerSettings.backgroundColor;
14879
+ }
14880
+ this.themeCssVariablesChanges["--sjs-cover-backcolor"] = coverBackgroundColorValue;
14881
+ if (!!headerSettings["titleForecolor"]) {
14882
+ this.themeCssVariablesChanges["--sjs-cover-title-forecolor"] = headerSettings.titleForecolor;
14883
+ }
14884
+ };
14832
14885
  ThemeBuilder.prototype.loadThemeIntoPropertyGrid = function () {
14833
14886
  this.blockChanges = true;
14834
14887
  try {
@@ -14844,6 +14897,53 @@ var ThemeBuilder = /** @class */ (function (_super) {
14844
14897
  this.blockChanges = false;
14845
14898
  }
14846
14899
  };
14900
+ ThemeBuilder.prototype.getBackgroundColorSwitchByValue = function (backgroundColor) {
14901
+ if (!backgroundColor)
14902
+ return "none";
14903
+ if (backgroundColor === this.currentTheme.cssVariables["--sjs-primary-backcolor"])
14904
+ return "accentColor";
14905
+ return "custom";
14906
+ };
14907
+ ThemeBuilder.prototype.updateHeaderViewContainerEditors = function (themeCssVariables) {
14908
+ var _this = this;
14909
+ var headerViewContainerQuestion = this.themeEditorSurvey.getQuestionByName("headerViewContainer");
14910
+ headerViewContainerQuestion.visible = _creator_settings__WEBPACK_IMPORTED_MODULE_7__["settings"].theme.allowEditHeaderSettings;
14911
+ var panel = headerViewContainerQuestion.panels[0];
14912
+ panel.getQuestionByName("backgroundColor").choices = this.getPredefinedColorsItemValues();
14913
+ if (!!this.survey) {
14914
+ panel.getQuestionByName("headerView").value = this.survey.titleView;
14915
+ panel.getQuestionByName("logoPosition").value = this.survey.logoPosition;
14916
+ panel.getQuestionByName("logoPositionX").readOnly = !this.survey.logo;
14917
+ panel.getQuestionByName("logoPositionY").readOnly = !this.survey.logo;
14918
+ panel.getQuestionByName("logoPosition").readOnly = !this.survey.logo;
14919
+ panel.getQuestionByName("titlePositionX").readOnly = !this.survey.title;
14920
+ panel.getQuestionByName("titlePositionY").readOnly = !this.survey.title;
14921
+ panel.getQuestionByName("descriptionPositionX").readOnly = !this.survey.description;
14922
+ panel.getQuestionByName("descriptionPositionY").readOnly = !this.survey.description;
14923
+ }
14924
+ if (!!this.currentTheme.cover) {
14925
+ Object.keys(this.currentTheme.cover).forEach(function (key) {
14926
+ var question = panel.getQuestionByName(key);
14927
+ if (!!question && key === "backgroundImageOpacity") {
14928
+ question.value = _this.currentTheme.cover[key] * 100;
14929
+ }
14930
+ else if (question) {
14931
+ question.value = _this.currentTheme.cover[key];
14932
+ }
14933
+ });
14934
+ var titleForecolorQuestion = panel.getQuestionByName("titleForecolor");
14935
+ var titleForecolorValue = themeCssVariables["--sjs-cover-title-forecolor"] || themeCssVariables["--sjs-general-dim-forecolor"];
14936
+ if (!!titleForecolorQuestion && !!titleForecolorValue) {
14937
+ titleForecolorQuestion.value = titleForecolorValue;
14938
+ }
14939
+ var backgroundColorQuestion = panel.getQuestionByName("backgroundColor");
14940
+ var backgroundColorValue = themeCssVariables["--sjs-cover-backcolor"];
14941
+ if (!!backgroundColorQuestion && !!backgroundColorValue) {
14942
+ backgroundColorQuestion.value = backgroundColorValue;
14943
+ panel.getQuestionByName("backgroundColorSwitch").value = this.getBackgroundColorSwitchByValue(backgroundColorValue);
14944
+ }
14945
+ }
14946
+ };
14847
14947
  ThemeBuilder.prototype.updatePropertyGridEditorsAvailability = function () {
14848
14948
  var isCustomTheme = _themes__WEBPACK_IMPORTED_MODULE_11__["PredefinedThemes"].indexOf(this.themeName) === -1;
14849
14949
  this.themeEditorSurvey.getQuestionByName("themeMode").readOnly = isCustomTheme;
@@ -14874,6 +14974,7 @@ var ThemeBuilder = /** @class */ (function (_super) {
14874
14974
  themeEditorSurvey.getQuestionByName("backgroundImageAttachment").value = this.backgroundImageAttachment;
14875
14975
  themeEditorSurvey.getQuestionByName("generalPrimaryColor").value = themeEditorSurvey.getQuestionByName("--sjs-primary-backcolor").value;
14876
14976
  themeEditorSurvey.getQuestionByName("generalBackcolorDimColor").value = themeEditorSurvey.getQuestionByName("--sjs-general-backcolor-dim").value;
14977
+ this.updateHeaderViewContainerEditors(newCssVariables);
14877
14978
  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
14979
  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
14980
  Object(_theme_custom_questions_font_settings__WEBPACK_IMPORTED_MODULE_8__["fontsettingsFromCssVariable"])(themeEditorSurvey.getQuestionByName("surveyTitle"), newCssVariables);
@@ -14893,7 +14994,7 @@ var ThemeBuilder = /** @class */ (function (_super) {
14893
14994
  }
14894
14995
  themeEditorSurvey.getAllQuestions().forEach(function (question) {
14895
14996
  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)); });
14997
+ question.choices = _this.getPredefinedColorsItemValues();
14897
14998
  }
14898
14999
  });
14899
15000
  };
@@ -15092,6 +15193,187 @@ var ThemeBuilder = /** @class */ (function (_super) {
15092
15193
  ]
15093
15194
  }
15094
15195
  ]
15196
+ }, {
15197
+ type: "panel",
15198
+ state: "collapsed",
15199
+ title: Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_3__["getLocString"])("theme.groupHeader"),
15200
+ elements: [
15201
+ {
15202
+ type: "panel",
15203
+ elements: [
15204
+ {
15205
+ "type": "paneldynamic",
15206
+ "name": "headerViewContainer",
15207
+ "titleLocation": "hidden",
15208
+ "allowAddPanel": false,
15209
+ "allowRemovePanel": false,
15210
+ "panelCount": 1,
15211
+ "defaultValue": [
15212
+ {
15213
+ "headerView": "title",
15214
+ "logoPosition": "right",
15215
+ "areaWidth": "survey",
15216
+ "backgroundColorSwitch": "none",
15217
+ "backgroundImageFit": "cover",
15218
+ "backgroundImageOpacity": 100,
15219
+ "overlap": false,
15220
+ "logoPositionX": "right",
15221
+ "logoPositionY": "top",
15222
+ "titlePositionX": "left",
15223
+ "titlePositionY": "bottom",
15224
+ "descriptionPositionX": "left",
15225
+ "descriptionPositionY": "bottom",
15226
+ "textWidth": 512,
15227
+ "height": 256
15228
+ }
15229
+ ],
15230
+ "templateElements": [
15231
+ {
15232
+ type: "panel",
15233
+ questionTitleLocation: "top",
15234
+ elements: [
15235
+ {
15236
+ type: "buttongroup",
15237
+ name: "headerView",
15238
+ title: Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_3__["getLocString"])("theme.headerView"),
15239
+ choices: [
15240
+ { value: "title", text: Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_3__["getLocString"])("theme.headerViewTitle") },
15241
+ { value: "cover", text: Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_3__["getLocString"])("theme.headerViewCover") }
15242
+ ]
15243
+ },
15244
+ {
15245
+ type: "buttongroup",
15246
+ name: "logoPosition",
15247
+ title: Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_3__["getLocString"])("theme.logoPosition"),
15248
+ visibleIf: "{panel.headerView} = 'title'",
15249
+ choices: [
15250
+ { value: "left", text: Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_3__["getLocString"])("theme.horizontalAlignmentLeft") },
15251
+ { value: "right", text: Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_3__["getLocString"])("theme.horizontalAlignmentRight") }
15252
+ ],
15253
+ },
15254
+ {
15255
+ type: "spinedit",
15256
+ name: "height",
15257
+ title: Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_3__["getLocString"])("p.height"),
15258
+ descriptionLocation: "hidden",
15259
+ visibleIf: "{panel.headerView} = 'cover'",
15260
+ unit: "px",
15261
+ min: 0
15262
+ },
15263
+ {
15264
+ type: "buttongroup",
15265
+ name: "areaWidth",
15266
+ title: Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_3__["getLocString"])("theme.coverAreaWidth"),
15267
+ choices: [
15268
+ { value: "survey", text: Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_3__["getLocString"])("theme.coverAreaWidthSurvey") },
15269
+ { value: "container", text: Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_3__["getLocString"])("theme.coverAreaWidthContainer") }
15270
+ ],
15271
+ visibleIf: "{panel.headerView} = 'cover'",
15272
+ },
15273
+ {
15274
+ type: "spinedit",
15275
+ name: "textWidth",
15276
+ title: Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_3__["getLocString"])("theme.coverTextWidth"),
15277
+ descriptionLocation: "hidden",
15278
+ visibleIf: "{panel.headerView} = 'cover'",
15279
+ unit: "px",
15280
+ min: 0
15281
+ }
15282
+ ]
15283
+ }, {
15284
+ type: "panel",
15285
+ questionTitleLocation: "top",
15286
+ visibleIf: "{panel.headerView} = 'cover'",
15287
+ elements: [
15288
+ {
15289
+ type: "buttongroup",
15290
+ name: "backgroundColorSwitch",
15291
+ title: Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_3__["getLocString"])("theme.coverBackgroundColorSwitch"),
15292
+ choices: [
15293
+ { value: "none", text: Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_3__["getLocString"])("theme.coverBackgroundColorNone") },
15294
+ { value: "accentColor", text: Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_3__["getLocString"])("theme.coverBackgroundColorAccentColor") },
15295
+ { value: "custom", text: Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_3__["getLocString"])("theme.coverBackgroundColorCustom") },
15296
+ ],
15297
+ },
15298
+ {
15299
+ type: "color",
15300
+ name: "backgroundColor",
15301
+ enableIf: "{panel.backgroundColorSwitch} = 'custom'",
15302
+ titleLocation: "hidden",
15303
+ descriptionLocation: "hidden",
15304
+ },
15305
+ {
15306
+ type: "panel",
15307
+ title: Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_3__["getLocString"])("theme.backgroundImage"),
15308
+ elements: [
15309
+ {
15310
+ type: "fileedit",
15311
+ storeDataAsText: false,
15312
+ name: "backgroundImage",
15313
+ titleLocation: "hidden",
15314
+ maxSize: this.surveyProvider.onUploadFile.isEmpty ? 65536 : undefined,
15315
+ acceptedTypes: "image/*",
15316
+ placeholder: "Browse..."
15317
+ },
15318
+ {
15319
+ type: "buttongroup",
15320
+ name: "backgroundImageFit",
15321
+ enableIf: "{panel.backgroundImage} notempty",
15322
+ titleLocation: "hidden",
15323
+ choices: [
15324
+ { value: "cover", text: Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_3__["getLocString"])("theme.backgroundImageFitCover") },
15325
+ { value: "fill", text: Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_3__["getLocString"])("theme.backgroundImageFitFill") },
15326
+ { value: "contain", text: Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_3__["getLocString"])("theme.backgroundImageFitContain") },
15327
+ { value: "tile", text: Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_3__["getLocString"])("theme.backgroundImageFitTile") },
15328
+ ],
15329
+ },
15330
+ {
15331
+ type: "spinedit",
15332
+ name: "backgroundImageOpacity",
15333
+ enableIf: "{panel.backgroundImage} notempty",
15334
+ titleLocation: "left",
15335
+ title: Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_3__["getLocString"])("theme.backgroundOpacity"),
15336
+ descriptionLocation: "hidden",
15337
+ unit: "%",
15338
+ min: 0,
15339
+ max: 100,
15340
+ step: 5
15341
+ },
15342
+ ]
15343
+ },
15344
+ {
15345
+ type: "color",
15346
+ name: "titleForecolor",
15347
+ title: Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_3__["getLocString"])("theme.coverTitleForecolor"),
15348
+ descriptionLocation: "hidden",
15349
+ },
15350
+ {
15351
+ type: "boolean",
15352
+ name: "overlap",
15353
+ renderAs: "checkbox",
15354
+ title: Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_3__["getLocString"])("theme.coverOverlap"),
15355
+ titleLocation: "hidden",
15356
+ descriptionLocation: "hidden",
15357
+ }
15358
+ ]
15359
+ }, {
15360
+ type: "panel",
15361
+ questionTitleLocation: "top",
15362
+ visibleIf: "{panel.headerView} = 'cover'",
15363
+ elements: [
15364
+ this.getHorizontalAlignment("logoPositionX", Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_3__["getLocString"])("theme.logoPosition"), "right"),
15365
+ this.getVerticalAlignment("logoPositionY", "top"),
15366
+ this.getHorizontalAlignment("titlePositionX", Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_3__["getLocString"])("theme.coverTitlePosition"), "left"),
15367
+ this.getVerticalAlignment("titlePositionY", "bottom"),
15368
+ this.getHorizontalAlignment("descriptionPositionX", Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_3__["getLocString"])("theme.coverDescriptionPosition"), "left"),
15369
+ this.getVerticalAlignment("descriptionPositionY", "bottom"),
15370
+ ]
15371
+ }
15372
+ ]
15373
+ }
15374
+ ]
15375
+ }
15376
+ ]
15095
15377
  }, {
15096
15378
  type: "panel",
15097
15379
  title: Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_3__["getLocString"])("theme.groupAdvanced"),
@@ -15332,6 +15614,32 @@ var ThemeBuilder = /** @class */ (function (_super) {
15332
15614
  };
15333
15615
  return themeEditorSurveyJSON;
15334
15616
  };
15617
+ ThemeBuilder.prototype.getHorizontalAlignment = function (questionName, title, defaultValue) {
15618
+ return {
15619
+ type: "buttongroup",
15620
+ name: questionName,
15621
+ title: title,
15622
+ choices: [
15623
+ { value: "left", text: Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_3__["getLocString"])("theme.horizontalAlignmentLeft") },
15624
+ { value: "center", text: Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_3__["getLocString"])("theme.horizontalAlignmentCenter") },
15625
+ { value: "right", text: Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_3__["getLocString"])("theme.horizontalAlignmentRight") },
15626
+ ],
15627
+ defaultValue: defaultValue
15628
+ };
15629
+ };
15630
+ ThemeBuilder.prototype.getVerticalAlignment = function (questionName, defaultValue) {
15631
+ return {
15632
+ type: "buttongroup",
15633
+ name: questionName,
15634
+ titleLocation: "hidden",
15635
+ choices: [
15636
+ { value: "top", text: Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_3__["getLocString"])("theme.verticalAlignmentTop") },
15637
+ { value: "middle", text: Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_3__["getLocString"])("theme.verticalAlignmentMiddle") },
15638
+ { value: "bottom", text: Object(_editorLocalization__WEBPACK_IMPORTED_MODULE_3__["getLocString"])("theme.verticalAlignmentBottom") },
15639
+ ],
15640
+ defaultValue: defaultValue
15641
+ };
15642
+ };
15335
15643
  ThemeBuilder.prototype.dispose = function () {
15336
15644
  var _a;
15337
15645
  (_a = this.themeEditorSurveyValue) === null || _a === void 0 ? void 0 : _a.dispose();
@@ -15876,6 +16184,7 @@ __webpack_require__.r(__webpack_exports__);
15876
16184
 
15877
16185
  var ThemeTabPlugin = /** @class */ (function () {
15878
16186
  function ThemeTabPlugin(creator) {
16187
+ var _this = this;
15879
16188
  this.creator = creator;
15880
16189
  this.simulatorTheme = survey_core__WEBPACK_IMPORTED_MODULE_0__["surveyCss"][survey_core__WEBPACK_IMPORTED_MODULE_0__["defaultV2ThemeName"]];
15881
16190
  this._availableThemes = _themes__WEBPACK_IMPORTED_MODULE_4__["PredefinedThemes"];
@@ -15902,6 +16211,30 @@ var ThemeTabPlugin = /** @class */ (function () {
15902
16211
  this.createActions().forEach(function (action) { return creator.toolbar.actions.push(action); });
15903
16212
  this.sidebarTab = this.creator.sidebar.addTab("theme");
15904
16213
  this.sidebarTab.caption = _editorLocalization__WEBPACK_IMPORTED_MODULE_1__["editorLocalization"].getString("ed.themePropertyGridTitle");
16214
+ creator.registerShortcut("undo_theme", {
16215
+ name: "undo",
16216
+ affectedTab: "theme",
16217
+ hotKey: {
16218
+ ctrlKey: true,
16219
+ keyCode: 90,
16220
+ },
16221
+ macOsHotkey: {
16222
+ keyCode: 90,
16223
+ },
16224
+ execute: function () { return _this.undo(); }
16225
+ });
16226
+ creator.registerShortcut("redo_theme", {
16227
+ name: "redo",
16228
+ affectedTab: "theme",
16229
+ hotKey: {
16230
+ ctrlKey: true,
16231
+ keyCode: 89,
16232
+ },
16233
+ macOsHotkey: {
16234
+ keyCode: 89,
16235
+ },
16236
+ execute: function () { return _this.redo(); }
16237
+ });
15905
16238
  }
15906
16239
  ThemeTabPlugin.prototype.activate = function () {
15907
16240
  this.model = new _theme_builder__WEBPACK_IMPORTED_MODULE_2__["ThemeBuilder"](this.creator, this.simulatorTheme);
@@ -16387,42 +16720,11 @@ var TabTranslationPlugin = /** @class */ (function () {
16387
16720
  }
16388
16721
  });
16389
16722
  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
- });
16723
+ this.importCsvAction = Object(_translation__WEBPACK_IMPORTED_MODULE_2__["createImportCSVAction"])(function () { _this.model.importFromCSVFileDOM(); }, true);
16724
+ this.importCsvAction.visible = false;
16413
16725
  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
- });
16726
+ this.exportCsvAction = Object(_translation__WEBPACK_IMPORTED_MODULE_2__["createExportCSVAction"])(function () { _this.model.exportToCSVFileUI(); });
16727
+ this.exportCsvAction.visible = false;
16426
16728
  items.push(this.exportCsvAction);
16427
16729
  return items;
16428
16730
  };
@@ -16517,6 +16819,7 @@ var translationCss = {
16517
16819
  logoImage: "st-logo__image",
16518
16820
  headerText: "st-header__text",
16519
16821
  navigationButton: "",
16822
+ bodyNavigationButton: "st-navigation-btn",
16520
16823
  completedPage: "st-completedpage",
16521
16824
  navigation: {
16522
16825
  complete: "st-btn st-footer__complete-btn",
@@ -16826,7 +17129,7 @@ var translationCss = {
16826
17129
  /*!********************************************!*\
16827
17130
  !*** ./src/components/tabs/translation.ts ***!
16828
17131
  \********************************************/
16829
- /*! exports provided: TranslationItemBase, TranslationItemString, TranslationItem, TranslationGroup, Translation */
17132
+ /*! exports provided: TranslationItemBase, TranslationItemString, TranslationItem, TranslationGroup, Translation, TranslationEditor, createImportCSVAction, createExportCSVAction */
16830
17133
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
16831
17134
 
16832
17135
  "use strict";
@@ -16836,6 +17139,9 @@ __webpack_require__.r(__webpack_exports__);
16836
17139
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TranslationItem", function() { return TranslationItem; });
16837
17140
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TranslationGroup", function() { return TranslationGroup; });
16838
17141
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Translation", function() { return Translation; });
17142
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TranslationEditor", function() { return TranslationEditor; });
17143
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createImportCSVAction", function() { return createImportCSVAction; });
17144
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createExportCSVAction", function() { return createExportCSVAction; });
16839
17145
  /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./src/entries/helpers.ts");
16840
17146
  /* harmony import */ var survey_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! survey-core */ "survey-core");
16841
17147
  /* harmony import */ var survey_core__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(survey_core__WEBPACK_IMPORTED_MODULE_1__);
@@ -16906,6 +17212,7 @@ var TranslationItemBase = /** @class */ (function (_super) {
16906
17212
  this.fireOnObjCreating();
16907
17213
  };
16908
17214
  TranslationItemBase.prototype.deleteLocaleStrings = function (locale) { };
17215
+ TranslationItemBase.prototype.applyEditLocale = function (locale) { };
16909
17216
  TranslationItemBase.prototype.fireOnObjCreating = function (obj) {
16910
17217
  if (obj === void 0) { obj = null; }
16911
17218
  if (this.translation) {
@@ -16928,7 +17235,7 @@ var TranslationItemString = /** @class */ (function (_super) {
16928
17235
  }
16929
17236
  TranslationItemString.prototype.onPropertyValueChanged = function (name, oldValue, newValue) {
16930
17237
  _super.prototype.onPropertyValueChanged.call(this, name, oldValue, newValue);
16931
- if (name === "text") {
17238
+ if (!this.isReadOnly && name === "text") {
16932
17239
  this.locString.setLocaleText(this.locale, newValue);
16933
17240
  }
16934
17241
  };
@@ -17007,9 +17314,17 @@ var TranslationItem = /** @class */ (function (_super) {
17007
17314
  !!this.translation.tranlationChangedCallback &&
17008
17315
  this.translation.tranlationChangedCallback(loc, this.name, newValue, this.context);
17009
17316
  };
17317
+ TranslationItem.prototype.applyEditLocale = function (locale) {
17318
+ var itemStr = this.values(locale);
17319
+ if (!!itemStr && !!itemStr.text) {
17320
+ this.setLocText(locale, itemStr.text);
17321
+ }
17322
+ };
17010
17323
  TranslationItem.prototype.values = function (loc) {
17324
+ var _a;
17011
17325
  if (!this.hashValues[loc]) {
17012
17326
  var val = new TranslationItemString(this.locString, loc);
17327
+ val.isReadOnly = !!((_a = this.translation) === null || _a === void 0 ? void 0 : _a.getEditLocale());
17013
17328
  if (!loc) {
17014
17329
  val.placeholder = this.defaultValue;
17015
17330
  }
@@ -17030,7 +17345,22 @@ var TranslationItem = /** @class */ (function (_super) {
17030
17345
  }
17031
17346
  };
17032
17347
  TranslationItem.prototype.toJSON = function () {
17348
+ var _this = this;
17033
17349
  var json = this.locString.getJson();
17350
+ var keys = Object.keys(this.hashValues);
17351
+ if (keys.length > 0) {
17352
+ keys.forEach(function (loc) {
17353
+ var text = _this.hashValues[loc].text;
17354
+ if (!!text) {
17355
+ if (!json)
17356
+ json = {};
17357
+ if (typeof json === "string") {
17358
+ json = { default: json };
17359
+ }
17360
+ json[loc] = text;
17361
+ }
17362
+ });
17363
+ }
17034
17364
  json = this.correctJSON(json);
17035
17365
  if (!json || typeof json === "string")
17036
17366
  return { default: json };
@@ -17061,8 +17391,16 @@ var TranslationItem = /** @class */ (function (_super) {
17061
17391
  TranslationItem.prototype.deleteLocaleStrings = function (locale) {
17062
17392
  this.setLocText(locale, undefined);
17063
17393
  };
17394
+ TranslationItem.prototype.getDefaultLocaleText = function () {
17395
+ var res = this.locString.getLocaleText("");
17396
+ if (!res) {
17397
+ res = this.getPlaceholder("");
17398
+ }
17399
+ return res;
17400
+ };
17064
17401
  TranslationItem.prototype.getPlaceholder = function (locale) {
17065
- var placeholderText = _editorLocalization__WEBPACK_IMPORTED_MODULE_3__["editorLocalization"].getString("ed.translationPlaceHolder", locale);
17402
+ var textLocale = !!locale && locale !== "default" ? locale : survey_core__WEBPACK_IMPORTED_MODULE_1__["surveyLocalization"].defaultLocale;
17403
+ var placeholderText = _editorLocalization__WEBPACK_IMPORTED_MODULE_3__["editorLocalization"].getString("ed.translationPlaceHolder", textLocale);
17066
17404
  if (this.context instanceof survey_core__WEBPACK_IMPORTED_MODULE_1__["SurveyModel"]) {
17067
17405
  return survey_core__WEBPACK_IMPORTED_MODULE_1__["surveyLocalization"].getString(this.name, locale) || placeholderText;
17068
17406
  }
@@ -17286,6 +17624,9 @@ var TranslationGroup = /** @class */ (function (_super) {
17286
17624
  TranslationGroup.prototype.deleteLocaleStrings = function (locale) {
17287
17625
  this.items.forEach(function (item) { return item.deleteLocaleStrings(locale); });
17288
17626
  };
17627
+ TranslationGroup.prototype.applyEditLocale = function (locale) {
17628
+ this.items.forEach(function (item) { return item.applyEditLocale(locale); });
17629
+ };
17289
17630
  TranslationGroup.prototype.fillItems = function () {
17290
17631
  if (this.isItemValueArray(this.obj)) {
17291
17632
  this.createItemValuesLocale();
@@ -17361,12 +17702,16 @@ var TranslationGroup = /** @class */ (function (_super) {
17361
17702
  return true;
17362
17703
  };
17363
17704
  TranslationGroup.prototype.createTranslationItem = function (obj, property) {
17705
+ var _a;
17364
17706
  var defaultValue = this.getDefaultValue(obj, property);
17365
17707
  var locStr = obj[property.serializationProperty];
17366
17708
  if (!locStr)
17367
17709
  return null;
17368
17710
  if (!this.showAllStrings && !defaultValue && locStr.isEmpty)
17369
17711
  return null;
17712
+ var editLocale = (_a = this.translation) === null || _a === void 0 ? void 0 : _a.getEditLocale();
17713
+ if (!!editLocale && !!locStr.getLocaleText(editLocale))
17714
+ return null;
17370
17715
  if (!this.canShowProperty(property, locStr.isEmpty))
17371
17716
  return null;
17372
17717
  return new TranslationItem(property.name, locStr, defaultValue, this.translation, obj, property);
@@ -17414,9 +17759,14 @@ var TranslationGroup = /** @class */ (function (_super) {
17414
17759
  }
17415
17760
  };
17416
17761
  TranslationGroup.prototype.createItemValuesLocale = function () {
17762
+ var _a;
17763
+ var editMode = (_a = this.translation) === null || _a === void 0 ? void 0 : _a.getEditLocale();
17417
17764
  for (var i = 0; i < this.obj.length; i++) {
17418
17765
  var val = this.obj[i];
17419
17766
  var canAdd = this.showAllStrings || !val.locText.isEmpty || isNaN(val.value);
17767
+ if (!!editMode && val.locText.getLocaleText(editMode)) {
17768
+ canAdd = false;
17769
+ }
17420
17770
  if (!canAdd)
17421
17771
  continue;
17422
17772
  var item = new TranslationItem(val.value, val.locText, val.value, this.translation, val);
@@ -17476,6 +17826,21 @@ var Translation = /** @class */ (function (_super) {
17476
17826
  Translation.prototype.getType = function () {
17477
17827
  return "translation";
17478
17828
  };
17829
+ Translation.prototype.getEditLocale = function () { return this.editLocale; };
17830
+ Translation.prototype.setEditMode = function (locale) {
17831
+ this.editLocale = locale;
17832
+ this.addLocale(locale);
17833
+ };
17834
+ Object.defineProperty(Translation.prototype, "isEditMode", {
17835
+ get: function () { return !!this.editLocale; },
17836
+ enumerable: false,
17837
+ configurable: true
17838
+ });
17839
+ Translation.prototype.applyEditLocale = function () {
17840
+ if (!this.isEditMode || !this.root)
17841
+ return;
17842
+ this.root.applyEditLocale(this.editLocale);
17843
+ };
17479
17844
  Translation.prototype.makeObservable = function (onBaseObjCreating) {
17480
17845
  this.onBaseObjCreatingCallback = onBaseObjCreating;
17481
17846
  this.fireOnObjCreating(this);
@@ -17540,6 +17905,17 @@ var Translation = /** @class */ (function (_super) {
17540
17905
  });
17541
17906
  res.onGetMatrixRowActions.add(function (sender, options) {
17542
17907
  Object(_utils_actions__WEBPACK_IMPORTED_MODULE_9__["updateMatrixRemoveAction"])(options.question, options.actions, options.row);
17908
+ if (_this.options.getHasMachineTranslation() && Object(_utils_actions__WEBPACK_IMPORTED_MODULE_9__["findAction"])(options.actions, "remove-row")) {
17909
+ var q = options.question;
17910
+ var rowIndex = q.visibleRows.indexOf(options.row);
17911
+ var locale_1 = q.value[rowIndex].name;
17912
+ options.actions.splice(0, 0, new survey_core__WEBPACK_IMPORTED_MODULE_1__["Action"]({
17913
+ iconName: "icon-language",
17914
+ locTooltipName: "ed.translateUsigAI",
17915
+ location: "end",
17916
+ action: function () { return _this.showTranslationEditor(locale_1); }
17917
+ }));
17918
+ }
17543
17919
  Object(_utils_actions__WEBPACK_IMPORTED_MODULE_9__["updateMatixActionsClasses"])(options.actions);
17544
17920
  });
17545
17921
  return res;
@@ -17593,6 +17969,20 @@ var Translation = /** @class */ (function (_super) {
17593
17969
  }
17594
17970
  return [usedLocales, locales];
17595
17971
  };
17972
+ Translation.prototype.importFromCSVFileDOM = function () {
17973
+ var _this = this;
17974
+ if (!document)
17975
+ return;
17976
+ if (!this.inputFileElement) {
17977
+ this.inputFileElement = document.createElement("input");
17978
+ this.inputFileElement.type = "file";
17979
+ this.inputFileElement.style.display = "none";
17980
+ this.inputFileElement.onchange = function () {
17981
+ _this.importFromCSVFileUI(_this.inputFileElement);
17982
+ };
17983
+ }
17984
+ this.inputFileElement.click();
17985
+ };
17596
17986
  Translation.prototype.updateSettingsSurveyLocales = function () {
17597
17987
  var _a = this.getSurveyLocales(), choices = _a[0], locales = _a[1];
17598
17988
  var selectedLocales = [];
@@ -17665,6 +18055,11 @@ var Translation = /** @class */ (function (_super) {
17665
18055
  });
17666
18056
  }
17667
18057
  });
18058
+ survey.onUpdatePanelCssClasses.add(function (sender, options) {
18059
+ if (options.panel["__translationHasIndent"]) {
18060
+ options.cssClasses.panel.content += " st-panel-indent";
18061
+ }
18062
+ });
17668
18063
  survey.currentPage = survey.pages[0];
17669
18064
  return survey;
17670
18065
  };
@@ -17711,14 +18106,15 @@ var Translation = /** @class */ (function (_super) {
17711
18106
  panel.addElement(pnl);
17712
18107
  pnl.title = item.text;
17713
18108
  if (item.hasIndent) {
17714
- pnl.cssClasses.panel.content += " st-panel-indent";
18109
+ pnl["__translationHasIndent"] = true;
17715
18110
  }
17716
18111
  this.addTranslationGroupIntoStringsSurvey(pnl, item);
17717
18112
  }
17718
18113
  };
17719
18114
  Translation.prototype.addLocaleColumns = function (matrix) {
17720
18115
  var locs = this.getSelectedLocales();
17721
- matrix.addColumn("default", this.getLocaleName(""));
18116
+ var defaultColumn = matrix.addColumn("default", this.getLocaleName(""));
18117
+ defaultColumn.readOnly = this.isEditMode;
17722
18118
  for (var i = 0; i < locs.length; i++) {
17723
18119
  matrix.addColumn(locs[i], this.getLocaleName(locs[i]));
17724
18120
  }
@@ -17731,6 +18127,12 @@ var Translation = /** @class */ (function (_super) {
17731
18127
  }
17732
18128
  return res;
17733
18129
  };
18130
+ Translation.prototype.updateStringsSurveyData = function () {
18131
+ var survey = this.stringsSurvey;
18132
+ if (survey) {
18133
+ survey.data = this.getStringsSurveyData(survey);
18134
+ }
18135
+ };
17734
18136
  Translation.prototype.getStringsQuestionData = function (matrix) {
17735
18137
  var res = {};
17736
18138
  for (var i = 0; i < matrix.rows.length; i++) {
@@ -18042,6 +18444,17 @@ var Translation = /** @class */ (function (_super) {
18042
18444
  this.setSelectedLocales([]);
18043
18445
  this.reset();
18044
18446
  };
18447
+ Translation.prototype.createTranslationEditor = function (locale) {
18448
+ var _this = this;
18449
+ var res = new TranslationEditor(this.survey, locale, this.options);
18450
+ res.onApply = function () {
18451
+ _this.reset();
18452
+ };
18453
+ return res;
18454
+ };
18455
+ Translation.prototype.showTranslationEditor = function (locale) {
18456
+ this.createTranslationEditor(locale).showDialog();
18457
+ };
18045
18458
  Translation.prototype.translateItemAfterRender = function (item, el, locale) {
18046
18459
  if (!this.translateItemAfterRenderCallback)
18047
18460
  return;
@@ -18150,6 +18563,156 @@ var Translation = /** @class */ (function (_super) {
18150
18563
  return Translation;
18151
18564
  }(survey_core__WEBPACK_IMPORTED_MODULE_1__["Base"]));
18152
18565
 
18566
+ var TranslationEditor = /** @class */ (function () {
18567
+ function TranslationEditor(survey, locale, options) {
18568
+ this.survey = survey;
18569
+ this.locale = locale;
18570
+ this.options = options;
18571
+ this.translationValue = new Translation(this.survey, options, true);
18572
+ this.translation.setEditMode(locale);
18573
+ this.translation.reset();
18574
+ this.setupNavigationButtons();
18575
+ }
18576
+ Object.defineProperty(TranslationEditor.prototype, "translation", {
18577
+ get: function () { return this.translationValue; },
18578
+ enumerable: false,
18579
+ configurable: true
18580
+ });
18581
+ TranslationEditor.prototype.showDialog = function () {
18582
+ var _this = this;
18583
+ var dialogTitle = _editorLocalization__WEBPACK_IMPORTED_MODULE_3__["editorLocalization"].getString("ed.translationDialogTitle") + " (" + this.translation.getLocaleName(this.locale) + ")";
18584
+ if (this.translation.stringsSurvey.getAllQuestions(true).length === 0) {
18585
+ var locStr = new survey_core__WEBPACK_IMPORTED_MODULE_1__["LocalizableString"](this.translation.stringsSurvey);
18586
+ locStr.text = _editorLocalization__WEBPACK_IMPORTED_MODULE_3__["editorLocalization"].getString("ed.translationNoStrings");
18587
+ var popup = survey_core__WEBPACK_IMPORTED_MODULE_1__["settings"].showDialog({
18588
+ componentName: "sv-string-viewer",
18589
+ data: { locStr: locStr, locString: locStr, model: locStr },
18590
+ onApply: function () { return true; },
18591
+ title: dialogTitle,
18592
+ displayMode: "popup"
18593
+ }, this.options.rootElement);
18594
+ var actions = popup.footerToolbar.actions;
18595
+ actions.splice(1, actions.length - 1);
18596
+ actions[0].title = "OK";
18597
+ return;
18598
+ }
18599
+ var popupModel = survey_core__WEBPACK_IMPORTED_MODULE_1__["settings"].showDialog({
18600
+ componentName: "survey",
18601
+ data: {
18602
+ survey: this.translation.stringsSurvey,
18603
+ model: this.translation.stringsSurvey
18604
+ },
18605
+ onApply: function () {
18606
+ _this.apply();
18607
+ return true;
18608
+ },
18609
+ onCancel: function () {
18610
+ _this.dispose();
18611
+ },
18612
+ cssClass: "sv-property-editor st-translation-dialog",
18613
+ title: dialogTitle,
18614
+ displayMode: this.options.isMobileView ? "overlay" : "popup"
18615
+ }, this.options.rootElement);
18616
+ popupModel.locale = _editorLocalization__WEBPACK_IMPORTED_MODULE_3__["editorLocalization"].currentLocale;
18617
+ };
18618
+ TranslationEditor.prototype.doMachineTranslation = function () {
18619
+ var _this = this;
18620
+ var fromLocale = this.translation.defaultLocale;
18621
+ if (!fromLocale)
18622
+ fromLocale = "en";
18623
+ var items = this.createStringsToTranslate();
18624
+ var strings = [];
18625
+ items.forEach(function (item) {
18626
+ strings.push(item.getDefaultLocaleText());
18627
+ });
18628
+ var callback = function (translatedStrings) {
18629
+ if (!Array.isArray(translatedStrings))
18630
+ return;
18631
+ for (var i = 0; i < Math.min(items.length, translatedStrings.length); i++) {
18632
+ items[i].values(_this.locale).text = translatedStrings[i];
18633
+ }
18634
+ _this.translation.updateStringsSurveyData();
18635
+ };
18636
+ this.options.doMachineTranslation(fromLocale, this.locale, strings, callback);
18637
+ };
18638
+ TranslationEditor.prototype.apply = function () {
18639
+ this.translation.applyEditLocale();
18640
+ if (this.onApply) {
18641
+ this.onApply();
18642
+ }
18643
+ this.dispose();
18644
+ };
18645
+ TranslationEditor.prototype.cancel = function () {
18646
+ this.dispose();
18647
+ };
18648
+ TranslationEditor.prototype.dispose = function () {
18649
+ this.translationValue.dispose();
18650
+ };
18651
+ TranslationEditor.prototype.setupNavigationButtons = function () {
18652
+ var _this = this;
18653
+ var survey = this.translation.stringsSurvey;
18654
+ var actions = survey.navigationBar.actions;
18655
+ actions.splice(0, actions.length);
18656
+ if (this.options.getHasMachineTranslation()) {
18657
+ survey.addNavigationItem(new survey_core__WEBPACK_IMPORTED_MODULE_1__["Action"]({
18658
+ id: "svc-translation-machine",
18659
+ iconName: "icon-language",
18660
+ css: "svc-translation-machine",
18661
+ locTitleName: "ed.translateUsigAI",
18662
+ component: "sv-action-bar-item",
18663
+ action: function () { _this.doMachineTranslation(); }
18664
+ }));
18665
+ }
18666
+ survey.addNavigationItem(createImportCSVAction(function () { _this.translation.importFromCSVFileDOM(); }, false, true));
18667
+ survey.addNavigationItem(createExportCSVAction(function () { _this.translation.exportToCSVFileUI(); }, true));
18668
+ survey.showNavigationButtons = "top";
18669
+ };
18670
+ TranslationEditor.prototype.createStringsToTranslate = function () {
18671
+ var res = new Array();
18672
+ this.addStringsToTranlate(this.translation.root, res);
18673
+ return res;
18674
+ };
18675
+ TranslationEditor.prototype.addStringsToTranlate = function (group, items) {
18676
+ var _this = this;
18677
+ group.items.forEach(function (item) {
18678
+ if (item.isGroup) {
18679
+ _this.addStringsToTranlate(item, items);
18680
+ }
18681
+ else {
18682
+ if (!!item.getDefaultLocaleText()) {
18683
+ items.push(item);
18684
+ }
18685
+ }
18686
+ });
18687
+ };
18688
+ return TranslationEditor;
18689
+ }());
18690
+
18691
+ function createImportCSVAction(action, needSeparator, isInEditor) {
18692
+ if (isInEditor === void 0) { isInEditor = false; }
18693
+ return new survey_core__WEBPACK_IMPORTED_MODULE_1__["Action"]({
18694
+ id: "svc-translation-import",
18695
+ iconName: "icon-load",
18696
+ locTitleName: "ed.translationImportFromSCVButton",
18697
+ locTooltipName: "ed.translationImportFromSCVButton",
18698
+ mode: isInEditor ? "large" : "small",
18699
+ component: "sv-action-bar-item",
18700
+ needSeparator: needSeparator,
18701
+ action: action
18702
+ });
18703
+ }
18704
+ function createExportCSVAction(action, isInEditor) {
18705
+ if (isInEditor === void 0) { isInEditor = false; }
18706
+ return new survey_core__WEBPACK_IMPORTED_MODULE_1__["Action"]({
18707
+ id: "svc-translation-export",
18708
+ iconName: "icon-download",
18709
+ locTitleName: "ed.translationExportToSCVButton",
18710
+ locTooltipName: "ed.translationExportToSCVButton",
18711
+ mode: isInEditor ? "large" : "small",
18712
+ component: "sv-action-bar-item",
18713
+ action: action
18714
+ });
18715
+ }
18153
18716
 
18154
18717
 
18155
18718
  /***/ }),
@@ -18919,6 +19482,27 @@ var CreatorBase = /** @class */ (function (_super) {
18919
19482
  * - `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
19483
  */
18921
19484
  _this.onTranslationExportItem = new CreatorEvent();
19485
+ /**
19486
+ * An event that allows you to integrate a machine translation service, such as Google Translate or Microsoft Translator, into Survey Creator.
19487
+ *
19488
+ * 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.
19489
+ *
19490
+ * Parameters:
19491
+ *
19492
+ * - `sender`: `CreatorBase`\
19493
+ * A Survey Creator instance that raised the event.
19494
+ * - `options.fromLocale`: `string`\
19495
+ * A locale from which you want to translate strings. Contains a locale identifier (`"en"`, `"de"`, etc.).
19496
+ * - `options.toLocale`: `string`\
19497
+ * A locale to which you want to translate strings. Contains a locale identifier (`"en"`, `"de"`, etc.).
19498
+ * - `options.strings`: `Array<string>`\
19499
+ * Strings to translate.
19500
+ * - `options.callback: (strings: Array<string>)`: `Function`\
19501
+ * A callback function that accepts translated strings. If the translation failed, pass an empty array or call this function without arguments.
19502
+ *
19503
+ * > Survey Creator does not include a machine translation service out of the box. Our component only provides a UI for calling the service API.
19504
+ */
19505
+ _this.onMachineTranslate = new CreatorEvent();
18922
19506
  /**
18923
19507
  * An event that is raised before a string translation is changed. Use this event to override a new translation value.
18924
19508
  *
@@ -19007,6 +19591,12 @@ var CreatorBase = /** @class */ (function (_super) {
19007
19591
  * Default value: 0 (unlimited, taken from `settings.propertyGrid.maximumChoicesCount`)
19008
19592
  */
19009
19593
  _this.maximumChoicesCount = _creator_settings__WEBPACK_IMPORTED_MODULE_2__["settings"].propertyGrid.maximumChoicesCount;
19594
+ /**
19595
+ * 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.
19596
+ *
19597
+ * Default value: 0 (unlimited, taken from `settings.propertyGrid.minimumChoicesCount`)
19598
+ */
19599
+ _this.minimumChoicesCount = _creator_settings__WEBPACK_IMPORTED_MODULE_2__["settings"].propertyGrid.minimumChoicesCount;
19010
19600
  /**
19011
19601
  * 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
19602
  *
@@ -19014,11 +19604,17 @@ var CreatorBase = /** @class */ (function (_super) {
19014
19604
  */
19015
19605
  _this.maximumRowsCount = _creator_settings__WEBPACK_IMPORTED_MODULE_2__["settings"].propertyGrid.maximumRowsCount;
19016
19606
  /**
19017
- * Limits the number of rate value that users can add to [Rating](https://surveyjs.io/Documentation/Library?id=questionratingmodel) questions.
19607
+ * Limits the number of rate values that users can add to [Rating](https://surveyjs.io/Documentation/Library?id=questionratingmodel) questions.
19018
19608
  *
19019
19609
  * Default value: 0 (unlimited, taken from `settings.propertyGrid.maximumRateValues`)
19020
19610
  */
19021
19611
  _this.maximumRateValues = _creator_settings__WEBPACK_IMPORTED_MODULE_2__["settings"].propertyGrid.maximumRateValues;
19612
+ /**
19613
+ * Limits the number of nested panels within a [Panel](/form-library/documentation/api-reference/panel-model) element.
19614
+ *
19615
+ * Default value: -1 (unlimited)
19616
+ */
19617
+ _this.maxNestedPanels = -1;
19022
19618
  /**
19023
19619
  * Obsolete. Use the [`showPagesInPreviewTab`](https://surveyjs.io/Documentation/Survey-Creator?id=surveycreator#showPagesInPreviewTab) property instead.
19024
19620
  */
@@ -19169,11 +19765,11 @@ var CreatorBase = /** @class */ (function (_super) {
19169
19765
  shown: "svc-notifier--shown"
19170
19766
  });
19171
19767
  _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;
19768
+ var availableShortcuts = Object.keys(_this.shortcuts || {})
19769
+ .map(function (key) { return _this.shortcuts[key]; })
19770
+ .filter(function (shortcut) { return !shortcut.affectedTab || shortcut.affectedTab === _this.activeTab; });
19771
+ availableShortcuts.forEach(function (shortcut) {
19772
+ var hotKey = event.metaKey ? shortcut.macOsHotkey : shortcut.hotKey;
19177
19773
  if (!hotKey)
19178
19774
  return;
19179
19775
  if (!!hotKey.ctrlKey !== !!event.ctrlKey)
@@ -20106,6 +20702,7 @@ var CreatorBase = /** @class */ (function (_super) {
20106
20702
  this.dragDropSurveyElements = new _survey_elements__WEBPACK_IMPORTED_MODULE_24__["DragDropSurveyElements"](null, this);
20107
20703
  var isDraggedFromToolbox = false;
20108
20704
  this.dragDropSurveyElements.onDragStart.add(function (sender, options) {
20705
+ _this.dragDropSurveyElements.maxNestedPanels = _this.maxNestedPanels;
20109
20706
  isDraggedFromToolbox = !sender.draggedElement.parent;
20110
20707
  _this.onDragStart.fire(sender, options);
20111
20708
  _this.startUndoRedoTransaction("drag drop");
@@ -21377,6 +21974,17 @@ var CreatorBase = /** @class */ (function (_super) {
21377
21974
  this.onTranslationExportItem.fire(this, options);
21378
21975
  return options.text;
21379
21976
  };
21977
+ CreatorBase.prototype.getHasMachineTranslation = function () {
21978
+ return !this.onMachineTranslate.isEmpty;
21979
+ };
21980
+ CreatorBase.prototype.doMachineTranslation = function (fromLocale, toLocale, strings, callback) {
21981
+ if (!this.getHasMachineTranslation()) {
21982
+ callback(undefined);
21983
+ }
21984
+ else {
21985
+ this.onMachineTranslate.fire(this, { fromLocale: fromLocale, toLocale: toLocale, strings: strings, callback: callback });
21986
+ }
21987
+ };
21380
21988
  CreatorBase.prototype.doAutoSave = function (saveFunc) {
21381
21989
  var _this = this;
21382
21990
  if (saveFunc === void 0) { saveFunc = function () { return _this.doSave(); }; }
@@ -21497,10 +22105,26 @@ var CreatorBase = /** @class */ (function (_super) {
21497
22105
  enumerable: false,
21498
22106
  configurable: true
21499
22107
  });
21500
- CreatorBase.prototype.getQuestionTypeSelectorModel = function (beforeAdd, panel) {
22108
+ CreatorBase.prototype.getAvailableToolboxItems = function (element, isAddNew) {
22109
+ if (isAddNew === void 0) { isAddNew = true; }
22110
+ var res = [].concat(this.toolbox.items);
22111
+ if (!element || this.maxNestedPanels < 0)
22112
+ return res;
22113
+ if (!isAddNew && element.isPanel)
22114
+ return res;
22115
+ if (this.maxNestedPanels < _survey_helper__WEBPACK_IMPORTED_MODULE_9__["SurveyHelper"].getElementDeepLength(element)) {
22116
+ for (var i = res.length - 1; i >= 0; i--) {
22117
+ if (res[i].isPanel) {
22118
+ res.splice(i, 1);
22119
+ }
22120
+ }
22121
+ }
22122
+ return res;
22123
+ };
22124
+ CreatorBase.prototype.getQuestionTypeSelectorModel = function (beforeAdd, element) {
21501
22125
  var _this = this;
21502
- if (panel === void 0) { panel = null; }
21503
- var availableTypes = this.toolbox.items.map(function (item) {
22126
+ var panel = !!element && element.isPanel ? element : null;
22127
+ var availableTypes = this.getAvailableToolboxItems(element).map(function (item) {
21504
22128
  return _this.createIActionBarItemByClass(item.name, item.title, item.iconName, item.needSeparator);
21505
22129
  });
21506
22130
  var listModel = new survey_core__WEBPACK_IMPORTED_MODULE_1__["ListModel"](availableTypes, function (item) {
@@ -22141,7 +22765,8 @@ var settings = {
22141
22765
  },
22142
22766
  theme: {
22143
22767
  exportFileName: "survey_theme.json",
22144
- fontFamily: "Open Sans"
22768
+ fontFamily: "Open Sans",
22769
+ allowEditHeaderSettings: false,
22145
22770
  },
22146
22771
  operators: {
22147
22772
  empty: [],
@@ -22198,6 +22823,7 @@ var settings = {
22198
22823
  maxCharsInButtonGroup: 25,
22199
22824
  showNavigationButtons: false,
22200
22825
  maximumColumnsCount: 0,
22826
+ minimumChoicesCount: 0,
22201
22827
  maximumChoicesCount: 0,
22202
22828
  maximumRowsCount: 0,
22203
22829
  maximumRateValues: 0,
@@ -22288,9 +22914,12 @@ var EmptySurveyCreatorOptions = /** @class */ (function () {
22288
22914
  this.isMobileView = false;
22289
22915
  this.allowEditExpressionsInTextEditor = true;
22290
22916
  this.maximumColumnsCount = settings.propertyGrid.maximumColumnsCount;
22917
+ this.minimumChoicesCount = settings.propertyGrid.minimumChoicesCount;
22291
22918
  this.maximumChoicesCount = settings.propertyGrid.maximumChoicesCount;
22292
22919
  this.maximumRowsCount = settings.propertyGrid.maximumRowsCount;
22293
22920
  this.maximumRateValues = settings.propertyGrid.maximumRateValues;
22921
+ this.machineTranslationValue = false;
22922
+ this.maxNestedPanels = -1;
22294
22923
  }
22295
22924
  EmptySurveyCreatorOptions.prototype.getProcessedTranslationItemText = function (locale, locString, newText, obj) {
22296
22925
  return newText;
@@ -22338,6 +22967,8 @@ var EmptySurveyCreatorOptions = /** @class */ (function () {
22338
22967
  EmptySurveyCreatorOptions.prototype.onLogicGetTitleCallback = function (expression, displayExpression, text, logicItem) { return text; };
22339
22968
  EmptySurveyCreatorOptions.prototype.getTranslationExportedText = function (obj, name, locString, locale, text) { return text; };
22340
22969
  EmptySurveyCreatorOptions.prototype.uploadFiles = function (files, question, uploadingCallback) { };
22970
+ EmptySurveyCreatorOptions.prototype.getHasMachineTranslation = function () { return this.machineTranslationValue; };
22971
+ EmptySurveyCreatorOptions.prototype.doMachineTranslation = function (fromLocale, toLocale, strings, callback) { };
22341
22972
  return EmptySurveyCreatorOptions;
22342
22973
  }());
22343
22974
 
@@ -23479,7 +24110,7 @@ var __spreadArray = function (to, from) {
23479
24110
  /*!******************************!*\
23480
24111
  !*** ./src/entries/index.ts ***!
23481
24112
  \******************************/
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 */
24113
+ /*! 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, 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, 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 */
23483
24114
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
23484
24115
 
23485
24116
  "use strict";
@@ -23618,6 +24249,12 @@ __webpack_require__.r(__webpack_exports__);
23618
24249
 
23619
24250
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Translation", function() { return _components_tabs_translation__WEBPACK_IMPORTED_MODULE_18__["Translation"]; });
23620
24251
 
24252
+ /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TranslationEditor", function() { return _components_tabs_translation__WEBPACK_IMPORTED_MODULE_18__["TranslationEditor"]; });
24253
+
24254
+ /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createImportCSVAction", function() { return _components_tabs_translation__WEBPACK_IMPORTED_MODULE_18__["createImportCSVAction"]; });
24255
+
24256
+ /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createExportCSVAction", function() { return _components_tabs_translation__WEBPACK_IMPORTED_MODULE_18__["createExportCSVAction"]; });
24257
+
23621
24258
  /* harmony import */ var _components_tabs_translation_theme__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../components/tabs/translation-theme */ "./src/components/tabs/translation-theme.ts");
23622
24259
  /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "translationCss", function() { return _components_tabs_translation_theme__WEBPACK_IMPORTED_MODULE_19__["translationCss"]; });
23623
24260
 
@@ -23965,7 +24602,7 @@ __webpack_require__.r(__webpack_exports__);
23965
24602
  /* harmony import */ var survey_core__WEBPACK_IMPORTED_MODULE_71__ = __webpack_require__(/*! survey-core */ "survey-core");
23966
24603
  /* harmony import */ var survey_core__WEBPACK_IMPORTED_MODULE_71___default = /*#__PURE__*/__webpack_require__.n(survey_core__WEBPACK_IMPORTED_MODULE_71__);
23967
24604
  var Version;
23968
- Version = "" + "1.9.110";
24605
+ Version = "" + "1.9.111";
23969
24606
  //should be loaded before other styles for easier override
23970
24607
  __webpack_require__(/*! ../utils/context-button.scss */ "./src/utils/context-button.scss");
23971
24608
 
@@ -24055,7 +24692,7 @@ __webpack_require__(/*! ../utils/design.scss */ "./src/utils/design.scss");
24055
24692
  __webpack_require__(/*! ../utils/layout.scss */ "./src/utils/layout.scss");
24056
24693
 
24057
24694
  survey_core__WEBPACK_IMPORTED_MODULE_71__["settings"].supportCreatorV2 = true;
24058
- Object(survey_core__WEBPACK_IMPORTED_MODULE_71__["checkLibraryVersion"])("" + "1.9.110", "survey-creator-core");
24695
+ Object(survey_core__WEBPACK_IMPORTED_MODULE_71__["checkLibraryVersion"])("" + "1.9.111", "survey-creator-core");
24059
24696
 
24060
24697
 
24061
24698
  /***/ }),
@@ -24368,6 +25005,7 @@ var map = {
24368
25005
  "./rating.svg": "./src/images/rating.svg",
24369
25006
  "./redo.svg": "./src/images/redo.svg",
24370
25007
  "./remove_16x16.svg": "./src/images/remove_16x16.svg",
25008
+ "./required.svg": "./src/images/required.svg",
24371
25009
  "./reset.svg": "./src/images/reset.svg",
24372
25010
  "./save.svg": "./src/images/save.svg",
24373
25011
  "./select-page.svg": "./src/images/select-page.svg",
@@ -25243,6 +25881,17 @@ module.exports = "<svg viewBox=\"0 0 16 16\" xmlns=\"http://www.w3.org/2000/svg\
25243
25881
 
25244
25882
  /***/ }),
25245
25883
 
25884
+ /***/ "./src/images/required.svg":
25885
+ /*!*********************************!*\
25886
+ !*** ./src/images/required.svg ***!
25887
+ \*********************************/
25888
+ /*! no static exports found */
25889
+ /***/ (function(module, exports) {
25890
+
25891
+ 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>"
25892
+
25893
+ /***/ }),
25894
+
25246
25895
  /***/ "./src/images/reset.svg":
25247
25896
  /*!******************************!*\
25248
25897
  !*** ./src/images/reset.svg ***!
@@ -26292,6 +26941,8 @@ var enStrings = {
26292
26941
  translationNoStrings: "No strings to translate. Please, change the filter.",
26293
26942
  translationExportToSCVButton: "Export to CSV",
26294
26943
  translationImportFromSCVButton: "Import from CSV",
26944
+ translateUsigAI: "Auto-translate All",
26945
+ translationDialogTitle: "Untranslated strings",
26295
26946
  translationMergeLocaleWithDefault: "Merge {0} with default locale",
26296
26947
  translationPlaceHolder: "Translation...",
26297
26948
  themeExportButton: "Export",
@@ -26322,9 +26973,11 @@ var enStrings = {
26322
26973
  question_visibilityName: "Show (hide) question",
26323
26974
  question_enableName: "Enable (disable) question",
26324
26975
  question_requireName: "Make question required",
26976
+ question_resetValue: "Reset question value",
26325
26977
  column_visibilityName: "Show (hide) column",
26326
26978
  column_enableName: "Enable (disable) column",
26327
26979
  column_requireName: "Make column required",
26980
+ column_resetValue: "Reset column value",
26328
26981
  trigger_completeName: "Complete survey",
26329
26982
  trigger_setvalueName: "Set answer",
26330
26983
  trigger_copyvalueName: "Copy answer",
@@ -26419,6 +27072,7 @@ var enStrings = {
26419
27072
  fastEntry: "Manual Entry",
26420
27073
  fastEntryNonUniqueError: "Value '{0}' is not unique",
26421
27074
  fastEntryChoicesCountError: "Please limit the number of items from {0} to {1}",
27075
+ fastEntryChoicesMinCountError: "Please enter at least {0} items",
26422
27076
  fastEntryPlaceholder: "You can set data in the following format:\nvalue1|text\nvalue2",
26423
27077
  formEntry: "Form Entry",
26424
27078
  testService: "Test the service",
@@ -26483,6 +27137,8 @@ var enStrings = {
26483
27137
  choicesOrder: "Choices sort order",
26484
27138
  visible: "Visible",
26485
27139
  isRequired: "Required",
27140
+ markRequired: "Mark as required",
27141
+ removeRequiredMark: "Remove the required mark",
26486
27142
  isAllRowRequired: "Require answer for all rows",
26487
27143
  requiredErrorText: "\"Required\" error message",
26488
27144
  startWithNewLine: "Display the question on a new line",
@@ -26564,8 +27220,12 @@ var enStrings = {
26564
27220
  imageHeight: "Image height (in CSS-accepted values)",
26565
27221
  imageWidth: "Image width (in CSS-accepted values)"
26566
27222
  },
27223
+ survey: {
27224
+ title: "Title"
27225
+ },
26567
27226
  page: {
26568
- maxTimeToFinish: "Time limit to finish the page (in seconds)"
27227
+ title: "Title",
27228
+ maxTimeToFinish: "Time limit to finish the page (in seconds)",
26569
27229
  },
26570
27230
  question: {
26571
27231
  page: "Parent page"
@@ -27066,6 +27726,7 @@ var enStrings = {
27066
27726
  descriptionLocation: "Description location",
27067
27727
  defaultValueExpression: "Default value expression",
27068
27728
  requiredIf: "Required if",
27729
+ resetValueIf: "Reset value if",
27069
27730
  validators: "Validators",
27070
27731
  bindings: "Bindings",
27071
27732
  renderAs: "Render as",
@@ -27142,6 +27803,7 @@ var enStrings = {
27142
27803
  "--base-unit": "Base unit",
27143
27804
  groupGeneral: "General",
27144
27805
  groupAdvanced: "Advanced",
27806
+ groupHeader: "Header",
27145
27807
  themeName: "Theme",
27146
27808
  themeMode: "Question appearance",
27147
27809
  themeModePanels: "Default",
@@ -27152,11 +27814,15 @@ var enStrings = {
27152
27814
  primaryDefaultColor: "Default",
27153
27815
  primaryDarkColor: "Hover",
27154
27816
  primaryLightColor: "Selected",
27817
+ coverTitleForecolor: "Title forecolor",
27818
+ coverOverlap: "Overlap",
27155
27819
  backgroundDimColor: "Background color",
27156
27820
  backgroundImage: "Background image",
27157
27821
  backgroundImageFitAuto: "Auto",
27158
27822
  backgroundImageFitCover: "Cover",
27159
27823
  backgroundImageFitContain: "Contain",
27824
+ backgroundImageFitFill: "Fill",
27825
+ backgroundImageFitTile: "Tile",
27160
27826
  backgroundOpacity: "Opacity",
27161
27827
  backgroundImageAttachmentFixed: "Fixed",
27162
27828
  backgroundImageAttachmentScroll: "Scroll",
@@ -27201,6 +27867,26 @@ var enStrings = {
27201
27867
  boxShadowInner: "Inner",
27202
27868
  questionShadow: "Shadow effects",
27203
27869
  editorShadow: "Input element shadow effects",
27870
+ headerView: "View",
27871
+ headerViewTitle: "Title",
27872
+ headerViewCover: "Cover",
27873
+ coverAreaWidth: "Content area width",
27874
+ coverAreaWidthSurvey: "Same as survey",
27875
+ coverAreaWidthContainer: "Fit to page",
27876
+ coverTextWidth: "Text width",
27877
+ coverBackgroundColorSwitch: "Background color",
27878
+ coverBackgroundColorNone: "None",
27879
+ coverBackgroundColorAccentColor: "Accent color",
27880
+ coverBackgroundColorCustom: "Custom",
27881
+ horizontalAlignmentLeft: "Left",
27882
+ horizontalAlignmentCenter: "Center",
27883
+ horizontalAlignmentRight: "Right",
27884
+ verticalAlignmentTop: "Top",
27885
+ verticalAlignmentMiddle: "Middle",
27886
+ verticalAlignmentBottom: "Bottom",
27887
+ logoPosition: "Logo Position",
27888
+ coverTitlePosition: "Title Position",
27889
+ coverDescriptionPosition: "Description Position",
27204
27890
  names: {
27205
27891
  "default": "Default",
27206
27892
  "sharp": "Sharp",
@@ -27349,6 +28035,7 @@ var UndoRedoPlugin = /** @class */ (function () {
27349
28035
  this.model = new _undo_redo_controller__WEBPACK_IMPORTED_MODULE_0__["UndoRedoController"](creator);
27350
28036
  this.model.createActions().forEach(function (action) { return creator.toolbar.actions.push(action); });
27351
28037
  creator.registerShortcut("undo", {
28038
+ affectedTab: "designer",
27352
28039
  hotKey: {
27353
28040
  ctrlKey: true,
27354
28041
  keyCode: 90,
@@ -27359,6 +28046,7 @@ var UndoRedoPlugin = /** @class */ (function () {
27359
28046
  execute: function () { return _this.model.undo(); }
27360
28047
  });
27361
28048
  creator.registerShortcut("redo", {
28049
+ affectedTab: "designer",
27362
28050
  hotKey: {
27363
28051
  ctrlKey: true,
27364
28052
  keyCode: 89,
@@ -29789,6 +30477,15 @@ var FastEntryEditorBase = /** @class */ (function (_super) {
29789
30477
  _this.editSurvey.getQuestionByName("question").placeholder =
29790
30478
  _editorLocalization__WEBPACK_IMPORTED_MODULE_3__["editorLocalization"].getString("pe.fastEntryPlaceholder");
29791
30479
  _this.editSurvey.onValidateQuestion.add(function (sender, options) {
30480
+ var minChoiceCount = _this.options.minimumChoicesCount;
30481
+ if (minChoiceCount > 0) {
30482
+ var choicesCount = _this.getChoicesCount();
30483
+ if (minChoiceCount > choicesCount) {
30484
+ options.error = _editorLocalization__WEBPACK_IMPORTED_MODULE_3__["editorLocalization"]
30485
+ .getString("pe.fastEntryChoicesMinCountError")["format"](minChoiceCount);
30486
+ }
30487
+ return;
30488
+ }
29792
30489
  var maxChoicesCount = _this.options.maximumChoicesCount;
29793
30490
  if (maxChoicesCount > 0) {
29794
30491
  var choicesCount = _this.getChoicesCount();
@@ -32026,7 +32723,11 @@ var PropertyGridEditorMatrix = /** @class */ (function (_super) {
32026
32723
  if (this.getShowDetailPanelOnAdding()) {
32027
32724
  res.detailPanelShowOnAdding = true;
32028
32725
  }
32726
+ var minRowCount = this.getMinimumRowCount(obj, prop, options);
32029
32727
  var maxRowCount = this.getMaximumRowCount(obj, prop, options);
32728
+ if (minRowCount > 0) {
32729
+ res.minRowCount = minRowCount;
32730
+ }
32030
32731
  if (maxRowCount > 0) {
32031
32732
  res.maxRowCount = maxRowCount;
32032
32733
  }
@@ -32040,6 +32741,9 @@ var PropertyGridEditorMatrix = /** @class */ (function (_super) {
32040
32741
  }
32041
32742
  return _editorLocalization__WEBPACK_IMPORTED_MODULE_2__["editorLocalization"].getString(locName);
32042
32743
  };
32744
+ PropertyGridEditorMatrix.prototype.getMinimumRowCount = function (obj, prop, options) {
32745
+ return -1;
32746
+ };
32043
32747
  PropertyGridEditorMatrix.prototype.getMaximumRowCount = function (obj, prop, options) {
32044
32748
  return -1;
32045
32749
  };
@@ -32145,6 +32849,11 @@ var PropertyGridEditorMatrixItemValues = /** @class */ (function (_super) {
32145
32849
  res.showHeader = res.columns > 3;
32146
32850
  return res;
32147
32851
  };
32852
+ PropertyGridEditorMatrixItemValues.prototype.getMinimumRowCount = function (obj, prop, options) {
32853
+ if (prop.name === "choices")
32854
+ return options.minimumChoicesCount;
32855
+ return _super.prototype.getMaximumRowCount.call(this, obj, prop, options);
32856
+ };
32148
32857
  PropertyGridEditorMatrixItemValues.prototype.getMaximumRowCount = function (obj, prop, options) {
32149
32858
  if (prop.name === "choices")
32150
32859
  return options.maximumChoicesCount;
@@ -32880,6 +33589,7 @@ var PropertyGridViewModel = /** @class */ (function (_super) {
32880
33589
  title: this.selectedElementName,
32881
33590
  css: "sv-action--object-selector sv-action-bar-item--secondary",
32882
33591
  component: "sv-action-bar-item-dropdown",
33592
+ disableHide: true,
32883
33593
  action: function () {
32884
33594
  _this.selectorPopupModel.displayMode = _this.creator.isMobileView ? "overlay" : "popup";
32885
33595
  selectorModel.show(_this.selectionController.creator.survey, _this.propertyGridModel.obj, function (obj) {
@@ -33350,6 +34060,7 @@ var SurveyQuestionEditorDefinition = /** @class */ (function () {
33350
34060
  { name: "requiredIf", tab: "logic" },
33351
34061
  { name: "bindings", tab: "logic" },
33352
34062
  { name: "defaultValueExpression", tab: "logic" },
34063
+ { name: "resetValueIf", tab: "logic" },
33353
34064
  { name: "page", tab: "layout" },
33354
34065
  { name: "startWithNewLine", tab: "layout" },
33355
34066
  { name: "hideNumber", tab: "layout" },
@@ -33663,6 +34374,7 @@ var SurveyQuestionEditorDefinition = /** @class */ (function () {
33663
34374
  { name: "enableIf", tab: "logic" },
33664
34375
  { name: "requiredIf", tab: "logic" },
33665
34376
  { name: "defaultValueExpression", tab: "logic" },
34377
+ { name: "resetValueIf", tab: "logic" },
33666
34378
  { name: "totalType", tab: "totals" },
33667
34379
  { name: "totalDisplayStyle", tab: "totals" },
33668
34380
  { name: "totalCurrency", tab: "totals" },
@@ -34718,6 +35430,8 @@ __webpack_require__.r(__webpack_exports__);
34718
35430
  /* harmony import */ var survey_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! survey-core */ "survey-core");
34719
35431
  /* harmony import */ var survey_core__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(survey_core__WEBPACK_IMPORTED_MODULE_1__);
34720
35432
  /* harmony import */ var _creator_settings__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./creator-settings */ "./src/creator-settings.ts");
35433
+ /* harmony import */ var _survey_helper__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./survey-helper */ "./src/survey-helper.ts");
35434
+
34721
35435
 
34722
35436
 
34723
35437
 
@@ -34769,6 +35483,7 @@ var DragDropSurveyElements = /** @class */ (function (_super) {
34769
35483
  // protected ghostSurveyElement: IElement = null;
34770
35484
  _this.dragOverIndicatorElement = null;
34771
35485
  _this.isDraggedElementSelected = false;
35486
+ _this.maxNestedPanels = -1;
34772
35487
  _this.doBanDropHere = function () {
34773
35488
  _this.removeDragOverMarker(_this.dragOverIndicatorElement);
34774
35489
  _this.removeDragOverMarker(_this.dropTarget);
@@ -34999,6 +35714,13 @@ var DragDropSurveyElements = /** @class */ (function (_super) {
34999
35714
  if (this.draggedElement.getType() === "paneldynamic" && dropTarget === this.draggedElement.template) {
35000
35715
  return false;
35001
35716
  }
35717
+ if (this.maxNestedPanels >= 0 && this.draggedElement.isPanel) {
35718
+ var len = _survey_helper__WEBPACK_IMPORTED_MODULE_3__["SurveyHelper"].getElementDeepLength(dropTarget);
35719
+ if (this.isEdge && dropTarget.isPanel)
35720
+ len--;
35721
+ if (this.maxNestedPanels < len)
35722
+ return false;
35723
+ }
35002
35724
  if (DragDropSurveyElements.restrictDragQuestionBetweenPages &&
35003
35725
  this.shouldRestricDragQuestionBetweenPages(dropTarget)) {
35004
35726
  return false;
@@ -35560,6 +36282,15 @@ var SurveyHelper = /** @class */ (function () {
35560
36282
  }
35561
36283
  return false;
35562
36284
  };
36285
+ SurveyHelper.getElementDeepLength = function (element) {
36286
+ var res = 0;
36287
+ while (!!element) {
36288
+ if (element.isPanel)
36289
+ res++;
36290
+ element = element.parent;
36291
+ }
36292
+ return res;
36293
+ };
35563
36294
  return SurveyHelper;
35564
36295
  }());
35565
36296
 
@@ -36032,6 +36763,23 @@ var QuestionToolboxItem = /** @class */ (function (_super) {
36032
36763
  QuestionToolboxItem.prototype.toJSON = function () {
36033
36764
  return this.item;
36034
36765
  };
36766
+ Object.defineProperty(QuestionToolboxItem.prototype, "typeName", {
36767
+ get: function () {
36768
+ if (!!this.json && !!this.json.type)
36769
+ return this.json.type;
36770
+ return this.name;
36771
+ },
36772
+ enumerable: false,
36773
+ configurable: true
36774
+ });
36775
+ Object.defineProperty(QuestionToolboxItem.prototype, "isPanel", {
36776
+ get: function () {
36777
+ var type = this.typeName;
36778
+ return !!type && survey_core__WEBPACK_IMPORTED_MODULE_1__["Serializer"].isDescendantOf(type, "panelbase");
36779
+ },
36780
+ enumerable: false,
36781
+ configurable: true
36782
+ });
36035
36783
  return QuestionToolboxItem;
36036
36784
  }(survey_core__WEBPACK_IMPORTED_MODULE_1__["Action"]));
36037
36785
 
@@ -36177,7 +36925,7 @@ var QuestionToolbox = /** @class */ (function (_super) {
36177
36925
  get: function () {
36178
36926
  var res = [];
36179
36927
  for (var i = 0; i < this.items.length; i++) {
36180
- res.push(this.items[i].name);
36928
+ res.push(this.items[i].typeName);
36181
36929
  }
36182
36930
  return res;
36183
36931
  },