survey-creator-core 2.0.0-rc.6 → 2.0.0-rc.7

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 (145) 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 +182 -98
  38. package/fesm/survey-creator-core.js.map +1 -1
  39. package/fesm/themes/index.js +1 -1
  40. package/fonts.fontless.css +1 -1
  41. package/fonts.fontless.min.css +1 -1
  42. package/i18n/arabic.js +1 -1
  43. package/i18n/arabic.min.js.LICENSE.txt +1 -1
  44. package/i18n/bulgarian.js +1 -1
  45. package/i18n/bulgarian.min.js.LICENSE.txt +1 -1
  46. package/i18n/burmese.js +1 -1
  47. package/i18n/burmese.min.js.LICENSE.txt +1 -1
  48. package/i18n/croatian.js +1 -1
  49. package/i18n/croatian.min.js.LICENSE.txt +1 -1
  50. package/i18n/czech.js +1 -1
  51. package/i18n/czech.min.js.LICENSE.txt +1 -1
  52. package/i18n/danish.js +1 -1
  53. package/i18n/danish.min.js.LICENSE.txt +1 -1
  54. package/i18n/dutch.js +1 -1
  55. package/i18n/dutch.min.js.LICENSE.txt +1 -1
  56. package/i18n/english.js +1 -1
  57. package/i18n/english.min.js.LICENSE.txt +1 -1
  58. package/i18n/finnish.js +1 -1
  59. package/i18n/finnish.min.js.LICENSE.txt +1 -1
  60. package/i18n/french.js +1 -1
  61. package/i18n/french.min.js.LICENSE.txt +1 -1
  62. package/i18n/german.js +1 -1
  63. package/i18n/german.min.js.LICENSE.txt +1 -1
  64. package/i18n/hebrew.js +1 -1
  65. package/i18n/hebrew.min.js.LICENSE.txt +1 -1
  66. package/i18n/hungarian.js +1 -1
  67. package/i18n/hungarian.min.js.LICENSE.txt +1 -1
  68. package/i18n/index.js +1 -1
  69. package/i18n/index.min.js.LICENSE.txt +1 -1
  70. package/i18n/indonesian.js +1 -1
  71. package/i18n/indonesian.min.js.LICENSE.txt +1 -1
  72. package/i18n/italian.js +1 -1
  73. package/i18n/italian.min.js.LICENSE.txt +1 -1
  74. package/i18n/japanese.js +1 -1
  75. package/i18n/japanese.min.js.LICENSE.txt +1 -1
  76. package/i18n/korean.js +1 -1
  77. package/i18n/korean.min.js.LICENSE.txt +1 -1
  78. package/i18n/malay.js +1 -1
  79. package/i18n/malay.min.js.LICENSE.txt +1 -1
  80. package/i18n/mongolian.js +1 -1
  81. package/i18n/mongolian.min.js.LICENSE.txt +1 -1
  82. package/i18n/norwegian.js +1 -1
  83. package/i18n/norwegian.min.js.LICENSE.txt +1 -1
  84. package/i18n/persian.js +1 -1
  85. package/i18n/persian.min.js.LICENSE.txt +1 -1
  86. package/i18n/polish.js +1 -1
  87. package/i18n/polish.min.js.LICENSE.txt +1 -1
  88. package/i18n/portuguese.js +1 -1
  89. package/i18n/portuguese.min.js.LICENSE.txt +1 -1
  90. package/i18n/romanian.js +1 -1
  91. package/i18n/romanian.min.js.LICENSE.txt +1 -1
  92. package/i18n/russian.js +1 -1
  93. package/i18n/russian.min.js.LICENSE.txt +1 -1
  94. package/i18n/simplified-chinese.js +1 -1
  95. package/i18n/simplified-chinese.min.js.LICENSE.txt +1 -1
  96. package/i18n/slovak.js +1 -1
  97. package/i18n/slovak.min.js.LICENSE.txt +1 -1
  98. package/i18n/slovenian.js +1 -1
  99. package/i18n/slovenian.min.js.LICENSE.txt +1 -1
  100. package/i18n/spanish.js +1 -1
  101. package/i18n/spanish.min.js.LICENSE.txt +1 -1
  102. package/i18n/swedish.js +1 -1
  103. package/i18n/swedish.min.js.LICENSE.txt +1 -1
  104. package/i18n/tajik.js +1 -1
  105. package/i18n/tajik.min.js.LICENSE.txt +1 -1
  106. package/i18n/thai.js +1 -1
  107. package/i18n/thai.min.js.LICENSE.txt +1 -1
  108. package/i18n/traditional-chinese.js +1 -1
  109. package/i18n/traditional-chinese.min.js.LICENSE.txt +1 -1
  110. package/i18n/turkish.js +1 -1
  111. package/i18n/turkish.min.js.LICENSE.txt +1 -1
  112. package/package.json +2 -2
  113. package/survey-creator-core.css +2 -2
  114. package/survey-creator-core.fontless.css +1 -1
  115. package/survey-creator-core.fontless.min.css +1 -1
  116. package/survey-creator-core.i18n.js +1 -1
  117. package/survey-creator-core.i18n.min.js.LICENSE.txt +1 -1
  118. package/survey-creator-core.js +199 -98
  119. package/survey-creator-core.js.map +1 -1
  120. package/survey-creator-core.min.css +2 -2
  121. package/survey-creator-core.min.js +1 -1
  122. package/survey-creator-core.min.js.LICENSE.txt +1 -1
  123. package/themes/default-contrast.js +2 -2
  124. package/themes/default-contrast.js.map +1 -1
  125. package/themes/default-contrast.min.js +1 -1
  126. package/themes/default-contrast.min.js.LICENSE.txt +1 -1
  127. package/themes/default-dark.js +2 -2
  128. package/themes/default-dark.js.map +1 -1
  129. package/themes/default-dark.min.js +1 -1
  130. package/themes/default-dark.min.js.LICENSE.txt +1 -1
  131. package/themes/index.js +2 -2
  132. package/themes/index.js.map +1 -1
  133. package/themes/index.min.js +1 -1
  134. package/themes/index.min.js.LICENSE.txt +1 -1
  135. package/themes/sc2020.js +2 -2
  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 +10 -3
  140. package/typings/components/page.d.ts +2 -1
  141. package/typings/components/question.d.ts +5 -4
  142. package/typings/components/tabs/designer-plugin.d.ts +1 -1
  143. package/typings/components/tabs/preview.d.ts +1 -0
  144. package/typings/property-grid/index.d.ts +3 -1
  145. package/typings/property-grid/property-grid-view-model.d.ts +5 -2
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * SurveyJS Creator v2.0.0-rc.6
2
+ * SurveyJS Creator v2.0.0-rc.7
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
@@ -13466,6 +13466,11 @@ class PreviewViewModel extends external_survey_core_namespaceObject.Base {
13466
13466
  this.updatePageList();
13467
13467
  this.show();
13468
13468
  }
13469
+ isSurveyRunning() {
13470
+ var _a;
13471
+ const state = (_a = this.survey) === null || _a === void 0 ? void 0 : _a.state;
13472
+ return state === "running" || state === "starting";
13473
+ }
13469
13474
  buildActions() {
13470
13475
  const pageActions = [];
13471
13476
  const setNearPage = (isNext) => {
@@ -13486,7 +13491,7 @@ class PreviewViewModel extends external_survey_core_namespaceObject.Base {
13486
13491
  };
13487
13492
  if (this.prevPageAction) {
13488
13493
  this.prevPageAction.visible = new external_survey_core_namespaceObject.ComputedUpdater(() => {
13489
- const isRunning = this.survey.state === "running";
13494
+ const isRunning = this.isSurveyRunning();
13490
13495
  const isActiveTab = this.getTabName() === this.surveyProvider.activeTab;
13491
13496
  return notShortCircuitAnd(this.isRunning, isActiveTab, this.pageListItems.length > 1) && isRunning;
13492
13497
  });
@@ -13518,11 +13523,11 @@ class PreviewViewModel extends external_survey_core_namespaceObject.Base {
13518
13523
  });
13519
13524
  pageActions.push(this.selectPageAction);
13520
13525
  this.selectPageAction.visible = new external_survey_core_namespaceObject.ComputedUpdater(() => {
13521
- return this.survey.state === "running";
13526
+ return this.isSurveyRunning();
13522
13527
  });
13523
13528
  if (this.nextPageAction) {
13524
13529
  this.nextPageAction.visible = new external_survey_core_namespaceObject.ComputedUpdater(() => {
13525
- const isRunning = this.survey.state === "running";
13530
+ const isRunning = this.isSurveyRunning();
13526
13531
  const isActiveTab = this.getTabName() === this.surveyProvider.activeTab;
13527
13532
  return notShortCircuitAnd(this.isRunning, isActiveTab, this.pageListItems.length > 1) && isRunning;
13528
13533
  });
@@ -18258,6 +18263,9 @@ class PropertyGridModel {
18258
18263
  }
18259
18264
  setObj(value) {
18260
18265
  this.objValue = value;
18266
+ if (this.onSetNewObjectCallback) {
18267
+ this.onSetNewObjectCallback();
18268
+ }
18261
18269
  this.classNameProperty = !!this.obj
18262
18270
  ? PropertyJSONGenerator.getClassNameProperty(this.obj)
18263
18271
  : "";
@@ -18267,24 +18275,33 @@ class PropertyGridModel {
18267
18275
  this.titleActionsCreator = !!this.obj
18268
18276
  ? new PropertyGridTitleActionsCreator(this.obj, this.options)
18269
18277
  : undefined;
18270
- var json = this.getSurveyJSON();
18278
+ if (!this.surveyValue)
18279
+ return;
18280
+ this.clearSurveyValue();
18281
+ this.createSurveyValue();
18282
+ }
18283
+ clearSurveyValue() {
18284
+ this.surveyValue.onValidateQuestion.clear();
18285
+ this.surveyValue.onValueChanging.clear();
18286
+ this.surveyValue.onValueChanged.clear();
18287
+ this.surveyValue.onMatrixCellValueChanging.clear();
18288
+ this.surveyValue.onMatrixCellValidate.clear();
18289
+ this.surveyValue.onMatrixCellValueChanged.clear();
18290
+ this.surveyValue.editingObj = undefined;
18291
+ this.surveyValue.data = {};
18292
+ this.surveyValue.dispose();
18293
+ }
18294
+ createSurveyValue() {
18295
+ const json = this.getSurveyJSON();
18271
18296
  if (this.options.readOnly) {
18272
18297
  json.mode = "display";
18273
18298
  }
18274
- if (!!this.surveyValue) {
18275
- this.surveyValue.onValidateQuestion.clear();
18276
- this.surveyValue.onValueChanging.clear();
18277
- this.surveyValue.onValueChanged.clear();
18278
- this.surveyValue.onMatrixCellValueChanging.clear();
18279
- this.surveyValue.onMatrixCellValidate.clear();
18280
- this.surveyValue.onMatrixCellValueChanged.clear();
18281
- this.surveyValue.editingObj = undefined;
18282
- this.surveyValue.data = {};
18283
- this.surveyValue.dispose();
18284
- }
18285
18299
  this.surveyValue = this.createSurvey(json, (survey) => {
18286
18300
  this.onCreateSurvey(survey);
18287
18301
  });
18302
+ if (this.onNewSurveyCreatedCallback) {
18303
+ this.onNewSurveyCreatedCallback();
18304
+ }
18288
18305
  if (!this.obj)
18289
18306
  return;
18290
18307
  this.survey.onValueChanged.add((sender, options) => {
@@ -18351,9 +18368,6 @@ class PropertyGridModel {
18351
18368
  }
18352
18369
  });
18353
18370
  this.survey.editingObj = this.obj;
18354
- if (this.objValueChangedCallback) {
18355
- this.objValueChangedCallback();
18356
- }
18357
18371
  this.updateDependedPropertiesEditors();
18358
18372
  if (this.showOneCategoryInPropertyGrid) {
18359
18373
  this.survey.onCurrentPageChanged.add((sender, options) => {
@@ -18461,6 +18475,9 @@ class PropertyGridModel {
18461
18475
  this.optionsValue = !!val ? val : new EmptySurveyCreatorOptions();
18462
18476
  }
18463
18477
  get survey() {
18478
+ if (!this.surveyValue) {
18479
+ this.createSurveyValue();
18480
+ }
18464
18481
  return this.surveyValue;
18465
18482
  }
18466
18483
  validate() {
@@ -18503,6 +18520,8 @@ class PropertyGridModel {
18503
18520
  });
18504
18521
  }
18505
18522
  expandCategoryIfNeeded() {
18523
+ if (!this.surveyValue)
18524
+ return;
18506
18525
  const expandedTabName = settings.propertyGrid.defaultExpandedTabName;
18507
18526
  if (!!expandedTabName && !this.getPropertyGridExpandedCategory()) {
18508
18527
  const panel = this.survey.getPanelByName(expandedTabName);
@@ -18596,9 +18615,6 @@ class PropertyGridModel {
18596
18615
  options.name === this.classNameProperty &&
18597
18616
  this.classNameValue !== options.value) {
18598
18617
  this.setObj(this.obj);
18599
- if (this.onSetNewObjectCallback) {
18600
- this.onSetNewObjectCallback();
18601
- }
18602
18618
  if (!!this.survey) {
18603
18619
  const question = this.survey.getQuestionByName(options.name);
18604
18620
  if (!!question) {
@@ -20461,13 +20477,12 @@ class SurveyElementAdornerBase extends external_survey_core_namespaceObject.Base
20461
20477
  get renderedCollapsed() {
20462
20478
  return !!this._renderedCollapsed;
20463
20479
  }
20464
- createActionContainers() {
20465
- this.actionContainer = this.createActionContainer();
20466
- this.topActionContainer = new external_survey_core_namespaceObject.ActionContainer();
20467
- this.topActionContainer.sizeMode = "small";
20480
+ createTopActionContainer() {
20481
+ const actionContainer = new external_survey_core_namespaceObject.ActionContainer();
20482
+ actionContainer.sizeMode = "small";
20468
20483
  if (this.creator.expandCollapseButtonVisibility != "never") {
20469
- this.topActionContainer.setItems([this.expandCollapseAction]);
20470
- this.topActionContainer.cssClasses = {
20484
+ actionContainer.setItems([this.expandCollapseAction]);
20485
+ actionContainer.cssClasses = {
20471
20486
  root: "svc-survey-element-top-toolbar sv-action-bar",
20472
20487
  item: "svc-survey-element-top-toolbar__item",
20473
20488
  itemIcon: "svc-survey-element-toolbar-item__icon",
@@ -20475,6 +20490,7 @@ class SurveyElementAdornerBase extends external_survey_core_namespaceObject.Base
20475
20490
  itemTitleWithIcon: "svc-survey-element-toolbar-item__title--with-icon",
20476
20491
  };
20477
20492
  }
20493
+ return actionContainer;
20478
20494
  }
20479
20495
  createActionContainer() {
20480
20496
  const actionContainer = new SurveyElementActionContainer();
@@ -20535,10 +20551,32 @@ class SurveyElementAdornerBase extends external_survey_core_namespaceObject.Base
20535
20551
  this.updateActionsProperties();
20536
20552
  }
20537
20553
  };
20554
+ this.actionVisibilityCache = {};
20538
20555
  this.expandCollapseAction = this.getExpandCollapseAction();
20539
- this.createActionContainers();
20540
20556
  this.attachToUI(surveyElement);
20541
20557
  }
20558
+ get isActionContainerCreated() {
20559
+ return !!this.actionContainerValue;
20560
+ }
20561
+ get actionContainer() {
20562
+ if (!this.actionContainerValue) {
20563
+ this.actionContainerValue = this.createActionContainer();
20564
+ if (this.surveyElement) {
20565
+ this.updateActionsContainer(this.surveyElement);
20566
+ this.updateActionsVisibility(false);
20567
+ }
20568
+ }
20569
+ return this.actionContainerValue;
20570
+ }
20571
+ get topActionContainer() {
20572
+ if (!this.topActionContainerValue) {
20573
+ this.topActionContainerValue = this.createTopActionContainer();
20574
+ if (this.surveyElement) {
20575
+ this.updateActionsVisibility(true);
20576
+ }
20577
+ }
20578
+ return this.topActionContainerValue;
20579
+ }
20542
20580
  static GetAdorner(surveyElement) {
20543
20581
  return surveyElement.getPropertyValue(SurveyElementAdornerBase.AdornerValueName);
20544
20582
  }
@@ -20614,13 +20652,17 @@ class SurveyElementAdornerBase extends external_survey_core_namespaceObject.Base
20614
20652
  }
20615
20653
  dispose() {
20616
20654
  this.detachFromUI();
20617
- if (!this.actionContainer.isDisposed) {
20618
- this.actionContainer.dispose();
20619
- }
20655
+ this.disposeActions(this.actionContainerValue);
20656
+ this.disposeActions(this.topActionContainerValue);
20620
20657
  super.dispose();
20621
20658
  this.sidebarFlyoutModeChangedFunc = undefined;
20622
20659
  this.animationCollapsed = undefined;
20623
20660
  }
20661
+ disposeActions(container) {
20662
+ if (!!container && !container.isDisposed) {
20663
+ container.dispose();
20664
+ }
20665
+ }
20624
20666
  onElementSelectedChanged(isSelected) {
20625
20667
  if (!isSelected)
20626
20668
  return;
@@ -20641,19 +20683,27 @@ class SurveyElementAdornerBase extends external_survey_core_namespaceObject.Base
20641
20683
  };
20642
20684
  }
20643
20685
  cleanActionsContainer() {
20644
- const actions = this.actionContainer.actions;
20645
- this.actionContainer.setItems([]);
20686
+ const container = this.actionContainerValue;
20687
+ if (!container)
20688
+ return;
20689
+ const actions = container.actions;
20690
+ container.setItems([]);
20646
20691
  actions.forEach(action => action.dispose && action.dispose());
20647
20692
  }
20648
20693
  updateActionsContainer(surveyElement) {
20694
+ if (!this.actionContainerValue)
20695
+ return;
20649
20696
  const actions = [];
20650
20697
  this.buildActions(actions);
20651
20698
  this.creator.onElementMenuItemsChanged(surveyElement, actions);
20652
- this.actionContainer.setItems(actions);
20699
+ this.actionContainerValue.setItems(actions);
20653
20700
  }
20654
20701
  updateActionsProperties() {
20655
20702
  if (this.isDisposed)
20656
20703
  return;
20704
+ this.updateActionsPropertiesCore();
20705
+ }
20706
+ updateActionsPropertiesCore() {
20657
20707
  this.updateElementAllowOptions(this.creator.getElementAllowOperations(this.surveyElement), this.isOperationsAllow());
20658
20708
  }
20659
20709
  getAllowDragging(options) {
@@ -20682,12 +20732,21 @@ class SurveyElementAdornerBase extends external_survey_core_namespaceObject.Base
20682
20732
  return !this.creator.readOnly;
20683
20733
  }
20684
20734
  updateActionVisibility(id, isVisible) {
20685
- var action = this.getActionById(id);
20686
- if (!action)
20687
- return;
20688
- if (action.visible == isVisible)
20689
- return;
20690
- action.visible = isVisible;
20735
+ var _a, _b;
20736
+ 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));
20737
+ if (!action) {
20738
+ this.actionVisibilityCache[id] = isVisible;
20739
+ }
20740
+ else {
20741
+ if (action.visible !== isVisible) {
20742
+ action.visible = isVisible;
20743
+ }
20744
+ }
20745
+ }
20746
+ updateActionsVisibility(isTop) {
20747
+ for (var key in this.actionVisibilityCache) {
20748
+ this.updateActionVisibility(key, this.actionVisibilityCache[key]);
20749
+ }
20691
20750
  }
20692
20751
  getActionById(id) {
20693
20752
  return this.actionContainer.getActionById(id) || this.topActionContainer.getActionById(id);
@@ -26277,8 +26336,11 @@ class PropertyGridViewModel extends external_survey_core_namespaceObject.Base {
26277
26336
  this.searchManager = new SearchManagerPropertyGrid();
26278
26337
  this.searchEnabled = settings.propertyGrid.enableSearch;
26279
26338
  this.selectedElementName = this.getTitle();
26280
- this.propertyGridModel.objValueChangedCallback = () => {
26281
- this.onSurveyChanged();
26339
+ this.propertyGridModel.onSetNewObjectCallback = () => {
26340
+ this.onSurveyObjChanged();
26341
+ };
26342
+ this.propertyGridModel.onNewSurveyCreatedCallback = () => {
26343
+ this.onNewSurveyCreated();
26282
26344
  };
26283
26345
  this.propertyGridModel.changedFromActionCallback = (obj, propertyName) => {
26284
26346
  if (!!this.selectionController) {
@@ -26291,7 +26353,13 @@ class PropertyGridViewModel extends external_survey_core_namespaceObject.Base {
26291
26353
  this.selectorPopupModel.horizontalPosition = this.creator.sidebarLocation == "right" ? "left" : "right";
26292
26354
  }
26293
26355
  });
26294
- this.onSurveyChanged();
26356
+ this.onSurveyObjChanged();
26357
+ }
26358
+ get survey() {
26359
+ return this.getPropertyValue("survey", undefined, () => this.propertyGridModel.survey);
26360
+ }
26361
+ set survey(val) {
26362
+ this.setPropertyValue("survey", val);
26295
26363
  }
26296
26364
  get rootCss() {
26297
26365
  return new external_survey_core_namespaceObject.CssClassBuilder()
@@ -26311,7 +26379,14 @@ class PropertyGridViewModel extends external_survey_core_namespaceObject.Base {
26311
26379
  get selectionController() {
26312
26380
  return this.creator.selectionHistoryController;
26313
26381
  }
26314
- onSurveyChanged() {
26382
+ onSurveyObjChanged() {
26383
+ this.updateTitle();
26384
+ if (this.selectionController) {
26385
+ this.hasPrev = this.selectionController.hasPrev;
26386
+ this.hasNext = this.selectionController.hasNext;
26387
+ }
26388
+ }
26389
+ onNewSurveyCreated() {
26315
26390
  this.survey = this.propertyGridModel.survey;
26316
26391
  this.searchManager.setSurvey(this.survey);
26317
26392
  if (!!this.survey) {
@@ -26321,10 +26396,8 @@ class PropertyGridViewModel extends external_survey_core_namespaceObject.Base {
26321
26396
  }
26322
26397
  });
26323
26398
  }
26324
- this.updateTitle();
26325
- if (this.selectionController) {
26326
- this.hasPrev = this.selectionController.hasPrev;
26327
- this.hasNext = this.selectionController.hasNext;
26399
+ if (this.onNewSurveyCreatedCallback) {
26400
+ this.onNewSurveyCreatedCallback();
26328
26401
  }
26329
26402
  }
26330
26403
  updateTitle() {
@@ -26424,9 +26497,6 @@ __decorate([
26424
26497
  __decorate([
26425
26498
  (0,external_survey_core_namespaceObject.property)()
26426
26499
  ], PropertyGridViewModel.prototype, "hasNext", void 0);
26427
- __decorate([
26428
- (0,external_survey_core_namespaceObject.property)()
26429
- ], PropertyGridViewModel.prototype, "survey", void 0);
26430
26500
  __decorate([
26431
26501
  (0,external_survey_core_namespaceObject.property)()
26432
26502
  ], PropertyGridViewModel.prototype, "selectedElementName", void 0);
@@ -27691,7 +27761,6 @@ class TabDesignerPlugin {
27691
27761
  }
27692
27762
  updateTabControl() {
27693
27763
  if (this.showOneCategoryInPropertyGrid) {
27694
- this.updateTabControlActions();
27695
27764
  this.creator.sidebar.sideAreaComponentName = "svc-tab-control";
27696
27765
  this.creator.sidebar.sideAreaComponentData = this.tabControlModel;
27697
27766
  }
@@ -27765,11 +27834,6 @@ class TabDesignerPlugin {
27765
27834
  if (this.creator.showCreatorThemeSettings) {
27766
27835
  this.themeModel.loadTheme(this.creator.creatorTheme);
27767
27836
  this.themePropertyGrid.obj = this.themeModel;
27768
- this.themePropertyGrid.survey.onUpdatePanelCssClasses.add((_, options) => {
27769
- options.cssClasses.panel.container += " spg-panel--group";
27770
- });
27771
- this.updateThemeChooserChoices();
27772
- this.updatePredefinedColorChoices();
27773
27837
  }
27774
27838
  }
27775
27839
  setTheme() {
@@ -27777,20 +27841,15 @@ class TabDesignerPlugin {
27777
27841
  this.themeModel.setTheme(this.creator.creatorTheme);
27778
27842
  }
27779
27843
  }
27780
- updateThemeChooserChoices() {
27781
- const themeChooser = this.themePropertyGrid.survey.getQuestionByName("themeName");
27782
- if (!!themeChooser) {
27783
- themeChooser.choices = PredefinedCreatorThemes.map(theme => ({ value: theme, text: getLocString("creatortheme.names." + theme) }));
27784
- }
27785
- this.themePropertyGrid.survey.runExpressions();
27786
- }
27787
27844
  createCreatorThemeSettingsPage(creator) {
27788
27845
  this.themeModel = new CreatorThemeModel();
27789
27846
  this.themePropertyGrid = new PropertyGridModel(undefined, creator, creatorThemeModelPropertyGridDefinition);
27790
- this.themePropertyGrid.survey.css.root += "svc-creator-theme-settings";
27791
27847
  this.themePropertyGrid.showOneCategoryInPropertyGrid = true;
27792
27848
  this.themePropertyGrid.surveyInstanceCreatedArea = "designer-tab:creator-settings";
27793
27849
  const themePropertyGridViewModel = new PropertyGridViewModel(this.themePropertyGrid, creator);
27850
+ themePropertyGridViewModel.onNewSurveyCreatedCallback = () => {
27851
+ this.onThemePropertyGridSurveyCreated();
27852
+ };
27794
27853
  themePropertyGridViewModel.searchEnabled = false;
27795
27854
  this.themePropertyGridTab = this.creator.sidebar.addPage("creatorTheme", "svc-property-grid", themePropertyGridViewModel);
27796
27855
  this.themePropertyGridTab.caption = editorLocalization.getString("ed.creatorSettingTitle");
@@ -27828,6 +27887,19 @@ class TabDesignerPlugin {
27828
27887
  });
27829
27888
  this.tabControlModel.bottomToolbar.setItems([settingsAction]);
27830
27889
  }
27890
+ onThemePropertyGridSurveyCreated() {
27891
+ const survey = this.themePropertyGrid.survey;
27892
+ survey.css.root += " svc-creator-theme-settings";
27893
+ survey.onUpdatePanelCssClasses.add((_, options) => {
27894
+ options.cssClasses.panel.container += " spg-panel--group";
27895
+ });
27896
+ const themeChooser = survey.getQuestionByName("themeName");
27897
+ if (!!themeChooser) {
27898
+ themeChooser.choices = PredefinedCreatorThemes.map(theme => ({ value: theme, text: getLocString("creatortheme.names." + theme) }));
27899
+ }
27900
+ survey.runExpressions();
27901
+ this.updatePredefinedColorChoices();
27902
+ }
27831
27903
  constructor(creator) {
27832
27904
  this.creator = creator;
27833
27905
  this._showOneCategoryInPropertyGrid = true;
@@ -27837,10 +27909,10 @@ class TabDesignerPlugin {
27837
27909
  this.showOneCategoryInPropertyGrid = creator.showOneCategoryInPropertyGrid;
27838
27910
  this.propertyGrid.showOneCategoryInPropertyGrid = this.showOneCategoryInPropertyGrid;
27839
27911
  this.propertyGrid.obj = creator.survey;
27840
- this.propertyGrid.onSetNewObjectCallback = () => {
27912
+ this.propertyGridViewModel = new PropertyGridViewModel(this.propertyGrid, creator);
27913
+ this.propertyGridViewModel.onNewSurveyCreatedCallback = () => {
27841
27914
  this.updateTabControlActions();
27842
27915
  };
27843
- this.propertyGridViewModel = new PropertyGridViewModel(this.propertyGrid, creator);
27844
27916
  this.propertyGridPlaceholderPage = this.creator.sidebar.addPage("propertyGridPlaceholder", "svc-property-grid-placeholder", this.propertyGridViewModel);
27845
27917
  this.propertyGridPlaceholderPage.caption = editorLocalization.getString("ed.surveySettings");
27846
27918
  this.propertyGridTab = this.creator.sidebar.addPage("propertyGrid", "svc-property-grid", this.propertyGridViewModel, () => {
@@ -32375,6 +32447,9 @@ class SurveyCreatorModel extends external_survey_core_namespaceObject.Base {
32375
32447
  * @returns true if initial survey doesn't have any elements or properties
32376
32448
  */
32377
32449
  initSurveyWithJSON(json, clearState) {
32450
+ if (!json) {
32451
+ json = { "headerView": "advanced" };
32452
+ }
32378
32453
  this.existingPages = {};
32379
32454
  const survey = this.createSurvey({}, "designer", undefined, (survey) => {
32380
32455
  survey.skeletonHeight = 188;
@@ -35189,7 +35264,7 @@ class PageAdorner extends SurveyElementAdornerBase {
35189
35264
  }, null, type || this.currentAddQuestionType || settings.designer.defaultAddQuestionType);
35190
35265
  };
35191
35266
  this.creatorPropertyChanged = (sender, options) => {
35192
- if (options.name === "isMobileView") {
35267
+ if (options.name === "isMobileView" && this.isActionContainerCreated) {
35193
35268
  this.actionContainer.alwaysShrink = options.newValue;
35194
35269
  }
35195
35270
  };
@@ -35205,7 +35280,6 @@ class PageAdorner extends SurveyElementAdornerBase {
35205
35280
  this.creator.survey.currentPage = this.page;
35206
35281
  });
35207
35282
  this.dragOrClickHelper = new external_survey_core_namespaceObject.DragOrClickHelper(this.startDragSurveyElement);
35208
- this.actionContainer.alwaysShrink = this.creator.isMobileView;
35209
35283
  this.creator.onPropertyChanged.add(this.creatorPropertyChanged);
35210
35284
  }
35211
35285
  dispose() {
@@ -35310,8 +35384,21 @@ class PageAdorner extends SurveyElementAdornerBase {
35310
35384
  }
35311
35385
  createActionContainer() {
35312
35386
  const container = super.createActionContainer();
35387
+ container.alwaysShrink = this.creator.isMobileView;
35313
35388
  container.sizeMode = "small";
35314
- container.cssClasses = {
35389
+ container.cssClasses = this.containerCssClasses();
35390
+ container.dotsItem.iconSize = "auto";
35391
+ container.dotsItem.cssClasses.itemIcon += " svc-page-toolbar-item__icon";
35392
+ return container;
35393
+ }
35394
+ createTopActionContainer() {
35395
+ const container = super.createTopActionContainer();
35396
+ container.cssClasses = Object.assign({}, this.containerCssClasses());
35397
+ container.cssClasses.root += " svc-page-toolbar--collapse";
35398
+ return container;
35399
+ }
35400
+ containerCssClasses() {
35401
+ return {
35315
35402
  root: "svc-page-toolbar sv-action-bar",
35316
35403
  item: "svc-page-toolbar__item",
35317
35404
  itemWithTitle: "svc-page-toolbar__item--with-text",
@@ -35321,14 +35408,6 @@ class PageAdorner extends SurveyElementAdornerBase {
35321
35408
  itemTitle: "svc-page-toolbar-item__title",
35322
35409
  itemTitleWithIcon: "svc-page-toolbar-item__title--with-icon",
35323
35410
  };
35324
- container.dotsItem.iconSize = "auto";
35325
- container.dotsItem.cssClasses.itemIcon += " svc-page-toolbar-item__icon";
35326
- return container;
35327
- }
35328
- createActionContainers() {
35329
- super.createActionContainers();
35330
- this.topActionContainer.cssClasses = Object.assign({}, this.actionContainer.cssClasses);
35331
- this.topActionContainer.cssClasses.root += " svc-page-toolbar--collapse";
35332
35411
  }
35333
35412
  allowExpandCollapseByDblClick(element) {
35334
35413
  return element.classList.contains("svc-page__content") ||
@@ -35797,8 +35876,10 @@ class QuestionAdornerViewModel extends SurveyElementAdornerBase {
35797
35876
  super.attachElement(surveyElement);
35798
35877
  if (surveyElement) {
35799
35878
  surveyElement.registerFunctionOnPropertyValueChanged("isRequired", (newValue) => {
35800
- const requiredAction = this.actionContainer.getActionById("isrequired");
35801
- this.updateRequiredAction(requiredAction);
35879
+ if (this.isActionContainerCreated) {
35880
+ const requiredAction = this.actionContainer.getActionById("isrequired");
35881
+ this.updateRequiredAction(requiredAction);
35882
+ }
35802
35883
  }, "isRequiredAdorner");
35803
35884
  }
35804
35885
  }
@@ -35817,8 +35898,8 @@ class QuestionAdornerViewModel extends SurveyElementAdornerBase {
35817
35898
  }
35818
35899
  super.hover(event, element);
35819
35900
  }
35820
- createActionContainers() {
35821
- super.createActionContainers();
35901
+ createActionContainer() {
35902
+ const actionContainer = super.createActionContainer();
35822
35903
  const defaultCssClasses = {
35823
35904
  root: "svc-survey-element-toolbar sv-action-bar",
35824
35905
  item: "svc-survey-element-toolbar__item",
@@ -35830,22 +35911,25 @@ class QuestionAdornerViewModel extends SurveyElementAdornerBase {
35830
35911
  itemTitle: "svc-survey-element-toolbar-item__title",
35831
35912
  itemTitleWithIcon: "svc-survey-element-toolbar-item__title--with-icon",
35832
35913
  };
35833
- this.actionContainer.sizeMode = "small";
35834
- this.actionContainer.cssClasses = defaultCssClasses;
35835
- this.actionContainer.dotsItem.css += " svc-survey-element-toolbar__dots-item";
35836
- this.actionContainer.dotsItem.innerCss += " svc-survey-element-toolbar__item";
35914
+ actionContainer.sizeMode = "small";
35915
+ actionContainer.cssClasses = defaultCssClasses;
35916
+ actionContainer.dotsItem.css += " svc-survey-element-toolbar__dots-item";
35917
+ actionContainer.dotsItem.innerCss += " svc-survey-element-toolbar__item";
35918
+ return actionContainer;
35837
35919
  }
35838
- getActionById(id) {
35839
- let res = super.getActionById(id);
35840
- if (!res) {
35841
- res = this.topActionContainer.getActionById(id);
35920
+ updateActionsPropertiesCore() {
35921
+ super.updateActionsPropertiesCore();
35922
+ if (this.isActionContainerCreated) {
35923
+ this.updateActionsLocations();
35842
35924
  }
35843
- return res;
35844
35925
  }
35845
- updateActionsProperties() {
35846
- if (this.isDisposed)
35847
- return;
35848
- super.updateActionsProperties();
35926
+ updateActionsVisibility(isTop) {
35927
+ super.updateActionsVisibility(isTop);
35928
+ if (!isTop) {
35929
+ this.updateActionsLocations();
35930
+ }
35931
+ }
35932
+ updateActionsLocations() {
35849
35933
  const actions = this.actionContainer.visibleActions;
35850
35934
  let switchToStartLocation = false;
35851
35935
  for (var i = actions.length - 1; i >= 0; i--) {
@@ -39843,7 +39927,7 @@ class CreatorPreset extends CreatorPresetBase {
39843
39927
 
39844
39928
  ;// ./src/entries/index.ts
39845
39929
  let Version;
39846
- Version = `${"2.0.0-rc.6"}`;
39930
+ Version = `${"2.0.0-rc.7"}`;
39847
39931
  //should be loaded before other styles for easier override
39848
39932
  __webpack_require__(5175);
39849
39933
 
@@ -39967,7 +40051,7 @@ __webpack_require__(326);
39967
40051
  __webpack_require__(7671);
39968
40052
  __webpack_require__(5574);
39969
40053
 
39970
- (0,external_survey_core_namespaceObject.checkLibraryVersion)(`${"2.0.0-rc.6"}`, "survey-creator-core");
40054
+ (0,external_survey_core_namespaceObject.checkLibraryVersion)(`${"2.0.0-rc.7"}`, "survey-creator-core");
39971
40055
 
39972
40056
  var __webpack_exports__AceJsonEditorModel = __webpack_exports__.wtv;
39973
40057
  var __webpack_exports__ColorCalculator = __webpack_exports__.YbP;