survey-creator-core 1.11.5 → 1.11.6

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 (85) hide show
  1. package/fonts.fontless.css +1 -1
  2. package/fonts.fontless.min.css +1 -1
  3. package/i18n/arabic.js +1 -1
  4. package/i18n/arabic.min.js +1 -1
  5. package/i18n/bulgarian.js +1 -1
  6. package/i18n/bulgarian.min.js +1 -1
  7. package/i18n/croatian.js +1 -1
  8. package/i18n/croatian.min.js +1 -1
  9. package/i18n/czech.js +1 -1
  10. package/i18n/czech.min.js +1 -1
  11. package/i18n/danish.js +1 -1
  12. package/i18n/danish.min.js +1 -1
  13. package/i18n/dutch.js +1 -1
  14. package/i18n/dutch.min.js +1 -1
  15. package/i18n/english.js +1 -1
  16. package/i18n/english.min.js +1 -1
  17. package/i18n/finnish.js +1 -1
  18. package/i18n/finnish.min.js +1 -1
  19. package/i18n/french.js +1 -1
  20. package/i18n/french.min.js +1 -1
  21. package/i18n/german.js +1 -1
  22. package/i18n/german.min.js +1 -1
  23. package/i18n/hebrew.js +1 -1
  24. package/i18n/hebrew.min.js +1 -1
  25. package/i18n/hungarian.js +1 -1
  26. package/i18n/hungarian.min.js +1 -1
  27. package/i18n/index.js +1 -1
  28. package/i18n/index.min.js +1 -1
  29. package/i18n/indonesian.js +1 -1
  30. package/i18n/indonesian.min.js +1 -1
  31. package/i18n/italian.js +1 -1
  32. package/i18n/italian.min.js +1 -1
  33. package/i18n/japanese.js +1 -1
  34. package/i18n/japanese.min.js +1 -1
  35. package/i18n/korean.js +1 -1
  36. package/i18n/korean.min.js +1 -1
  37. package/i18n/malay.js +1 -1
  38. package/i18n/malay.min.js +1 -1
  39. package/i18n/mongolian.js +1 -1
  40. package/i18n/mongolian.min.js +1 -1
  41. package/i18n/norwegian.js +1 -1
  42. package/i18n/norwegian.min.js +1 -1
  43. package/i18n/persian.js +1 -1
  44. package/i18n/persian.min.js +1 -1
  45. package/i18n/polish.js +1 -1
  46. package/i18n/polish.min.js +1 -1
  47. package/i18n/portuguese.js +1 -1
  48. package/i18n/portuguese.min.js +1 -1
  49. package/i18n/russian.js +1 -1
  50. package/i18n/russian.min.js +1 -1
  51. package/i18n/simplified-chinese.js +1 -1
  52. package/i18n/simplified-chinese.min.js +1 -1
  53. package/i18n/slovak.js +1 -1
  54. package/i18n/slovak.min.js +1 -1
  55. package/i18n/spanish.js +1 -1
  56. package/i18n/spanish.min.js +1 -1
  57. package/i18n/swedish.js +1 -1
  58. package/i18n/swedish.min.js +1 -1
  59. package/i18n/tajik.js +1 -1
  60. package/i18n/tajik.min.js +1 -1
  61. package/i18n/traditional-chinese.js +1 -1
  62. package/i18n/traditional-chinese.min.js +1 -1
  63. package/i18n/turkish.js +1 -1
  64. package/i18n/turkish.min.js +1 -1
  65. package/package.json +2 -2
  66. package/survey-creator-core.css +244 -36
  67. package/survey-creator-core.fontless.css +243 -35
  68. package/survey-creator-core.fontless.css.map +1 -1
  69. package/survey-creator-core.fontless.min.css +9 -9
  70. package/survey-creator-core.i18n.js +1 -1
  71. package/survey-creator-core.i18n.min.js +1 -1
  72. package/survey-creator-core.js +443 -89
  73. package/survey-creator-core.js.map +1 -1
  74. package/survey-creator-core.min.css +10 -10
  75. package/survey-creator-core.min.js +6 -6
  76. package/typings/components/action-container-view-model.d.ts +9 -1
  77. package/typings/components/question.d.ts +4 -2
  78. package/typings/components/tabs/designer-plugin.d.ts +2 -0
  79. package/typings/components/tabs/designer-state-manager.d.ts +17 -0
  80. package/typings/components/toolbox/toolbox-tool.d.ts +8 -4
  81. package/typings/creator-base.d.ts +18 -4
  82. package/typings/creator-events-api.d.ts +4 -0
  83. package/typings/creator-options.d.ts +12 -0
  84. package/typings/survey-helper.d.ts +1 -0
  85. package/typings/toolbox.d.ts +7 -0
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * SurveyJS Creator v1.11.5
2
+ * SurveyJS Creator v1.11.6
3
3
  * (c) 2015-2024 Devsoft Baltic OÜ - http://surveyjs.io/
4
4
  * Github: https://github.com/surveyjs/survey-creator
5
5
  * License: https://surveyjs.io/Licenses#SurveyCreator
@@ -130,7 +130,7 @@ License: MIT
130
130
  /***/ (function(module, exports, __webpack_require__) {
131
131
 
132
132
  /*!
133
- * surveyjs - Survey JavaScript library v1.11.5
133
+ * surveyjs - Survey JavaScript library v1.11.6
134
134
  * Copyright (c) 2015-2024 Devsoft Baltic OÜ - http://surveyjs.io/
135
135
  * License: MIT (http://www.opensource.org/licenses/mit-license.php)
136
136
  */
@@ -4704,9 +4704,12 @@ var SurveyElementActionContainer = /** @class */ (function (_super) {
4704
4704
  var SurveyElementAdornerBase = /** @class */ (function (_super) {
4705
4705
  Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(SurveyElementAdornerBase, _super);
4706
4706
  function SurveyElementAdornerBase(creator, surveyElement) {
4707
+ var _a, _b, _c;
4707
4708
  var _this = _super.call(this) || this;
4708
4709
  _this.creator = creator;
4709
4710
  _this.surveyElement = surveyElement;
4711
+ _this.designerStateManager = (_a = creator.getPlugin("designer")) === null || _a === void 0 ? void 0 : _a.designerStateManager;
4712
+ (_b = _this.designerStateManager) === null || _b === void 0 ? void 0 : _b.initForElement(surveyElement);
4710
4713
  _this.selectedPropPageFunc = function (sender, options) {
4711
4714
  if (options.name === "isSelectedInDesigner") {
4712
4715
  _this.onElementSelectedChanged(options.newValue);
@@ -4720,6 +4723,17 @@ var SurveyElementAdornerBase = /** @class */ (function (_super) {
4720
4723
  _this.actionContainer = new SurveyElementActionContainer();
4721
4724
  _this.actionContainer.dotsItem.iconSize = 16;
4722
4725
  _this.actionContainer.dotsItem.popupModel.horizontalPosition = "center";
4726
+ _this.topActionContainer = new survey_core__WEBPACK_IMPORTED_MODULE_1__["ActionContainer"]();
4727
+ _this.topActionContainer.sizeMode = "small";
4728
+ _this.topActionContainer.setItems([{
4729
+ id: "collapse",
4730
+ iconName: new survey_core__WEBPACK_IMPORTED_MODULE_1__["ComputedUpdater"](function () { return _this.collapsed ? "icon-restore_16x16" : "icon-collapse-detail-light_16x16"; }),
4731
+ iconSize: 16,
4732
+ action: function () {
4733
+ _this.collapsed = !_this.collapsed;
4734
+ }
4735
+ }]);
4736
+ _this.collapsed = !!surveyElement && ((_c = _this.designerStateManager) === null || _c === void 0 ? void 0 : _c.getElementState(surveyElement).collapsed);
4723
4737
  _this.setSurveyElement(surveyElement);
4724
4738
  _this.creator.sidebar.onPropertyChanged.add(_this.sidebarFlyoutModeChangedFunc);
4725
4739
  _this.setShowAddQuestionButton(true);
@@ -4816,9 +4830,8 @@ var SurveyElementAdornerBase = /** @class */ (function (_super) {
4816
4830
  title: this.creator.getLocString("survey.duplicate"),
4817
4831
  visibleIndex: 10,
4818
4832
  iconSize: 16,
4819
- action: function () {
4820
- _this.duplicate();
4821
- }
4833
+ action: function () { return _this.duplicate(); },
4834
+ onFocus: function (isMouse, event) { return _this.disableActionFocusing(isMouse, event); }
4822
4835
  }));
4823
4836
  items.push(new survey_core__WEBPACK_IMPORTED_MODULE_1__["Action"]({
4824
4837
  id: "settings",
@@ -4845,9 +4858,18 @@ var SurveyElementAdornerBase = /** @class */ (function (_super) {
4845
4858
  iconSize: 16,
4846
4859
  action: function () {
4847
4860
  _this.delete();
4848
- }
4861
+ },
4862
+ onFocus: function (isMouse, event) { return _this.disableActionFocusing(isMouse, event); }
4849
4863
  }));
4850
4864
  };
4865
+ SurveyElementAdornerBase.prototype.disableActionFocusing = function (isMouse, event) {
4866
+ this.isDisableSelecting = isMouse;
4867
+ };
4868
+ SurveyElementAdornerBase.prototype.canSelectElement = function () {
4869
+ var res = !this.isDisableSelecting;
4870
+ this.isDisableSelecting = false;
4871
+ return res;
4872
+ };
4851
4873
  Object.defineProperty(SurveyElementAdornerBase.prototype, "allowEdit", {
4852
4874
  get: function () {
4853
4875
  return !!this.creator && !this.creator.readOnly && this.allowEditOption;
@@ -4872,6 +4894,18 @@ var SurveyElementAdornerBase = /** @class */ (function (_super) {
4872
4894
  Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
4873
4895
  Object(survey_core__WEBPACK_IMPORTED_MODULE_1__["property"])({ defaultValue: true })
4874
4896
  ], SurveyElementAdornerBase.prototype, "allowDragging", void 0);
4897
+ Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
4898
+ Object(survey_core__WEBPACK_IMPORTED_MODULE_1__["property"])({
4899
+ onSet: function (val, target) {
4900
+ target.renderedCollapsed = val;
4901
+ if (target.designerStateManager && target.surveyElement)
4902
+ target.designerStateManager.getElementState(target.surveyElement).collapsed = val;
4903
+ }
4904
+ })
4905
+ ], SurveyElementAdornerBase.prototype, "collapsed", void 0);
4906
+ Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
4907
+ Object(survey_core__WEBPACK_IMPORTED_MODULE_1__["property"])()
4908
+ ], SurveyElementAdornerBase.prototype, "renderedCollapsed", void 0);
4875
4909
  return SurveyElementAdornerBase;
4876
4910
  }(survey_core__WEBPACK_IMPORTED_MODULE_1__["Base"]));
4877
4911
 
@@ -7032,6 +7066,7 @@ __webpack_require__.r(__webpack_exports__);
7032
7066
  /* harmony import */ var _action_container_view_model__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./action-container-view-model */ "./src/components/action-container-view-model.ts");
7033
7067
  /* harmony import */ var _creator_settings__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../creator-settings */ "./src/creator-settings.ts");
7034
7068
  /* harmony import */ var _string_editor__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./string-editor */ "./src/components/string-editor.ts");
7069
+ /* harmony import */ var _toolbox__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../toolbox */ "./src/toolbox.ts");
7035
7070
 
7036
7071
 
7037
7072
 
@@ -7041,6 +7076,7 @@ __webpack_require__.r(__webpack_exports__);
7041
7076
  __webpack_require__(/*! ./question.scss */ "./src/components/question.scss");
7042
7077
 
7043
7078
 
7079
+
7044
7080
  var QuestionAdornerViewModel = /** @class */ (function (_super) {
7045
7081
  Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(QuestionAdornerViewModel, _super);
7046
7082
  function QuestionAdornerViewModel(creator, surveyElement, templateData) {
@@ -7077,10 +7113,12 @@ var QuestionAdornerViewModel = /** @class */ (function (_super) {
7077
7113
  enumerable: false,
7078
7114
  configurable: true
7079
7115
  });
7116
+ QuestionAdornerViewModel.prototype.canSelectElement = function () {
7117
+ return _super.prototype.canSelectElement.call(this) && this.surveyElement.isInteractiveDesignElement;
7118
+ };
7080
7119
  QuestionAdornerViewModel.prototype.select = function (model, event) {
7081
- if (!model.surveyElement.isInteractiveDesignElement) {
7120
+ if (!model.canSelectElement())
7082
7121
  return;
7083
- }
7084
7122
  var creator = model.creator;
7085
7123
  var selEl = model.surveyElement;
7086
7124
  var el = document === null || document === void 0 ? void 0 : document.activeElement;
@@ -7093,7 +7131,11 @@ var QuestionAdornerViewModel = /** @class */ (function (_super) {
7093
7131
  return true;
7094
7132
  };
7095
7133
  QuestionAdornerViewModel.prototype.rootCss = function () {
7096
- return this.surveyElement.isQuestion && !this.surveyElement.startWithNewLine ? " svc-question__adorner--start-with-new-line" : "";
7134
+ var isStartWithNewLine = this.surveyElement.isQuestion && !this.surveyElement.startWithNewLine;
7135
+ return new survey_core__WEBPACK_IMPORTED_MODULE_1__["CssClassBuilder"]()
7136
+ .append("svc-question__adorner--start-with-new-line", isStartWithNewLine)
7137
+ .append("svc-question__adorner--collapse-" + this.creator.expandCollapseButtonVisibility, true)
7138
+ .append("svc-question__adorner--collapsed", !!this.renderedCollapsed).toString();
7097
7139
  };
7098
7140
  QuestionAdornerViewModel.prototype.css = function () {
7099
7141
  if (!this.surveyElement.isInteractiveDesignElement)
@@ -7342,7 +7384,7 @@ var QuestionAdornerViewModel = /** @class */ (function (_super) {
7342
7384
  QuestionAdornerViewModel.prototype.onPointerDown = function (pointerDownEvent) {
7343
7385
  this.dragOrClickHelper.onPointerDown(pointerDownEvent);
7344
7386
  };
7345
- QuestionAdornerViewModel.prototype.getConvertToTypesActions = function () {
7387
+ QuestionAdornerViewModel.prototype.getConvertToTypes = function () {
7346
7388
  var _this = this;
7347
7389
  var availableItems = this.creator.getAvailableToolboxItems(this.element, false);
7348
7390
  var itemNames = [];
@@ -7353,19 +7395,36 @@ var QuestionAdornerViewModel = /** @class */ (function (_super) {
7353
7395
  });
7354
7396
  var convertClasses = _questionconverter__WEBPACK_IMPORTED_MODULE_3__["QuestionConverter"].getConvertToClasses(this.currentType, itemNames, true);
7355
7397
  var res = [];
7356
- var lastItem = null;
7357
7398
  convertClasses.forEach(function (className) {
7358
7399
  var items = _this.creator.toolbox.items.filter(function (item) { return item.name == className; });
7359
7400
  if (Array.isArray(items) && items.length > 0) {
7360
7401
  var item = items[0];
7361
- var needSeparator = lastItem && item.category != lastItem.category;
7362
- var action = _this.creator.createIActionBarItemByClass(item.name, item.title, item.iconName, needSeparator);
7363
- lastItem = item;
7364
- res.push(action);
7402
+ res.push(item);
7365
7403
  }
7366
7404
  });
7367
7405
  return res;
7368
7406
  };
7407
+ QuestionAdornerViewModel.prototype.getConvertToTypesActions = function (parentAction) {
7408
+ var _this = this;
7409
+ var availableItems = this.getConvertToTypes();
7410
+ var res = [];
7411
+ var lastItem = null;
7412
+ availableItems.forEach(function (item) {
7413
+ var needSeparator = lastItem && item.category != lastItem.category;
7414
+ var action = _this.creator.createIActionBarItemByClass(item, needSeparator, function (questionType, subtype) {
7415
+ if (_this.surveyElement.getType() !== questionType) {
7416
+ _this.creator.convertCurrentQuestion(questionType);
7417
+ }
7418
+ var propertyName = _toolbox__WEBPACK_IMPORTED_MODULE_8__["QuestionToolbox"].getSubTypePropertyName(questionType);
7419
+ if (!!propertyName && !!subtype)
7420
+ _this.creator.selectedElement.setPropertyValue(propertyName, subtype);
7421
+ parentAction === null || parentAction === void 0 ? void 0 : parentAction.hidePopup();
7422
+ });
7423
+ lastItem = item;
7424
+ res.push(action);
7425
+ });
7426
+ return res;
7427
+ };
7369
7428
  Object.defineProperty(QuestionAdornerViewModel.prototype, "currentType", {
7370
7429
  get: function () {
7371
7430
  return this.surveyElement.getType();
@@ -7387,46 +7446,62 @@ var QuestionAdornerViewModel = /** @class */ (function (_super) {
7387
7446
  title: actionTitle,
7388
7447
  iconName: (_a = this.creator.toolbox.getItemByName(this.element.getType())) === null || _a === void 0 ? void 0 : _a.iconName
7389
7448
  };
7390
- var newAction = this.createDropdownModel(actionData, actions, function (listModel) {
7391
- var newItems = _this.getConvertToTypesActions();
7392
- listModel.setItems(newItems);
7393
- listModel.selectedItem = _this.getSelectedItem(newItems, _this.currentType);
7394
- }, function (item) {
7395
- _this.creator.convertCurrentQuestion(item.id);
7449
+ var newAction = this.createDropdownModel({
7450
+ actionData: actionData,
7451
+ items: actions,
7452
+ updateListModel: function (listModel) {
7453
+ var newItems = _this.getConvertToTypesActions(newAction);
7454
+ listModel.setItems(newItems);
7455
+ listModel.selectedItem = _this.getSelectedItem(newItems, _this.currentType);
7456
+ var propertyName = _toolbox__WEBPACK_IMPORTED_MODULE_8__["QuestionToolbox"].getSubTypePropertyName(_this.currentType);
7457
+ newItems.forEach(function (action) {
7458
+ var _a;
7459
+ if (((_a = action.items) === null || _a === void 0 ? void 0 : _a.length) > 0) {
7460
+ var selectedSubItem = action.items.filter(function (item) { return item.id === _this.element[propertyName]; })[0];
7461
+ if (selectedSubItem) {
7462
+ var _listModel = action.popupModel.contentComponentData.model;
7463
+ _listModel.selectedItem = selectedSubItem;
7464
+ }
7465
+ }
7466
+ });
7467
+ }
7396
7468
  });
7469
+ newAction.disableHide = true;
7397
7470
  return newAction;
7398
7471
  };
7399
7472
  QuestionAdornerViewModel.prototype.createConvertInputType = function () {
7400
7473
  var _this = this;
7401
- var prop = null;
7402
- if (this.surveyElement.getType() === "text")
7403
- prop = survey_core__WEBPACK_IMPORTED_MODULE_1__["Serializer"].findProperty("text", "inputType");
7404
- if (this.surveyElement.getType() === "rating")
7405
- prop = survey_core__WEBPACK_IMPORTED_MODULE_1__["Serializer"].findProperty("rating", "rateDisplayMode");
7406
- if (!prop || !Object(_utils_utils__WEBPACK_IMPORTED_MODULE_4__["isPropertyVisible"])(this.surveyElement, prop.name))
7474
+ var questionType = this.surveyElement.getType();
7475
+ var toolboxItem = this.creator.toolbox.items.filter(function (item) { return item.id === questionType; })[0];
7476
+ if (!toolboxItem || !toolboxItem.items || toolboxItem.items.length < 1)
7407
7477
  return null;
7408
- var propName = prop.name;
7478
+ var propName = _toolbox__WEBPACK_IMPORTED_MODULE_8__["QuestionToolbox"].getSubTypePropertyName(questionType);
7409
7479
  var questionSubType = this.surveyElement.getPropertyValue(propName);
7410
- var items = prop.getChoices(this.surveyElement, function (chs) { });
7411
7480
  var getAvailableTypes = function () {
7412
- var availableTypes = [];
7413
- items.forEach(function (item) {
7414
- availableTypes.push({ id: item, title: _editorLocalization__WEBPACK_IMPORTED_MODULE_2__["editorLocalization"].getPropertyValueInEditor(prop.name, item) });
7481
+ return toolboxItem.items.map(function (item) {
7482
+ return {
7483
+ id: item.id,
7484
+ title: item.title,
7485
+ action: function (item) {
7486
+ var newValue = _this.getUpdatedPropertyValue(propName, item.id);
7487
+ _this.surveyElement.setPropertyValue(propName, newValue);
7488
+ }
7489
+ };
7415
7490
  });
7416
- return availableTypes;
7417
7491
  };
7418
7492
  var actionData = {
7419
7493
  id: "convertInputType",
7420
7494
  visibleIndex: 1,
7421
- title: _editorLocalization__WEBPACK_IMPORTED_MODULE_2__["editorLocalization"].getPropertyValueInEditor(prop.name, questionSubType),
7495
+ title: _editorLocalization__WEBPACK_IMPORTED_MODULE_2__["editorLocalization"].getPropertyValueInEditor(propName, questionSubType),
7422
7496
  };
7423
- var newAction = this.createDropdownModel(actionData, getAvailableTypes(), function (listModel) {
7424
- var newItems = getAvailableTypes();
7425
- listModel.setItems(newItems);
7426
- listModel.selectedItem = _this.getSelectedItem(newItems, _this.surveyElement.getPropertyValue(propName));
7427
- }, function (item) {
7428
- var newValue = _this.getUpdatedPropertyValue(propName, item.id);
7429
- _this.surveyElement.setPropertyValue(propName, newValue);
7497
+ var newAction = this.createDropdownModel({
7498
+ actionData: actionData,
7499
+ items: getAvailableTypes(),
7500
+ updateListModel: function (listModel) {
7501
+ var newItems = getAvailableTypes();
7502
+ listModel.setItems(newItems);
7503
+ listModel.selectedItem = _this.getSelectedItem(newItems, _this.surveyElement.getPropertyValue(propName));
7504
+ }
7430
7505
  });
7431
7506
  newAction.disableShrink = true;
7432
7507
  this.surveyElement.registerFunctionOnPropertyValueChanged(propName, function () {
@@ -7445,27 +7520,26 @@ var QuestionAdornerViewModel = /** @class */ (function (_super) {
7445
7520
  var selectedItems = actions.filter(function (item) { return item.id === id; });
7446
7521
  return selectedItems.length > 0 ? selectedItems[0] : undefined;
7447
7522
  };
7448
- QuestionAdornerViewModel.prototype.createDropdownModel = function (actionData, items, updateListModel, onSelectionChanged) {
7523
+ QuestionAdornerViewModel.prototype.createDropdownModel = function (options) {
7449
7524
  var newAction = Object(survey_core__WEBPACK_IMPORTED_MODULE_1__["createDropdownActionModel"])({
7450
- id: actionData.id,
7525
+ id: options.actionData.id,
7451
7526
  css: "sv-action--convertTo sv-action-bar-item--secondary",
7452
- iconName: actionData.iconName,
7527
+ iconName: options.actionData.iconName,
7453
7528
  iconSize: 24,
7454
- title: actionData.title,
7455
- enabled: actionData.enabled,
7456
- visibleIndex: actionData.visibleIndex,
7529
+ title: options.actionData.title,
7530
+ enabled: options.actionData.enabled,
7531
+ visibleIndex: options.actionData.visibleIndex,
7457
7532
  disableShrink: false,
7458
7533
  location: "start",
7459
7534
  action: function (newType) {
7460
7535
  },
7461
7536
  }, {
7462
- items: items,
7463
- onSelectionChanged: onSelectionChanged,
7537
+ items: options.items,
7464
7538
  allowSelection: true,
7465
7539
  horizontalPosition: "center",
7466
7540
  onShow: function () {
7467
7541
  var listModel = newAction.popupModel.contentComponentData.model;
7468
- updateListModel(listModel);
7542
+ options.updateListModel(listModel);
7469
7543
  },
7470
7544
  });
7471
7545
  newAction.popupModel.displayMode = this.creator.isTouch ? "overlay" : "popup";
@@ -7525,8 +7599,7 @@ var QuestionAdornerViewModel = /** @class */ (function (_super) {
7525
7599
  QuestionAdornerViewModel.prototype.duplicate = function () {
7526
7600
  var _this = this;
7527
7601
  setTimeout(function () {
7528
- var newElement = _this.creator.fastCopyQuestion(_this.surveyElement);
7529
- _this.creator.selectElement(newElement);
7602
+ _this.creator.fastCopyQuestion(_this.surveyElement, true);
7530
7603
  }, 1);
7531
7604
  };
7532
7605
  QuestionAdornerViewModel.prototype.addNewQuestion = function () {
@@ -8880,6 +8953,9 @@ var StringEditorViewModelBase = /** @class */ (function (_super) {
8880
8953
  if (this.creator) {
8881
8954
  this.creator.selectFromStringEditor = true;
8882
8955
  }
8956
+ if (this.locString.hasHtml && this.editAsText) {
8957
+ event.target.innerText = event.target.textContent = this.locString.calculatedText;
8958
+ }
8883
8959
  event.target.parentElement.click();
8884
8960
  event.target.spellcheck = true;
8885
8961
  event.target.setAttribute("tabindex", -1);
@@ -8986,7 +9062,7 @@ var StringEditorViewModelBase = /** @class */ (function (_super) {
8986
9062
  clearedText = mdText;
8987
9063
  }
8988
9064
  else {
8989
- var txt = this.locString.hasHtml ? html : text;
9065
+ var txt = this.locString.hasHtml && !this.editAsText ? html : text;
8990
9066
  if (!this.locString.allowLineBreaks)
8991
9067
  txt = Object(_utils_utils__WEBPACK_IMPORTED_MODULE_3__["clearNewLines"])(txt);
8992
9068
  clearedText = txt;
@@ -9294,6 +9370,8 @@ __webpack_require__.r(__webpack_exports__);
9294
9370
  /* harmony import */ var _property_grid__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../property-grid */ "./src/property-grid/index.ts");
9295
9371
  /* harmony import */ var _property_grid_property_grid_view_model__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../property-grid/property-grid-view-model */ "./src/property-grid/property-grid-view-model.ts");
9296
9372
  /* harmony import */ var _designer__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./designer */ "./src/components/tabs/designer.ts");
9373
+ /* harmony import */ var _designer_state_manager__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./designer-state-manager */ "./src/components/tabs/designer-state-manager.ts");
9374
+
9297
9375
 
9298
9376
 
9299
9377
 
@@ -9323,6 +9401,13 @@ var TabDesignerPlugin = /** @class */ (function () {
9323
9401
  return result;
9324
9402
  });
9325
9403
  this.toolboxTab = this.creator.sidebar.addTab("toolbox", "svc-toolbox", creator);
9404
+ this.designerStateManager = new _designer_state_manager__WEBPACK_IMPORTED_MODULE_5__["DesignerStateManager"]();
9405
+ this.designerStateManager.initForSurvey(this.creator.survey);
9406
+ this.creator.onSurveyInstanceCreated.add(function (s, o) {
9407
+ if (o.reason == "designer") {
9408
+ _this.designerStateManager.initForSurvey(o.survey);
9409
+ }
9410
+ });
9326
9411
  this.creator.onPropertyChanged.add(function (sender, options) {
9327
9412
  if (options.name === "toolboxLocation") {
9328
9413
  if (_this.toolboxTab.visible && options.newVal !== "sidebar") {
@@ -9485,6 +9570,71 @@ var TabDesignerPlugin = /** @class */ (function () {
9485
9570
 
9486
9571
 
9487
9572
 
9573
+ /***/ }),
9574
+
9575
+ /***/ "./src/components/tabs/designer-state-manager.ts":
9576
+ /*!*******************************************************!*\
9577
+ !*** ./src/components/tabs/designer-state-manager.ts ***!
9578
+ \*******************************************************/
9579
+ /*! exports provided: DesignerStateManager */
9580
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
9581
+
9582
+ "use strict";
9583
+ __webpack_require__.r(__webpack_exports__);
9584
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DesignerStateManager", function() { return DesignerStateManager; });
9585
+ var ElementState = /** @class */ (function () {
9586
+ function ElementState() {
9587
+ this.collapsed = false;
9588
+ }
9589
+ return ElementState;
9590
+ }());
9591
+ var DesignerStateManager = /** @class */ (function () {
9592
+ function DesignerStateManager() {
9593
+ var _this = this;
9594
+ this.elementState = {};
9595
+ this.pageState = {};
9596
+ this.onQuestionAddedHandler = function (sender, opts) {
9597
+ _this.elementState[opts.question.name] = new ElementState();
9598
+ };
9599
+ this.onPageAddedHandler = function (sender, opts) {
9600
+ _this.pageState[opts.page.name] = new ElementState();
9601
+ };
9602
+ this.onPanelAddedHandler = function (sender, opts) {
9603
+ _this.elementState[opts.panel.name] = new ElementState();
9604
+ };
9605
+ }
9606
+ DesignerStateManager.prototype.getStateMapForElement = function (element) {
9607
+ return (element && element.isPage) ? this.pageState : this.elementState;
9608
+ };
9609
+ DesignerStateManager.prototype.initForSurvey = function (survey) {
9610
+ survey.onQuestionAdded.add(this.onQuestionAddedHandler);
9611
+ survey.onPageAdded.add(this.onPageAddedHandler);
9612
+ survey.onPanelAdded.add(this.onPanelAddedHandler);
9613
+ };
9614
+ DesignerStateManager.prototype.initForElement = function (element) {
9615
+ if (!element)
9616
+ return;
9617
+ var stateMap = this.getStateMapForElement(element);
9618
+ element.registerFunctionOnPropertyValueChanged("name", function (newName) {
9619
+ delete stateMap[element.name];
9620
+ stateMap[newName] = new ElementState();
9621
+ }, "designerStateManager");
9622
+ };
9623
+ DesignerStateManager.prototype.getElementState = function (element) {
9624
+ var stateMap = this.getStateMapForElement(element);
9625
+ var name = element.name;
9626
+ var state = stateMap[name];
9627
+ if (state)
9628
+ return state;
9629
+ state = new ElementState();
9630
+ stateMap[name] = new ElementState();
9631
+ return state;
9632
+ };
9633
+ return DesignerStateManager;
9634
+ }());
9635
+
9636
+
9637
+
9488
9638
  /***/ }),
9489
9639
 
9490
9640
  /***/ "./src/components/tabs/designer.scss":
@@ -20194,18 +20344,20 @@ __webpack_require__.r(__webpack_exports__);
20194
20344
 
20195
20345
  var ToolboxToolViewModel = /** @class */ (function (_super) {
20196
20346
  Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__extends"])(ToolboxToolViewModel, _super);
20197
- function ToolboxToolViewModel(item, creator) {
20347
+ function ToolboxToolViewModel(item, creator, model) {
20198
20348
  var _this = _super.call(this) || this;
20199
20349
  _this.item = item;
20200
20350
  _this.creator = creator;
20351
+ _this.model = model;
20201
20352
  _this.click = function (event) {
20202
20353
  if (!_this.allowAdd)
20203
20354
  return;
20204
20355
  _this.creator.clickToolboxItem(_this.item.json);
20356
+ _this.hidePopup();
20205
20357
  };
20206
20358
  _this.onPointerUp = function (pointerUpEvent) {
20207
- _this._node.classList.remove("svc-toolbox__tool--pressed");
20208
- _this._node = null;
20359
+ _this.hidePopup();
20360
+ _this.toolboxItem.isPressed = false;
20209
20361
  document.removeEventListener("pointerup", _this.onPointerUp);
20210
20362
  };
20211
20363
  _this.startDragToolboxItem = function (pointerDownEvent, currentTarget) {
@@ -20216,6 +20368,13 @@ var ToolboxToolViewModel = /** @class */ (function (_super) {
20216
20368
  _this.dragOrClickHelper = new survey_core__WEBPACK_IMPORTED_MODULE_1__["DragOrClickHelper"](_this.startDragToolboxItem);
20217
20369
  return _this;
20218
20370
  }
20371
+ Object.defineProperty(ToolboxToolViewModel.prototype, "toolboxItem", {
20372
+ get: function () {
20373
+ return this.item;
20374
+ },
20375
+ enumerable: false,
20376
+ configurable: true
20377
+ });
20219
20378
  Object.defineProperty(ToolboxToolViewModel.prototype, "allowAdd", {
20220
20379
  get: function () {
20221
20380
  return !this.creator.readOnly;
@@ -20223,18 +20382,28 @@ var ToolboxToolViewModel = /** @class */ (function (_super) {
20223
20382
  enumerable: false,
20224
20383
  configurable: true
20225
20384
  });
20385
+ ToolboxToolViewModel.prototype.onMouseOver = function (itemValue, mouseoverEvent) {
20386
+ this.model.mouseOverHandler(itemValue);
20387
+ };
20388
+ ToolboxToolViewModel.prototype.onMouseLeave = function (itemValue, mouseoverEvent) {
20389
+ itemValue.hidePopupDelayed(this.creator.toolbox.subItemsHideDelay);
20390
+ };
20226
20391
  ToolboxToolViewModel.prototype.onPointerDown = function (pointerDownEvent) {
20227
20392
  var _a;
20393
+ pointerDownEvent.stopPropagation();
20228
20394
  if (!this.allowAdd)
20229
20395
  return;
20230
20396
  if (this.item.id.indexOf("dotsItem-id") === 0)
20231
20397
  return true; //toolbox responsive popup
20232
20398
  this.dragOrClickHelper.onPointerDown(pointerDownEvent);
20233
- this._node = pointerDownEvent.currentTarget;
20234
- this._node.classList.add("svc-toolbox__tool--pressed");
20399
+ this.toolboxItem.isPressed = true;
20235
20400
  document.addEventListener("pointerup", this.onPointerUp);
20236
20401
  (_a = this.creator) === null || _a === void 0 ? void 0 : _a.onDragDropItemStart();
20237
20402
  };
20403
+ ToolboxToolViewModel.prototype.hidePopup = function () {
20404
+ this.toolboxItem.hidePopup();
20405
+ this.toolboxItem.isHovered = false;
20406
+ };
20238
20407
  Object.defineProperty(ToolboxToolViewModel.prototype, "dragDropHelper", {
20239
20408
  get: function () {
20240
20409
  return this.creator.dragDropSurveyElements;
@@ -20949,6 +21118,18 @@ var SurveyCreatorModel = /** @class */ (function (_super) {
20949
21118
  button: "",
20950
21119
  shown: "svc-notifier--shown"
20951
21120
  });
21121
+ /**
21122
+ * Specifies where to add new questions when users click the "Add Question" button.
21123
+ *
21124
+ * Accepted values:
21125
+ *
21126
+ * - `true` (default)
21127
+ * New questions are added to the end of a survey page.
21128
+ *
21129
+ * - `false`
21130
+ * New questions are added after the currently selected question on the design surface.
21131
+ */
21132
+ _this.addNewQuestionLast = true;
20952
21133
  _this.onKeyDownHandler = function (event) {
20953
21134
  _this.findSuitableShortcuts(event).forEach(function (shortcut) {
20954
21135
  if ((event.keyCode < 48 || event.keyCode == 89 || event.keyCode == 90) && isTextInput(event.target))
@@ -22552,9 +22733,14 @@ var SurveyCreatorModel = /** @class */ (function (_super) {
22552
22733
  }
22553
22734
  parent = selectedElement.parent;
22554
22735
  if (index < 0) {
22555
- index = parent.elements.indexOf(selectedElement);
22556
- if (index > -1)
22557
- index++;
22736
+ if (this.addNewQuestionLast) {
22737
+ index = parent.elements.length;
22738
+ }
22739
+ else {
22740
+ index = parent.elements.indexOf(selectedElement);
22741
+ if (index > -1)
22742
+ index++;
22743
+ }
22558
22744
  }
22559
22745
  }
22560
22746
  if (panel) {
@@ -22693,11 +22879,12 @@ var SurveyCreatorModel = /** @class */ (function (_super) {
22693
22879
  return this.createNewElement(json);
22694
22880
  };
22695
22881
  /**
22696
- * Creates a copy of a specified question and inserts the copy next to this question.
22882
+ * Creates a copy of a specified question, inserts the copy next to this question and optionally select it in the designer.
22697
22883
  * @param question A question to copy.
22884
+ * @param selectNewElement Select a new element if true
22698
22885
  * @returns The instance of a new question.
22699
22886
  */
22700
- SurveyCreatorModel.prototype.fastCopyQuestion = function (question) {
22887
+ SurveyCreatorModel.prototype.fastCopyQuestion = function (question, selectNewElement) {
22701
22888
  var newElement = this.copyElement(question);
22702
22889
  var index = !!question["parent"]
22703
22890
  ? question["parent"].elements.indexOf(question) + 1
@@ -22709,6 +22896,9 @@ var SurveyCreatorModel = /** @class */ (function (_super) {
22709
22896
  }
22710
22897
  }
22711
22898
  this.doClickQuestionCore(newElement, "ELEMENT_COPIED", index, question["parent"]);
22899
+ if (selectNewElement) {
22900
+ this.selectElement(newElement);
22901
+ }
22712
22902
  return newElement;
22713
22903
  };
22714
22904
  Object.defineProperty(SurveyCreatorModel.prototype, "selectedElement", {
@@ -23178,6 +23368,7 @@ var SurveyCreatorModel = /** @class */ (function (_super) {
23178
23368
  };
23179
23369
  SurveyCreatorModel.prototype.deletePanelOrQuestion = function (obj) {
23180
23370
  var _this = this;
23371
+ var changeSelection = obj === this.selectedElement;
23181
23372
  var parent = obj["parent"];
23182
23373
  var elements = parent.elements;
23183
23374
  var objIndex = elements.indexOf(obj);
@@ -23191,7 +23382,9 @@ var SurveyCreatorModel = /** @class */ (function (_super) {
23191
23382
  if (parent.isPage && (this.pageEditMode === "single" || elements.length === 0)) {
23192
23383
  parent = this.survey;
23193
23384
  }
23194
- this.selectElement(objIndex > -1 ? elements[objIndex] : parent);
23385
+ if (changeSelection) {
23386
+ this.selectElement(objIndex > -1 ? elements[objIndex] : parent);
23387
+ }
23195
23388
  };
23196
23389
  SurveyCreatorModel.prototype.onCanShowObjectProperty = function (object, property, showMode, parentObj, parentProperty) {
23197
23390
  if (this.hiddenProperties[property.id])
@@ -23647,9 +23840,14 @@ var SurveyCreatorModel = /** @class */ (function (_super) {
23647
23840
  SurveyCreatorModel.prototype.getQuestionTypeSelectorModel = function (beforeAdd, element) {
23648
23841
  var _this = this;
23649
23842
  var panel = !!element && element.isPanel ? element : null;
23843
+ var onSelectQuestionType = function (questionType, subtype) {
23844
+ _this.currentAddQuestionType = questionType;
23845
+ _this.addNewQuestionInPage(beforeAdd, panel, questionType, subtype);
23846
+ newAction.popupModel.hide();
23847
+ };
23650
23848
  var getActions = function () {
23651
23849
  var availableTypes = _this.getAvailableToolboxItems(element).map(function (item) {
23652
- return _this.createIActionBarItemByClass(item.name, item.title, item.iconName, item.needSeparator);
23850
+ return _this.createIActionBarItemByClass(item, item.needSeparator, onSelectQuestionType);
23653
23851
  });
23654
23852
  return availableTypes;
23655
23853
  };
@@ -23658,10 +23856,6 @@ var SurveyCreatorModel = /** @class */ (function (_super) {
23658
23856
  title: this.getLocString("ed.addNewQuestion"),
23659
23857
  }, {
23660
23858
  items: getActions(),
23661
- onSelectionChanged: function (item) {
23662
- _this.currentAddQuestionType = item.id;
23663
- _this.addNewQuestionInPage(beforeAdd, panel);
23664
- },
23665
23859
  onShow: function () {
23666
23860
  var listModel = newAction.popupModel.contentComponentData.model;
23667
23861
  listModel.setItems(getActions());
@@ -23682,9 +23876,10 @@ var SurveyCreatorModel = /** @class */ (function (_super) {
23682
23876
  this.onGetPageActions.fire(this, options);
23683
23877
  return options.actions;
23684
23878
  };
23685
- SurveyCreatorModel.prototype.addNewQuestionInPage = function (beforeAdd, panel, type) {
23879
+ SurveyCreatorModel.prototype.addNewQuestionInPage = function (beforeAdd, panel, type, subtype) {
23686
23880
  if (panel === void 0) { panel = null; }
23687
23881
  if (type === void 0) { type = null; }
23882
+ if (subtype === void 0) { subtype = null; }
23688
23883
  if (!type)
23689
23884
  type = this.currentAddQuestionType;
23690
23885
  if (!type)
@@ -23696,15 +23891,34 @@ var SurveyCreatorModel = /** @class */ (function (_super) {
23696
23891
  json = toolboxItem.json;
23697
23892
  }
23698
23893
  var newElement = this.createNewElement(json);
23894
+ var propertyName = _toolbox__WEBPACK_IMPORTED_MODULE_7__["QuestionToolbox"].getSubTypePropertyName(type);
23895
+ if (!!propertyName && !!subtype)
23896
+ newElement.setPropertyValue(propertyName, subtype);
23699
23897
  this.clickToolboxItem(newElement, panel, "ADDED_FROM_PAGEBUTTON");
23700
23898
  };
23701
- SurveyCreatorModel.prototype.createIActionBarItemByClass = function (className, title, iconName, needSeparator) {
23899
+ SurveyCreatorModel.prototype.createIActionBarItemByClass = function (item, needSeparator, onSelectQuestionType) {
23702
23900
  var action = new survey_core__WEBPACK_IMPORTED_MODULE_1__["Action"]({
23703
- title: title,
23704
- id: className,
23705
- iconName: iconName,
23901
+ title: item.title,
23902
+ id: item.name,
23903
+ iconName: item.iconName,
23904
+ visible: item.visible,
23905
+ enabled: item.enabled,
23906
+ needSeparator: needSeparator
23706
23907
  });
23707
- action.needSeparator = needSeparator;
23908
+ action.action = function () {
23909
+ onSelectQuestionType(item.typeName);
23910
+ };
23911
+ if (!!item.items && item.items.length > 0) {
23912
+ var innerItems = item.items.map(function (i) { return new survey_core__WEBPACK_IMPORTED_MODULE_1__["Action"]({
23913
+ id: i.id,
23914
+ title: i.title,
23915
+ action: function () {
23916
+ action.hidePopup();
23917
+ onSelectQuestionType(item.typeName, i.id);
23918
+ }
23919
+ }); });
23920
+ action.setSubItems({ items: innerItems });
23921
+ }
23708
23922
  return action;
23709
23923
  };
23710
23924
  SurveyCreatorModel.prototype.onElementMenuItemsChanged = function (element, items) {
@@ -23947,6 +24161,9 @@ var SurveyCreatorModel = /** @class */ (function (_super) {
23947
24161
  Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
23948
24162
  Object(survey_core__WEBPACK_IMPORTED_MODULE_1__["property"])({ defaultValue: "right" })
23949
24163
  ], SurveyCreatorModel.prototype, "sidebarLocation", void 0);
24164
+ Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
24165
+ Object(survey_core__WEBPACK_IMPORTED_MODULE_1__["property"])({ defaultValue: "never" })
24166
+ ], SurveyCreatorModel.prototype, "expandCollapseButtonVisibility", void 0);
23950
24167
  Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
23951
24168
  Object(survey_core__WEBPACK_IMPORTED_MODULE_1__["property"])({
23952
24169
  defaultValue: false,
@@ -26441,7 +26658,7 @@ __webpack_require__.r(__webpack_exports__);
26441
26658
  /* harmony import */ var survey_core__WEBPACK_IMPORTED_MODULE_78__ = __webpack_require__(/*! survey-core */ "survey-core");
26442
26659
  /* harmony import */ var survey_core__WEBPACK_IMPORTED_MODULE_78___default = /*#__PURE__*/__webpack_require__.n(survey_core__WEBPACK_IMPORTED_MODULE_78__);
26443
26660
  var Version;
26444
- Version = "" + "1.11.5";
26661
+ Version = "" + "1.11.6";
26445
26662
  //should be loaded before other styles for easier override
26446
26663
  __webpack_require__(/*! ../utils/context-button.scss */ "./src/utils/context-button.scss");
26447
26664
 
@@ -26538,7 +26755,7 @@ __webpack_require__(/*! ../utils/design.scss */ "./src/utils/design.scss");
26538
26755
  __webpack_require__(/*! ../utils/layout.scss */ "./src/utils/layout.scss");
26539
26756
 
26540
26757
  survey_core__WEBPACK_IMPORTED_MODULE_78__["settings"].supportCreatorV2 = true;
26541
- Object(survey_core__WEBPACK_IMPORTED_MODULE_78__["checkLibraryVersion"])("" + "1.11.5", "survey-creator-core");
26758
+ Object(survey_core__WEBPACK_IMPORTED_MODULE_78__["checkLibraryVersion"])("" + "1.11.6", "survey-creator-core");
26542
26759
 
26543
26760
 
26544
26761
  /***/ }),
@@ -26796,6 +27013,7 @@ var map = {
26796
27013
  "./collapse-detail-light_16x16.svg": "./src/images/collapse-detail-light_16x16.svg",
26797
27014
  "./collapse-detail_16x16.svg": "./src/images/collapse-detail_16x16.svg",
26798
27015
  "./collapse-panel.svg": "./src/images/collapse-panel.svg",
27016
+ "./collapse-v_16x16.svg": "./src/images/collapse-v_16x16.svg",
26799
27017
  "./collapse_16x16.svg": "./src/images/collapse_16x16.svg",
26800
27018
  "./color-picker.svg": "./src/images/color-picker.svg",
26801
27019
  "./comment.svg": "./src/images/comment.svg",
@@ -26823,6 +27041,7 @@ var map = {
26823
27041
  "./expand-detail-light_16x16.svg": "./src/images/expand-detail-light_16x16.svg",
26824
27042
  "./expand-detail_16x16.svg": "./src/images/expand-detail_16x16.svg",
26825
27043
  "./expand-panel.svg": "./src/images/expand-panel.svg",
27044
+ "./expand-v_16x16.svg": "./src/images/expand-v_16x16.svg",
26826
27045
  "./expand_16x16.svg": "./src/images/expand_16x16.svg",
26827
27046
  "./export.svg": "./src/images/export.svg",
26828
27047
  "./expression.svg": "./src/images/expression.svg",
@@ -26856,6 +27075,7 @@ var map = {
26856
27075
  "./remove_16x16.svg": "./src/images/remove_16x16.svg",
26857
27076
  "./required.svg": "./src/images/required.svg",
26858
27077
  "./reset.svg": "./src/images/reset.svg",
27078
+ "./restore_16x16.svg": "./src/images/restore_16x16.svg",
26859
27079
  "./save.svg": "./src/images/save.svg",
26860
27080
  "./select-page.svg": "./src/images/select-page.svg",
26861
27081
  "./settings.svg": "./src/images/settings.svg",
@@ -27125,6 +27345,17 @@ module.exports = "<svg viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\
27125
27345
 
27126
27346
  /***/ }),
27127
27347
 
27348
+ /***/ "./src/images/collapse-v_16x16.svg":
27349
+ /*!*****************************************!*\
27350
+ !*** ./src/images/collapse-v_16x16.svg ***!
27351
+ \*****************************************/
27352
+ /*! no static exports found */
27353
+ /***/ (function(module, exports) {
27354
+
27355
+ module.exports = "<svg viewBox=\"0 0 16 16\" xmlns=\"http://www.w3.org/2000/svg\"><g id=\"Collapse V 16x16\"><path id=\"Vector\" d=\"M11.71 12.29C12.1 12.68 12.1 13.31 11.71 13.7C11.51 13.9 11.26 13.99 11 13.99C10.74 13.99 10.49 13.89 10.29 13.7L9.00002 12.41V15C9.00002 15.55 8.55002 16 8.00002 16C7.45002 16 7.00002 15.55 7.00002 15V12.41L5.71002 13.7C5.32002 14.09 4.69002 14.09 4.30002 13.7C3.91002 13.31 3.91002 12.68 4.30002 12.29L7.30002 9.29C7.69002 8.9 8.32002 8.9 8.71002 9.29L11.71 12.29ZM7.29002 6.71C7.49002 6.91 7.74002 7 8.00002 7C8.26002 7 8.51002 6.9 8.71002 6.71L11.71 3.71C12.1 3.32 12.1 2.69 11.71 2.3C11.32 1.91 10.69 1.91 10.3 2.3L9.01002 3.59V1C9.01002 0.45 8.56002 0 8.01002 0C7.46002 0 7.01002 0.45 7.01002 1V3.59L5.72002 2.3C5.33002 1.91 4.70002 1.91 4.31002 2.3C3.92002 2.69 3.90002 3.32 4.29002 3.71L7.29002 6.71Z\"></path></g></svg>"
27356
+
27357
+ /***/ }),
27358
+
27128
27359
  /***/ "./src/images/collapse_16x16.svg":
27129
27360
  /*!***************************************!*\
27130
27361
  !*** ./src/images/collapse_16x16.svg ***!
@@ -27422,6 +27653,17 @@ module.exports = "<svg viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\
27422
27653
 
27423
27654
  /***/ }),
27424
27655
 
27656
+ /***/ "./src/images/expand-v_16x16.svg":
27657
+ /*!***************************************!*\
27658
+ !*** ./src/images/expand-v_16x16.svg ***!
27659
+ \***************************************/
27660
+ /*! no static exports found */
27661
+ /***/ (function(module, exports) {
27662
+
27663
+ module.exports = "<svg viewBox=\"0 0 16 16\" xmlns=\"http://www.w3.org/2000/svg\"><g id=\"Expand V 16x16\" clip-path=\"url(#clip0_2625_3196)\"><path id=\"Vector\" d=\"M4.29006 4.71006C3.90006 4.32006 3.90006 3.69006 4.29006 3.30006L7.29006 0.290059C7.68006 -0.0999414 8.31006 -0.0999414 8.70006 0.290059L11.7001 3.29006C12.0901 3.68006 12.0901 4.31006 11.7001 4.70006C11.5001 4.90006 11.2501 4.99006 10.9901 4.99006C10.7301 4.99006 10.4801 4.89006 10.2801 4.70006L8.99006 3.41006V6.00006C8.99006 6.55006 8.54006 7.00006 7.99006 7.00006C7.44006 7.00006 6.99006 6.55006 6.99006 6.00006V3.41006L5.70006 4.70006C5.31006 5.09006 4.68006 5.09006 4.29006 4.70006V4.71006ZM10.2901 11.2901L9.00006 12.5801V9.99006C9.00006 9.44006 8.55006 8.99006 8.00006 8.99006C7.45006 8.99006 7.00006 9.44006 7.00006 9.99006V12.5801L5.71006 11.2901C5.32006 10.9001 4.69006 10.9001 4.30006 11.2901C3.91006 11.6801 3.91006 12.3101 4.30006 12.7001L7.30006 15.7001C7.50006 15.9001 7.75006 15.9901 8.01006 15.9901C8.27006 15.9901 8.52006 15.8901 8.72006 15.7001L11.7201 12.7001C12.1101 12.3101 12.1101 11.6801 11.7201 11.2901C11.3301 10.9001 10.7001 10.9001 10.3101 11.2901H10.2901Z\"></path></g><defs><clipPath id=\"clip0_2625_3196\"><rect width=\"16\" height=\"16\" fill=\"white\"></rect></clipPath></defs></svg>"
27664
+
27665
+ /***/ }),
27666
+
27425
27667
  /***/ "./src/images/expand_16x16.svg":
27426
27668
  /*!*************************************!*\
27427
27669
  !*** ./src/images/expand_16x16.svg ***!
@@ -27785,6 +28027,17 @@ module.exports = "<svg viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\
27785
28027
 
27786
28028
  /***/ }),
27787
28029
 
28030
+ /***/ "./src/images/restore_16x16.svg":
28031
+ /*!**************************************!*\
28032
+ !*** ./src/images/restore_16x16.svg ***!
28033
+ \**************************************/
28034
+ /*! no static exports found */
28035
+ /***/ (function(module, exports) {
28036
+
28037
+ module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\"><path d=\"M12 13H4C2.9 13 2 12.1 2 11V5C2 3.9 2.9 3 4 3H12C13.1 3 14 3.9 14 5V11C14 12.1 13.1 13 12 13ZM4 5V11H12V5H4Z\"></path></svg>"
28038
+
28039
+ /***/ }),
28040
+
27788
28041
  /***/ "./src/images/save.svg":
27789
28042
  /*!*****************************!*\
27790
28043
  !*** ./src/images/save.svg ***!
@@ -37666,12 +37919,15 @@ var defaultProperties = {
37666
37919
  { name: "totalDisplayStyle", tab: "totals" },
37667
37920
  { name: "totalCurrency", tab: "totals" },
37668
37921
  { name: "totalFormat", tab: "totals" },
37669
- { name: "totalExpression", tab: "totals" }
37922
+ { name: "totalExpression", tab: "totals" },
37923
+ { name: "validators", tab: "validation" },
37924
+ { name: "requiredErrorText", tab: "validation" }
37670
37925
  ],
37671
37926
  tabs: [
37672
37927
  { name: "general", index: 5 },
37673
37928
  { name: "logic", index: 20 },
37674
- { name: "totals", index: 40 }
37929
+ { name: "totals", index: 40 },
37930
+ { name: "validation", index: 60 }
37675
37931
  ]
37676
37932
  },
37677
37933
  "matrixdropdowncolumn@checkbox": {
@@ -37682,6 +37938,7 @@ var defaultProperties = {
37682
37938
  { name: "choiceTextsFromQuestion", tab: "choices" },
37683
37939
  { name: "showOtherItem", tab: "choices" },
37684
37940
  { name: "otherText", tab: "choices" },
37941
+ { name: "otherPlaceholder", tab: "choices" },
37685
37942
  { name: "choicesOrder", tab: "choices" },
37686
37943
  { name: "colCount", tab: "choices" },
37687
37944
  { name: "showSelectAllItem", tab: "choices" },
@@ -37710,6 +37967,7 @@ var defaultProperties = {
37710
37967
  { name: "choiceTextsFromQuestion", tab: "choices" },
37711
37968
  { name: "showOtherItem", tab: "choices" },
37712
37969
  { name: "otherText", tab: "choices" },
37970
+ { name: "otherPlaceholder", tab: "choices" },
37713
37971
  { name: "choicesOrder", tab: "choices" },
37714
37972
  { name: "colCount", tab: "choices" },
37715
37973
  { name: "showNoneItem", tab: "choices" },
@@ -37734,6 +37992,7 @@ var defaultProperties = {
37734
37992
  { name: "choiceTextsFromQuestion", tab: "choices" },
37735
37993
  { name: "showOtherItem", tab: "choices" },
37736
37994
  { name: "otherText", tab: "choices" },
37995
+ { name: "otherPlaceholder", tab: "choices" },
37737
37996
  { name: "choicesOrder", tab: "choices" },
37738
37997
  { name: "optionsCaption", tab: "choices" },
37739
37998
  { name: "showNoneItem", tab: "choices" },
@@ -37761,6 +38020,7 @@ var defaultProperties = {
37761
38020
  { name: "choiceTextsFromQuestion", tab: "choices" },
37762
38021
  { name: "showOtherItem", tab: "choices" },
37763
38022
  { name: "otherText", tab: "choices" },
38023
+ { name: "otherPlaceholder", tab: "choices" },
37764
38024
  { name: "choicesOrder", tab: "choices" },
37765
38025
  { name: "optionsCaption", tab: "choices" },
37766
38026
  { name: "showNoneItem", tab: "choices" },
@@ -39027,21 +39287,25 @@ var DragDropSurveyElements = /** @class */ (function (_super) {
39027
39287
  var textSpan = document.createElement("span");
39028
39288
  textSpan.className = "svc-dragged-element-shortcut__text";
39029
39289
  textSpan.innerText = text;
39030
- draggedElementShortcut.appendChild(this.createDraggedElementIcon());
39290
+ if (this.draggedElement.toolboxItemIconName) {
39291
+ draggedElementShortcut.appendChild(this.createDraggedElementIcon());
39292
+ }
39031
39293
  draggedElementShortcut.appendChild(textSpan);
39032
39294
  draggedElementShortcut.className = this.getDraggedElementClass();
39033
39295
  return draggedElementShortcut;
39034
39296
  };
39035
39297
  DragDropSurveyElements.prototype.createDraggedElementIcon = function () {
39036
39298
  var span = document.createElement("span");
39299
+ span.className = "svc-dragged-element-shortcut__icon";
39037
39300
  var iconName = this.draggedElement.toolboxItemIconName;
39038
39301
  var svgString = "<svg class=\"sv-svg-icon\" role=\"img\" style=\"width: 24px; height: 24px;\"><use xlink:href=\"#" + iconName + "\"></use></svg>";
39039
- span.className = "svc-dragged-element-shortcut__icon";
39040
39302
  span.innerHTML = svgString;
39041
39303
  return span;
39042
39304
  };
39043
39305
  DragDropSurveyElements.prototype.getDraggedElementClass = function () {
39044
39306
  var result = "svc-dragged-element-shortcut";
39307
+ if (!!this.draggedElement.toolboxItemIconName)
39308
+ result += " svc-dragged-element-shortcut--has-icon";
39045
39309
  if (this.isDraggedElementSelected)
39046
39310
  result += " svc-dragged-element-shortcut--selected";
39047
39311
  return result;
@@ -39195,7 +39459,7 @@ var DragDropSurveyElements = /** @class */ (function (_super) {
39195
39459
  target: dropTarget,
39196
39460
  insertAfter: undefined,
39197
39461
  insertBefore: undefined,
39198
- allowMultipleElementsInRow: true
39462
+ allowDropNextToAnother: true
39199
39463
  };
39200
39464
  if (dragOverLocation === survey_core__WEBPACK_IMPORTED_MODULE_1__["DragTypeOverMeEnum"].Bottom || dragOverLocation === survey_core__WEBPACK_IMPORTED_MODULE_1__["DragTypeOverMeEnum"].Right) {
39201
39465
  allowOptions.insertAfter = dropTarget;
@@ -39204,7 +39468,7 @@ var DragDropSurveyElements = /** @class */ (function (_super) {
39204
39468
  allowOptions.insertBefore = dropTarget;
39205
39469
  }
39206
39470
  this.survey.onDragDropAllow.fire(this.survey, allowOptions);
39207
- if (!allowOptions.allowMultipleElementsInRow) {
39471
+ if (!allowOptions.allowDropNextToAnother) {
39208
39472
  if (dragOverLocation === survey_core__WEBPACK_IMPORTED_MODULE_1__["DragTypeOverMeEnum"].Left) {
39209
39473
  this.dragOverLocation = survey_core__WEBPACK_IMPORTED_MODULE_1__["DragTypeOverMeEnum"].Top;
39210
39474
  }
@@ -39623,10 +39887,18 @@ var SurveyHelper = /** @class */ (function () {
39623
39887
  delete json["minWidth"];
39624
39888
  delete json["maxWidth"];
39625
39889
  };
39890
+ SurveyHelper.deleteRandomProperties = function (json) {
39891
+ ["choicesOrder", "rowsOrder"].forEach(function (prop) {
39892
+ if (json[prop] === "random") {
39893
+ delete json[prop];
39894
+ }
39895
+ });
39896
+ };
39626
39897
  SurveyHelper.updateQuestionJson = function (questionJson) {
39627
39898
  questionJson.storeOthersAsComment = false;
39628
39899
  delete questionJson.valuePropertyName;
39629
39900
  SurveyHelper.deleteConditionProperties(questionJson);
39901
+ SurveyHelper.deleteRandomProperties(questionJson);
39630
39902
  SurveyHelper.deleteConditionPropertiesFromArray(questionJson.choices);
39631
39903
  SurveyHelper.deleteConditionPropertiesFromArray(questionJson.rows);
39632
39904
  SurveyHelper.deleteConditionPropertiesFromArray(questionJson.columns);
@@ -40251,6 +40523,19 @@ var QuestionToolboxItem = /** @class */ (function (_super) {
40251
40523
  if (!_this.id) {
40252
40524
  _this.id = _this.name;
40253
40525
  }
40526
+ var originalCss = _this.css;
40527
+ _this.css = new survey_core__WEBPACK_IMPORTED_MODULE_1__["ComputedUpdater"](function () {
40528
+ return new survey_core__WEBPACK_IMPORTED_MODULE_1__["CssClassBuilder"]()
40529
+ .append("svc-toolbox__tool")
40530
+ .append("svc-toolbox__tool--action")
40531
+ .append(originalCss)
40532
+ .append("svc-toolbox__tool--hovered", _this.isHovered)
40533
+ .append("svc-toolbox__tool--pressed", _this.isPressed)
40534
+ .append("svc-toolbox__tool--has-icon", !!_this.iconName)
40535
+ .append("svc-toolbox__tool--disabled", _this.enabled === false)
40536
+ .append("sv-action--hidden", !_this.isVisible)
40537
+ .toString();
40538
+ });
40254
40539
  return _this;
40255
40540
  }
40256
40541
  QuestionToolboxItem.prototype.toJSON = function () {
@@ -40273,6 +40558,9 @@ var QuestionToolboxItem = /** @class */ (function (_super) {
40273
40558
  enumerable: false,
40274
40559
  configurable: true
40275
40560
  });
40561
+ QuestionToolboxItem.prototype.getArea = function (target) {
40562
+ return target.closest("#scrollableDiv-designer");
40563
+ };
40276
40564
  QuestionToolboxItem.prototype.hasText = function (text) {
40277
40565
  if (!text)
40278
40566
  return;
@@ -40314,7 +40602,7 @@ var QuestionToolbox = /** @class */ (function (_super) {
40314
40602
  _this.searchManager.toolbox = _this;
40315
40603
  _this.searchItem = new survey_core__WEBPACK_IMPORTED_MODULE_1__["Action"]({
40316
40604
  id: "searchItem-id",
40317
- css: "svc-toolbox__search-button",
40605
+ css: "svc-toolbox__tool svc-toolbox__search-button",
40318
40606
  innerCss: "sv-dots__item",
40319
40607
  iconName: "icon-search",
40320
40608
  component: "sv-action-bar-item",
@@ -40331,7 +40619,7 @@ var QuestionToolbox = /** @class */ (function (_super) {
40331
40619
  }
40332
40620
  Object.defineProperty(QuestionToolbox.prototype, "itemSelector", {
40333
40621
  get: function () {
40334
- return ".svc-toolbox__tool:not(.svc-toolbox__search-button):not(.sv-dots)";
40622
+ return ".svc-toolbox__category>.svc-toolbox__tool--action";
40335
40623
  },
40336
40624
  enumerable: false,
40337
40625
  configurable: true
@@ -40348,6 +40636,14 @@ var QuestionToolbox = /** @class */ (function (_super) {
40348
40636
  return undefined;
40349
40637
  return _creator_settings__WEBPACK_IMPORTED_MODULE_3__["settings"].toolbox.defaultJSON[questionType];
40350
40638
  };
40639
+ QuestionToolbox.getSubTypePropertyName = function (questionType) {
40640
+ var propertyName = "";
40641
+ if (questionType === "text")
40642
+ propertyName = "inputType";
40643
+ if (questionType === "rating")
40644
+ propertyName = "rateType";
40645
+ return propertyName;
40646
+ };
40351
40647
  Object.defineProperty(QuestionToolbox.prototype, "orderedQuestions", {
40352
40648
  /**
40353
40649
  * Modify this array to change the toolbox items order.
@@ -40388,6 +40684,14 @@ var QuestionToolbox = /** @class */ (function (_super) {
40388
40684
  };
40389
40685
  QuestionToolbox.prototype.initDotsItem = function () {
40390
40686
  var _this = this;
40687
+ var originalCss = this.dotsItem.css;
40688
+ this.dotsItem.css = new survey_core__WEBPACK_IMPORTED_MODULE_1__["ComputedUpdater"](function () {
40689
+ return new survey_core__WEBPACK_IMPORTED_MODULE_1__["CssClassBuilder"]()
40690
+ .append("svc-toolbox__tool")
40691
+ .append(originalCss)
40692
+ .append("sv-action--hidden", !_this.dotsItem.isVisible)
40693
+ .toString();
40694
+ });
40391
40695
  this.dotsItem.popupModel.horizontalPosition = "right";
40392
40696
  this.dotsItem.popupModel.verticalPosition = "top";
40393
40697
  this.dragOrClickHelper = new survey_core__WEBPACK_IMPORTED_MODULE_1__["DragOrClickHelper"](function (pointerDownEvent, currentTarget, itemModel) {
@@ -40592,7 +40896,7 @@ var QuestionToolbox = /** @class */ (function (_super) {
40592
40896
  name: name,
40593
40897
  title: title,
40594
40898
  tooltip: tooltip,
40595
- className: "svc-toolbox__item svc-toolbox__item--" + iconName,
40899
+ className: this.getItemClassNames(iconName),
40596
40900
  isCopied: options.isCopied !== false,
40597
40901
  iconName: iconName,
40598
40902
  json: !!options.json ? options.json : this.getQuestionJSON(question),
@@ -40617,9 +40921,44 @@ var QuestionToolbox = /** @class */ (function (_super) {
40617
40921
  }
40618
40922
  else {
40619
40923
  item.iconName = item.iconName ? item.iconName : QuestionToolbox.defaultIconName;
40620
- return new QuestionToolboxItem(item);
40924
+ var newItem = new QuestionToolboxItem(item);
40925
+ this.addSubTypes(newItem);
40926
+ return newItem;
40621
40927
  }
40622
40928
  };
40929
+ QuestionToolbox.prototype.addSubTypes = function (parentItem) {
40930
+ var _this = this;
40931
+ var property = null;
40932
+ var propName = QuestionToolbox.getSubTypePropertyName(parentItem.id);
40933
+ if (propName)
40934
+ property = survey_core__WEBPACK_IMPORTED_MODULE_1__["Serializer"].findProperty(parentItem.id, propName);
40935
+ if (!property || !property.visible)
40936
+ return;
40937
+ var newItems = property.choices.map(function (ch) {
40938
+ var newJson = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, parentItem.json);
40939
+ newJson[propName] = ch;
40940
+ var innerItem = new QuestionToolboxItem({
40941
+ id: ch,
40942
+ name: ch,
40943
+ title: _editorLocalization__WEBPACK_IMPORTED_MODULE_2__["editorLocalization"].getPropertyValueInEditor(propName, ch),
40944
+ className: _this.getItemClassNames() + " svc-toolbox__item-subtype",
40945
+ json: newJson,
40946
+ iconName: null,
40947
+ category: null,
40948
+ isCopied: false,
40949
+ component: "svc-toolbox-item"
40950
+ });
40951
+ return innerItem;
40952
+ });
40953
+ parentItem.setSubItems({ items: newItems });
40954
+ parentItem.component = "svc-toolbox-item-group";
40955
+ parentItem.popupModel.cssClass += " toolbox-subtypes";
40956
+ parentItem.popupModel.isFocusedContainer = false;
40957
+ var popup = parentItem.popupModel;
40958
+ popup.contentComponentName = "svc-toolbox-list";
40959
+ popup.contentComponentData["toolbox"] = this;
40960
+ popup.isFocusedContent = false;
40961
+ };
40623
40962
  QuestionToolbox.prototype.addItem = function (item, index) {
40624
40963
  this.correctItem(item);
40625
40964
  var action = this.getActionByItem(item);
@@ -41072,7 +41411,7 @@ var QuestionToolbox = /** @class */ (function (_super) {
41072
41411
  iconName: iconName,
41073
41412
  title: title,
41074
41413
  tooltip: title,
41075
- className: "svc-toolbox__item svc-toolbox__item--" + iconName,
41414
+ className: this.getItemClassNames(iconName),
41076
41415
  json: json,
41077
41416
  isCopied: false,
41078
41417
  category: (defaultCategories[name_1] || "")
@@ -41110,6 +41449,13 @@ var QuestionToolbox = /** @class */ (function (_super) {
41110
41449
  var items = instanceOwner.Instance["items"];
41111
41450
  return !!items ? items : [];
41112
41451
  };
41452
+ QuestionToolbox.prototype.getItemClassNames = function (iconName) {
41453
+ return new survey_core__WEBPACK_IMPORTED_MODULE_1__["CssClassBuilder"]()
41454
+ .append("svc-toolbox__item")
41455
+ .append("svc-toolbox__item--has-icon", !!iconName)
41456
+ .append("svc-toolbox__item--" + iconName, !!iconName)
41457
+ .toString();
41458
+ };
41113
41459
  QuestionToolbox.prototype.addItemFromJSON = function (json) {
41114
41460
  if (json.showInToolbox === false)
41115
41461
  return;
@@ -41133,7 +41479,7 @@ var QuestionToolbox = /** @class */ (function (_super) {
41133
41479
  iconName: iconName,
41134
41480
  title: title,
41135
41481
  tooltip: title,
41136
- className: "svc-toolbox__item svc-toolbox__item--" + iconName,
41482
+ className: this.getItemClassNames(iconName),
41137
41483
  json: elementJson,
41138
41484
  isCopied: false,
41139
41485
  category: category
@@ -41187,6 +41533,14 @@ var QuestionToolbox = /** @class */ (function (_super) {
41187
41533
  }
41188
41534
  return questions;
41189
41535
  };
41536
+ QuestionToolbox.prototype.hideAllInnerPopups = function () {
41537
+ this.actions.forEach(function (action) {
41538
+ action.hidePopup();
41539
+ });
41540
+ };
41541
+ QuestionToolbox.prototype.onScroll = function (model, event) {
41542
+ this.hideAllInnerPopups();
41543
+ };
41190
41544
  QuestionToolbox.MINELEMENTCOUNT = 10;
41191
41545
  QuestionToolbox.defaultIconName = "icon-default";
41192
41546
  QuestionToolbox.defaultCategories = {