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
@@ -228,7 +228,7 @@
228
228
  }
229
229
 
230
230
  /*# sourceMappingURL=fonts.fontless.css.map*//*!
231
- * SurveyJS Creator v2.0.0-rc.6
231
+ * SurveyJS Creator v2.0.0-rc.7
232
232
  * (c) 2015-2025 Devsoft Baltic OÜ - http://surveyjs.io/
233
233
  * Github: https://github.com/surveyjs/survey-creator
234
234
  * License: https://surveyjs.io/Licenses#SurveyCreator
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -158,8 +158,8 @@ var SurveyElementAdornerBase = /** @class */ (function (_super) {
158
158
  _this.updateActionsProperties();
159
159
  }
160
160
  };
161
+ _this.actionVisibilityCache = {};
161
162
  _this.expandCollapseAction = _this.getExpandCollapseAction();
162
- _this.createActionContainers();
163
163
  _this.attachToUI(surveyElement);
164
164
  return _this;
165
165
  }
@@ -274,13 +274,12 @@ var SurveyElementAdornerBase = /** @class */ (function (_super) {
274
274
  enumerable: false,
275
275
  configurable: true
276
276
  });
277
- SurveyElementAdornerBase.prototype.createActionContainers = function () {
278
- this.actionContainer = this.createActionContainer();
279
- this.topActionContainer = new survey_core__WEBPACK_IMPORTED_MODULE_1__.ActionContainer();
280
- this.topActionContainer.sizeMode = "small";
277
+ SurveyElementAdornerBase.prototype.createTopActionContainer = function () {
278
+ var actionContainer = new survey_core__WEBPACK_IMPORTED_MODULE_1__.ActionContainer();
279
+ actionContainer.sizeMode = "small";
281
280
  if (this.creator.expandCollapseButtonVisibility != "never") {
282
- this.topActionContainer.setItems([this.expandCollapseAction]);
283
- this.topActionContainer.cssClasses = {
281
+ actionContainer.setItems([this.expandCollapseAction]);
282
+ actionContainer.cssClasses = {
284
283
  root: "svc-survey-element-top-toolbar sv-action-bar",
285
284
  item: "svc-survey-element-top-toolbar__item",
286
285
  itemIcon: "svc-survey-element-toolbar-item__icon",
@@ -288,6 +287,7 @@ var SurveyElementAdornerBase = /** @class */ (function (_super) {
288
287
  itemTitleWithIcon: "svc-survey-element-toolbar-item__title--with-icon",
289
288
  };
290
289
  }
290
+ return actionContainer;
291
291
  };
292
292
  SurveyElementAdornerBase.prototype.createActionContainer = function () {
293
293
  var actionContainer = new SurveyElementActionContainer();
@@ -339,6 +339,40 @@ var SurveyElementAdornerBase = /** @class */ (function (_super) {
339
339
  enumerable: false,
340
340
  configurable: true
341
341
  });
342
+ Object.defineProperty(SurveyElementAdornerBase.prototype, "isActionContainerCreated", {
343
+ get: function () {
344
+ return !!this.actionContainerValue;
345
+ },
346
+ enumerable: false,
347
+ configurable: true
348
+ });
349
+ Object.defineProperty(SurveyElementAdornerBase.prototype, "actionContainer", {
350
+ get: function () {
351
+ if (!this.actionContainerValue) {
352
+ this.actionContainerValue = this.createActionContainer();
353
+ if (this.surveyElement) {
354
+ this.updateActionsContainer(this.surveyElement);
355
+ this.updateActionsVisibility(false);
356
+ }
357
+ }
358
+ return this.actionContainerValue;
359
+ },
360
+ enumerable: false,
361
+ configurable: true
362
+ });
363
+ Object.defineProperty(SurveyElementAdornerBase.prototype, "topActionContainer", {
364
+ get: function () {
365
+ if (!this.topActionContainerValue) {
366
+ this.topActionContainerValue = this.createTopActionContainer();
367
+ if (this.surveyElement) {
368
+ this.updateActionsVisibility(true);
369
+ }
370
+ }
371
+ return this.topActionContainerValue;
372
+ },
373
+ enumerable: false,
374
+ configurable: true
375
+ });
342
376
  SurveyElementAdornerBase.GetAdorner = function (surveyElement) {
343
377
  return surveyElement.getPropertyValue(SurveyElementAdornerBase.AdornerValueName);
344
378
  };
@@ -415,13 +449,17 @@ var SurveyElementAdornerBase = /** @class */ (function (_super) {
415
449
  };
416
450
  SurveyElementAdornerBase.prototype.dispose = function () {
417
451
  this.detachFromUI();
418
- if (!this.actionContainer.isDisposed) {
419
- this.actionContainer.dispose();
420
- }
452
+ this.disposeActions(this.actionContainerValue);
453
+ this.disposeActions(this.topActionContainerValue);
421
454
  _super.prototype.dispose.call(this);
422
455
  this.sidebarFlyoutModeChangedFunc = undefined;
423
456
  this.animationCollapsed = undefined;
424
457
  };
458
+ SurveyElementAdornerBase.prototype.disposeActions = function (container) {
459
+ if (!!container && !container.isDisposed) {
460
+ container.dispose();
461
+ }
462
+ };
425
463
  SurveyElementAdornerBase.prototype.onElementSelectedChanged = function (isSelected) {
426
464
  if (!isSelected)
427
465
  return;
@@ -443,19 +481,27 @@ var SurveyElementAdornerBase = /** @class */ (function (_super) {
443
481
  };
444
482
  };
445
483
  SurveyElementAdornerBase.prototype.cleanActionsContainer = function () {
446
- var actions = this.actionContainer.actions;
447
- this.actionContainer.setItems([]);
484
+ var container = this.actionContainerValue;
485
+ if (!container)
486
+ return;
487
+ var actions = container.actions;
488
+ container.setItems([]);
448
489
  actions.forEach(function (action) { return action.dispose && action.dispose(); });
449
490
  };
450
491
  SurveyElementAdornerBase.prototype.updateActionsContainer = function (surveyElement) {
492
+ if (!this.actionContainerValue)
493
+ return;
451
494
  var actions = [];
452
495
  this.buildActions(actions);
453
496
  this.creator.onElementMenuItemsChanged(surveyElement, actions);
454
- this.actionContainer.setItems(actions);
497
+ this.actionContainerValue.setItems(actions);
455
498
  };
456
499
  SurveyElementAdornerBase.prototype.updateActionsProperties = function () {
457
500
  if (this.isDisposed)
458
501
  return;
502
+ this.updateActionsPropertiesCore();
503
+ };
504
+ SurveyElementAdornerBase.prototype.updateActionsPropertiesCore = function () {
459
505
  this.updateElementAllowOptions(this.creator.getElementAllowOperations(this.surveyElement), this.isOperationsAllow());
460
506
  };
461
507
  SurveyElementAdornerBase.prototype.getAllowDragging = function (options) {
@@ -484,12 +530,21 @@ var SurveyElementAdornerBase = /** @class */ (function (_super) {
484
530
  return !this.creator.readOnly;
485
531
  };
486
532
  SurveyElementAdornerBase.prototype.updateActionVisibility = function (id, isVisible) {
487
- var action = this.getActionById(id);
488
- if (!action)
489
- return;
490
- if (action.visible == isVisible)
491
- return;
492
- action.visible = isVisible;
533
+ var _a, _b;
534
+ 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));
535
+ if (!action) {
536
+ this.actionVisibilityCache[id] = isVisible;
537
+ }
538
+ else {
539
+ if (action.visible !== isVisible) {
540
+ action.visible = isVisible;
541
+ }
542
+ }
543
+ };
544
+ SurveyElementAdornerBase.prototype.updateActionsVisibility = function (isTop) {
545
+ for (var key in this.actionVisibilityCache) {
546
+ this.updateActionVisibility(key, this.actionVisibilityCache[key]);
547
+ }
493
548
  };
494
549
  SurveyElementAdornerBase.prototype.getActionById = function (id) {
495
550
  return this.actionContainer.getActionById(id) || this.topActionContainer.getActionById(id);
@@ -2146,7 +2201,7 @@ var PageAdorner = /** @class */ (function (_super) {
2146
2201
  }, null, type || _this.currentAddQuestionType || _creator_settings__WEBPACK_IMPORTED_MODULE_5__.settings.designer.defaultAddQuestionType);
2147
2202
  };
2148
2203
  _this.creatorPropertyChanged = function (sender, options) {
2149
- if (options.name === "isMobileView") {
2204
+ if (options.name === "isMobileView" && _this.isActionContainerCreated) {
2150
2205
  _this.actionContainer.alwaysShrink = options.newValue;
2151
2206
  }
2152
2207
  };
@@ -2162,7 +2217,6 @@ var PageAdorner = /** @class */ (function (_super) {
2162
2217
  _this.creator.survey.currentPage = _this.page;
2163
2218
  });
2164
2219
  _this.dragOrClickHelper = new survey_core__WEBPACK_IMPORTED_MODULE_1__.DragOrClickHelper(_this.startDragSurveyElement);
2165
- _this.actionContainer.alwaysShrink = _this.creator.isMobileView;
2166
2220
  _this.creator.onPropertyChanged.add(_this.creatorPropertyChanged);
2167
2221
  return _this;
2168
2222
  }
@@ -2297,8 +2351,21 @@ var PageAdorner = /** @class */ (function (_super) {
2297
2351
  });
2298
2352
  PageAdorner.prototype.createActionContainer = function () {
2299
2353
  var container = _super.prototype.createActionContainer.call(this);
2354
+ container.alwaysShrink = this.creator.isMobileView;
2300
2355
  container.sizeMode = "small";
2301
- container.cssClasses = {
2356
+ container.cssClasses = this.containerCssClasses();
2357
+ container.dotsItem.iconSize = "auto";
2358
+ container.dotsItem.cssClasses.itemIcon += " svc-page-toolbar-item__icon";
2359
+ return container;
2360
+ };
2361
+ PageAdorner.prototype.createTopActionContainer = function () {
2362
+ var container = _super.prototype.createTopActionContainer.call(this);
2363
+ container.cssClasses = (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__assign)({}, this.containerCssClasses());
2364
+ container.cssClasses.root += " svc-page-toolbar--collapse";
2365
+ return container;
2366
+ };
2367
+ PageAdorner.prototype.containerCssClasses = function () {
2368
+ return {
2302
2369
  root: "svc-page-toolbar sv-action-bar",
2303
2370
  item: "svc-page-toolbar__item",
2304
2371
  itemWithTitle: "svc-page-toolbar__item--with-text",
@@ -2308,14 +2375,6 @@ var PageAdorner = /** @class */ (function (_super) {
2308
2375
  itemTitle: "svc-page-toolbar-item__title",
2309
2376
  itemTitleWithIcon: "svc-page-toolbar-item__title--with-icon",
2310
2377
  };
2311
- container.dotsItem.iconSize = "auto";
2312
- container.dotsItem.cssClasses.itemIcon += " svc-page-toolbar-item__icon";
2313
- return container;
2314
- };
2315
- PageAdorner.prototype.createActionContainers = function () {
2316
- _super.prototype.createActionContainers.call(this);
2317
- this.topActionContainer.cssClasses = (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__assign)({}, this.actionContainer.cssClasses);
2318
- this.topActionContainer.cssClasses.root += " svc-page-toolbar--collapse";
2319
2378
  };
2320
2379
  PageAdorner.prototype.allowExpandCollapseByDblClick = function (element) {
2321
2380
  return element.classList.contains("svc-page__content") ||
@@ -3367,8 +3426,10 @@ var QuestionAdornerViewModel = /** @class */ (function (_super) {
3367
3426
  _super.prototype.attachElement.call(this, surveyElement);
3368
3427
  if (surveyElement) {
3369
3428
  surveyElement.registerFunctionOnPropertyValueChanged("isRequired", function (newValue) {
3370
- var requiredAction = _this.actionContainer.getActionById("isrequired");
3371
- _this.updateRequiredAction(requiredAction);
3429
+ if (_this.isActionContainerCreated) {
3430
+ var requiredAction = _this.actionContainer.getActionById("isrequired");
3431
+ _this.updateRequiredAction(requiredAction);
3432
+ }
3372
3433
  }, "isRequiredAdorner");
3373
3434
  }
3374
3435
  };
@@ -3395,8 +3456,8 @@ var QuestionAdornerViewModel = /** @class */ (function (_super) {
3395
3456
  }
3396
3457
  _super.prototype.hover.call(this, event, element);
3397
3458
  };
3398
- QuestionAdornerViewModel.prototype.createActionContainers = function () {
3399
- _super.prototype.createActionContainers.call(this);
3459
+ QuestionAdornerViewModel.prototype.createActionContainer = function () {
3460
+ var actionContainer = _super.prototype.createActionContainer.call(this);
3400
3461
  var defaultCssClasses = {
3401
3462
  root: "svc-survey-element-toolbar sv-action-bar",
3402
3463
  item: "svc-survey-element-toolbar__item",
@@ -3408,22 +3469,25 @@ var QuestionAdornerViewModel = /** @class */ (function (_super) {
3408
3469
  itemTitle: "svc-survey-element-toolbar-item__title",
3409
3470
  itemTitleWithIcon: "svc-survey-element-toolbar-item__title--with-icon",
3410
3471
  };
3411
- this.actionContainer.sizeMode = "small";
3412
- this.actionContainer.cssClasses = defaultCssClasses;
3413
- this.actionContainer.dotsItem.css += " svc-survey-element-toolbar__dots-item";
3414
- this.actionContainer.dotsItem.innerCss += " svc-survey-element-toolbar__item";
3472
+ actionContainer.sizeMode = "small";
3473
+ actionContainer.cssClasses = defaultCssClasses;
3474
+ actionContainer.dotsItem.css += " svc-survey-element-toolbar__dots-item";
3475
+ actionContainer.dotsItem.innerCss += " svc-survey-element-toolbar__item";
3476
+ return actionContainer;
3415
3477
  };
3416
- QuestionAdornerViewModel.prototype.getActionById = function (id) {
3417
- var res = _super.prototype.getActionById.call(this, id);
3418
- if (!res) {
3419
- res = this.topActionContainer.getActionById(id);
3478
+ QuestionAdornerViewModel.prototype.updateActionsPropertiesCore = function () {
3479
+ _super.prototype.updateActionsPropertiesCore.call(this);
3480
+ if (this.isActionContainerCreated) {
3481
+ this.updateActionsLocations();
3420
3482
  }
3421
- return res;
3422
3483
  };
3423
- QuestionAdornerViewModel.prototype.updateActionsProperties = function () {
3424
- if (this.isDisposed)
3425
- return;
3426
- _super.prototype.updateActionsProperties.call(this);
3484
+ QuestionAdornerViewModel.prototype.updateActionsVisibility = function (isTop) {
3485
+ _super.prototype.updateActionsVisibility.call(this, isTop);
3486
+ if (!isTop) {
3487
+ this.updateActionsLocations();
3488
+ }
3489
+ };
3490
+ QuestionAdornerViewModel.prototype.updateActionsLocations = function () {
3427
3491
  var actions = this.actionContainer.visibleActions;
3428
3492
  var switchToStartLocation = false;
3429
3493
  for (var i = actions.length - 1; i >= 0; i--) {
@@ -6166,10 +6230,10 @@ var TabDesignerPlugin = /** @class */ (function () {
6166
6230
  this.showOneCategoryInPropertyGrid = creator.showOneCategoryInPropertyGrid;
6167
6231
  this.propertyGrid.showOneCategoryInPropertyGrid = this.showOneCategoryInPropertyGrid;
6168
6232
  this.propertyGrid.obj = creator.survey;
6169
- this.propertyGrid.onSetNewObjectCallback = function () {
6233
+ this.propertyGridViewModel = new _property_grid_property_grid_view_model__WEBPACK_IMPORTED_MODULE_3__.PropertyGridViewModel(this.propertyGrid, creator);
6234
+ this.propertyGridViewModel.onNewSurveyCreatedCallback = function () {
6170
6235
  _this.updateTabControlActions();
6171
6236
  };
6172
- this.propertyGridViewModel = new _property_grid_property_grid_view_model__WEBPACK_IMPORTED_MODULE_3__.PropertyGridViewModel(this.propertyGrid, creator);
6173
6237
  this.propertyGridPlaceholderPage = this.creator.sidebar.addPage("propertyGridPlaceholder", "svc-property-grid-placeholder", this.propertyGridViewModel);
6174
6238
  this.propertyGridPlaceholderPage.caption = _editorLocalization__WEBPACK_IMPORTED_MODULE_9__.editorLocalization.getString("ed.surveySettings");
6175
6239
  this.propertyGridTab = this.creator.sidebar.addPage("propertyGrid", "svc-property-grid", this.propertyGridViewModel, function () {
@@ -6265,7 +6329,6 @@ var TabDesignerPlugin = /** @class */ (function () {
6265
6329
  };
6266
6330
  TabDesignerPlugin.prototype.updateTabControl = function () {
6267
6331
  if (this.showOneCategoryInPropertyGrid) {
6268
- this.updateTabControlActions();
6269
6332
  this.creator.sidebar.sideAreaComponentName = "svc-tab-control";
6270
6333
  this.creator.sidebar.sideAreaComponentData = this.tabControlModel;
6271
6334
  }
@@ -6344,11 +6407,6 @@ var TabDesignerPlugin = /** @class */ (function () {
6344
6407
  if (this.creator.showCreatorThemeSettings) {
6345
6408
  this.themeModel.loadTheme(this.creator.creatorTheme);
6346
6409
  this.themePropertyGrid.obj = this.themeModel;
6347
- this.themePropertyGrid.survey.onUpdatePanelCssClasses.add(function (_, options) {
6348
- options.cssClasses.panel.container += " spg-panel--group";
6349
- });
6350
- this.updateThemeChooserChoices();
6351
- this.updatePredefinedColorChoices();
6352
6410
  }
6353
6411
  };
6354
6412
  TabDesignerPlugin.prototype.setTheme = function () {
@@ -6356,21 +6414,16 @@ var TabDesignerPlugin = /** @class */ (function () {
6356
6414
  this.themeModel.setTheme(this.creator.creatorTheme);
6357
6415
  }
6358
6416
  };
6359
- TabDesignerPlugin.prototype.updateThemeChooserChoices = function () {
6360
- var themeChooser = this.themePropertyGrid.survey.getQuestionByName("themeName");
6361
- if (!!themeChooser) {
6362
- themeChooser.choices = _creator_theme_creator_themes__WEBPACK_IMPORTED_MODULE_12__.PredefinedCreatorThemes.map(function (theme) { return ({ value: theme, text: (0,_editorLocalization__WEBPACK_IMPORTED_MODULE_9__.getLocString)("creatortheme.names." + theme) }); });
6363
- }
6364
- this.themePropertyGrid.survey.runExpressions();
6365
- };
6366
6417
  TabDesignerPlugin.prototype.createCreatorThemeSettingsPage = function (creator) {
6367
6418
  var _this = this;
6368
6419
  this.themeModel = new _creator_theme_creator_theme_model__WEBPACK_IMPORTED_MODULE_11__.CreatorThemeModel();
6369
6420
  this.themePropertyGrid = new _property_grid__WEBPACK_IMPORTED_MODULE_2__.PropertyGridModel(undefined, creator, _creator_theme_creator_theme_model_definition__WEBPACK_IMPORTED_MODULE_10__.creatorThemeModelPropertyGridDefinition);
6370
- this.themePropertyGrid.survey.css.root += "svc-creator-theme-settings";
6371
6421
  this.themePropertyGrid.showOneCategoryInPropertyGrid = true;
6372
6422
  this.themePropertyGrid.surveyInstanceCreatedArea = "designer-tab:creator-settings";
6373
6423
  var themePropertyGridViewModel = new _property_grid_property_grid_view_model__WEBPACK_IMPORTED_MODULE_3__.PropertyGridViewModel(this.themePropertyGrid, creator);
6424
+ themePropertyGridViewModel.onNewSurveyCreatedCallback = function () {
6425
+ _this.onThemePropertyGridSurveyCreated();
6426
+ };
6374
6427
  themePropertyGridViewModel.searchEnabled = false;
6375
6428
  this.themePropertyGridTab = this.creator.sidebar.addPage("creatorTheme", "svc-property-grid", themePropertyGridViewModel);
6376
6429
  this.themePropertyGridTab.caption = _editorLocalization__WEBPACK_IMPORTED_MODULE_9__.editorLocalization.getString("ed.creatorSettingTitle");
@@ -6408,6 +6461,19 @@ var TabDesignerPlugin = /** @class */ (function () {
6408
6461
  });
6409
6462
  this.tabControlModel.bottomToolbar.setItems([settingsAction]);
6410
6463
  };
6464
+ TabDesignerPlugin.prototype.onThemePropertyGridSurveyCreated = function () {
6465
+ var survey = this.themePropertyGrid.survey;
6466
+ survey.css.root += " svc-creator-theme-settings";
6467
+ survey.onUpdatePanelCssClasses.add(function (_, options) {
6468
+ options.cssClasses.panel.container += " spg-panel--group";
6469
+ });
6470
+ var themeChooser = survey.getQuestionByName("themeName");
6471
+ if (!!themeChooser) {
6472
+ themeChooser.choices = _creator_theme_creator_themes__WEBPACK_IMPORTED_MODULE_12__.PredefinedCreatorThemes.map(function (theme) { return ({ value: theme, text: (0,_editorLocalization__WEBPACK_IMPORTED_MODULE_9__.getLocString)("creatortheme.names." + theme) }); });
6473
+ }
6474
+ survey.runExpressions();
6475
+ this.updatePredefinedColorChoices();
6476
+ };
6411
6477
  TabDesignerPlugin.prototype.updateTabControlActions = function () {
6412
6478
  var _this = this;
6413
6479
  var _a;
@@ -12390,6 +12456,11 @@ var PreviewViewModel = /** @class */ (function (_super) {
12390
12456
  this.updatePageList();
12391
12457
  this.show();
12392
12458
  };
12459
+ PreviewViewModel.prototype.isSurveyRunning = function () {
12460
+ var _a;
12461
+ var state = (_a = this.survey) === null || _a === void 0 ? void 0 : _a.state;
12462
+ return state === "running" || state === "starting";
12463
+ };
12393
12464
  PreviewViewModel.prototype.buildActions = function () {
12394
12465
  var _this = this;
12395
12466
  var pageActions = [];
@@ -12411,7 +12482,7 @@ var PreviewViewModel = /** @class */ (function (_super) {
12411
12482
  };
12412
12483
  if (this.prevPageAction) {
12413
12484
  this.prevPageAction.visible = new survey_core__WEBPACK_IMPORTED_MODULE_2__.ComputedUpdater(function () {
12414
- var isRunning = _this.survey.state === "running";
12485
+ var isRunning = _this.isSurveyRunning();
12415
12486
  var isActiveTab = _this.getTabName() === _this.surveyProvider.activeTab;
12416
12487
  return (0,_utils_utils__WEBPACK_IMPORTED_MODULE_4__.notShortCircuitAnd)(_this.isRunning, isActiveTab, _this.pageListItems.length > 1) && isRunning;
12417
12488
  });
@@ -12443,11 +12514,11 @@ var PreviewViewModel = /** @class */ (function (_super) {
12443
12514
  });
12444
12515
  pageActions.push(this.selectPageAction);
12445
12516
  this.selectPageAction.visible = new survey_core__WEBPACK_IMPORTED_MODULE_2__.ComputedUpdater(function () {
12446
- return _this.survey.state === "running";
12517
+ return _this.isSurveyRunning();
12447
12518
  });
12448
12519
  if (this.nextPageAction) {
12449
12520
  this.nextPageAction.visible = new survey_core__WEBPACK_IMPORTED_MODULE_2__.ComputedUpdater(function () {
12450
- var isRunning = _this.survey.state === "running";
12521
+ var isRunning = _this.isSurveyRunning();
12451
12522
  var isActiveTab = _this.getTabName() === _this.surveyProvider.activeTab;
12452
12523
  return (0,_utils_utils__WEBPACK_IMPORTED_MODULE_4__.notShortCircuitAnd)(_this.isRunning, isActiveTab, _this.pageListItems.length > 1) && isRunning;
12453
12524
  });
@@ -20789,6 +20860,9 @@ var SurveyCreatorModel = /** @class */ (function (_super) {
20789
20860
  */
20790
20861
  SurveyCreatorModel.prototype.initSurveyWithJSON = function (json, clearState) {
20791
20862
  var _this = this;
20863
+ if (!json) {
20864
+ json = { "headerView": "advanced" };
20865
+ }
20792
20866
  this.existingPages = {};
20793
20867
  var survey = this.createSurvey({}, "designer", undefined, function (survey) {
20794
20868
  survey.skeletonHeight = 188;
@@ -37397,8 +37471,10 @@ var PropertyGridModel = /** @class */ (function () {
37397
37471
  }
37398
37472
  };
37399
37473
  PropertyGridModel.prototype.setObj = function (value) {
37400
- var _this = this;
37401
37474
  this.objValue = value;
37475
+ if (this.onSetNewObjectCallback) {
37476
+ this.onSetNewObjectCallback();
37477
+ }
37402
37478
  this.classNameProperty = !!this.obj
37403
37479
  ? PropertyJSONGenerator.getClassNameProperty(this.obj)
37404
37480
  : "";
@@ -37408,24 +37484,34 @@ var PropertyGridModel = /** @class */ (function () {
37408
37484
  this.titleActionsCreator = !!this.obj
37409
37485
  ? new PropertyGridTitleActionsCreator(this.obj, this.options)
37410
37486
  : undefined;
37487
+ if (!this.surveyValue)
37488
+ return;
37489
+ this.clearSurveyValue();
37490
+ this.createSurveyValue();
37491
+ };
37492
+ PropertyGridModel.prototype.clearSurveyValue = function () {
37493
+ this.surveyValue.onValidateQuestion.clear();
37494
+ this.surveyValue.onValueChanging.clear();
37495
+ this.surveyValue.onValueChanged.clear();
37496
+ this.surveyValue.onMatrixCellValueChanging.clear();
37497
+ this.surveyValue.onMatrixCellValidate.clear();
37498
+ this.surveyValue.onMatrixCellValueChanged.clear();
37499
+ this.surveyValue.editingObj = undefined;
37500
+ this.surveyValue.data = {};
37501
+ this.surveyValue.dispose();
37502
+ };
37503
+ PropertyGridModel.prototype.createSurveyValue = function () {
37504
+ var _this = this;
37411
37505
  var json = this.getSurveyJSON();
37412
37506
  if (this.options.readOnly) {
37413
37507
  json.mode = "display";
37414
37508
  }
37415
- if (!!this.surveyValue) {
37416
- this.surveyValue.onValidateQuestion.clear();
37417
- this.surveyValue.onValueChanging.clear();
37418
- this.surveyValue.onValueChanged.clear();
37419
- this.surveyValue.onMatrixCellValueChanging.clear();
37420
- this.surveyValue.onMatrixCellValidate.clear();
37421
- this.surveyValue.onMatrixCellValueChanged.clear();
37422
- this.surveyValue.editingObj = undefined;
37423
- this.surveyValue.data = {};
37424
- this.surveyValue.dispose();
37425
- }
37426
37509
  this.surveyValue = this.createSurvey(json, function (survey) {
37427
37510
  _this.onCreateSurvey(survey);
37428
37511
  });
37512
+ if (this.onNewSurveyCreatedCallback) {
37513
+ this.onNewSurveyCreatedCallback();
37514
+ }
37429
37515
  if (!this.obj)
37430
37516
  return;
37431
37517
  this.survey.onValueChanged.add(function (sender, options) {
@@ -37492,9 +37578,6 @@ var PropertyGridModel = /** @class */ (function () {
37492
37578
  }
37493
37579
  });
37494
37580
  this.survey.editingObj = this.obj;
37495
- if (this.objValueChangedCallback) {
37496
- this.objValueChangedCallback();
37497
- }
37498
37581
  this.updateDependedPropertiesEditors();
37499
37582
  if (this.showOneCategoryInPropertyGrid) {
37500
37583
  this.survey.onCurrentPageChanged.add(function (sender, options) {
@@ -37608,6 +37691,9 @@ var PropertyGridModel = /** @class */ (function () {
37608
37691
  });
37609
37692
  Object.defineProperty(PropertyGridModel.prototype, "survey", {
37610
37693
  get: function () {
37694
+ if (!this.surveyValue) {
37695
+ this.createSurveyValue();
37696
+ }
37611
37697
  return this.surveyValue;
37612
37698
  },
37613
37699
  enumerable: false,
@@ -37653,6 +37739,8 @@ var PropertyGridModel = /** @class */ (function () {
37653
37739
  });
37654
37740
  };
37655
37741
  PropertyGridModel.prototype.expandCategoryIfNeeded = function () {
37742
+ if (!this.surveyValue)
37743
+ return;
37656
37744
  var expandedTabName = _creator_settings__WEBPACK_IMPORTED_MODULE_6__.settings.propertyGrid.defaultExpandedTabName;
37657
37745
  if (!!expandedTabName && !this.getPropertyGridExpandedCategory()) {
37658
37746
  var panel = this.survey.getPanelByName(expandedTabName);
@@ -37747,9 +37835,6 @@ var PropertyGridModel = /** @class */ (function () {
37747
37835
  options.name === this.classNameProperty &&
37748
37836
  this.classNameValue !== options.value) {
37749
37837
  this.setObj(this.obj);
37750
- if (this.onSetNewObjectCallback) {
37751
- this.onSetNewObjectCallback();
37752
- }
37753
37838
  if (!!this.survey) {
37754
37839
  var question = this.survey.getQuestionByName(options.name);
37755
37840
  if (!!question) {
@@ -39983,8 +40068,11 @@ var PropertyGridViewModel = /** @class */ (function (_super) {
39983
40068
  _this.searchManager = new _search_manager__WEBPACK_IMPORTED_MODULE_6__.SearchManagerPropertyGrid();
39984
40069
  _this.searchEnabled = _creator_settings__WEBPACK_IMPORTED_MODULE_4__.settings.propertyGrid.enableSearch;
39985
40070
  _this.selectedElementName = _this.getTitle();
39986
- _this.propertyGridModel.objValueChangedCallback = function () {
39987
- _this.onSurveyChanged();
40071
+ _this.propertyGridModel.onSetNewObjectCallback = function () {
40072
+ _this.onSurveyObjChanged();
40073
+ };
40074
+ _this.propertyGridModel.onNewSurveyCreatedCallback = function () {
40075
+ _this.onNewSurveyCreated();
39988
40076
  };
39989
40077
  _this.propertyGridModel.changedFromActionCallback = function (obj, propertyName) {
39990
40078
  if (!!_this.selectionController) {
@@ -39997,9 +40085,20 @@ var PropertyGridViewModel = /** @class */ (function (_super) {
39997
40085
  _this.selectorPopupModel.horizontalPosition = _this.creator.sidebarLocation == "right" ? "left" : "right";
39998
40086
  }
39999
40087
  });
40000
- _this.onSurveyChanged();
40088
+ _this.onSurveyObjChanged();
40001
40089
  return _this;
40002
40090
  }
40091
+ Object.defineProperty(PropertyGridViewModel.prototype, "survey", {
40092
+ get: function () {
40093
+ var _this = this;
40094
+ return this.getPropertyValue("survey", undefined, function () { return _this.propertyGridModel.survey; });
40095
+ },
40096
+ set: function (val) {
40097
+ this.setPropertyValue("survey", val);
40098
+ },
40099
+ enumerable: false,
40100
+ configurable: true
40101
+ });
40003
40102
  Object.defineProperty(PropertyGridViewModel.prototype, "rootCss", {
40004
40103
  get: function () {
40005
40104
  return new survey_core__WEBPACK_IMPORTED_MODULE_1__.CssClassBuilder()
@@ -40026,7 +40125,14 @@ var PropertyGridViewModel = /** @class */ (function (_super) {
40026
40125
  enumerable: false,
40027
40126
  configurable: true
40028
40127
  });
40029
- PropertyGridViewModel.prototype.onSurveyChanged = function () {
40128
+ PropertyGridViewModel.prototype.onSurveyObjChanged = function () {
40129
+ this.updateTitle();
40130
+ if (this.selectionController) {
40131
+ this.hasPrev = this.selectionController.hasPrev;
40132
+ this.hasNext = this.selectionController.hasNext;
40133
+ }
40134
+ };
40135
+ PropertyGridViewModel.prototype.onNewSurveyCreated = function () {
40030
40136
  var _this = this;
40031
40137
  this.survey = this.propertyGridModel.survey;
40032
40138
  this.searchManager.setSurvey(this.survey);
@@ -40037,10 +40143,8 @@ var PropertyGridViewModel = /** @class */ (function (_super) {
40037
40143
  }
40038
40144
  });
40039
40145
  }
40040
- this.updateTitle();
40041
- if (this.selectionController) {
40042
- this.hasPrev = this.selectionController.hasPrev;
40043
- this.hasNext = this.selectionController.hasNext;
40146
+ if (this.onNewSurveyCreatedCallback) {
40147
+ this.onNewSurveyCreatedCallback();
40044
40148
  }
40045
40149
  };
40046
40150
  PropertyGridViewModel.prototype.updateTitle = function () {
@@ -40141,9 +40245,6 @@ var PropertyGridViewModel = /** @class */ (function (_super) {
40141
40245
  (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
40142
40246
  (0,survey_core__WEBPACK_IMPORTED_MODULE_1__.property)()
40143
40247
  ], PropertyGridViewModel.prototype, "hasNext", void 0);
40144
- (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
40145
- (0,survey_core__WEBPACK_IMPORTED_MODULE_1__.property)()
40146
- ], PropertyGridViewModel.prototype, "survey", void 0);
40147
40248
  (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
40148
40249
  (0,survey_core__WEBPACK_IMPORTED_MODULE_1__.property)()
40149
40250
  ], PropertyGridViewModel.prototype, "selectedElementName", void 0);
@@ -47026,7 +47127,7 @@ __webpack_require__.r(__webpack_exports__);
47026
47127
  /* harmony import */ var survey_core__WEBPACK_IMPORTED_MODULE_100__ = __webpack_require__(/*! survey-core */ "survey-core");
47027
47128
  /* harmony import */ var survey_core__WEBPACK_IMPORTED_MODULE_100___default = /*#__PURE__*/__webpack_require__.n(survey_core__WEBPACK_IMPORTED_MODULE_100__);
47028
47129
  var Version;
47029
- Version = "".concat("2.0.0-rc.6");
47130
+ Version = "".concat("2.0.0-rc.7");
47030
47131
  //should be loaded before other styles for easier override
47031
47132
  __webpack_require__(/*! ../utils/context-button.scss */ "./src/utils/context-button.scss");
47032
47133
 
@@ -47150,7 +47251,7 @@ __webpack_require__(/*! ../property-grid-theme/property-grid.scss */ "./src/prop
47150
47251
  __webpack_require__(/*! ../utils/layout.scss */ "./src/utils/layout.scss");
47151
47252
  __webpack_require__(/*! ../custom-questions/boolean-switch.scss */ "./src/custom-questions/boolean-switch.scss");
47152
47253
 
47153
- (0,survey_core__WEBPACK_IMPORTED_MODULE_100__.checkLibraryVersion)("".concat("2.0.0-rc.6"), "survey-creator-core");
47254
+ (0,survey_core__WEBPACK_IMPORTED_MODULE_100__.checkLibraryVersion)("".concat("2.0.0-rc.7"), "survey-creator-core");
47154
47255
 
47155
47256
  })();
47156
47257