survey-creator-core 2.0.6 → 2.0.8

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 (143) hide show
  1. package/fesm/i18n/arabic.mjs +1 -1
  2. package/fesm/i18n/bulgarian.mjs +1 -1
  3. package/fesm/i18n/burmese.mjs +1 -1
  4. package/fesm/i18n/croatian.mjs +1 -1
  5. package/fesm/i18n/czech.mjs +1 -1
  6. package/fesm/i18n/danish.mjs +1 -1
  7. package/fesm/i18n/dutch.mjs +1 -1
  8. package/fesm/i18n/english.mjs +1 -1
  9. package/fesm/i18n/finnish.mjs +1 -1
  10. package/fesm/i18n/french.mjs +1 -1
  11. package/fesm/i18n/german.mjs +1 -1
  12. package/fesm/i18n/haitian-creole.mjs +1 -1
  13. package/fesm/i18n/hebrew.mjs +1 -1
  14. package/fesm/i18n/hungarian.mjs +1 -1
  15. package/fesm/i18n/index.mjs +1 -1
  16. package/fesm/i18n/indonesian.mjs +1 -1
  17. package/fesm/i18n/italian.mjs +1 -1
  18. package/fesm/i18n/japanese.mjs +1 -1
  19. package/fesm/i18n/korean.mjs +1 -1
  20. package/fesm/i18n/malay.mjs +1 -1
  21. package/fesm/i18n/mongolian.mjs +1 -1
  22. package/fesm/i18n/norwegian.mjs +1 -1
  23. package/fesm/i18n/persian.mjs +1 -1
  24. package/fesm/i18n/polish.mjs +1 -1
  25. package/fesm/i18n/portuguese.mjs +1 -1
  26. package/fesm/i18n/romanian.mjs +1 -1
  27. package/fesm/i18n/russian.mjs +1 -1
  28. package/fesm/i18n/simplified-chinese.mjs +1 -1
  29. package/fesm/i18n/slovak.mjs +1 -1
  30. package/fesm/i18n/slovenian.mjs +1 -1
  31. package/fesm/i18n/spanish.mjs +1 -1
  32. package/fesm/i18n/swedish.mjs +1 -1
  33. package/fesm/i18n/tajik.mjs +1 -1
  34. package/fesm/i18n/thai.mjs +1 -1
  35. package/fesm/i18n/traditional-chinese.mjs +1 -1
  36. package/fesm/i18n/turkish.mjs +1 -1
  37. package/fesm/survey-creator-core.i18n.mjs +1 -1
  38. package/fesm/survey-creator-core.mjs +201 -116
  39. package/fesm/survey-creator-core.mjs.map +1 -1
  40. package/fesm/themes/index.mjs +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/haitian-creole.js +1 -1
  66. package/i18n/haitian-creole.min.js.LICENSE.txt +1 -1
  67. package/i18n/hebrew.js +1 -1
  68. package/i18n/hebrew.min.js.LICENSE.txt +1 -1
  69. package/i18n/hungarian.js +1 -1
  70. package/i18n/hungarian.min.js.LICENSE.txt +1 -1
  71. package/i18n/index.js +1 -1
  72. package/i18n/index.min.js.LICENSE.txt +1 -1
  73. package/i18n/indonesian.js +1 -1
  74. package/i18n/indonesian.min.js.LICENSE.txt +1 -1
  75. package/i18n/italian.js +1 -1
  76. package/i18n/italian.min.js.LICENSE.txt +1 -1
  77. package/i18n/japanese.js +1 -1
  78. package/i18n/japanese.min.js.LICENSE.txt +1 -1
  79. package/i18n/korean.js +1 -1
  80. package/i18n/korean.min.js.LICENSE.txt +1 -1
  81. package/i18n/malay.js +1 -1
  82. package/i18n/malay.min.js.LICENSE.txt +1 -1
  83. package/i18n/mongolian.js +1 -1
  84. package/i18n/mongolian.min.js.LICENSE.txt +1 -1
  85. package/i18n/norwegian.js +1 -1
  86. package/i18n/norwegian.min.js.LICENSE.txt +1 -1
  87. package/i18n/persian.js +1 -1
  88. package/i18n/persian.min.js.LICENSE.txt +1 -1
  89. package/i18n/polish.js +1 -1
  90. package/i18n/polish.min.js.LICENSE.txt +1 -1
  91. package/i18n/portuguese.js +1 -1
  92. package/i18n/portuguese.min.js.LICENSE.txt +1 -1
  93. package/i18n/romanian.js +1 -1
  94. package/i18n/romanian.min.js.LICENSE.txt +1 -1
  95. package/i18n/russian.js +1 -1
  96. package/i18n/russian.min.js.LICENSE.txt +1 -1
  97. package/i18n/simplified-chinese.js +1 -1
  98. package/i18n/simplified-chinese.min.js.LICENSE.txt +1 -1
  99. package/i18n/slovak.js +1 -1
  100. package/i18n/slovak.min.js.LICENSE.txt +1 -1
  101. package/i18n/slovenian.js +1 -1
  102. package/i18n/slovenian.min.js.LICENSE.txt +1 -1
  103. package/i18n/spanish.js +1 -1
  104. package/i18n/spanish.min.js.LICENSE.txt +1 -1
  105. package/i18n/swedish.js +1 -1
  106. package/i18n/swedish.min.js.LICENSE.txt +1 -1
  107. package/i18n/tajik.js +1 -1
  108. package/i18n/tajik.min.js.LICENSE.txt +1 -1
  109. package/i18n/thai.js +1 -1
  110. package/i18n/thai.min.js.LICENSE.txt +1 -1
  111. package/i18n/traditional-chinese.js +1 -1
  112. package/i18n/traditional-chinese.min.js.LICENSE.txt +1 -1
  113. package/i18n/turkish.js +1 -1
  114. package/i18n/turkish.min.js.LICENSE.txt +1 -1
  115. package/package.json +2 -2
  116. package/survey-creator-core.css +61 -23
  117. package/survey-creator-core.fontless.css +60 -22
  118. package/survey-creator-core.fontless.css.map +1 -1
  119. package/survey-creator-core.fontless.min.css +6 -6
  120. package/survey-creator-core.i18n.js +1 -1
  121. package/survey-creator-core.i18n.min.js.LICENSE.txt +1 -1
  122. package/survey-creator-core.js +249 -125
  123. package/survey-creator-core.js.map +1 -1
  124. package/survey-creator-core.min.css +7 -7
  125. package/survey-creator-core.min.js +1 -1
  126. package/survey-creator-core.min.js.LICENSE.txt +1 -1
  127. package/themes/default-contrast.js +1 -1
  128. package/themes/default-contrast.min.js.LICENSE.txt +1 -1
  129. package/themes/default-dark.js +1 -1
  130. package/themes/default-dark.min.js.LICENSE.txt +1 -1
  131. package/themes/index.js +1 -1
  132. package/themes/index.min.js.LICENSE.txt +1 -1
  133. package/themes/sc2020.js +1 -1
  134. package/themes/sc2020.min.js.LICENSE.txt +1 -1
  135. package/typings/components/action-container-view-model.d.ts +11 -1
  136. package/typings/components/image-item-value.d.ts +7 -0
  137. package/typings/creator-base.d.ts +14 -14
  138. package/typings/creator-options.d.ts +4 -12
  139. package/typings/custom-questions/question-file.d.ts +2 -0
  140. package/typings/property-grid/condition.d.ts +3 -0
  141. package/typings/property-grid/matrices.d.ts +0 -1
  142. package/typings/property-grid/object-selector.d.ts +0 -1
  143. package/typings/property-grid-theme/property-grid.d.ts +13 -0
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * SurveyJS Creator v2.0.6
2
+ * SurveyJS Creator v2.0.8
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.6
2
+ * SurveyJS Creator v2.0.8
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.6
2
+ * SurveyJS Creator v2.0.8
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
@@ -54,11 +54,24 @@ __webpack_require__.r(__webpack_exports__);
54
54
 
55
55
 
56
56
 
57
+ var SurveyElementResponsivityManager = /** @class */ (function (_super) {
58
+ (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(SurveyElementResponsivityManager, _super);
59
+ function SurveyElementResponsivityManager(container, model, onGetAllowResponsivenessCallback) {
60
+ var _this = _super.call(this, container, model) || this;
61
+ _this.onGetAllowResponsivenessCallback = onGetAllowResponsivenessCallback;
62
+ return _this;
63
+ }
64
+ SurveyElementResponsivityManager.prototype.shouldProcessResponsiveness = function () {
65
+ return _super.prototype.shouldProcessResponsiveness.call(this) && (!this.onGetAllowResponsivenessCallback || this.onGetAllowResponsivenessCallback());
66
+ };
67
+ return SurveyElementResponsivityManager;
68
+ }(survey_core__WEBPACK_IMPORTED_MODULE_1__.ResponsivityManager));
57
69
  var SurveyElementActionContainer = /** @class */ (function (_super) {
58
70
  (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(SurveyElementActionContainer, _super);
59
71
  function SurveyElementActionContainer() {
60
72
  var _this = _super.call(this) || this;
61
73
  _this.alwaysShrink = false;
74
+ _this.isResponsivenessAllowed = false;
62
75
  _this.dotsItem.iconSize = "auto";
63
76
  _this.dotsItem.popupModel.cssClass += " svc-creator-popup";
64
77
  _this.hiddenItemsListModel.cssClasses = _list_theme__WEBPACK_IMPORTED_MODULE_2__.listComponentCss;
@@ -136,6 +149,16 @@ var SurveyElementActionContainer = /** @class */ (function (_super) {
136
149
  }
137
150
  this.hiddenItemsListModel.setItems(items.filter(function (i) { return i.mode == "popup"; }).map(function (i) { return i.innerItem; }));
138
151
  };
152
+ SurveyElementActionContainer.prototype.allowResponsiveness = function () {
153
+ if (!this.isResponsivenessAllowed) {
154
+ this.isResponsivenessAllowed = true;
155
+ this.updateCallback && this.updateCallback(true);
156
+ }
157
+ };
158
+ SurveyElementActionContainer.prototype.createResponsivityManager = function (container) {
159
+ var _this = this;
160
+ return new SurveyElementResponsivityManager(container, this, function () { return _this.isResponsivenessAllowed; });
161
+ };
139
162
  return SurveyElementActionContainer;
140
163
  }(survey_core__WEBPACK_IMPORTED_MODULE_1__.AdaptiveActionContainer));
141
164
 
@@ -350,6 +373,8 @@ __webpack_require__.r(__webpack_exports__);
350
373
  /* harmony import */ var _item_value__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./item-value */ "./src/components/item-value.ts");
351
374
  /* harmony import */ var _utils_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/utils */ "./src/utils/utils.ts");
352
375
  /* harmony import */ var _image_item_value_scss__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./image-item-value.scss */ "./src/components/image-item-value.scss");
376
+ /* harmony import */ var _editorLocalization__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../editorLocalization */ "./src/editorLocalization.ts");
377
+
353
378
 
354
379
 
355
380
 
@@ -364,25 +389,40 @@ var ImageItemValueWrapperViewModel = /** @class */ (function (_super) {
364
389
  _this.templateData = templateData;
365
390
  _this.itemsRoot = itemsRoot;
366
391
  _this.isChoosingNewFile = false;
392
+ _this.onDragCounter = 0;
393
+ _this.onDragEnter = function (event) {
394
+ if (_this.isNew) {
395
+ _this.onDragCounter++;
396
+ _this.isFileDragging = true;
397
+ }
398
+ };
367
399
  _this.onDragOver = function (event) {
368
- _this.isFileDragging = true;
369
- event.dataTransfer.dropEffect = "copy";
370
- event.preventDefault();
400
+ if (_this.isNew) {
401
+ event.dataTransfer.dropEffect = "copy";
402
+ event.preventDefault();
403
+ }
371
404
  };
372
405
  _this.onDrop = function (event) {
373
- _this.isFileDragging = false;
374
- event.preventDefault();
375
- var input = event.dataTransfer;
376
- if (!input || !input.files || input.files.length < 1)
377
- return;
378
- var files = [];
379
- for (var i = 0; i < input.files.length; i++) {
380
- files.push(input.files[i]);
406
+ if (_this.isNew) {
407
+ _this.onDragCounter = 0;
408
+ _this.isFileDragging = false;
409
+ event.preventDefault();
410
+ var input = event.dataTransfer;
411
+ if (!input || !input.files || input.files.length < 1)
412
+ return;
413
+ var files = [];
414
+ for (var i = 0; i < input.files.length; i++) {
415
+ files.push(input.files[i]);
416
+ }
417
+ _this.uploadFiles(files);
381
418
  }
382
- _this.uploadFiles(files);
383
419
  };
384
420
  _this.onDragLeave = function (event) {
385
- _this.isFileDragging = false;
421
+ if (_this.isNew) {
422
+ if (--_this.onDragCounter == 0) {
423
+ _this.isFileDragging = false;
424
+ }
425
+ }
386
426
  };
387
427
  return _this;
388
428
  }
@@ -426,6 +466,47 @@ var ImageItemValueWrapperViewModel = /** @class */ (function (_super) {
426
466
  enumerable: false,
427
467
  configurable: true
428
468
  });
469
+ Object.defineProperty(ImageItemValueWrapperViewModel.prototype, "placeholderText", {
470
+ get: function () {
471
+ if (this.creator.isMobileView)
472
+ return (0,_editorLocalization__WEBPACK_IMPORTED_MODULE_5__.getLocString)("ed.imagePlaceHolderMobile");
473
+ return (0,_editorLocalization__WEBPACK_IMPORTED_MODULE_5__.getLocString)("ed.imagePlaceHolder");
474
+ },
475
+ enumerable: false,
476
+ configurable: true
477
+ });
478
+ Object.defineProperty(ImageItemValueWrapperViewModel.prototype, "chooseImageText", {
479
+ get: function () {
480
+ return (0,_editorLocalization__WEBPACK_IMPORTED_MODULE_5__.getLocString)("ed.imageChooseImage");
481
+ },
482
+ enumerable: false,
483
+ configurable: true
484
+ });
485
+ Object.defineProperty(ImageItemValueWrapperViewModel.prototype, "showChooseButtonAsIcon", {
486
+ get: function () {
487
+ return !this.getIsNewItemSingle();
488
+ },
489
+ enumerable: false,
490
+ configurable: true
491
+ });
492
+ Object.defineProperty(ImageItemValueWrapperViewModel.prototype, "showPlaceholder", {
493
+ get: function () {
494
+ return this.getIsNewItemSingle();
495
+ },
496
+ enumerable: false,
497
+ configurable: true
498
+ });
499
+ Object.defineProperty(ImageItemValueWrapperViewModel.prototype, "addButtonCss", {
500
+ get: function () {
501
+ return new survey_core__WEBPACK_IMPORTED_MODULE_1__.CssClassBuilder()
502
+ .append("svc-image-item-value-controls__add")
503
+ .append("svc-context-button", this.showChooseButtonAsIcon)
504
+ .append("sd-action", !this.showChooseButtonAsIcon)
505
+ .toString();
506
+ },
507
+ enumerable: false,
508
+ configurable: true
509
+ });
429
510
  ImageItemValueWrapperViewModel.prototype.chooseFile = function (model) {
430
511
  var fileInput = model.itemsRoot.getElementsByClassName("svc-choose-file-input")[0];
431
512
  var context = { element: model.question, item: model.item, elementType: model.question.getType(), propertyName: "imageLink" };
@@ -5490,6 +5571,29 @@ __webpack_require__.r(__webpack_exports__);
5490
5571
 
5491
5572
 
5492
5573
 
5574
+ function debounce(func, delay) {
5575
+ var timeout;
5576
+ return function () {
5577
+ var _this = this;
5578
+ var args = [];
5579
+ for (var _i = 0; _i < arguments.length; _i++) {
5580
+ args[_i] = arguments[_i];
5581
+ }
5582
+ clearTimeout(timeout);
5583
+ timeout = setTimeout(function () {
5584
+ func.apply(_this, args);
5585
+ }, delay);
5586
+ };
5587
+ }
5588
+ var updateRowsVisibility = debounce(function (target) {
5589
+ if (target.creator.rootElement.getAnimations({ subtree: true }).filter((function (animation) { return animation.effect.getComputedTiming().activeDuration !== Infinity && (animation.pending || animation.playState !== "finished"); }))[0]) {
5590
+ updateRowsVisibility(target);
5591
+ }
5592
+ else {
5593
+ target.creator.survey.pages.forEach(function (p) { return p.ensureRowsVisibility(); });
5594
+ target.creator.survey.getAllPanels().forEach(function (p) { return p.ensureRowsVisibility(); });
5595
+ }
5596
+ }, 50);
5493
5597
  var SurveyElementAdornerBase = /** @class */ (function (_super) {
5494
5598
  (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(SurveyElementAdornerBase, _super);
5495
5599
  function SurveyElementAdornerBase(creator, surveyElement) {
@@ -5551,6 +5655,7 @@ var SurveyElementAdornerBase = /** @class */ (function (_super) {
5551
5655
  this.hoverTimeout = undefined;
5552
5656
  this.isHovered = false;
5553
5657
  }
5658
+ this.actionContainer.allowResponsiveness();
5554
5659
  };
5555
5660
  SurveyElementAdornerBase.prototype.getExpandCollapseAnimationOptions = function () {
5556
5661
  var _this = this;
@@ -5752,6 +5857,9 @@ var SurveyElementAdornerBase = /** @class */ (function (_super) {
5752
5857
  _this.onElementSelectedChanged(newValue);
5753
5858
  }, "questionSelected");
5754
5859
  this.restoreState();
5860
+ if (surveyElement.getPropertyValue("isSelectedInDesigner")) {
5861
+ this.actionContainer.allowResponsiveness();
5862
+ }
5755
5863
  this.updateActionsContainer(surveyElement);
5756
5864
  this.updateActionsProperties();
5757
5865
  surveyElement.setPropertyValue(SurveyElementAdornerBase.AdornerValueName, this);
@@ -5806,6 +5914,7 @@ var SurveyElementAdornerBase = /** @class */ (function (_super) {
5806
5914
  if (!isSelected)
5807
5915
  return;
5808
5916
  this.updateActionsProperties();
5917
+ this.actionContainer.allowResponsiveness();
5809
5918
  };
5810
5919
  SurveyElementAdornerBase.prototype.getExpandCollapseAction = function () {
5811
5920
  var _this = this;
@@ -5987,17 +6096,16 @@ var SurveyElementAdornerBase = /** @class */ (function (_super) {
5987
6096
  ], SurveyElementAdornerBase.prototype, "allowExpandCollapse", void 0);
5988
6097
  (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
5989
6098
  (0,survey_core__WEBPACK_IMPORTED_MODULE_1__.property)({
5990
- onSet: function (val, target) {
6099
+ onSet: function (val, target, prevVal) {
5991
6100
  target.renderedCollapsed = val;
5992
6101
  if (!val)
5993
6102
  target.needToRenderContent = true;
5994
6103
  if (target.creator.designerStateManager && target.surveyElement) {
5995
6104
  target.creator.designerStateManager.setElementCollapsed(target.surveyElement, val);
5996
6105
  }
5997
- setTimeout(function () {
5998
- target.creator.survey.pages.forEach(function (p) { return p.ensureRowsVisibility(); });
5999
- target.creator.survey.getAllPanels().forEach(function (p) { return p.ensureRowsVisibility(); });
6000
- }, 50);
6106
+ if (!!val !== !!prevVal) {
6107
+ updateRowsVisibility(target);
6108
+ }
6001
6109
  }
6002
6110
  })
6003
6111
  ], SurveyElementAdornerBase.prototype, "collapsed", void 0);
@@ -18221,6 +18329,7 @@ var TranslationEditor = /** @class */ (function () {
18221
18329
  TranslationEditor.prototype.setupNavigationButtons = function (survey) {
18222
18330
  var _this = this;
18223
18331
  var navigationBar = new _action_container_view_model__WEBPACK_IMPORTED_MODULE_11__.SurveyElementActionContainer();
18332
+ navigationBar.allowResponsiveness();
18224
18333
  survey["navigationBarValue"] = navigationBar;
18225
18334
  survey.findLayoutElement("buttons-navigation").data = navigationBar;
18226
18335
  navigationBar.locOwner = survey;
@@ -19311,12 +19420,7 @@ var SurveyCreatorModel = /** @class */ (function (_super) {
19311
19420
  _this.showPagesInTestSurveyTab = true;
19312
19421
  _this.showSimulatorInTestSurveyTab = true;
19313
19422
  /**
19314
- * A [UI theme](https://surveyjs.io/Documentation/Library?id=get-started-react#configure-styles) used to display the survey in the Preview tab.
19315
- *
19316
- * Accepted values: `"default"`
19317
- *
19318
- * Default value: `"default"`
19319
- * @see previewAllowSelectTheme
19423
+ * @deprecated Survey Creator no longer supports switching between UI themes in the Preview tab.
19320
19424
  */
19321
19425
  _this.previewTheme = "default";
19322
19426
  _this.hasPendingThemeChanges = false;
@@ -19326,12 +19430,7 @@ var SurveyCreatorModel = /** @class */ (function (_super) {
19326
19430
  _this.showDefaultLanguageInTestSurveyTab = "auto";
19327
19431
  _this.showInvisibleElementsInTestSurveyTab = true;
19328
19432
  /**
19329
- * Specifies whether users can switch between UI themes in the Preview tab.
19330
- *
19331
- * Default value: `true`
19332
- *
19333
- * [View Demo](https://surveyjs.io/Examples/Creator?id=theme-switcher (linkStyle))
19334
- * @see previewTheme
19433
+ * @deprecated Survey Creator no longer supports switching between UI themes in the Preview tab.
19335
19434
  */
19336
19435
  _this.previewAllowSelectTheme = true;
19337
19436
  _this._tabResponsivenessMode = "icons";
@@ -19956,7 +20055,7 @@ var SurveyCreatorModel = /** @class */ (function (_super) {
19956
20055
  });
19957
20056
  Object.defineProperty(SurveyCreatorModel.prototype, "themeForPreview", {
19958
20057
  /**
19959
- * @deprecated Use the [`previewTheme`](https://surveyjs.io/survey-creator/documentation/api-reference/survey-creator#previewTheme) property instead.
20058
+ * @deprecated Survey Creator no longer supports switching between UI themes in the Preview tab.
19960
20059
  */
19961
20060
  get: function () { return this.previewTheme; },
19962
20061
  set: function (val) { this.previewTheme = val; },
@@ -20007,18 +20106,30 @@ var SurveyCreatorModel = /** @class */ (function (_super) {
20007
20106
  return this._theme;
20008
20107
  },
20009
20108
  set: function (newTheme) {
20010
- this._theme = newTheme;
20011
- this.hasPendingThemeChanges = true;
20012
- if (this.activeTab !== "theme") {
20013
- this.updatePlugin(this.activeTab);
20014
- }
20015
- if (!!newTheme && newTheme.headerView) {
20016
- this.survey.headerView = newTheme.headerView;
20017
- }
20109
+ this.applyTheme(newTheme);
20018
20110
  },
20019
20111
  enumerable: false,
20020
20112
  configurable: true
20021
20113
  });
20114
+ /**
20115
+ * Applies a [theme](https://surveyjs.io/form-library/documentation/api-reference/itheme) to the survey being configured.
20116
+ *
20117
+ * [Theme Editor](https://surveyjs.io/survey-creator/documentation/theme-editor (linkStyle))
20118
+ * @param surveyTheme An [`ITheme`](https://surveyjs.io/form-library/documentation/api-reference/itheme) object with theme settings.
20119
+ * @see theme
20120
+ * @see themeEditor
20121
+ * @see saveThemeFunc
20122
+ */
20123
+ SurveyCreatorModel.prototype.applyTheme = function (surveyTheme) {
20124
+ this._theme = surveyTheme;
20125
+ this.hasPendingThemeChanges = true;
20126
+ if (this.activeTab !== "theme") {
20127
+ this.updatePlugin(this.activeTab);
20128
+ }
20129
+ if (!!surveyTheme && surveyTheme.headerView) {
20130
+ this.survey.headerView = surveyTheme.headerView;
20131
+ }
20132
+ };
20022
20133
  SurveyCreatorModel.prototype._doSaveThemeCore = function (onSaveComplete) {
20023
20134
  var _this = this;
20024
20135
  this.setState("saving");
@@ -20130,7 +20241,7 @@ var SurveyCreatorModel = /** @class */ (function (_super) {
20130
20241
  });
20131
20242
  Object.defineProperty(SurveyCreatorModel.prototype, "allowChangeThemeInPreview", {
20132
20243
  /**
20133
- * @deprecated Use the [`previewAllowSelectTheme`](https://surveyjs.io/survey-creator/documentation/api-reference/survey-creator#previewAllowSelectTheme) property instead.
20244
+ * @deprecated Survey Creator no longer supports switching between UI themes in the Preview tab.
20134
20245
  */
20135
20246
  get: function () { return this.previewAllowSelectTheme; },
20136
20247
  set: function (val) { this.previewAllowSelectTheme = val; },
@@ -23014,7 +23125,7 @@ var SurveyCreatorModel = /** @class */ (function (_super) {
23014
23125
  var newCssVariable = {};
23015
23126
  (0,_utils_utils__WEBPACK_IMPORTED_MODULE_8__.assign)(newCssVariable, theme === null || theme === void 0 ? void 0 : theme.cssVariables);
23016
23127
  var designerPlugin = this.getPlugin("designer");
23017
- if (designerPlugin) {
23128
+ if (designerPlugin && designerPlugin.model) {
23018
23129
  designerPlugin.model.updateSurfaceCssVariables();
23019
23130
  }
23020
23131
  this.themeVariables = newCssVariable;
@@ -23726,25 +23837,7 @@ var settings = {
23726
23837
  choices: ["Item 1", "Item 2", "Item 3"]
23727
23838
  },
23728
23839
  imagepicker: {
23729
- imageFit: "cover",
23730
- choices: [
23731
- {
23732
- value: "Image 1",
23733
- imageLink: "https://surveyjs.io/Content/Images/examples/image-picker/lion.jpg"
23734
- },
23735
- {
23736
- value: "Image 2",
23737
- imageLink: "https://surveyjs.io/Content/Images/examples/image-picker/giraffe.jpg"
23738
- },
23739
- {
23740
- value: "Image 3",
23741
- imageLink: "https://surveyjs.io/Content/Images/examples/image-picker/panda.jpg"
23742
- },
23743
- {
23744
- value: "Image 4",
23745
- imageLink: "https://surveyjs.io/Content/Images/examples/image-picker/camel.jpg"
23746
- }
23747
- ]
23840
+ imageFit: "cover"
23748
23841
  },
23749
23842
  image: {
23750
23843
  imageFit: "cover",
@@ -24781,6 +24874,13 @@ var QuestionFileEditorModel = /** @class */ (function (_super) {
24781
24874
  enumerable: false,
24782
24875
  configurable: true
24783
24876
  });
24877
+ Object.defineProperty(QuestionFileEditorModel.prototype, "isTextInputReadOnly", {
24878
+ get: function () {
24879
+ return this.disableInput || this.isReadOnly;
24880
+ },
24881
+ enumerable: false,
24882
+ configurable: true
24883
+ });
24784
24884
  QuestionFileEditorModel.prototype.updateRenderedValue = function (value) {
24785
24885
  var matchBase64 = !!value ? value.match(/^data:((?:\w+\/(?:(?!;).)+)?)((?:;[\w\W]*?[^;])*),/) : null;
24786
24886
  if (matchBase64) {
@@ -24853,10 +24953,16 @@ var QuestionFileEditorModel = /** @class */ (function (_super) {
24853
24953
  (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
24854
24954
  (0,survey_core__WEBPACK_IMPORTED_MODULE_1__.property)()
24855
24955
  ], QuestionFileEditorModel.prototype, "placeholder", void 0);
24956
+ (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
24957
+ (0,survey_core__WEBPACK_IMPORTED_MODULE_1__.property)()
24958
+ ], QuestionFileEditorModel.prototype, "disableInput", void 0);
24856
24959
  return QuestionFileEditorModel;
24857
24960
  }(survey_core__WEBPACK_IMPORTED_MODULE_1__.QuestionFileModel));
24858
24961
 
24859
- survey_core__WEBPACK_IMPORTED_MODULE_1__.Serializer.addClass("fileedit", ["placeholder:string"], function () { return new QuestionFileEditorModel(""); }, "file");
24962
+ survey_core__WEBPACK_IMPORTED_MODULE_1__.Serializer.addClass("fileedit", [
24963
+ "placeholder:string",
24964
+ { name: "disableInput:boolean", default: false },
24965
+ ], function () { return new QuestionFileEditorModel(""); }, "file");
24860
24966
  survey_core__WEBPACK_IMPORTED_MODULE_1__.QuestionFactory.Instance.registerQuestion("fileedit", function (name) {
24861
24967
  return new QuestionFileEditorModel(name);
24862
24968
  }, false);
@@ -35448,7 +35554,7 @@ var propertyGridCss = {
35448
35554
  controlReadOnly: "sd-input--disabled sd-input--readonly"
35449
35555
  },
35450
35556
  buttongroup: {
35451
- root: "spg-button-group",
35557
+ root: "sd-button-group-scrollable-container spg-button-group",
35452
35558
  item: "spg-button-group__item",
35453
35559
  itemIcon: "spg-button-group__item-icon",
35454
35560
  itemDecorator: "spg-button-group__item-decorator",
@@ -35457,7 +35563,20 @@ var propertyGridCss = {
35457
35563
  itemSelected: "spg-button-group__item--selected",
35458
35564
  itemDisabled: "spg-button-group__item--disabled",
35459
35565
  itemControl: "sv-visuallyhidden",
35460
- readOnly: "spg-question--disabled"
35566
+ readOnly: "spg-question--disabled",
35567
+ rootDropdown: "sd-button-group-scrollable-container sd-scrollable-container--compact sd-selectbase",
35568
+ selectWrapper: "sv-dropdown_select-wrapper spg-dropdown_select-wrapper",
35569
+ control: "spg-input spg-dropdown sd-input sd-dropdown",
35570
+ controlEmpty: "spg-dropdown--empty sd-dropdown--empty",
35571
+ controlValue: "spg-dropdown__value sd-dropdown__value",
35572
+ controlDisabled: "spg-input--disabled sd-input--disabled",
35573
+ controlReadOnly: "spg-input--readonly sd-input--readonly",
35574
+ controlPreview: "spg-input--preview sd-input--preview",
35575
+ filterStringInput: "sd-dropdown__filter-string-input spg-dropdown__filter-string-input",
35576
+ chevronButton: "sd-dropdown_chevron-button spg-dropdown_chevron-button",
35577
+ chevronButtonSvg: "sd-dropdown_chevron-button-svg spg-dropdown_chevron-button-svg",
35578
+ chevronButtonIconId: "icon-chevron",
35579
+ popup: "spg-dropdown-popup svc-creator-popup",
35461
35580
  },
35462
35581
  imagepicker: {
35463
35582
  root: "spg-imagepicker",
@@ -36999,8 +37118,11 @@ __webpack_require__.r(__webpack_exports__);
36999
37118
  /* harmony export */ PropertyGridEditorExpression: () => (/* binding */ PropertyGridEditorExpression)
37000
37119
  /* harmony export */ });
37001
37120
  /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./src/entries/helpers.ts");
37002
- /* harmony import */ var _index__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./index */ "./src/property-grid/index.ts");
37003
- /* harmony import */ var _condition_survey__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./condition-survey */ "./src/property-grid/condition-survey.ts");
37121
+ /* harmony import */ var survey_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! survey-core */ "survey-core");
37122
+ /* harmony import */ var survey_core__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(survey_core__WEBPACK_IMPORTED_MODULE_1__);
37123
+ /* harmony import */ var _index__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./index */ "./src/property-grid/index.ts");
37124
+ /* harmony import */ var _condition_survey__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./condition-survey */ "./src/property-grid/condition-survey.ts");
37125
+
37004
37126
 
37005
37127
 
37006
37128
 
@@ -37023,43 +37145,56 @@ var PropertyGridEditorExpression = /** @class */ (function (_super) {
37023
37145
  question.clearValue();
37024
37146
  };
37025
37147
  PropertyGridEditorExpression.prototype.onCreated = function (obj, question, prop, options) {
37148
+ var _this = this;
37026
37149
  question.valueToDataCallback = function (val) {
37027
- if (!val)
37028
- return val;
37029
- return val.replace(/\\n/g, "\n")
37030
- .replace(/\\r/g, "\r")
37031
- .replace(/\\t/g, "\t");
37150
+ return _this.processExpression(val, true);
37032
37151
  };
37033
37152
  question.valueFromDataCallback = function (val) {
37034
- if (!val)
37035
- return val;
37036
- return val.replace(/\n/g, "\\n")
37037
- .replace(/\r/g, "\\r")
37038
- .replace(/\t/g, "\\t");
37153
+ return _this.processExpression(val, false);
37039
37154
  };
37040
- /*
37041
- question.valueFromDataCallback = (val: any): any => {
37042
- if(!val) return val;
37043
- return val.replace(/\\/g, "\\\\")
37044
- .replace(/'/g, "\\'")
37045
- .replace(/"/g, '\\"')
37046
- .replace(/\n/g, "\\n")
37155
+ };
37156
+ PropertyGridEditorExpression.prototype.processExpression = function (val, valueToData) {
37157
+ if (!val)
37158
+ return val;
37159
+ var operand = new survey_core__WEBPACK_IMPORTED_MODULE_1__.ConditionsParser().parseExpression(val);
37160
+ if (!operand)
37161
+ return val;
37162
+ var list = new Array();
37163
+ operand.addOperandsToList(list);
37164
+ var replacedText = new Array();
37165
+ for (var i = 0; i < list.length; i++) {
37166
+ var op = list[i];
37167
+ if (op.getType() === "const") {
37168
+ var constVal = op.correctValue;
37169
+ if (typeof constVal === "string") {
37170
+ var newVal = valueToData ? this.valueToData(constVal) : this.valueFromData(constVal);
37171
+ if (newVal !== constVal) {
37172
+ replacedText.push({ oldText: constVal, newText: newVal });
37173
+ }
37174
+ }
37175
+ }
37176
+ }
37177
+ replacedText.forEach(function (item) {
37178
+ val = val.replace(item.oldText, item.newText);
37179
+ });
37180
+ return val;
37181
+ };
37182
+ PropertyGridEditorExpression.prototype.valueToData = function (val) {
37183
+ if (!val)
37184
+ return val;
37185
+ return val.replace(/\\n/g, "\n")
37186
+ .replace(/\\r/g, "\r")
37187
+ .replace(/\\t/g, "\t");
37188
+ };
37189
+ PropertyGridEditorExpression.prototype.valueFromData = function (val) {
37190
+ if (!val)
37191
+ return val;
37192
+ return val.replace(/\n/g, "\\n")
37047
37193
  .replace(/\r/g, "\\r")
37048
37194
  .replace(/\t/g, "\\t");
37049
- };
37050
- question.valueToDataCallback = (val: any): any => {
37051
- if(!val) return val;
37052
- return val.replace(/\\t/g, "\t")
37053
- .replace(/\\r/g, "\r")
37054
- .replace(/\\n/g, "\n")
37055
- .replace(/\\"/g, '"')
37056
- .replace(/\\'/g, "'")
37057
- .replace(/\\\\/g, "\\");
37058
- };
37059
- */
37060
37195
  };
37061
37196
  return PropertyGridEditorExpression;
37062
- }(_index__WEBPACK_IMPORTED_MODULE_1__.PropertyGridEditor));
37197
+ }(_index__WEBPACK_IMPORTED_MODULE_2__.PropertyGridEditor));
37063
37198
 
37064
37199
  var PropertyGridEditorCondition = /** @class */ (function (_super) {
37065
37200
  (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(PropertyGridEditorCondition, _super);
@@ -37090,13 +37225,13 @@ var PropertyGridEditorCondition = /** @class */ (function (_super) {
37090
37225
  }
37091
37226
  };
37092
37227
  PropertyGridEditorCondition.prototype.createPropertyEditorSetup = function (obj, prop, question, options) {
37093
- return new _condition_survey__WEBPACK_IMPORTED_MODULE_2__.ConditionEditor(obj.getSurvey(), obj, options, prop.name);
37228
+ return new _condition_survey__WEBPACK_IMPORTED_MODULE_3__.ConditionEditor(obj.getSurvey(), obj, options, prop.name);
37094
37229
  };
37095
37230
  return PropertyGridEditorCondition;
37096
37231
  }(PropertyGridEditorExpression));
37097
37232
 
37098
- _index__WEBPACK_IMPORTED_MODULE_1__.PropertyGridEditorCollection.register(new PropertyGridEditorExpression());
37099
- _index__WEBPACK_IMPORTED_MODULE_1__.PropertyGridEditorCollection.register(new PropertyGridEditorCondition());
37233
+ _index__WEBPACK_IMPORTED_MODULE_2__.PropertyGridEditorCollection.register(new PropertyGridEditorExpression());
37234
+ _index__WEBPACK_IMPORTED_MODULE_2__.PropertyGridEditorCollection.register(new PropertyGridEditorCondition());
37100
37235
 
37101
37236
 
37102
37237
  /***/ }),
@@ -37944,13 +38079,6 @@ var PropertyGridTitleActionsCreator = /** @class */ (function () {
37944
38079
  action.iconName = _this.getHelpActionIconName(question);
37945
38080
  }
37946
38081
  });
37947
- var baseOnMouseDown = action.doMouseDown;
37948
- action.doMouseDown = function (args) {
37949
- baseOnMouseDown.call(action);
37950
- var evt = !!args.originalEvent ? args.originalEvent : args;
37951
- evt.preventDefault();
37952
- evt.stopPropagation();
37953
- };
37954
38082
  return action;
37955
38083
  };
37956
38084
  PropertyGridTitleActionsCreator.prototype.getHelpActionIconName = function (question) {
@@ -39022,8 +39150,9 @@ var PropertyGridEditorUndefinedBoolean = /** @class */ (function (_super) {
39022
39150
  { value: "false", text: _editorLocalization__WEBPACK_IMPORTED_MODULE_2__.editorLocalization.getString("pe.disabled") },
39023
39151
  { value: "true", text: _editorLocalization__WEBPACK_IMPORTED_MODULE_2__.editorLocalization.getString("pe.enabled") },
39024
39152
  ];
39153
+ var _renderAsButtonGroup = _creator_settings__WEBPACK_IMPORTED_MODULE_6__.settings.propertyGrid.useButtonGroup;
39025
39154
  var res = {
39026
- type: "buttongroup",
39155
+ type: _renderAsButtonGroup ? "buttongroup" : "dropdown",
39027
39156
  choices: choices,
39028
39157
  showOptionsCaption: false
39029
39158
  };
@@ -39384,10 +39513,9 @@ var PropertyGridEditorDropdown = /** @class */ (function (_super) {
39384
39513
  };
39385
39514
  PropertyGridEditorDropdown.prototype.getJSON = function (obj, prop, options) {
39386
39515
  var choices = this.getChoices(obj, prop);
39516
+ var _renderAsButtonGroup = this.renderAsButtonGroup(prop, choices);
39387
39517
  var json = {
39388
- type: this.renderAsButtonGroup(prop, choices)
39389
- ? "buttongroup"
39390
- : "dropdown",
39518
+ type: _renderAsButtonGroup ? "buttongroup" : "dropdown",
39391
39519
  choices: choices,
39392
39520
  showOptionsCaption: false
39393
39521
  };
@@ -40222,12 +40350,19 @@ var PropertyGridEditorMatrixItemValues = /** @class */ (function (_super) {
40222
40350
  return (!!column &&
40223
40351
  column.isVisible &&
40224
40352
  !column.readOnly &&
40225
- !this.hasMultipleLanguage(items) &&
40226
- !this.hasVisibleIfOrEnableIf(items));
40353
+ !this.hasMultipleLanguage(items));
40227
40354
  };
40228
40355
  PropertyGridEditorMatrixItemValues.prototype.getAllowRowDragDrop = function (prop) { return true; };
40229
40356
  PropertyGridEditorMatrixItemValues.prototype.createPropertyEditorSetup = function (obj, prop, question, options) {
40230
40357
  var names = question.columns.filter(function (c) { return !c.readOnly; }).map(function (c) { return c.name; });
40358
+ var visibleIfProp = survey_core__WEBPACK_IMPORTED_MODULE_1__.Serializer.findProperty("itemvalue", "visibleIf");
40359
+ if (visibleIfProp && visibleIfProp.visible) {
40360
+ names.push("visibleIf");
40361
+ var enableIfProp = survey_core__WEBPACK_IMPORTED_MODULE_1__.Serializer.findProperty("itemvalue", "enableIf");
40362
+ if (enableIfProp && enableIfProp.visible) {
40363
+ names.push("enableIf");
40364
+ }
40365
+ }
40231
40366
  return new _fast_entry__WEBPACK_IMPORTED_MODULE_6__.FastEntryEditor(obj[prop.name], options, prop.className, names);
40232
40367
  };
40233
40368
  PropertyGridEditorMatrixItemValues.prototype.canClearPropertyValue = function (obj, prop, question, options) {
@@ -40282,17 +40417,6 @@ var PropertyGridEditorMatrixItemValues = /** @class */ (function (_super) {
40282
40417
  }
40283
40418
  return false;
40284
40419
  };
40285
- PropertyGridEditorMatrixItemValues.prototype.hasVisibleIfOrEnableIf = function (items) {
40286
- if (!items || !Array.isArray(items)) {
40287
- return false;
40288
- }
40289
- for (var i = 0; i < items.length; i++) {
40290
- if (!!items[i].visibleIf || items[i].enableIf) {
40291
- return true;
40292
- }
40293
- }
40294
- return false;
40295
- };
40296
40420
  PropertyGridEditorMatrixItemValues.prototype.onMatrixCellCreated = function (obj, options) {
40297
40421
  _super.prototype.onMatrixCellCreated.call(this, obj, options);
40298
40422
  function updateHtml(question, value) {
@@ -40740,8 +40864,8 @@ var ObjectSelectorItem = /** @class */ (function (_super) {
40740
40864
  (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(ObjectSelectorItem, _super);
40741
40865
  function ObjectSelectorItem(id, data, title, level) {
40742
40866
  var _this = _super.call(this, { id: "sv_item_selector_" + id.toString(), title: title }) || this;
40743
- _this.data = data;
40744
40867
  _this.level = level;
40868
+ _this.data = data;
40745
40869
  return _this;
40746
40870
  }
40747
40871
  ObjectSelectorItem.prototype.hasText = function (filteredTextInLow) {
@@ -47888,7 +48012,7 @@ __webpack_require__.r(__webpack_exports__);
47888
48012
  /* harmony import */ var survey_core__WEBPACK_IMPORTED_MODULE_116__ = __webpack_require__(/*! survey-core */ "survey-core");
47889
48013
  /* harmony import */ var survey_core__WEBPACK_IMPORTED_MODULE_116___default = /*#__PURE__*/__webpack_require__.n(survey_core__WEBPACK_IMPORTED_MODULE_116__);
47890
48014
  var Version;
47891
- Version = "".concat("2.0.6");
48015
+ Version = "".concat("2.0.8");
47892
48016
  //should be loaded before other styles for easier override
47893
48017
 
47894
48018
 
@@ -48010,7 +48134,7 @@ Version = "".concat("2.0.6");
48010
48134
 
48011
48135
 
48012
48136
 
48013
- (0,survey_core__WEBPACK_IMPORTED_MODULE_116__.checkLibraryVersion)("".concat("2.0.6"), "survey-creator-core");
48137
+ (0,survey_core__WEBPACK_IMPORTED_MODULE_116__.checkLibraryVersion)("".concat("2.0.8"), "survey-creator-core");
48014
48138
 
48015
48139
  })();
48016
48140