survey-creator-core 2.0.0 → 2.0.2

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 (162) hide show
  1. package/fesm/i18n/arabic.js +1 -1
  2. package/fesm/i18n/bulgarian.js +1 -1
  3. package/fesm/i18n/burmese.js +1 -1
  4. package/fesm/i18n/croatian.js +1 -1
  5. package/fesm/i18n/czech.js +1 -1
  6. package/fesm/i18n/danish.js +1 -1
  7. package/fesm/i18n/dutch.js +1 -1
  8. package/fesm/i18n/english.js +1 -1
  9. package/fesm/i18n/finnish.js +1 -1
  10. package/fesm/i18n/french.js +1 -1
  11. package/fesm/i18n/german.js +1 -1
  12. package/fesm/i18n/hebrew.js +1 -1
  13. package/fesm/i18n/hungarian.js +1 -1
  14. package/fesm/i18n/index.js +1 -1
  15. package/fesm/i18n/indonesian.js +1 -1
  16. package/fesm/i18n/italian.js +1 -1
  17. package/fesm/i18n/japanese.js +1 -1
  18. package/fesm/i18n/korean.js +1 -1
  19. package/fesm/i18n/malay.js +1 -1
  20. package/fesm/i18n/mongolian.js +1 -1
  21. package/fesm/i18n/norwegian.js +1 -1
  22. package/fesm/i18n/persian.js +1 -1
  23. package/fesm/i18n/polish.js +1 -1
  24. package/fesm/i18n/portuguese.js +1 -1
  25. package/fesm/i18n/romanian.js +1 -1
  26. package/fesm/i18n/russian.js +1 -1
  27. package/fesm/i18n/simplified-chinese.js +1 -1
  28. package/fesm/i18n/slovak.js +1 -1
  29. package/fesm/i18n/slovenian.js +1 -1
  30. package/fesm/i18n/spanish.js +1 -1
  31. package/fesm/i18n/swedish.js +1 -1
  32. package/fesm/i18n/tajik.js +1 -1
  33. package/fesm/i18n/thai.js +1 -1
  34. package/fesm/i18n/traditional-chinese.js +1 -1
  35. package/fesm/i18n/turkish.js +1 -1
  36. package/fesm/survey-creator-core.i18n.js +1 -1
  37. package/fesm/survey-creator-core.js +1680 -1374
  38. package/fesm/survey-creator-core.js.map +1 -1
  39. package/fesm/themes/index.js +34 -1
  40. package/fesm/themes/index.js.map +1 -1
  41. package/fonts.fontless.css +1 -1
  42. package/fonts.fontless.min.css +1 -1
  43. package/i18n/arabic.js +1 -1
  44. package/i18n/arabic.min.js.LICENSE.txt +1 -1
  45. package/i18n/bulgarian.js +1 -1
  46. package/i18n/bulgarian.min.js.LICENSE.txt +1 -1
  47. package/i18n/burmese.js +1 -1
  48. package/i18n/burmese.min.js.LICENSE.txt +1 -1
  49. package/i18n/croatian.js +1 -1
  50. package/i18n/croatian.min.js.LICENSE.txt +1 -1
  51. package/i18n/czech.js +1 -1
  52. package/i18n/czech.min.js.LICENSE.txt +1 -1
  53. package/i18n/danish.js +1 -1
  54. package/i18n/danish.min.js.LICENSE.txt +1 -1
  55. package/i18n/dutch.js +1 -1
  56. package/i18n/dutch.min.js.LICENSE.txt +1 -1
  57. package/i18n/english.js +1 -1
  58. package/i18n/english.min.js.LICENSE.txt +1 -1
  59. package/i18n/finnish.js +1 -1
  60. package/i18n/finnish.min.js.LICENSE.txt +1 -1
  61. package/i18n/french.js +1 -1
  62. package/i18n/french.min.js.LICENSE.txt +1 -1
  63. package/i18n/german.js +1 -1
  64. package/i18n/german.min.js.LICENSE.txt +1 -1
  65. package/i18n/hebrew.js +1 -1
  66. package/i18n/hebrew.min.js.LICENSE.txt +1 -1
  67. package/i18n/hungarian.js +1 -1
  68. package/i18n/hungarian.min.js.LICENSE.txt +1 -1
  69. package/i18n/index.js +1 -1
  70. package/i18n/index.min.js.LICENSE.txt +1 -1
  71. package/i18n/indonesian.js +1 -1
  72. package/i18n/indonesian.min.js.LICENSE.txt +1 -1
  73. package/i18n/italian.js +1 -1
  74. package/i18n/italian.min.js.LICENSE.txt +1 -1
  75. package/i18n/japanese.js +1 -1
  76. package/i18n/japanese.min.js.LICENSE.txt +1 -1
  77. package/i18n/korean.js +1 -1
  78. package/i18n/korean.min.js.LICENSE.txt +1 -1
  79. package/i18n/malay.js +1 -1
  80. package/i18n/malay.min.js.LICENSE.txt +1 -1
  81. package/i18n/mongolian.js +1 -1
  82. package/i18n/mongolian.min.js.LICENSE.txt +1 -1
  83. package/i18n/norwegian.js +1 -1
  84. package/i18n/norwegian.min.js.LICENSE.txt +1 -1
  85. package/i18n/persian.js +1 -1
  86. package/i18n/persian.min.js.LICENSE.txt +1 -1
  87. package/i18n/polish.js +1 -1
  88. package/i18n/polish.min.js.LICENSE.txt +1 -1
  89. package/i18n/portuguese.js +1 -1
  90. package/i18n/portuguese.min.js.LICENSE.txt +1 -1
  91. package/i18n/romanian.js +1 -1
  92. package/i18n/romanian.min.js.LICENSE.txt +1 -1
  93. package/i18n/russian.js +1 -1
  94. package/i18n/russian.min.js.LICENSE.txt +1 -1
  95. package/i18n/simplified-chinese.js +1 -1
  96. package/i18n/simplified-chinese.min.js.LICENSE.txt +1 -1
  97. package/i18n/slovak.js +1 -1
  98. package/i18n/slovak.min.js.LICENSE.txt +1 -1
  99. package/i18n/slovenian.js +1 -1
  100. package/i18n/slovenian.min.js.LICENSE.txt +1 -1
  101. package/i18n/spanish.js +1 -1
  102. package/i18n/spanish.min.js.LICENSE.txt +1 -1
  103. package/i18n/swedish.js +1 -1
  104. package/i18n/swedish.min.js.LICENSE.txt +1 -1
  105. package/i18n/tajik.js +1 -1
  106. package/i18n/tajik.min.js.LICENSE.txt +1 -1
  107. package/i18n/thai.js +1 -1
  108. package/i18n/thai.min.js.LICENSE.txt +1 -1
  109. package/i18n/traditional-chinese.js +1 -1
  110. package/i18n/traditional-chinese.min.js.LICENSE.txt +1 -1
  111. package/i18n/turkish.js +1 -1
  112. package/i18n/turkish.min.js.LICENSE.txt +1 -1
  113. package/package.json +2 -2
  114. package/survey-creator-core.css +260 -246
  115. package/survey-creator-core.fontless.css +259 -245
  116. package/survey-creator-core.fontless.css.map +1 -1
  117. package/survey-creator-core.fontless.min.css +22 -22
  118. package/survey-creator-core.i18n.js +1 -1
  119. package/survey-creator-core.i18n.min.js.LICENSE.txt +1 -1
  120. package/survey-creator-core.js +6372 -6002
  121. package/survey-creator-core.js.map +1 -1
  122. package/survey-creator-core.min.css +23 -23
  123. package/survey-creator-core.min.js +1 -1
  124. package/survey-creator-core.min.js.LICENSE.txt +1 -1
  125. package/themes/default-contrast.js +1 -1
  126. package/themes/default-contrast.min.js.LICENSE.txt +1 -1
  127. package/themes/default-dark.js +1 -1
  128. package/themes/default-dark.min.js.LICENSE.txt +1 -1
  129. package/themes/index.d.ts +33 -0
  130. package/themes/index.js +34 -1
  131. package/themes/index.js.map +1 -1
  132. package/themes/index.min.js +1 -1
  133. package/themes/index.min.js.LICENSE.txt +1 -1
  134. package/themes/sc2020.d.ts +33 -0
  135. package/themes/sc2020.js +34 -1
  136. package/themes/sc2020.js.map +1 -1
  137. package/themes/sc2020.min.js +1 -1
  138. package/themes/sc2020.min.js.LICENSE.txt +1 -1
  139. package/typings/components/action-container-view-model.d.ts +1 -85
  140. package/typings/components/page.d.ts +3 -7
  141. package/typings/components/question.d.ts +3 -4
  142. package/typings/components/row.d.ts +3 -3
  143. package/typings/components/scroll.d.ts +0 -1
  144. package/typings/components/string-editor.d.ts +3 -0
  145. package/typings/components/survey-element-adorner-base.d.ts +88 -0
  146. package/typings/components/tabs/designer-state-manager.d.ts +3 -1
  147. package/typings/components/tabs/logic-theme.d.ts +1 -13
  148. package/typings/creator-base.d.ts +42 -6
  149. package/typings/creator-events-api.d.ts +7 -0
  150. package/typings/creator-options.d.ts +12 -0
  151. package/typings/drag-drop-enums.d.ts +14 -0
  152. package/typings/{survey-elements.d.ts → dragdrop-survey-elements.d.ts} +14 -8
  153. package/typings/editorLocalization.d.ts +1 -0
  154. package/typings/entries/index.d.ts +2 -2
  155. package/typings/expand-collapse-manager.d.ts +1 -5
  156. package/typings/plugins/undo-redo/undo-redo-controller.d.ts +1 -0
  157. package/typings/property-grid/index.d.ts +1 -1
  158. package/typings/property-grid/matrices.d.ts +0 -1
  159. package/typings/question-editor/properties.d.ts +1 -0
  160. package/typings/survey-helper.d.ts +1 -1
  161. package/typings/utils/creator-locstrings.d.ts +9 -0
  162. package/typings/utils/creator-utils.d.ts +0 -2
@@ -1,12 +1,12 @@
1
1
  /*!
2
- * SurveyJS Creator v2.0.0
2
+ * SurveyJS Creator v2.0.2
3
3
  * (c) 2015-2025 Devsoft Baltic OÜ - http://surveyjs.io/
4
4
  * Github: https://github.com/surveyjs/survey-creator
5
5
  * License: https://surveyjs.io/Licenses#SurveyCreator
6
6
  */
7
7
 
8
8
  import * as Survey from 'survey-core';
9
- import { surveyLocalization, Serializer, SurveyModel, Helpers, QuestionFactory, CustomWidgetCollection, defaultCss, settings as settings$1, MatrixDropdownColumn, ItemValue, JsonError, property, Base, Action, ComputedUpdater, ActionContainer, propertyArray, AdaptiveActionContainer, AnimationBoolean, CssClassBuilder, DragOrClickHelper, ElementFactory, ComponentCollection, JsonObject, ListModel, EventBase, createDropdownActionModel, surveyCss, defaultThemeName, ConditionsParser, SurveyTrigger, QuestionMatrixDropdownModelBase, QuestionPanelDynamicModel, ConditionRunner, ExpressionRunner, FunctionFactory, QuestionButtonGroupModel, QuestionTextBase, DragDropCore, PageModel, DragTypeOverMeEnum, getIconNameFromProxy, prepareElementForVerticalAnimation, cleanHtmlElementAfterAnimation, LocalizableString, QuestionCommentModel, createPopupModelWithListModel, defaultActionBarCss, createDropdownActionModelAdvanced, PopupModel, getActionDropdownButtonTarget, AnimationGroup, activateLazyRenderingChecks, CharacterCounter, QuestionImagePickerModel, QuestionMultipleTextModel, QuestionMatrixDropdownModel, QuestionMatrixDynamicModel, QuestionMatrixModel, QuestionSelectBase, MultipleTextItemModel, addIconsToThemeSet, SvgRegistry, hasLicense, slk, Notifier, SvgThemeSets, IsTouch, SurveyElement, Question, PanelModel, DragDropChoices, chooseFiles, classesToSelector, PanelModelBase, QuestionHtmlModel, QuestionNonValue, QuestionTextModel, QuestionFileModel, QuestionRatingModel, renamedIcons, JsonObjectProperty, checkLibraryVersion } from 'survey-core';
9
+ import { surveyLocalization, Serializer, SurveyModel, Helpers, QuestionFactory, CustomWidgetCollection, defaultCss, settings as settings$1, MatrixDropdownColumn, ItemValue, JsonError, property, Base, Action, ComputedUpdater, ActionContainer, propertyArray, AdaptiveActionContainer, AnimationBoolean, CssClassBuilder, DragOrClickHelper, ElementFactory, ComponentCollection, JsonObject, ListModel, EventBase, createDropdownActionModel, surveyCss, defaultThemeName, ConditionsParser, SurveyTrigger, QuestionMatrixDropdownModelBase, QuestionPanelDynamicModel, ConditionRunner, ExpressionRunner, FunctionFactory, QuestionButtonGroupModel, QuestionTextBase, LocalizableString, PageModel, QuestionCommentModel, createPopupModelWithListModel, defaultActionBarCss, createDropdownActionModelAdvanced, PopupModel, getActionDropdownButtonTarget, prepareElementForVerticalAnimation, cleanHtmlElementAfterAnimation, DragDropCore, getIconNameFromProxy, AnimationGroup, activateLazyRenderingChecks, CharacterCounter, QuestionImagePickerModel, QuestionMultipleTextModel, QuestionMatrixDropdownModel, QuestionMatrixDynamicModel, QuestionMatrixModel, QuestionSelectBase, MultipleTextItemModel, addIconsToThemeSet, SvgRegistry, hasLicense, slk, Notifier, SvgThemeSets, IsTouch, SurveyElement, Question, PanelModel, DragDropChoices, chooseFiles, classesToSelector, PanelModelBase, QuestionHtmlModel, QuestionNonValue, QuestionTextModel, QuestionFileModel, QuestionRatingModel, renamedIcons, JsonObjectProperty, checkLibraryVersion } from 'survey-core';
10
10
 
11
11
  // Uncomment the line below if you create a custom dictionary
12
12
  // import { editorLocalization } from "survey-creator-core";
@@ -2220,6 +2220,10 @@ class EditorLocalization {
2220
2220
  return (locale ? this.getLocaleStrings(locale) : this.getDefaultStrings()) || this.getDefaultStrings();
2221
2221
  }
2222
2222
  getLocaleStrings(loc) {
2223
+ if (!loc)
2224
+ loc = this.defaultLocale;
2225
+ if (loc === "en")
2226
+ return defaultStrings;
2223
2227
  return this.locales[loc];
2224
2228
  }
2225
2229
  setupLocale(loc, strings) {
@@ -2293,6 +2297,9 @@ surveyLocalization.onGetExternalString = (name, locale) => {
2293
2297
  function getLocString(strName, locale = null) {
2294
2298
  return editorLocalization.getString(strName, locale);
2295
2299
  }
2300
+ function getLocaleStrings(loc) {
2301
+ return editorLocalization.getLocaleStrings(loc);
2302
+ }
2296
2303
  var defaultStrings = enStrings;
2297
2304
  function setupLocale(localeConfig) {
2298
2305
  editorLocalization.setupLocale(localeConfig.localeCode, localeConfig.strings);
@@ -3584,22 +3591,6 @@ function getNextValue(prefix, values, isText) {
3584
3591
  }
3585
3592
  return isText ? "" : prefix + 1;
3586
3593
  }
3587
- function propertyExists(obj, propertyName) {
3588
- let result = true;
3589
- if (!!obj && typeof obj.getType === "function") {
3590
- const property = Serializer.findProperty(obj.getType(), propertyName);
3591
- result = !!property;
3592
- }
3593
- return result;
3594
- }
3595
- function isPropertyVisible(obj, propertyName) {
3596
- let result = true;
3597
- if (!!obj && typeof obj.getType === "function") {
3598
- const property = Serializer.findProperty(obj.getType(), propertyName);
3599
- result = !property || property.visible;
3600
- }
3601
- return result;
3602
- }
3603
3594
  function getQuestionFromObj(obj) {
3604
3595
  return (obj instanceof MatrixDropdownColumn) ? obj.templateQuestion : obj;
3605
3596
  }
@@ -3762,23 +3753,12 @@ class SurveyHelper {
3762
3753
  }
3763
3754
  return result;
3764
3755
  }
3765
- static isPropertyVisible(obj, property, options = null, showMode = null, parentObj = null, parentProperty = null) {
3766
- if (!property || !property.visible)
3767
- return false;
3768
- if (!!showMode && !!property.showMode && showMode !== property.showMode)
3769
- return false;
3770
- if (!!property.isVisible &&
3771
- !!obj.getLayoutType &&
3772
- !property["isVisible"](obj.getLayoutType(), null))
3756
+ static isPropertyVisible(obj, prop, options = null, showMode = null, parentObj = null, parentProperty = null) {
3757
+ if (!prop || !prop.visible)
3773
3758
  return false;
3774
- var canShow = !!options
3775
- ? (object, property) => {
3776
- return options.onCanShowPropertyCallback(object, property, showMode, parentObj, parentProperty);
3777
- }
3778
- : null;
3779
- if (!!canShow && !canShow(obj, property))
3759
+ if (!!showMode && !!prop.showMode && showMode !== prop.showMode && prop.locationInTable !== "both")
3780
3760
  return false;
3781
- return true;
3761
+ return !options || options.onCanShowPropertyCallback(obj, prop, showMode, parentObj, parentProperty);
3782
3762
  }
3783
3763
  static isNeedScrollIntoView(el, scrollIfElementBiggerThanContainer = false) {
3784
3764
  if (!el || !el.scrollIntoView)
@@ -12792,6 +12772,38 @@ class SurveyQuestionEditorDefinition {
12792
12772
  }
12793
12773
  SurveyQuestionEditorDefinition.definition = defaultProperties;
12794
12774
 
12775
+ const pgTabIcons = {
12776
+ "appearance": "icon-pg-appearance-24x24",
12777
+ "background": "icon-pg-background-24x24",
12778
+ "columns": "icon-pg-columns-24x24",
12779
+ "logic": "icon-pg-conditions-24x24",
12780
+ "data": "icon-pg-data-24x24",
12781
+ "design": "icon-pg-design-24x24",
12782
+ "general": "icon-pg-general-24x24",
12783
+ "header": "icon-pg-header-24x24",
12784
+ "language": "icon-pg-language-24x24",
12785
+ "layout": "icon-pg-design-24x24",
12786
+ "logo": "icon-pg-logo-24x24",
12787
+ "navigation": "icon-pg-navigation-24x24",
12788
+ "pages": "icon-pg-pages-24x24",
12789
+ "question": "icon-pg-questiondesign-24x24",
12790
+ "questionSettings": "icon-pg-questiondesign-24x24",
12791
+ "timer": "icon-pg-quiz-24x24",
12792
+ "rows": "icon-pg-rows-24x24",
12793
+ "specific": "icon-pg-specific-24x24",
12794
+ "showOnCompleted": "icon-pg-thankyyoupage-24x24",
12795
+ "themes": "icon-pg-themes-24x24",
12796
+ "totals": "icon-pg-totals-24x24",
12797
+ "validation": "icon-pg-validation-24x24",
12798
+ "cells": "icon-pg-specific-24x24",
12799
+ "items": "icon-pg-specific-24x24",
12800
+ "mask": "icon-pg-specific-24x24",
12801
+ "rateValues": "icon-pg-specific-24x24",
12802
+ "choices": "icon-pg-specific-24x24",
12803
+ "choicesByUrl": "icon-pg-webservice-24x24",
12804
+ "undefined": "icon-pg-undefined-24x24",
12805
+ };
12806
+
12795
12807
  class SurveyQuestionEditorPropertyDefinition {
12796
12808
  get name() {
12797
12809
  return !!this.property ? this.property.name : "";
@@ -13050,6 +13062,7 @@ class SurveyQuestionProperties {
13050
13062
  }
13051
13063
  var res = new SurveyQuestionEditorTabDefinition();
13052
13064
  res.name = tabName;
13065
+ res.iconName = pgTabIcons[tabName] || pgTabIcons["undefined"];
13053
13066
  if (tabName == settings.propertyGrid.generalTabName) {
13054
13067
  res.index = -1;
13055
13068
  }
@@ -13188,7 +13201,7 @@ class SurveyQuestionProperties {
13188
13201
  const isColumn = this.isColumnObj;
13189
13202
  for (var i = 0; i < this.properties.length; i++) {
13190
13203
  const prop = this.properties[i];
13191
- if (this.isJSONPropertyVisible(prop) && !usedProperties[prop.name] && (!isFormMode || prop.showMode === "form" || isColumn && prop.availableInMatrixColumn)) {
13204
+ if (this.isJSONPropertyVisible(prop) && !usedProperties[prop.name] && (!isFormMode || prop.locationInTable === "both" || prop.showMode === "form" || isColumn && prop.availableInMatrixColumn)) {
13192
13205
  res.push(prop);
13193
13206
  }
13194
13207
  }
@@ -13573,6 +13586,15 @@ class PropertyGridTitleActionsCreator {
13573
13586
  options.titleActions = actions;
13574
13587
  }
13575
13588
  }
13589
+ onValueChanged(obj, property, question) {
13590
+ const editor = PropertyGridEditorCollection.getEditor(property);
13591
+ if (!!editor && !!editor.createPropertyEditorSetup && !!editor.isPropertyEditorSetupEnabled) {
13592
+ const act = question.getTitleToolbar().getActionById("property-grid-setup");
13593
+ if (!!act) {
13594
+ act.enabled = editor.isPropertyEditorSetupEnabled(obj, property, question, this.options);
13595
+ }
13596
+ }
13597
+ }
13576
13598
  createClearValueAction(editor, property, question, enabled) {
13577
13599
  return {
13578
13600
  id: "property-grid-clear",
@@ -13639,6 +13661,7 @@ class PropertyGridTitleActionsCreator {
13639
13661
  return question.descriptionLocation != "hidden" ? "icon-description-hide" : "icon-description";
13640
13662
  }
13641
13663
  }
13664
+ Serializer.addProperty("panelbase", { name: "iconName", visible: false });
13642
13665
  class PropertyJSONGenerator {
13643
13666
  static isPropertyReadOnly(prop, options, obj, parentObj, parentProperty) {
13644
13667
  var res = prop.readOnly;
@@ -13737,8 +13760,8 @@ class PropertyJSONGenerator {
13737
13760
  this.options.onPropertyEditorCreatedCallback(this.obj, prop, q);
13738
13761
  }
13739
13762
  }
13740
- getVisibilityOnEvent(prop, showMode = "") {
13741
- return this.options.onCanShowPropertyCallback(this.obj, prop, showMode, this.parentObj, this.parentProperty);
13763
+ getVisibilityOnEvent(prop) {
13764
+ return this.options.onCanShowPropertyCallback(this.obj, prop, undefined, this.parentObj, this.parentProperty);
13742
13765
  }
13743
13766
  isPropertyReadOnly(prop) {
13744
13767
  return PropertyJSONGenerator.isPropertyReadOnly(prop, this.options, this.obj, this.parentObj, this.parentProperty);
@@ -13811,7 +13834,7 @@ class PropertyJSONGenerator {
13811
13834
  return json;
13812
13835
  }
13813
13836
  createPanelProps(tab, context, isChild = false) {
13814
- var panel = this.createPanelJSON(tab.name, tab.title, isChild);
13837
+ var panel = this.createPanelJSON(tab.name, tab.title, tab.iconName, isChild);
13815
13838
  for (var i = 0; i < tab.properties.length; i++) {
13816
13839
  var propDef = tab.properties[i];
13817
13840
  var propJSON = this.createQuestionJSON(this.obj, propDef.property, propDef.title, false, context);
@@ -13843,10 +13866,11 @@ class PropertyJSONGenerator {
13843
13866
  json.titleLocation = "left";
13844
13867
  json.minWidth = "50px";
13845
13868
  }
13846
- createPanelJSON(category, title, isChild) {
13869
+ createPanelJSON(category, title, iconName, isChild) {
13847
13870
  const res = {
13848
13871
  type: "panel",
13849
13872
  name: category,
13873
+ iconName: iconName,
13850
13874
  title: this.getPanelTitle(category, title),
13851
13875
  elements: []
13852
13876
  };
@@ -13856,10 +13880,8 @@ class PropertyJSONGenerator {
13856
13880
  return res;
13857
13881
  }
13858
13882
  createQuestionJSON(obj, prop, title, isColumn = false, context) {
13859
- var isVisible = this.isPropertyVisible(prop, isColumn ? "list" : "");
13860
- if (!isVisible && isColumn)
13861
- return null;
13862
- var json = PropertyGridEditorCollection.getJSON(obj, prop, this.options, context, this.propertyGridDefinition);
13883
+ //if(isColumn && !SurveyHelper.isPropertyVisible(this.obj, prop, undefined, isColumn ? "list" : "")) return null;
13884
+ const json = PropertyGridEditorCollection.getJSON(obj, prop, this.options, context, this.propertyGridDefinition);
13863
13885
  if (!json)
13864
13886
  return null;
13865
13887
  json.name = prop.name;
@@ -13912,11 +13934,6 @@ class PropertyJSONGenerator {
13912
13934
  }
13913
13935
  return json;
13914
13936
  }
13915
- isPropertyVisible(prop, showMode) {
13916
- if (!prop.visible)
13917
- return false;
13918
- return !showMode || !prop.showMode || showMode == prop.showMode;
13919
- }
13920
13937
  getPanelTitle(name, title) {
13921
13938
  if (!!title)
13922
13939
  return title;
@@ -14466,6 +14483,8 @@ class PropertyGridModel {
14466
14483
  const cellQuestion = options.row.getQuestionByName(options.columnName);
14467
14484
  if (!!cellQuestion) {
14468
14485
  this.changeDependedProperties(cellQuestion, (name) => { return options.row.getQuestionByName(name); }, (name) => { return options.row.getValue(name); });
14486
+ const matrix = options.question;
14487
+ this.titleActionsCreator.onValueChanged(matrix.obj, matrix.property, matrix);
14469
14488
  }
14470
14489
  PropertyGridEditorCollection.onMatrixCellValueChanged(this.obj, options.question.property, options);
14471
14490
  }
@@ -14513,9 +14532,6 @@ class PropertyGridEditor {
14513
14532
  const surveyPropertyEditor = editor.createPropertyEditorSetup(obj, property, question, options);
14514
14533
  if (!surveyPropertyEditor)
14515
14534
  return null;
14516
- if (property.type !== "condition") {
14517
- surveyPropertyEditor.editSurvey.css = defaultCss;
14518
- }
14519
14535
  if (question.isReadOnly) {
14520
14536
  surveyPropertyEditor.editSurvey.mode = "display";
14521
14537
  }
@@ -15570,483 +15586,6 @@ __decorate([
15570
15586
  property({ defaultValue: "icon" })
15571
15587
  ], MenuButton.prototype, "contentType", void 0);
15572
15588
 
15573
- function calculateIsEdge(dropTargetNode, clientY) {
15574
- const rect = dropTargetNode.getBoundingClientRect();
15575
- return clientY - rect.top <= DragDropSurveyElements.edgeHeight || rect.bottom - clientY <= DragDropSurveyElements.edgeHeight;
15576
- }
15577
- function calculateIsSide(dropTargetNode, clientX) {
15578
- const rect = dropTargetNode.getBoundingClientRect();
15579
- return clientX - rect.left <= DragDropSurveyElements.edgeHeight || rect.right - clientX <= DragDropSurveyElements.edgeHeight;
15580
- }
15581
- function calculateDragOverLocation(clientX, clientY, rect, direction = null) {
15582
- const tg = rect.height / rect.width;
15583
- const dx = clientX - rect.x;
15584
- const dy = clientY - rect.y;
15585
- if (direction == "top-bottom") {
15586
- if (dy >= rect.height / 2) {
15587
- return DragTypeOverMeEnum.Bottom;
15588
- }
15589
- else {
15590
- return DragTypeOverMeEnum.Top;
15591
- }
15592
- }
15593
- if (direction == "left-right") {
15594
- if (dx >= rect.width / 2) {
15595
- return DragTypeOverMeEnum.Right;
15596
- }
15597
- else {
15598
- return DragTypeOverMeEnum.Left;
15599
- }
15600
- }
15601
- if (dy >= tg * dx) {
15602
- if (dy >= -tg * dx + rect.height) {
15603
- return DragTypeOverMeEnum.Bottom;
15604
- }
15605
- else {
15606
- return DragTypeOverMeEnum.Left;
15607
- }
15608
- }
15609
- else {
15610
- if (dy >= -tg * dx + rect.height) {
15611
- return DragTypeOverMeEnum.Right;
15612
- }
15613
- else {
15614
- return DragTypeOverMeEnum.Top;
15615
- }
15616
- }
15617
- }
15618
- function isPanelDynamic(element) {
15619
- return element instanceof QuestionPanelDynamicModel;
15620
- }
15621
- class DragDropSurveyElements extends DragDropCore {
15622
- constructor() {
15623
- super(...arguments);
15624
- this.insideContainer = null;
15625
- this.prevIsEdge = null;
15626
- // protected ghostSurveyElement: IElement = null;
15627
- this.dragOverIndicatorElement = null;
15628
- this.isDraggedElementSelected = false;
15629
- this.doBanDropHere = () => {
15630
- this.removeDragOverMarker(this.dragOverIndicatorElement);
15631
- this.removeDragOverMarker(this.dropTarget);
15632
- };
15633
- this.doDrop = () => {
15634
- var _a;
15635
- if (!this.dropTarget)
15636
- return;
15637
- const page = this.parentElement;
15638
- const dragged = this.draggedElement;
15639
- const src = this.draggedElement;
15640
- if (dragged.isPage && dragged instanceof PageModel) {
15641
- const survey = dragged.survey;
15642
- const indexOfDraggedPage = survey.pages.indexOf(dragged);
15643
- survey.pages.splice(indexOfDraggedPage, 1);
15644
- const indexOfDropTarget = survey.pages.indexOf(this.dropTarget) + (this.dragOverLocation === DragTypeOverMeEnum.Top ? 0 : 1);
15645
- survey.pages.splice(indexOfDropTarget, 0, dragged);
15646
- if (indexOfDraggedPage !== indexOfDropTarget) {
15647
- dragged["draggedFrom"] = indexOfDraggedPage < indexOfDropTarget ? indexOfDraggedPage : indexOfDraggedPage + 1;
15648
- }
15649
- return dragged;
15650
- }
15651
- const convertLocation = () => {
15652
- switch (this.dragOverLocation) {
15653
- case 4: return "top";
15654
- case 5: return "right";
15655
- case 6: return "bottom";
15656
- case 7: return "left";
15657
- default: return "bottom";
15658
- }
15659
- };
15660
- const srcContainer = src.parent || src.page;
15661
- if (!!srcContainer) {
15662
- page.survey.startMovingQuestion();
15663
- srcContainer.removeElement(src);
15664
- }
15665
- let dest = ((_a = this.dragOverIndicatorElement) === null || _a === void 0 ? void 0 : _a.isPanel) ? this.dragOverIndicatorElement : this.dropTarget;
15666
- if (isPanelDynamic(dest) && this.insideContainer)
15667
- dest = dest.template;
15668
- if (dest.isPage && dest.elements.length > 0 && !this.insideContainer)
15669
- return;
15670
- const isTargetIsContainer = dest.isPanel || dest.isPage;
15671
- if (isTargetIsContainer && this.insideContainer) {
15672
- dest.insertElement(src);
15673
- }
15674
- else {
15675
- const destParent = dest.parent || dest.page;
15676
- if (destParent)
15677
- destParent.insertElement(src, dest, convertLocation());
15678
- }
15679
- page.survey.stopMovingQuestion();
15680
- return dragged;
15681
- };
15682
- }
15683
- get draggedElementType() {
15684
- if (!!this.draggedElement && this.draggedElement.isPage) {
15685
- return "survey-page";
15686
- }
15687
- return "survey-element";
15688
- }
15689
- get maxNestedPanels() { return this.onGetMaxNestedPanels ? this.onGetMaxNestedPanels() : -1; }
15690
- // private isRight: boolean;
15691
- // protected prevIsRight: boolean;
15692
- startDragToolboxItem(event, draggedElementJson, toolboxItemModel) {
15693
- const draggedElement = this.createElementFromJson(draggedElementJson);
15694
- draggedElement.toolboxItemTitle = toolboxItemModel.title;
15695
- draggedElement.toolboxItemIconName = toolboxItemModel.iconName;
15696
- this.startDrag(event, draggedElement);
15697
- }
15698
- startDragSurveyElement(event, draggedElement, isElementSelected) {
15699
- this.isDraggedElementSelected = isElementSelected;
15700
- this.startDrag(event, draggedElement);
15701
- }
15702
- getShortcutText(draggedElement) {
15703
- return draggedElement.toolboxItemTitle || super.getShortcutText(draggedElement);
15704
- }
15705
- createDraggedElementShortcut(text, draggedElementNode, event) {
15706
- const draggedElementShortcut = document.createElement("div");
15707
- draggedElementShortcut.style.display = "flex";
15708
- const textSpan = document.createElement("span");
15709
- textSpan.className = "svc-dragged-element-shortcut__text";
15710
- textSpan.innerText = text;
15711
- if (this.draggedElement.toolboxItemIconName) {
15712
- draggedElementShortcut.appendChild(this.createDraggedElementIcon());
15713
- }
15714
- draggedElementShortcut.appendChild(textSpan);
15715
- draggedElementShortcut.className = this.getDraggedElementClass();
15716
- return draggedElementShortcut;
15717
- }
15718
- createDraggedElementIcon() {
15719
- const span = document.createElement("span");
15720
- span.className = "svc-dragged-element-shortcut__icon";
15721
- const iconName = getIconNameFromProxy(this.draggedElement.toolboxItemIconName);
15722
- const svgString = `<svg class="sv-svg-icon" role="img"><use xlink:href="#${iconName}"></use></svg>`;
15723
- span.innerHTML = svgString;
15724
- return span;
15725
- }
15726
- getDraggedElementClass() {
15727
- let result = "svc-dragged-element-shortcut";
15728
- if (!!this.draggedElement.toolboxItemIconName)
15729
- result += " svc-dragged-element-shortcut--has-icon";
15730
- if (this.isDraggedElementSelected)
15731
- result += " svc-dragged-element-shortcut--selected";
15732
- return result;
15733
- }
15734
- createElementFromJson(json) {
15735
- const element = this.createNewElement(json);
15736
- if (element["setSurveyImpl"]) {
15737
- element["setSurveyImpl"](this.survey);
15738
- }
15739
- else {
15740
- element["setData"](this.survey);
15741
- }
15742
- element.renderWidth = "100%";
15743
- return element;
15744
- }
15745
- createNewElement(json) {
15746
- var newElement = Serializer.createClass(json["type"]);
15747
- new JsonObject().toObject(json, newElement);
15748
- return newElement;
15749
- }
15750
- findDropTargetNodeByDragOverNode(dragOverNode) {
15751
- const ghostRow = dragOverNode.closest(".svc-row--ghost");
15752
- if (!!ghostRow) {
15753
- const ghostDataAttrSelector = "[data-sv-drop-target-survey-element='sv-drag-drop-ghost-survey-element-name']";
15754
- const ghostNode = dragOverNode.closest(ghostDataAttrSelector) || dragOverNode.querySelector(ghostDataAttrSelector);
15755
- if (!!ghostNode) {
15756
- return ghostNode;
15757
- }
15758
- }
15759
- const dropTargetNode = dragOverNode.closest(this.dropTargetDataAttributeName);
15760
- return dropTargetNode;
15761
- }
15762
- getDropTargetByDataAttributeValue(dataAttributeValue, dropTargetNode, event) {
15763
- const oldDragOverIndicatorElement = this.dragOverIndicatorElement;
15764
- if (!dataAttributeValue) {
15765
- // panel dynamic
15766
- const nearestDropTargetElement = dropTargetNode.parentElement.closest(this.dropTargetDataAttributeName);
15767
- dataAttributeValue = this.getDataAttributeValueByNode(nearestDropTargetElement);
15768
- }
15769
- if (!dataAttributeValue) {
15770
- throw new Error("Can't find drop target survey element name");
15771
- }
15772
- if (dataAttributeValue === DragDropSurveyElements.ghostSurveyElementName) {
15773
- return this.prevDropTarget;
15774
- }
15775
- // drop to new page
15776
- if (dataAttributeValue === "newGhostPage") {
15777
- return DragDropSurveyElements.newGhostPage;
15778
- }
15779
- // drop to page
15780
- let page = this.survey.getPageByName(dataAttributeValue);
15781
- if (page) {
15782
- return page;
15783
- }
15784
- // drop to question or panel
15785
- let dropTarget;
15786
- let dragOverElement;
15787
- this.survey.pages.forEach((page) => {
15788
- const question = page.getElementByName(dataAttributeValue);
15789
- if (question) {
15790
- dropTarget = question;
15791
- dragOverElement = question;
15792
- }
15793
- });
15794
- // drop to matrix detail panel
15795
- if ((dropTarget.getType() === "matrixdropdown" || dropTarget.getType() === "matrixdynamic") && dropTarget.detailPanelMode !== "none" && this.insideContainer) {
15796
- dropTarget = dropTarget.detailPanel;
15797
- }
15798
- // drop to question
15799
- //question inside paneldymanic
15800
- if (!dropTarget.page) {
15801
- const nearestDropTargetPageElement = dropTargetNode.parentElement.closest("[data-sv-drop-target-page]");
15802
- dataAttributeValue = nearestDropTargetPageElement.dataset.svDropTargetPage;
15803
- let page = this.survey.getPageByName(dataAttributeValue);
15804
- dropTarget.__page = page;
15805
- }
15806
- this.dragOverIndicatorElement = dragOverElement;
15807
- if (this.dragOverIndicatorElement != oldDragOverIndicatorElement) {
15808
- this.removeDragOverMarker(oldDragOverIndicatorElement);
15809
- }
15810
- return dropTarget;
15811
- // EO drop to question or panel
15812
- }
15813
- isDropTargetValid(dropTarget, dropTargetNode, dragOverLocation = DragTypeOverMeEnum.Top) {
15814
- if (!dropTarget)
15815
- return false;
15816
- if (dropTarget === this.draggedElement)
15817
- return false;
15818
- if (this.draggedElement.getType() === "paneldynamic" && dropTarget === this.draggedElement.template) {
15819
- return false;
15820
- }
15821
- if (this.maxNestedPanels >= 0 && this.draggedElement.isPanel) {
15822
- const pnl = this.draggedElement;
15823
- if (pnl.deepNested === undefined) {
15824
- pnl.deepNested = this.getMaximumNestedPanelCount(pnl, 0);
15825
- }
15826
- let len = SurveyHelper.getElementDeepLength(dropTarget);
15827
- if (dragOverLocation !== DragTypeOverMeEnum.InsideEmptyPanel && dropTarget.isPanel)
15828
- len--;
15829
- if (this.maxNestedPanels < len + pnl.deepNested)
15830
- return false;
15831
- }
15832
- if (DragDropSurveyElements.restrictDragQuestionBetweenPages &&
15833
- this.shouldRestricDragQuestionBetweenPages(dropTarget)) {
15834
- return false;
15835
- }
15836
- return true;
15837
- }
15838
- getMaximumNestedPanelCount(panel, deep) {
15839
- let max = deep;
15840
- panel.elements.forEach(el => {
15841
- if (el.isPanel) {
15842
- const pDeep = this.getMaximumNestedPanelCount(el, deep + 1);
15843
- if (pDeep > max) {
15844
- max = pDeep;
15845
- }
15846
- }
15847
- });
15848
- return max;
15849
- }
15850
- shouldRestricDragQuestionBetweenPages(dropTarget) {
15851
- const oldPage = this.draggedElement["page"];
15852
- const newPage = dropTarget.isPage ? dropTarget : dropTarget["page"];
15853
- // if oldPage === null then it is drop from the toolbox
15854
- return oldPage && oldPage !== newPage;
15855
- }
15856
- findDeepestDropTargetChild(parent) {
15857
- const selector = this.dropTargetDataAttributeName;
15858
- let result = parent;
15859
- while (!!parent) {
15860
- result = parent;
15861
- parent = parent.querySelector(selector);
15862
- }
15863
- return result;
15864
- }
15865
- isAllowDragOver(dropTarget, dragOverLocation) {
15866
- if (!this.survey || this.survey.onDragDropAllow.isEmpty)
15867
- return true;
15868
- const allowOptions = {
15869
- allow: true,
15870
- parent: this.parentElement,
15871
- source: this.draggedElement,
15872
- toElement: dropTarget,
15873
- draggedElement: this.draggedElement,
15874
- fromElement: this.draggedElement.parent,
15875
- target: dropTarget,
15876
- insertAfter: undefined,
15877
- insertBefore: undefined,
15878
- allowDropNextToAnother: true
15879
- };
15880
- if (dragOverLocation === DragTypeOverMeEnum.Bottom || dragOverLocation === DragTypeOverMeEnum.Right) {
15881
- allowOptions.insertAfter = dropTarget;
15882
- }
15883
- if (dragOverLocation === DragTypeOverMeEnum.Top || dragOverLocation === DragTypeOverMeEnum.Left) {
15884
- allowOptions.insertBefore = dropTarget;
15885
- }
15886
- this.survey.onDragDropAllow.fire(this.survey, allowOptions);
15887
- if (!allowOptions.allowDropNextToAnother) {
15888
- if (dragOverLocation === DragTypeOverMeEnum.Left) {
15889
- this.dragOverLocation = DragTypeOverMeEnum.Top;
15890
- }
15891
- if (dragOverLocation === DragTypeOverMeEnum.Right) {
15892
- this.dragOverLocation = DragTypeOverMeEnum.Bottom;
15893
- }
15894
- }
15895
- return allowOptions.allow;
15896
- }
15897
- dragOverCore(dropTarget, dragOverLocation) {
15898
- const oldDragOverIndicatorElement = this.dragOverIndicatorElement;
15899
- const oldDropTarget = this.dropTarget;
15900
- if (this.isSameElement(dropTarget)) {
15901
- this.allowDropHere = false;
15902
- return;
15903
- }
15904
- this.dropTarget = dropTarget;
15905
- this.dragOverLocation = dragOverLocation;
15906
- this.parentElement = this.dropTarget.isPage
15907
- ? this.dropTarget
15908
- : (this.dropTarget.page || this.dropTarget.__page);
15909
- if (!this.isAllowDragOver(dropTarget, dragOverLocation)) {
15910
- this.allowDropHere = false;
15911
- return;
15912
- }
15913
- if (dragOverLocation == DragTypeOverMeEnum.InsideEmptyPanel) {
15914
- this.dragOverIndicatorElement = this.dropTarget;
15915
- this.dragOverIndicatorElement.dragTypeOverMe = DragTypeOverMeEnum.InsideEmptyPanel;
15916
- }
15917
- else {
15918
- const row = this.parentElement.dragDropFindRow(this.dropTarget);
15919
- if (!!row && row.elements.length > 1 && (this.dragOverLocation === DragTypeOverMeEnum.Top || this.dragOverLocation === DragTypeOverMeEnum.Bottom)) {
15920
- row.dragTypeOverMe = this.dragOverLocation;
15921
- this.dragOverIndicatorElement = row;
15922
- }
15923
- else {
15924
- this.dropTarget.dragTypeOverMe = this.dragOverLocation;
15925
- this.dragOverIndicatorElement = this.dropTarget;
15926
- }
15927
- }
15928
- if (this.dragOverIndicatorElement != oldDragOverIndicatorElement)
15929
- this.removeDragOverMarker(oldDragOverIndicatorElement);
15930
- if (this.dropTarget != oldDropTarget)
15931
- this.removeDragOverMarker(oldDropTarget);
15932
- }
15933
- isSameElement(target) {
15934
- while (!!target) {
15935
- if (target === this.draggedElement)
15936
- return true;
15937
- target = target.parent;
15938
- }
15939
- return false;
15940
- }
15941
- isDragInsideItself(dragOverNodes) {
15942
- let result = false;
15943
- dragOverNodes.forEach((node) => {
15944
- if (node.classList.contains("svc-question__content--dragged")) {
15945
- result = true;
15946
- }
15947
- });
15948
- return result;
15949
- }
15950
- dragOver(event) {
15951
- const dropTargetNode = this.findDropTargetNodeFromPoint(event.clientX, event.clientY);
15952
- if (!dropTargetNode) {
15953
- this.banDropHere();
15954
- return;
15955
- }
15956
- if (document && document.elementsFromPoint && this.isDragInsideItself(document.elementsFromPoint(event.clientX, event.clientY))) {
15957
- this.banDropHere();
15958
- return null;
15959
- }
15960
- const oldInsideContainer = this.insideContainer;
15961
- this.insideContainer = !calculateIsEdge(dropTargetNode, event.clientY) && !calculateIsSide(dropTargetNode, event.clientX);
15962
- const dropTarget = this.getDropTargetByNode(dropTargetNode, event);
15963
- if (!!oldInsideContainer != !!this.insideContainer)
15964
- dropTarget.dragTypeOverMe = null;
15965
- const dropTargetRect = dropTargetNode.getBoundingClientRect();
15966
- const calcDirection = !settings.dragDrop.allowDragToTheSameLine || (!!this.draggedElement && this.draggedElement.isPage) ? "top-bottom" : null;
15967
- let dragOverLocation = calculateDragOverLocation(event.clientX, event.clientY, dropTargetRect, calcDirection);
15968
- if (!this.draggedElement.isPage && dropTarget && ((dropTarget.isPanel || dropTarget.isPage) && dropTarget.elements.length === 0 || isPanelDynamic(dropTarget) && dropTarget.template.elements.length == 0)) {
15969
- if (dropTarget.isPage || this.insideContainer) {
15970
- dragOverLocation = DragTypeOverMeEnum.InsideEmptyPanel;
15971
- }
15972
- }
15973
- const options = {
15974
- survey: this.survey,
15975
- draggedSurveyElement: this.draggedElement,
15976
- dragOverSurveyElement: dropTarget,
15977
- clientX: event.clientX,
15978
- clientY: event.clientY,
15979
- dragOverRect: dropTargetRect,
15980
- insideContainer: this.insideContainer,
15981
- dragOverLocation
15982
- };
15983
- if (this.onDragOverLocationCalculating) {
15984
- this.onDragOverLocationCalculating(options);
15985
- dragOverLocation = options.dragOverLocation;
15986
- this.insideContainer = options.insideContainer;
15987
- }
15988
- const isDropTargetValid = this.isDropTargetValid(dropTarget, dropTargetNode, dragOverLocation);
15989
- if (!isDropTargetValid) {
15990
- this.banDropHere();
15991
- return;
15992
- }
15993
- this.allowDropHere = true;
15994
- this.dragOverCore(dropTarget, dragOverLocation);
15995
- }
15996
- onStartDrag() {
15997
- // this.ghostSurveyElement = this.createGhostSurveyElement();
15998
- this.draggedElement.isDragMe = true;
15999
- }
16000
- moveElementInPanel(panel, src, target, targetIndex) {
16001
- var srcIndex = src.parent.elements.indexOf(src);
16002
- if (targetIndex > srcIndex) {
16003
- targetIndex--;
16004
- }
16005
- if (src === target && srcIndex === targetIndex) {
16006
- return;
16007
- }
16008
- panel.removeElement(src);
16009
- panel.addElement(target, targetIndex);
16010
- }
16011
- removeDragOverMarker(dropTarget) {
16012
- if (!!dropTarget) {
16013
- dropTarget.dragTypeOverMe = null;
16014
- }
16015
- }
16016
- clear() {
16017
- this.insideContainer = null;
16018
- this.removeDragOverMarker(this.prevDropTarget);
16019
- this.removeDragOverMarker(this.dropTarget);
16020
- this.removeDragOverMarker(this.dragOverIndicatorElement);
16021
- if (!!this.draggedElement) {
16022
- this.draggedElement.isDragMe = false;
16023
- }
16024
- super.clear();
16025
- }
16026
- getTargetParent(dropTarget) {
16027
- let targetParent = dropTarget.isPage || dropTarget.isPanel ? dropTarget : dropTarget.parent;
16028
- if (dropTarget.getType() === "paneldynamic") {
16029
- targetParent = dropTarget.templateValue;
16030
- }
16031
- return targetParent;
16032
- }
16033
- getTargetRow(dropTarget) {
16034
- const targetParent = this.getTargetParent(dropTarget);
16035
- let targetRow;
16036
- targetParent.rows.forEach((row) => {
16037
- if (row.elements.indexOf(dropTarget) !== -1) {
16038
- targetRow = row;
16039
- }
16040
- });
16041
- return targetRow;
16042
- }
16043
- }
16044
- DragDropSurveyElements.newGhostPage = null;
16045
- DragDropSurveyElements.restrictDragQuestionBetweenPages = false;
16046
- DragDropSurveyElements.edgeHeight = 30;
16047
- DragDropSurveyElements.nestedPanelDepth = -1;
16048
- DragDropSurveyElements.ghostSurveyElementName = "sv-drag-drop-ghost-survey-element-name"; // before renaming use globa search (we have also css selectors)
16049
-
16050
15589
  class SurveyElementActionContainer extends AdaptiveActionContainer {
16051
15590
  needToShrink(item, shrinkTypeConverterAction) {
16052
15591
  return (item.innerItem.location == "start" && shrinkTypeConverterAction || item.innerItem.location != "start");
@@ -16104,498 +15643,26 @@ class SurveyElementActionContainer extends AdaptiveActionContainer {
16104
15643
  this.setModeForActions(true);
16105
15644
  return;
16106
15645
  }
16107
- this.visibleActions.forEach((item) => {
16108
- if (item.id == "convertTo") {
16109
- item.mode = "small";
16110
- return;
16111
- }
16112
- if (item.id == "convertInputType") {
16113
- item.mode = "removed";
16114
- return;
16115
- }
16116
- item.mode = "popup";
16117
- });
16118
- this.dotsItem.visible = true;
16119
- this.hiddenItemsListModel.setItems(items.filter(i => i.mode == "popup").map(i => i.innerItem));
16120
- }
16121
- }
16122
- class SurveyElementAdornerBase extends Base {
16123
- get dragInsideCollapsedContainer() {
16124
- return this.collapsed && this.creator.dragDropSurveyElements.insideContainer;
16125
- }
16126
- getAnimatedElement() {
16127
- return null;
16128
- }
16129
- getInnerAnimatedElements() {
16130
- return [];
16131
- }
16132
- getCollapsingCssClassName() {
16133
- return "svc-question--leave";
16134
- }
16135
- getExpandingCssClassName() {
16136
- return "svc-question--enter";
16137
- }
16138
- get hoverDelay() {
16139
- return this.creator.pageHoverDelay;
16140
- }
16141
- hover(e, element) {
16142
- const processedFlagName = "__svc_question_processed";
16143
- if (!e[processedFlagName] && e.type === "mouseover") {
16144
- if (!this.hoverTimeout) {
16145
- this.hoverTimeout = setTimeout(() => {
16146
- this.isHovered = true;
16147
- this.hoverTimeout = undefined;
16148
- }, this.hoverDelay);
16149
- }
16150
- e[processedFlagName] = true;
16151
- }
16152
- else {
16153
- clearTimeout(this.hoverTimeout);
16154
- this.hoverTimeout = undefined;
16155
- this.isHovered = false;
16156
- }
16157
- }
16158
- getExpandCollapseAnimationOptions() {
16159
- const beforeRunAnimation = (el, animatingClassName) => {
16160
- prepareElementForVerticalAnimation(el);
16161
- const innerAnimatedElements = this.getInnerAnimatedElements();
16162
- innerAnimatedElements.forEach((elem) => {
16163
- prepareElementForVerticalAnimation(elem);
16164
- });
16165
- innerAnimatedElements.forEach((elem) => {
16166
- elem.classList.add(animatingClassName);
15646
+ if (this.visibleActions.length > 1) {
15647
+ this.visibleActions.forEach((item) => {
15648
+ if (item.id == "convertTo") {
15649
+ item.mode = "small";
15650
+ return;
15651
+ }
15652
+ if (item.id == "convertInputType") {
15653
+ item.mode = "removed";
15654
+ return;
15655
+ }
15656
+ item.mode = "popup";
16167
15657
  });
16168
- };
16169
- const afterRunAnimation = (el, animatingClassName) => {
16170
- this.expandCollapseAnimationRunning = false;
16171
- if (this.surveyElement) {
16172
- cleanHtmlElementAfterAnimation(el);
16173
- const innerAnimatedElements = this.getInnerAnimatedElements();
16174
- innerAnimatedElements.forEach((elem) => {
16175
- cleanHtmlElementAfterAnimation(elem);
16176
- });
16177
- innerAnimatedElements.forEach((elem) => {
16178
- elem.classList.remove(animatingClassName);
16179
- });
16180
- }
16181
- };
16182
- return {
16183
- getRerenderEvent: () => this.onElementRerendered,
16184
- getEnterOptions: () => {
16185
- const className = this.getExpandingCssClassName();
16186
- return {
16187
- cssClass: className,
16188
- onBeforeRunAnimation: (el) => {
16189
- beforeRunAnimation(el, className);
16190
- },
16191
- onAfterRunAnimation: (el) => {
16192
- afterRunAnimation(el, className);
16193
- },
16194
- };
16195
- },
16196
- getLeaveOptions: () => {
16197
- const className = this.getCollapsingCssClassName();
16198
- return {
16199
- cssClass: className,
16200
- onBeforeRunAnimation: (el) => {
16201
- beforeRunAnimation(el, className);
16202
- },
16203
- onAfterRunAnimation: (el) => {
16204
- afterRunAnimation(el, className);
16205
- },
16206
- };
16207
- },
16208
- getAnimatedElement: () => this.getAnimatedElement(),
16209
- isAnimationEnabled: () => this.animationAllowed
16210
- };
16211
- }
16212
- set renderedCollapsed(val) {
16213
- if (this.animationAllowed && val !== this.renderedCollapsed)
16214
- this.expandCollapseAnimationRunning = true;
16215
- this.animationCollapsed.sync(!val);
16216
- }
16217
- get renderedCollapsed() {
16218
- return !!this._renderedCollapsed;
16219
- }
16220
- createTopActionContainer() {
16221
- const actionContainer = new ActionContainer();
16222
- actionContainer.sizeMode = "small";
16223
- if (this.creator.expandCollapseButtonVisibility != "never") {
16224
- actionContainer.setItems([this.expandCollapseAction]);
16225
- actionContainer.cssClasses = {
16226
- root: "svc-survey-element-top-toolbar sv-action-bar",
16227
- item: "svc-survey-element-top-toolbar__item",
16228
- itemIcon: "svc-survey-element-toolbar-item__icon",
16229
- itemTitle: "svc-survey-element-toolbar-item__title",
16230
- itemTitleWithIcon: "svc-survey-element-toolbar-item__title--with-icon",
16231
- };
16232
- }
16233
- return actionContainer;
16234
- }
16235
- createActionContainer() {
16236
- const actionContainer = new SurveyElementActionContainer();
16237
- actionContainer.dotsItem.popupModel.horizontalPosition = "center";
16238
- return actionContainer;
16239
- }
16240
- get canExpandOnDrag() {
16241
- return this.surveyElement.isPanel || this.surveyElement.isPage || isPanelDynamic(this.surveyElement);
16242
- }
16243
- dragIn() {
16244
- if (!this.draggedIn) {
16245
- if (this.canExpandOnDrag && this.collapsed) {
16246
- this.draggedIn = true;
16247
- this.dragCollapsedTimer = setTimeout(() => {
16248
- this.expandWithDragIn();
16249
- }, this.creator.expandOnDragTimeOut);
16250
- }
16251
- }
16252
- }
16253
- expandWithDragIn() {
16254
- this.collapsed = false;
16255
- this.dragCollapsedTimer = undefined;
16256
- }
16257
- dragOut() {
16258
- if (this.draggedIn) {
16259
- clearTimeout(this.dragCollapsedTimer);
16260
- this.draggedIn = false;
16261
- }
16262
- }
16263
- allowExpandCollapseByDblClick(element) {
16264
- return true;
16265
- }
16266
- dblclick(event) {
16267
- if (this.allowExpandCollapseByDblClick(event.target)) {
16268
- if (this.allowExpandCollapse)
16269
- this.collapsed = !this.collapsed;
16270
- }
16271
- event.stopPropagation();
16272
- }
16273
- get element() {
16274
- return this.surveyElement;
16275
- }
16276
- constructor(creator, surveyElement) {
16277
- super();
16278
- this.creator = creator;
16279
- this.animationCollapsed = new AnimationBoolean(this.getExpandCollapseAnimationOptions(), (val) => {
16280
- this._renderedCollapsed = !val;
16281
- }, () => !this.renderedCollapsed);
16282
- this.draggedIn = false;
16283
- this.sidebarFlyoutModeChangedFunc = (_, options) => {
16284
- if (options.name === "flyoutMode") {
16285
- this.updateActionsProperties();
16286
- }
16287
- };
16288
- this.creatorOnLocaleChanged = (_, options) => {
16289
- if (this.surveyElement) {
16290
- this.updateActionsContainer(this.surveyElement);
16291
- this.updateActionsProperties();
16292
- }
16293
- };
16294
- this.actionVisibilityCache = {};
16295
- this.expandCollapseAction = this.getExpandCollapseAction();
16296
- this.attachToUI(surveyElement);
16297
- }
16298
- get isActionContainerCreated() {
16299
- return !!this.actionContainerValue;
16300
- }
16301
- get actionContainer() {
16302
- if (!this.actionContainerValue) {
16303
- this.actionContainerValue = this.createActionContainer();
16304
- if (this.surveyElement) {
16305
- this.updateActionsContainer(this.surveyElement);
16306
- this.updateActionsVisibility(false);
16307
- }
16308
- }
16309
- return this.actionContainerValue;
16310
- }
16311
- get topActionContainer() {
16312
- if (!this.topActionContainerValue) {
16313
- this.topActionContainerValue = this.createTopActionContainer();
16314
- if (this.surveyElement) {
16315
- this.updateActionsVisibility(true);
16316
- }
16317
- }
16318
- return this.topActionContainerValue;
16319
- }
16320
- static GetAdorner(surveyElement) {
16321
- return surveyElement.getPropertyValue(SurveyElementAdornerBase.AdornerValueName);
16322
- }
16323
- static RestoreStateFor(surveyElement) {
16324
- const adorner = SurveyElementAdornerBase.GetAdorner(surveyElement);
16325
- if (!!adorner) {
16326
- adorner.restoreState();
16327
- }
16328
- }
16329
- restoreState() {
16330
- var _a;
16331
- if (!!this.surveyElement) {
16332
- const state = (_a = this.creator.designerStateManager) === null || _a === void 0 ? void 0 : _a.getElementState(this.surveyElement);
16333
- this.collapsed = state.collapsed;
16334
- }
16335
- if (!this.surveyElement || this.surveyElement.isInteractiveDesignElement) {
16336
- this.needToRenderContent = !this.collapsed;
16337
- }
16338
- }
16339
- detachElement(surveyElement) {
16340
- if (surveyElement) {
16341
- surveyElement.setPropertyValue(SurveyElementAdornerBase.AdornerValueName, null);
16342
- surveyElement.unRegisterFunctionOnPropertyValueChanged("isSelectedInDesigner", "questionSelected");
16343
- this.cleanActionsContainer();
16344
- }
16345
- }
16346
- attachElement(surveyElement) {
16347
- var _a, _b;
16348
- if (surveyElement) {
16349
- (_b = (_a = this.creator) === null || _a === void 0 ? void 0 : _a.designerStateManager) === null || _b === void 0 ? void 0 : _b.initForElement(surveyElement);
16350
- surveyElement.registerFunctionOnPropertyValueChanged("isSelectedInDesigner", (newValue) => {
16351
- this.onElementSelectedChanged(newValue);
16352
- }, "questionSelected");
16353
- this.restoreState();
16354
- this.updateActionsContainer(surveyElement);
16355
- this.updateActionsProperties();
16356
- surveyElement.setPropertyValue(SurveyElementAdornerBase.AdornerValueName, this);
16357
- }
16358
- }
16359
- setSurveyElement(surveyElement) {
16360
- this.detachOnlyMyElement();
16361
- this.surveyElement = surveyElement;
16362
- this.attachElement(this.surveyElement);
16363
- }
16364
- checkActionProperties() {
16365
- if (this.creator.isElementSelected(this.surveyElement)) {
16366
- this.updateActionsProperties();
16367
- }
16368
- }
16369
- attachToUI(surveyElement, rootElement) {
16370
- if (!!rootElement) {
16371
- this.rootElement = rootElement;
16372
- }
16373
- if (this.surveyElement != surveyElement) {
16374
- this.setSurveyElement(surveyElement);
16375
- this.creator.onLocaleChanded.add(this.creatorOnLocaleChanged);
16376
- this.creator.sidebar.onPropertyChanged.add(this.sidebarFlyoutModeChangedFunc);
16377
- this.creator.expandCollapseManager.add(this);
16378
- }
16379
- }
16380
- detachOnlyMyElement() {
16381
- if (this.surveyElement && this.surveyElement.getPropertyValue(SurveyElementAdornerBase.AdornerValueName) === this && !this.surveyElement.isDisposed) {
16382
- this.detachElement(this.surveyElement);
16383
- }
16384
- }
16385
- detachFromUI() {
16386
- this.rootElement = undefined;
16387
- this.detachOnlyMyElement();
16388
- this.surveyElement = undefined;
16389
- this.creator.onLocaleChanded.remove(this.creatorOnLocaleChanged);
16390
- this.creator.sidebar.onPropertyChanged.remove(this.sidebarFlyoutModeChangedFunc);
16391
- this.creator.expandCollapseManager.remove(this);
16392
- }
16393
- dispose() {
16394
- this.detachFromUI();
16395
- this.disposeActions(this.actionContainerValue);
16396
- this.disposeActions(this.topActionContainerValue);
16397
- super.dispose();
16398
- this.sidebarFlyoutModeChangedFunc = undefined;
16399
- this.animationCollapsed = undefined;
16400
- }
16401
- disposeActions(container) {
16402
- if (!!container && !container.isDisposed) {
16403
- container.dispose();
16404
- }
16405
- }
16406
- onElementSelectedChanged(isSelected) {
16407
- if (!isSelected)
16408
- return;
16409
- this.updateActionsProperties();
16410
- }
16411
- getExpandCollapseAction() {
16412
- const collapseIcon = "icon-collapsepanel-16x16";
16413
- const expandIcon = "icon-expandpanel-16x16";
16414
- return {
16415
- id: "collapse",
16416
- css: "sv-action-bar-item--collapse",
16417
- locTooltipName: new ComputedUpdater(() => this.collapsed ? "ed.expandTooltip" : "ed.collapseTooltip"),
16418
- iconName: new ComputedUpdater(() => this.collapsed ? expandIcon : collapseIcon),
16419
- iconSize: "auto",
16420
- action: () => {
16421
- this.collapsed = !this.collapsed;
16422
- }
16423
- };
16424
- }
16425
- cleanActionsContainer() {
16426
- const container = this.actionContainerValue;
16427
- if (!container)
16428
- return;
16429
- const actions = container.actions;
16430
- container.setItems([]);
16431
- actions.forEach(action => action.dispose && action.dispose());
16432
- }
16433
- updateActionsContainer(surveyElement) {
16434
- if (!this.actionContainerValue)
16435
- return;
16436
- const actions = [];
16437
- this.buildActions(actions);
16438
- this.creator.onElementMenuItemsChanged(surveyElement, actions);
16439
- this.actionContainerValue.setItems(actions);
16440
- }
16441
- updateActionsProperties() {
16442
- if (this.isDisposed)
16443
- return;
16444
- this.updateActionsPropertiesCore();
16445
- }
16446
- updateActionsPropertiesCore() {
16447
- this.updateElementAllowOptions(this.creator.getElementAllowOperations(this.surveyElement), this.isOperationsAllow());
16448
- }
16449
- getAllowDragging(options) {
16450
- return options.allowDragging;
16451
- }
16452
- getAllowExpandCollapse(options) {
16453
- return this.creator.expandCollapseButtonVisibility != "never" && (options.allowExpandCollapse == undefined || !!options.allowExpandCollapse);
16454
- }
16455
- updateElementAllowOptions(options, operationsAllow) {
16456
- this.allowDragging = operationsAllow && this.getAllowDragging(options);
16457
- this.allowExpandCollapse = this.getAllowExpandCollapse(options);
16458
- this.allowEditOption = (options.allowEdit == undefined || !!options.allowEdit);
16459
- this.updateActionVisibility("delete", operationsAllow && options.allowDelete);
16460
- this.updateActionVisibility("duplicate", operationsAllow && options.allowCopy);
16461
- this.updateActionVisibility("collapse", this.allowExpandCollapse);
16462
- if (options.allowShowSettings === undefined) {
16463
- const settingsVisibility = (options.allowEdit !== undefined) ? (operationsAllow && options.allowEdit) : this.creator.sidebar.flyoutMode;
16464
- this.updateActionVisibility("settings", settingsVisibility);
16465
- }
16466
- else {
16467
- this.updateActionVisibility("settings", options.allowShowSettings);
16468
- }
16469
- this.setShowAddQuestionButton(options.allowEdit !== false);
16470
- }
16471
- isOperationsAllow() {
16472
- return !this.creator.readOnly;
16473
- }
16474
- updateActionVisibility(id, isVisible) {
16475
- var _a, _b;
16476
- var action = ((_a = this.actionContainerValue) === null || _a === void 0 ? void 0 : _a.getActionById(id)) || ((_b = this.topActionContainerValue) === null || _b === void 0 ? void 0 : _b.getActionById(id));
16477
- if (!action) {
16478
- this.actionVisibilityCache[id] = isVisible;
15658
+ this.dotsItem.visible = true;
16479
15659
  }
16480
15660
  else {
16481
- if (action.visible !== isVisible) {
16482
- action.visible = isVisible;
16483
- }
15661
+ this.visibleActions.forEach(i => i.mode = "small");
16484
15662
  }
16485
- }
16486
- updateActionsVisibility(isTop) {
16487
- for (var key in this.actionVisibilityCache) {
16488
- this.updateActionVisibility(key, this.actionVisibilityCache[key]);
16489
- }
16490
- }
16491
- getActionById(id) {
16492
- return this.actionContainer.getActionById(id) || this.topActionContainer.getActionById(id);
16493
- }
16494
- buildActions(items) {
16495
- items.push(new Action({
16496
- id: "duplicate",
16497
- iconName: "icon-duplicate_16x16",
16498
- css: "svc-action-bar-item--right",
16499
- title: this.creator.getLocString("survey.duplicate"),
16500
- visibleIndex: 10,
16501
- iconSize: "auto",
16502
- action: () => this.duplicate(),
16503
- onFocus: (isMouse, event) => this.disableActionFocusing(isMouse, event)
16504
- }));
16505
- items.push(new Action({
16506
- id: "settings",
16507
- iconName: "icon-settings_16x16",
16508
- css: "svc-action-bar-item--right",
16509
- title: this.creator.getLocString("ed.settings"),
16510
- locTooltipName: "ed.settingsTooltip",
16511
- visibleIndex: 20,
16512
- iconSize: "auto",
16513
- action: () => {
16514
- this.creator.setShowSidebar(true, true);
16515
- if (!this.creator.isMobileView) {
16516
- this.creator.sidebar.executeOnExpand(() => {
16517
- this.creator.propertyGrid.getAllQuestions()[0].focus();
16518
- });
16519
- }
16520
- }
16521
- }));
16522
- items.push(new Action({
16523
- id: "delete",
16524
- iconName: "icon-delete_16x16",
16525
- css: "svc-action-bar-item--right",
16526
- //needSeparator: items.length > 0,
16527
- title: this.creator.getLocString("pe.delete"),
16528
- visibleIndex: 30,
16529
- iconSize: "auto",
16530
- action: () => {
16531
- this.delete();
16532
- },
16533
- onFocus: (isMouse, event) => this.disableActionFocusing(isMouse, event)
16534
- }));
16535
- }
16536
- disableActionFocusing(isMouse, event) {
16537
- this.isDisableSelecting = isMouse;
16538
- }
16539
- canSelectElement() {
16540
- const res = !this.isDisableSelecting;
16541
- this.isDisableSelecting = false;
16542
- return res;
16543
- }
16544
- get allowEdit() {
16545
- return !!this.creator && !this.creator.readOnly && this.allowEditOption;
16546
- }
16547
- get showAddQuestionButton() {
16548
- return this.getPropertyValue("showAddQuestionButton");
16549
- }
16550
- setShowAddQuestionButton(val) {
16551
- this.setPropertyValue("showAddQuestionButton", val && this.allowEdit && !!this.creator && this.creator.showAddQuestionButton);
16552
- }
16553
- duplicate() { }
16554
- delete() {
16555
- this.creator.deleteElement(this.surveyElement);
16556
- }
16557
- getCss() {
16558
- return new CssClassBuilder().append("svc-hovered svc-hovered-ready", this.isHovered).toString();
15663
+ this.hiddenItemsListModel.setItems(items.filter(i => i.mode == "popup").map(i => i.innerItem));
16559
15664
  }
16560
15665
  }
16561
- SurveyElementAdornerBase.AdornerValueName = "__sjs_creator_adorner";
16562
- __decorate([
16563
- property({ defaultValue: true })
16564
- ], SurveyElementAdornerBase.prototype, "allowDragging", void 0);
16565
- __decorate([
16566
- property({ defaultValue: false })
16567
- ], SurveyElementAdornerBase.prototype, "expandCollapseAnimationRunning", void 0);
16568
- __decorate([
16569
- property({ defaultValue: true })
16570
- ], SurveyElementAdornerBase.prototype, "needToRenderContent", void 0);
16571
- __decorate([
16572
- property({ defaultValue: true })
16573
- ], SurveyElementAdornerBase.prototype, "allowExpandCollapse", void 0);
16574
- __decorate([
16575
- property({
16576
- onSet: (val, target) => {
16577
- target.renderedCollapsed = val;
16578
- if (!val)
16579
- target.needToRenderContent = true;
16580
- if (target.creator.designerStateManager && !target.creator.designerStateManager.isSuspended && target.surveyElement) {
16581
- target.creator.designerStateManager.getElementState(target.surveyElement).collapsed = val;
16582
- }
16583
- setTimeout(() => {
16584
- target.creator.survey.pages.forEach(p => p.ensureRowsVisibility());
16585
- target.creator.survey.getAllPanels().forEach(p => p.ensureRowsVisibility());
16586
- }, 50);
16587
- }
16588
- })
16589
- ], SurveyElementAdornerBase.prototype, "collapsed", void 0);
16590
- __decorate([
16591
- property()
16592
- ], SurveyElementAdornerBase.prototype, "_renderedCollapsed", void 0);
16593
- __decorate([
16594
- property()
16595
- ], SurveyElementAdornerBase.prototype, "isAnimationRunningCollapsed", void 0);
16596
- __decorate([
16597
- property({ defaultValue: false })
16598
- ], SurveyElementAdornerBase.prototype, "isHovered", void 0);
16599
15666
 
16600
15667
  let isLocaleEnableIfExecuting;
16601
15668
  function localeEnableIf(params) {
@@ -16990,8 +16057,7 @@ class TranslationGroup extends TranslationItemBase {
16990
16057
  return;
16991
16058
  var properties = this.getLocalizedProperties(this.obj);
16992
16059
  for (var i = 0; i < properties.length; i++) {
16993
- var property = properties[i];
16994
- var item = this.createTranslationItem(this.obj, properties[i]);
16060
+ const item = this.createTranslationItem(this.obj, properties[i]);
16995
16061
  if (!!item) {
16996
16062
  this.itemValues.push(item);
16997
16063
  }
@@ -17090,10 +16156,10 @@ class TranslationGroup extends TranslationItemBase {
17090
16156
  }
17091
16157
  createTranslationItem(obj, property) {
17092
16158
  var _a;
17093
- const defaultValue = this.getDefaultValue(obj, property);
17094
16159
  const locStr = obj[property.serializationProperty];
17095
16160
  if (!locStr)
17096
16161
  return null;
16162
+ const defaultValue = this.getDefaultValue(obj, property);
17097
16163
  if (!this.showAllStrings && !defaultValue && locStr.isEmpty)
17098
16164
  return null;
17099
16165
  const editLocale = (_a = this.translation) === null || _a === void 0 ? void 0 : _a.getEditLocale();
@@ -17108,9 +16174,7 @@ class TranslationGroup extends TranslationItemBase {
17108
16174
  property.isLocalizable &&
17109
16175
  !!property.serializationProperty) {
17110
16176
  var locStr = obj[property.serializationProperty];
17111
- if (!!locStr &&
17112
- !obj.isPage && !obj.isPanel &&
17113
- (!!locStr.onGetTextCallback || locStr["onRenderedHtmlCallback"]))
16177
+ if (!!locStr && !obj.isPage && !obj.isPanel && !!locStr.onGetTextCallback)
17114
16178
  return obj["name"];
17115
16179
  }
17116
16180
  return "";
@@ -21426,7 +20490,7 @@ class TabLogicPlugin {
21426
20490
 
21427
20491
  class UndoRedoController extends Base {
21428
20492
  onSurveyPropertyValueChangedCallback(name, oldValue, newValue, sender, arrayChanges) {
21429
- if (!this.undoRedoManager || !this.undoRedoManager.isCorrectProperty(sender, name)) {
20493
+ if (this.ignoreChanges || !this.undoRedoManager || !this.undoRedoManager.isCorrectProperty(sender, name)) {
21430
20494
  return;
21431
20495
  }
21432
20496
  const canUndoRedoMerge = this.undoRedoManager.tryMergeTransaction(sender, name, newValue);
@@ -22049,7 +21113,9 @@ class PropertyGridViewModel extends Base {
22049
21113
  let titleName = this.getTitle();
22050
21114
  this.selectedElementName = titleName;
22051
21115
  this.objectSelectionAction.tooltip = titleName;
22052
- this.objectSelectionAction.title = this.propertyGridModel.showOneCategoryInPropertyGrid ? "" : titleName;
21116
+ if (!this.propertyGridModel.showOneCategoryInPropertyGrid) {
21117
+ this.objectSelectionAction.title = titleName;
21118
+ }
22053
21119
  }
22054
21120
  getTitle() {
22055
21121
  var obj = this.getSelectedObj();
@@ -22108,114 +21174,1180 @@ class PropertyGridViewModel extends Base {
22108
21174
  this.objectSelectionAction.pressed = true;
22109
21175
  }
22110
21176
  });
22111
- this.objectSelectionAction = new MenuButton({
22112
- id: "svd-grid-object-selector",
22113
- title: this.selectedElementName,
22114
- css: "sv-action--object-selector",
22115
- component: "sv-action-bar-item-dropdown",
22116
- disableHide: true,
22117
- pressed: false,
22118
- action: () => {
22119
- selectorModel.show(this.selectionController.creator.survey, this.propertyGridModel.obj, (obj) => {
22120
- this.selectionController.selectFromAction(obj, "name");
22121
- this.selectorPopupModel.hide();
22122
- });
22123
- this.selectorPopupModel.show();
22124
- selectorModel.list.scrollToSelectedItem();
22125
- },
22126
- popupModel: this.selectorPopupModel
22127
- });
22128
- this.objectSelectionAction.contentType = "text-description-vertical";
21177
+ this.objectSelectionAction = new MenuButton({
21178
+ id: "svd-grid-object-selector",
21179
+ title: this.selectedElementName,
21180
+ css: "sv-action--object-selector",
21181
+ component: "sv-action-bar-item-dropdown",
21182
+ disableHide: true,
21183
+ pressed: false,
21184
+ action: () => {
21185
+ selectorModel.show(this.selectionController.creator.survey, this.propertyGridModel.obj, (obj) => {
21186
+ this.selectionController.selectFromAction(obj, "name");
21187
+ this.selectorPopupModel.hide();
21188
+ });
21189
+ this.selectorPopupModel.show();
21190
+ selectorModel.list.scrollToSelectedItem();
21191
+ },
21192
+ popupModel: this.selectorPopupModel
21193
+ });
21194
+ this.objectSelectionAction.contentType = "text-description-vertical";
21195
+ }
21196
+ dispose() {
21197
+ this.searchManager.dispose();
21198
+ this.nextSelectionAction.dispose();
21199
+ this.prevSelectionAction.dispose();
21200
+ this.objectSelectionAction.dispose();
21201
+ this.selectorPopupModel.dispose();
21202
+ super.dispose();
21203
+ }
21204
+ }
21205
+ __decorate([
21206
+ property()
21207
+ ], PropertyGridViewModel.prototype, "hasPrev", void 0);
21208
+ __decorate([
21209
+ property()
21210
+ ], PropertyGridViewModel.prototype, "hasNext", void 0);
21211
+ __decorate([
21212
+ property()
21213
+ ], PropertyGridViewModel.prototype, "selectedElementName", void 0);
21214
+ __decorate([
21215
+ property({
21216
+ onSet: (newValue, target) => {
21217
+ target.searchManager.isVisible = newValue;
21218
+ }
21219
+ })
21220
+ ], PropertyGridViewModel.prototype, "searchEnabled", void 0);
21221
+ __decorate([
21222
+ property()
21223
+ ], PropertyGridViewModel.prototype, "showPlaceholder", void 0);
21224
+
21225
+ class PagesController extends Base {
21226
+ constructor(creator) {
21227
+ super();
21228
+ this.creator = creator;
21229
+ this.onPagesChanged = this.addEvent();
21230
+ this.onCurrentPageChanged = this.addEvent();
21231
+ this.currentPageChangedFunc = (sender, options) => {
21232
+ this.page2Display = this.survey.currentPage;
21233
+ this.onCurrentPageChanged.fire(this, {});
21234
+ };
21235
+ this.onSurveyChanged();
21236
+ }
21237
+ get survey() {
21238
+ return this.creator.survey;
21239
+ }
21240
+ get pages() {
21241
+ return this.survey.pages;
21242
+ }
21243
+ get currentPage() {
21244
+ return this.survey.currentPage;
21245
+ }
21246
+ set currentPage(value) {
21247
+ this.survey.currentPage = value;
21248
+ this.page2Display = value;
21249
+ }
21250
+ selectPage(value) {
21251
+ this.currentPage = value;
21252
+ this.creator.selectElement(value);
21253
+ }
21254
+ getDisplayName(page) {
21255
+ if (!page)
21256
+ return "";
21257
+ return this.creator.getObjectDisplayName(page, "page-selector");
21258
+ }
21259
+ raisePagesChanged() {
21260
+ this.page2Display = this.survey.currentPage;
21261
+ this.onPagesChanged.fire(this, {});
21262
+ }
21263
+ onSurveyChanged() {
21264
+ this.removeFunctions();
21265
+ this.surveyValue = this.creator.survey;
21266
+ if (!this.surveyValue)
21267
+ return;
21268
+ this.raisePagesChanged();
21269
+ this.page2Display = this.survey.currentPage;
21270
+ this.surveyValue.onCurrentPageChanged.add(this.currentPageChangedFunc);
21271
+ }
21272
+ dispose() {
21273
+ super.dispose();
21274
+ this.removeFunctions();
21275
+ }
21276
+ removeFunctions() {
21277
+ if (!!this.surveyValue && !this.surveyValue.isDisposed) {
21278
+ this.surveyValue.onCurrentPageChanged.remove(this.currentPageChangedFunc);
21279
+ }
21280
+ }
21281
+ }
21282
+ __decorate([
21283
+ property()
21284
+ ], PagesController.prototype, "page2Display", void 0);
21285
+
21286
+ class SurveyElementAdornerBase extends Base {
21287
+ getAnimatedElement() {
21288
+ return null;
21289
+ }
21290
+ getInnerAnimatedElements() {
21291
+ return [];
21292
+ }
21293
+ getCollapsingCssClassName() {
21294
+ return "svc-question--leave";
21295
+ }
21296
+ getExpandingCssClassName() {
21297
+ return "svc-question--enter";
21298
+ }
21299
+ get hoverDelay() {
21300
+ return this.creator.pageHoverDelay;
21301
+ }
21302
+ hover(e, element) {
21303
+ const processedFlagName = "__svc_question_processed";
21304
+ if (!e[processedFlagName] && e.type === "mouseover") {
21305
+ if (!this.hoverTimeout) {
21306
+ this.hoverTimeout = setTimeout(() => {
21307
+ this.isHovered = true;
21308
+ this.hoverTimeout = undefined;
21309
+ }, this.hoverDelay);
21310
+ }
21311
+ e[processedFlagName] = true;
21312
+ }
21313
+ else {
21314
+ clearTimeout(this.hoverTimeout);
21315
+ this.hoverTimeout = undefined;
21316
+ this.isHovered = false;
21317
+ }
21318
+ }
21319
+ getExpandCollapseAnimationOptions() {
21320
+ const beforeRunAnimation = (el, animatingClassName) => {
21321
+ prepareElementForVerticalAnimation(el);
21322
+ const innerAnimatedElements = this.getInnerAnimatedElements();
21323
+ innerAnimatedElements.forEach((elem) => {
21324
+ prepareElementForVerticalAnimation(elem);
21325
+ });
21326
+ innerAnimatedElements.forEach((elem) => {
21327
+ elem.classList.add(animatingClassName);
21328
+ });
21329
+ };
21330
+ const afterRunAnimation = (el, animatingClassName) => {
21331
+ this.expandCollapseAnimationRunning = false;
21332
+ if (this.surveyElement) {
21333
+ cleanHtmlElementAfterAnimation(el);
21334
+ const innerAnimatedElements = this.getInnerAnimatedElements();
21335
+ innerAnimatedElements.forEach((elem) => {
21336
+ cleanHtmlElementAfterAnimation(elem);
21337
+ });
21338
+ innerAnimatedElements.forEach((elem) => {
21339
+ elem.classList.remove(animatingClassName);
21340
+ });
21341
+ }
21342
+ };
21343
+ return {
21344
+ getRerenderEvent: () => this.onElementRerendered,
21345
+ getEnterOptions: () => {
21346
+ const className = this.getExpandingCssClassName();
21347
+ return {
21348
+ cssClass: className,
21349
+ onBeforeRunAnimation: (el) => {
21350
+ beforeRunAnimation(el, className);
21351
+ },
21352
+ onAfterRunAnimation: (el) => {
21353
+ afterRunAnimation(el, className);
21354
+ },
21355
+ };
21356
+ },
21357
+ getLeaveOptions: () => {
21358
+ const className = this.getCollapsingCssClassName();
21359
+ return {
21360
+ cssClass: className,
21361
+ onBeforeRunAnimation: (el) => {
21362
+ beforeRunAnimation(el, className);
21363
+ },
21364
+ onAfterRunAnimation: (el) => {
21365
+ afterRunAnimation(el, className);
21366
+ },
21367
+ };
21368
+ },
21369
+ getAnimatedElement: () => this.getAnimatedElement(),
21370
+ isAnimationEnabled: () => this.animationAllowed
21371
+ };
21372
+ }
21373
+ set renderedCollapsed(val) {
21374
+ if (this.animationAllowed && val !== this.renderedCollapsed)
21375
+ this.expandCollapseAnimationRunning = true;
21376
+ this.animationCollapsed.sync(!val);
21377
+ }
21378
+ get renderedCollapsed() {
21379
+ return !!this._renderedCollapsed;
21380
+ }
21381
+ createTopActionContainer() {
21382
+ const actionContainer = new ActionContainer();
21383
+ actionContainer.sizeMode = "small";
21384
+ if (this.creator.expandCollapseButtonVisibility != "never") {
21385
+ actionContainer.setItems([this.expandCollapseAction]);
21386
+ actionContainer.cssClasses = {
21387
+ root: "svc-survey-element-top-toolbar sv-action-bar",
21388
+ item: "svc-survey-element-top-toolbar__item",
21389
+ itemIcon: "svc-survey-element-toolbar-item__icon",
21390
+ itemTitle: "svc-survey-element-toolbar-item__title",
21391
+ itemTitleWithIcon: "svc-survey-element-toolbar-item__title--with-icon",
21392
+ };
21393
+ }
21394
+ return actionContainer;
21395
+ }
21396
+ createActionContainer() {
21397
+ const actionContainer = new SurveyElementActionContainer();
21398
+ actionContainer.dotsItem.popupModel.horizontalPosition = "center";
21399
+ return actionContainer;
21400
+ }
21401
+ get canExpandOnDrag() {
21402
+ return this.surveyElement.isPanel || this.surveyElement.isPage || this.surveyElement instanceof QuestionPanelDynamicModel;
21403
+ }
21404
+ dragIn() {
21405
+ if (!this.draggedIn) {
21406
+ if (this.canExpandOnDrag && this.collapsed) {
21407
+ this.draggedIn = true;
21408
+ this.dragCollapsedTimer = setTimeout(() => {
21409
+ this.expandWithDragIn();
21410
+ }, this.creator.expandOnDragTimeOut);
21411
+ }
21412
+ }
21413
+ }
21414
+ expandWithDragIn() {
21415
+ this.collapsed = false;
21416
+ this.dragCollapsedTimer = undefined;
21417
+ }
21418
+ dragOut() {
21419
+ if (this.draggedIn) {
21420
+ clearTimeout(this.dragCollapsedTimer);
21421
+ this.draggedIn = false;
21422
+ }
21423
+ }
21424
+ allowExpandCollapseByDblClick(element) {
21425
+ return true;
21426
+ }
21427
+ dblclick(event) {
21428
+ if (this.allowExpandCollapseByDblClick(event.target)) {
21429
+ if (this.allowExpandCollapse)
21430
+ this.collapsed = !this.collapsed;
21431
+ }
21432
+ event.stopPropagation();
21433
+ }
21434
+ get element() {
21435
+ return this.surveyElement;
21436
+ }
21437
+ constructor(creator, surveyElement) {
21438
+ super();
21439
+ this.creator = creator;
21440
+ this.animationCollapsed = new AnimationBoolean(this.getExpandCollapseAnimationOptions(), (val) => {
21441
+ this._renderedCollapsed = !val;
21442
+ }, () => !this.renderedCollapsed);
21443
+ this.draggedIn = false;
21444
+ this.sidebarFlyoutModeChangedFunc = (_, options) => {
21445
+ if (options.name === "flyoutMode") {
21446
+ this.updateActionsProperties();
21447
+ }
21448
+ };
21449
+ this.creatorOnLocaleChanged = (_, options) => {
21450
+ if (this.surveyElement) {
21451
+ this.updateActionsContainer(this.surveyElement);
21452
+ this.updateActionsProperties();
21453
+ }
21454
+ };
21455
+ this.actionVisibilityCache = {};
21456
+ this.expandCollapseAction = this.getExpandCollapseAction();
21457
+ this.attachToUI(surveyElement);
21458
+ }
21459
+ get isActionContainerCreated() {
21460
+ return !!this.actionContainerValue;
21461
+ }
21462
+ get actionContainer() {
21463
+ if (!this.actionContainerValue) {
21464
+ this.actionContainerValue = this.createActionContainer();
21465
+ if (this.surveyElement) {
21466
+ this.updateActionsContainer(this.surveyElement);
21467
+ this.updateActionsVisibility(false);
21468
+ }
21469
+ }
21470
+ return this.actionContainerValue;
21471
+ }
21472
+ get topActionContainer() {
21473
+ if (!this.topActionContainerValue) {
21474
+ this.topActionContainerValue = this.createTopActionContainer();
21475
+ if (this.surveyElement) {
21476
+ this.updateActionsVisibility(true);
21477
+ }
21478
+ }
21479
+ return this.topActionContainerValue;
21480
+ }
21481
+ static GetAdorner(surveyElement) {
21482
+ return surveyElement.getPropertyValue(SurveyElementAdornerBase.AdornerValueName);
21483
+ }
21484
+ static RestoreStateFor(surveyElement) {
21485
+ const adorner = SurveyElementAdornerBase.GetAdorner(surveyElement);
21486
+ if (!!adorner) {
21487
+ adorner.restoreState();
21488
+ }
21489
+ }
21490
+ restoreState() {
21491
+ var _a;
21492
+ if (!!this.surveyElement) {
21493
+ this.collapsed = (_a = this.creator.designerStateManager) === null || _a === void 0 ? void 0 : _a.getElementCollapsed(this.surveyElement);
21494
+ }
21495
+ if (!this.surveyElement || this.surveyElement.isInteractiveDesignElement) {
21496
+ this.needToRenderContent = !this.collapsed;
21497
+ }
21498
+ }
21499
+ detachElement(surveyElement) {
21500
+ if (surveyElement) {
21501
+ surveyElement.setPropertyValue(SurveyElementAdornerBase.AdornerValueName, null);
21502
+ surveyElement.unRegisterFunctionOnPropertyValueChanged("isSelectedInDesigner", "questionSelected");
21503
+ this.cleanActionsContainer();
21504
+ }
21505
+ }
21506
+ attachElement(surveyElement) {
21507
+ var _a, _b;
21508
+ if (surveyElement) {
21509
+ (_b = (_a = this.creator) === null || _a === void 0 ? void 0 : _a.designerStateManager) === null || _b === void 0 ? void 0 : _b.initForElement(surveyElement);
21510
+ surveyElement.registerFunctionOnPropertyValueChanged("isSelectedInDesigner", (newValue) => {
21511
+ this.onElementSelectedChanged(newValue);
21512
+ }, "questionSelected");
21513
+ this.restoreState();
21514
+ this.updateActionsContainer(surveyElement);
21515
+ this.updateActionsProperties();
21516
+ surveyElement.setPropertyValue(SurveyElementAdornerBase.AdornerValueName, this);
21517
+ }
21518
+ }
21519
+ setSurveyElement(surveyElement) {
21520
+ this.detachOnlyMyElement();
21521
+ this.surveyElement = surveyElement;
21522
+ this.attachElement(this.surveyElement);
21523
+ }
21524
+ checkActionProperties() {
21525
+ if (this.creator.isElementSelected(this.surveyElement)) {
21526
+ this.updateActionsProperties();
21527
+ }
21528
+ }
21529
+ attachToUI(surveyElement, rootElement) {
21530
+ if (!!rootElement) {
21531
+ this.rootElement = rootElement;
21532
+ }
21533
+ if (this.surveyElement != surveyElement) {
21534
+ this.setSurveyElement(surveyElement);
21535
+ this.creator.onLocaleChanded.add(this.creatorOnLocaleChanged);
21536
+ this.creator.sidebar.onPropertyChanged.add(this.sidebarFlyoutModeChangedFunc);
21537
+ }
21538
+ }
21539
+ detachOnlyMyElement() {
21540
+ if (this.surveyElement && this.surveyElement.getPropertyValue(SurveyElementAdornerBase.AdornerValueName) === this && !this.surveyElement.isDisposed) {
21541
+ this.detachElement(this.surveyElement);
21542
+ }
21543
+ }
21544
+ detachFromUI() {
21545
+ this.rootElement = undefined;
21546
+ this.detachOnlyMyElement();
21547
+ this.surveyElement = undefined;
21548
+ this.creator.onLocaleChanded.remove(this.creatorOnLocaleChanged);
21549
+ this.creator.sidebar.onPropertyChanged.remove(this.sidebarFlyoutModeChangedFunc);
21550
+ }
21551
+ dispose() {
21552
+ this.detachFromUI();
21553
+ this.disposeActions(this.actionContainerValue);
21554
+ this.disposeActions(this.topActionContainerValue);
21555
+ super.dispose();
21556
+ this.sidebarFlyoutModeChangedFunc = undefined;
21557
+ this.animationCollapsed = undefined;
21558
+ }
21559
+ disposeActions(container) {
21560
+ if (!!container && !container.isDisposed) {
21561
+ container.dispose();
21562
+ }
21563
+ }
21564
+ onElementSelectedChanged(isSelected) {
21565
+ if (!isSelected)
21566
+ return;
21567
+ this.updateActionsProperties();
21568
+ }
21569
+ getExpandCollapseAction() {
21570
+ const collapseIcon = "icon-collapsepanel-16x16";
21571
+ const expandIcon = "icon-expandpanel-16x16";
21572
+ return {
21573
+ id: "collapse",
21574
+ css: "sv-action-bar-item--collapse",
21575
+ locTooltipName: new ComputedUpdater(() => this.collapsed ? "ed.expandTooltip" : "ed.collapseTooltip"),
21576
+ iconName: new ComputedUpdater(() => this.collapsed ? expandIcon : collapseIcon),
21577
+ iconSize: "auto",
21578
+ action: () => {
21579
+ this.collapsed = !this.collapsed;
21580
+ }
21581
+ };
21582
+ }
21583
+ cleanActionsContainer() {
21584
+ const container = this.actionContainerValue;
21585
+ if (!container)
21586
+ return;
21587
+ const actions = container.actions;
21588
+ container.setItems([]);
21589
+ actions.forEach(action => action.dispose && action.dispose());
21590
+ }
21591
+ updateActionsContainer(surveyElement) {
21592
+ if (!this.actionContainerValue)
21593
+ return;
21594
+ const actions = [];
21595
+ this.buildActions(actions);
21596
+ this.creator.onElementMenuItemsChanged(surveyElement, actions);
21597
+ this.actionContainerValue.setItems(actions);
21598
+ }
21599
+ updateActionsProperties() {
21600
+ if (this.isDisposed)
21601
+ return;
21602
+ this.updateActionsPropertiesCore();
21603
+ }
21604
+ updateActionsPropertiesCore() {
21605
+ this.updateElementAllowOptions(this.creator.getElementAllowOperations(this.surveyElement), this.isOperationsAllow());
21606
+ }
21607
+ getAllowDragging(options) {
21608
+ return options.allowDragging;
21609
+ }
21610
+ getAllowExpandCollapse(options) {
21611
+ return this.creator.expandCollapseButtonVisibility != "never" && (options.allowExpandCollapse == undefined || !!options.allowExpandCollapse);
21612
+ }
21613
+ updateElementAllowOptions(options, operationsAllow) {
21614
+ this.allowDragging = operationsAllow && this.getAllowDragging(options);
21615
+ this.allowExpandCollapse = this.getAllowExpandCollapse(options);
21616
+ this.allowEditOption = (options.allowEdit == undefined || !!options.allowEdit);
21617
+ this.updateActionVisibility("delete", operationsAllow && options.allowDelete);
21618
+ this.updateActionVisibility("duplicate", operationsAllow && options.allowCopy);
21619
+ this.updateActionVisibility("collapse", this.allowExpandCollapse);
21620
+ if (options.allowShowSettings === undefined) {
21621
+ const settingsVisibility = (options.allowEdit !== undefined) ? (operationsAllow && options.allowEdit) : this.creator.sidebar.flyoutMode;
21622
+ this.updateActionVisibility("settings", settingsVisibility);
21623
+ }
21624
+ else {
21625
+ this.updateActionVisibility("settings", options.allowShowSettings);
21626
+ }
21627
+ this.setShowAddQuestionButton(options.allowEdit !== false);
21628
+ }
21629
+ isOperationsAllow() {
21630
+ return !this.creator.readOnly;
21631
+ }
21632
+ updateActionVisibility(id, isVisible) {
21633
+ var _a, _b;
21634
+ var action = ((_a = this.actionContainerValue) === null || _a === void 0 ? void 0 : _a.getActionById(id)) || ((_b = this.topActionContainerValue) === null || _b === void 0 ? void 0 : _b.getActionById(id));
21635
+ if (!action) {
21636
+ this.actionVisibilityCache[id] = isVisible;
21637
+ }
21638
+ else {
21639
+ if (action.visible !== isVisible) {
21640
+ action.visible = isVisible;
21641
+ }
21642
+ }
21643
+ }
21644
+ updateActionsVisibility(isTop) {
21645
+ for (var key in this.actionVisibilityCache) {
21646
+ this.updateActionVisibility(key, this.actionVisibilityCache[key]);
21647
+ }
21648
+ }
21649
+ getActionById(id) {
21650
+ return this.actionContainer.getActionById(id) || this.topActionContainer.getActionById(id);
21651
+ }
21652
+ buildActions(items) {
21653
+ items.push(new Action({
21654
+ id: "duplicate",
21655
+ iconName: "icon-duplicate_16x16",
21656
+ css: "svc-action-bar-item--right",
21657
+ title: this.creator.getLocString("survey.duplicate"),
21658
+ visibleIndex: 10,
21659
+ iconSize: "auto",
21660
+ action: () => this.duplicate(),
21661
+ onFocus: (isMouse, event) => this.disableActionFocusing(isMouse, event)
21662
+ }));
21663
+ items.push(new Action({
21664
+ id: "settings",
21665
+ iconName: "icon-settings_16x16",
21666
+ css: "svc-action-bar-item--right",
21667
+ title: this.creator.getLocString("ed.settings"),
21668
+ locTooltipName: "ed.settingsTooltip",
21669
+ visibleIndex: 20,
21670
+ iconSize: "auto",
21671
+ action: () => {
21672
+ this.creator.setShowSidebar(true, true);
21673
+ if (!this.creator.isMobileView) {
21674
+ this.creator.sidebar.executeOnExpand(() => {
21675
+ this.creator.propertyGrid.getAllQuestions()[0].focus();
21676
+ });
21677
+ }
21678
+ }
21679
+ }));
21680
+ items.push(new Action({
21681
+ id: "delete",
21682
+ iconName: "icon-delete_16x16",
21683
+ css: "svc-action-bar-item--right",
21684
+ //needSeparator: items.length > 0,
21685
+ title: this.creator.getLocString("pe.delete"),
21686
+ visibleIndex: 30,
21687
+ iconSize: "auto",
21688
+ action: () => {
21689
+ this.delete();
21690
+ },
21691
+ onFocus: (isMouse, event) => this.disableActionFocusing(isMouse, event)
21692
+ }));
21693
+ }
21694
+ disableActionFocusing(isMouse, event) {
21695
+ this.isDisableSelecting = isMouse;
21696
+ }
21697
+ canSelectElement() {
21698
+ const res = !this.isDisableSelecting;
21699
+ this.isDisableSelecting = false;
21700
+ return res;
21701
+ }
21702
+ get allowEdit() {
21703
+ return !!this.creator && !this.creator.readOnly && this.allowEditOption;
21704
+ }
21705
+ get showAddQuestionButton() {
21706
+ return this.getPropertyValue("showAddQuestionButton");
21707
+ }
21708
+ setShowAddQuestionButton(val) {
21709
+ this.setPropertyValue("showAddQuestionButton", val && this.allowEdit && !!this.creator && this.creator.showAddQuestionButton);
21710
+ }
21711
+ duplicate() { }
21712
+ delete() {
21713
+ this.creator.deleteElement(this.surveyElement);
21714
+ }
21715
+ getCss() {
21716
+ return new CssClassBuilder().append("svc-hovered svc-hovered-ready", this.isHovered).toString();
21717
+ }
21718
+ }
21719
+ SurveyElementAdornerBase.AdornerValueName = "__sjs_creator_adorner";
21720
+ __decorate([
21721
+ property({ defaultValue: true })
21722
+ ], SurveyElementAdornerBase.prototype, "allowDragging", void 0);
21723
+ __decorate([
21724
+ property({ defaultValue: false })
21725
+ ], SurveyElementAdornerBase.prototype, "expandCollapseAnimationRunning", void 0);
21726
+ __decorate([
21727
+ property({ defaultValue: null })
21728
+ ], SurveyElementAdornerBase.prototype, "dropIndicatorPosition", void 0);
21729
+ __decorate([
21730
+ property({ defaultValue: false })
21731
+ ], SurveyElementAdornerBase.prototype, "isBeingDragged", void 0);
21732
+ __decorate([
21733
+ property({ defaultValue: true })
21734
+ ], SurveyElementAdornerBase.prototype, "needToRenderContent", void 0);
21735
+ __decorate([
21736
+ property({ defaultValue: true })
21737
+ ], SurveyElementAdornerBase.prototype, "allowExpandCollapse", void 0);
21738
+ __decorate([
21739
+ property({
21740
+ onSet: (val, target) => {
21741
+ target.renderedCollapsed = val;
21742
+ if (!val)
21743
+ target.needToRenderContent = true;
21744
+ if (target.creator.designerStateManager && target.surveyElement) {
21745
+ target.creator.designerStateManager.setElementCollapsed(target.surveyElement, val);
21746
+ }
21747
+ setTimeout(() => {
21748
+ target.creator.survey.pages.forEach(p => p.ensureRowsVisibility());
21749
+ target.creator.survey.getAllPanels().forEach(p => p.ensureRowsVisibility());
21750
+ }, 50);
21751
+ }
21752
+ })
21753
+ ], SurveyElementAdornerBase.prototype, "collapsed", void 0);
21754
+ __decorate([
21755
+ property()
21756
+ ], SurveyElementAdornerBase.prototype, "_renderedCollapsed", void 0);
21757
+ __decorate([
21758
+ property()
21759
+ ], SurveyElementAdornerBase.prototype, "isAnimationRunningCollapsed", void 0);
21760
+ __decorate([
21761
+ property({ defaultValue: false })
21762
+ ], SurveyElementAdornerBase.prototype, "isHovered", void 0);
21763
+
21764
+ var DropIndicatorPosition;
21765
+ (function (DropIndicatorPosition) {
21766
+ DropIndicatorPosition["Inside"] = "inside";
21767
+ DropIndicatorPosition["Top"] = "top";
21768
+ DropIndicatorPosition["Bottom"] = "bottom";
21769
+ DropIndicatorPosition["Right"] = "right";
21770
+ DropIndicatorPosition["Left"] = "left";
21771
+ })(DropIndicatorPosition || (DropIndicatorPosition = {}));
21772
+ var ElType;
21773
+ (function (ElType) {
21774
+ ElType["Page"] = "page";
21775
+ ElType["Panel"] = "panel";
21776
+ ElType["Question"] = "question";
21777
+ ElType["DynamicPanel"] = "dynamic-panel";
21778
+ ElType["EmptySurvey"] = "empty-survey";
21779
+ })(ElType || (ElType = {}));
21780
+
21781
+ function calculateIsEdge(dropTargetNode, clientY) {
21782
+ const rect = dropTargetNode.getBoundingClientRect();
21783
+ return clientY - rect.top <= DragDropSurveyElements.edgeHeight || rect.bottom - clientY <= DragDropSurveyElements.edgeHeight;
21784
+ }
21785
+ function calculateIsSide(dropTargetNode, clientX) {
21786
+ const rect = dropTargetNode.getBoundingClientRect();
21787
+ return clientX - rect.left <= DragDropSurveyElements.edgeHeight || rect.right - clientX <= DragDropSurveyElements.edgeHeight;
21788
+ }
21789
+ function calculateDragOverLocation(clientX, clientY, rect, direction = null) {
21790
+ const tg = rect.height / rect.width;
21791
+ const dx = clientX - rect.x;
21792
+ const dy = clientY - rect.y;
21793
+ if (direction == "top-bottom") {
21794
+ if (dy >= rect.height / 2) {
21795
+ return DropIndicatorPosition.Bottom;
21796
+ }
21797
+ else {
21798
+ return DropIndicatorPosition.Top;
21799
+ }
21800
+ }
21801
+ if (direction == "left-right") {
21802
+ if (dx >= rect.width / 2) {
21803
+ return DropIndicatorPosition.Right;
21804
+ }
21805
+ else {
21806
+ return DropIndicatorPosition.Left;
21807
+ }
21808
+ }
21809
+ if (dy >= tg * dx) {
21810
+ if (dy >= -tg * dx + rect.height) {
21811
+ return DropIndicatorPosition.Bottom;
21812
+ }
21813
+ else {
21814
+ return DropIndicatorPosition.Left;
21815
+ }
21816
+ }
21817
+ else {
21818
+ if (dy >= -tg * dx + rect.height) {
21819
+ return DropIndicatorPosition.Right;
21820
+ }
21821
+ else {
21822
+ return DropIndicatorPosition.Top;
21823
+ }
21824
+ }
21825
+ }
21826
+ class DragDropSurveyElements extends DragDropCore {
21827
+ constructor() {
21828
+ super(...arguments);
21829
+ this.insideElement = null;
21830
+ this.prevIsEdge = null;
21831
+ // protected ghostSurveyElement: IElement = null;
21832
+ this.dragOverIndicatorElement = null;
21833
+ this.isDraggedElementSelected = false;
21834
+ this.doBanDropHere = () => {
21835
+ this.removeDragOverMarker(this.dragOverIndicatorElement);
21836
+ this.removeDragOverMarker(this.dropTarget);
21837
+ };
21838
+ this.doDrop = () => {
21839
+ var _a;
21840
+ if (!this.dropTarget)
21841
+ return;
21842
+ if (!this.dragOverLocation)
21843
+ return;
21844
+ const page = this.parentElement;
21845
+ const dragged = this.draggedElement;
21846
+ const src = this.draggedElement;
21847
+ if (dragged.isPage && dragged instanceof PageModel) {
21848
+ const survey = dragged.survey;
21849
+ survey.startMovingPage();
21850
+ const indexOfDraggedPage = survey.pages.indexOf(dragged);
21851
+ survey.pages.splice(indexOfDraggedPage, 1);
21852
+ const indexOfDropTarget = survey.pages.indexOf(this.dropTarget) + (this.dragOverLocation === DropIndicatorPosition.Top ? 0 : 1);
21853
+ survey.pages.splice(indexOfDropTarget, 0, dragged);
21854
+ survey.stopMovingPage();
21855
+ if (indexOfDraggedPage !== indexOfDropTarget) {
21856
+ dragged["draggedFrom"] = indexOfDraggedPage < indexOfDropTarget ? indexOfDraggedPage : indexOfDraggedPage + 1;
21857
+ }
21858
+ return dragged;
21859
+ }
21860
+ const convertLocation = () => {
21861
+ switch (this.dragOverLocation) {
21862
+ case "top": return "top";
21863
+ case "bottom": return "bottom";
21864
+ case "right": return "right";
21865
+ case "left": return "left";
21866
+ default: return "bottom";
21867
+ }
21868
+ };
21869
+ const srcContainer = src.parent || src.page;
21870
+ if (!!srcContainer) {
21871
+ page.survey.startMovingQuestion();
21872
+ srcContainer.removeElement(src);
21873
+ }
21874
+ let dest = ((_a = this.dragOverIndicatorElement) === null || _a === void 0 ? void 0 : _a.isPanel) ? this.dragOverIndicatorElement : this.dropTarget;
21875
+ if (this.dragOverLocation === DropIndicatorPosition.Inside) {
21876
+ if (this.isPanelDynamic(dest))
21877
+ dest = dest.template;
21878
+ dest.insertElement(src);
21879
+ }
21880
+ else {
21881
+ const destParent = dest.parent || dest.page;
21882
+ if (destParent)
21883
+ destParent.insertElement(src, dest, convertLocation());
21884
+ }
21885
+ page.survey.stopMovingQuestion();
21886
+ return dragged;
21887
+ };
21888
+ }
21889
+ get draggedElementAdorner() {
21890
+ if (!this.draggedElement)
21891
+ return null;
21892
+ return SurveyElementAdornerBase.GetAdorner(this.draggedElement);
21893
+ }
21894
+ get dropTargetAdorner() {
21895
+ if (!this.dropTarget)
21896
+ return null;
21897
+ return SurveyElementAdornerBase.GetAdorner(this.dropTarget);
21898
+ }
21899
+ get draggedElementType() {
21900
+ if (!!this.draggedElement && this.draggedElement.isPage) {
21901
+ return "survey-page";
21902
+ }
21903
+ return "survey-element";
21904
+ }
21905
+ get maxNestedPanels() { return this.onGetMaxNestedPanels ? this.onGetMaxNestedPanels() : -1; }
21906
+ // private isRight: boolean;
21907
+ // protected prevIsRight: boolean;
21908
+ startDragToolboxItem(event, draggedElementJson, toolboxItemModel) {
21909
+ const draggedElement = this.createElementFromJson(draggedElementJson);
21910
+ draggedElement.toolboxItemTitle = toolboxItemModel.title;
21911
+ draggedElement.toolboxItemIconName = toolboxItemModel.iconName;
21912
+ this.startDrag(event, draggedElement);
21913
+ }
21914
+ startDragSurveyElement(event, draggedElement, isElementSelected) {
21915
+ this.isDraggedElementSelected = isElementSelected;
21916
+ this.startDrag(event, draggedElement);
21917
+ }
21918
+ getShortcutText(draggedElement) {
21919
+ if (draggedElement.isPage)
21920
+ return draggedElement.name;
21921
+ return draggedElement.toolboxItemTitle || super.getShortcutText(draggedElement);
21922
+ }
21923
+ createDraggedElementShortcut(text, draggedElementNode, event) {
21924
+ const draggedElementShortcut = document.createElement("div");
21925
+ draggedElementShortcut.style.display = "flex";
21926
+ const textSpan = document.createElement("span");
21927
+ textSpan.className = "svc-dragged-element-shortcut__text";
21928
+ textSpan.innerText = text;
21929
+ if (this.draggedElement.toolboxItemIconName) {
21930
+ draggedElementShortcut.appendChild(this.createDraggedElementIcon());
21931
+ }
21932
+ draggedElementShortcut.appendChild(textSpan);
21933
+ draggedElementShortcut.className = this.getDraggedElementClass();
21934
+ return draggedElementShortcut;
21935
+ }
21936
+ createDraggedElementIcon() {
21937
+ const span = document.createElement("span");
21938
+ span.className = "svc-dragged-element-shortcut__icon";
21939
+ const iconName = getIconNameFromProxy(this.draggedElement.toolboxItemIconName);
21940
+ const svgString = `<svg class="sv-svg-icon" role="img"><use xlink:href="#${iconName}"></use></svg>`;
21941
+ span.innerHTML = svgString;
21942
+ return span;
21943
+ }
21944
+ getDraggedElementClass() {
21945
+ let result = "svc-dragged-element-shortcut";
21946
+ if (!!this.draggedElement.toolboxItemIconName)
21947
+ result += " svc-dragged-element-shortcut--has-icon";
21948
+ if (this.isDraggedElementSelected)
21949
+ result += " svc-dragged-element-shortcut--selected";
21950
+ return result;
21951
+ }
21952
+ createElementFromJson(json) {
21953
+ const element = this.createNewElement(json);
21954
+ if (element["setSurveyImpl"]) {
21955
+ element["setSurveyImpl"](this.survey);
21956
+ }
21957
+ else {
21958
+ element["setData"](this.survey);
21959
+ }
21960
+ element.renderWidth = "100%";
21961
+ return element;
21962
+ }
21963
+ createNewElement(json) {
21964
+ var newElement = Serializer.createClass(json["type"]);
21965
+ new JsonObject().toObject(json, newElement);
21966
+ return newElement;
21967
+ }
21968
+ isPanelDynamic(element) {
21969
+ return element instanceof QuestionPanelDynamicModel;
21970
+ }
21971
+ findDropTargetNodeByDragOverNode(dragOverNode) {
21972
+ const ghostRow = dragOverNode.closest(".svc-row--ghost");
21973
+ if (!!ghostRow) {
21974
+ const ghostDataAttrSelector = "[data-sv-drop-target-survey-element='sv-drag-drop-ghost-survey-element-name']";
21975
+ const ghostNode = dragOverNode.closest(ghostDataAttrSelector) || dragOverNode.querySelector(ghostDataAttrSelector);
21976
+ if (!!ghostNode) {
21977
+ return ghostNode;
21978
+ }
21979
+ }
21980
+ const dropTargetNode = dragOverNode.closest(this.dropTargetDataAttributeName);
21981
+ return dropTargetNode;
21982
+ }
21983
+ getDropTargetByDataAttributeValue(dataAttributeValue, dropTargetNode, event) {
21984
+ const oldDragOverIndicatorElement = this.dragOverIndicatorElement;
21985
+ if (!dataAttributeValue) {
21986
+ // panel dynamic
21987
+ const nearestDropTargetElement = dropTargetNode.parentElement.closest(this.dropTargetDataAttributeName);
21988
+ dataAttributeValue = this.getDataAttributeValueByNode(nearestDropTargetElement);
21989
+ }
21990
+ if (!dataAttributeValue) {
21991
+ throw new Error("Can't find drop target survey element name");
21992
+ }
21993
+ if (dataAttributeValue === DragDropSurveyElements.ghostSurveyElementName) {
21994
+ return this.prevDropTarget;
21995
+ }
21996
+ // drop to new page
21997
+ if (dataAttributeValue === "newGhostPage") {
21998
+ return DragDropSurveyElements.newGhostPage;
21999
+ }
22000
+ // drop to page
22001
+ let page = this.survey.getPageByName(dataAttributeValue);
22002
+ if (page) {
22003
+ return page;
22004
+ }
22005
+ // drop to question or panel
22006
+ let dropTarget;
22007
+ let dragOverElement;
22008
+ this.survey.pages.forEach((page) => {
22009
+ const question = page.getElementByName(dataAttributeValue);
22010
+ if (question) {
22011
+ dropTarget = question;
22012
+ dragOverElement = question;
22013
+ }
22014
+ });
22015
+ // drop to matrix detail panel
22016
+ if ((dropTarget.getType() === "matrixdropdown" || dropTarget.getType() === "matrixdynamic") && dropTarget.detailPanelMode !== "none" && this.insideElement) {
22017
+ dropTarget = dropTarget.detailPanel;
22018
+ }
22019
+ // drop to question
22020
+ //question inside paneldymanic
22021
+ if (!dropTarget.page) {
22022
+ const nearestDropTargetPageElement = dropTargetNode.parentElement.closest("[data-sv-drop-target-page]");
22023
+ dataAttributeValue = nearestDropTargetPageElement.dataset.svDropTargetPage;
22024
+ let page = this.survey.getPageByName(dataAttributeValue);
22025
+ dropTarget.__page = page;
22026
+ }
22027
+ this.dragOverIndicatorElement = dragOverElement;
22028
+ if (this.dragOverIndicatorElement != oldDragOverIndicatorElement) {
22029
+ this.removeDragOverMarker(oldDragOverIndicatorElement);
22030
+ }
22031
+ return dropTarget;
22032
+ // EO drop to question or panel
22033
+ }
22034
+ isDropTargetValid(dropTarget, dropTargetNode, dragOverLocation = DropIndicatorPosition.Top) {
22035
+ if (!dropTarget)
22036
+ return false;
22037
+ if (dropTarget === this.draggedElement)
22038
+ return false;
22039
+ if (this.draggedElement.getType() === "paneldynamic" && dropTarget === this.draggedElement.template) {
22040
+ return false;
22041
+ }
22042
+ if (this.maxNestedPanels >= 0 && this.draggedElement.isPanel) {
22043
+ const pnl = this.draggedElement;
22044
+ if (pnl.deepNested === undefined) {
22045
+ pnl.deepNested = this.getMaximumNestedPanelCount(pnl, 0);
22046
+ }
22047
+ let len = SurveyHelper.getElementDeepLength(dropTarget);
22048
+ if (dragOverLocation !== DropIndicatorPosition.Inside && dropTarget.isPanel)
22049
+ len--;
22050
+ if (this.maxNestedPanels < len + pnl.deepNested)
22051
+ return false;
22052
+ }
22053
+ if (DragDropSurveyElements.restrictDragQuestionBetweenPages &&
22054
+ this.shouldRestricDragQuestionBetweenPages(dropTarget)) {
22055
+ return false;
22056
+ }
22057
+ return true;
22058
+ }
22059
+ getMaximumNestedPanelCount(panel, deep) {
22060
+ let max = deep;
22061
+ panel.elements.forEach(el => {
22062
+ if (el.isPanel) {
22063
+ const pDeep = this.getMaximumNestedPanelCount(el, deep + 1);
22064
+ if (pDeep > max) {
22065
+ max = pDeep;
22066
+ }
22067
+ }
22068
+ });
22069
+ return max;
22129
22070
  }
22130
- dispose() {
22131
- this.searchManager.dispose();
22132
- this.nextSelectionAction.dispose();
22133
- this.prevSelectionAction.dispose();
22134
- this.objectSelectionAction.dispose();
22135
- this.selectorPopupModel.dispose();
22136
- super.dispose();
22071
+ shouldRestricDragQuestionBetweenPages(dropTarget) {
22072
+ const oldPage = this.draggedElement["page"];
22073
+ const newPage = dropTarget.isPage ? dropTarget : dropTarget["page"];
22074
+ // if oldPage === null then it is drop from the toolbox
22075
+ return oldPage && oldPage !== newPage;
22137
22076
  }
22138
- }
22139
- __decorate([
22140
- property()
22141
- ], PropertyGridViewModel.prototype, "hasPrev", void 0);
22142
- __decorate([
22143
- property()
22144
- ], PropertyGridViewModel.prototype, "hasNext", void 0);
22145
- __decorate([
22146
- property()
22147
- ], PropertyGridViewModel.prototype, "selectedElementName", void 0);
22148
- __decorate([
22149
- property({
22150
- onSet: (newValue, target) => {
22151
- target.searchManager.isVisible = newValue;
22077
+ findDeepestDropTargetChild(parent) {
22078
+ const selector = this.dropTargetDataAttributeName;
22079
+ let result = parent;
22080
+ while (!!parent) {
22081
+ result = parent;
22082
+ parent = parent.querySelector(selector);
22152
22083
  }
22153
- })
22154
- ], PropertyGridViewModel.prototype, "searchEnabled", void 0);
22155
- __decorate([
22156
- property()
22157
- ], PropertyGridViewModel.prototype, "showPlaceholder", void 0);
22158
-
22159
- class PagesController extends Base {
22160
- constructor(creator) {
22161
- super();
22162
- this.creator = creator;
22163
- this.onPagesChanged = this.addEvent();
22164
- this.onCurrentPageChanged = this.addEvent();
22165
- this.currentPageChangedFunc = (sender, options) => {
22166
- this.page2Display = this.survey.currentPage;
22167
- this.onCurrentPageChanged.fire(this, {});
22084
+ return result;
22085
+ }
22086
+ isAllowDragOver(dropTarget, dragOverLocation) {
22087
+ if (!this.survey || this.survey.onDragDropAllow.isEmpty)
22088
+ return true;
22089
+ const allowOptions = {
22090
+ allow: true,
22091
+ parent: this.parentElement,
22092
+ source: this.draggedElement,
22093
+ toElement: dropTarget,
22094
+ draggedElement: this.draggedElement,
22095
+ fromElement: this.draggedElement.parent,
22096
+ target: dropTarget,
22097
+ insertAfter: undefined,
22098
+ insertBefore: undefined,
22099
+ allowDropNextToAnother: true
22168
22100
  };
22169
- this.onSurveyChanged();
22101
+ if (dragOverLocation === DropIndicatorPosition.Bottom || dragOverLocation === DropIndicatorPosition.Right) {
22102
+ allowOptions.insertAfter = dropTarget;
22103
+ }
22104
+ if (dragOverLocation === DropIndicatorPosition.Top || dragOverLocation === DropIndicatorPosition.Left) {
22105
+ allowOptions.insertBefore = dropTarget;
22106
+ }
22107
+ this.survey.onDragDropAllow.fire(this.survey, allowOptions);
22108
+ if (!allowOptions.allowDropNextToAnother) {
22109
+ if (dragOverLocation === DropIndicatorPosition.Left) {
22110
+ this.dragOverLocation = DropIndicatorPosition.Top;
22111
+ }
22112
+ if (dragOverLocation === DropIndicatorPosition.Right) {
22113
+ this.dragOverLocation = DropIndicatorPosition.Bottom;
22114
+ }
22115
+ }
22116
+ return allowOptions.allow;
22170
22117
  }
22171
- get survey() {
22172
- return this.creator.survey;
22118
+ dragOverCore(dropTarget, dragOverLocation) {
22119
+ const oldDragOverIndicatorElement = this.dragOverIndicatorElement;
22120
+ const oldDropTarget = this.dropTarget;
22121
+ if (this.isSameElement(dropTarget)) {
22122
+ this.allowDropHere = false;
22123
+ return;
22124
+ }
22125
+ this.dropTarget = dropTarget;
22126
+ this.dragOverLocation = dragOverLocation;
22127
+ this.parentElement = this.dropTarget.isPage
22128
+ ? this.dropTarget
22129
+ : (this.dropTarget.page || this.dropTarget.__page);
22130
+ if (!this.isAllowDragOver(dropTarget, dragOverLocation)) {
22131
+ this.allowDropHere = false;
22132
+ return;
22133
+ }
22134
+ if (dragOverLocation == DropIndicatorPosition.Inside) {
22135
+ this.dragOverIndicatorElement = this.dropTarget;
22136
+ this.dropTargetAdorner.dropIndicatorPosition = DropIndicatorPosition.Inside;
22137
+ }
22138
+ else {
22139
+ const row = this.dragDropFindRow(this.dropTarget, this.parentElement);
22140
+ if (!!row && row.elements.length > 1 && (this.dragOverLocation === DropIndicatorPosition.Top || this.dragOverLocation === DropIndicatorPosition.Bottom)) {
22141
+ this.dragOverIndicatorElement = row;
22142
+ const adorner = SurveyElementAdornerBase.GetAdorner(row);
22143
+ if (adorner) {
22144
+ adorner.dropIndicatorPosition = this.dragOverLocation;
22145
+ }
22146
+ }
22147
+ else {
22148
+ this.dragOverIndicatorElement = this.dropTarget;
22149
+ if (this.draggedElement.isPage) {
22150
+ if (this.dragOverLocation === DropIndicatorPosition.Top || this.dragOverLocation === DropIndicatorPosition.Bottom) {
22151
+ this.dropTargetAdorner.dropIndicatorPosition = this.dragOverLocation;
22152
+ }
22153
+ else {
22154
+ this.dropTargetAdorner.dropIndicatorPosition = this.dragOverLocation;
22155
+ }
22156
+ }
22157
+ else {
22158
+ this.dropTargetAdorner.dropIndicatorPosition = this.dragOverLocation;
22159
+ }
22160
+ }
22161
+ }
22162
+ if (this.dragOverIndicatorElement != oldDragOverIndicatorElement)
22163
+ this.removeDragOverMarker(oldDragOverIndicatorElement);
22164
+ if (this.dropTarget != oldDropTarget)
22165
+ this.removeDragOverMarker(oldDropTarget);
22173
22166
  }
22174
- get pages() {
22175
- return this.survey.pages;
22167
+ dragDropFindRow(findElement, panel) {
22168
+ if (!findElement || findElement.isPage)
22169
+ return null;
22170
+ var element = findElement;
22171
+ var rows = panel.rows;
22172
+ for (var i = 0; i < rows.length; i++) {
22173
+ if (rows[i].elements.indexOf(element) > -1)
22174
+ return rows[i];
22175
+ }
22176
+ for (var i = 0; i < panel.elements.length; i++) {
22177
+ var pnl = panel.elements[i].getPanel();
22178
+ if (!pnl)
22179
+ continue;
22180
+ var row = this.dragDropFindRow(element, pnl);
22181
+ if (!!row)
22182
+ return row;
22183
+ }
22184
+ return null;
22176
22185
  }
22177
- get currentPage() {
22178
- return this.survey.currentPage;
22186
+ isSameElement(target) {
22187
+ while (!!target) {
22188
+ if (target === this.draggedElement)
22189
+ return true;
22190
+ target = target.parent;
22191
+ }
22192
+ return false;
22179
22193
  }
22180
- set currentPage(value) {
22181
- this.survey.currentPage = value;
22182
- this.page2Display = value;
22194
+ isDragInsideItself(dragOverNodes) {
22195
+ let result = false;
22196
+ dragOverNodes.forEach((node) => {
22197
+ if (node.classList.contains("svc-question__content--dragged")) {
22198
+ result = true;
22199
+ }
22200
+ });
22201
+ return result;
22183
22202
  }
22184
- selectPage(value) {
22185
- this.currentPage = value;
22186
- this.creator.selectElement(value);
22203
+ getDragDropElementType(element) {
22204
+ if (element.isPage)
22205
+ return ElType.Page;
22206
+ if (element.isPanel)
22207
+ return ElType.Panel;
22208
+ if (element instanceof QuestionPanelDynamicModel)
22209
+ return ElType.DynamicPanel;
22210
+ return ElType.Question;
22187
22211
  }
22188
- getDisplayName(page) {
22189
- if (!page)
22190
- return "";
22191
- return this.creator.getObjectDisplayName(page, "page-selector");
22212
+ dragOver(event) {
22213
+ const dropTargetNode = this.findDropTargetNodeFromPoint(event.clientX, event.clientY);
22214
+ if (!dropTargetNode) {
22215
+ this.banDropHere();
22216
+ return;
22217
+ }
22218
+ if (document && document.elementsFromPoint && this.isDragInsideItself(document.elementsFromPoint(event.clientX, event.clientY))) {
22219
+ this.banDropHere();
22220
+ return null;
22221
+ }
22222
+ const oldinsideElement = this.insideElement;
22223
+ this.insideElement = !calculateIsEdge(dropTargetNode, event.clientY) && !calculateIsSide(dropTargetNode, event.clientX);
22224
+ const dropTarget = this.getDropTargetByNode(dropTargetNode, event);
22225
+ const dropTargetAdorner = SurveyElementAdornerBase.GetAdorner(dropTarget);
22226
+ if (!!oldinsideElement != !!this.insideElement) {
22227
+ dropTargetAdorner.dropIndicatorPosition = null;
22228
+ }
22229
+ const dropTargetRect = dropTargetNode.getBoundingClientRect();
22230
+ const calcDirection = !settings.dragDrop.allowDragToTheSameLine || (!!this.draggedElement && this.draggedElement.isPage) ? "top-bottom" : null;
22231
+ let dragOverLocation = calculateDragOverLocation(event.clientX, event.clientY, dropTargetRect, calcDirection);
22232
+ if (!this.draggedElement.isPage && dropTarget && ((dropTarget.isPanel || dropTarget.isPage) && dropTarget.elements.length === 0 || this.isPanelDynamic(dropTarget) && dropTarget.template.elements.length == 0)) {
22233
+ if (dropTarget.isPage || this.insideElement) {
22234
+ dragOverLocation = DropIndicatorPosition.Inside;
22235
+ }
22236
+ }
22237
+ if (!this.draggedElement.isPage && dropTarget.isPage && dropTargetAdorner.collapsed) {
22238
+ dragOverLocation = DropIndicatorPosition.Inside;
22239
+ }
22240
+ if ((dropTarget.isPanel || this.isPanelDynamic(dropTarget)) && this.insideElement && dropTargetAdorner.collapsed) {
22241
+ dragOverLocation = DropIndicatorPosition.Inside;
22242
+ }
22243
+ if (!this.draggedElement.isPage && dropTarget.isPage && dropTarget.elements.length !== 0 && !dropTargetAdorner.collapsed) {
22244
+ dragOverLocation = null;
22245
+ }
22246
+ // const dropTargetType = this.getDragDropElementType(dropTarget);
22247
+ // const draggedElementType = this.getDragDropElementType(this.draggedElement);
22248
+ // switch (dropTargetType) {
22249
+ // case ElType.Page: {
22250
+ // console.log("dropTargetType", dropTargetType);
22251
+ // break;
22252
+ // }
22253
+ // case ElType.Panel: {
22254
+ // console.log("dropTargetType", dropTargetType);
22255
+ // break;
22256
+ // }
22257
+ // case ElType.DynamicPanel: {
22258
+ // console.log("dropTargetType", dropTargetType);
22259
+ // break;
22260
+ // }
22261
+ // case ElType.Question: {
22262
+ // console.log("dropTargetType", dropTargetType);
22263
+ // break;
22264
+ // }
22265
+ // // case ElType.EmptySurvey: {
22266
+ // // console.log("dropTargetType", dropTargetType);
22267
+ // // break;
22268
+ // // }
22269
+ // }
22270
+ const options = {
22271
+ survey: this.survey,
22272
+ draggedSurveyElement: this.draggedElement,
22273
+ dragOverSurveyElement: dropTarget,
22274
+ clientX: event.clientX,
22275
+ clientY: event.clientY,
22276
+ dragOverRect: dropTargetRect,
22277
+ insideElement: this.insideElement,
22278
+ dragOverLocation
22279
+ };
22280
+ if (this.onDragOverLocationCalculating) {
22281
+ this.onDragOverLocationCalculating(options);
22282
+ dragOverLocation = options.dragOverLocation;
22283
+ this.insideElement = options.insideElement;
22284
+ }
22285
+ const isDropTargetValid = this.isDropTargetValid(dropTarget, dropTargetNode, dragOverLocation);
22286
+ if (!isDropTargetValid) {
22287
+ this.banDropHere();
22288
+ return;
22289
+ }
22290
+ this.allowDropHere = true;
22291
+ this.dragOverCore(dropTarget, dragOverLocation);
22192
22292
  }
22193
- raisePagesChanged() {
22194
- this.page2Display = this.survey.currentPage;
22195
- this.onPagesChanged.fire(this, {});
22293
+ onStartDrag() {
22294
+ // this.ghostSurveyElement = this.createGhostSurveyElement();
22295
+ if (this.draggedElementAdorner) {
22296
+ this.draggedElementAdorner.isBeingDragged = true;
22297
+ }
22196
22298
  }
22197
- onSurveyChanged() {
22198
- this.removeFunctions();
22199
- this.surveyValue = this.creator.survey;
22200
- if (!this.surveyValue)
22299
+ moveElementInPanel(panel, src, target, targetIndex) {
22300
+ var srcIndex = src.parent.elements.indexOf(src);
22301
+ if (targetIndex > srcIndex) {
22302
+ targetIndex--;
22303
+ }
22304
+ if (src === target && srcIndex === targetIndex) {
22201
22305
  return;
22202
- this.raisePagesChanged();
22203
- this.page2Display = this.survey.currentPage;
22204
- this.surveyValue.onCurrentPageChanged.add(this.currentPageChangedFunc);
22306
+ }
22307
+ panel.removeElement(src);
22308
+ panel.addElement(target, targetIndex);
22205
22309
  }
22206
- dispose() {
22207
- super.dispose();
22208
- this.removeFunctions();
22310
+ removeDragOverMarker(dropTarget) {
22311
+ if (dropTarget) {
22312
+ const adorner = SurveyElementAdornerBase.GetAdorner(dropTarget);
22313
+ if (adorner) {
22314
+ adorner.dropIndicatorPosition = null;
22315
+ }
22316
+ }
22209
22317
  }
22210
- removeFunctions() {
22211
- if (!!this.surveyValue && !this.surveyValue.isDisposed) {
22212
- this.surveyValue.onCurrentPageChanged.remove(this.currentPageChangedFunc);
22318
+ clear() {
22319
+ this.insideElement = null;
22320
+ this.removeDragOverMarker(this.prevDropTarget);
22321
+ this.removeDragOverMarker(this.dropTarget);
22322
+ this.removeDragOverMarker(this.dragOverIndicatorElement);
22323
+ if (this.draggedElement && this.draggedElementAdorner) {
22324
+ this.draggedElementAdorner.isBeingDragged = false;
22325
+ }
22326
+ super.clear();
22327
+ }
22328
+ getTargetParent(dropTarget) {
22329
+ let targetParent = dropTarget.isPage || dropTarget.isPanel ? dropTarget : dropTarget.parent;
22330
+ if (dropTarget.getType() === "paneldynamic") {
22331
+ targetParent = dropTarget.templateValue;
22213
22332
  }
22333
+ return targetParent;
22334
+ }
22335
+ getTargetRow(dropTarget) {
22336
+ const targetParent = this.getTargetParent(dropTarget);
22337
+ let targetRow;
22338
+ targetParent.rows.forEach((row) => {
22339
+ if (row.elements.indexOf(dropTarget) !== -1) {
22340
+ targetRow = row;
22341
+ }
22342
+ });
22343
+ return targetRow;
22214
22344
  }
22215
22345
  }
22216
- __decorate([
22217
- property()
22218
- ], PagesController.prototype, "page2Display", void 0);
22346
+ DragDropSurveyElements.newGhostPage = null;
22347
+ DragDropSurveyElements.restrictDragQuestionBetweenPages = false;
22348
+ DragDropSurveyElements.edgeHeight = 30;
22349
+ DragDropSurveyElements.nestedPanelDepth = -1;
22350
+ DragDropSurveyElements.ghostSurveyElementName = "sv-drag-drop-ghost-survey-element-name"; // before renaming use globa search (we have also css selectors)
22219
22351
 
22220
22352
  const designTabSurveyThemeJSON = {
22221
22353
  "cssVariables": {
@@ -22732,6 +22864,14 @@ class DesignerStateManager {
22732
22864
  stateMap[newName] = new ElementState();
22733
22865
  }, "designerStateManager");
22734
22866
  }
22867
+ getElementCollapsed(element) {
22868
+ return this.getElementState(element).collapsed;
22869
+ }
22870
+ setElementCollapsed(element, isCollapsed) {
22871
+ if (this.isSuspended)
22872
+ return;
22873
+ this.getElementState(element).collapsed = isCollapsed;
22874
+ }
22735
22875
  getElementState(element) {
22736
22876
  return this.createElementState(element, true);
22737
22877
  }
@@ -22761,38 +22901,6 @@ class DesignerStateManager {
22761
22901
  }
22762
22902
  }
22763
22903
 
22764
- const pgTabIcons = {
22765
- "appearance": "icon-pg-appearance-24x24",
22766
- "background": "icon-pg-background-24x24",
22767
- "columns": "icon-pg-columns-24x24",
22768
- "logic": "icon-pg-conditions-24x24",
22769
- "data": "icon-pg-data-24x24",
22770
- "design": "icon-pg-design-24x24",
22771
- "general": "icon-pg-general-24x24",
22772
- "header": "icon-pg-header-24x24",
22773
- "language": "icon-pg-language-24x24",
22774
- "layout": "icon-pg-design-24x24",
22775
- "logo": "icon-pg-logo-24x24",
22776
- "navigation": "icon-pg-navigation-24x24",
22777
- "pages": "icon-pg-pages-24x24",
22778
- "question": "icon-pg-questiondesign-24x24",
22779
- "questionSettings": "icon-pg-questiondesign-24x24",
22780
- "timer": "icon-pg-quiz-24x24",
22781
- "rows": "icon-pg-rows-24x24",
22782
- "specific": "icon-pg-specific-24x24",
22783
- "showOnCompleted": "icon-pg-thankyyoupage-24x24",
22784
- "themes": "icon-pg-themes-24x24",
22785
- "totals": "icon-pg-totals-24x24",
22786
- "validation": "icon-pg-validation-24x24",
22787
- "cells": "icon-pg-specific-24x24",
22788
- "items": "icon-pg-specific-24x24",
22789
- "mask": "icon-pg-specific-24x24",
22790
- "rateValues": "icon-pg-specific-24x24",
22791
- "choices": "icon-pg-specific-24x24",
22792
- "choicesByUrl": "icon-pg-webservice-24x24",
22793
- "undefined": "icon-pg-undefined-24x24",
22794
- };
22795
-
22796
22904
  const creatorThemeModelProperties = {
22797
22905
  "creatortheme": {
22798
22906
  properties: [
@@ -22878,7 +22986,7 @@ class DomDocumentHelper {
22878
22986
  }
22879
22987
  class CreatorStylesManager {
22880
22988
  static findSheet(styleSheetId) {
22881
- if (typeof document === "undefined")
22989
+ if (!DomDocumentHelper.isAvailable())
22882
22990
  return null;
22883
22991
  for (let i = 0; i < document.styleSheets.length; i++) {
22884
22992
  if (!!document.styleSheets[i].ownerNode && document.styleSheets[i].ownerNode["id"] === styleSheetId) {
@@ -22888,6 +22996,8 @@ class CreatorStylesManager {
22888
22996
  return null;
22889
22997
  }
22890
22998
  static createSheet(styleSheetId) {
22999
+ if (!DomDocumentHelper.isAvailable())
23000
+ return null;
22891
23001
  let style = DomDocumentHelper.createElement("style");
22892
23002
  style.id = styleSheetId;
22893
23003
  style.appendChild(new Text(""));
@@ -22900,13 +23010,15 @@ class CreatorStylesManager {
22900
23010
  if (!sheet) {
22901
23011
  sheet = CreatorStylesManager.createSheet(CreatorStylesManager.SurveyJSCreatorStylesSheetId);
22902
23012
  }
22903
- if (Object.keys(rules).length) {
22904
- rules.forEach((rule) => {
22905
- try {
22906
- sheet.insertRule(`${rule.selector} { ${rule.styles} }`, 0);
22907
- }
22908
- catch (e) { }
22909
- });
23013
+ if (sheet) {
23014
+ if (Object.keys(rules).length) {
23015
+ rules.forEach((rule) => {
23016
+ try {
23017
+ sheet.insertRule(`${rule.selector} { ${rule.styles} }`, 0);
23018
+ }
23019
+ catch (e) { }
23020
+ });
23021
+ }
22910
23022
  }
22911
23023
  }
22912
23024
  }
@@ -23628,7 +23740,7 @@ class TabDesignerPlugin {
23628
23740
  const action = new MenuButton({
23629
23741
  id: p.name,
23630
23742
  tooltip: p.title,
23631
- iconName: pgTabIcons[p.name] || pgTabIcons["undefined"],
23743
+ iconName: p["iconName"],
23632
23744
  iconSize: "auto",
23633
23745
  active: this.activePageIsPropertyGrid && p.name === this.propertyGrid.survey.currentPage.name,
23634
23746
  pressed: false,
@@ -23669,7 +23781,6 @@ class TabDesignerPlugin {
23669
23781
  this.creator.sidebar.sideAreaComponentData = undefined;
23670
23782
  this.creator.sidebar.onPropertyChanged.clear();
23671
23783
  this.creator.sidebar.header.reset();
23672
- this.creator.expandCollapseManager.clear();
23673
23784
  return true;
23674
23785
  }
23675
23786
  onDesignerSurveyPropertyChanged(obj, propName) {
@@ -24593,6 +24704,9 @@ class StringEditorViewModelBase extends Base {
24593
24704
  this.blurredByEscape = false;
24594
24705
  this.focusedProgram = false;
24595
24706
  this.characterCounter = new CharacterCounter();
24707
+ this.onLocaleChanged = () => {
24708
+ this.resetPropertyValue("placeholderValue");
24709
+ };
24596
24710
  this.activate = () => {
24597
24711
  const element = this.getEditorElement();
24598
24712
  if (element && element.offsetParent != null) {
@@ -24605,6 +24719,7 @@ class StringEditorViewModelBase extends Base {
24605
24719
  this.justFocused = false;
24606
24720
  this.locString = locString;
24607
24721
  this.checkMarkdownToTextConversion(this.locString.owner, this.locString.name);
24722
+ this.addCreatorEvents();
24608
24723
  }
24609
24724
  afterRender() {
24610
24725
  if (this.connector.focusOnEditor) {
@@ -24614,20 +24729,33 @@ class StringEditorViewModelBase extends Base {
24614
24729
  }
24615
24730
  detachFromUI() {
24616
24731
  var _a;
24732
+ this.removeCreatorEvents();
24617
24733
  (_a = this.connector) === null || _a === void 0 ? void 0 : _a.onDoActivate.remove(this.activate);
24618
24734
  this.getEditorElement = undefined;
24619
24735
  this.blurEditor = undefined;
24620
24736
  }
24621
24737
  dispose() {
24738
+ var _a;
24739
+ (_a = this.creator) === null || _a === void 0 ? void 0 : _a.onLocaleChanded.remove(this.onLocaleChanged);
24622
24740
  super.dispose();
24623
24741
  this.detachFromUI();
24624
24742
  }
24743
+ addCreatorEvents() {
24744
+ var _a;
24745
+ (_a = this.creator) === null || _a === void 0 ? void 0 : _a.onLocaleChanded.add(this.onLocaleChanged);
24746
+ }
24747
+ removeCreatorEvents() {
24748
+ var _a;
24749
+ (_a = this.creator) === null || _a === void 0 ? void 0 : _a.onLocaleChanded.remove(this.onLocaleChanged);
24750
+ }
24625
24751
  setLocString(locString) {
24626
24752
  var _a;
24753
+ this.removeCreatorEvents();
24627
24754
  (_a = this.connector) === null || _a === void 0 ? void 0 : _a.onDoActivate.remove(this.activate);
24628
24755
  this.locString = locString;
24629
24756
  this.connector = StringEditorConnector.get(locString);
24630
24757
  this.connector.onDoActivate.add(this.activate);
24758
+ this.addCreatorEvents();
24631
24759
  }
24632
24760
  checkConstraints(event) {
24633
24761
  if (!this.compostionInProgress && this.maxLength > 0 && event.keyCode >= 32) {
@@ -25443,7 +25571,7 @@ class ThemeTabPlugin {
25443
25571
  const action = new MenuButton({
25444
25572
  id: p.name,
25445
25573
  tooltip: p.title,
25446
- iconName: pgTabIcons[p.name] || pgTabIcons["undefined"],
25574
+ iconName: p["iconName"],
25447
25575
  iconSize: "auto",
25448
25576
  active: p.name === this.propertyGrid.survey.currentPage.name,
25449
25577
  pressed: false,
@@ -25967,7 +26095,6 @@ class ExpandCollapseManager {
25967
26095
  constructor(creator) {
25968
26096
  this.creator = creator;
25969
26097
  this._lockQuestions = false;
25970
- this.adorners = [];
25971
26098
  }
25972
26099
  expandCollapseElements(reason, isCollapsed, elements = null) {
25973
26100
  this.updateCollapsed(elements || this.getCollapsableElements(), isCollapsed, reason);
@@ -25983,38 +26110,26 @@ class ExpandCollapseManager {
25983
26110
  .concat(this.creator.survey.getAllPanels())
25984
26111
  .concat(this.creator.survey.getAllQuestions());
25985
26112
  }
26113
+ sortElements(elements) {
26114
+ return [].concat(elements).sort((el, el2) => {
26115
+ const a = el.isPage ? 2 : el.isPanel ? 1 : 0;
26116
+ const b = el2.isPage ? 2 : el2.isPanel ? 1 : 0;
26117
+ return a - b;
26118
+ });
26119
+ }
25986
26120
  updateCollapsed(elements, value, reason) {
25987
- const canToSaveToStateManager = this.creator.designerStateManager && !this.creator.designerStateManager.isSuspended;
25988
- elements.forEach(element => {
26121
+ this.sortElements(elements).forEach(element => {
26122
+ var _a;
25989
26123
  if (element.isQuestion && this._lockQuestions)
25990
26124
  return;
25991
- if (canToSaveToStateManager) {
25992
- this.creator.designerStateManager.getElementState(element).collapsed =
25993
- this.creator.getElementExpandCollapseState(element, reason, value);
26125
+ const collapsed = this.creator.getElementExpandCollapseState(element, reason, value);
26126
+ (_a = this.creator.designerStateManager) === null || _a === void 0 ? void 0 : _a.setElementCollapsed(element, collapsed);
26127
+ const adorner = SurveyElementAdornerBase.GetAdorner(element);
26128
+ if (adorner && adorner.allowExpandCollapse) {
26129
+ const newState = this.creator.getElementExpandCollapseState(element, reason, value);
26130
+ adorner.collapsed = newState;
25994
26131
  }
25995
26132
  });
25996
- for (let i = this.adorners.length - 1; i >= 0; i--) {
25997
- const element = this.adorners[i].element;
25998
- if (element.isQuestion && this._lockQuestions)
25999
- continue;
26000
- if (elements.indexOf(element) == -1)
26001
- continue;
26002
- if (this.adorners[i].allowExpandCollapse) {
26003
- let newState = canToSaveToStateManager ?
26004
- this.creator.designerStateManager.getElementState(element).collapsed :
26005
- this.creator.getElementExpandCollapseState(element, reason, value);
26006
- this.adorners[i].collapsed = newState;
26007
- }
26008
- }
26009
- }
26010
- add(adorner) {
26011
- this.adorners.push(adorner);
26012
- }
26013
- remove(adorner) {
26014
- this.adorners.splice(this.adorners.indexOf(adorner), 1);
26015
- }
26016
- clear() {
26017
- this.adorners.length = 0;
26018
26133
  }
26019
26134
  }
26020
26135
 
@@ -26051,6 +26166,9 @@ class TabbedMenuContainer extends AdaptiveActionContainer {
26051
26166
  this.creator = creator;
26052
26167
  this.dotsItem.popupModel.horizontalPosition = "center";
26053
26168
  this.dotsItem.popupModel.cssClass += " svc-tabbed-menu-item__popup svc-creator-popup";
26169
+ this.dotsItem.css += " svc-tabbed-menu-dots";
26170
+ this.dotsItem.innerCss += " svc-tabbed-menu-dots__item";
26171
+ this.dotsItem.iconSize = "auto";
26054
26172
  this.hiddenItemsListModel.cssClasses = listComponentCss;
26055
26173
  this.minVisibleItemsCount = 1;
26056
26174
  }
@@ -26084,6 +26202,210 @@ class TabbedMenuContainer extends AdaptiveActionContainer {
26084
26202
  }
26085
26203
  }
26086
26204
 
26205
+ function doMachineStringsTranslation(survey, creatorOptions, locales) {
26206
+ locales.forEach(loc => {
26207
+ const locStrs = getUnlocalizedStrings(survey);
26208
+ if (locStrs.length > 0) {
26209
+ const locStrsHash = {};
26210
+ const defaultStrs = new Array();
26211
+ locStrs.forEach(locStr => {
26212
+ let text = locStr.getLocaleText("");
26213
+ if (!text && locStr.onGetTextCallback) {
26214
+ text = locStr.onGetTextCallback("");
26215
+ if (isTextNonTranslated(text)) {
26216
+ text = undefined;
26217
+ }
26218
+ }
26219
+ if (!!text) {
26220
+ if (!locStrsHash[text]) {
26221
+ locStrsHash[text] = [];
26222
+ defaultStrs.push(text);
26223
+ }
26224
+ locStrsHash[text].push(locStr);
26225
+ }
26226
+ });
26227
+ creatorOptions.doMachineTranslation(surveyLocalization.defaultLocale, loc, defaultStrs, (translated) => {
26228
+ if (!!translated && translated.length === defaultStrs.length) {
26229
+ creatorOptions.startUndoRedoTransaction("Translate to " + loc);
26230
+ for (let i = 0; i < defaultStrs.length; i++) {
26231
+ locStrsHash[defaultStrs[i]].forEach(locStr => locStr.setLocaleText(loc, translated[i]));
26232
+ }
26233
+ creatorOptions.stopUndoRedoTransaction();
26234
+ }
26235
+ });
26236
+ }
26237
+ });
26238
+ }
26239
+ function getUnlocalizedStrings(survey, creatorOptions, loc) {
26240
+ const res = new Array();
26241
+ const options = {
26242
+ canShowProperty: (reason, obj, property, locStr, isShowing, defaultValue) => {
26243
+ return isShowing && (!locStr || !(locStr === null || locStr === void 0 ? void 0 : locStr.isEmpty)) || !!defaultValue;
26244
+ },
26245
+ onAddLocalizedString: (obj, property, locStr, translatedObj) => {
26246
+ res.push(locStr);
26247
+ },
26248
+ onCreateNewTranslateObj: (obj, property, translateObj) => {
26249
+ return undefined;
26250
+ }
26251
+ };
26252
+ collectStringsByObj(survey, options, undefined);
26253
+ return res;
26254
+ }
26255
+ function collectStringsByObj(obj, options, translateObj) {
26256
+ if (isItemValueArray(obj)) {
26257
+ createItemValuesLocale(obj, options, translateObj);
26258
+ return;
26259
+ }
26260
+ if (!obj || !obj.getType)
26261
+ return;
26262
+ let properties = getLocalizedProperties(obj, options);
26263
+ for (let i = 0; i < properties.length; i++) {
26264
+ addLocalizationItem(obj, options, properties[i], translateObj);
26265
+ }
26266
+ properties = getArrayProperties(obj);
26267
+ for (var i = 0; i < properties.length; i++) {
26268
+ var property = properties[i];
26269
+ var value = obj[property.name];
26270
+ //If ItemValue array?
26271
+ if (isItemValueArray(value)) {
26272
+ if (canShowProperty("itemvalue-array", options, obj, property, Array.isArray(value) && value.length > 0)) {
26273
+ createGroup(options, obj[property.name], property, translateObj);
26274
+ }
26275
+ }
26276
+ else {
26277
+ for (let i = 0; i < value.length; i++) {
26278
+ createGroup(options, value[i], property, translateObj);
26279
+ }
26280
+ }
26281
+ }
26282
+ createMatrixCellsGroup(options, obj, translateObj);
26283
+ }
26284
+ function isItemValueArray(val) {
26285
+ return (!!val &&
26286
+ Array.isArray(val) &&
26287
+ val.length > 0 &&
26288
+ !!val[0] &&
26289
+ !!val[0]["getType"] &&
26290
+ !!val[0]["setData"] &&
26291
+ !!val[0]["setLocText"]);
26292
+ }
26293
+ function addLocalizationItem(obj, options, property, translateObj) {
26294
+ const locStr = getLocalizableStr(obj, property);
26295
+ if (!locStr)
26296
+ return;
26297
+ const defaultValue = getDefaultValue(obj, property);
26298
+ if (canShowProperty("add-locsr", options, obj, property, !locStr.isEmpty, defaultValue)) {
26299
+ options.onAddLocalizedString(obj, property, locStr, translateObj);
26300
+ }
26301
+ }
26302
+ function createItemValuesLocale(obj, options, translateObj) {
26303
+ for (let i = 0; i < obj.length; i++) {
26304
+ const val = obj[i];
26305
+ addPropertiesForItemValue(val, options, translateObj);
26306
+ }
26307
+ }
26308
+ function addPropertiesForItemValue(itemValue, options, translateObj) {
26309
+ const locProperties = getLocalizedProperties(itemValue, options, false);
26310
+ for (let i = 0; i < locProperties.length; i++) {
26311
+ const prop = locProperties[i];
26312
+ const isText = prop.name === "text";
26313
+ const reason = isText ? "itemvalue-text" : "itemvalue-customprop";
26314
+ const defValue = isText ? itemValue.value : undefined;
26315
+ const canshow = canShowProperty(reason, options, itemValue, prop, true, defValue);
26316
+ if (!canshow && isText)
26317
+ break;
26318
+ if (canshow) {
26319
+ options.onAddLocalizedString(itemValue, prop, getLocalizableStr(itemValue, prop), translateObj);
26320
+ }
26321
+ }
26322
+ }
26323
+ function getLocalizedProperties(obj, options, checkIsShowing = true) {
26324
+ const res = new Array();
26325
+ const properties = Serializer.getPropertiesByObj(obj);
26326
+ for (let i = 0; i < properties.length; i++) {
26327
+ const property = properties[i];
26328
+ if (property.readOnly || !property.visible || !property.isSerializable || !property.isLocalizable)
26329
+ continue;
26330
+ const isShowing = ["url", "file"].indexOf(property.type) < 0;
26331
+ if (!checkIsShowing || canShowProperty("get-property", options, obj, property, isShowing)) {
26332
+ res.push(property);
26333
+ }
26334
+ }
26335
+ return res;
26336
+ }
26337
+ function getArrayProperties(obj) {
26338
+ var res = new Array();
26339
+ var properties = Serializer.getPropertiesByObj(obj);
26340
+ for (var i = 0; i < properties.length; i++) {
26341
+ var property = properties[i];
26342
+ if (property.isSerializable === false)
26343
+ continue;
26344
+ var value = obj[property.name];
26345
+ if (!!value && Array.isArray(value) && value.length > 0) {
26346
+ res.push(property);
26347
+ }
26348
+ }
26349
+ return res;
26350
+ }
26351
+ function getLocalizableStr(obj, prop) {
26352
+ return obj[prop.serializationProperty];
26353
+ }
26354
+ function createGroup(options, obj, property, translateObj) {
26355
+ if (!!obj && (obj.getType || Array.isArray(obj))) {
26356
+ translateObj = options.onCreateNewTranslateObj(obj, property, translateObj);
26357
+ collectStringsByObj(obj, options, translateObj);
26358
+ }
26359
+ }
26360
+ function canShowProperty(reason, options, obj, property, isShowing, defaultValue) {
26361
+ if (options.canShowProperty) {
26362
+ return options.canShowProperty(reason, obj, property, getLocalizableStr(obj, property), isShowing, defaultValue);
26363
+ }
26364
+ return isShowing;
26365
+ }
26366
+ function createMatrixCellsGroup(options, obj, translateObj) {
26367
+ Serializer.getPropertiesByObj(obj).forEach(prop => {
26368
+ if (prop.type === "cells" && canShowProperty("matrix-cell", options, obj, prop, true)) {
26369
+ createMatrixCellsGroupCore(options, obj, prop, translateObj);
26370
+ }
26371
+ });
26372
+ }
26373
+ function createMatrixCellsGroupCore(options, obj, prop, translateObj) {
26374
+ const cells = obj[prop.name];
26375
+ if (cells.isEmpty)
26376
+ return;
26377
+ const matrix = obj;
26378
+ translateObj = options.onCreateNewTranslateObj(obj, prop, translateObj);
26379
+ const defaultName = settings$1.matrix.defaultRowName;
26380
+ const rows = [defaultName];
26381
+ matrix.rows.forEach(row => rows.push(row.value));
26382
+ rows.forEach(val => {
26383
+ matrix.columns.forEach(col => {
26384
+ const locStr = cells.getCellDisplayLocText(val, col);
26385
+ if (!!locStr) {
26386
+ options.onAddLocalizedString(obj, prop, locStr, translateObj);
26387
+ }
26388
+ });
26389
+ });
26390
+ }
26391
+ function getDefaultValue(obj, prop) {
26392
+ const locStr = getLocalizableStr(obj, prop);
26393
+ if (!locStr)
26394
+ return "";
26395
+ if (prop.name == "title") {
26396
+ if (!!locStr && !obj.isPage && !obj.isPanel && !!locStr.onGetTextCallback)
26397
+ return obj["name"];
26398
+ }
26399
+ return "";
26400
+ }
26401
+ function isTextNonTranslated(text) {
26402
+ if (!text)
26403
+ return true;
26404
+ if (Helpers.isNumber(text))
26405
+ return true;
26406
+ return text.length < 2;
26407
+ }
26408
+
26087
26409
  var iconsV1Data = {
26088
26410
  "actual-size-24x24": "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M10 6C7.79 6 6 7.79 6 10C6 12.21 7.79 14 10 14C12.21 14 14 12.21 14 10C14 7.79 12.21 6 10 6ZM10 12C8.9 12 8 11.1 8 10C8 8.9 8.9 8 10 8C11.1 8 12 8.9 12 10C12 11.1 11.1 12 10 12ZM22.71 21.29L17.03 15.61C18.26 14.07 19 12.12 19 10C19 5.04 14.96 1 10 1C5.04 1 1 5.04 1 10C1 14.96 5.04 19 10 19C12.12 19 14.07 18.26 15.61 17.03L21.29 22.71L22.7 21.3L22.71 21.29ZM3 10C3 6.14 6.14 3 10 3C13.86 3 17 6.14 17 10C17 13.86 13.86 17 10 17C6.14 17 3 13.86 3 10Z\"></path></svg>",
26089
26411
  "add-16x16": "<svg viewBox=\"0 0 16 16\" xmlns=\"http://www.w3.org/2000/svg\"><g clip-path=\"url(#clip0_554_309816)\"><path d=\"M9 7H12V9H9V12H7V9H4V7H7V4H9V7ZM16 8C16 12.4 12.4 16 8 16C3.6 16 0 12.4 0 8C0 3.6 3.6 0 8 0C12.4 0 16 3.6 16 8ZM14 8C14 4.7 11.3 2 8 2C4.7 2 2 4.7 2 8C2 11.3 4.7 14 8 14C11.3 14 14 11.3 14 8Z\"></path></g><defs><clipPath id=\"clip0_554_309816\"><rect width=\"16\" height=\"16\" fill=\"white\"></rect></clipPath></defs></svg>",
@@ -27230,6 +27552,10 @@ class SurveyCreatorModel extends Base {
27230
27552
  this.onHtmlToMarkdown = this.addCreatorEvent();
27231
27553
  /**
27232
27554
  * An event that is raised when Survey Creator obtains the expand/collapse state of a survey element on the design surface. Handle this event to set a required state.
27555
+ *
27556
+ * For information on event handler parameters, refer to descriptions within the interface.
27557
+ *
27558
+ * [View Demo](https://surveyjs.io/survey-creator/examples/expand-and-collapse-survey-elements/ (linkStyle))
27233
27559
  * @see [ICreatorOptions.collapseQuestions](https://surveyjs.io/survey-creator/documentation/api-reference/icreatoroptions#collapseQuestions)
27234
27560
  * @see [ICreatorOptions.collapsePanels](https://surveyjs.io/survey-creator/documentation/api-reference/icreatoroptions#collapsePanels)
27235
27561
  * @see [ICreatorOptions.collapsePages](https://surveyjs.io/survey-creator/documentation/api-reference/icreatoroptions#collapsePages)
@@ -27508,7 +27834,6 @@ class SurveyCreatorModel extends Base {
27508
27834
  *
27509
27835
  * For information on event handler parameters, refer to descriptions within the interface.
27510
27836
  *
27511
- *
27512
27837
  * Within the event handler, you need to pass translation strings and locale information to the translation service API. The service should return an array of translated strings that you need to pass to the `options.callback` function. The following code shows how to integrate the Microsoft Translator service into Survey Creator:
27513
27838
  *
27514
27839
  * ```js
@@ -27554,6 +27879,7 @@ class SurveyCreatorModel extends Base {
27554
27879
  * ```
27555
27880
  *
27556
27881
  * > Survey Creator does not include a machine translation service out of the box. Our component only provides a UI for calling the service API.
27882
+ * @see startMachineTranslationTo
27557
27883
  */
27558
27884
  this.onMachineTranslate = this.addCreatorEvent();
27559
27885
  /**
@@ -27624,6 +27950,9 @@ class SurveyCreatorModel extends Base {
27624
27950
  * An event that is raised when users change a property in a [Survey Creator theme](https://surveyjs.io/survey-creator/documentation/api-reference/survey-creator#creatorTheme).
27625
27951
  */
27626
27952
  this.onCreatorThemePropertyChanged = this.addCreatorEvent();
27953
+ /**
27954
+ * An event that is raised when users select a [Survey Creator theme](https://surveyjs.io/survey-creator/documentation/api-reference/survey-creator#creatorTheme) from the drop-down list of UI themes.
27955
+ */
27627
27956
  this.onCreatorThemeSelected = this.addCreatorEvent();
27628
27957
  // /**
27629
27958
  // * You need to set this property to true if you want to use tabs instead of accordion in the popup element's editor.
@@ -27864,6 +28193,13 @@ class SurveyCreatorModel extends Base {
27864
28193
  * Default value: `false`
27865
28194
  */
27866
28195
  this.collapseOnDrag = false;
28196
+ /**
28197
+ * Specifies whether to clear translations to other languages when a source language translation is changed.
28198
+ *
28199
+ * Default value: `false`
28200
+ * @see showTranslationTab
28201
+ */
28202
+ this.clearTranslationsOnSourceTextChange = false;
27867
28203
  if (!!options2 ||
27868
28204
  typeof this.options === "string" ||
27869
28205
  this.options instanceof String) {
@@ -28894,9 +29230,52 @@ class SurveyCreatorModel extends Base {
28894
29230
  options.value = options.newValue;
28895
29231
  this.onAfterPropertyChanged.fire(this, options);
28896
29232
  }
29233
+ this.clearLocalizationStrings(options.target, options.name);
28897
29234
  options.type = "PROPERTY_CHANGED";
28898
29235
  this.setModified(options);
28899
29236
  }
29237
+ clearLocalizationStrings(el, name) {
29238
+ if (this.clearTranslationsOnSourceTextChange) {
29239
+ const loc = this.survey.locale;
29240
+ if (!!loc && loc !== surveyLocalization.defaultLocale)
29241
+ return;
29242
+ if ((el.isQuestion || Serializer.isDescendantOf(el.getType(), "matrixdropdowncolumn")) && name === "name") {
29243
+ this.clearNonDefaultLocalesInStrByValue(el.locTitle);
29244
+ }
29245
+ else {
29246
+ if (Serializer.isDescendantOf(el.getType(), "itemvalue") && name === "value") {
29247
+ this.clearNonDefaultLocalesInStrByValue(el.locText);
29248
+ }
29249
+ else {
29250
+ const prop = Serializer.findProperty(el.getType(), name);
29251
+ if (prop && prop.isLocalizable && prop.serializationProperty) {
29252
+ const locStr = el[prop.serializationProperty];
29253
+ this.clearNonDefaultLocalesInStr(locStr);
29254
+ }
29255
+ }
29256
+ }
29257
+ }
29258
+ }
29259
+ clearNonDefaultLocalesInStrByValue(locStr) {
29260
+ if (!locStr.isEmpty && !locStr.getLocaleText("")) {
29261
+ this.clearNonDefaultLocalesInStr(locStr);
29262
+ }
29263
+ }
29264
+ clearNonDefaultLocalesInStr(locStr) {
29265
+ if (locStr) {
29266
+ const ctrl = this.undoRedoController;
29267
+ if (ctrl)
29268
+ ctrl.ignoreChanges = true;
29269
+ const locs = locStr.getLocales();
29270
+ locs.forEach(l => {
29271
+ if (l !== surveyLocalization.defaultLocale && l !== "default") {
29272
+ locStr.setLocaleText(l, "");
29273
+ }
29274
+ });
29275
+ if (ctrl)
29276
+ ctrl.ignoreChanges = false;
29277
+ }
29278
+ }
28900
29279
  notifySurveyItemMoved(options) {
28901
29280
  options.type = "ELEMENT_REORDERED";
28902
29281
  this.setModified(options);
@@ -29326,7 +29705,7 @@ class SurveyCreatorModel extends Base {
29326
29705
  this.currentFocusTimeout = setTimeout(() => {
29327
29706
  this.currentFocusInterval = setInterval(() => {
29328
29707
  var _a, _b;
29329
- const el = document.getElementById(selEl.id);
29708
+ let el = this.getHtmlElementForScroll(selEl);
29330
29709
  if (!!selEl && (focus || startEdit && (!selEl.hasTitle || selEl.isPanel))) {
29331
29710
  if (!el || this.rootElement.getAnimations({ subtree: true }).filter((animation => animation.effect.getComputedTiming().activeDuration !== Infinity && (animation.pending || animation.playState !== "finished")))[0])
29332
29711
  return;
@@ -29343,7 +29722,7 @@ class SurveyCreatorModel extends Base {
29343
29722
  SurveyHelper.scrollIntoViewIfNeeded((_b = el.parentElement) !== null && _b !== void 0 ? _b : el, () => { return scrollIntoViewOptions; }, true);
29344
29723
  }
29345
29724
  }
29346
- if (!propertyName && el.parentElement) {
29725
+ if (!propertyName && el.parentElement && selEl.getType() !== "matrixdropdowncolumn") {
29347
29726
  let elToFocus = (typeof (focus) === "string") ? el.parentElement.querySelector(focus) : el.parentElement;
29348
29727
  elToFocus && elToFocus.focus({ preventScroll: true });
29349
29728
  }
@@ -29358,10 +29737,17 @@ class SurveyCreatorModel extends Base {
29358
29737
  }, 1);
29359
29738
  }, 100);
29360
29739
  }
29740
+ getHtmlElementForScroll(element) {
29741
+ const id = element.getType() === "matrixdropdowncolumn" ? element.colOwner.id : element.id;
29742
+ return document.getElementById(id);
29743
+ }
29361
29744
  getSelectedSurveyElement() {
29362
29745
  var sel = this.selectedElement;
29363
29746
  if (!sel || sel.getType() == "survey")
29364
29747
  return null;
29748
+ if (this.selectedElement.getType() === "matrixdropdowncolumn") {
29749
+ return this.selectedElement;
29750
+ }
29365
29751
  return sel.isInteractiveDesignElement && sel.id ? sel : null;
29366
29752
  }
29367
29753
  onSelectingElement(val) {
@@ -29375,6 +29761,8 @@ class SurveyCreatorModel extends Base {
29375
29761
  }
29376
29762
  /**
29377
29763
  * Opens [Survey Creator theme](https://surveyjs.io/survey-creator/documentation/api-reference/survey-creator#creatorTheme) settings in Property Grid. Applies only if [`propertyGridNavigationMode`](https://surveyjs.io/survey-creator/documentation/api-reference/survey-creator#propertyGridNavigationMode) is `"buttons"`.
29764
+ *
29765
+ * [View Demo](https://surveyjs.io/survey-creator/examples/dynamic-ui-customization/ (linkStyle))
29378
29766
  * @see closeCreatorThemeSettings
29379
29767
  * @see showCreatorThemeSettings
29380
29768
  */
@@ -29971,6 +30359,17 @@ class SurveyCreatorModel extends Base {
29971
30359
  this.onMachineTranslate.fire(this, { fromLocale: fromLocale, toLocale: toLocale, strings: strings, callback: callback });
29972
30360
  }
29973
30361
  }
30362
+ /**
30363
+ * Starts the translation of survey strings from the default language to one or more specified languages using a machine translation service, such as Google Translate or Microsoft Translator.
30364
+ *
30365
+ * This method only launches the operation by raising the [`onMachineTranslate`](https://surveyjs.io/survey-creator/documentation/api-reference/survey-creator#onMachineTranslate) event. Handle this event to perform the actual translation.
30366
+ * @param locales An array of locale codes that correspond to target languages, for example, `[ "de", "fr" ]`.
30367
+ */
30368
+ startMachineTranslationTo(locales) {
30369
+ if (!this.getHasMachineTranslation())
30370
+ return;
30371
+ doMachineStringsTranslation(this.survey, this, locales);
30372
+ }
29974
30373
  doAutoSave() {
29975
30374
  const saveFunc = () => this.doSave();
29976
30375
  if (this.autoSaveDelay <= 0) {
@@ -30335,6 +30734,8 @@ class SurveyCreatorModel extends Base {
30335
30734
  }
30336
30735
  /**
30337
30736
  * Applies a specified UI theme to Survey Creator.
30737
+ *
30738
+ * [View Demo](https://surveyjs.io/survey-creator/examples/dynamic-ui-customization/ (linkStyle))
30338
30739
  * @param theme An `ICreatorTheme` object with theme settings.
30339
30740
  * @see creatorTheme
30340
30741
  * @see showCreatorThemeSettings
@@ -31139,18 +31540,6 @@ __decorate([
31139
31540
  ], PageNavigatorViewModel.prototype, "visibleItemsCount", void 0);
31140
31541
 
31141
31542
  class PageAdorner extends SurveyElementAdornerBase {
31142
- updateDragTypeOverMe() {
31143
- var _a;
31144
- if (!this.isDisposed) {
31145
- this.dragTypeOverMe = (_a = this.page) === null || _a === void 0 ? void 0 : _a.dragTypeOverMe;
31146
- }
31147
- }
31148
- updateIsDragMe() {
31149
- var _a;
31150
- if (!this.isDisposed) {
31151
- this.isDragMe = (_a = this.page) === null || _a === void 0 ? void 0 : _a.isDragMe;
31152
- }
31153
- }
31154
31543
  updateShowPlaceholder(visibleRows) {
31155
31544
  this.showPlaceholder = !this.isGhost && (visibleRows || this.page.visibleRows).length === 0;
31156
31545
  }
@@ -31206,15 +31595,12 @@ class PageAdorner extends SurveyElementAdornerBase {
31206
31595
  updateActionVisibility(id, isVisible) {
31207
31596
  super.updateActionVisibility(id, !this.isGhost && isVisible);
31208
31597
  }
31209
- get dragInsideCollapsedContainer() {
31210
- return this.collapsed;
31211
- }
31212
31598
  getAllowExpandCollapse(options) {
31213
31599
  return !this.isGhost && super.getAllowExpandCollapse(options);
31214
31600
  }
31215
31601
  attachElement(surveyElement) {
31216
31602
  super.attachElement(surveyElement);
31217
- this.dragTypeOverMe = null;
31603
+ this.dropIndicatorPosition = null;
31218
31604
  if (!!surveyElement) {
31219
31605
  surveyElement["surveyChangedCallback"] = () => {
31220
31606
  this.isPageLive = !!surveyElement.survey;
@@ -31222,12 +31608,6 @@ class PageAdorner extends SurveyElementAdornerBase {
31222
31608
  if (this.isGhost) {
31223
31609
  this.addGhostPageSubsribes(surveyElement);
31224
31610
  }
31225
- surveyElement.registerFunctionOnPropertiesValueChanged(["dragTypeOverMe"], () => {
31226
- this.updateDragTypeOverMe();
31227
- }, "dragOver");
31228
- surveyElement.registerFunctionOnPropertiesValueChanged(["isDragMe"], () => {
31229
- this.updateIsDragMe();
31230
- }, "dragOver");
31231
31611
  surveyElement.registerFunctionOnPropertiesValueChanged(["visibleRows"], (newValue) => {
31232
31612
  this.updateShowPlaceholder(newValue);
31233
31613
  }, "updatePlaceholder");
@@ -31236,8 +31616,6 @@ class PageAdorner extends SurveyElementAdornerBase {
31236
31616
  surveyElement.updateCustomWidgets();
31237
31617
  surveyElement.setWasShown(true);
31238
31618
  this.checkActionProperties();
31239
- this.dragTypeOverMe = surveyElement.dragTypeOverMe;
31240
- this.isDragMe = surveyElement.isDragMe;
31241
31619
  if (this.creator.pageEditMode !== "single") {
31242
31620
  surveyElement.locTitle.placeholder = () => { return surveyElement.isStartPage ? "pe.startPageTitlePlaceholder" : "pe.pageTitlePlaceholder"; };
31243
31621
  surveyElement.locDescription.placeholder = "pe.pageDescriptionPlaceholder";
@@ -31249,14 +31627,13 @@ class PageAdorner extends SurveyElementAdornerBase {
31249
31627
  delete surveyElement.locTitle.placeholder;
31250
31628
  delete surveyElement.locDescription.placeholder;
31251
31629
  surveyElement.unRegisterFunctionOnPropertiesValueChanged(["elements"], "updatePlaceholder");
31252
- surveyElement.unRegisterFunctionOnPropertiesValueChanged(["dragTypeOverMe", "isDragMe"], "dragOver");
31253
31630
  surveyElement.unRegisterFunctionOnPropertiesValueChanged(["title", "description"], "add_ghost");
31254
31631
  surveyElement.unRegisterFunctionOnPropertiesValueChanged(["visibleRows"], "updatePlaceholder");
31255
31632
  surveyElement["surveyChangedCallback"] = undefined;
31256
31633
  }
31257
31634
  super.detachElement(surveyElement);
31258
31635
  if (!this.isDisposed) {
31259
- this.dragTypeOverMe = null;
31636
+ this.dropIndicatorPosition = null;
31260
31637
  }
31261
31638
  }
31262
31639
  onElementSelectedChanged(isSelected) {
@@ -31305,7 +31682,6 @@ class PageAdorner extends SurveyElementAdornerBase {
31305
31682
  container.sizeMode = "small";
31306
31683
  container.cssClasses = this.containerCssClasses();
31307
31684
  container.dotsItem.iconSize = "auto";
31308
- container.dotsItem.cssClasses.itemIcon += " svc-page-toolbar-item__icon";
31309
31685
  return container;
31310
31686
  }
31311
31687
  createTopActionContainer() {
@@ -31353,53 +31729,32 @@ class PageAdorner extends SurveyElementAdornerBase {
31353
31729
  event.cancelBubble = true;
31354
31730
  }
31355
31731
  get css() {
31356
- let result = super.getCss();
31357
- if (this.dragDropHelper.draggedElement && this.dragDropHelper.draggedElement.isPage) {
31358
- if (this.dragTypeOverMe === DragTypeOverMeEnum.Top) {
31359
- result += " svc-question__content--drag-over-top";
31360
- }
31361
- if (this.dragTypeOverMe === DragTypeOverMeEnum.Bottom) {
31362
- result += " svc-question__content--drag-over-bottom";
31363
- }
31732
+ const isShowAddQuestionButton = !!this.creator && !this.creator.showAddQuestionButton;
31733
+ const isGhostEmpty = this.isGhost && this.creator.survey.pages.length > 0;
31734
+ const isInsideCollapsed = this.dropIndicatorPosition === DropIndicatorPosition.Inside && this.collapsed;
31735
+ let result = new CssClassBuilder()
31736
+ .append(super.getCss())
31737
+ .append("svc-page__content--dragged", this.isBeingDragged)
31738
+ .append("svc-question__content--drag-over-top", this.dropIndicatorPosition === DropIndicatorPosition.Top)
31739
+ .append("svc-question__content--drag-over-bottom", this.dropIndicatorPosition === DropIndicatorPosition.Bottom)
31740
+ .append("svc-page__content--collapsed-drag-over-inside", isInsideCollapsed)
31741
+ .append("svc-question__content--drag-over-inside", this.dropIndicatorPosition === DropIndicatorPosition.Inside && this.showPlaceholder)
31742
+ .append("svc-page--drag-over-empty", this.dropIndicatorPosition === DropIndicatorPosition.Inside && !!isGhostEmpty)
31743
+ .append("svc-page--drag-over-empty-no-add-button", this.dropIndicatorPosition === DropIndicatorPosition.Inside && !!isGhostEmpty && isShowAddQuestionButton)
31744
+ .append("svc-page__content--collapse-" + this.creator.expandCollapseButtonVisibility, this.allowExpandCollapse || !!this.page["isGhost"])
31745
+ .append("svc-page__content--collapsed", (this.allowExpandCollapse || !!this.page["isGhost"]) && (this.renderedCollapsed || !!this.page["isGhost"]))
31746
+ .append("svc-page__content--animation-running", (this.allowExpandCollapse || !!this.page["isGhost"]) && (this.expandCollapseAnimationRunning))
31747
+ .append("svc-page__content--new", !!this.isGhost)
31748
+ .append("svc-page__content--selected", !this.isGhost && !!this.creator.isElementSelected(this.page))
31749
+ .append("svc-page__content--no-header", !this.isGhost && settings$1.designMode.showEmptyTitles === false)
31750
+ .toString();
31751
+ if (isInsideCollapsed) {
31752
+ this.dragIn();
31364
31753
  }
31365
31754
  else {
31366
- if (!!this.dragTypeOverMe && this.showPlaceholder) {
31367
- result = "svc-question__content--drag-over-inside";
31368
- }
31369
- else if (!!this.dragTypeOverMe && this.page.elements.length === 0 && this.creator.survey.pages.length > 0) {
31370
- result = "svc-page--drag-over-empty";
31371
- if (!!this.creator && !this.creator.showAddQuestionButton) {
31372
- result += " svc-page--drag-over-empty-no-add-button";
31373
- }
31374
- }
31375
- if (!!this.dragTypeOverMe && this.collapsed) {
31376
- this.dragIn();
31377
- result += " svc-page__content--collapsed-drag-over-inside";
31378
- }
31379
- else {
31380
- this.dragOut();
31381
- }
31382
- }
31383
- if (this.allowExpandCollapse || this.page["isGhost"]) {
31384
- result += (" svc-page__content--collapse-" + this.creator.expandCollapseButtonVisibility);
31385
- if (this.renderedCollapsed || this.page["isGhost"])
31386
- result += (" svc-page__content--collapsed");
31387
- if (this.expandCollapseAnimationRunning)
31388
- result += (" svc-page__content--animation-running");
31389
- }
31390
- if (this.isDragMe) {
31391
- result += " svc-page__content--dragged";
31392
- }
31393
- if (this.isGhost) {
31394
- return result + " svc-page__content--new";
31395
- }
31396
- if (this.creator.isElementSelected(this.page)) {
31397
- result += " svc-page__content--selected";
31398
- }
31399
- if (settings$1.designMode.showEmptyTitles === false) {
31400
- result += " svc-page__content--no-header";
31755
+ this.dragOut();
31401
31756
  }
31402
- return result.trim();
31757
+ return result;
31403
31758
  }
31404
31759
  hoverStopper(event, element) {
31405
31760
  event["__svc_question_processed"] = true;
@@ -31479,12 +31834,6 @@ __decorate([
31479
31834
  __decorate([
31480
31835
  property({ defaultValue: "" })
31481
31836
  ], PageAdorner.prototype, "currentAddQuestionType", void 0);
31482
- __decorate([
31483
- property({ defaultValue: null })
31484
- ], PageAdorner.prototype, "dragTypeOverMe", void 0);
31485
- __decorate([
31486
- property({ defaultValue: false })
31487
- ], PageAdorner.prototype, "isDragMe", void 0);
31488
31837
  __decorate([
31489
31838
  property({
31490
31839
  onSet(val, target, prevVal) {
@@ -31505,42 +31854,32 @@ class RowViewModel extends Base {
31505
31854
  this.creator = creator;
31506
31855
  this.row = row;
31507
31856
  this.templateData = templateData;
31508
- this.rowDragTypeOverMeChanged = (s, o) => {
31509
- if (o.name == "dragTypeOverMe")
31510
- this.dragTypeOverMe = o.newValue;
31511
- };
31512
- this.dragTypeOverMe = this.row.dragTypeOverMe;
31857
+ if (this.row) {
31858
+ this.row.setPropertyValue(SurveyElementAdornerBase.AdornerValueName, this);
31859
+ }
31513
31860
  }
31514
31861
  subscribeElementChanges() {
31515
- this.row.onPropertyChanged.add(this.rowDragTypeOverMeChanged);
31862
+ this.row.setPropertyValue(SurveyElementAdornerBase.AdornerValueName, this);
31516
31863
  }
31517
31864
  unsubscribeElementChanges() {
31518
- this.row.onPropertyChanged.remove(this.rowDragTypeOverMeChanged);
31865
+ this.row.setPropertyValue(SurveyElementAdornerBase.AdornerValueName, null);
31519
31866
  }
31520
31867
  get cssClasses() {
31521
- let result = "svc-row";
31522
- let ghostClass = " svc-row--ghost";
31523
- if (this.row.elements.length === 1 &&
31524
- this.row.elements[0].name === "sv-drag-drop-ghost-survey-element-name") {
31525
- result += ghostClass;
31526
- }
31527
- if (this.dragTypeOverMe === DragTypeOverMeEnum.Top) {
31528
- result += " svc-row--drag-over-top";
31529
- }
31530
- if (this.dragTypeOverMe === DragTypeOverMeEnum.Bottom) {
31531
- result += " svc-row--drag-over-bottom";
31532
- }
31533
- return result;
31868
+ return new CssClassBuilder()
31869
+ .append("svc-row")
31870
+ .append("svc-row--ghost", this.row.elements.length === 1 && this.row.elements[0].name === "sv-drag-drop-ghost-survey-element-name")
31871
+ .append("svc-row--drag-over-top", this.dropIndicatorPosition === DropIndicatorPosition.Top)
31872
+ .append("svc-row--drag-over-bottom", this.dropIndicatorPosition === DropIndicatorPosition.Bottom)
31873
+ .toString();
31534
31874
  }
31535
31875
  dispose() {
31536
31876
  super.dispose();
31537
31877
  this.unsubscribeElementChanges();
31538
- this.rowDragTypeOverMeChanged = undefined;
31539
31878
  }
31540
31879
  }
31541
31880
  __decorate([
31542
- property()
31543
- ], RowViewModel.prototype, "dragTypeOverMe", void 0);
31881
+ property({ defaultValue: null })
31882
+ ], RowViewModel.prototype, "dropIndicatorPosition", void 0);
31544
31883
 
31545
31884
  class QuestionAdornerViewModel extends SurveyElementAdornerBase {
31546
31885
  constructor(creator, surveyElement, templateData) {
@@ -31599,57 +31938,34 @@ class QuestionAdornerViewModel extends SurveyElementAdornerBase {
31599
31938
  .append("svc-question__adorner--collapse-" + this.creator.expandCollapseButtonVisibility, true).toString();
31600
31939
  }
31601
31940
  css() {
31941
+ const isInsideCollapsed = this.dropIndicatorPosition === DropIndicatorPosition.Inside && this.collapsed;
31602
31942
  if (!this.surveyElement.isInteractiveDesignElement)
31603
31943
  return "";
31604
- let result = "svc-question__content";
31605
- result += typeof this.surveyElement.getType === "function" ? (" svc-question__content--" + this.surveyElement.getType()) : "";
31606
- if (this.creator.isElementSelected(this.surveyElement)) {
31607
- result += " svc-question__content--selected";
31608
- }
31609
- if (this.isEmptyElement) {
31610
- result += " svc-question__content--empty";
31611
- }
31612
- if (this.isEmptyTemplate) {
31613
- result += " svc-question__content--empty-template";
31614
- }
31615
- if (this.renderedCollapsed) {
31616
- result += " svc-question__content--collapsed";
31617
- }
31618
- if (!this.surveyElement.hasTitle || (!this.surveyElement.isPanel && this.surveyElement.getTitleLocation() === "hidden")) {
31619
- result += " svc-question__content--title-hidden";
31620
- }
31621
- if (this.surveyElement.hasTitleOnBottom) {
31622
- result += " svc-question__content--title-bottom";
31623
- }
31624
- if (this.isDragMe) {
31625
- result += " svc-question__content--dragged";
31626
- }
31627
- if (!!this.dragTypeOverMe && (this.canExpandOnDrag) && this.dragInsideCollapsedContainer) {
31944
+ if (isInsideCollapsed) {
31628
31945
  this.dragIn();
31629
- result += " svc-question__content--collapsed-drag-over-inside";
31630
31946
  }
31631
31947
  else {
31632
31948
  this.dragOut();
31633
31949
  }
31634
- if (this.dragTypeOverMe === DragTypeOverMeEnum.InsideEmptyPanel) {
31635
- result += " svc-question__content--drag-over-inside";
31636
- }
31637
- if (!this.dragInsideCollapsedContainer) {
31638
- if (this.dragTypeOverMe === DragTypeOverMeEnum.Left) {
31639
- result += " svc-question__content--drag-over-left";
31640
- }
31641
- if (this.dragTypeOverMe === DragTypeOverMeEnum.Right) {
31642
- result += " svc-question__content--drag-over-right";
31643
- }
31644
- if (this.dragTypeOverMe === DragTypeOverMeEnum.Top) {
31645
- result += " svc-question__content--drag-over-top";
31646
- }
31647
- if (this.dragTypeOverMe === DragTypeOverMeEnum.Bottom) {
31648
- result += " svc-question__content--drag-over-bottom";
31649
- }
31650
- if (this.creator) {
31651
- result = this.creator.getElementAddornerCssCallback(this.surveyElement, result);
31652
- }
31950
+ let result = new CssClassBuilder()
31951
+ .append("svc-question__content")
31952
+ .append("svc-question__content--" + this.surveyElement.getType(), typeof this.surveyElement.getType === "function")
31953
+ .append("svc-question__content--selected", !!this.creator.isElementSelected(this.surveyElement))
31954
+ .append("svc-question__content--empty", this.isEmptyElement)
31955
+ .append("svc-question__content--empty-template", this.isEmptyTemplate)
31956
+ .append("svc-question__content--collapsed", this.renderedCollapsed)
31957
+ .append("svc-question__content--title-hidden", !this.surveyElement.hasTitle || (!this.surveyElement.isPanel && this.surveyElement.getTitleLocation() === "hidden"))
31958
+ .append("svc-question__content--title-bottom", !!this.surveyElement.hasTitleOnBottom)
31959
+ .append("svc-question__content--dragged", this.isBeingDragged)
31960
+ .append("svc-question__content--collapsed-drag-over-inside", isInsideCollapsed)
31961
+ .append("svc-question__content--drag-over-inside", this.dropIndicatorPosition === DropIndicatorPosition.Inside && !this.collapsed)
31962
+ .append("svc-question__content--drag-over-top", this.dropIndicatorPosition === DropIndicatorPosition.Top)
31963
+ .append("svc-question__content--drag-over-bottom", this.dropIndicatorPosition === DropIndicatorPosition.Bottom)
31964
+ .append("svc-question__content--drag-over-right", this.dropIndicatorPosition === DropIndicatorPosition.Right)
31965
+ .append("svc-question__content--drag-over-left", this.dropIndicatorPosition === DropIndicatorPosition.Left)
31966
+ .toString();
31967
+ if (!isInsideCollapsed && this.creator) {
31968
+ result = this.creator.getElementAddornerCssCallback(this.surveyElement, result);
31653
31969
  }
31654
31970
  return result;
31655
31971
  }
@@ -31686,15 +32002,9 @@ class QuestionAdornerViewModel extends SurveyElementAdornerBase {
31686
32002
  }
31687
32003
  expandWithDragIn() {
31688
32004
  super.expandWithDragIn();
31689
- this.element.dragTypeOverMe = null;
32005
+ this.dropIndicatorPosition = null;
31690
32006
  this.creator.dragDropSurveyElements.dropTarget = null;
31691
32007
  }
31692
- get isDragMe() {
31693
- return this.surveyElement.isDragMe;
31694
- }
31695
- get dragTypeOverMe() {
31696
- return this.element.dragTypeOverMe;
31697
- }
31698
32008
  get isBannerShowing() {
31699
32009
  return this.isUsingCarryForward || this.isUsingRestfull || this.isMessagePanelVisible;
31700
32010
  }
@@ -31816,7 +32126,6 @@ class QuestionAdornerViewModel extends SurveyElementAdornerBase {
31816
32126
  actionContainer.sizeMode = "small";
31817
32127
  actionContainer.cssClasses = defaultCssClasses;
31818
32128
  actionContainer.dotsItem.css += " svc-survey-element-toolbar__dots-item";
31819
- actionContainer.dotsItem.innerCss += " svc-survey-element-toolbar__item";
31820
32129
  return actionContainer;
31821
32130
  }
31822
32131
  updateActionsPropertiesCore() {
@@ -32041,20 +32350,25 @@ class QuestionAdornerViewModel extends SurveyElementAdornerBase {
32041
32350
  let selectedAction;
32042
32351
  let selectedSubaction = undefined;
32043
32352
  let selectedSubactions = undefined;
32353
+ const toolboxItemToAction = (item, needSeparator = false) => {
32354
+ return this.creator.createIActionBarItemByClass(item, needSeparator, (questionType, json) => { this.convertQuestion(questionType, json, defaultJsons); });
32355
+ };
32044
32356
  availableItems.forEach((item) => {
32045
32357
  var _a;
32046
32358
  const needSeparator = lastItem && item.category != lastItem.category;
32047
- const action = this.creator.createIActionBarItemByClass(item, needSeparator, (questionType, json) => { this.convertQuestion(questionType, json, defaultJsons); });
32359
+ const action = toolboxItemToAction(item, needSeparator);
32048
32360
  if (this.toolboxItemIsCorresponded(item, !!selectedAction)) {
32049
32361
  selectedAction = action;
32050
- selectedSubactions = item.items;
32362
+ if (item.items) {
32363
+ selectedSubactions = item.items.map(subitem => toolboxItemToAction(subitem));
32364
+ }
32051
32365
  }
32052
32366
  if (((_a = item.items) === null || _a === void 0 ? void 0 : _a.length) > 0 && this.creator.toolbox.showSubitems) {
32053
32367
  const subactions = [];
32054
32368
  let selectedSubactionLocal = undefined;
32055
32369
  let allChildsAreCompatibleToParent = false;
32056
32370
  item.items.forEach(subitem => {
32057
- const subaction = this.creator.createIActionBarItemByClass(subitem, false, (questionType, json) => { this.convertQuestion(questionType, json, defaultJsons); });
32371
+ const subaction = toolboxItemToAction(subitem);
32058
32372
  if (this.toolboxItemIsCorresponded(subitem, !!selectedAction))
32059
32373
  selectedSubactionLocal = subitem;
32060
32374
  if (this.jsonsAreCompatible(item.json, subitem.json))
@@ -32062,7 +32376,7 @@ class QuestionAdornerViewModel extends SurveyElementAdornerBase {
32062
32376
  subactions.push(subaction);
32063
32377
  });
32064
32378
  if (!allChildsAreCompatibleToParent && subactions.length > 0) {
32065
- const defaultSubaction = this.creator.createIActionBarItemByClass(item, false, (questionType, json) => { this.convertQuestion(questionType, json, defaultJsons); });
32379
+ const defaultSubaction = toolboxItemToAction(item);
32066
32380
  defaultSubaction.id = action.id + "-default";
32067
32381
  defaultSubaction.iconName = undefined;
32068
32382
  defaultSubaction.markerIconName = undefined;
@@ -32224,9 +32538,8 @@ class QuestionAdornerViewModel extends SurveyElementAdornerBase {
32224
32538
  items.push(inputTypeConverter);
32225
32539
  }
32226
32540
  items[items.length - 1].css += " svc-dropdown-action--convertTo-last";
32227
- if (typeof element["isRequired"] !== "undefined" &&
32228
- propertyExists(element, "isRequired") &&
32229
- isPropertyVisible(element, "isRequired")) {
32541
+ if (typeof element["isRequired"] !== "undefined" && !!element.getType
32542
+ && SurveyHelper.isPropertyVisible(element, Serializer.findProperty(element.getType(), "isRequired"), this.creator)) {
32230
32543
  items.push(this.createRequiredAction());
32231
32544
  }
32232
32545
  }
@@ -32963,7 +33276,8 @@ class MatrixCellWrapperViewModel extends Base {
32963
33276
  componentName: "svc-question-editor-content",
32964
33277
  data: {
32965
33278
  survey: editSurvey.survey,
32966
- creator: this.creator
33279
+ creator: this.creator,
33280
+ style: designTabSurveyThemeJSON.cssVariables
32967
33281
  },
32968
33282
  onApply: () => {
32969
33283
  editSurvey.apply();
@@ -33321,7 +33635,6 @@ QuestionFactory.Instance.registerQuestion("linkvalue", (name) => {
33321
33635
  class ScrollViewModel {
33322
33636
  constructor() {
33323
33637
  this._lockScroll = false;
33324
- //this.dragTypeOverMe = this.row.dragTypeOverMe;
33325
33638
  }
33326
33639
  setRootElement(element) {
33327
33640
  this._containerElementValue = element === null || element === void 0 ? void 0 : element.querySelector(".svc-scroll__scroller");
@@ -34118,15 +34431,16 @@ class FastEntryEditorBase extends PropertyEditorSetupValue {
34118
34431
  collectNames(item, type, separatorCounter) {
34119
34432
  let text = "";
34120
34433
  this.names.forEach((name) => {
34434
+ let str = undefined;
34121
34435
  if (type === "itemvalues") {
34122
34436
  if (name == "value")
34123
34437
  return;
34124
- var str = name == "text" ? item.pureText : item[name];
34438
+ str = name == "text" ? item.pureText : item[name];
34125
34439
  }
34126
34440
  else {
34127
- var str = item[name];
34441
+ str = item[name];
34128
34442
  }
34129
- if (!!str) {
34443
+ if (!Helpers.isValueEmpty(str)) {
34130
34444
  for (var i = 0; i < separatorCounter; i++) {
34131
34445
  text += ItemValue.Separator;
34132
34446
  }
@@ -34167,9 +34481,9 @@ class FastEntryEditor extends FastEntryEditorBase {
34167
34481
  if (item) {
34168
34482
  item.text = src[i].text;
34169
34483
  names.forEach((name) => {
34170
- if (name == "value" || name == "text")
34171
- return;
34172
- dest[i][name] = src[i][name];
34484
+ if (name !== "value") {
34485
+ item[name] = src[i][name];
34486
+ }
34173
34487
  });
34174
34488
  src.splice(i, 1, item);
34175
34489
  }
@@ -34224,16 +34538,12 @@ class PropertyGridEditorMatrix extends PropertyGridEditor {
34224
34538
  if (cellQuestion.getType() === "text" && !!objType) {
34225
34539
  if (propertyName === "text" && objType === "itemvalue") {
34226
34540
  cellQuestion.placeholder = new ComputedUpdater(() => {
34227
- if (!!rowObj.value)
34228
- return rowObj.value.toString();
34229
- return rowObj.text;
34541
+ return rowObj.locText.getPlaceholder();
34230
34542
  });
34231
34543
  }
34232
34544
  if (propertyName === "title" && (objType === "matrixdropdowncolumn" || objType === "multipletextitem")) {
34233
34545
  cellQuestion.placeholder = new ComputedUpdater(() => {
34234
- if (!!rowObj.name)
34235
- return rowObj.name;
34236
- return rowObj.title;
34546
+ return rowObj.locTitle.getPlaceholder();
34237
34547
  });
34238
34548
  }
34239
34549
  }
@@ -34391,10 +34701,9 @@ class PropertyGridEditorMatrix extends PropertyGridEditor {
34391
34701
  if (!!prop && !!prop.className) {
34392
34702
  var properties = Serializer.getProperties(prop.className);
34393
34703
  for (var i = 0; i < properties.length; i++) {
34394
- if (!this.isPropertyShownInList(properties[i])) {
34395
- continue;
34704
+ if (SurveyHelper.isPropertyVisible(undefined, properties[i], undefined, "list")) {
34705
+ res.push(properties[i].name);
34396
34706
  }
34397
- res.push(properties[i].name);
34398
34707
  }
34399
34708
  }
34400
34709
  return res.length > 0 ? res : this.getDefaulColumnNames();
@@ -34402,9 +34711,6 @@ class PropertyGridEditorMatrix extends PropertyGridEditor {
34402
34711
  getDefaulColumnNames() {
34403
34712
  return [];
34404
34713
  }
34405
- isPropertyShownInList(prop) {
34406
- return prop.visible && prop.showMode !== "form";
34407
- }
34408
34714
  getObjTypeName() {
34409
34715
  return "";
34410
34716
  }
@@ -34759,7 +35065,7 @@ class PropertyGridEditorMatrixPages extends PropertyGridEditorMatrix {
34759
35065
  return "name";
34760
35066
  }
34761
35067
  getBaseValue(prop) {
34762
- return "page";
35068
+ return editorLocalization.getString("ed.newPageName");
34763
35069
  }
34764
35070
  getAllowRowDragDrop(prop) { return true; }
34765
35071
  }
@@ -35016,14 +35322,14 @@ class PropertyGridEditorBindings extends PropertyGridEditor {
35016
35322
  onCreated(obj, question, prop, options) {
35017
35323
  question.contentPanel.fromJSON({ elements: this.getQuestions(obj, options) });
35018
35324
  question.valueFromDataCallback = (value) => {
35019
- if (!value && obj.bindings.getNames().length > 0) {
35020
- const result = {};
35021
- for (const bindingName of obj.bindings.getNames()) {
35022
- result[bindingName] = obj.bindings.getValueNameByPropertyName(bindingName);
35325
+ const keys = obj.bindings.getNames();
35326
+ const result = {};
35327
+ if (keys.length > 0) {
35328
+ for (const key of keys) {
35329
+ result[key] = !!value ? value[key] : obj.bindings.getValueNameByPropertyName(key);
35023
35330
  }
35024
- return result;
35025
35331
  }
35026
- return value;
35332
+ return result;
35027
35333
  };
35028
35334
  }
35029
35335
  getQuestions(obj, options) {
@@ -35717,8 +36023,8 @@ class CreatorPreset extends CreatorPresetBase {
35717
36023
  }
35718
36024
 
35719
36025
  let Version;
35720
- Version = `${"2.0.0"}`;
35721
- checkLibraryVersion(`${"2.0.0"}`, "survey-creator-core");
36026
+ Version = `${"2.0.2"}`;
36027
+ checkLibraryVersion(`${"2.0.2"}`, "survey-creator-core");
35722
36028
 
35723
- export { AceJsonEditorModel, ColorCalculator, CreatorAction, CreatorBase, CreatorEvent, CreatorPreset, CreatorPresetBase, CreatorPresetPropertyGrid, CreatorPresetPropertyGridDefinition, CreatorPresetTabs, CreatorPresetToolbox, CreatorPresetToolboxConfigurator, CreatorPresetToolboxDefinition, CreatorResponsivityManager, CreatorThemeModel, CreatorThemes, DEFAULT_MONITOR_DPI, DefaultFonts, DragDropSurveyElements, EditorLocalization, EmptySurveyCreatorOptions, FooterToolbarActionContainer, HEXToRGB, HSBToRGB, HueColorCalculator, ImageItemValueWrapperViewModel, ItemValueWrapperViewModel, JsonDuplicateNameError, JsonEditorBaseModel, LogicEvent, LogoImageViewModel, MatrixCellWrapperEditSurvey, MatrixCellWrapperViewModel, MenuButton, ObjType, ObjectSelector, ObjectSelectorItem, ObjectSelectorModel, PageAdorner, PageNavigatorViewModel, PagesController, PredefinedBackgroundColors, PredefinedColors, PredefinedCreatorThemes, PredefinedThemes, PropertyEditorSetupValue, PropertyGridCellsEditor, PropertyGridEditor, PropertyGridEditorBackgroundCornerRadius, PropertyGridEditorBindings, PropertyGridEditorBoolean, PropertyGridEditorCollection, PropertyGridEditorColor, PropertyGridEditorColorWithAlpha, PropertyGridEditorCondition, PropertyGridEditorDateTime, PropertyGridEditorDropdown, PropertyGridEditorExpression, PropertyGridEditorFontSettings, PropertyGridEditorHtml, PropertyGridEditorImageSize, PropertyGridEditorMatrix, PropertyGridEditorMatrixCalculatedValues, PropertyGridEditorMatrixColumns, PropertyGridEditorMatrixHtmlConditions, PropertyGridEditorMatrixItemValues, PropertyGridEditorMatrixLayoutColumns, PropertyGridEditorMatrixMultipleTypes, PropertyGridEditorMatrixMutlipleTextItems, PropertyGridEditorMatrixPages, PropertyGridEditorMatrixRateValues, PropertyGridEditorMatrixTriggers, PropertyGridEditorMatrixUrlConditions, PropertyGridEditorMatrixValidators, PropertyGridEditorNumber, PropertyGridEditorPage, PropertyGridEditorQuestion, PropertyGridEditorQuestionCarryForward, PropertyGridEditorQuestionHeader, PropertyGridEditorQuestionMaskSettings, PropertyGridEditorQuestionRestfull, PropertyGridEditorQuestionSelectBase, PropertyGridEditorQuestionValue, PropertyGridEditorSet, PropertyGridEditorShadowEffects, PropertyGridEditorSpinEdit, PropertyGridEditorString, PropertyGridEditorStringArray, PropertyGridEditorStringBase, PropertyGridEditorSwitchToggle, PropertyGridEditorText, PropertyGridEditorUndefinedBoolean, PropertyGridLinkEditor, PropertyGridModel, PropertyGridPanelValueEditor, PropertyGridRowValueEditor, PropertyGridTitleActionsCreator, PropertyGridTriggerValueEditor, PropertyGridTriggerValueInLogicEditor, PropertyGridValueEditor, PropertyGridValueEditorBase, PropertyGridViewModel, PropertyJSONGenerator, QuestionAdornerViewModel, QuestionColorModel, QuestionCommentWithResetModel, QuestionConvertMode, QuestionConverter, QuestionDropdownAdornerViewModel, QuestionEmbeddedSurveyModel, QuestionFileEditorModel, QuestionImageAdornerViewModel, QuestionLinkValueModel, QuestionRatingAdornerViewModel, QuestionSpinEditorModel, QuestionTextWithResetModel, QuestionToolbox, QuestionToolboxCategory, QuestionToolboxItem, RGBToHSB, ResetValueAdorner, ResizeManager, RowViewModel, ScrollViewModel, SearchManager, SearchManagerPropertyGrid, SearchManagerToolbox, SidebarHeaderModel, SidebarModel, SidebarPageModel, StringEditorConnector, StringEditorViewModelBase, StringItemsNavigatorBase, SurveyCreatorModel, SurveyHelper, SurveyJSON5, SurveyLogic, SurveyLogicUI, SurveyQuestionEditorDefinition, SurveyQuestionEditorPropertyDefinition, SurveyQuestionEditorTabDefinition, SurveyQuestionProperties, SurveyResultsItemModel, SurveyResultsModel, SurveySimulatorModel, SurveyTextWorker, SurveyTextWorkerError, SurveyTextWorkerJsonError, SurveyTextWorkerParserError, Switcher, TabControlModel, TabDesignerPlugin, TabDesignerViewModel, TabJsonEditorAcePlugin, TabJsonEditorBasePlugin, TabJsonEditorTextareaPlugin, TabLogicPlugin, TabTestPlugin, TabTranslationPlugin, TabbedMenuContainer, TabbedMenuItem, TestSurveyTabViewModel, TextareaJsonEditorModel, ThemeModelEditorDefinition, ThemeTabPlugin, ThemeTabViewModel, Themes, ToolbarActionContainer, ToolboxToolViewModel, Transaction, Translation, TranslationEditor, TranslationForEditor, TranslationGroup, TranslationItem, TranslationItemBase, TranslationItemString, UndoRedoAction, UndoRedoArrayAction, UndoRedoManager, UndoRedoPlugin, Version, assign, assignDefaultClasses, backgroundCornerRadiusFromCssVariable, backgroundCornerRadiusToCssVariable, calculateDragOverLocation, calculateIsEdge, calculateIsSide, capitalize, clearNewLines, colorsAreEqual, convertRgbaToString, copyCssClasses, copyObject, createBoxShadow, createBoxShadowReset, createColor, createExportCSVAction, createImportCSVAction, creatorThemeModelEditorDefinition, creatorThemeModelPropertyGridDefinition, defaultCreatorThemesOrder, defaultPropertyGridDefinition, defaultStrings, defaultThemesOrder, editableStringRendererName, editorLocalization, enStrings, findParentNode, focusFirstControl, fontsettingsFromCssVariable, fontsettingsToCssVariable, getAcceptedTypesByContentMode, getElementWrapperComponentData, getElementWrapperComponentName, getFirstNonTextElement, getItemValueWrapperComponentData, getItemValueWrapperComponentName, getLocString, getNextItemText, getNextItemValue, getNextValue, getNodesFromKoComponentInfo, getOS, getPredefinedBackgoundColorsChoices, getPredefinedColorsItemValues, getQuestionContentWrapperComponentName, getQuestionFromObj, getRGBaChannelValues, iconsV1, iconsV2, ignoreUndoRedo, imageMimeTypes, ingectAlpha, initLogicOperator, initialSettingsAllowShowEmptyTitleInDesignMode, initializeDesignTimeSurveyModel, isPanelDynamic, isPropertyVisible, isStringEditable, isTextInput, listComponentCss, editorLocalization as localization, logicCss, notShortCircuitAnd, parseBoxShadow, parseColor, parseRgbaFromString, propertyExists, propertyGridCss, registerAdorner, registerCreatorTheme, registerSurveyTheme, removeAdorners, roundTo2Decimals, saveToFileHandler, scrollElementIntoView, select, setSurveyJSONForPropertyGrid, settings, setupLocale, simulatorDevices, svgBundle, themeModelPropertyGridDefinition, toggleHovered, translationCss, trimBoxShadowValue, trimEmptyFields, undoRedoTransaction, updateBackgroundCornerRadiusJSON, updateFontSettingsJSON, updateShadowEffectsJSON, updatecoloralphaJSON, wrapTextByCurlyBraces };
36029
+ export { AceJsonEditorModel, ColorCalculator, CreatorAction, CreatorBase, CreatorEvent, CreatorPreset, CreatorPresetBase, CreatorPresetPropertyGrid, CreatorPresetPropertyGridDefinition, CreatorPresetTabs, CreatorPresetToolbox, CreatorPresetToolboxConfigurator, CreatorPresetToolboxDefinition, CreatorResponsivityManager, CreatorThemeModel, CreatorThemes, DEFAULT_MONITOR_DPI, DefaultFonts, DragDropSurveyElements, EditorLocalization, EmptySurveyCreatorOptions, FooterToolbarActionContainer, HEXToRGB, HSBToRGB, HueColorCalculator, ImageItemValueWrapperViewModel, ItemValueWrapperViewModel, JsonDuplicateNameError, JsonEditorBaseModel, LogicEvent, LogoImageViewModel, MatrixCellWrapperEditSurvey, MatrixCellWrapperViewModel, MenuButton, ObjType, ObjectSelector, ObjectSelectorItem, ObjectSelectorModel, PageAdorner, PageNavigatorViewModel, PagesController, PredefinedBackgroundColors, PredefinedColors, PredefinedCreatorThemes, PredefinedThemes, PropertyEditorSetupValue, PropertyGridCellsEditor, PropertyGridEditor, PropertyGridEditorBackgroundCornerRadius, PropertyGridEditorBindings, PropertyGridEditorBoolean, PropertyGridEditorCollection, PropertyGridEditorColor, PropertyGridEditorColorWithAlpha, PropertyGridEditorCondition, PropertyGridEditorDateTime, PropertyGridEditorDropdown, PropertyGridEditorExpression, PropertyGridEditorFontSettings, PropertyGridEditorHtml, PropertyGridEditorImageSize, PropertyGridEditorMatrix, PropertyGridEditorMatrixCalculatedValues, PropertyGridEditorMatrixColumns, PropertyGridEditorMatrixHtmlConditions, PropertyGridEditorMatrixItemValues, PropertyGridEditorMatrixLayoutColumns, PropertyGridEditorMatrixMultipleTypes, PropertyGridEditorMatrixMutlipleTextItems, PropertyGridEditorMatrixPages, PropertyGridEditorMatrixRateValues, PropertyGridEditorMatrixTriggers, PropertyGridEditorMatrixUrlConditions, PropertyGridEditorMatrixValidators, PropertyGridEditorNumber, PropertyGridEditorPage, PropertyGridEditorQuestion, PropertyGridEditorQuestionCarryForward, PropertyGridEditorQuestionHeader, PropertyGridEditorQuestionMaskSettings, PropertyGridEditorQuestionRestfull, PropertyGridEditorQuestionSelectBase, PropertyGridEditorQuestionValue, PropertyGridEditorSet, PropertyGridEditorShadowEffects, PropertyGridEditorSpinEdit, PropertyGridEditorString, PropertyGridEditorStringArray, PropertyGridEditorStringBase, PropertyGridEditorSwitchToggle, PropertyGridEditorText, PropertyGridEditorUndefinedBoolean, PropertyGridLinkEditor, PropertyGridModel, PropertyGridPanelValueEditor, PropertyGridRowValueEditor, PropertyGridTitleActionsCreator, PropertyGridTriggerValueEditor, PropertyGridTriggerValueInLogicEditor, PropertyGridValueEditor, PropertyGridValueEditorBase, PropertyGridViewModel, PropertyJSONGenerator, QuestionAdornerViewModel, QuestionColorModel, QuestionCommentWithResetModel, QuestionConvertMode, QuestionConverter, QuestionDropdownAdornerViewModel, QuestionEmbeddedSurveyModel, QuestionFileEditorModel, QuestionImageAdornerViewModel, QuestionLinkValueModel, QuestionRatingAdornerViewModel, QuestionSpinEditorModel, QuestionTextWithResetModel, QuestionToolbox, QuestionToolboxCategory, QuestionToolboxItem, RGBToHSB, ResetValueAdorner, ResizeManager, RowViewModel, ScrollViewModel, SearchManager, SearchManagerPropertyGrid, SearchManagerToolbox, SidebarHeaderModel, SidebarModel, SidebarPageModel, StringEditorConnector, StringEditorViewModelBase, StringItemsNavigatorBase, SurveyCreatorModel, SurveyHelper, SurveyJSON5, SurveyLogic, SurveyLogicUI, SurveyQuestionEditorDefinition, SurveyQuestionEditorPropertyDefinition, SurveyQuestionEditorTabDefinition, SurveyQuestionProperties, SurveyResultsItemModel, SurveyResultsModel, SurveySimulatorModel, SurveyTextWorker, SurveyTextWorkerError, SurveyTextWorkerJsonError, SurveyTextWorkerParserError, Switcher, TabControlModel, TabDesignerPlugin, TabDesignerViewModel, TabJsonEditorAcePlugin, TabJsonEditorBasePlugin, TabJsonEditorTextareaPlugin, TabLogicPlugin, TabTestPlugin, TabTranslationPlugin, TabbedMenuContainer, TabbedMenuItem, TestSurveyTabViewModel, TextareaJsonEditorModel, ThemeModelEditorDefinition, ThemeTabPlugin, ThemeTabViewModel, Themes, ToolbarActionContainer, ToolboxToolViewModel, Transaction, Translation, TranslationEditor, TranslationForEditor, TranslationGroup, TranslationItem, TranslationItemBase, TranslationItemString, UndoRedoAction, UndoRedoArrayAction, UndoRedoManager, UndoRedoPlugin, Version, assign, assignDefaultClasses, backgroundCornerRadiusFromCssVariable, backgroundCornerRadiusToCssVariable, calculateDragOverLocation, calculateIsEdge, calculateIsSide, capitalize, clearNewLines, colorsAreEqual, convertRgbaToString, copyCssClasses, copyObject, createBoxShadow, createBoxShadowReset, createColor, createExportCSVAction, createImportCSVAction, creatorThemeModelEditorDefinition, creatorThemeModelPropertyGridDefinition, defaultCreatorThemesOrder, defaultPropertyGridDefinition, defaultStrings, defaultThemesOrder, editableStringRendererName, editorLocalization, enStrings, findParentNode, focusFirstControl, fontsettingsFromCssVariable, fontsettingsToCssVariable, getAcceptedTypesByContentMode, getElementWrapperComponentData, getElementWrapperComponentName, getFirstNonTextElement, getItemValueWrapperComponentData, getItemValueWrapperComponentName, getLocString, getLocaleStrings, getNextItemText, getNextItemValue, getNextValue, getNodesFromKoComponentInfo, getOS, getPredefinedBackgoundColorsChoices, getPredefinedColorsItemValues, getQuestionContentWrapperComponentName, getQuestionFromObj, getRGBaChannelValues, iconsV1, iconsV2, ignoreUndoRedo, imageMimeTypes, ingectAlpha, initLogicOperator, initialSettingsAllowShowEmptyTitleInDesignMode, initializeDesignTimeSurveyModel, isStringEditable, isTextInput, listComponentCss, editorLocalization as localization, logicCss, notShortCircuitAnd, parseBoxShadow, parseColor, parseRgbaFromString, propertyGridCss, registerAdorner, registerCreatorTheme, registerSurveyTheme, removeAdorners, roundTo2Decimals, saveToFileHandler, scrollElementIntoView, select, setSurveyJSONForPropertyGrid, settings, setupLocale, simulatorDevices, svgBundle, themeModelPropertyGridDefinition, toggleHovered, translationCss, trimBoxShadowValue, trimEmptyFields, undoRedoTransaction, updateBackgroundCornerRadiusJSON, updateFontSettingsJSON, updateShadowEffectsJSON, updatecoloralphaJSON, wrapTextByCurlyBraces };
35724
36030
  //# sourceMappingURL=survey-creator-core.js.map