survey-react-ui 1.9.139 → 1.10.1

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.
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - Survey JavaScript library v1.9.139
2
+ * surveyjs - Survey JavaScript library v1.10.1
3
3
  * Copyright (c) 2015-2024 Devsoft Baltic OÜ - http://surveyjs.io/
4
4
  * License: MIT (http://www.opensource.org/licenses/mit-license.php)
5
5
  */
@@ -1286,6 +1286,7 @@ var Base = /** @class */ (function () {
1286
1286
  */
1287
1287
  this.onItemValuePropertyChanged = this.addEvent();
1288
1288
  this.isCreating = true;
1289
+ this.animationAllowedLock = 0;
1289
1290
  this.bindingsValue = new Bindings(this);
1290
1291
  _jsonobject__WEBPACK_IMPORTED_MODULE_2__["CustomPropertiesCollection"].createProperties(this);
1291
1292
  this.onBaseCreating();
@@ -2206,6 +2207,22 @@ var Base = /** @class */ (function () {
2206
2207
  if (includeHidden === void 0) { includeHidden = false; }
2207
2208
  return [];
2208
2209
  };
2210
+ Object.defineProperty(Base.prototype, "animationAllowed", {
2211
+ get: function () {
2212
+ return this.getIsAnimationAllowed();
2213
+ },
2214
+ enumerable: false,
2215
+ configurable: true
2216
+ });
2217
+ Base.prototype.getIsAnimationAllowed = function () {
2218
+ return _settings__WEBPACK_IMPORTED_MODULE_3__["settings"].animationEnabled && this.animationAllowedLock >= 0 && !this.isLoadingFromJson && !this.isDisposed;
2219
+ };
2220
+ Base.prototype.blockAnimations = function () {
2221
+ this.animationAllowedLock--;
2222
+ };
2223
+ Base.prototype.releaseAnimations = function () {
2224
+ this.animationAllowedLock++;
2225
+ };
2209
2226
  Base.currentDependencis = undefined;
2210
2227
  return Base;
2211
2228
  }());
@@ -3608,7 +3625,7 @@ __webpack_require__.r(__webpack_exports__);
3608
3625
 
3609
3626
 
3610
3627
 
3611
- Object(survey_core__WEBPACK_IMPORTED_MODULE_2__["checkLibraryVersion"])("" + "1.9.139", "survey-react-ui");
3628
+ Object(survey_core__WEBPACK_IMPORTED_MODULE_2__["checkLibraryVersion"])("" + "1.10.1", "survey-react-ui");
3612
3629
 
3613
3630
 
3614
3631
  /***/ }),
@@ -11580,6 +11597,7 @@ var englishStrings = {
11580
11597
  savingData: "The results are being saved on the server...",
11581
11598
  savingDataError: "An error occurred and we could not save the results.",
11582
11599
  savingDataSuccess: "The results were saved successfully!",
11600
+ savingExceedSize: "Your response exceeds 64KB. Please reduce the size of your file(s) and try again or contact a survey owner.",
11583
11601
  saveAgainButton: "Try again",
11584
11602
  timerMin: "min",
11585
11603
  timerSec: "sec",
@@ -13441,6 +13459,7 @@ var MatrixRow = /** @class */ (function (_super) {
13441
13459
  __extends(MatrixRow, _super);
13442
13460
  function MatrixRow(props) {
13443
13461
  var _this = _super.call(this, props) || this;
13462
+ _this.root = react__WEBPACK_IMPORTED_MODULE_0___default.a.createRef();
13444
13463
  _this.onPointerDownHandler = function (event) {
13445
13464
  _this.parentMatrix.onPointerDown(event.nativeEvent, _this.model.row);
13446
13465
  };
@@ -13463,12 +13482,35 @@ var MatrixRow = /** @class */ (function (_super) {
13463
13482
  MatrixRow.prototype.getStateElement = function () {
13464
13483
  return this.model;
13465
13484
  };
13485
+ MatrixRow.prototype.componentDidMount = function () {
13486
+ _super.prototype.componentDidMount.call(this);
13487
+ if (this.root.current) {
13488
+ this.model.setRootElement(this.root.current);
13489
+ }
13490
+ };
13491
+ MatrixRow.prototype.componentWillUnmount = function () {
13492
+ _super.prototype.componentWillUnmount.call(this);
13493
+ this.model.setRootElement(undefined);
13494
+ };
13495
+ MatrixRow.prototype.shouldComponentUpdate = function (nextProps, nextState) {
13496
+ if (!_super.prototype.shouldComponentUpdate.call(this, nextProps, nextState))
13497
+ return false;
13498
+ if (nextProps.model !== this.model) {
13499
+ if (nextProps.element) {
13500
+ nextProps.element.setRootElement(this.root.current);
13501
+ }
13502
+ if (this.model) {
13503
+ this.model.setRootElement(undefined);
13504
+ }
13505
+ }
13506
+ return true;
13507
+ };
13466
13508
  MatrixRow.prototype.render = function () {
13467
13509
  var _this = this;
13468
13510
  var model = this.model;
13469
13511
  if (!model.visible)
13470
13512
  return null;
13471
- return (react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("tr", { className: model.className, "data-sv-drop-target-matrix-row": model.row && model.row.id, onPointerDown: function (event) { return _this.onPointerDownHandler(event); } }, this.props.children));
13513
+ return (react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("tr", { ref: this.root, className: model.className, "data-sv-drop-target-matrix-row": model.row && model.row.id, onPointerDown: function (event) { return _this.onPointerDownHandler(event); } }, this.props.children));
13472
13514
  };
13473
13515
  return MatrixRow;
13474
13516
  }(_reactquestion_element__WEBPACK_IMPORTED_MODULE_2__["SurveyElementBase"]));
@@ -13962,7 +14004,6 @@ var PopupContainer = /** @class */ (function (_super) {
13962
14004
  __extends(PopupContainer, _super);
13963
14005
  function PopupContainer(props) {
13964
14006
  var _this = _super.call(this, props) || this;
13965
- _this.prevIsVisible = false;
13966
14007
  _this.handleKeydown = function (event) {
13967
14008
  _this.model.onKeyDown(event);
13968
14009
  };
@@ -13983,10 +14024,9 @@ var PopupContainer = /** @class */ (function (_super) {
13983
14024
  };
13984
14025
  PopupContainer.prototype.componentDidUpdate = function (prevProps, prevState) {
13985
14026
  _super.prototype.componentDidUpdate.call(this, prevProps, prevState);
13986
- if (!this.prevIsVisible && this.model.isVisible) {
14027
+ if (!this.model.isPositionSet && this.model.isVisible) {
13987
14028
  this.model.updateOnShowing();
13988
14029
  }
13989
- this.prevIsVisible = this.model.isVisible;
13990
14030
  };
13991
14031
  PopupContainer.prototype.renderContainer = function (popupBaseViewModel) {
13992
14032
  var _this = this;
@@ -14194,7 +14234,7 @@ var RatingItemSmiley = /** @class */ (function (_super) {
14194
14234
  RatingItemSmiley.prototype.render = function () {
14195
14235
  var _this = this;
14196
14236
  return (react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", { onMouseDown: this.handleOnMouseDown, style: this.question.getItemStyle(this.item.itemValue, this.item.highlight), className: this.question.getItemClass(this.item.itemValue), onMouseOver: function (e) { return _this.question.onItemMouseIn(_this.item); }, onMouseOut: function (e) { return _this.question.onItemMouseOut(_this.item); } },
14197
- react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", { type: "radio", className: "sv-visuallyhidden", name: this.question.name, id: this.question.getInputId(this.index), value: this.item.value, disabled: this.isDisplayMode, checked: this.question.value == this.item.value, onClick: this.props.handleOnClick, onChange: function () { }, "aria-required": this.question.ariaRequired, "aria-label": this.question.ariaLabel, "aria-invalid": this.question.ariaInvalid, "aria-errormessage": this.question.ariaErrormessage }),
14237
+ react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", { type: "radio", className: "sv-visuallyhidden", name: this.question.questionName, id: this.question.getInputId(this.index), value: this.item.value, disabled: this.isDisplayMode, checked: this.question.value == this.item.value, onClick: this.props.handleOnClick, onChange: function () { }, "aria-required": this.question.ariaRequired, "aria-label": this.question.ariaLabel, "aria-invalid": this.question.ariaInvalid, "aria-errormessage": this.question.ariaErrormessage }),
14198
14238
  react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_svg_icon_svg_icon__WEBPACK_IMPORTED_MODULE_2__["SvgIcon"], { size: "auto", iconName: this.question.getItemSmileyIconName(this.item.itemValue), title: this.item.text })));
14199
14239
  };
14200
14240
  return RatingItemSmiley;
@@ -14249,7 +14289,7 @@ var RatingItemStar = /** @class */ (function (_super) {
14249
14289
  RatingItemStar.prototype.render = function () {
14250
14290
  var _this = this;
14251
14291
  return (react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", { onMouseDown: this.handleOnMouseDown, className: this.question.getItemClass(this.item.itemValue), onMouseOver: function (e) { return _this.question.onItemMouseIn(_this.item); }, onMouseOut: function (e) { return _this.question.onItemMouseOut(_this.item); } },
14252
- react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", { type: "radio", className: "sv-visuallyhidden", name: this.question.name, id: this.question.getInputId(this.index), value: this.item.value, disabled: this.isDisplayMode, checked: this.question.value == this.item.value, onClick: this.props.handleOnClick, onChange: function () { }, "aria-required": this.question.ariaRequired, "aria-label": this.question.ariaLabel, "aria-invalid": this.question.ariaInvalid, "aria-errormessage": this.question.ariaErrormessage }),
14292
+ react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", { type: "radio", className: "sv-visuallyhidden", name: this.question.questionName, id: this.question.getInputId(this.index), value: this.item.value, disabled: this.isDisplayMode, checked: this.question.value == this.item.value, onClick: this.props.handleOnClick, onChange: function () { }, "aria-required": this.question.ariaRequired, "aria-label": this.question.ariaLabel, "aria-invalid": this.question.ariaInvalid, "aria-errormessage": this.question.ariaErrormessage }),
14253
14293
  react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_svg_icon_svg_icon__WEBPACK_IMPORTED_MODULE_2__["SvgIcon"], { className: "sv-star", size: "auto", iconName: this.question.itemStarIcon, title: this.item.text }),
14254
14294
  react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_svg_icon_svg_icon__WEBPACK_IMPORTED_MODULE_2__["SvgIcon"], { className: "sv-star-2", size: "auto", iconName: this.question.itemStarIconAlt, title: this.item.text })));
14255
14295
  };
@@ -14341,7 +14381,7 @@ var RatingItem = /** @class */ (function (_super) {
14341
14381
  RatingItem.prototype.render = function () {
14342
14382
  var itemText = this.renderLocString(this.item.locText);
14343
14383
  return (react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", { onMouseDown: this.handleOnMouseDown, className: this.question.getItemClassByText(this.item.itemValue, this.item.text) },
14344
- react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", { type: "radio", className: "sv-visuallyhidden", name: this.question.name, id: this.question.getInputId(this.index), value: this.item.value, disabled: this.isDisplayMode, checked: this.question.value == this.item.value, onClick: this.props.handleOnClick, onChange: function () { }, "aria-required": this.question.ariaRequired, "aria-label": this.question.ariaLabel, "aria-invalid": this.question.ariaInvalid, "aria-errormessage": this.question.ariaErrormessage }),
14384
+ react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", { type: "radio", className: "sv-visuallyhidden", name: this.question.questionName, id: this.question.getInputId(this.index), value: this.item.value, disabled: this.isDisplayMode, checked: this.question.value == this.item.value, onClick: this.props.handleOnClick, onChange: function () { }, "aria-required": this.question.ariaRequired, "aria-label": this.question.ariaLabel, "aria-invalid": this.question.ariaInvalid, "aria-errormessage": this.question.ariaErrormessage }),
14345
14385
  react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", { className: this.question.cssClasses.itemText }, itemText)));
14346
14386
  };
14347
14387
  RatingItem.prototype.componentDidMount = function () {
@@ -15452,7 +15492,7 @@ var SurveyElementHeader = /** @class */ (function (_super) {
15452
15492
  var description = element.hasDescriptionUnderTitle
15453
15493
  ? _reactquestion_element__WEBPACK_IMPORTED_MODULE_3__["SurveyElementBase"].renderQuestionDescription(this.element)
15454
15494
  : null;
15455
- var additionalTitleToolbarElement = !!element.additionalTitleToolbar ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components_action_bar_action_bar__WEBPACK_IMPORTED_MODULE_1__["SurveyActionBar"], { model: element.additionalTitleToolbar }) : null;
15495
+ var additionalTitleToolbarElement = element.hasAdditionalTitleToolbar ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components_action_bar_action_bar__WEBPACK_IMPORTED_MODULE_1__["SurveyActionBar"], { model: element.additionalTitleToolbar }) : null;
15456
15496
  return (react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { className: element.cssHeader, onClick: function (e) { return element.clickTitleFunction && element.clickTitleFunction(e.nativeEvent); } },
15457
15497
  title,
15458
15498
  description,
@@ -19646,7 +19686,7 @@ var SurveyQuestionMatrixDropdownBase = /** @class */ (function (_super) {
19646
19686
  SurveyQuestionMatrixDropdownBase.prototype.renderRows = function () {
19647
19687
  var cssClasses = this.question.cssClasses;
19648
19688
  var rows = [];
19649
- var renderedRows = this.question.renderedTable.rows;
19689
+ var renderedRows = this.question.renderedTable.renderedRows;
19650
19690
  for (var i = 0; i < renderedRows.length; i++) {
19651
19691
  rows.push(this.renderRow(renderedRows[i].id, renderedRows[i], cssClasses));
19652
19692
  }
@@ -20231,19 +20271,11 @@ var SurveyQuestionPanelDynamic = /** @class */ (function (_super) {
20231
20271
  });
20232
20272
  };
20233
20273
  SurveyQuestionPanelDynamic.prototype.renderElement = function () {
20274
+ var _this = this;
20234
20275
  var panels = [];
20235
- if (this.question.isRenderModeList) {
20236
- for (var i = 0; i < this.question.visiblePanels.length; i++) {
20237
- var panel = this.question.visiblePanels[i];
20238
- panels.push(react__WEBPACK_IMPORTED_MODULE_0__["createElement"](SurveyQuestionPanelDynamicItem, { key: panel.id, element: panel, question: this.question, index: i, cssClasses: this.question.cssClasses, isDisplayMode: this.isDisplayMode, creator: this.creator }));
20239
- }
20240
- }
20241
- else {
20242
- if (this.question.currentPanel != null) {
20243
- var panel = this.question.currentPanel;
20244
- panels.push(react__WEBPACK_IMPORTED_MODULE_0__["createElement"](SurveyQuestionPanelDynamicItem, { key: this.question.currentIndex, element: panel, question: this.question, index: this.question.currentIndex, cssClasses: this.question.cssClasses, isDisplayMode: this.isDisplayMode, creator: this.creator }));
20245
- }
20246
- }
20276
+ this.question.renderedPanels.forEach(function (panel, index) {
20277
+ panels.push(react__WEBPACK_IMPORTED_MODULE_0__["createElement"](SurveyQuestionPanelDynamicItem, { key: panel.id, element: panel, question: _this.question, index: index, cssClasses: _this.question.cssClasses, isDisplayMode: _this.isDisplayMode, creator: _this.creator }));
20278
+ });
20247
20279
  var btnAdd = this.question.isRenderModeList && this.question["showLegacyNavigation"]
20248
20280
  ? this.renderAddRowButton()
20249
20281
  : null;
@@ -20253,13 +20285,12 @@ var SurveyQuestionPanelDynamic = /** @class */ (function (_super) {
20253
20285
  var navBottom = this.question.isProgressBottomShowing
20254
20286
  ? this.renderNavigator()
20255
20287
  : null;
20256
- var style = {};
20257
20288
  var navV2 = this.renderNavigatorV2();
20258
20289
  var noEntriesPlaceholder = this.renderPlaceholder();
20259
20290
  return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.question.cssClasses.root },
20260
20291
  noEntriesPlaceholder,
20261
20292
  navTop,
20262
- panels,
20293
+ react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.question.cssClasses.panelsContainer }, panels),
20263
20294
  navBottom,
20264
20295
  btnAdd,
20265
20296
  navV2));
@@ -20708,6 +20739,10 @@ var SurveyQuestionRanking = /** @class */ (function (_super) {
20708
20739
  event.persist();
20709
20740
  //event.preventDefault();
20710
20741
  _this.question.handlePointerDown.call(_this.question, event, item, event.currentTarget);
20742
+ }, function (event) {
20743
+ event.persist();
20744
+ //event.preventDefault();
20745
+ _this.question.handlePointerUp.call(_this.question, event, item, event.currentTarget);
20711
20746
  }, this_1.question.cssClasses, this_1.question.getItemClass(item), this_1.question, unrankedItem));
20712
20747
  };
20713
20748
  var this_1 = this;
@@ -20716,13 +20751,13 @@ var SurveyQuestionRanking = /** @class */ (function (_super) {
20716
20751
  }
20717
20752
  return items;
20718
20753
  };
20719
- SurveyQuestionRanking.prototype.renderItem = function (item, i, handleKeydown, handlePointerDown, cssClasses, itemClass, question, unrankedItem) {
20754
+ SurveyQuestionRanking.prototype.renderItem = function (item, i, handleKeydown, handlePointerDown, handlePointerUp, cssClasses, itemClass, question, unrankedItem) {
20720
20755
  var key = "id-" + item.renderedId;
20721
20756
  var text = this.renderLocString(item.locText);
20722
20757
  var index = i;
20723
20758
  var indexText = this.question.getNumberByIndex(index);
20724
20759
  var tabIndex = this.question.getItemTabIndex(item);
20725
- var renderedItem = (react__WEBPACK_IMPORTED_MODULE_0__["createElement"](SurveyQuestionRankingItem, { key: item.value, text: text, index: index, indexText: indexText, itemTabIndex: tabIndex, handleKeydown: handleKeydown, handlePointerDown: handlePointerDown, cssClasses: cssClasses, itemClass: itemClass, question: question, unrankedItem: unrankedItem, item: item }));
20760
+ var renderedItem = (react__WEBPACK_IMPORTED_MODULE_0__["createElement"](SurveyQuestionRankingItem, { key: item.value, text: text, index: index, indexText: indexText, itemTabIndex: tabIndex, handleKeydown: handleKeydown, handlePointerDown: handlePointerDown, handlePointerUp: handlePointerUp, cssClasses: cssClasses, itemClass: itemClass, question: question, unrankedItem: unrankedItem, item: item }));
20726
20761
  var survey = this.question.survey;
20727
20762
  var wrappedItem = null;
20728
20763
  if (!!survey) {
@@ -20773,6 +20808,13 @@ var SurveyQuestionRankingItem = /** @class */ (function (_super) {
20773
20808
  enumerable: false,
20774
20809
  configurable: true
20775
20810
  });
20811
+ Object.defineProperty(SurveyQuestionRankingItem.prototype, "handlePointerUp", {
20812
+ get: function () {
20813
+ return this.props.handlePointerUp;
20814
+ },
20815
+ enumerable: false,
20816
+ configurable: true
20817
+ });
20776
20818
  Object.defineProperty(SurveyQuestionRankingItem.prototype, "cssClasses", {
20777
20819
  get: function () {
20778
20820
  return this.props.cssClasses;
@@ -20820,7 +20862,7 @@ var SurveyQuestionRankingItem = /** @class */ (function (_super) {
20820
20862
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("use", { xlinkHref: this.question.dashSvgIcon })));
20821
20863
  };
20822
20864
  SurveyQuestionRankingItem.prototype.renderElement = function () {
20823
- return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { tabIndex: this.itemTabIndex, className: this.itemClass, onKeyDown: this.handleKeydown, onPointerDown: this.handlePointerDown, "data-sv-drop-target-ranking-item": this.index },
20865
+ return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { tabIndex: this.itemTabIndex, className: this.itemClass, onKeyDown: this.handleKeydown, onPointerDown: this.handlePointerDown, onPointerUp: this.handlePointerUp, "data-sv-drop-target-ranking-item": this.index },
20824
20866
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { tabIndex: -1, style: { outline: "none" } },
20825
20867
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.cssClasses.itemGhostNode }),
20826
20868
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.cssClasses.itemContent },
@@ -22922,7 +22964,6 @@ var SurveyElement = /** @class */ (function (_super) {
22922
22964
  }
22923
22965
  }
22924
22966
  }, function () { return _this.renderedIsExpanded; });
22925
- _this.animationAllowedValue = true;
22926
22967
  _this.name = name;
22927
22968
  _this.createNewArray("errors");
22928
22969
  _this.createNewArray("titleActions");
@@ -22958,7 +22999,7 @@ var SurveyElement = /** @class */ (function (_super) {
22958
22999
  var el = root.getElementById(elementId);
22959
23000
  return SurveyElement.ScrollElementToViewCore(el, false, scrollIfVisible);
22960
23001
  };
22961
- SurveyElement.ScrollElementToViewCore = function (el, checkLeft, scrollIfVisible) {
23002
+ SurveyElement.ScrollElementToViewCore = function (el, checkLeft, scrollIfVisible, scrollIntoViewOptions) {
22962
23003
  if (!el || !el.scrollIntoView)
22963
23004
  return false;
22964
23005
  var elTop = scrollIfVisible ? -1 : el.getBoundingClientRect().top;
@@ -22977,7 +23018,7 @@ var SurveyElement = /** @class */ (function (_super) {
22977
23018
  }
22978
23019
  }
22979
23020
  if (needScroll) {
22980
- el.scrollIntoView();
23021
+ el.scrollIntoView(scrollIntoViewOptions);
22981
23022
  }
22982
23023
  return needScroll;
22983
23024
  };
@@ -23961,6 +24002,13 @@ var SurveyElement = /** @class */ (function (_super) {
23961
24002
  this.toggleState();
23962
24003
  }
23963
24004
  };
24005
+ Object.defineProperty(SurveyElement.prototype, "hasAdditionalTitleToolbar", {
24006
+ get: function () {
24007
+ return false;
24008
+ },
24009
+ enumerable: false,
24010
+ configurable: true
24011
+ });
23964
24012
  Object.defineProperty(SurveyElement.prototype, "additionalTitleToolbar", {
23965
24013
  get: function () {
23966
24014
  return this.getAdditionalTitleToolbar();
@@ -23986,18 +24034,25 @@ var SurveyElement = /** @class */ (function (_super) {
23986
24034
  };
23987
24035
  Object.defineProperty(SurveyElement.prototype, "isDisabledStyle", {
23988
24036
  get: function () {
23989
- return !this.isDefaultV2Theme && (this.isReadOnlyStyle || this.isPreviewStyle);
24037
+ return this.getIsDisableAndReadOnlyStyles(false)[1];
23990
24038
  },
23991
24039
  enumerable: false,
23992
24040
  configurable: true
23993
24041
  });
23994
24042
  Object.defineProperty(SurveyElement.prototype, "isReadOnlyStyle", {
23995
24043
  get: function () {
23996
- return this.isReadOnly && !this.isPreviewStyle;
24044
+ return this.getIsDisableAndReadOnlyStyles(false)[0];
23997
24045
  },
23998
24046
  enumerable: false,
23999
24047
  configurable: true
24000
24048
  });
24049
+ SurveyElement.prototype.getIsDisableAndReadOnlyStyles = function (itemReadOnly) {
24050
+ var isPreview = this.isPreviewStyle;
24051
+ var isReadOnly = itemReadOnly || this.isReadOnly;
24052
+ var isReadOnlyStyle = isReadOnly && !isPreview;
24053
+ var isDisableStyle = !this.isDefaultV2Theme && (isReadOnly || isPreview);
24054
+ return [isReadOnlyStyle, isDisableStyle];
24055
+ };
24001
24056
  Object.defineProperty(SurveyElement.prototype, "isPreviewStyle", {
24002
24057
  get: function () {
24003
24058
  return !!this.survey && this.survey.state === "preview";
@@ -24064,12 +24119,12 @@ var SurveyElement = /** @class */ (function (_super) {
24064
24119
  if (cssClasses.content) {
24065
24120
  var selector = Object(_utils_utils__WEBPACK_IMPORTED_MODULE_8__["classesToSelector"])(cssClasses.content);
24066
24121
  if (selector) {
24067
- return (_a = _this.getWrapperElement()) === null || _a === void 0 ? void 0 : _a.querySelector(selector);
24122
+ return (_a = _this.getWrapperElement()) === null || _a === void 0 ? void 0 : _a.querySelector(":scope " + selector);
24068
24123
  }
24069
24124
  }
24070
24125
  return undefined;
24071
24126
  },
24072
- isAnimationEnabled: function () { return _settings__WEBPACK_IMPORTED_MODULE_4__["settings"].animationEnabled && _this.animationAllowed && !_this.isDesignMode; }
24127
+ isAnimationEnabled: function () { return _this.animationAllowed && !_this.isDesignMode; }
24073
24128
  };
24074
24129
  };
24075
24130
  Object.defineProperty(SurveyElement.prototype, "renderedIsExpanded", {
@@ -24082,16 +24137,9 @@ var SurveyElement = /** @class */ (function (_super) {
24082
24137
  enumerable: false,
24083
24138
  configurable: true
24084
24139
  });
24085
- Object.defineProperty(SurveyElement.prototype, "animationAllowed", {
24086
- get: function () {
24087
- return !this.isLoadingFromJson && !this.isDisposed && !!this.survey && this.animationAllowedValue;
24088
- },
24089
- set: function (val) {
24090
- this.animationAllowedValue = val;
24091
- },
24092
- enumerable: false,
24093
- configurable: true
24094
- });
24140
+ SurveyElement.prototype.getIsAnimationAllowed = function () {
24141
+ return _super.prototype.getIsAnimationAllowed.call(this) && !!this.survey;
24142
+ };
24095
24143
  SurveyElement.prototype.dispose = function () {
24096
24144
  _super.prototype.dispose.call(this);
24097
24145
  if (this.titleToolbarValue) {
@@ -24240,7 +24288,7 @@ surveyLocalization.localeNames["en"] = "english";
24240
24288
  /*!********************************!*\
24241
24289
  !*** ./src/utils/animation.ts ***!
24242
24290
  \********************************/
24243
- /*! exports provided: AnimationUtils, AnimationPropertyUtils, AnimationGroupUtils, AnimationBoolean, AnimationGroup */
24291
+ /*! exports provided: AnimationUtils, AnimationPropertyUtils, AnimationGroupUtils, AnimationProperty, AnimationBoolean, AnimationGroup, AnimationTab */
24244
24292
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
24245
24293
 
24246
24294
  "use strict";
@@ -24248,8 +24296,10 @@ __webpack_require__.r(__webpack_exports__);
24248
24296
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AnimationUtils", function() { return AnimationUtils; });
24249
24297
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AnimationPropertyUtils", function() { return AnimationPropertyUtils; });
24250
24298
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AnimationGroupUtils", function() { return AnimationGroupUtils; });
24299
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AnimationProperty", function() { return AnimationProperty; });
24251
24300
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AnimationBoolean", function() { return AnimationBoolean; });
24252
24301
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AnimationGroup", function() { return AnimationGroup; });
24302
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AnimationTab", function() { return AnimationTab; });
24253
24303
  /* harmony import */ var _global_variables_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../global_variables_utils */ "./src/global_variables_utils.ts");
24254
24304
  /* harmony import */ var _taskmanager__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./taskmanager */ "./src/utils/taskmanager.ts");
24255
24305
  var __extends = (undefined && undefined.__extends) || (function () {
@@ -24278,6 +24328,9 @@ var AnimationUtils = /** @class */ (function () {
24278
24328
  return 0;
24279
24329
  return Number(value.slice(0, -1).replace(",", ".")) * 1000;
24280
24330
  };
24331
+ AnimationUtils.prototype.reflow = function (element) {
24332
+ return element.offsetHeight;
24333
+ };
24281
24334
  AnimationUtils.prototype.getAnimationsCount = function (element) {
24282
24335
  var animationName = "";
24283
24336
  if (getComputedStyle) {
@@ -24295,6 +24348,14 @@ var AnimationUtils = /** @class */ (function () {
24295
24348
  }
24296
24349
  return duration;
24297
24350
  };
24351
+ AnimationUtils.prototype.addCancelCallback = function (callback) {
24352
+ this.cancelQueue.push(callback);
24353
+ };
24354
+ AnimationUtils.prototype.removeCancelCallback = function (callback) {
24355
+ if (this.cancelQueue.indexOf(callback) >= 0) {
24356
+ this.cancelQueue.splice(this.cancelQueue.indexOf(callback), 1);
24357
+ }
24358
+ };
24298
24359
  AnimationUtils.prototype.onAnimationEnd = function (element, callback, options) {
24299
24360
  var _this = this;
24300
24361
  var cancelTimeout;
@@ -24304,7 +24365,7 @@ var AnimationUtils = /** @class */ (function () {
24304
24365
  options.onAfterRunAnimation && options.onAfterRunAnimation(element);
24305
24366
  callback(isCancel);
24306
24367
  clearTimeout(cancelTimeout);
24307
- _this.cancelQueue.splice(_this.cancelQueue.indexOf(onEndCallback), 1);
24368
+ _this.removeCancelCallback(onEndCallback);
24308
24369
  element.removeEventListener("animationend", onAnimationEndCallback);
24309
24370
  };
24310
24371
  var onAnimationEndCallback = function (event) {
@@ -24314,7 +24375,7 @@ var AnimationUtils = /** @class */ (function () {
24314
24375
  };
24315
24376
  if (animationsCount > 0) {
24316
24377
  element.addEventListener("animationend", onAnimationEndCallback);
24317
- this.cancelQueue.push(onEndCallback);
24378
+ this.addCancelCallback(onEndCallback);
24318
24379
  cancelTimeout = setTimeout(function () {
24319
24380
  onEndCallback(false);
24320
24381
  }, this.getAnimationDuration(element) + 10);
@@ -24324,40 +24385,51 @@ var AnimationUtils = /** @class */ (function () {
24324
24385
  }
24325
24386
  };
24326
24387
  AnimationUtils.prototype.beforeAnimationRun = function (element, options) {
24327
- if (element) {
24388
+ if (element && options) {
24328
24389
  options.onBeforeRunAnimation && options.onBeforeRunAnimation(element);
24329
24390
  }
24330
24391
  };
24331
- AnimationUtils.prototype.runLeaveAnimation = function (element, options, callback) {
24392
+ AnimationUtils.prototype.runAnimation = function (element, options, callback) {
24332
24393
  if (element && options.cssClass) {
24394
+ this.reflow(element);
24333
24395
  element.classList.add(options.cssClass);
24334
- var onAnimationEndCallback = function (isCancel) {
24396
+ this.onAnimationEnd(element, callback, options);
24397
+ }
24398
+ else {
24399
+ callback(true);
24400
+ }
24401
+ };
24402
+ AnimationUtils.prototype.clearHtmlElement = function (element, options) {
24403
+ if (element && options.cssClass) {
24404
+ element.classList.remove(options.cssClass);
24405
+ }
24406
+ };
24407
+ AnimationUtils.prototype.onNextRender = function (callback, runEarly, isCancel) {
24408
+ var _this = this;
24409
+ if (isCancel === void 0) { isCancel = false; }
24410
+ if (!isCancel && _global_variables_utils__WEBPACK_IMPORTED_MODULE_0__["DomWindowHelper"].isAvailable()) {
24411
+ var cancelCallback_1 = function () {
24335
24412
  callback();
24336
- if (isCancel) {
24337
- element.classList.remove(options.cssClass);
24413
+ cancelAnimationFrame(latestRAF_1);
24414
+ };
24415
+ var latestRAF_1 = _global_variables_utils__WEBPACK_IMPORTED_MODULE_0__["DomWindowHelper"].requestAnimationFrame(function () {
24416
+ if (runEarly && runEarly()) {
24417
+ callback();
24418
+ _this.removeCancelCallback(cancelCallback_1);
24338
24419
  }
24339
24420
  else {
24340
- _global_variables_utils__WEBPACK_IMPORTED_MODULE_0__["DomWindowHelper"].requestAnimationFrame(function () {
24341
- _global_variables_utils__WEBPACK_IMPORTED_MODULE_0__["DomWindowHelper"].requestAnimationFrame(function () {
24342
- element.classList.remove(options.cssClass);
24343
- });
24421
+ latestRAF_1 = _global_variables_utils__WEBPACK_IMPORTED_MODULE_0__["DomWindowHelper"].requestAnimationFrame(function () {
24422
+ callback();
24423
+ _this.removeCancelCallback(cancelCallback_1);
24344
24424
  });
24345
24425
  }
24346
- };
24347
- this.onAnimationEnd(element, onAnimationEndCallback, options);
24426
+ });
24427
+ this.addCancelCallback(cancelCallback_1);
24348
24428
  }
24349
24429
  else {
24350
24430
  callback();
24351
24431
  }
24352
24432
  };
24353
- AnimationUtils.prototype.runEnterAnimation = function (element, options) {
24354
- if (element && options.cssClass) {
24355
- element.classList.add(options.cssClass);
24356
- this.onAnimationEnd(element, function () {
24357
- element.classList.remove(options.cssClass);
24358
- }, options);
24359
- }
24360
- };
24361
24433
  AnimationUtils.prototype.cancel = function () {
24362
24434
  var cancelQueue = [].concat(this.cancelQueue);
24363
24435
  cancelQueue.forEach(function (callback) { return callback(); });
@@ -24371,26 +24443,28 @@ var AnimationPropertyUtils = /** @class */ (function (_super) {
24371
24443
  function AnimationPropertyUtils() {
24372
24444
  return _super !== null && _super.apply(this, arguments) || this;
24373
24445
  }
24374
- AnimationPropertyUtils.prototype.onEnter = function (getElement, options) {
24446
+ AnimationPropertyUtils.prototype.onEnter = function (options) {
24375
24447
  var _this = this;
24376
- var callback = function () {
24377
- var element = getElement();
24378
- _this.beforeAnimationRun(element, options);
24379
- _this.runEnterAnimation(element, options);
24380
- };
24381
- _global_variables_utils__WEBPACK_IMPORTED_MODULE_0__["DomWindowHelper"].requestAnimationFrame(function () {
24382
- if (getElement()) {
24383
- callback();
24384
- }
24385
- else {
24386
- _global_variables_utils__WEBPACK_IMPORTED_MODULE_0__["DomWindowHelper"].requestAnimationFrame(callback);
24387
- }
24388
- });
24448
+ this.onNextRender(function () {
24449
+ var htmlElement = options.getAnimatedElement();
24450
+ var enterOptions = options.getEnterOptions();
24451
+ _this.beforeAnimationRun(htmlElement, enterOptions);
24452
+ _this.runAnimation(htmlElement, enterOptions, function () {
24453
+ _this.clearHtmlElement(htmlElement, enterOptions);
24454
+ });
24455
+ }, function () { return !!options.getAnimatedElement(); });
24389
24456
  };
24390
- AnimationPropertyUtils.prototype.onLeave = function (getElement, callback, options) {
24391
- var element = getElement();
24392
- this.beforeAnimationRun(element, options);
24393
- this.runLeaveAnimation(element, options, callback);
24457
+ AnimationPropertyUtils.prototype.onLeave = function (options, callback) {
24458
+ var _this = this;
24459
+ var htmlElement = options.getAnimatedElement();
24460
+ var leaveOptions = options.getLeaveOptions();
24461
+ this.beforeAnimationRun(htmlElement, leaveOptions);
24462
+ this.runAnimation(htmlElement, leaveOptions, function (isCancel) {
24463
+ callback();
24464
+ _this.onNextRender(function () {
24465
+ _this.clearHtmlElement(htmlElement, leaveOptions);
24466
+ }, undefined, isCancel);
24467
+ });
24394
24468
  };
24395
24469
  return AnimationPropertyUtils;
24396
24470
  }(AnimationUtils));
@@ -24400,41 +24474,40 @@ var AnimationGroupUtils = /** @class */ (function (_super) {
24400
24474
  function AnimationGroupUtils() {
24401
24475
  return _super !== null && _super.apply(this, arguments) || this;
24402
24476
  }
24403
- AnimationGroupUtils.prototype.onEnter = function (getElement, getOptions, elements) {
24477
+ AnimationGroupUtils.prototype.runGroupAnimation = function (options, addedElements, removedElements, callback) {
24404
24478
  var _this = this;
24405
- if (elements.length == 0)
24406
- return;
24407
- _global_variables_utils__WEBPACK_IMPORTED_MODULE_0__["DomWindowHelper"].requestAnimationFrame(function () {
24408
- var callback = function () {
24409
- elements.forEach(function (el) {
24410
- _this.beforeAnimationRun(getElement(el), getOptions(el));
24411
- });
24412
- elements.forEach(function (el) {
24413
- _this.runEnterAnimation(getElement(el), getOptions(el));
24414
- });
24479
+ this.onNextRender(function () {
24480
+ var addedHtmlElements = addedElements.map(function (el) { return options.getAnimatedElement(el); });
24481
+ var enterOptions = addedElements.map(function (el) { return options.getEnterOptions(el); });
24482
+ var removedHtmlElements = removedElements.map(function (el) { return options.getAnimatedElement(el); });
24483
+ var leaveOptions = removedElements.map(function (el) { return options.getLeaveOptions(el); });
24484
+ addedElements.forEach(function (_, i) {
24485
+ _this.beforeAnimationRun(addedHtmlElements[i], enterOptions[i]);
24486
+ });
24487
+ removedElements.forEach(function (_, i) {
24488
+ _this.beforeAnimationRun(removedHtmlElements[i], leaveOptions[i]);
24489
+ });
24490
+ var counter = addedElements.length + removedElements.length;
24491
+ var onAnimationEndCallback = function (isCancel) {
24492
+ if (--counter <= 0) {
24493
+ callback && callback();
24494
+ _this.onNextRender(function () {
24495
+ addedElements.forEach(function (_, i) {
24496
+ _this.clearHtmlElement(addedHtmlElements[i], enterOptions[i]);
24497
+ });
24498
+ removedElements.forEach(function (_, i) {
24499
+ _this.clearHtmlElement(removedHtmlElements[i], leaveOptions[i]);
24500
+ });
24501
+ }, undefined, isCancel);
24502
+ }
24415
24503
  };
24416
- if (!getElement(elements[0])) {
24417
- _global_variables_utils__WEBPACK_IMPORTED_MODULE_0__["DomWindowHelper"].requestAnimationFrame(callback);
24418
- }
24419
- else {
24420
- callback();
24421
- }
24422
- });
24423
- };
24424
- AnimationGroupUtils.prototype.onLeave = function (getElement, callback, getOptions, elements) {
24425
- var _this = this;
24426
- elements.forEach(function (el) {
24427
- _this.beforeAnimationRun(getElement(el), getOptions(el));
24428
- });
24429
- var counter = elements.length;
24430
- var onEndCallback = function () {
24431
- if (--counter <= 0) {
24432
- callback();
24433
- }
24434
- };
24435
- elements.forEach(function (el) {
24436
- _this.runLeaveAnimation(getElement(el), getOptions(el), onEndCallback);
24437
- });
24504
+ addedElements.forEach(function (_, i) {
24505
+ _this.runAnimation(addedHtmlElements[i], enterOptions[i], onAnimationEndCallback);
24506
+ });
24507
+ removedElements.forEach(function (_, i) {
24508
+ _this.runAnimation(removedHtmlElements[i], leaveOptions[i], onAnimationEndCallback);
24509
+ });
24510
+ }, function () { return addedElements.length == 0 || addedElements.some(function (el) { return !!options.getAnimatedElement(el); }); });
24438
24511
  };
24439
24512
  return AnimationGroupUtils;
24440
24513
  }(AnimationUtils));
@@ -24455,6 +24528,7 @@ var AnimationProperty = /** @class */ (function () {
24455
24528
  this._debouncedSync.run(newValue);
24456
24529
  }
24457
24530
  else {
24531
+ this.cancel();
24458
24532
  this.update(newValue);
24459
24533
  }
24460
24534
  };
@@ -24464,6 +24538,7 @@ var AnimationProperty = /** @class */ (function () {
24464
24538
  };
24465
24539
  return AnimationProperty;
24466
24540
  }());
24541
+
24467
24542
  var AnimationBoolean = /** @class */ (function (_super) {
24468
24543
  __extends(AnimationBoolean, _super);
24469
24544
  function AnimationBoolean() {
@@ -24476,12 +24551,12 @@ var AnimationBoolean = /** @class */ (function (_super) {
24476
24551
  if (newValue !== this.getCurrentValue()) {
24477
24552
  if (newValue) {
24478
24553
  this.update(newValue);
24479
- this.animation.onEnter(function () { return _this.animationOptions.getAnimatedElement(); }, this.animationOptions.getEnterOptions());
24554
+ this.animation.onEnter(this.animationOptions);
24480
24555
  }
24481
24556
  else {
24482
- this.animation.onLeave(function () { return _this.animationOptions.getAnimatedElement(); }, function () {
24557
+ this.animation.onLeave(this.animationOptions, function () {
24483
24558
  _this.update(newValue);
24484
- }, this.animationOptions.getLeaveOptions());
24559
+ });
24485
24560
  }
24486
24561
  }
24487
24562
  else {
@@ -24503,19 +24578,42 @@ var AnimationGroup = /** @class */ (function (_super) {
24503
24578
  var oldValue = this.getCurrentValue();
24504
24579
  var itemsToAdd = newValue.filter(function (el) { return oldValue.indexOf(el) < 0; });
24505
24580
  var deletedItems = oldValue.filter(function (el) { return newValue.indexOf(el) < 0; });
24506
- this.animation.onEnter(function (el) { return _this.animationOptions.getAnimatedElement(el); }, function (el) { return _this.animationOptions.getEnterOptions(el); }, itemsToAdd);
24507
24581
  if (itemsToAdd.length == 0 && (deletedItems === null || deletedItems === void 0 ? void 0 : deletedItems.length) > 0) {
24508
- this.animation.onLeave(function (el) { return _this.animationOptions.getAnimatedElement(el); }, function () {
24509
- _this.update(newValue);
24510
- }, function (el) { return _this.animationOptions.getLeaveOptions(el); }, deletedItems);
24582
+ this.animation.runGroupAnimation(this.animationOptions, [], deletedItems, function () { return _this.update(newValue); });
24511
24583
  }
24512
24584
  else {
24513
24585
  this.update(newValue);
24586
+ this.animation.runGroupAnimation(this.animationOptions, itemsToAdd, []);
24514
24587
  }
24515
24588
  };
24516
24589
  return AnimationGroup;
24517
24590
  }(AnimationProperty));
24518
24591
 
24592
+ var AnimationTab = /** @class */ (function (_super) {
24593
+ __extends(AnimationTab, _super);
24594
+ function AnimationTab(animationOptions, update, getCurrentValue, mergeValues) {
24595
+ var _this = _super.call(this, animationOptions, update, getCurrentValue) || this;
24596
+ _this.mergeValues = mergeValues;
24597
+ _this.animation = new AnimationGroupUtils();
24598
+ return _this;
24599
+ }
24600
+ AnimationTab.prototype._sync = function (newValue) {
24601
+ var _this = this;
24602
+ var oldValue = [].concat(this.getCurrentValue());
24603
+ if (oldValue[0] !== newValue[0]) {
24604
+ var tempValue = !!this.mergeValues ? this.mergeValues(newValue, oldValue) : [].concat(oldValue, newValue);
24605
+ this.update(tempValue, true);
24606
+ this.animation.runGroupAnimation(this.animationOptions, newValue, oldValue, function () {
24607
+ _this.update(newValue);
24608
+ });
24609
+ }
24610
+ else {
24611
+ this.update(newValue);
24612
+ }
24613
+ };
24614
+ return AnimationTab;
24615
+ }(AnimationProperty));
24616
+
24519
24617
 
24520
24618
 
24521
24619
  /***/ }),