survey-react 1.9.111 → 1.9.112

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.
package/survey.react.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - Survey JavaScript library v1.9.111
2
+ * surveyjs - Survey JavaScript library v1.9.112
3
3
  * Copyright (c) 2015-2023 Devsoft Baltic OÜ - http://surveyjs.io/
4
4
  * License: MIT (http://www.opensource.org/licenses/mit-license.php)
5
5
  */
@@ -3563,11 +3563,11 @@ var ChoicesRestful = /** @class */ (function (_super) {
3563
3563
  configurable: true
3564
3564
  });
3565
3565
  ChoicesRestful.prototype.clear = function () {
3566
- this.url = "";
3567
- this.path = "";
3568
- this.valueName = "";
3569
- this.titleName = "";
3570
- this.imageLinkName = "";
3566
+ this.url = undefined;
3567
+ this.path = undefined;
3568
+ this.valueName = undefined;
3569
+ this.titleName = undefined;
3570
+ this.imageLinkName = undefined;
3571
3571
  var properties = this.getCustomPropertiesNames();
3572
3572
  for (var i = 0; i < properties.length; i++) {
3573
3573
  if (this[properties[i]])
@@ -4503,12 +4503,12 @@ var CoverCell = /** @class */ (function () {
4503
4503
  enumerable: false,
4504
4504
  configurable: true
4505
4505
  });
4506
- Object.defineProperty(CoverCell.prototype, "textWidth", {
4506
+ Object.defineProperty(CoverCell.prototype, "textAreaWidth", {
4507
4507
  get: function () {
4508
- if (!this.cover.textWidth) {
4508
+ if (!this.cover.textAreaWidth) {
4509
4509
  return "";
4510
4510
  }
4511
- return "" + this.cover.textWidth + "px";
4511
+ return "" + this.cover.textAreaWidth + "px";
4512
4512
  },
4513
4513
  enumerable: false,
4514
4514
  configurable: true
@@ -4526,6 +4526,9 @@ var Cover = /** @class */ (function (_super) {
4526
4526
  ["top", "middle", "bottom"].forEach(function (positionY) {
4527
4527
  return ["left", "center", "right"].forEach(function (positionX) { return _this.cells.push(new CoverCell(_this, positionX, positionY)); });
4528
4528
  });
4529
+ _this.updateCoverClasses();
4530
+ _this.updateContentClasses();
4531
+ _this.updateBackgroundImageClasses();
4529
4532
  return _this;
4530
4533
  }
4531
4534
  Cover.prototype.calcBackgroundSize = function (backgroundImageFit) {
@@ -4537,8 +4540,29 @@ var Cover = /** @class */ (function (_super) {
4537
4540
  }
4538
4541
  return backgroundImageFit;
4539
4542
  };
4543
+ Cover.prototype.updateCoverClasses = function () {
4544
+ this.coverClasses = new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_2__["CssClassBuilder"]()
4545
+ .append("sv-cover")
4546
+ .append("sv-conver__without-background", (!this.backgroundColor || this.backgroundColor === "trasparent") && !this.backgroundImage)
4547
+ .append("sv-conver__overlap", this.overlapEnabled)
4548
+ .toString();
4549
+ };
4550
+ Cover.prototype.updateContentClasses = function () {
4551
+ this.contentClasses = new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_2__["CssClassBuilder"]()
4552
+ .append("sv-conver__content")
4553
+ .append("sv-conver__content--static", this.inheritWidthFrom === "survey" && !!this.survey && this.survey.calculateWidthMode() === "static")
4554
+ .append("sv-conver__content--responsive", this.inheritWidthFrom === "page" || (!!this.survey && this.survey.calculateWidthMode() === "responsive"))
4555
+ .toString();
4556
+ };
4557
+ Cover.prototype.updateBackgroundImageClasses = function () {
4558
+ this.backgroundImageClasses = new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_2__["CssClassBuilder"]()
4559
+ .append("sv-cover__background-image")
4560
+ .append("sv-cover__background-image--contain", this.backgroundImageFit === "contain")
4561
+ .append("sv-cover__background-image--tile", this.backgroundImageFit === "tile")
4562
+ .toString();
4563
+ };
4540
4564
  Cover.prototype.fromTheme = function (theme) {
4541
- _super.prototype.fromJSON.call(this, theme.cover);
4565
+ _super.prototype.fromJSON.call(this, theme.header);
4542
4566
  if (!!theme.cssVariables) {
4543
4567
  this.backgroundColor = theme.cssVariables["--sjs-cover-backcolor"];
4544
4568
  }
@@ -4553,42 +4577,30 @@ var Cover = /** @class */ (function (_super) {
4553
4577
  enumerable: false,
4554
4578
  configurable: true
4555
4579
  });
4556
- Object.defineProperty(Cover.prototype, "renderedTextWidth", {
4557
- get: function () {
4558
- return this.textWidth ? this.textWidth + "px" : undefined;
4559
- },
4560
- enumerable: false,
4561
- configurable: true
4562
- });
4563
- Object.defineProperty(Cover.prototype, "coverClasses", {
4580
+ Object.defineProperty(Cover.prototype, "renderedtextAreaWidth", {
4564
4581
  get: function () {
4565
- return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_2__["CssClassBuilder"]()
4566
- .append("sv-cover")
4567
- .append("sv-conver__without-background", !this.backgroundColor && !this.backgroundImage)
4568
- .append("sv-conver__overlap", this.overlap)
4569
- .toString();
4582
+ return this.textAreaWidth ? this.textAreaWidth + "px" : undefined;
4570
4583
  },
4571
4584
  enumerable: false,
4572
4585
  configurable: true
4573
4586
  });
4574
- Object.defineProperty(Cover.prototype, "contentClasses", {
4587
+ Object.defineProperty(Cover.prototype, "survey", {
4575
4588
  get: function () {
4576
- return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_2__["CssClassBuilder"]()
4577
- .append("sv-conver__content")
4578
- .append("sv-conver__content--static", this.areaWidth === "survey" && this.survey.calculateWidthMode() === "static")
4579
- .append("sv-conver__content--responsive", this.areaWidth === "container" || this.survey.calculateWidthMode() === "responsive")
4580
- .toString();
4589
+ return this._survey;
4581
4590
  },
4582
- enumerable: false,
4583
- configurable: true
4584
- });
4585
- Object.defineProperty(Cover.prototype, "backgroundImageClasses", {
4586
- get: function () {
4587
- return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_2__["CssClassBuilder"]()
4588
- .append("sv-cover__background-image")
4589
- .append("sv-cover__background-image--contain", this.backgroundImageFit === "contain")
4590
- .append("sv-cover__background-image--tile", this.backgroundImageFit === "tile")
4591
- .toString();
4591
+ set: function (newValue) {
4592
+ var _this = this;
4593
+ if (this._survey === newValue)
4594
+ return;
4595
+ this._survey = newValue;
4596
+ if (!!newValue) {
4597
+ this.updateContentClasses();
4598
+ this._survey.onPropertyChanged.add(function (sender, options) {
4599
+ if (options.name == "widthMode") {
4600
+ _this.updateContentClasses();
4601
+ }
4602
+ });
4603
+ }
4592
4604
  },
4593
4605
  enumerable: false,
4594
4606
  configurable: true
@@ -4606,24 +4618,33 @@ var Cover = /** @class */ (function (_super) {
4606
4618
  enumerable: false,
4607
4619
  configurable: true
4608
4620
  });
4621
+ Cover.prototype.propertyValueChanged = function (name, oldValue, newValue) {
4622
+ _super.prototype.propertyValueChanged.call(this, name, oldValue, newValue);
4623
+ if (name === "backgroundColor" || name === "backgroundImage" || name === "overlapEnabled") {
4624
+ this.updateCoverClasses();
4625
+ }
4626
+ if (name === "inheritWidthFrom") {
4627
+ this.updateContentClasses();
4628
+ }
4629
+ if (name === "backgroundImageFit") {
4630
+ this.updateBackgroundImageClasses();
4631
+ }
4632
+ };
4609
4633
  __decorate([
4610
4634
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])()
4611
4635
  ], Cover.prototype, "height", void 0);
4612
4636
  __decorate([
4613
4637
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])()
4614
- ], Cover.prototype, "areaWidth", void 0);
4615
- __decorate([
4616
- Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])()
4617
- ], Cover.prototype, "textWidth", void 0);
4638
+ ], Cover.prototype, "inheritWidthFrom", void 0);
4618
4639
  __decorate([
4619
4640
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])()
4620
- ], Cover.prototype, "invertText", void 0);
4641
+ ], Cover.prototype, "textAreaWidth", void 0);
4621
4642
  __decorate([
4622
4643
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])()
4623
- ], Cover.prototype, "glowText", void 0);
4644
+ ], Cover.prototype, "textGlowEnabled", void 0);
4624
4645
  __decorate([
4625
4646
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])()
4626
- ], Cover.prototype, "overlap", void 0);
4647
+ ], Cover.prototype, "overlapEnabled", void 0);
4627
4648
  __decorate([
4628
4649
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])()
4629
4650
  ], Cover.prototype, "backgroundColor", void 0);
@@ -4670,17 +4691,25 @@ var Cover = /** @class */ (function (_super) {
4670
4691
  __decorate([
4671
4692
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])()
4672
4693
  ], Cover.prototype, "descriptionStyle", void 0);
4694
+ __decorate([
4695
+ Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])()
4696
+ ], Cover.prototype, "coverClasses", void 0);
4697
+ __decorate([
4698
+ Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])()
4699
+ ], Cover.prototype, "contentClasses", void 0);
4700
+ __decorate([
4701
+ Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])()
4702
+ ], Cover.prototype, "backgroundImageClasses", void 0);
4673
4703
  return Cover;
4674
4704
  }(_base__WEBPACK_IMPORTED_MODULE_0__["Base"]));
4675
4705
 
4676
4706
  _jsonobject__WEBPACK_IMPORTED_MODULE_1__["Serializer"].addClass("cover", [
4677
4707
  { name: "height:number", minValue: 0, default: 256 },
4678
- { name: "areaWidth", default: "survey" },
4679
- { name: "textWidth:number", minValue: 0, default: 512 },
4680
- { name: "invertText:boolean" },
4681
- { name: "glowText:boolean" },
4682
- { name: "overlap:boolean" },
4683
- { name: "backgroundImage" },
4708
+ { name: "inheritWidthFrom", default: "survey" },
4709
+ { name: "textAreaWidth:number", minValue: 0, default: 512 },
4710
+ { name: "textGlowEnabled:boolean" },
4711
+ { name: "overlapEnabled:boolean" },
4712
+ { name: "backgroundImage:file" },
4684
4713
  { name: "backgroundImageOpacity:number", minValue: 0, maxValue: 1, default: 1 },
4685
4714
  { name: "backgroundImageFit", default: "cover", choices: ["cover", "fill", "contain"] },
4686
4715
  { name: "logoPositionX", default: "right" },
@@ -7691,7 +7720,7 @@ var DragDropRankingChoices = /** @class */ (function (_super) {
7691
7720
  DragDropRankingChoices.prototype.createDraggedElementShortcut = function (text, draggedElementNode, event) {
7692
7721
  var draggedElementShortcut = document.createElement("div");
7693
7722
  draggedElementShortcut.className = this.shortcutClass + " sv-ranking-shortcut";
7694
- draggedElementShortcut.style.cssText = " \n cursor: grabbing;\n position: absolute;\n z-index: 10000;\n border-radius: calc(12.5 * var(--sjs-base-unit, var(--base-unit, 8px)));\n min-width: 100px;\n box-shadow: var(--sjs-shadow-medium, 0px 2px 6px 0px rgba(0, 0, 0, 0.1)), var(--sjs-shadow-large, 0px 8px 16px 0px rgba(0, 0, 0, 0.1));\n background-color: var(--sjs-general-backcolor, var(--background, #fff));\n font-family: var(--font-family, 'Open Sans');\n ";
7723
+ draggedElementShortcut.style.cssText = " \n cursor: grabbing;\n position: absolute;\n z-index: 10000;\n border-radius: calc(12.5 * var(--sjs-base-unit, var(--base-unit, 8px)));\n min-width: 100px;\n max-width: 400px;\n box-shadow: var(--sjs-shadow-medium, 0px 2px 6px 0px rgba(0, 0, 0, 0.1)), var(--sjs-shadow-large, 0px 8px 16px 0px rgba(0, 0, 0, 0.1));\n background-color: var(--sjs-general-backcolor, var(--background, #fff));\n font-family: var(--font-family, 'Open Sans');\n ";
7695
7724
  var isDeepClone = true;
7696
7725
  var clone = draggedElementNode.cloneNode(isDeepClone);
7697
7726
  draggedElementShortcut.appendChild(clone);
@@ -8211,6 +8240,8 @@ var DropdownListModel = /** @class */ (function (_super) {
8211
8240
  };
8212
8241
  DropdownListModel.prototype.onSetFilterString = function () {
8213
8242
  var _this = this;
8243
+ if (!this.filterString && !this.popupModel.isVisible)
8244
+ return;
8214
8245
  if (!!this.filterString && !this.popupModel.isVisible) {
8215
8246
  this.popupModel.isVisible = true;
8216
8247
  }
@@ -8540,11 +8571,11 @@ var DropdownListModel = /** @class */ (function (_super) {
8540
8571
  this._popupModel.isVisible = true;
8541
8572
  return;
8542
8573
  }
8574
+ Object(_utils_utils__WEBPACK_IMPORTED_MODULE_8__["doKey2ClickBlur"])(event);
8575
+ this._popupModel.isVisible = false;
8543
8576
  this.resetFilterString();
8544
8577
  this.inputString = null;
8545
8578
  this.hintString = "";
8546
- Object(_utils_utils__WEBPACK_IMPORTED_MODULE_8__["doKey2ClickBlur"])(event);
8547
- this._popupModel.isVisible = false;
8548
8579
  event.stopPropagation();
8549
8580
  };
8550
8581
  DropdownListModel.prototype.onFocus = function (event) {
@@ -9645,8 +9676,8 @@ __webpack_require__.r(__webpack_exports__);
9645
9676
  //import "../../modern.scss";
9646
9677
  var Version;
9647
9678
  var ReleaseDate;
9648
- Version = "" + "1.9.111";
9649
- ReleaseDate = "" + "2023-10-04";
9679
+ Version = "" + "1.9.112";
9680
+ ReleaseDate = "" + "2023-10-10";
9650
9681
  function checkLibraryVersion(ver, libraryName) {
9651
9682
  if (Version != ver) {
9652
9683
  var str = "survey-core has version '" + Version + "' and " + libraryName
@@ -28345,6 +28376,7 @@ var Notifier = /** @class */ (function (_super) {
28345
28376
  _this.timeout = _settings__WEBPACK_IMPORTED_MODULE_1__["settings"].notifications.lifetime;
28346
28377
  _this.timer = undefined;
28347
28378
  _this.actionsVisibility = {};
28379
+ _this.showActions = true;
28348
28380
  _this.actionBar = new _actions_container__WEBPACK_IMPORTED_MODULE_4__["ActionContainer"]();
28349
28381
  _this.actionBar.updateCallback = function (isResetInitialized) {
28350
28382
  _this.actionBar.actions.forEach(function (action) { return action.cssClasses = {}; });
@@ -28363,7 +28395,7 @@ var Notifier = /** @class */ (function (_super) {
28363
28395
  };
28364
28396
  Notifier.prototype.updateActionsVisibility = function (type) {
28365
28397
  var _this = this;
28366
- this.actionBar.actions.forEach(function (action) { return action.visible = (_this.actionsVisibility[action.id] === type); });
28398
+ this.actionBar.actions.forEach(function (action) { return action.visible = _this.showActions && (_this.actionsVisibility[action.id] === type); });
28367
28399
  };
28368
28400
  Notifier.prototype.notify = function (message, type, waitUserAction) {
28369
28401
  var _this = this;
@@ -33751,6 +33783,14 @@ var __decorate = (undefined && undefined.__decorate) || function (decorators, ta
33751
33783
 
33752
33784
 
33753
33785
 
33786
+ var TriggerExpressionInfo = /** @class */ (function () {
33787
+ function TriggerExpressionInfo(name, canRun, doComplete) {
33788
+ this.name = name;
33789
+ this.canRun = canRun;
33790
+ this.doComplete = doComplete;
33791
+ }
33792
+ return TriggerExpressionInfo;
33793
+ }());
33754
33794
  /**
33755
33795
  * A base class for all questions.
33756
33796
  */
@@ -33774,6 +33814,7 @@ var Question = /** @class */ (function (_super) {
33774
33814
  * Indicates the previous ready state.
33775
33815
  */
33776
33816
  _this.onReadyChanged = _this.addEvent();
33817
+ _this.triggersInfo = [];
33777
33818
  _this.isRunningValidatorsValue = false;
33778
33819
  _this.isValueChangedInSurvey = false;
33779
33820
  _this.allowNotifyValueChanged = true;
@@ -33791,6 +33832,11 @@ var Question = /** @class */ (function (_super) {
33791
33832
  };
33792
33833
  _this.locTitle.storeDefaultText = true;
33793
33834
  _this.createLocalizableString("requiredErrorText", _this);
33835
+ _this.addTriggerInfo("resetValueIf", function () { return !_this.isEmpty(); }, function () {
33836
+ _this.clearValue();
33837
+ _this.updateValueWithDefaults();
33838
+ });
33839
+ _this.addTriggerInfo("setValueIf", function () { return true; }, function () { return _this.runSetValueExpression(); });
33794
33840
  _this.registerPropertyChangedHandlers(["width"], function () {
33795
33841
  _this.updateQuestionCss();
33796
33842
  if (!!_this.parent) {
@@ -33830,7 +33876,6 @@ var Question = /** @class */ (function (_super) {
33830
33876
  };
33831
33877
  Question.prototype.setIsMobile = function (val) {
33832
33878
  this.isMobile = val && (this.allowMobileInDesignMode() || !this.isDesignMode);
33833
- this.renderMinWidth = !val;
33834
33879
  };
33835
33880
  Question.prototype.createLocTitleProperty = function () {
33836
33881
  var _this = this;
@@ -34243,31 +34288,60 @@ var Question = /** @class */ (function (_super) {
34243
34288
  requiredAnsweredQuestionCount: !this.isEmpty() && this.isRequired ? 1 : 0,
34244
34289
  };
34245
34290
  };
34246
- Question.prototype.runTriggers = function (name, value) {
34291
+ Question.prototype.runSetValueExpression = function () {
34247
34292
  var _this = this;
34248
- if (this.isRunningResetValueIf || this.isReadOnly || !this.resetValueIf || this.isEmpty() || this.isSettingQuestionValue)
34249
- return;
34250
- if (this.parentQuestion && this.parentQuestion.getValueName() === name)
34293
+ if (!this.setValueExpression) {
34294
+ this.clearValue();
34295
+ }
34296
+ else {
34297
+ if (!this.setValueExpressionRunner) {
34298
+ this.setValueExpressionRunner = new _conditions__WEBPACK_IMPORTED_MODULE_6__["ExpressionRunner"](this.setValueExpression);
34299
+ this.setValueExpressionRunner.onRunComplete = function (res) {
34300
+ if (!_this.isTwoValueEquals(_this.value, res)) {
34301
+ _this.value = res;
34302
+ }
34303
+ };
34304
+ }
34305
+ else {
34306
+ this.setValueExpressionRunner.expression = this.setValueExpression;
34307
+ }
34308
+ this.setValueExpressionRunner.run(this.getDataFilteredValues(), this.getDataFilteredProperties());
34309
+ }
34310
+ };
34311
+ Question.prototype.addTriggerInfo = function (name, canRun, doComplete) {
34312
+ this.triggersInfo.push(new TriggerExpressionInfo(name, canRun, doComplete));
34313
+ };
34314
+ Question.prototype.runTriggerInfo = function (info, name, value) {
34315
+ var expression = this[info.name];
34316
+ if (!expression || info.isRunning || !info.canRun())
34251
34317
  return;
34252
- if (!this.resetValueIfExpression) {
34253
- this.resetValueIfExpression = new _conditions__WEBPACK_IMPORTED_MODULE_6__["ExpressionRunner"](this.resetValueIf);
34254
- this.resetValueIfExpression.onRunComplete = function (res) {
34255
- _this.isRunningResetValueIf = false;
34318
+ if (!info.runner) {
34319
+ info.runner = new _conditions__WEBPACK_IMPORTED_MODULE_6__["ExpressionRunner"](expression);
34320
+ info.runner.onRunComplete = function (res) {
34256
34321
  if (res === true) {
34257
- _this.clearValue();
34258
- _this.updateValueWithDefaults();
34322
+ info.doComplete();
34259
34323
  }
34324
+ info.isRunning = false;
34260
34325
  };
34261
34326
  }
34262
34327
  else {
34263
- this.resetValueIfExpression.expression = this.resetValueIf;
34328
+ info.runner.expression = expression;
34264
34329
  }
34265
34330
  var keys = {};
34266
34331
  keys[name] = value;
34267
- if (!new _conditionProcessValue__WEBPACK_IMPORTED_MODULE_13__["ProcessValue"]().isAnyKeyChanged(keys, this.resetValueIfExpression.getVariables()))
34332
+ if (!new _conditionProcessValue__WEBPACK_IMPORTED_MODULE_13__["ProcessValue"]().isAnyKeyChanged(keys, info.runner.getVariables()))
34333
+ return;
34334
+ info.isRunning = true;
34335
+ info.runner.run(this.getDataFilteredValues(), this.getDataFilteredProperties());
34336
+ };
34337
+ Question.prototype.runTriggers = function (name, value) {
34338
+ var _this = this;
34339
+ if (this.isReadOnly || this.isSettingQuestionValue ||
34340
+ (this.parentQuestion && this.parentQuestion.getValueName() === name))
34268
34341
  return;
34269
- this.isRunningResetValueIf = true;
34270
- this.resetValueIfExpression.run(this.getDataFilteredValues(), this.getDataFilteredProperties());
34342
+ this.triggersInfo.forEach(function (info) {
34343
+ _this.runTriggerInfo(info, name, value);
34344
+ });
34271
34345
  };
34272
34346
  Question.prototype.runConditions = function () {
34273
34347
  if (this.data && !this.isLoadingFromJson) {
@@ -35653,6 +35727,7 @@ var Question = /** @class */ (function (_super) {
35653
35727
  *
35654
35728
  * An expression can also include built-in and custom functions for advanced calculations. For example, if the `defaultValue` should be today's date, set the `defaultValueExpression` to `"today()"`, and the corresponding built-in function will be executed each time the survey is loaded. Refer to the following help topic for more information: [Built-In Functions](https://surveyjs.io/form-library/documentation/design-survey-conditional-logic#built-in-functions).
35655
35729
  * @see defaultValue
35730
+ * @see setValueExpression
35656
35731
  */
35657
35732
  get: function () {
35658
35733
  return this.getPropertyValue("defaultValueExpression");
@@ -35672,6 +35747,7 @@ var Question = /** @class */ (function (_super) {
35672
35747
  * A survey parses and runs all expressions on startup. If any values used in the expression change, the survey re-evaluates it.
35673
35748
  *
35674
35749
  * [Expressions](https://surveyjs.io/form-library/documentation/design-survey/conditional-logic#expressions (linkStyle))
35750
+ * @see setValueIf
35675
35751
  */
35676
35752
  get: function () {
35677
35753
  return this.getPropertyValue("resetValueIf");
@@ -35682,6 +35758,41 @@ var Question = /** @class */ (function (_super) {
35682
35758
  enumerable: false,
35683
35759
  configurable: true
35684
35760
  });
35761
+ Object.defineProperty(Question.prototype, "setValueIf", {
35762
+ /**
35763
+ * A Boolean expression. If it evaluates to `true`, the question value is set to a value calculated using the [`setValueExpression`](#setValueExpression).
35764
+ *
35765
+ * A survey parses and runs all expressions on startup. If any values used in the expression change, the survey re-evaluates it.
35766
+ *
35767
+ * [Expressions](https://surveyjs.io/form-library/documentation/design-survey/conditional-logic#expressions (linkStyle))
35768
+ * @see resetValueIf
35769
+ */
35770
+ get: function () {
35771
+ return this.getPropertyValue("setValueIf");
35772
+ },
35773
+ set: function (val) {
35774
+ this.setPropertyValue("setValueIf", val);
35775
+ },
35776
+ enumerable: false,
35777
+ configurable: true
35778
+ });
35779
+ Object.defineProperty(Question.prototype, "setValueExpression", {
35780
+ /**
35781
+ * An expression used to calculate the question value. Applies only when the [`setValueIf`](#setValueIf) expression evaluates to `true`.
35782
+ *
35783
+ * [Expressions](https://surveyjs.io/form-library/documentation/design-survey/conditional-logic#expressions (linkStyle))
35784
+ * @see defaultValueExpression
35785
+ * @see resetValueIf
35786
+ */
35787
+ get: function () {
35788
+ return this.getPropertyValue("setValueExpression");
35789
+ },
35790
+ set: function (val) {
35791
+ this.setPropertyValue("setValueExpression", val);
35792
+ },
35793
+ enumerable: false,
35794
+ configurable: true
35795
+ });
35685
35796
  Object.defineProperty(Question.prototype, "resizeStyle", {
35686
35797
  get: function () {
35687
35798
  return this.allowResizeComment ? "both" : "none";
@@ -36799,10 +36910,9 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_1__["Serializer"].addClass("question", [
36799
36910
  },
36800
36911
  { name: "valueName", onSettingValue: function (obj, val) { return makeNameValid(val); } },
36801
36912
  "enableIf:condition",
36802
- {
36803
- name: "resetValueIf:condition",
36804
- category: "logic"
36805
- },
36913
+ "resetValueIf:condition",
36914
+ "setValueIf:condition",
36915
+ { name: "setValueExpression:expression", visibleIf: function (obj) { return !!obj.setValueIf; } },
36806
36916
  "defaultValue:value",
36807
36917
  {
36808
36918
  name: "defaultValueExpression:expression",
@@ -42498,11 +42608,6 @@ var QuestionExpressionModel = /** @class */ (function (_super) {
42498
42608
  }
42499
42609
  return val.toString();
42500
42610
  };
42501
- QuestionExpressionModel.prototype.convertToCorrectValue = function (val) {
42502
- if (Array.isArray(val))
42503
- return val.join(", ");
42504
- return val;
42505
- };
42506
42611
  return QuestionExpressionModel;
42507
42612
  }(_question__WEBPACK_IMPORTED_MODULE_1__["Question"]));
42508
42613
 
@@ -44396,7 +44501,7 @@ function getCorrectImageLink(val) {
44396
44501
  return youtubeUrl + youtubeEmbed + "/" + id;
44397
44502
  }
44398
44503
  _jsonobject__WEBPACK_IMPORTED_MODULE_1__["Serializer"].addClass("image", [
44399
- { name: "imageLink", serializationProperty: "locImageLink" },
44504
+ { name: "imageLink:file", serializationProperty: "locImageLink" },
44400
44505
  { name: "altText", serializationProperty: "locAltText", alternativeName: "text", category: "general" },
44401
44506
  {
44402
44507
  name: "contentMode",
@@ -44973,7 +45078,7 @@ var QuestionImagePickerModel = /** @class */ (function (_super) {
44973
45078
  return QuestionImagePickerModel;
44974
45079
  }(_question_baseselect__WEBPACK_IMPORTED_MODULE_2__["QuestionCheckboxBase"]));
44975
45080
 
44976
- _jsonobject__WEBPACK_IMPORTED_MODULE_0__["Serializer"].addClass("imageitemvalue", [{ name: "imageLink", serializationProperty: "locImageLink" }], function (value) { return new ImageItemValue(value); }, "itemvalue");
45081
+ _jsonobject__WEBPACK_IMPORTED_MODULE_0__["Serializer"].addClass("imageitemvalue", [{ name: "imageLink:file", serializationProperty: "locImageLink" }], function (value) { return new ImageItemValue(value); }, "itemvalue");
44977
45082
  _jsonobject__WEBPACK_IMPORTED_MODULE_0__["Serializer"].addClass("responsiveImageSize", [], undefined, "number");
44978
45083
  _jsonobject__WEBPACK_IMPORTED_MODULE_0__["Serializer"].addClass("imagepicker", [
44979
45084
  { name: "showOtherItem", visible: false },
@@ -48207,7 +48312,10 @@ var QuestionMatrixDropdownModelBase = /** @class */ (function (_super) {
48207
48312
  return false;
48208
48313
  };
48209
48314
  QuestionMatrixDropdownModelBase.prototype.addDuplicationError = function (question) {
48210
- question.addError(new _error__WEBPACK_IMPORTED_MODULE_10__["KeyDuplicationError"](this.keyDuplicationError, this));
48315
+ var keyError = question.errors.find(function (error) { return error.getErrorType() === "keyduplicationerror"; });
48316
+ if (!keyError) {
48317
+ question.addError(new _error__WEBPACK_IMPORTED_MODULE_10__["KeyDuplicationError"](this.keyDuplicationError, this));
48318
+ }
48211
48319
  };
48212
48320
  QuestionMatrixDropdownModelBase.prototype.getFirstQuestionToFocus = function (withError) {
48213
48321
  return this.getFirstCellQuestion(withError);
@@ -49039,6 +49147,26 @@ var MatrixDropdownColumn = /** @class */ (function (_super) {
49039
49147
  enumerable: false,
49040
49148
  configurable: true
49041
49149
  });
49150
+ Object.defineProperty(MatrixDropdownColumn.prototype, "setValueIf", {
49151
+ get: function () {
49152
+ return this.templateQuestion.setValueIf;
49153
+ },
49154
+ set: function (val) {
49155
+ this.templateQuestion.setValueIf = val;
49156
+ },
49157
+ enumerable: false,
49158
+ configurable: true
49159
+ });
49160
+ Object.defineProperty(MatrixDropdownColumn.prototype, "setValueExpession", {
49161
+ get: function () {
49162
+ return this.templateQuestion.setValueExpession;
49163
+ },
49164
+ set: function (val) {
49165
+ this.templateQuestion.setValueExpession = val;
49166
+ },
49167
+ enumerable: false,
49168
+ configurable: true
49169
+ });
49042
49170
  Object.defineProperty(MatrixDropdownColumn.prototype, "isUnique", {
49043
49171
  get: function () {
49044
49172
  return this.getPropertyValue("isUnique");
@@ -49490,12 +49618,12 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_0__["Serializer"].addClass("matrixdropdownc
49490
49618
  "enableIf:condition",
49491
49619
  "requiredIf:condition",
49492
49620
  "resetValueIf:condition",
49621
+ "setValueIf:condition",
49622
+ { name: "setValueExpression:expression", visibleIf: function (obj) { return !!obj.setValueIf; } },
49493
49623
  {
49494
49624
  name: "showInMultipleColumns:boolean",
49495
49625
  dependsOn: "cellType",
49496
49626
  visibleIf: function (obj) {
49497
- if (!obj)
49498
- return false;
49499
49627
  return obj.isSupportMultipleColumns;
49500
49628
  },
49501
49629
  },
@@ -53745,10 +53873,8 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
53745
53873
  };
53746
53874
  QuestionPanelDynamicModel.prototype.setIsMobile = function (val) {
53747
53875
  _super.prototype.setIsMobile.call(this, val);
53748
- (this.panels || []).forEach(function (panel) { return panel.elements.forEach(function (element) {
53749
- if (element instanceof _question__WEBPACK_IMPORTED_MODULE_4__["Question"]) {
53750
- element.isMobile = val;
53751
- }
53876
+ (this.panels || []).forEach(function (panel) { return panel.getQuestions(true).forEach(function (question) {
53877
+ question.setIsMobile(val);
53752
53878
  }); });
53753
53879
  };
53754
53880
  Object.defineProperty(QuestionPanelDynamicModel.prototype, "panelCount", {
@@ -57733,7 +57859,7 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_0__["Serializer"].addClass("signaturepad",
57733
57859
  default: true,
57734
57860
  },
57735
57861
  {
57736
- name: "backgroundImage",
57862
+ name: "backgroundImage:file",
57737
57863
  category: "general",
57738
57864
  },
57739
57865
  {
@@ -60105,9 +60231,9 @@ var CoverCellComponent = /** @class */ (function (_super) {
60105
60231
  return (react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { className: this.model.css, style: this.model.style },
60106
60232
  react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { className: "sv-cover__cell-content", style: this.model.contentStyle },
60107
60233
  this.model.showLogo ? (react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { className: "sv-cover__logo" }, this.renderLogoImage())) : null,
60108
- this.model.showTitle ? (react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { className: "sv-cover__title", style: { maxWidth: this.model.textWidth } },
60234
+ this.model.showTitle ? (react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { className: "sv-cover__title", style: { maxWidth: this.model.textAreaWidth } },
60109
60235
  react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_title_title_element__WEBPACK_IMPORTED_MODULE_3__["TitleElement"], { element: this.model.survey }))) : null,
60110
- this.model.showDescription ? (react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { className: "sv-cover__description", style: { maxWidth: this.model.textWidth } },
60236
+ this.model.showDescription ? (react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { className: "sv-cover__description", style: { maxWidth: this.model.textAreaWidth } },
60111
60237
  react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("h5", { className: this.model.survey.css.description }, _reactquestion_element__WEBPACK_IMPORTED_MODULE_1__["SurveyElementBase"].renderLocString(this.model.survey.locDescription)))) : null)));
60112
60238
  };
60113
60239
  return CoverCellComponent;
@@ -60130,7 +60256,7 @@ var CoverComponent = /** @class */ (function (_super) {
60130
60256
  };
60131
60257
  CoverComponent.prototype.renderElement = function () {
60132
60258
  this.model.survey = this.props.survey;
60133
- if (!(this.props.survey.titleView === "cover" && this.props.survey.renderedHasHeader)) {
60259
+ if (!(this.props.survey.headerView === "advanced" && this.props.survey.renderedHasHeader)) {
60134
60260
  return null;
60135
60261
  }
60136
60262
  return (react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { className: this.model.coverClasses, style: { height: this.model.renderedHeight } },
@@ -62494,7 +62620,7 @@ var SurveyQuestionDropdownBase = /** @class */ (function (_super) {
62494
62620
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", { style: { visibility: "hidden" }, "data-bind": "text: model.filterString" }, dropdownListModel.inputStringRendered),
62495
62621
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", null, dropdownListModel.hintStringSuffix))) : null,
62496
62622
  valueElement,
62497
- react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("input", { type: "text", autoComplete: "off", id: this.question.getInputId(), ref: function (element) { return (_this.inputElement = element); }, className: this.question.cssClasses.filterStringInput, role: dropdownListModel.filterStringEnabled ? this.question.ariaRole : undefined, "aria-label": this.question.placeholder, "aria-expanded": this.question.ariaExpanded === null ? undefined : this.question.ariaExpanded === "true", "aria-controls": dropdownListModel.listElementId, "aria-activedescendant": dropdownListModel.ariaActivedescendant, placeholder: dropdownListModel.placeholderRendered, readOnly: !dropdownListModel.searchEnabled ? true : undefined, tabIndex: dropdownListModel.inputReadOnly ? undefined : -1, disabled: this.question.isInputReadOnly, inputMode: dropdownListModel.inputMode, onChange: function (e) { onInputChange(e); }, onBlur: this.blur, onFocus: this.focus })),
62623
+ react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("input", { type: "text", autoComplete: "off", id: this.question.getInputId(), ref: function (element) { return (_this.inputElement = element); }, className: this.question.cssClasses.filterStringInput, role: dropdownListModel.filterStringEnabled ? this.question.ariaRole : undefined, "aria-expanded": this.question.ariaExpanded === null ? undefined : this.question.ariaExpanded === "true", "aria-controls": dropdownListModel.listElementId, "aria-activedescendant": dropdownListModel.ariaActivedescendant, placeholder: dropdownListModel.placeholderRendered, readOnly: !dropdownListModel.searchEnabled ? true : undefined, tabIndex: dropdownListModel.inputReadOnly ? undefined : -1, disabled: this.question.isInputReadOnly, inputMode: dropdownListModel.inputMode, onChange: function (e) { onInputChange(e); }, onBlur: this.blur, onFocus: this.focus })),
62498
62624
  this.createClearButton()));
62499
62625
  };
62500
62626
  SurveyQuestionDropdownBase.prototype.createClearButton = function () {
@@ -64059,7 +64185,7 @@ var Survey = /** @class */ (function (_super) {
64059
64185
  renderResult = this.renderSurvey();
64060
64186
  }
64061
64187
  var backgroundImage = !!this.survey.backgroundImage ? react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.css.rootBackgroundImage, style: this.survey.backgroundImageStyle }) : null;
64062
- var header = this.survey.titleView === "title" ? react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_components_survey_header_survey_header__WEBPACK_IMPORTED_MODULE_5__["SurveyHeader"], { survey: this.survey }) : null;
64188
+ var header = this.survey.headerView === "basic" ? react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_components_survey_header_survey_header__WEBPACK_IMPORTED_MODULE_5__["SurveyHeader"], { survey: this.survey }) : null;
64063
64189
  var onSubmit = function (event) {
64064
64190
  event.preventDefault();
64065
64191
  };
@@ -64392,7 +64518,7 @@ var SurveyProgress = /** @class */ (function (_super) {
64392
64518
  width: this.progress + "%",
64393
64519
  };
64394
64520
  return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.survey.getProgressCssClasses(this.props.container) },
64395
- react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { style: progressStyle, className: this.css.progressBar, role: "progressbar", "aria-valuemin": 0, "aria-valuemax": 100 },
64521
+ react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { style: progressStyle, className: this.css.progressBar, role: "progressbar", "aria-valuemin": 0, "aria-valuemax": 100, "aria-label": "progress" },
64396
64522
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", { className: survey_core__WEBPACK_IMPORTED_MODULE_1__["SurveyProgressModel"].getProgressTextInBarCss(this.css) }, this.progressText)),
64397
64523
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", { className: survey_core__WEBPACK_IMPORTED_MODULE_1__["SurveyProgressModel"].getProgressTextUnderBarCss(this.css) }, this.progressText)));
64398
64524
  };
@@ -68921,7 +69047,7 @@ var TagboxFilterString = /** @class */ (function (_super) {
68921
69047
  (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.question.cssClasses.hintSuffix },
68922
69048
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", { style: { visibility: "hidden" }, "data-bind": "text: model.filterString" }, this.model.inputStringRendered),
68923
69049
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", null, this.model.hintStringSuffix))) : null,
68924
- react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("input", { type: "text", autoComplete: "off", id: this.question.getInputId(), inputMode: this.model.inputMode, ref: function (element) { return (_this.inputElement = element); }, className: this.question.cssClasses.filterStringInput, disabled: this.question.isInputReadOnly, readOnly: !this.model.searchEnabled ? true : undefined, size: !this.model.inputStringRendered ? 1 : undefined, role: this.model.filterStringEnabled ? this.question.ariaRole : undefined, "aria-label": this.question.placeholder, "aria-expanded": this.question.ariaExpanded === null ? undefined : this.question.ariaExpanded === "true", "aria-controls": this.model.listElementId, "aria-activedescendant": this.model.ariaActivedescendant, placeholder: this.model.filterStringPlaceholder, onKeyDown: function (e) { _this.keyhandler(e); }, onChange: function (e) { _this.onChange(e); }, onBlur: function (e) { _this.onBlur(e); }, onFocus: function (e) { _this.onFocus(e); } }))));
69050
+ react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("input", { type: "text", autoComplete: "off", id: this.question.getInputId(), inputMode: this.model.inputMode, ref: function (element) { return (_this.inputElement = element); }, className: this.question.cssClasses.filterStringInput, disabled: this.question.isInputReadOnly, readOnly: !this.model.searchEnabled ? true : undefined, size: !this.model.inputStringRendered ? 1 : undefined, role: this.model.filterStringEnabled ? this.question.ariaRole : undefined, "aria-expanded": this.question.ariaExpanded === null ? undefined : this.question.ariaExpanded === "true", "aria-controls": this.model.listElementId, "aria-activedescendant": this.model.ariaActivedescendant, placeholder: this.model.filterStringPlaceholder, onKeyDown: function (e) { _this.keyhandler(e); }, onChange: function (e) { _this.onChange(e); }, onBlur: function (e) { _this.onBlur(e); }, onFocus: function (e) { _this.onFocus(e); } }))));
68925
69051
  };
68926
69052
  return TagboxFilterString;
68927
69053
  }(_reactquestion_element__WEBPACK_IMPORTED_MODULE_3__["SurveyElementBase"]));
@@ -71312,7 +71438,9 @@ var SurveyElement = /** @class */ (function (_super) {
71312
71438
  Object.defineProperty(SurveyElement.prototype, "rootStyle", {
71313
71439
  get: function () {
71314
71440
  var style = {};
71315
- var minWidth = this.renderMinWidth ? this.minWidth : "min(100%, " + this.minWidth + ")";
71441
+ var minWidth = this.minWidth;
71442
+ if (minWidth != "auto")
71443
+ minWidth = "min(100%, " + this.minWidth + ")";
71316
71444
  if (this.allowRootStyle && this.renderWidth) {
71317
71445
  // style["width"] = this.renderWidth;
71318
71446
  style["flexGrow"] = 1;
@@ -71422,9 +71550,6 @@ var SurveyElement = /** @class */ (function (_super) {
71422
71550
  __decorate([
71423
71551
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])({ defaultValue: true })
71424
71552
  ], SurveyElement.prototype, "allowRootStyle", void 0);
71425
- __decorate([
71426
- Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])({ defaultValue: true })
71427
- ], SurveyElement.prototype, "renderMinWidth", void 0);
71428
71553
  return SurveyElement;
71429
71554
  }(SurveyElementCore));
71430
71555
 
@@ -71610,6 +71735,10 @@ var SurveyModel = /** @class */ (function (_super) {
71610
71735
  _this.valuesHash = {};
71611
71736
  _this.variablesHash = {};
71612
71737
  _this.onThemeApplying = new _base__WEBPACK_IMPORTED_MODULE_2__["EventBase"]();
71738
+ /**
71739
+ * An event that is raised after a [theme](/form-library/documentation/manage-default-themes-and-styles) is [applied](#applyTheme) to the survey.
71740
+ * @see applyTheme
71741
+ */
71613
71742
  _this.onThemeApplied = new _base__WEBPACK_IMPORTED_MODULE_2__["EventBase"]();
71614
71743
  //#region Event declarations
71615
71744
  /**
@@ -72201,10 +72330,12 @@ var SurveyModel = /** @class */ (function (_super) {
72201
72330
  * For information on event handler parameters, refer to descriptions within the interface.
72202
72331
  *
72203
72332
  * [View Demo](https://surveyjs.io/form-library/examples/survey-titleactions/ (linkStyle))
72333
+ * @see [IAction](https://surveyjs.io/form-library/documentation/api-reference/iaction)
72204
72334
  */
72205
72335
  _this.onGetQuestionTitleActions = _this.addEvent();
72206
72336
  /**
72207
72337
  * An event that allows you to add, delete, or modify actions in a panel title.
72338
+ * @see [IAction](https://surveyjs.io/form-library/documentation/api-reference/iaction)
72208
72339
  */
72209
72340
  _this.onGetPanelTitleActions = _this.addEvent();
72210
72341
  /**
@@ -72213,10 +72344,12 @@ var SurveyModel = /** @class */ (function (_super) {
72213
72344
  * For information on event handler parameters, refer to descriptions within the interface.
72214
72345
  *
72215
72346
  * [View Demo](https://surveyjs.io/form-library/examples/modify-titles-of-survey-elements/ (linkStyle))
72347
+ * @see [IAction](https://surveyjs.io/form-library/documentation/api-reference/iaction)
72216
72348
  */
72217
72349
  _this.onGetPageTitleActions = _this.addEvent();
72218
72350
  /**
72219
72351
  * An event that allows you to add, delete, or modify actions in the footer of a [Panel](https://surveyjs.io/form-library/documentation/panelmodel).
72352
+ * @see [IAction](https://surveyjs.io/form-library/documentation/api-reference/iaction)
72220
72353
  */
72221
72354
  _this.onGetPanelFooterActions = _this.addEvent();
72222
72355
  /**
@@ -72225,7 +72358,7 @@ var SurveyModel = /** @class */ (function (_super) {
72225
72358
  * For information on event handler parameters, refer to descriptions within the interface.
72226
72359
  *
72227
72360
  * [View Demo](https://surveyjs.io/form-library/examples/employee-information-form/ (linkStyle))
72228
- * @see IAction
72361
+ * @see [IAction](https://surveyjs.io/form-library/documentation/api-reference/iaction)
72229
72362
  */
72230
72363
  _this.onGetMatrixRowActions = _this.addEvent();
72231
72364
  /**
@@ -75261,10 +75394,12 @@ var SurveyModel = /** @class */ (function (_super) {
75261
75394
  }
75262
75395
  this.setPropertyValue("completedStateText", text);
75263
75396
  if (this.state === "completed" && this.showCompletedPage && !!this.completedState) {
75264
- this.notify(this.completedStateText, this.completedState);
75397
+ this.notify(this.completedStateText, this.completedState, true);
75265
75398
  }
75266
75399
  };
75267
- SurveyModel.prototype.notify = function (message, type) {
75400
+ SurveyModel.prototype.notify = function (message, type, showActions) {
75401
+ if (showActions === void 0) { showActions = false; }
75402
+ this.notifier.showActions = showActions;
75268
75403
  this.notifier.notify(message, type, type === "error");
75269
75404
  };
75270
75405
  /**
@@ -79404,12 +79539,19 @@ var SurveyModel = /** @class */ (function (_super) {
79404
79539
  SurveyModel.prototype.processPopupVisiblityChanged = function (question, popup, visible) {
79405
79540
  this.onPopupVisibleChanged.fire(this, { question: question, popup: popup, visible: visible });
79406
79541
  };
79542
+ /**
79543
+ * Applies a specified theme to the survey.
79544
+ *
79545
+ * [Themes & Styles](/form-library/documentation/manage-default-themes-and-styles (linkStyle))
79546
+ * @param theme An [`ITheme`](/form-library/documentation/api-reference/itheme) object with theme settings.
79547
+ * @see onThemeApplied
79548
+ */
79407
79549
  SurveyModel.prototype.applyTheme = function (theme) {
79408
79550
  var _this = this;
79409
79551
  if (!theme)
79410
79552
  return;
79411
79553
  Object.keys(theme).forEach(function (key) {
79412
- if (key === "cover") {
79554
+ if (key === "header") {
79413
79555
  _this.removeLayoutElement("cover");
79414
79556
  var newCoverModel = new _cover__WEBPACK_IMPORTED_MODULE_20__["Cover"]();
79415
79557
  newCoverModel.fromTheme(theme);
@@ -79502,8 +79644,8 @@ var SurveyModel = /** @class */ (function (_super) {
79502
79644
  __decorate([
79503
79645
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])({
79504
79646
  onSet: function (newValue, target) {
79505
- if (newValue === "cover") {
79506
- var layoutElement = target.layoutElements.filter(function (a) { return a.id === newValue; })[0];
79647
+ if (newValue === "advanced") {
79648
+ var layoutElement = target.layoutElements.filter(function (a) { return a.id === "cover"; })[0];
79507
79649
  if (!layoutElement) {
79508
79650
  var cover = new _cover__WEBPACK_IMPORTED_MODULE_20__["Cover"]();
79509
79651
  cover.logoPositionX = target.logoPosition === "right" ? "right" : "left";
@@ -79526,7 +79668,7 @@ var SurveyModel = /** @class */ (function (_super) {
79526
79668
  }
79527
79669
  }
79528
79670
  })
79529
- ], SurveyModel.prototype, "titleView", void 0);
79671
+ ], SurveyModel.prototype, "headerView", void 0);
79530
79672
  __decorate([
79531
79673
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])()
79532
79674
  ], SurveyModel.prototype, "showBrandInfo", void 0);
@@ -79599,7 +79741,7 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_1__["Serializer"].addClass("survey", [
79599
79741
  serializationProperty: "locDescription",
79600
79742
  dependsOn: "locale",
79601
79743
  },
79602
- { name: "logo", serializationProperty: "locLogo" },
79744
+ { name: "logo:file", serializationProperty: "locLogo" },
79603
79745
  { name: "logoWidth", default: "300px", minValue: 0 },
79604
79746
  { name: "logoHeight", default: "200px", minValue: 0 },
79605
79747
  {
@@ -79815,8 +79957,8 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_1__["Serializer"].addClass("survey", [
79815
79957
  },
79816
79958
  { name: "width", visibleIf: function (obj) { return obj.widthMode === "static"; } },
79817
79959
  { name: "fitToContainer:boolean", default: false },
79818
- { name: "titleView", default: "title", choices: ["title", "cover"], visible: false },
79819
- { name: "backgroundImage", visible: false },
79960
+ { name: "headerView", default: "basic", choices: ["basic", "advanced"], visible: false },
79961
+ { name: "backgroundImage:file", visible: false },
79820
79962
  { name: "backgroundImageFit", default: "cover", choices: ["auto", "contain", "cover"], visible: false },
79821
79963
  { name: "backgroundImageAttachment", default: "scroll", choices: ["scroll", "fixed"], visible: false },
79822
79964
  { name: "backgroundOpacity:number", minValue: 0, maxValue: 1, default: 1, visible: false },