survey-creator-core 1.12.3 → 1.12.4

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 (103) hide show
  1. package/5dcaaadc5b1c048d6daa.png +0 -0
  2. package/5e87e454a7071a571216.png +0 -0
  3. package/a7b373b83d0c1e0262bd.png +0 -0
  4. package/cc27e2890751d1ea0380.png +0 -0
  5. package/e8dfbe2bdd7c9dca5efa.png +0 -0
  6. package/fonts.fontless.css +1 -1
  7. package/fonts.fontless.min.css +1 -1
  8. package/i18n/arabic.js +1 -1
  9. package/i18n/arabic.min.js.LICENSE.txt +1 -1
  10. package/i18n/bulgarian.js +1 -1
  11. package/i18n/bulgarian.min.js.LICENSE.txt +1 -1
  12. package/i18n/croatian.js +1 -1
  13. package/i18n/croatian.min.js.LICENSE.txt +1 -1
  14. package/i18n/czech.js +1 -1
  15. package/i18n/czech.min.js.LICENSE.txt +1 -1
  16. package/i18n/danish.js +1 -1
  17. package/i18n/danish.min.js.LICENSE.txt +1 -1
  18. package/i18n/dutch.js +1 -1
  19. package/i18n/dutch.min.js.LICENSE.txt +1 -1
  20. package/i18n/english.js +17 -1
  21. package/i18n/english.js.map +1 -1
  22. package/i18n/english.min.js +1 -1
  23. package/i18n/english.min.js.LICENSE.txt +1 -1
  24. package/i18n/finnish.js +1 -1
  25. package/i18n/finnish.min.js.LICENSE.txt +1 -1
  26. package/i18n/french.js +1 -1
  27. package/i18n/french.min.js.LICENSE.txt +1 -1
  28. package/i18n/german.js +1 -1
  29. package/i18n/german.min.js.LICENSE.txt +1 -1
  30. package/i18n/hebrew.js +1 -1
  31. package/i18n/hebrew.min.js.LICENSE.txt +1 -1
  32. package/i18n/hungarian.js +1 -1
  33. package/i18n/hungarian.min.js.LICENSE.txt +1 -1
  34. package/i18n/index.js +1 -1
  35. package/i18n/index.min.js.LICENSE.txt +1 -1
  36. package/i18n/indonesian.js +1 -1
  37. package/i18n/indonesian.min.js.LICENSE.txt +1 -1
  38. package/i18n/italian.js +1 -1
  39. package/i18n/italian.min.js.LICENSE.txt +1 -1
  40. package/i18n/japanese.js +1 -1
  41. package/i18n/japanese.min.js.LICENSE.txt +1 -1
  42. package/i18n/korean.js +1 -1
  43. package/i18n/korean.min.js.LICENSE.txt +1 -1
  44. package/i18n/malay.js +1 -1
  45. package/i18n/malay.min.js.LICENSE.txt +1 -1
  46. package/i18n/mongolian.js +1 -1
  47. package/i18n/mongolian.min.js.LICENSE.txt +1 -1
  48. package/i18n/norwegian.js +1 -1
  49. package/i18n/norwegian.min.js.LICENSE.txt +1 -1
  50. package/i18n/persian.js +1 -1
  51. package/i18n/persian.min.js.LICENSE.txt +1 -1
  52. package/i18n/polish.js +1 -1
  53. package/i18n/polish.min.js.LICENSE.txt +1 -1
  54. package/i18n/portuguese.js +1 -1
  55. package/i18n/portuguese.min.js.LICENSE.txt +1 -1
  56. package/i18n/romanian.js +1 -1
  57. package/i18n/romanian.min.js.LICENSE.txt +1 -1
  58. package/i18n/russian.js +1 -1
  59. package/i18n/russian.min.js.LICENSE.txt +1 -1
  60. package/i18n/simplified-chinese.js +1 -1
  61. package/i18n/simplified-chinese.min.js.LICENSE.txt +1 -1
  62. package/i18n/slovak.js +1 -1
  63. package/i18n/slovak.min.js.LICENSE.txt +1 -1
  64. package/i18n/spanish.js +1 -1
  65. package/i18n/spanish.min.js.LICENSE.txt +1 -1
  66. package/i18n/swedish.js +1 -1
  67. package/i18n/swedish.min.js.LICENSE.txt +1 -1
  68. package/i18n/tajik.js +1 -1
  69. package/i18n/tajik.min.js.LICENSE.txt +1 -1
  70. package/i18n/thai.js +1 -1
  71. package/i18n/thai.min.js.LICENSE.txt +1 -1
  72. package/i18n/traditional-chinese.js +1 -1
  73. package/i18n/traditional-chinese.min.js.LICENSE.txt +1 -1
  74. package/i18n/turkish.js +1 -1
  75. package/i18n/turkish.min.js.LICENSE.txt +1 -1
  76. package/package.json +2 -2
  77. package/survey-creator-core.css +392 -97
  78. package/survey-creator-core.fontless.css +391 -96
  79. package/survey-creator-core.fontless.css.map +1 -1
  80. package/survey-creator-core.fontless.min.css +10 -10
  81. package/survey-creator-core.i18n.js +1 -1
  82. package/survey-creator-core.i18n.min.js.LICENSE.txt +1 -1
  83. package/survey-creator-core.js +589 -156
  84. package/survey-creator-core.js.map +1 -1
  85. package/survey-creator-core.min.css +11 -11
  86. package/survey-creator-core.min.js +1 -1
  87. package/survey-creator-core.min.js.LICENSE.txt +1 -1
  88. package/typings/components/action-container-view-model.d.ts +17 -1
  89. package/typings/components/page.d.ts +4 -2
  90. package/typings/components/question-image.d.ts +2 -2
  91. package/typings/components/question.d.ts +10 -2
  92. package/typings/components/simulator.d.ts +3 -1
  93. package/typings/components/tabs/designer.d.ts +2 -0
  94. package/typings/components/tabs/logic-ui.d.ts +2 -0
  95. package/typings/components/tabs/preview.d.ts +2 -0
  96. package/typings/components/tabs/theme-custom-questions/shadow-effects.d.ts +1 -0
  97. package/typings/components/tabs/translation.d.ts +2 -0
  98. package/typings/creator-base.d.ts +2 -0
  99. package/typings/editorLocalization.d.ts +16 -0
  100. package/typings/expand-collapse-manager.d.ts +8 -0
  101. package/typings/localization/english.d.ts +16 -0
  102. package/typings/survey-helper.d.ts +1 -0
  103. package/typings/toolbox.d.ts +1 -0
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * SurveyJS Creator v1.12.3
2
+ * SurveyJS Creator v1.12.4
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
@@ -1828,6 +1828,7 @@ __webpack_require__.r(__webpack_exports__);
1828
1828
 
1829
1829
 
1830
1830
 
1831
+
1831
1832
  var SurveyElementActionContainer = /** @class */ (function (_super) {
1832
1833
  (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(SurveyElementActionContainer, _super);
1833
1834
  function SurveyElementActionContainer() {
@@ -1909,6 +1910,9 @@ var SurveyElementAdornerBase = /** @class */ (function (_super) {
1909
1910
  _this = _super.call(this) || this;
1910
1911
  _this.creator = creator;
1911
1912
  _this.surveyElement = surveyElement;
1913
+ _this.animationCollapsed = new survey_core__WEBPACK_IMPORTED_MODULE_1__.AnimationBoolean(_this.getExpandCollapseAnimationOptions(), function (val) {
1914
+ _this._renderedCollapsed = !val;
1915
+ }, function () { return !_this.renderedCollapsed; });
1912
1916
  _this.draggedIn = false;
1913
1917
  _this.designerStateManager = (_a = creator.getPlugin("designer")) === null || _a === void 0 ? void 0 : _a.designerStateManager;
1914
1918
  (_b = _this.designerStateManager) === null || _b === void 0 ? void 0 : _b.initForElement(surveyElement);
@@ -1939,12 +1943,7 @@ var SurveyElementAdornerBase = /** @class */ (function (_super) {
1939
1943
  _this.creator.sidebar.onPropertyChanged.add(_this.sidebarFlyoutModeChangedFunc);
1940
1944
  _this.setShowAddQuestionButton(true);
1941
1945
  _this.expandCollapseAction.visible = _this.allowExpandCollapse;
1942
- _this.creator.onSurfaceToolbarActionExecuted.add(function (_, options) {
1943
- if (options.action.id == "collapseAll")
1944
- _this.collapsed = true;
1945
- if (options.action.id == "expandAll")
1946
- _this.collapsed = false;
1947
- });
1946
+ _this.creator.expandCollapseManager.add(_this);
1948
1947
  return _this;
1949
1948
  }
1950
1949
  Object.defineProperty(SurveyElementAdornerBase.prototype, "dragInsideCollapsedContainer", {
@@ -1954,6 +1953,101 @@ var SurveyElementAdornerBase = /** @class */ (function (_super) {
1954
1953
  enumerable: false,
1955
1954
  configurable: true
1956
1955
  });
1956
+ SurveyElementAdornerBase.prototype.getAnimatedElement = function () {
1957
+ return null;
1958
+ };
1959
+ SurveyElementAdornerBase.prototype.getInnerAnimatedElements = function () {
1960
+ return [];
1961
+ };
1962
+ SurveyElementAdornerBase.prototype.getCollapsingCssClassName = function () {
1963
+ return "svc-question--leave";
1964
+ };
1965
+ SurveyElementAdornerBase.prototype.getExpandingCssClassName = function () {
1966
+ return "svc-question--enter";
1967
+ };
1968
+ SurveyElementAdornerBase.prototype.hover = function (e, element) {
1969
+ var _this = this;
1970
+ var processedFlagName = "__svc_question_processed";
1971
+ if (!e[processedFlagName] && e.type === "mouseover") {
1972
+ if (!this.hoverTimeout) {
1973
+ this.hoverTimeout = setTimeout(function () {
1974
+ _this.isHovered = true;
1975
+ _this.hoverTimeout = undefined;
1976
+ }, this.creator.pageHoverDelay);
1977
+ }
1978
+ e[processedFlagName] = true;
1979
+ }
1980
+ else {
1981
+ clearTimeout(this.hoverTimeout);
1982
+ this.hoverTimeout = undefined;
1983
+ this.isHovered = false;
1984
+ }
1985
+ };
1986
+ SurveyElementAdornerBase.prototype.getExpandCollapseAnimationOptions = function () {
1987
+ var _this = this;
1988
+ var beforeRunAnimation = function (el, animatingClassName) {
1989
+ (0,survey_core__WEBPACK_IMPORTED_MODULE_1__.prepareElementForVerticalAnimation)(el);
1990
+ var innerAnimatedElements = _this.getInnerAnimatedElements();
1991
+ innerAnimatedElements.forEach(function (elem) {
1992
+ (0,survey_core__WEBPACK_IMPORTED_MODULE_1__.prepareElementForVerticalAnimation)(elem);
1993
+ });
1994
+ innerAnimatedElements.forEach(function (elem) {
1995
+ elem.classList.add(animatingClassName);
1996
+ });
1997
+ };
1998
+ var afterRunAnimation = function (el, animatingClassName) {
1999
+ _this.expandCollapseAnimationRunning = false;
2000
+ (0,survey_core__WEBPACK_IMPORTED_MODULE_1__.cleanHtmlElementAfterAnimation)(el);
2001
+ var innerAnimatedElements = _this.getInnerAnimatedElements();
2002
+ innerAnimatedElements.forEach(function (elem) {
2003
+ (0,survey_core__WEBPACK_IMPORTED_MODULE_1__.cleanHtmlElementAfterAnimation)(elem);
2004
+ });
2005
+ innerAnimatedElements.forEach(function (elem) {
2006
+ elem.classList.remove(animatingClassName);
2007
+ });
2008
+ };
2009
+ return {
2010
+ getRerenderEvent: function () { return _this.onElementRerendered; },
2011
+ getEnterOptions: function () {
2012
+ var className = _this.getExpandingCssClassName();
2013
+ return {
2014
+ cssClass: className,
2015
+ onBeforeRunAnimation: function (el) {
2016
+ beforeRunAnimation(el, className);
2017
+ },
2018
+ onAfterRunAnimation: function (el) {
2019
+ afterRunAnimation(el, className);
2020
+ },
2021
+ };
2022
+ },
2023
+ getLeaveOptions: function () {
2024
+ var className = _this.getCollapsingCssClassName();
2025
+ return {
2026
+ cssClass: className,
2027
+ onBeforeRunAnimation: function (el) {
2028
+ beforeRunAnimation(el, className);
2029
+ },
2030
+ onAfterRunAnimation: function (el) {
2031
+ afterRunAnimation(el, className);
2032
+ },
2033
+ };
2034
+ },
2035
+ getAnimatedElement: function () { return _this.getAnimatedElement(); },
2036
+ isAnimationEnabled: function () { return _this.animationAllowed; }
2037
+ };
2038
+ };
2039
+ Object.defineProperty(SurveyElementAdornerBase.prototype, "renderedCollapsed", {
2040
+ get: function () {
2041
+ return !!this._renderedCollapsed;
2042
+ },
2043
+ set: function (val) {
2044
+ if (this.animationAllowed)
2045
+ this.expandCollapseAnimationRunning = true;
2046
+ this.animationCollapsed.sync(!val);
2047
+ },
2048
+ enumerable: false,
2049
+ configurable: true
2050
+ });
1957
2051
  SurveyElementAdornerBase.prototype.createActionContainer = function () {
1958
2052
  var actionContainer = new SurveyElementActionContainer();
1959
2053
  actionContainer.dotsItem.iconSize = 16;
@@ -2024,7 +2118,9 @@ var SurveyElementAdornerBase = /** @class */ (function (_super) {
2024
2118
  };
2025
2119
  SurveyElementAdornerBase.prototype.dispose = function () {
2026
2120
  _super.prototype.dispose.call(this);
2121
+ this.rootElement = undefined;
2027
2122
  this.detachElement(this.surveyElement);
2123
+ this.creator.expandCollapseManager.remove(this);
2028
2124
  if (!this.actionContainer.isDisposed) {
2029
2125
  this.actionContainer.dispose();
2030
2126
  }
@@ -2042,9 +2138,12 @@ var SurveyElementAdornerBase = /** @class */ (function (_super) {
2042
2138
  return;
2043
2139
  this.updateElementAllowOptions(this.creator.getElementAllowOperations(this.surveyElement), this.isOperationsAllow());
2044
2140
  };
2141
+ SurveyElementAdornerBase.prototype.getAllowExpandCollapse = function (options) {
2142
+ return this.creator.expandCollapseButtonVisibility != "never" && (options.allowExpandCollapse == undefined || !!options.allowExpandCollapse);
2143
+ };
2045
2144
  SurveyElementAdornerBase.prototype.updateElementAllowOptions = function (options, operationsAllow) {
2046
2145
  this.allowDragging = operationsAllow && options.allowDragging;
2047
- this.allowExpandCollapse = this.creator.expandCollapseButtonVisibility != "never" && (options.allowExpandCollapse == undefined || !!options.allowExpandCollapse);
2146
+ this.allowExpandCollapse = this.getAllowExpandCollapse(options);
2048
2147
  this.allowEditOption = (options.allowEdit == undefined || !!options.allowEdit);
2049
2148
  this.updateActionVisibility("delete", operationsAllow && options.allowDelete);
2050
2149
  this.updateActionVisibility("duplicate", operationsAllow && options.allowCopy);
@@ -2146,9 +2245,15 @@ var SurveyElementAdornerBase = /** @class */ (function (_super) {
2146
2245
  SurveyElementAdornerBase.prototype.delete = function () {
2147
2246
  this.creator.deleteElement(this.surveyElement);
2148
2247
  };
2248
+ SurveyElementAdornerBase.prototype.getCss = function () {
2249
+ return new survey_core__WEBPACK_IMPORTED_MODULE_1__.CssClassBuilder().append("svc-hovered svc-hovered-ready", this.isHovered).toString();
2250
+ };
2149
2251
  (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
2150
2252
  (0,survey_core__WEBPACK_IMPORTED_MODULE_1__.property)({ defaultValue: true })
2151
2253
  ], SurveyElementAdornerBase.prototype, "allowDragging", void 0);
2254
+ (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
2255
+ (0,survey_core__WEBPACK_IMPORTED_MODULE_1__.property)({ defaultValue: false })
2256
+ ], SurveyElementAdornerBase.prototype, "expandCollapseAnimationRunning", void 0);
2152
2257
  (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
2153
2258
  (0,survey_core__WEBPACK_IMPORTED_MODULE_1__.property)({ defaultValue: true })
2154
2259
  ], SurveyElementAdornerBase.prototype, "allowExpandCollapse", void 0);
@@ -2168,7 +2273,13 @@ var SurveyElementAdornerBase = /** @class */ (function (_super) {
2168
2273
  ], SurveyElementAdornerBase.prototype, "collapsed", void 0);
2169
2274
  (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
2170
2275
  (0,survey_core__WEBPACK_IMPORTED_MODULE_1__.property)()
2171
- ], SurveyElementAdornerBase.prototype, "renderedCollapsed", void 0);
2276
+ ], SurveyElementAdornerBase.prototype, "_renderedCollapsed", void 0);
2277
+ (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
2278
+ (0,survey_core__WEBPACK_IMPORTED_MODULE_1__.property)()
2279
+ ], SurveyElementAdornerBase.prototype, "isAnimationRunningCollapsed", void 0);
2280
+ (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
2281
+ (0,survey_core__WEBPACK_IMPORTED_MODULE_1__.property)({ defaultValue: false })
2282
+ ], SurveyElementAdornerBase.prototype, "isHovered", void 0);
2172
2283
  return SurveyElementAdornerBase;
2173
2284
  }(survey_core__WEBPACK_IMPORTED_MODULE_1__.Base));
2174
2285
 
@@ -3477,11 +3588,9 @@ __webpack_require__.r(__webpack_exports__);
3477
3588
  /* harmony import */ var survey_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! survey-core */ "survey-core");
3478
3589
  /* harmony import */ var survey_core__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(survey_core__WEBPACK_IMPORTED_MODULE_1__);
3479
3590
  /* harmony import */ var _action_container_view_model__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./action-container-view-model */ "./src/components/action-container-view-model.ts");
3480
- /* harmony import */ var _utils_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/utils */ "./src/utils/utils.ts");
3481
- /* harmony import */ var _editorLocalization__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../editorLocalization */ "./src/editorLocalization.ts");
3482
- /* harmony import */ var _survey_helper__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../survey-helper */ "./src/survey-helper.ts");
3483
- /* harmony import */ var _creator_settings__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../creator-settings */ "./src/creator-settings.ts");
3484
-
3591
+ /* harmony import */ var _editorLocalization__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../editorLocalization */ "./src/editorLocalization.ts");
3592
+ /* harmony import */ var _survey_helper__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../survey-helper */ "./src/survey-helper.ts");
3593
+ /* harmony import */ var _creator_settings__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../creator-settings */ "./src/creator-settings.ts");
3485
3594
 
3486
3595
 
3487
3596
 
@@ -3499,7 +3608,7 @@ var PageAdorner = /** @class */ (function (_super) {
3499
3608
  if (_this.isGhost) {
3500
3609
  var addedPage = !!_this.creator.addPage(currentPage, selectCurrentPage, function () {
3501
3610
  currentPage.unRegisterFunctionOnPropertiesValueChanged(["title", "description"], "add_ghost");
3502
- currentPage.name = _survey_helper__WEBPACK_IMPORTED_MODULE_5__.SurveyHelper.getNewPageName(_this.creator.survey.pages);
3611
+ currentPage.name = _survey_helper__WEBPACK_IMPORTED_MODULE_4__.SurveyHelper.getNewPageName(_this.creator.survey.pages);
3503
3612
  return true;
3504
3613
  });
3505
3614
  if (addedPage) {
@@ -3514,7 +3623,7 @@ var PageAdorner = /** @class */ (function (_super) {
3514
3623
  _this.creator.addNewQuestionInPage(function (type) {
3515
3624
  _this.addGhostPage(false);
3516
3625
  _this.creator.survey.currentPage = _this.page;
3517
- }, null, type || _this.currentAddQuestionType || _creator_settings__WEBPACK_IMPORTED_MODULE_6__.settings.designer.defaultAddQuestionType);
3626
+ }, null, type || _this.currentAddQuestionType || _creator_settings__WEBPACK_IMPORTED_MODULE_5__.settings.designer.defaultAddQuestionType);
3518
3627
  };
3519
3628
  _this.actionContainer.sizeMode = "small";
3520
3629
  if (_this.isGhost)
@@ -3546,6 +3655,9 @@ var PageAdorner = /** @class */ (function (_super) {
3546
3655
  enumerable: false,
3547
3656
  configurable: true
3548
3657
  });
3658
+ PageAdorner.prototype.getAllowExpandCollapse = function (options) {
3659
+ return !this.isGhost && _super.prototype.getAllowExpandCollapse.call(this, options);
3660
+ };
3549
3661
  PageAdorner.prototype.attachElement = function (surveyElement) {
3550
3662
  var _this = this;
3551
3663
  _super.prototype.attachElement.call(this, surveyElement);
@@ -3593,8 +3705,8 @@ var PageAdorner = /** @class */ (function (_super) {
3593
3705
  if (isSelected && this.creator.pageEditMode === "bypage") {
3594
3706
  this.setSurveyElement(this.creator.selectedElement);
3595
3707
  }
3596
- if (isSelected && !!this.onPageSelectedCallback) {
3597
- this.onPageSelectedCallback();
3708
+ if (isSelected) {
3709
+ this.onPageSelected();
3598
3710
  }
3599
3711
  };
3600
3712
  PageAdorner.prototype.patchPageForDragDrop = function (page, addGhostPage) {
@@ -3624,8 +3736,8 @@ var PageAdorner = /** @class */ (function (_super) {
3624
3736
  Object.defineProperty(PageAdorner.prototype, "placeholderText", {
3625
3737
  get: function () {
3626
3738
  if (this.creator.isMobileView)
3627
- return (0,_editorLocalization__WEBPACK_IMPORTED_MODULE_4__.getLocString)("ed.pagePlaceHolderMobile");
3628
- return (0,_editorLocalization__WEBPACK_IMPORTED_MODULE_4__.getLocString)("ed.pagePlaceHolder");
3739
+ return (0,_editorLocalization__WEBPACK_IMPORTED_MODULE_3__.getLocString)("ed.pagePlaceHolderMobile");
3740
+ return (0,_editorLocalization__WEBPACK_IMPORTED_MODULE_3__.getLocString)("ed.pagePlaceHolder");
3629
3741
  },
3630
3742
  enumerable: false,
3631
3743
  configurable: true
@@ -3650,9 +3762,7 @@ var PageAdorner = /** @class */ (function (_super) {
3650
3762
  if (!model.isGhost) {
3651
3763
  if (model.creator.pageEditMode !== "single") {
3652
3764
  model.creator.selectElement(model.page, undefined, false);
3653
- if (!!this.onPageSelectedCallback) {
3654
- this.onPageSelectedCallback();
3655
- }
3765
+ this.onPageSelected();
3656
3766
  }
3657
3767
  else {
3658
3768
  model.creator.selectElement(model.creator.survey, undefined, false);
@@ -3663,7 +3773,7 @@ var PageAdorner = /** @class */ (function (_super) {
3663
3773
  };
3664
3774
  Object.defineProperty(PageAdorner.prototype, "css", {
3665
3775
  get: function () {
3666
- var result = "";
3776
+ var result = _super.prototype.getCss.call(this);
3667
3777
  if (!!this.dragTypeOverMe && this.showPlaceholder) {
3668
3778
  result = "svc-question__content--drag-over-inside";
3669
3779
  }
@@ -3680,23 +3790,24 @@ var PageAdorner = /** @class */ (function (_super) {
3680
3790
  else {
3681
3791
  this.dragOut();
3682
3792
  }
3793
+ if (this.allowExpandCollapse) {
3794
+ result += (" svc-page__content--collapse-" + this.creator.expandCollapseButtonVisibility);
3795
+ if (this.renderedCollapsed)
3796
+ result += (" svc-page__content--collapsed");
3797
+ if (this.expandCollapseAnimationRunning)
3798
+ result += (" svc-page__content--animation-running");
3799
+ }
3683
3800
  if (this.isGhost) {
3684
3801
  return result + " svc-page__content--new";
3685
3802
  }
3686
3803
  if (this.creator.isElementSelected(this.page)) {
3687
3804
  result += " svc-page__content--selected";
3688
3805
  }
3689
- result += (" svc-page__content--collapse-" + this.creator.expandCollapseButtonVisibility);
3690
- if (this.renderedCollapsed)
3691
- result += (" svc-page__content--collapsed");
3692
3806
  return result.trim();
3693
3807
  },
3694
3808
  enumerable: false,
3695
3809
  configurable: true
3696
3810
  });
3697
- PageAdorner.prototype.hover = function (event, element) {
3698
- (0,_utils_utils__WEBPACK_IMPORTED_MODULE_3__.toggleHovered)(event, element, this.creator.pageHoverDelay);
3699
- };
3700
3811
  PageAdorner.prototype.hoverStopper = function (event, element) {
3701
3812
  event["__svc_question_processed"] = true;
3702
3813
  };
@@ -3740,6 +3851,26 @@ var PageAdorner = /** @class */ (function (_super) {
3740
3851
  enumerable: false,
3741
3852
  configurable: true
3742
3853
  });
3854
+ PageAdorner.prototype.getAnimatedElement = function () {
3855
+ var _a;
3856
+ var cssClasses = this.surveyElement.cssClasses.page;
3857
+ if (cssClasses === null || cssClasses === void 0 ? void 0 : cssClasses.description) {
3858
+ return (_a = this.rootElement) === null || _a === void 0 ? void 0 : _a.querySelector(":scope ".concat((0,survey_core__WEBPACK_IMPORTED_MODULE_1__.classesToSelector)(cssClasses.description)));
3859
+ }
3860
+ return null;
3861
+ };
3862
+ PageAdorner.prototype.getInnerAnimatedElements = function () {
3863
+ var _a;
3864
+ var cssClasses = this.surveyElement.cssClasses;
3865
+ if (cssClasses.pageRow)
3866
+ return [].slice.call((_a = this.rootElement) === null || _a === void 0 ? void 0 : _a.querySelectorAll(":scope .svc-page__footer, :scope ".concat((0,survey_core__WEBPACK_IMPORTED_MODULE_1__.classesToSelector)(this.surveyElement.cssRoot), " > .svc-row")));
3867
+ return null;
3868
+ };
3869
+ PageAdorner.prototype.onPageSelected = function () {
3870
+ if (this.rootElement) {
3871
+ _survey_helper__WEBPACK_IMPORTED_MODULE_4__.SurveyHelper.scrollIntoViewIfNeeded(this.rootElement);
3872
+ }
3873
+ };
3743
3874
  (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
3744
3875
  (0,survey_core__WEBPACK_IMPORTED_MODULE_1__.property)({ defaultValue: false })
3745
3876
  ], PageAdorner.prototype, "isSelected", void 0);
@@ -3891,9 +4022,8 @@ __webpack_require__.r(__webpack_exports__);
3891
4022
  __webpack_require__(/*! ./question-image.scss */ "./src/components/question-image.scss");
3892
4023
  var QuestionImageAdornerViewModel = /** @class */ (function (_super) {
3893
4024
  (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(QuestionImageAdornerViewModel, _super);
3894
- function QuestionImageAdornerViewModel(creator, surveyElement, templateData, questionRoot) {
4025
+ function QuestionImageAdornerViewModel(creator, surveyElement, templateData) {
3895
4026
  var _this = _super.call(this, creator, surveyElement, templateData) || this;
3896
- _this.questionRoot = questionRoot;
3897
4027
  _this.imageLinkValueChangedHandler = function () {
3898
4028
  _this.isEmptyImageLink = !_this.question.imageLink;
3899
4029
  _this.filePresentationModel.value = null;
@@ -3930,7 +4060,7 @@ var QuestionImageAdornerViewModel = /** @class */ (function (_super) {
3930
4060
  });
3931
4061
  };
3932
4062
  QuestionImageAdornerViewModel.prototype.chooseFile = function (model) {
3933
- var fileInput = model.questionRoot.getElementsByClassName("svc-choose-file-input")[0];
4063
+ var fileInput = model.rootElement.getElementsByClassName("svc-choose-file-input")[0];
3934
4064
  var context = { element: model.question, elementType: model.question.getType(), propertyName: "imageLink" };
3935
4065
  model.creator.chooseFiles(fileInput, function (files) {
3936
4066
  model.isUploading = true;
@@ -3977,6 +4107,15 @@ var QuestionImageAdornerViewModel = /** @class */ (function (_super) {
3977
4107
  enumerable: false,
3978
4108
  configurable: true
3979
4109
  });
4110
+ QuestionImageAdornerViewModel.prototype.getAnimatedElement = function () {
4111
+ if (this.isEmptyImageLink) {
4112
+ var cssClasses = this.filePresentationModel.cssClasses;
4113
+ if (cssClasses.root) {
4114
+ return this.surveyElement.getWrapperElement().querySelector(":scope ".concat((0,survey_core__WEBPACK_IMPORTED_MODULE_1__.classesToSelector)(cssClasses.root)));
4115
+ }
4116
+ }
4117
+ return _super.prototype.getAnimatedElement.call(this);
4118
+ };
3980
4119
  QuestionImageAdornerViewModel.prototype.css = function () {
3981
4120
  return new survey_core__WEBPACK_IMPORTED_MODULE_1__.CssClassBuilder()
3982
4121
  .append(_super.prototype.css.call(this))
@@ -3986,7 +4125,6 @@ var QuestionImageAdornerViewModel = /** @class */ (function (_super) {
3986
4125
  this.surveyElement.unRegisterFunctionOnPropertyValueChanged("imageLink", "imageLinkValueChanged");
3987
4126
  this.surveyElement.locImageLink.onStringChanged.remove(this.imageLinkValueChangedHandler);
3988
4127
  _super.prototype.dispose.call(this);
3989
- this.questionRoot = undefined;
3990
4128
  };
3991
4129
  (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
3992
4130
  (0,survey_core__WEBPACK_IMPORTED_MODULE_1__.property)({ defaultValue: false })
@@ -4225,7 +4363,6 @@ __webpack_require__.r(__webpack_exports__);
4225
4363
  /* harmony import */ var _action_container_view_model__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./action-container-view-model */ "./src/components/action-container-view-model.ts");
4226
4364
  /* harmony import */ var _creator_settings__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../creator-settings */ "./src/creator-settings.ts");
4227
4365
  /* harmony import */ var _string_editor__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./string-editor */ "./src/components/string-editor.ts");
4228
- /* harmony import */ var _toolbox__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../toolbox */ "./src/toolbox.ts");
4229
4366
 
4230
4367
 
4231
4368
 
@@ -4235,7 +4372,6 @@ __webpack_require__.r(__webpack_exports__);
4235
4372
  __webpack_require__(/*! ./question.scss */ "./src/components/question.scss");
4236
4373
 
4237
4374
 
4238
-
4239
4375
  var QuestionAdornerViewModel = /** @class */ (function (_super) {
4240
4376
  (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(QuestionAdornerViewModel, _super);
4241
4377
  function QuestionAdornerViewModel(creator, surveyElement, templateData) {
@@ -4298,6 +4434,10 @@ var QuestionAdornerViewModel = /** @class */ (function (_super) {
4298
4434
  QuestionAdornerViewModel.prototype.rootCss = function () {
4299
4435
  var isStartWithNewLine = this.surveyElement.isQuestion && !this.surveyElement.startWithNewLine;
4300
4436
  return new survey_core__WEBPACK_IMPORTED_MODULE_1__.CssClassBuilder()
4437
+ .append(_super.prototype.getCss.call(this))
4438
+ .append("svc-question__adorner")
4439
+ .append("svc-question__adorner--selected", !!this.creator.isElementSelected(this.surveyElement))
4440
+ .append("svc-question__adorner--collapsed", this.renderedCollapsed)
4301
4441
  .append("svc-question__adorner--start-with-new-line", isStartWithNewLine)
4302
4442
  .append("svc-question__adorner--collapse-" + this.creator.expandCollapseButtonVisibility, true).toString();
4303
4443
  };
@@ -4318,6 +4458,12 @@ var QuestionAdornerViewModel = /** @class */ (function (_super) {
4318
4458
  if (this.renderedCollapsed) {
4319
4459
  result += " svc-question__content--collapsed";
4320
4460
  }
4461
+ if (!this.surveyElement.hasTitle || (!this.surveyElement.isPanel && this.surveyElement.getTitleLocation() === "hidden")) {
4462
+ result += " svc-question__content--title-hidden";
4463
+ }
4464
+ if (this.surveyElement.hasTitleOnBottom) {
4465
+ result += " svc-question__content--title-bottom";
4466
+ }
4321
4467
  if (this.isDragMe) {
4322
4468
  result += " svc-question__content--dragged";
4323
4469
  }
@@ -4350,6 +4496,41 @@ var QuestionAdornerViewModel = /** @class */ (function (_super) {
4350
4496
  }
4351
4497
  return result;
4352
4498
  };
4499
+ Object.defineProperty(QuestionAdornerViewModel.prototype, "isTitleLeft", {
4500
+ get: function () {
4501
+ return (!this.surveyElement.isPanel && this.surveyElement.getTitleLocation() === "left");
4502
+ },
4503
+ enumerable: false,
4504
+ configurable: true
4505
+ });
4506
+ QuestionAdornerViewModel.prototype.getAnimatedElement = function () {
4507
+ var _a, _b;
4508
+ var cssClasses = this.surveyElement.isPanel ? this.surveyElement.cssClasses.panel : this.surveyElement.cssClasses;
4509
+ var cssContent = cssClasses.content;
4510
+ if (this.surveyElement.isDescendantOf("rating")) {
4511
+ cssContent = "svc-rating-question-content";
4512
+ }
4513
+ if (this.isTitleLeft) {
4514
+ return (_a = this.rootElement) === null || _a === void 0 ? void 0 : _a.querySelector(":scope ".concat((0,survey_core__WEBPACK_IMPORTED_MODULE_1__.classesToSelector)(this.surveyElement.getRootCss())));
4515
+ }
4516
+ if (cssContent) {
4517
+ return (_b = this.rootElement) === null || _b === void 0 ? void 0 : _b.querySelector(":scope ".concat((0,survey_core__WEBPACK_IMPORTED_MODULE_1__.classesToSelector)(cssContent)));
4518
+ }
4519
+ return null;
4520
+ };
4521
+ QuestionAdornerViewModel.prototype.getInnerAnimatedElements = function () {
4522
+ var _a;
4523
+ var cssRoot = this.surveyElement.isPanel ? this.surveyElement.getContainerCss() : this.surveyElement.getRootCss();
4524
+ var cssDescription = this.surveyElement.cssDescription;
4525
+ var selectorArray = [
4526
+ ":scope > .svc-question__content > *:not(.svc-question__drag-area):not(".concat((0,survey_core__WEBPACK_IMPORTED_MODULE_1__.classesToSelector)(cssRoot), ")"),
4527
+ ];
4528
+ if (!this.isTitleLeft && cssDescription)
4529
+ selectorArray.push(":scope ".concat((0,survey_core__WEBPACK_IMPORTED_MODULE_1__.classesToSelector)(cssDescription)));
4530
+ var res = [].slice.call((_a = this.rootElement) === null || _a === void 0 ? void 0 : _a.querySelectorAll(selectorArray.join(",")));
4531
+ res.push(this.rootElement);
4532
+ return res;
4533
+ };
4353
4534
  QuestionAdornerViewModel.prototype.expandWithDragIn = function () {
4354
4535
  _super.prototype.expandWithDragIn.call(this);
4355
4536
  this.element.dragTypeOverMe = null;
@@ -4478,8 +4659,7 @@ var QuestionAdornerViewModel = /** @class */ (function (_super) {
4478
4659
  if (!this.surveyElement.isInteractiveDesignElement) {
4479
4660
  return;
4480
4661
  }
4481
- //this.updateActionsProperties();
4482
- (0,_utils_utils__WEBPACK_IMPORTED_MODULE_4__.toggleHovered)(event, element, this.creator.pageHoverDelay);
4662
+ _super.prototype.hover.call(this, event, element);
4483
4663
  };
4484
4664
  QuestionAdornerViewModel.prototype.updateActionsProperties = function () {
4485
4665
  if (this.isDisposed)
@@ -4534,7 +4714,7 @@ var QuestionAdornerViewModel = /** @class */ (function (_super) {
4534
4714
  });
4535
4715
  Object.defineProperty(QuestionAdornerViewModel.prototype, "showHiddenTitle", {
4536
4716
  get: function () {
4537
- return !this.element.hasTitle && this.element.isInteractiveDesignElement;
4717
+ return (!this.element.hasTitle || this.isTitleLeft) && this.element.isInteractiveDesignElement;
4538
4718
  },
4539
4719
  enumerable: false,
4540
4720
  configurable: true
@@ -4593,20 +4773,11 @@ var QuestionAdornerViewModel = /** @class */ (function (_super) {
4593
4773
  };
4594
4774
  QuestionAdornerViewModel.prototype.buildDefaultJsonMap = function (availableItems) {
4595
4775
  var defaultJsons = {};
4596
- function cleanDefaultsFromJson(type, toolboxItem) {
4597
- var question = survey_core__WEBPACK_IMPORTED_MODULE_1__.QuestionFactory.Instance.createQuestion(type, "question");
4598
- if (!question)
4599
- return toolboxItem.json;
4600
- question.fromJSON(toolboxItem.json);
4601
- var json = question.toJSON();
4602
- delete json.name;
4603
- return json;
4604
- }
4605
4776
  function addItemJson(toolboxItem) {
4606
4777
  var _a;
4607
4778
  var type = ((_a = toolboxItem.json) === null || _a === void 0 ? void 0 : _a.type) || toolboxItem.id;
4608
4779
  if (toolboxItem.json) {
4609
- var json = cleanDefaultsFromJson(type, toolboxItem);
4780
+ var json = toolboxItem.json;
4610
4781
  if (!defaultJsons[type])
4611
4782
  defaultJsons[type] = [];
4612
4783
  defaultJsons[type].push(json);
@@ -4620,38 +4791,42 @@ var QuestionAdornerViewModel = /** @class */ (function (_super) {
4620
4791
  });
4621
4792
  return defaultJsons;
4622
4793
  };
4623
- QuestionAdornerViewModel.prototype.getConvertToTypesActions = function (parentAction) {
4794
+ QuestionAdornerViewModel.prototype.convertQuestion = function (questionType, json, defaultJsons) {
4795
+ var _this = this;
4796
+ var type = (json === null || json === void 0 ? void 0 : json.type) || questionType;
4797
+ var newJson = {};
4798
+ (defaultJsons[type] || []).forEach(function (djson) {
4799
+ if (_this.jsonIsCorresponded(djson)) {
4800
+ newJson = (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__assign)({}, json);
4801
+ var objJson_1 = _this.element.toJSON();
4802
+ var cleanJson_1 = _this.cleanDefaultsFromJson(type, djson);
4803
+ Object.keys(djson).forEach(function (p) {
4804
+ if (p != "type" && !newJson[p])
4805
+ newJson[p] = undefined;
4806
+ });
4807
+ Object.keys(json || {}).forEach(function (p) {
4808
+ if (p != "type" && !(!objJson_1[p] || cleanJson_1[p]))
4809
+ newJson[p] = undefined;
4810
+ });
4811
+ }
4812
+ });
4813
+ this.creator.convertCurrentQuestion(type, newJson);
4814
+ };
4815
+ QuestionAdornerViewModel.prototype.getConvertToTypesActions = function () {
4624
4816
  var _this = this;
4625
4817
  var availableItems = this.getConvertToTypes();
4626
4818
  var defaultJsons = this.buildDefaultJsonMap(availableItems);
4627
- var res = [];
4819
+ var newItems = [];
4628
4820
  var lastItem = null;
4629
4821
  availableItems.forEach(function (item) {
4630
4822
  var needSeparator = lastItem && item.category != lastItem.category;
4631
4823
  var action = _this.creator.createIActionBarItemByClass(item, needSeparator, function (questionType, json) {
4632
- var type = (json === null || json === void 0 ? void 0 : json.type) || questionType;
4633
- var newJson = {};
4634
- (defaultJsons[type] || []).forEach(function (djson) {
4635
- if (_this.jsonIsCorresponded(djson)) {
4636
- newJson = (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__assign)({}, json);
4637
- var objJson_1 = _this.element.toJSON();
4638
- Object.keys(djson).forEach(function (p) {
4639
- if (p != "type" && !newJson[p])
4640
- newJson[p] = undefined;
4641
- });
4642
- Object.keys(json).forEach(function (p) {
4643
- if (p != "type" && !(!objJson_1[p] || djson[p]))
4644
- newJson[p] = undefined;
4645
- });
4646
- }
4647
- });
4648
- _this.creator.convertCurrentQuestion(type, newJson);
4649
- parentAction === null || parentAction === void 0 ? void 0 : parentAction.hidePopup();
4824
+ _this.convertQuestion(questionType, json, defaultJsons);
4650
4825
  });
4651
4826
  lastItem = item;
4652
- res.push(action);
4827
+ newItems.push(action);
4653
4828
  });
4654
- return res;
4829
+ return newItems;
4655
4830
  };
4656
4831
  Object.defineProperty(QuestionAdornerViewModel.prototype, "currentType", {
4657
4832
  get: function () {
@@ -4677,32 +4852,7 @@ var QuestionAdornerViewModel = /** @class */ (function (_super) {
4677
4852
  actionData: actionData,
4678
4853
  items: actions,
4679
4854
  updateListModel: function (listModel) {
4680
- var newItems = _this.getConvertToTypesActions(newAction);
4681
- listModel.setItems(newItems);
4682
- listModel.selectedItem = _this.getSelectedItem(newItems, _this.currentType);
4683
- newItems.forEach(function (action) {
4684
- var _a;
4685
- var toolboxItem = _this.creator.toolbox.getItemByName(action.id);
4686
- if (((_a = action.items) === null || _a === void 0 ? void 0 : _a.length) > 0) {
4687
- var selectedSubItem_1 = undefined;
4688
- action.items.forEach(function (item) {
4689
- var elementType = _this.element.getType();
4690
- var toolboxSubitem = toolboxItem.getSubitemByName(item.id);
4691
- var json = toolboxSubitem.json || {};
4692
- if (item.id == elementType || json.type == elementType) {
4693
- if (!listModel.selectedItem)
4694
- selectedSubItem_1 = item;
4695
- if (_this.jsonIsCorresponded(json))
4696
- selectedSubItem_1 = item;
4697
- }
4698
- });
4699
- if (selectedSubItem_1) {
4700
- var _listModel = action.popupModel.contentComponentData.model;
4701
- _listModel.selectedItem = selectedSubItem_1;
4702
- listModel.selectedItem = action;
4703
- }
4704
- }
4705
- });
4855
+ _this.updateQuestionTypeOrSubtypeListModel(listModel, false);
4706
4856
  }
4707
4857
  });
4708
4858
  newAction.iconName = new survey_core__WEBPACK_IMPORTED_MODULE_1__.ComputedUpdater(function () {
@@ -4718,61 +4868,127 @@ var QuestionAdornerViewModel = /** @class */ (function (_super) {
4718
4868
  newAction.disableHide = true;
4719
4869
  return newAction;
4720
4870
  };
4721
- QuestionAdornerViewModel.prototype.jsonIsCorresponded = function (json) {
4871
+ QuestionAdornerViewModel.prototype.jsonsAreCompatible = function (objJson, json) {
4872
+ var _this = this;
4722
4873
  var jsonIsCorresponded = true;
4723
- var objJson = this.element.toJSON();
4724
4874
  Object.keys(json).forEach(function (p) {
4725
- if (p != "type" && !survey_core__WEBPACK_IMPORTED_MODULE_1__.Helpers.isTwoValueEquals(json[p], objJson[p]))
4875
+ var propertyValue = objJson[p] === undefined ? _this.element.getDefaultPropertyValue(p) : objJson[p];
4876
+ if (p != "type" && !survey_core__WEBPACK_IMPORTED_MODULE_1__.Helpers.isTwoValueEquals(json[p], propertyValue))
4726
4877
  jsonIsCorresponded = false;
4727
4878
  });
4728
4879
  return jsonIsCorresponded;
4729
4880
  };
4881
+ QuestionAdornerViewModel.prototype.jsonIsCorresponded = function (json) {
4882
+ return this.jsonsAreCompatible(this.element.toJSON(), json);
4883
+ };
4884
+ QuestionAdornerViewModel.prototype.toolboxItemIsCorresponded = function (toolboxItem, someItemSelectedAlready) {
4885
+ var elementType = this.element.getType();
4886
+ var json = toolboxItem.json;
4887
+ if (toolboxItem.id == elementType || toolboxItem.json.type == elementType) {
4888
+ return !someItemSelectedAlready || this.jsonIsCorresponded(json);
4889
+ }
4890
+ };
4891
+ QuestionAdornerViewModel.prototype.cleanDefaultsFromJson = function (type, toolboxItemJson) {
4892
+ var question = survey_core__WEBPACK_IMPORTED_MODULE_1__.QuestionFactory.Instance.createQuestion(type, "question");
4893
+ if (!question)
4894
+ return toolboxItemJson;
4895
+ question.fromJSON(toolboxItemJson);
4896
+ var json = question.toJSON();
4897
+ json["type"] = type;
4898
+ delete json.name;
4899
+ return json;
4900
+ };
4901
+ QuestionAdornerViewModel.prototype.updateQuestionTypeOrSubtypeListModel = function (listModel, subtypeOnly) {
4902
+ var _this = this;
4903
+ var _a;
4904
+ var availableItems = this.getConvertToTypes();
4905
+ var defaultJsons = this.buildDefaultJsonMap(availableItems);
4906
+ var newItems = [];
4907
+ var lastItem;
4908
+ var selectedAction;
4909
+ var selectedSubaction = undefined;
4910
+ var selectedSubactions = undefined;
4911
+ availableItems.forEach(function (item) {
4912
+ var _a;
4913
+ var needSeparator = lastItem && item.category != lastItem.category;
4914
+ var action = _this.creator.createIActionBarItemByClass(item, needSeparator, function (questionType, json) { _this.convertQuestion(questionType, json, defaultJsons); });
4915
+ if (_this.toolboxItemIsCorresponded(item, !!selectedAction)) {
4916
+ selectedAction = action;
4917
+ selectedSubactions = item.items;
4918
+ }
4919
+ if (((_a = item.items) === null || _a === void 0 ? void 0 : _a.length) > 0 && _this.creator.toolbox.showSubitems) {
4920
+ var subactions_1 = [];
4921
+ var selectedSubactionLocal_1 = undefined;
4922
+ var allChildsAreCompatibleToParent_1 = false;
4923
+ item.items.forEach(function (subitem) {
4924
+ var subaction = _this.creator.createIActionBarItemByClass(subitem, false, function (questionType, json) { _this.convertQuestion(questionType, json, defaultJsons); });
4925
+ if (_this.toolboxItemIsCorresponded(subitem, !!selectedAction))
4926
+ selectedSubactionLocal_1 = subitem;
4927
+ if (_this.jsonsAreCompatible(item.json, subitem.json))
4928
+ allChildsAreCompatibleToParent_1 = true;
4929
+ subactions_1.push(subaction);
4930
+ });
4931
+ if (!allChildsAreCompatibleToParent_1 && subactions_1.length > 0) {
4932
+ var defaultSubaction = _this.creator.createIActionBarItemByClass(item, false, function (questionType, json) { _this.convertQuestion(questionType, json, defaultJsons); });
4933
+ defaultSubaction.id = action.id + "-default";
4934
+ defaultSubaction.iconName = undefined;
4935
+ defaultSubaction.markerIconName = undefined;
4936
+ defaultSubaction.items = [];
4937
+ defaultSubaction.component = undefined;
4938
+ subactions_1.unshift(defaultSubaction);
4939
+ if (selectedAction == action && !selectedSubactionLocal_1)
4940
+ selectedSubactionLocal_1 = defaultSubaction;
4941
+ }
4942
+ action.setSubItems({ items: subactions_1 });
4943
+ if (selectedSubactionLocal_1) {
4944
+ selectedAction = action;
4945
+ selectedSubaction = selectedSubactionLocal_1;
4946
+ selectedSubactions = subactions_1;
4947
+ }
4948
+ }
4949
+ lastItem = item;
4950
+ newItems.push(action);
4951
+ });
4952
+ if (subtypeOnly) {
4953
+ if (selectedSubactions) {
4954
+ listModel.setItems(selectedSubactions);
4955
+ listModel.selectedItem = selectedSubaction;
4956
+ return !!selectedSubactions;
4957
+ }
4958
+ }
4959
+ else {
4960
+ var _listModel = (_a = selectedAction === null || selectedAction === void 0 ? void 0 : selectedAction.popupModel) === null || _a === void 0 ? void 0 : _a.contentComponentData.model;
4961
+ if (_listModel)
4962
+ _listModel.selectedItem = selectedSubaction;
4963
+ listModel.setItems(newItems);
4964
+ listModel.selectedItem = selectedAction;
4965
+ }
4966
+ };
4730
4967
  QuestionAdornerViewModel.prototype.createConvertInputType = function () {
4731
4968
  var _this = this;
4732
- var questionType = this.surveyElement.getType();
4733
- if (questionType !== "text" && questionType !== "rating")
4734
- return null;
4735
- var toolboxItem = this.creator.toolbox.items.filter(function (item) { return item.id === questionType; })[0];
4736
- if (!toolboxItem || !toolboxItem.hasSubItems)
4969
+ var listModel = new survey_core__WEBPACK_IMPORTED_MODULE_1__.ListModel([]);
4970
+ this.updateQuestionTypeOrSubtypeListModel(listModel, true);
4971
+ if (listModel.actions.length == 0)
4737
4972
  return null;
4738
- var propName = _toolbox__WEBPACK_IMPORTED_MODULE_8__.QuestionToolbox.getSubTypePropertyName(questionType);
4739
- var questionSubType = this.surveyElement.getPropertyValue(propName);
4740
- var getAvailableTypes = function () {
4741
- return toolboxItem.items.map(function (item) {
4742
- return {
4743
- id: item.id,
4744
- title: item.title,
4745
- action: function (item) {
4746
- var newValue = _this.getUpdatedPropertyValue(propName, item.id);
4747
- _this.surveyElement.setPropertyValue(propName, newValue);
4748
- }
4749
- };
4750
- });
4751
- };
4752
4973
  var actionData = {
4753
4974
  id: "convertInputType",
4754
4975
  visibleIndex: 1,
4755
- title: _editorLocalization__WEBPACK_IMPORTED_MODULE_2__.editorLocalization.getPropertyValueInEditor(propName, questionSubType),
4976
+ title: "SUBTYPE",
4756
4977
  disableShrink: true,
4757
4978
  iconName: "icon-chevron_16x16"
4758
4979
  };
4759
4980
  var newAction = this.createDropdownModel({
4760
4981
  actionData: actionData,
4761
- items: getAvailableTypes(),
4982
+ items: [],
4762
4983
  updateListModel: function (listModel) {
4763
- var newItems = getAvailableTypes();
4764
- listModel.setItems(newItems);
4765
- listModel.selectedItem = _this.getSelectedItem(newItems, _this.surveyElement.getPropertyValue(propName));
4984
+ _this.updateQuestionTypeOrSubtypeListModel(listModel, true);
4766
4985
  }
4767
4986
  });
4768
- this.surveyElement.registerFunctionOnPropertyValueChanged(propName, function () {
4769
- var item = _this.getSelectedItem(getAvailableTypes(), _this.surveyElement.getPropertyValue(propName));
4770
- if (!item)
4771
- return;
4987
+ this.surveyElement.registerFunctionOnPropertiesValueChanged(["inputType", "rateType"], function () {
4772
4988
  var popup = newAction.popupModel;
4773
4989
  var list = popup.contentComponentData.model;
4774
- list.selectedItem = item;
4775
- newAction.title = item.title;
4990
+ _this.updateQuestionTypeOrSubtypeListModel(list, true);
4991
+ newAction.title = list.selectedItem.title;
4776
4992
  }, "inputTypeAdorner");
4777
4993
  newAction.removePriority = 1;
4778
4994
  return newAction;
@@ -4804,6 +5020,10 @@ var QuestionAdornerViewModel = /** @class */ (function (_super) {
4804
5020
  options.updateListModel(listModel);
4805
5021
  },
4806
5022
  });
5023
+ var listModel = newAction.popupModel.contentComponentData.model;
5024
+ options.updateListModel(listModel);
5025
+ if (listModel.selectedItem)
5026
+ newAction.title = listModel.selectedItem.title;
4807
5027
  newAction.popupModel.displayMode = this.creator.isTouch ? "overlay" : "popup";
4808
5028
  newAction.data.locOwner = this.creator;
4809
5029
  return newAction;
@@ -5612,8 +5832,9 @@ __webpack_require__.r(__webpack_exports__);
5612
5832
  __webpack_require__(/*! ./simulator.scss */ "./src/components/simulator.scss");
5613
5833
  var SurveySimulatorModel = /** @class */ (function (_super) {
5614
5834
  (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(SurveySimulatorModel, _super);
5615
- function SurveySimulatorModel() {
5835
+ function SurveySimulatorModel(surveyProvider) {
5616
5836
  var _this_1 = _super.call(this) || this;
5837
+ _this_1.surveyProvider = surveyProvider;
5617
5838
  _this_1.activateZoom = function () {
5618
5839
  document.addEventListener("keydown", _this_1.listenTryToZoom);
5619
5840
  document.addEventListener("wheel", _this_1.listenTryToZoomWithWheel, { passive: false });
@@ -5656,8 +5877,11 @@ var SurveySimulatorModel = /** @class */ (function (_super) {
5656
5877
  // }
5657
5878
  }
5658
5879
  SurveySimulatorModel.prototype.surveyChanged = function () {
5880
+ var _this_1 = this;
5659
5881
  var _this = this;
5660
5882
  this.survey.onOpenDropdownMenu.add(function (_, options) {
5883
+ if (_this_1.surveyProvider.isTouch)
5884
+ return;
5661
5885
  var device = simulatorDevices[_this.activeDevice];
5662
5886
  options.menuType = device.deviceType === "desktop" ? "dropdown" : (device.deviceType == "tablet" ? "popup" : "overlay");
5663
5887
  });
@@ -7316,6 +7540,24 @@ var TabDesignerViewModel = /** @class */ (function (_super) {
7316
7540
  enumerable: false,
7317
7541
  configurable: true
7318
7542
  });
7543
+ Object.defineProperty(TabDesignerViewModel.prototype, "placeholderTitleText", {
7544
+ get: function () {
7545
+ if (this.creator.isMobileView)
7546
+ return (0,_editorLocalization__WEBPACK_IMPORTED_MODULE_2__.getLocString)("ed.surveyPlaceholderTitleMobile");
7547
+ return (0,_editorLocalization__WEBPACK_IMPORTED_MODULE_2__.getLocString)("ed.surveyPlaceholderTitle");
7548
+ },
7549
+ enumerable: false,
7550
+ configurable: true
7551
+ });
7552
+ Object.defineProperty(TabDesignerViewModel.prototype, "placeholderDescriptionText", {
7553
+ get: function () {
7554
+ if (this.creator.isMobileView)
7555
+ return (0,_editorLocalization__WEBPACK_IMPORTED_MODULE_2__.getLocString)("ed.surveyPlaceholderDescriptionMobile");
7556
+ return (0,_editorLocalization__WEBPACK_IMPORTED_MODULE_2__.getLocString)("ed.surveyPlaceholderDescription");
7557
+ },
7558
+ enumerable: false,
7559
+ configurable: true
7560
+ });
7319
7561
  Object.defineProperty(TabDesignerViewModel.prototype, "hasToolbar", {
7320
7562
  get: function () {
7321
7563
  return this.creator.expandCollapseButtonVisibility != "never";
@@ -11700,6 +11942,24 @@ var SurveyLogicUI = /** @class */ (function (_super) {
11700
11942
  enumerable: false,
11701
11943
  configurable: true
11702
11944
  });
11945
+ Object.defineProperty(SurveyLogicUI.prototype, "placeholderTitleText", {
11946
+ get: function () {
11947
+ if (this.options.isMobileView)
11948
+ return (0,_logic_types__WEBPACK_IMPORTED_MODULE_5__.getLogicString)("logicPlaceholderTitleMobile");
11949
+ return (0,_logic_types__WEBPACK_IMPORTED_MODULE_5__.getLogicString)("logicPlaceholderTitle");
11950
+ },
11951
+ enumerable: false,
11952
+ configurable: true
11953
+ });
11954
+ Object.defineProperty(SurveyLogicUI.prototype, "placeholderDescriptionText", {
11955
+ get: function () {
11956
+ if (this.options.isMobileView)
11957
+ return (0,_logic_types__WEBPACK_IMPORTED_MODULE_5__.getLogicString)("logicPlaceholderDescriptionMobile");
11958
+ return (0,_logic_types__WEBPACK_IMPORTED_MODULE_5__.getLogicString)("logicPlaceholderDescription");
11959
+ },
11960
+ enumerable: false,
11961
+ configurable: true
11962
+ });
11703
11963
  (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
11704
11964
  (0,survey_core__WEBPACK_IMPORTED_MODULE_1__.property)()
11705
11965
  ], SurveyLogicUI.prototype, "itemsSurveyValue", void 0);
@@ -12271,7 +12531,7 @@ var PreviewViewModel = /** @class */ (function (_super) {
12271
12531
  _this.startThemeClasses = startThemeClasses;
12272
12532
  _this.enableInvisiblePages = true;
12273
12533
  _this.pages = new survey_core__WEBPACK_IMPORTED_MODULE_2__.ActionContainer();
12274
- _this.simulator = new _simulator__WEBPACK_IMPORTED_MODULE_1__.SurveySimulatorModel();
12534
+ _this.simulator = new _simulator__WEBPACK_IMPORTED_MODULE_1__.SurveySimulatorModel(surveyProvider);
12275
12535
  return _this;
12276
12536
  }
12277
12537
  Object.defineProperty(PreviewViewModel.prototype, "activeLanguage", {
@@ -12574,6 +12834,24 @@ var PreviewViewModel = /** @class */ (function (_super) {
12574
12834
  var isNextEnabled = this.survey && this.survey.visiblePages.indexOf(this.activePage) !== this.survey.visiblePages.length - 1;
12575
12835
  this.nextPageAction.enabled = isNextEnabled;
12576
12836
  };
12837
+ Object.defineProperty(PreviewViewModel.prototype, "placeholderTitleText", {
12838
+ get: function () {
12839
+ if (this.isMobileView)
12840
+ return (0,_editorLocalization__WEBPACK_IMPORTED_MODULE_3__.getLocString)("ed.previewPlaceholderTitleMobile");
12841
+ return (0,_editorLocalization__WEBPACK_IMPORTED_MODULE_3__.getLocString)("ed.previewPlaceholderTitle");
12842
+ },
12843
+ enumerable: false,
12844
+ configurable: true
12845
+ });
12846
+ Object.defineProperty(PreviewViewModel.prototype, "placeholderDescriptionText", {
12847
+ get: function () {
12848
+ if (this.isMobileView)
12849
+ return (0,_editorLocalization__WEBPACK_IMPORTED_MODULE_3__.getLocString)("ed.previewPlaceholderDescriptionMobile");
12850
+ return (0,_editorLocalization__WEBPACK_IMPORTED_MODULE_3__.getLocString)("ed.previewPlaceholderDescription");
12851
+ },
12852
+ enumerable: false,
12853
+ configurable: true
12854
+ });
12577
12855
  PreviewViewModel.prototype.onScroll = function () {
12578
12856
  this.survey.onScroll();
12579
12857
  return true;
@@ -12790,7 +13068,7 @@ var TabTestPlugin = /** @class */ (function () {
12790
13068
  iconName: "icon-device-desktop",
12791
13069
  mode: "small",
12792
13070
  visible: new survey_core__WEBPACK_IMPORTED_MODULE_1__.ComputedUpdater(function () {
12793
- return (0,_utils_utils__WEBPACK_IMPORTED_MODULE_0__.notShortCircuitAnd)(_this.creator.activeTab === "test", _this.creator.showSimulatorInTestSurveyTab);
13071
+ return (0,_utils_utils__WEBPACK_IMPORTED_MODULE_0__.notShortCircuitAnd)(_this.creator.activeTab === "test", _this.creator.showSimulatorInTestSurveyTab, !_this.creator.isTouch);
12794
13072
  }),
12795
13073
  }, {
12796
13074
  items: deviceSelectorItems,
@@ -12807,7 +13085,7 @@ var TabTestPlugin = /** @class */ (function () {
12807
13085
  iconName: "icon-device-rotate",
12808
13086
  mode: "small",
12809
13087
  visible: new survey_core__WEBPACK_IMPORTED_MODULE_1__.ComputedUpdater(function () {
12810
- return (0,_utils_utils__WEBPACK_IMPORTED_MODULE_0__.notShortCircuitAnd)(_this.creator.activeTab === "test", _this.creator.showSimulatorInTestSurveyTab);
13088
+ return (0,_utils_utils__WEBPACK_IMPORTED_MODULE_0__.notShortCircuitAnd)(_this.creator.activeTab === "test", _this.creator.showSimulatorInTestSurveyTab, !_this.creator.isTouch);
12811
13089
  }),
12812
13090
  action: function () {
12813
13091
  _this.model.simulator.landscape = !_this.model.simulator.landscape;
@@ -13460,6 +13738,7 @@ __webpack_require__.r(__webpack_exports__);
13460
13738
  /* harmony export */ createBoxShadow: () => (/* binding */ createBoxShadow),
13461
13739
  /* harmony export */ createBoxShadowReset: () => (/* binding */ createBoxShadowReset),
13462
13740
  /* harmony export */ parseBoxShadow: () => (/* binding */ parseBoxShadow),
13741
+ /* harmony export */ trimBoxShadowValue: () => (/* binding */ trimBoxShadowValue),
13463
13742
  /* harmony export */ updateShadowEffectsJSON: () => (/* binding */ updateShadowEffectsJSON)
13464
13743
  /* harmony export */ });
13465
13744
  /* harmony import */ var _editorLocalization__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../editorLocalization */ "./src/editorLocalization.ts");
@@ -13534,7 +13813,16 @@ if (!survey_core__WEBPACK_IMPORTED_MODULE_1__.ComponentCollection.Instance.getCu
13534
13813
  return [{}];
13535
13814
  return typeof value == "string" ? parseBoxShadow(value) : value;
13536
13815
  };
13537
- question.valueToDataCallback = function (value) { return !!value ? (typeof value == "string" ? value : createBoxShadow(Array.isArray(value) ? value : [value])) : ""; };
13816
+ question.valueToDataCallback = function (value) {
13817
+ if (!value)
13818
+ return "";
13819
+ if (typeof value == "string") {
13820
+ return value;
13821
+ }
13822
+ else {
13823
+ return createBoxShadow(Array.isArray(value) ? value : [value]);
13824
+ }
13825
+ };
13538
13826
  question.contentQuestion.panels.forEach(function (p) { return p.questions.forEach(function (q) { return q.allowRootStyle = false; }); });
13539
13827
  },
13540
13828
  });
@@ -13585,6 +13873,11 @@ function parseBoxShadow(value) {
13585
13873
  return res;
13586
13874
  });
13587
13875
  }
13876
+ function trimBoxShadowValue(value) {
13877
+ if (!value)
13878
+ return value;
13879
+ return value.replace(/\)\,\s/g, "),");
13880
+ }
13588
13881
 
13589
13882
 
13590
13883
  /***/ }),
@@ -14515,6 +14808,9 @@ survey_core__WEBPACK_IMPORTED_MODULE_1__.Serializer.addProperties("theme", [{
14515
14808
  }, {
14516
14809
  type: "shadoweffects",
14517
14810
  name: "--sjs-shadow-small",
14811
+ onSetValue: function (obj, value) {
14812
+ obj.setPropertyValue("--sjs-shadow-small", (0,_theme_custom_questions_shadow_effects__WEBPACK_IMPORTED_MODULE_7__.trimBoxShadowValue)(value));
14813
+ },
14518
14814
  }, {
14519
14815
  type: "font",
14520
14816
  name: "questionTitle",
@@ -14535,6 +14831,9 @@ survey_core__WEBPACK_IMPORTED_MODULE_1__.Serializer.addProperties("theme", [{
14535
14831
  {
14536
14832
  type: "shadoweffects",
14537
14833
  name: "--sjs-shadow-inner",
14834
+ onSetValue: function (obj, value) {
14835
+ obj.setPropertyValue("--sjs-shadow-inner", (0,_theme_custom_questions_shadow_effects__WEBPACK_IMPORTED_MODULE_7__.trimBoxShadowValue)(value));
14836
+ },
14538
14837
  }, {
14539
14838
  type: "font",
14540
14839
  name: "editorFont",
@@ -14577,10 +14876,34 @@ survey_core__WEBPACK_IMPORTED_MODULE_1__.Serializer.addProperties("theme", [{
14577
14876
  { name: "--sjs-secondary-backcolor-semi-light", visible: false },
14578
14877
  { name: "--sjs-secondary-forecolor", visible: false },
14579
14878
  { name: "--sjs-secondary-forecolor-light", visible: false },
14580
- { name: "--sjs-shadow-small-reset", visible: false },
14581
- { name: "--sjs-shadow-medium", visible: false },
14582
- { name: "--sjs-shadow-large", visible: false },
14583
- { name: "--sjs-shadow-inner-reset", visible: false },
14879
+ {
14880
+ name: "--sjs-shadow-small-reset",
14881
+ visible: false,
14882
+ onSetValue: function (obj, value) {
14883
+ obj.setPropertyValue("--sjs-shadow-small-reset", (0,_theme_custom_questions_shadow_effects__WEBPACK_IMPORTED_MODULE_7__.trimBoxShadowValue)(value));
14884
+ },
14885
+ },
14886
+ {
14887
+ name: "--sjs-shadow-medium",
14888
+ visible: false,
14889
+ onSetValue: function (obj, value) {
14890
+ obj.setPropertyValue("--sjs-shadow-medium", (0,_theme_custom_questions_shadow_effects__WEBPACK_IMPORTED_MODULE_7__.trimBoxShadowValue)(value));
14891
+ },
14892
+ },
14893
+ {
14894
+ name: "--sjs-shadow-large",
14895
+ visible: false,
14896
+ onSetValue: function (obj, value) {
14897
+ obj.setPropertyValue("--sjs-shadow-large", (0,_theme_custom_questions_shadow_effects__WEBPACK_IMPORTED_MODULE_7__.trimBoxShadowValue)(value));
14898
+ },
14899
+ },
14900
+ {
14901
+ name: "--sjs-shadow-inner-reset",
14902
+ visible: false,
14903
+ onSetValue: function (obj, value) {
14904
+ obj.setPropertyValue("--sjs-shadow-inner-reset", (0,_theme_custom_questions_shadow_effects__WEBPACK_IMPORTED_MODULE_7__.trimBoxShadowValue)(value));
14905
+ },
14906
+ },
14584
14907
  { name: "--sjs-border-light", visible: false },
14585
14908
  { name: "--sjs-border-default", visible: false },
14586
14909
  { name: "--sjs-border-inside", visible: false },
@@ -16800,7 +17123,7 @@ var TranslationGroup = /** @class */ (function (_super) {
16800
17123
  matrix.rows.forEach(function (row) { return rows.push({ value: row.value, text: row.text }); });
16801
17124
  rows.forEach(function (row) {
16802
17125
  matrix.columns.forEach(function (col) {
16803
- var locStr = cells.getCellLocText(row.value, col);
17126
+ var locStr = cells.getCellDisplayLocText(row.value, col);
16804
17127
  if (!!locStr) {
16805
17128
  var name_1 = _editorLocalization__WEBPACK_IMPORTED_MODULE_3__.editorLocalization.getPropertyName(row.text, "") + ", " + _editorLocalization__WEBPACK_IMPORTED_MODULE_3__.editorLocalization.getPropertyName(col.title);
16806
17129
  var item = new TranslationItem(name_1, locStr, "", _this.translation, locStr);
@@ -17545,6 +17868,24 @@ var Translation = /** @class */ (function (_super) {
17545
17868
  enumerable: false,
17546
17869
  configurable: true
17547
17870
  });
17871
+ Object.defineProperty(Translation.prototype, "placeholderTitleText", {
17872
+ get: function () {
17873
+ if (this.options.isMobileView)
17874
+ return (0,_editorLocalization__WEBPACK_IMPORTED_MODULE_3__.getLocString)("ed.translationsPlaceholderTitleMobile");
17875
+ return (0,_editorLocalization__WEBPACK_IMPORTED_MODULE_3__.getLocString)("ed.translationsPlaceholderTitle");
17876
+ },
17877
+ enumerable: false,
17878
+ configurable: true
17879
+ });
17880
+ Object.defineProperty(Translation.prototype, "placeholderDescriptionText", {
17881
+ get: function () {
17882
+ if (this.options.isMobileView)
17883
+ return (0,_editorLocalization__WEBPACK_IMPORTED_MODULE_3__.getLocString)("ed.translationsPlaceholderDescriptionMobile");
17884
+ return (0,_editorLocalization__WEBPACK_IMPORTED_MODULE_3__.getLocString)("ed.translationsPlaceholderDescription");
17885
+ },
17886
+ enumerable: false,
17887
+ configurable: true
17888
+ });
17548
17889
  Translation.prototype.exportToCSV = function () {
17549
17890
  if (!this.root) {
17550
17891
  this.reset();
@@ -18229,7 +18570,9 @@ __webpack_require__.r(__webpack_exports__);
18229
18570
  /* harmony import */ var _components_string_editor__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./components/string-editor */ "./src/components/string-editor.ts");
18230
18571
  /* harmony import */ var _components_tabs_theme_plugin__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./components/tabs/theme-plugin */ "./src/components/tabs/theme-plugin.ts");
18231
18572
  /* harmony import */ var _survey_elements__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./survey-elements */ "./src/survey-elements.ts");
18232
- /* harmony import */ var _designTabSurveyThemeJSON__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./designTabSurveyThemeJSON */ "./src/designTabSurveyThemeJSON.ts");
18573
+ /* harmony import */ var _expand_collapse_manager__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./expand-collapse-manager */ "./src/expand-collapse-manager.ts");
18574
+ /* harmony import */ var _designTabSurveyThemeJSON__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./designTabSurveyThemeJSON */ "./src/designTabSurveyThemeJSON.ts");
18575
+
18233
18576
 
18234
18577
 
18235
18578
 
@@ -18868,6 +19211,7 @@ var SurveyCreatorModel = /** @class */ (function (_super) {
18868
19211
  _this.animationEnabled = false;
18869
19212
  _this.onStateChanged = _this.addCreatorEvent();
18870
19213
  _this.onSurfaceToolbarActionExecuted = _this.addCreatorEvent();
19214
+ _this.expandCollapseManager = new _expand_collapse_manager__WEBPACK_IMPORTED_MODULE_25__.ExpandCollapseManager(_this);
18871
19215
  _this.notifier = new survey_core__WEBPACK_IMPORTED_MODULE_1__.Notifier({
18872
19216
  root: "svc-notifier",
18873
19217
  rootWithButtons: "",
@@ -20093,6 +20437,7 @@ var SurveyCreatorModel = /** @class */ (function (_super) {
20093
20437
  }
20094
20438
  this.existingPages = {};
20095
20439
  var survey = this.createSurvey({}, "designer", undefined, function (survey) {
20440
+ survey.skeletonHeight = 188;
20096
20441
  survey.css = survey_core__WEBPACK_IMPORTED_MODULE_1__.defaultV2Css;
20097
20442
  survey.setIsMobile(!!_this.isMobileView);
20098
20443
  survey.setDesignMode(true);
@@ -20408,7 +20753,7 @@ var SurveyCreatorModel = /** @class */ (function (_super) {
20408
20753
  });
20409
20754
  Object.defineProperty(SurveyCreatorModel.prototype, "designTabSurveyThemeVariables", {
20410
20755
  get: function () {
20411
- return _designTabSurveyThemeJSON__WEBPACK_IMPORTED_MODULE_25__["default"].cssVariables;
20756
+ return _designTabSurveyThemeJSON__WEBPACK_IMPORTED_MODULE_26__["default"].cssVariables;
20412
20757
  },
20413
20758
  enumerable: false,
20414
20759
  configurable: true
@@ -20439,7 +20784,7 @@ var SurveyCreatorModel = /** @class */ (function (_super) {
20439
20784
  var survey = this.createSurveyCore(json, reason);
20440
20785
  if (reason !== "designer" && reason !== "test" && reason !== "theme") {
20441
20786
  survey.fitToContainer = false;
20442
- survey.applyTheme(_designTabSurveyThemeJSON__WEBPACK_IMPORTED_MODULE_25__["default"]);
20787
+ survey.applyTheme(_designTabSurveyThemeJSON__WEBPACK_IMPORTED_MODULE_26__["default"]);
20443
20788
  survey.gridLayoutEnabled = false;
20444
20789
  }
20445
20790
  if (reason === "designer" || reason === "modal-question-editor") {
@@ -20999,19 +21344,26 @@ var SurveyCreatorModel = /** @class */ (function (_super) {
20999
21344
  return;
21000
21345
  clearInterval(this.currentFocusInterval);
21001
21346
  clearTimeout(this.currentFocusTimeout);
21002
- if (this.animationEnabled && this.survey.isLazyRendering) {
21003
- this.survey.disableLazyRenderingBeforeElement(selEl);
21004
- }
21005
21347
  this.currentFocusTimeout = setTimeout(function () {
21006
21348
  _this.currentFocusInterval = setInterval(function () {
21007
- var _a;
21349
+ var _a, _b;
21008
21350
  var el = document.getElementById(selEl.id);
21009
21351
  if (!!selEl && (focus || startEdit && (!selEl.hasTitle || selEl.isPanel))) {
21010
21352
  if (!el || _this.rootElement.getAnimations({ subtree: true }).filter((function (animation) { return animation.effect.getComputedTiming().activeDuration !== Infinity && (animation.pending || animation.playState !== "finished"); }))[0])
21011
21353
  return;
21012
21354
  clearInterval(_this.currentFocusInterval);
21013
21355
  if (!!el) {
21014
- _survey_helper__WEBPACK_IMPORTED_MODULE_9__.SurveyHelper.scrollIntoViewIfNeeded((_a = el.parentElement) !== null && _a !== void 0 ? _a : el, function () { return { block: "start", behavior: _this.animationEnabled ? "smooth" : undefined }; }, true);
21356
+ var isNeedScroll = _survey_helper__WEBPACK_IMPORTED_MODULE_9__.SurveyHelper.isNeedScrollIntoView((_a = el.parentElement) !== null && _a !== void 0 ? _a : el, true);
21357
+ if (!!isNeedScroll) {
21358
+ var elementPage = _this.getPageByElement(selEl);
21359
+ var scrollIntoViewOptions_1 = { block: "start", behavior: _this.animationEnabled ? "smooth" : undefined };
21360
+ if (!!elementPage) {
21361
+ _this.survey.scrollElementToTop(selEl, undefined, elementPage, selEl.id, true, scrollIntoViewOptions_1, _this.rootElement);
21362
+ }
21363
+ else {
21364
+ _survey_helper__WEBPACK_IMPORTED_MODULE_9__.SurveyHelper.scrollIntoViewIfNeeded((_b = el.parentElement) !== null && _b !== void 0 ? _b : el, function () { return scrollIntoViewOptions_1; }, true);
21365
+ }
21366
+ }
21015
21367
  if (!propertyName && el.parentElement) {
21016
21368
  var elToFocus = (typeof (focus) === "string") ? el.parentElement.querySelector(focus) : el.parentElement;
21017
21369
  elToFocus && elToFocus.focus({ preventScroll: true });
@@ -24196,6 +24548,46 @@ var __spreadArray = function (to, from) {
24196
24548
  };
24197
24549
 
24198
24550
 
24551
+ /***/ }),
24552
+
24553
+ /***/ "./src/expand-collapse-manager.ts":
24554
+ /*!****************************************!*\
24555
+ !*** ./src/expand-collapse-manager.ts ***!
24556
+ \****************************************/
24557
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
24558
+
24559
+ "use strict";
24560
+ __webpack_require__.r(__webpack_exports__);
24561
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
24562
+ /* harmony export */ ExpandCollapseManager: () => (/* binding */ ExpandCollapseManager)
24563
+ /* harmony export */ });
24564
+ var ExpandCollapseManager = /** @class */ (function () {
24565
+ function ExpandCollapseManager(creator) {
24566
+ var _this = this;
24567
+ this.adorners = [];
24568
+ creator.onSurfaceToolbarActionExecuted.add(function (_, options) {
24569
+ var isCollapseAction = options.action.id == "collapseAll";
24570
+ var isExpandAction = options.action.id == "expandAll";
24571
+ if (isCollapseAction || isExpandAction) {
24572
+ for (var i = _this.adorners.length - 1; i >= 0; i--) {
24573
+ if (_this.adorners[i].allowExpandCollapse) {
24574
+ _this.adorners[i].collapsed = isCollapseAction;
24575
+ }
24576
+ }
24577
+ }
24578
+ });
24579
+ }
24580
+ ExpandCollapseManager.prototype.add = function (adorner) {
24581
+ this.adorners.push(adorner);
24582
+ };
24583
+ ExpandCollapseManager.prototype.remove = function (adorner) {
24584
+ this.adorners.splice(this.adorners.indexOf(adorner), 1);
24585
+ };
24586
+ return ExpandCollapseManager;
24587
+ }());
24588
+
24589
+
24590
+
24199
24591
  /***/ }),
24200
24592
 
24201
24593
  /***/ "./src/expressionToDisplayText.ts":
@@ -25355,6 +25747,18 @@ var enStrings = {
25355
25747
  pagePlaceHolder: "The page is empty. Drag an element from the toolbox or click the button below.",
25356
25748
  imagePlaceHolder: "Drag and drop an image here or click the button below and choose an image to upload",
25357
25749
  surveyPlaceHolderMobile: "Click the \"Add Question\" button below to start creating your form.",
25750
+ surveyPlaceholderTitle: "Your form is empty",
25751
+ surveyPlaceholderTitleMobile: "Your form is empty",
25752
+ surveyPlaceholderDescription: "Drag an element from the toolbox or click the button below.",
25753
+ surveyPlaceholderDescriptionMobile: "Drag an element from the toolbox or click the button below.",
25754
+ previewPlaceholderTitle: "No preview",
25755
+ previewPlaceholderTitleMobile: "No preview",
25756
+ previewPlaceholderDescription: "The survey doesn't contain any visible elements.",
25757
+ previewPlaceholderDescriptionMobile: "The survey doesn't contain any visible elements.",
25758
+ translationsPlaceholderTitle: "No strings to translate",
25759
+ translationsPlaceholderTitleMobile: "No strings to translate",
25760
+ translationsPlaceholderDescription: "Add elements to your form or change the strings filter in the toolbar.",
25761
+ translationsPlaceholderDescriptionMobile: "Add elements to your form or change the strings filter in the toolbar.",
25358
25762
  pagePlaceHolderMobile: "Click the \"Add Question\" button below to add a new element to the page.",
25359
25763
  panelPlaceHolderMobile: "Click the \"Add Question\" button below to add a new element to the panel.",
25360
25764
  imagePlaceHolderMobile: "Click the button below and choose an image to upload",
@@ -25367,6 +25771,10 @@ var enStrings = {
25367
25771
  lg: {
25368
25772
  addNewItem: "Add New Rule",
25369
25773
  empty_tab: "Create a rule to customize the flow of the survey.",
25774
+ logicPlaceholderTitle: "No logical rules",
25775
+ logicPlaceholderTitleMobile: "No logical rules",
25776
+ logicPlaceholderDescription: "Create a rule to customize the flow of the survey.",
25777
+ logicPlaceholderDescriptionMobile: "Create a rule to customize the flow of the survey.",
25370
25778
  page_visibilityName: "Show/hide page",
25371
25779
  page_enableName: "Enable/disable page",
25372
25780
  page_requireName: "Make page required",
@@ -36813,7 +37221,7 @@ var SurveyHelper = /** @class */ (function () {
36813
37221
  return false;
36814
37222
  return true;
36815
37223
  };
36816
- SurveyHelper.scrollIntoViewIfNeeded = function (el, getOptions, scrollIfElementBiggerThanContainer) {
37224
+ SurveyHelper.isNeedScrollIntoView = function (el, scrollIfElementBiggerThanContainer) {
36817
37225
  if (scrollIfElementBiggerThanContainer === void 0) { scrollIfElementBiggerThanContainer = false; }
36818
37226
  if (!el || !el.scrollIntoView)
36819
37227
  return;
@@ -36823,15 +37231,23 @@ var SurveyHelper = /** @class */ (function () {
36823
37231
  return;
36824
37232
  var height = scrollableDiv.clientHeight;
36825
37233
  if (rect.top < scrollableDiv.offsetTop) {
36826
- el.scrollIntoView(getOptions ? getOptions(true) : true);
37234
+ return "top";
36827
37235
  }
36828
37236
  else {
36829
37237
  var offsetTop = height + scrollableDiv.offsetTop;
36830
37238
  if (rect.bottom > offsetTop && (rect.height < height || scrollIfElementBiggerThanContainer)) {
36831
- el.scrollIntoView(getOptions ? getOptions(false) : false);
37239
+ return "bottom";
36832
37240
  }
36833
37241
  }
36834
37242
  };
37243
+ SurveyHelper.scrollIntoViewIfNeeded = function (el, getOptions, scrollIfElementBiggerThanContainer) {
37244
+ if (scrollIfElementBiggerThanContainer === void 0) { scrollIfElementBiggerThanContainer = false; }
37245
+ var isNeedScroll = SurveyHelper.isNeedScrollIntoView(el, scrollIfElementBiggerThanContainer);
37246
+ if (!isNeedScroll)
37247
+ return;
37248
+ var isNeedScrollToTop = isNeedScroll === "top";
37249
+ el.scrollIntoView(getOptions ? getOptions(isNeedScrollToTop) : isNeedScrollToTop);
37250
+ };
36835
37251
  SurveyHelper.getScrollableDiv = function (el) {
36836
37252
  while (!!el) {
36837
37253
  if (!!el.id && el.id.indexOf("scrollableDiv") > -1)
@@ -38077,9 +38493,10 @@ var QuestionToolbox = /** @class */ (function (_super) {
38077
38493
  var newItems = property.choices.map(function (ch) {
38078
38494
  var newJson = (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__assign)({}, parentItem.json);
38079
38495
  newJson[propName] = ch;
38496
+ var newId = parentItem.id != ch ? ch : parentItem.id + "-default";
38080
38497
  var innerItem = new QuestionToolboxItem({
38081
- id: ch,
38082
- name: ch,
38498
+ id: newId,
38499
+ name: newId,
38083
38500
  title: _editorLocalization__WEBPACK_IMPORTED_MODULE_2__.editorLocalization.getPropertyValueInEditor(propName, ch),
38084
38501
  className: QuestionToolboxItem.getItemClassNames() + " svc-toolbox__item-subtype",
38085
38502
  json: newJson,
@@ -38667,7 +39084,7 @@ var QuestionToolbox = /** @class */ (function (_super) {
38667
39084
  var iconName = json.iconName ? json.iconName : QuestionToolbox.defaultIconName;
38668
39085
  var title = _editorLocalization__WEBPACK_IMPORTED_MODULE_2__.editorLocalization.getString("qt." + json.name);
38669
39086
  if (!title || title == json.name) {
38670
- title = json.title;
39087
+ title = this.getTitleFromJsonTitle(json.title, json.name);
38671
39088
  }
38672
39089
  if (!title) {
38673
39090
  title = json.name;
@@ -38691,6 +39108,21 @@ var QuestionToolbox = /** @class */ (function (_super) {
38691
39108
  });
38692
39109
  return this.getOrCreateToolboxItem(item);
38693
39110
  };
39111
+ QuestionToolbox.prototype.getTitleFromJsonTitle = function (title, name) {
39112
+ if (!title)
39113
+ return title;
39114
+ if (typeof title === "string")
39115
+ return title;
39116
+ if (typeof title !== "object")
39117
+ return title;
39118
+ for (var key in title) {
39119
+ var loc = _editorLocalization__WEBPACK_IMPORTED_MODULE_2__.editorLocalization.locales[key];
39120
+ if (title[key] && loc && loc.qt) {
39121
+ loc.qt[name] = title[key];
39122
+ }
39123
+ }
39124
+ return _editorLocalization__WEBPACK_IMPORTED_MODULE_2__.editorLocalization.getString("qt." + name);
39125
+ };
38694
39126
  QuestionToolbox.prototype.getQuestionJSON = function (question) {
38695
39127
  var json = new survey_core__WEBPACK_IMPORTED_MODULE_1__.JsonObject().toJsonObject(question);
38696
39128
  json.type = question.getType();
@@ -40057,6 +40489,7 @@ __webpack_require__.r(__webpack_exports__);
40057
40489
  /* harmony export */ themeModelPropertyGridDefinition: () => (/* reexport safe */ _components_tabs_theme_model_definition__WEBPACK_IMPORTED_MODULE_18__.themeModelPropertyGridDefinition),
40058
40490
  /* harmony export */ toggleHovered: () => (/* reexport safe */ _utils_utils__WEBPACK_IMPORTED_MODULE_73__.toggleHovered),
40059
40491
  /* harmony export */ translationCss: () => (/* reexport safe */ _components_tabs_translation_theme__WEBPACK_IMPORTED_MODULE_21__.translationCss),
40492
+ /* harmony export */ trimBoxShadowValue: () => (/* reexport safe */ _components_tabs_theme_custom_questions_shadow_effects__WEBPACK_IMPORTED_MODULE_12__.trimBoxShadowValue),
40060
40493
  /* harmony export */ trimEmptyFields: () => (/* reexport safe */ _utils_utils__WEBPACK_IMPORTED_MODULE_73__.trimEmptyFields),
40061
40494
  /* harmony export */ undoRedoTransaction: () => (/* reexport safe */ _plugins_undo_redo__WEBPACK_IMPORTED_MODULE_79__.undoRedoTransaction),
40062
40495
  /* harmony export */ updateBackgroundCornerRadiusJSON: () => (/* reexport safe */ _components_tabs_theme_custom_questions_background_corner_radius__WEBPACK_IMPORTED_MODULE_14__.updateBackgroundCornerRadiusJSON),
@@ -40155,7 +40588,7 @@ __webpack_require__.r(__webpack_exports__);
40155
40588
  /* harmony import */ var survey_core__WEBPACK_IMPORTED_MODULE_87__ = __webpack_require__(/*! survey-core */ "survey-core");
40156
40589
  /* harmony import */ var survey_core__WEBPACK_IMPORTED_MODULE_87___default = /*#__PURE__*/__webpack_require__.n(survey_core__WEBPACK_IMPORTED_MODULE_87__);
40157
40590
  var Version;
40158
- Version = "".concat("1.12.3");
40591
+ Version = "".concat("1.12.4");
40159
40592
  //should be loaded before other styles for easier override
40160
40593
  __webpack_require__(/*! ../utils/context-button.scss */ "./src/utils/context-button.scss");
40161
40594
 
@@ -40263,7 +40696,7 @@ __webpack_require__(/*! ../utils/layout.scss */ "./src/utils/layout.scss");
40263
40696
  __webpack_require__(/*! ../custom-questions/boolean-switch.scss */ "./src/custom-questions/boolean-switch.scss");
40264
40697
 
40265
40698
  survey_core__WEBPACK_IMPORTED_MODULE_87__.settings.supportCreatorV2 = true;
40266
- (0,survey_core__WEBPACK_IMPORTED_MODULE_87__.checkLibraryVersion)("".concat("1.12.3"), "survey-creator-core");
40699
+ (0,survey_core__WEBPACK_IMPORTED_MODULE_87__.checkLibraryVersion)("".concat("1.12.4"), "survey-creator-core");
40267
40700
 
40268
40701
  })();
40269
40702