survey-core 1.10.6 → 1.11.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.
Files changed (279) hide show
  1. package/defaultV2.css +131 -17
  2. package/defaultV2.css.map +1 -1
  3. package/defaultV2.fontless.css +131 -17
  4. package/defaultV2.fontless.css.map +1 -1
  5. package/defaultV2.fontless.min.css +2 -2
  6. package/defaultV2.min.css +2 -2
  7. package/i18n/arabic.js +1 -1
  8. package/i18n/arabic.min.js +1 -1
  9. package/i18n/basque.js +1 -1
  10. package/i18n/basque.min.js +1 -1
  11. package/i18n/bulgarian.js +1 -1
  12. package/i18n/bulgarian.min.js +1 -1
  13. package/i18n/catalan.js +1 -1
  14. package/i18n/catalan.min.js +1 -1
  15. package/i18n/croatian.js +1 -1
  16. package/i18n/croatian.min.js +1 -1
  17. package/i18n/czech.js +1 -1
  18. package/i18n/czech.min.js +1 -1
  19. package/i18n/danish.js +1 -1
  20. package/i18n/danish.min.js +1 -1
  21. package/i18n/dutch.js +1 -1
  22. package/i18n/dutch.min.js +1 -1
  23. package/i18n/english.js +1 -1
  24. package/i18n/english.min.js +1 -1
  25. package/i18n/estonian.js +1 -1
  26. package/i18n/estonian.min.js +1 -1
  27. package/i18n/finnish.js +1 -1
  28. package/i18n/finnish.min.js +1 -1
  29. package/i18n/french.js +1 -1
  30. package/i18n/french.min.js +1 -1
  31. package/i18n/georgian.js +1 -1
  32. package/i18n/georgian.min.js +1 -1
  33. package/i18n/german.js +1 -1
  34. package/i18n/german.min.js +1 -1
  35. package/i18n/greek.js +1 -1
  36. package/i18n/greek.min.js +1 -1
  37. package/i18n/hebrew.js +1 -1
  38. package/i18n/hebrew.min.js +1 -1
  39. package/i18n/hindi.js +1 -1
  40. package/i18n/hindi.min.js +1 -1
  41. package/i18n/hungarian.js +1 -1
  42. package/i18n/hungarian.min.js +1 -1
  43. package/i18n/icelandic.js +1 -1
  44. package/i18n/icelandic.min.js +1 -1
  45. package/i18n/index.js +1 -1
  46. package/i18n/index.min.js +1 -1
  47. package/i18n/indonesian.js +1 -1
  48. package/i18n/indonesian.min.js +1 -1
  49. package/i18n/italian.js +1 -1
  50. package/i18n/italian.min.js +1 -1
  51. package/i18n/japanese.js +1 -1
  52. package/i18n/japanese.min.js +1 -1
  53. package/i18n/kazakh.js +1 -1
  54. package/i18n/kazakh.min.js +1 -1
  55. package/i18n/korean.js +1 -1
  56. package/i18n/korean.min.js +1 -1
  57. package/i18n/latvian.js +1 -1
  58. package/i18n/latvian.min.js +1 -1
  59. package/i18n/lithuanian.js +1 -1
  60. package/i18n/lithuanian.min.js +1 -1
  61. package/i18n/macedonian.js +1 -1
  62. package/i18n/macedonian.min.js +1 -1
  63. package/i18n/malay.js +1 -1
  64. package/i18n/malay.min.js +1 -1
  65. package/i18n/nl-BE.js +1 -1
  66. package/i18n/nl-BE.min.js +1 -1
  67. package/i18n/norwegian.js +1 -1
  68. package/i18n/norwegian.min.js +1 -1
  69. package/i18n/persian.js +1 -1
  70. package/i18n/persian.min.js +1 -1
  71. package/i18n/philippines.js +1 -1
  72. package/i18n/philippines.min.js +1 -1
  73. package/i18n/polish.js +1 -1
  74. package/i18n/polish.min.js +1 -1
  75. package/i18n/portuguese-br.js +1 -1
  76. package/i18n/portuguese-br.min.js +1 -1
  77. package/i18n/portuguese.js +1 -1
  78. package/i18n/portuguese.min.js +1 -1
  79. package/i18n/romanian.js +1 -1
  80. package/i18n/romanian.min.js +1 -1
  81. package/i18n/russian.js +1 -1
  82. package/i18n/russian.min.js +1 -1
  83. package/i18n/serbian.js +1 -1
  84. package/i18n/serbian.min.js +1 -1
  85. package/i18n/simplified-chinese.js +1 -1
  86. package/i18n/simplified-chinese.min.js +1 -1
  87. package/i18n/slovak.js +1 -1
  88. package/i18n/slovak.min.js +1 -1
  89. package/i18n/spanish.js +1 -1
  90. package/i18n/spanish.min.js +1 -1
  91. package/i18n/swahili.js +1 -1
  92. package/i18n/swahili.min.js +1 -1
  93. package/i18n/swedish.js +1 -1
  94. package/i18n/swedish.min.js +1 -1
  95. package/i18n/tajik.js +1 -1
  96. package/i18n/tajik.min.js +1 -1
  97. package/i18n/telugu.js +1 -1
  98. package/i18n/telugu.min.js +1 -1
  99. package/i18n/thai.js +1 -1
  100. package/i18n/thai.min.js +1 -1
  101. package/i18n/traditional-chinese.js +1 -1
  102. package/i18n/traditional-chinese.min.js +1 -1
  103. package/i18n/turkish.js +1 -1
  104. package/i18n/turkish.min.js +1 -1
  105. package/i18n/ukrainian.js +1 -1
  106. package/i18n/ukrainian.min.js +1 -1
  107. package/i18n/urdu.js +1 -1
  108. package/i18n/urdu.min.js +1 -1
  109. package/i18n/vietnamese.js +1 -1
  110. package/i18n/vietnamese.min.js +1 -1
  111. package/i18n/welsh.js +1 -1
  112. package/i18n/welsh.min.js +1 -1
  113. package/modern.css +77 -9
  114. package/modern.css.map +1 -1
  115. package/modern.fontless.css +77 -9
  116. package/modern.fontless.css.map +1 -1
  117. package/modern.fontless.min.css +2 -2
  118. package/modern.min.css +2 -2
  119. package/package.json +1 -1
  120. package/plugins/bootstrap-integration.js +1 -1
  121. package/plugins/bootstrap-integration.min.js +1 -1
  122. package/plugins/bootstrap-material-integration.js +1 -1
  123. package/plugins/bootstrap-material-integration.min.js +1 -1
  124. package/survey.core.js +1030 -426
  125. package/survey.core.js.map +1 -1
  126. package/survey.core.min.js +3 -3
  127. package/survey.css +17 -1
  128. package/survey.css.map +1 -1
  129. package/survey.i18n.js +1 -1
  130. package/survey.i18n.min.js +1 -1
  131. package/survey.min.css +2 -2
  132. package/themes/borderless-dark-panelless.js +1 -1
  133. package/themes/borderless-dark-panelless.min.js +1 -1
  134. package/themes/borderless-dark.js +1 -1
  135. package/themes/borderless-dark.min.js +1 -1
  136. package/themes/borderless-light-panelless..js +1 -1
  137. package/themes/borderless-light-panelless..min.js +1 -1
  138. package/themes/borderless-light.js +1 -1
  139. package/themes/borderless-light.min.js +1 -1
  140. package/themes/contrast-dark-panelless.js +1 -1
  141. package/themes/contrast-dark-panelless.min.js +1 -1
  142. package/themes/contrast-dark.js +1 -1
  143. package/themes/contrast-dark.min.js +1 -1
  144. package/themes/contrast-light-panelless.js +1 -1
  145. package/themes/contrast-light-panelless.min.js +1 -1
  146. package/themes/contrast-light.js +1 -1
  147. package/themes/contrast-light.min.js +1 -1
  148. package/themes/default-dark-panelless.js +1 -1
  149. package/themes/default-dark-panelless.min.js +1 -1
  150. package/themes/default-dark.js +1 -1
  151. package/themes/default-dark.min.js +1 -1
  152. package/themes/default-light-panelless.js +1 -1
  153. package/themes/default-light-panelless.min.js +1 -1
  154. package/themes/default-light.js +1 -1
  155. package/themes/default-light.min.js +1 -1
  156. package/themes/doubleborder-dark-panelless.js +1 -1
  157. package/themes/doubleborder-dark-panelless.min.js +1 -1
  158. package/themes/doubleborder-dark.js +1 -1
  159. package/themes/doubleborder-dark.min.js +1 -1
  160. package/themes/doubleborder-light-panelles.js +1 -1
  161. package/themes/doubleborder-light-panelles.min.js +1 -1
  162. package/themes/doubleborder-light.js +1 -1
  163. package/themes/doubleborder-light.min.js +1 -1
  164. package/themes/flat-dark-panelless.js +1 -1
  165. package/themes/flat-dark-panelless.min.js +1 -1
  166. package/themes/flat-dark.js +1 -1
  167. package/themes/flat-dark.min.js +1 -1
  168. package/themes/flat-light-panelless.js +1 -1
  169. package/themes/flat-light-panelless.min.js +1 -1
  170. package/themes/flat-light.js +1 -1
  171. package/themes/flat-light.min.js +1 -1
  172. package/themes/index.js +1 -1
  173. package/themes/index.min.js +1 -1
  174. package/themes/layered-dark-panelless.js +1 -1
  175. package/themes/layered-dark-panelless.min.js +1 -1
  176. package/themes/layered-dark.js +1 -1
  177. package/themes/layered-dark.min.js +1 -1
  178. package/themes/layered-light-panelless.js +1 -1
  179. package/themes/layered-light-panelless.min.js +1 -1
  180. package/themes/layered-light.js +1 -1
  181. package/themes/layered-light.min.js +1 -1
  182. package/themes/plain-dark-panelless.js +1 -1
  183. package/themes/plain-dark-panelless.min.js +1 -1
  184. package/themes/plain-dark.js +1 -1
  185. package/themes/plain-dark.min.js +1 -1
  186. package/themes/plain-light-panelless.js +1 -1
  187. package/themes/plain-light-panelless.min.js +1 -1
  188. package/themes/plain-light.js +1 -1
  189. package/themes/plain-light.min.js +1 -1
  190. package/themes/sharp-dark-panelless.js +1 -1
  191. package/themes/sharp-dark-panelless.min.js +1 -1
  192. package/themes/sharp-dark.js +1 -1
  193. package/themes/sharp-dark.min.js +1 -1
  194. package/themes/sharp-light-panelless.js +1 -1
  195. package/themes/sharp-light-panelless.min.js +1 -1
  196. package/themes/sharp-light.js +1 -1
  197. package/themes/sharp-light.min.js +1 -1
  198. package/themes/solid-dark-panelless.js +1 -1
  199. package/themes/solid-dark-panelless.min.js +1 -1
  200. package/themes/solid-dark.js +1 -1
  201. package/themes/solid-dark.min.js +1 -1
  202. package/themes/solid-light-panelless.js +1 -1
  203. package/themes/solid-light-panelless.min.js +1 -1
  204. package/themes/solid-light.js +1 -1
  205. package/themes/solid-light.min.js +1 -1
  206. package/themes/three-dimensional-dark-panelless.js +1 -1
  207. package/themes/three-dimensional-dark-panelless.min.js +1 -1
  208. package/themes/three-dimensional-dark.js +1 -1
  209. package/themes/three-dimensional-dark.min.js +1 -1
  210. package/themes/three-dimensional-light-panelless.js +1 -1
  211. package/themes/three-dimensional-light-panelless.min.js +1 -1
  212. package/themes/three-dimensional-light.js +1 -1
  213. package/themes/three-dimensional-light.min.js +1 -1
  214. package/ts3.4/typings/actions/action.d.ts +18 -0
  215. package/ts3.4/typings/actions/adaptive-container.d.ts +0 -1
  216. package/ts3.4/typings/actions/container.d.ts +4 -0
  217. package/ts3.4/typings/base-interfaces.d.ts +1 -1
  218. package/ts3.4/typings/base.d.ts +7 -0
  219. package/ts3.4/typings/defaultCss/defaultV2Css.d.ts +2 -0
  220. package/ts3.4/typings/dragdrop/ranking-choices.d.ts +7 -1
  221. package/ts3.4/typings/dragdrop/ranking-select-to-rank.d.ts +0 -9
  222. package/ts3.4/typings/functionsfactory.d.ts +3 -3
  223. package/ts3.4/typings/list.d.ts +9 -1
  224. package/ts3.4/typings/panel.d.ts +1 -1
  225. package/ts3.4/typings/popup-dropdown-view-model.d.ts +6 -3
  226. package/ts3.4/typings/popup-view-model.d.ts +2 -1
  227. package/ts3.4/typings/popup.d.ts +2 -0
  228. package/ts3.4/typings/question.d.ts +6 -2
  229. package/ts3.4/typings/question_baseselect.d.ts +2 -0
  230. package/ts3.4/typings/question_boolean.d.ts +2 -0
  231. package/ts3.4/typings/question_file.d.ts +2 -1
  232. package/ts3.4/typings/question_matrix.d.ts +4 -0
  233. package/ts3.4/typings/question_matrixdropdown.d.ts +3 -0
  234. package/ts3.4/typings/question_matrixdropdownbase.d.ts +2 -0
  235. package/ts3.4/typings/question_matrixdropdownrendered.d.ts +0 -1
  236. package/ts3.4/typings/question_matrixdynamic.d.ts +4 -5
  237. package/ts3.4/typings/question_paneldynamic.d.ts +2 -4
  238. package/ts3.4/typings/question_ranking.d.ts +13 -5
  239. package/ts3.4/typings/question_text.d.ts +1 -0
  240. package/ts3.4/typings/question_textbase.d.ts +1 -1
  241. package/ts3.4/typings/survey-element.d.ts +3 -1
  242. package/ts3.4/typings/survey.d.ts +1 -1
  243. package/ts3.4/typings/surveyToc.d.ts +4 -0
  244. package/ts3.4/typings/utils/animation.d.ts +33 -19
  245. package/ts3.4/typings/utils/popup.d.ts +16 -4
  246. package/ts3.4/typings/utils/utils.d.ts +9 -0
  247. package/typings/actions/action.d.ts +18 -0
  248. package/typings/actions/adaptive-container.d.ts +0 -1
  249. package/typings/actions/container.d.ts +4 -0
  250. package/typings/base-interfaces.d.ts +1 -1
  251. package/typings/base.d.ts +7 -0
  252. package/typings/defaultCss/defaultV2Css.d.ts +2 -0
  253. package/typings/dragdrop/ranking-choices.d.ts +7 -1
  254. package/typings/dragdrop/ranking-select-to-rank.d.ts +0 -9
  255. package/typings/functionsfactory.d.ts +3 -3
  256. package/typings/list.d.ts +9 -1
  257. package/typings/panel.d.ts +1 -1
  258. package/typings/popup-dropdown-view-model.d.ts +6 -3
  259. package/typings/popup-view-model.d.ts +2 -1
  260. package/typings/popup.d.ts +2 -0
  261. package/typings/question.d.ts +6 -2
  262. package/typings/question_baseselect.d.ts +2 -0
  263. package/typings/question_boolean.d.ts +2 -0
  264. package/typings/question_file.d.ts +2 -1
  265. package/typings/question_matrix.d.ts +4 -0
  266. package/typings/question_matrixdropdown.d.ts +3 -0
  267. package/typings/question_matrixdropdownbase.d.ts +2 -0
  268. package/typings/question_matrixdropdownrendered.d.ts +0 -1
  269. package/typings/question_matrixdynamic.d.ts +4 -5
  270. package/typings/question_paneldynamic.d.ts +2 -2
  271. package/typings/question_ranking.d.ts +18 -9
  272. package/typings/question_text.d.ts +1 -0
  273. package/typings/question_textbase.d.ts +1 -1
  274. package/typings/survey-element.d.ts +3 -1
  275. package/typings/survey.d.ts +1 -1
  276. package/typings/surveyToc.d.ts +4 -0
  277. package/typings/utils/animation.d.ts +31 -10
  278. package/typings/utils/popup.d.ts +16 -4
  279. package/typings/utils/utils.d.ts +9 -0
package/survey.core.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - Survey JavaScript library v1.10.6
2
+ * surveyjs - Survey JavaScript library v1.11.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
  */
@@ -726,6 +726,11 @@ var __decorate = (undefined && undefined.__decorate) || function (decorators, ta
726
726
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
727
727
  return c > 3 && r && Object.defineProperty(target, key, r), r;
728
728
  };
729
+ var __spreadArray = (undefined && undefined.__spreadArray) || function (to, from) {
730
+ for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
731
+ to[j] = from[i];
732
+ return to;
733
+ };
729
734
 
730
735
 
731
736
 
@@ -748,7 +753,9 @@ function createDropdownActionModelAdvanced(actionOptions, listOptions, popupOpti
748
753
  if (newAction.hasTitle) {
749
754
  newAction.title = item.title;
750
755
  }
751
- originalSelectionChanged(item, params);
756
+ if (originalSelectionChanged) {
757
+ originalSelectionChanged(item, params);
758
+ }
752
759
  };
753
760
  var popupModel = createPopupModelWithListModel(listOptions, popupOptions);
754
761
  var newActionOptions = Object.assign({}, actionOptions, {
@@ -767,7 +774,9 @@ function createDropdownActionModelAdvanced(actionOptions, listOptions, popupOpti
767
774
  function createPopupModelWithListModel(listOptions, popupOptions) {
768
775
  var listModel = new _list__WEBPACK_IMPORTED_MODULE_3__["ListModel"](listOptions);
769
776
  listModel.onSelectionChanged = function (item) {
770
- listOptions.onSelectionChanged(item);
777
+ if (listOptions.onSelectionChanged) {
778
+ listOptions.onSelectionChanged(item);
779
+ }
771
780
  popupModel.hide();
772
781
  };
773
782
  var _popupOptions = popupOptions || {};
@@ -789,6 +798,7 @@ var BaseAction = /** @class */ (function (_super) {
789
798
  function BaseAction() {
790
799
  var _this = _super !== null && _super.apply(this, arguments) || this;
791
800
  _this.rendredIdValue = BaseAction.getNextRendredId();
801
+ _this.markerIconSize = 16;
792
802
  return _this;
793
803
  }
794
804
  BaseAction.getNextRendredId = function () { return BaseAction.renderedId++; };
@@ -932,6 +942,46 @@ var BaseAction = /** @class */ (function (_super) {
932
942
  }
933
943
  return args.isTrusted;
934
944
  };
945
+ BaseAction.prototype.showPopup = function () {
946
+ if (!!this.popupModel) {
947
+ this.popupModel.show();
948
+ }
949
+ };
950
+ BaseAction.prototype.hidePopup = function () {
951
+ if (!!this.popupModel) {
952
+ this.popupModel.hide();
953
+ }
954
+ };
955
+ BaseAction.prototype.clearPopupTimeouts = function () {
956
+ if (this.showPopupTimeout)
957
+ clearTimeout(this.showPopupTimeout);
958
+ if (this.hidePopupTimeout)
959
+ clearTimeout(this.hidePopupTimeout);
960
+ };
961
+ BaseAction.prototype.showPopupDelayed = function (delay) {
962
+ var _this = this;
963
+ this.clearPopupTimeouts();
964
+ this.showPopupTimeout = setTimeout(function () {
965
+ _this.clearPopupTimeouts();
966
+ _this.showPopup();
967
+ }, delay);
968
+ };
969
+ BaseAction.prototype.hidePopupDelayed = function (delay) {
970
+ var _this = this;
971
+ var _a;
972
+ if ((_a = this.popupModel) === null || _a === void 0 ? void 0 : _a.isVisible) {
973
+ this.clearPopupTimeouts();
974
+ this.hidePopupTimeout = setTimeout(function () {
975
+ _this.clearPopupTimeouts();
976
+ _this.hidePopup();
977
+ _this.isHovered = false;
978
+ }, delay);
979
+ }
980
+ else {
981
+ this.clearPopupTimeouts();
982
+ this.isHovered = false;
983
+ }
984
+ };
935
985
  BaseAction.renderedId = 1;
936
986
  __decorate([
937
987
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])()
@@ -993,9 +1043,21 @@ var BaseAction = /** @class */ (function (_super) {
993
1043
  __decorate([
994
1044
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])({ defaultValue: 24 })
995
1045
  ], BaseAction.prototype, "iconSize", void 0);
1046
+ __decorate([
1047
+ Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])()
1048
+ ], BaseAction.prototype, "markerIconName", void 0);
1049
+ __decorate([
1050
+ Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])()
1051
+ ], BaseAction.prototype, "markerIconSize", void 0);
996
1052
  __decorate([
997
1053
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])()
998
1054
  ], BaseAction.prototype, "css", void 0);
1055
+ __decorate([
1056
+ Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])({ defaultValue: false })
1057
+ ], BaseAction.prototype, "isPressed", void 0);
1058
+ __decorate([
1059
+ Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])({ defaultValue: false })
1060
+ ], BaseAction.prototype, "isHovered", void 0);
999
1061
  return BaseAction;
1000
1062
  }(_base__WEBPACK_IMPORTED_MODULE_0__["Base"]));
1001
1063
 
@@ -1033,6 +1095,14 @@ var Action = /** @class */ (function (_super) {
1033
1095
  Action.prototype.createLocTitle = function () {
1034
1096
  return this.createLocalizableString("title", this, true);
1035
1097
  };
1098
+ Action.prototype.setItems = function (items, onSelectionChanged) {
1099
+ this.markerIconName = "icon-next_16x16";
1100
+ this.component = "sv-list-item-group";
1101
+ this.items = __spreadArray([], items);
1102
+ var popupModel = createPopupModelWithListModel({ items: items, onSelectionChanged: onSelectionChanged, searchEnabled: false }, { horizontalPosition: "right", showPointer: false, canShrink: false });
1103
+ popupModel.cssClass = "sv-popup-inner";
1104
+ this.popupModel = popupModel;
1105
+ };
1036
1106
  Action.prototype.getLocTitle = function () {
1037
1107
  return this.locTitleValue;
1038
1108
  };
@@ -1249,9 +1319,6 @@ var AdaptiveActionContainer = /** @class */ (function (_super) {
1249
1319
  tooltip: _surveyStrings__WEBPACK_IMPORTED_MODULE_3__["surveyLocalization"].getString("more"),
1250
1320
  }, {
1251
1321
  items: [],
1252
- onSelectionChanged: function (item) {
1253
- _this.hiddenItemSelected(item);
1254
- },
1255
1322
  allowSelection: false
1256
1323
  });
1257
1324
  return _this;
@@ -1317,11 +1384,6 @@ var AdaptiveActionContainer = /** @class */ (function (_super) {
1317
1384
  enumerable: false,
1318
1385
  configurable: true
1319
1386
  });
1320
- AdaptiveActionContainer.prototype.hiddenItemSelected = function (item) {
1321
- if (!!item && typeof item.action === "function") {
1322
- item.action();
1323
- }
1324
- };
1325
1387
  AdaptiveActionContainer.prototype.onSet = function () {
1326
1388
  var _this = this;
1327
1389
  this.actions.forEach(function (action) { return action.updateCallback = function (isResetInitialized) { return _this.raiseUpdate(isResetInitialized); }; });
@@ -1578,6 +1640,21 @@ var ActionContainer = /** @class */ (function (_super) {
1578
1640
  this.sortItems();
1579
1641
  }
1580
1642
  };
1643
+ ActionContainer.prototype.popupAfterShowCallback = function (itemValue) {
1644
+ };
1645
+ ActionContainer.prototype.mouseOverHandler = function (itemValue) {
1646
+ var _this = this;
1647
+ itemValue.isHovered = true;
1648
+ this.actions.forEach(function (action) {
1649
+ if (action === itemValue && !!itemValue.popupModel) {
1650
+ itemValue.showPopupDelayed(_this.subItemsShowDelay);
1651
+ _this.popupAfterShowCallback(itemValue);
1652
+ }
1653
+ else if (!!action.popupModel && action.popupModel.isVisible) {
1654
+ action.hidePopupDelayed(_this.subItemsHideDelay);
1655
+ }
1656
+ });
1657
+ };
1581
1658
  ActionContainer.prototype.initResponsivityManager = function (container, delayedUpdateFunction) {
1582
1659
  return;
1583
1660
  };
@@ -1613,6 +1690,12 @@ var ActionContainer = /** @class */ (function (_super) {
1613
1690
  __decorate([
1614
1691
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])({ defaultValue: false })
1615
1692
  ], ActionContainer.prototype, "isEmpty", void 0);
1693
+ __decorate([
1694
+ Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])({ defaultValue: 300 })
1695
+ ], ActionContainer.prototype, "subItemsShowDelay", void 0);
1696
+ __decorate([
1697
+ Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])({ defaultValue: 300 })
1698
+ ], ActionContainer.prototype, "subItemsHideDelay", void 0);
1616
1699
  return ActionContainer;
1617
1700
  }(_base__WEBPACK_IMPORTED_MODULE_1__["Base"]));
1618
1701
 
@@ -1888,6 +1971,10 @@ var Base = /** @class */ (function () {
1888
1971
  this.onItemValuePropertyChanged = this.addEvent();
1889
1972
  this.isCreating = true;
1890
1973
  this.animationAllowedLock = 0;
1974
+ //remove when knockout obsolete
1975
+ this.supportOnElementRenderedEvent = true;
1976
+ this.onElementRenderedEventEnabled = false;
1977
+ this._onElementRerendered = new EventBase();
1891
1978
  this.bindingsValue = new Bindings(this);
1892
1979
  _jsonobject__WEBPACK_IMPORTED_MODULE_2__["CustomPropertiesCollection"].createProperties(this);
1893
1980
  this.onBaseCreating();
@@ -2816,7 +2903,7 @@ var Base = /** @class */ (function () {
2816
2903
  configurable: true
2817
2904
  });
2818
2905
  Base.prototype.getIsAnimationAllowed = function () {
2819
- return _settings__WEBPACK_IMPORTED_MODULE_3__["settings"].animationEnabled && this.animationAllowedLock >= 0 && !this.isLoadingFromJson && !this.isDisposed;
2906
+ return _settings__WEBPACK_IMPORTED_MODULE_3__["settings"].animationEnabled && this.animationAllowedLock >= 0 && !this.isLoadingFromJson && !this.isDisposed && (!!this.onElementRerendered || !this.supportOnElementRenderedEvent);
2820
2907
  };
2821
2908
  Base.prototype.blockAnimations = function () {
2822
2909
  this.animationAllowedLock--;
@@ -2824,6 +2911,22 @@ var Base = /** @class */ (function () {
2824
2911
  Base.prototype.releaseAnimations = function () {
2825
2912
  this.animationAllowedLock++;
2826
2913
  };
2914
+ Base.prototype.enableOnElementRenderedEvent = function () {
2915
+ this.onElementRenderedEventEnabled = true;
2916
+ };
2917
+ Base.prototype.disableOnElementRenderedEvent = function () {
2918
+ this.onElementRenderedEventEnabled = false;
2919
+ };
2920
+ Object.defineProperty(Base.prototype, "onElementRerendered", {
2921
+ get: function () {
2922
+ return this.supportOnElementRenderedEvent && this.onElementRenderedEventEnabled ? this._onElementRerendered : undefined;
2923
+ },
2924
+ enumerable: false,
2925
+ configurable: true
2926
+ });
2927
+ Base.prototype.afterRerender = function () {
2928
+ this.onElementRerendered.fire(this, undefined);
2929
+ };
2827
2930
  Base.currentDependencis = undefined;
2828
2931
  return Base;
2829
2932
  }());
@@ -2867,8 +2970,9 @@ var Event = /** @class */ (function () {
2867
2970
  Event.prototype.fire = function (sender, options) {
2868
2971
  if (!this.callbacks)
2869
2972
  return;
2870
- for (var i = 0; i < this.callbacks.length; i++) {
2871
- this.callbacks[i](sender, options);
2973
+ var callbacks = [].concat(this.callbacks);
2974
+ for (var i = 0; i < callbacks.length; i++) {
2975
+ callbacks[i](sender, options);
2872
2976
  if (!this.callbacks)
2873
2977
  return;
2874
2978
  }
@@ -5606,6 +5710,7 @@ var defaultV2Css = {
5606
5710
  rowMultiple: "sd-row--multiple",
5607
5711
  rowCompact: "sd-row--compact",
5608
5712
  rowFadeIn: "sd-row--fade-in",
5713
+ rowDelayedFadeIn: "sd-row--delayed-fade-in",
5609
5714
  rowFadeOut: "sd-row--fade-out",
5610
5715
  pageRow: "sd-page__row",
5611
5716
  question: {
@@ -5665,6 +5770,7 @@ var defaultV2Css = {
5665
5770
  disabled: "sd-question--disabled",
5666
5771
  readOnly: "sd-question--readonly",
5667
5772
  preview: "sd-question--preview",
5773
+ noPointerEventsMode: "sd-question--no-pointer-events",
5668
5774
  errorsContainer: "sd-element__erbox sd-question__erbox",
5669
5775
  errorsContainerTop: "sd-element__erbox--above-element sd-question__erbox--above-question",
5670
5776
  errorsContainerBottom: "sd-question__erbox--below-question"
@@ -6119,13 +6225,13 @@ var defaultV2Css = {
6119
6225
  removeButtonIconId: "icon-clear",
6120
6226
  removeFile: "sd-hidden",
6121
6227
  removeFileSvg: "",
6122
- removeFileSvgIconId: "icon-delete",
6228
+ removeFileSvgIconId: "icon-close_16x16",
6123
6229
  wrapper: "sd-file__wrapper",
6124
6230
  defaultImage: "sd-file__default-image",
6125
6231
  defaultImageIconId: "icon-defaultfile",
6126
6232
  leftIconId: "icon-arrowleft",
6127
6233
  rightIconId: "icon-arrowright",
6128
- removeFileButton: "sd-context-btn--negative sd-file__remove-file-button",
6234
+ removeFileButton: "sd-context-btn--small sd-context-btn--with-border sd-context-btn--colorful sd-context-btn--negative sd-file__remove-file-button",
6129
6235
  dragAreaPlaceholder: "sd-file__drag-area-placeholder",
6130
6236
  imageWrapper: "sd-file__image-wrapper",
6131
6237
  imageWrapperDefaultImage: "sd-file__image-wrapper--default-image",
@@ -7686,10 +7792,11 @@ var DragDropMatrixRows = /** @class */ (function (_super) {
7686
7792
  "use strict";
7687
7793
  __webpack_require__.r(__webpack_exports__);
7688
7794
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DragDropRankingChoices", function() { return DragDropRankingChoices; });
7689
- /* harmony import */ var _choices__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./choices */ "./src/dragdrop/choices.ts");
7690
- /* harmony import */ var _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/cssClassBuilder */ "./src/utils/cssClassBuilder.ts");
7691
- /* harmony import */ var _utils_devices__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/devices */ "./src/utils/devices.ts");
7692
- /* harmony import */ var _global_variables_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../global_variables_utils */ "./src/global_variables_utils.ts");
7795
+ /* harmony import */ var _itemvalue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../itemvalue */ "./src/itemvalue.ts");
7796
+ /* harmony import */ var _choices__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./choices */ "./src/dragdrop/choices.ts");
7797
+ /* harmony import */ var _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/cssClassBuilder */ "./src/utils/cssClassBuilder.ts");
7798
+ /* harmony import */ var _utils_devices__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/devices */ "./src/utils/devices.ts");
7799
+ /* harmony import */ var _global_variables_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../global_variables_utils */ "./src/global_variables_utils.ts");
7693
7800
  var __extends = (undefined && undefined.__extends) || (function () {
7694
7801
  var extendStatics = function (d, b) {
7695
7802
  extendStatics = Object.setPrototypeOf ||
@@ -7709,6 +7816,7 @@ var __extends = (undefined && undefined.__extends) || (function () {
7709
7816
 
7710
7817
 
7711
7818
 
7819
+
7712
7820
  var DragDropRankingChoices = /** @class */ (function (_super) {
7713
7821
  __extends(DragDropRankingChoices, _super);
7714
7822
  function DragDropRankingChoices() {
@@ -7718,6 +7826,16 @@ var DragDropRankingChoices = /** @class */ (function (_super) {
7718
7826
  var node = _this.domAdapter.draggedElementShortcut.querySelector(".sv-ranking-item");
7719
7827
  node.style.cursor = "grabbing";
7720
7828
  };
7829
+ _this.reorderRankedItem = function (questionModel, fromIndex, toIndex) {
7830
+ if (fromIndex == toIndex)
7831
+ return;
7832
+ var rankingChoices = questionModel.rankingChoices;
7833
+ var item = rankingChoices[fromIndex];
7834
+ questionModel.isValueSetByUser = true;
7835
+ rankingChoices.splice(fromIndex, 1);
7836
+ rankingChoices.splice(toIndex, 0, item);
7837
+ _this.updateDraggedElementShortcut(toIndex + 1);
7838
+ };
7721
7839
  _this.doBanDropHere = function () {
7722
7840
  if (_this.isDragOverRootNode) {
7723
7841
  _this.allowDropHere = true;
@@ -7736,7 +7854,7 @@ var DragDropRankingChoices = /** @class */ (function (_super) {
7736
7854
  configurable: true
7737
7855
  });
7738
7856
  DragDropRankingChoices.prototype.createDraggedElementShortcut = function (text, draggedElementNode, event) {
7739
- var draggedElementShortcut = _global_variables_utils__WEBPACK_IMPORTED_MODULE_3__["DomDocumentHelper"].createElement("div");
7857
+ var draggedElementShortcut = _global_variables_utils__WEBPACK_IMPORTED_MODULE_4__["DomDocumentHelper"].createElement("div");
7740
7858
  if (!draggedElementShortcut)
7741
7859
  return;
7742
7860
  draggedElementShortcut.className = this.shortcutClass + " sv-ranking-shortcut";
@@ -7754,9 +7872,9 @@ var DragDropRankingChoices = /** @class */ (function (_super) {
7754
7872
  };
7755
7873
  Object.defineProperty(DragDropRankingChoices.prototype, "shortcutClass", {
7756
7874
  get: function () {
7757
- return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_1__["CssClassBuilder"]()
7875
+ return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_2__["CssClassBuilder"]()
7758
7876
  .append(this.parentElement.cssClasses.root)
7759
- .append(this.parentElement.cssClasses.rootMobileMod, _utils_devices__WEBPACK_IMPORTED_MODULE_2__["IsMobile"])
7877
+ .append(this.parentElement.cssClasses.rootMobileMod, _utils_devices__WEBPACK_IMPORTED_MODULE_3__["IsMobile"])
7760
7878
  .toString();
7761
7879
  },
7762
7880
  enumerable: false,
@@ -7776,52 +7894,49 @@ var DragDropRankingChoices = /** @class */ (function (_super) {
7776
7894
  };
7777
7895
  DragDropRankingChoices.prototype.isDropTargetValid = function (dropTarget, dropTargetNode) {
7778
7896
  var choices = this.parentElement.rankingChoices;
7779
- var dropTargetIndex = choices.indexOf(this.dropTarget);
7780
- var draggedElementIndex = choices.indexOf(this.draggedElement);
7781
- if (draggedElementIndex > dropTargetIndex && dropTargetNode.classList.contains("sv-dragdrop-moveup")) {
7782
- this.parentElement.dropTargetNodeMove = null;
7783
- return false;
7784
- }
7785
- if (draggedElementIndex < dropTargetIndex && dropTargetNode.classList.contains("sv-dragdrop-movedown")) {
7786
- this.parentElement.dropTargetNodeMove = null;
7787
- return false;
7788
- }
7789
7897
  if (choices.indexOf(dropTarget) === -1)
7790
7898
  // shouldn't allow to drop on "adorners" (selectall, none, other)
7791
7899
  return false;
7792
7900
  return true;
7793
7901
  };
7794
- DragDropRankingChoices.prototype.calculateIsBottom = function (clientY) {
7795
- var choices = this.parentElement.rankingChoices;
7796
- return (choices.indexOf(this.dropTarget) - choices.indexOf(this.draggedElement) >
7797
- 0);
7902
+ DragDropRankingChoices.prototype.calculateIsBottom = function (clientY, dropTargetNode) {
7903
+ if (this.dropTarget instanceof _itemvalue__WEBPACK_IMPORTED_MODULE_0__["ItemValue"] && this.draggedElement !== this.dropTarget) {
7904
+ var rect = dropTargetNode.getBoundingClientRect();
7905
+ return clientY >= rect.y + rect.height / 2;
7906
+ }
7907
+ return _super.prototype.calculateIsBottom.call(this, clientY);
7798
7908
  };
7799
- DragDropRankingChoices.prototype.afterDragOver = function (dropTargetNode) {
7800
- var choices = this.parentElement.rankingChoices;
7801
- var dropTargetIndex = choices.indexOf(this.dropTarget);
7802
- var draggedElementIndex = choices.indexOf(this.draggedElement);
7803
- choices.splice(draggedElementIndex, 1);
7804
- choices.splice(dropTargetIndex, 0, this.draggedElement);
7805
- this.parentElement.setPropertyValue("rankingChoices", choices);
7806
- //return;
7807
- this.updateDraggedElementShortcut(dropTargetIndex + 1);
7808
- if (draggedElementIndex !== dropTargetIndex) {
7809
- dropTargetNode.classList.remove("sv-dragdrop-moveup");
7810
- dropTargetNode.classList.remove("sv-dragdrop-movedown");
7811
- this.parentElement.dropTargetNodeMove = null;
7909
+ DragDropRankingChoices.prototype.getIndixies = function (model, fromChoicesArray, toChoicesArray) {
7910
+ var fromIndex = fromChoicesArray.indexOf(this.draggedElement);
7911
+ var toIndex = toChoicesArray.indexOf(this.dropTarget);
7912
+ if (toIndex === -1) {
7913
+ var length_1 = model.value.length;
7914
+ toIndex = length_1;
7812
7915
  }
7813
- if (draggedElementIndex > dropTargetIndex) {
7814
- this.parentElement.dropTargetNodeMove = "down";
7916
+ else if (fromChoicesArray == toChoicesArray) {
7917
+ if (!this.isBottom && fromIndex < toIndex)
7918
+ toIndex--;
7919
+ if (this.isBottom && fromIndex > toIndex)
7920
+ toIndex++;
7815
7921
  }
7816
- if (draggedElementIndex < dropTargetIndex) {
7817
- this.parentElement.dropTargetNodeMove = "up";
7922
+ else if (fromChoicesArray != toChoicesArray) {
7923
+ if (this.isBottom)
7924
+ toIndex++;
7818
7925
  }
7926
+ return { fromIndex: fromIndex, toIndex: toIndex };
7927
+ };
7928
+ DragDropRankingChoices.prototype.afterDragOver = function (dropTargetNode) {
7929
+ var _a = this.getIndixies(this.parentElement, this.parentElement.rankingChoices, this.parentElement.rankingChoices), fromIndex = _a.fromIndex, toIndex = _a.toIndex;
7930
+ this.reorderRankedItem(this.parentElement, fromIndex, toIndex);
7819
7931
  };
7820
7932
  DragDropRankingChoices.prototype.updateDraggedElementShortcut = function (newIndex) {
7821
- var newIndexText = newIndex !== null ? newIndex + "" : "";
7822
- // TODO should avoid direct DOM manipulation, do through the frameworks instead
7823
- var indexNode = this.domAdapter.draggedElementShortcut.querySelector(".sv-ranking-item__index");
7824
- indexNode.innerText = newIndexText;
7933
+ var _a;
7934
+ if ((_a = this.domAdapter) === null || _a === void 0 ? void 0 : _a.draggedElementShortcut) {
7935
+ var newIndexText = newIndex !== null ? newIndex + "" : "";
7936
+ // TODO should avoid direct DOM manipulation, do through the frameworks instead
7937
+ var indexNode = this.domAdapter.draggedElementShortcut.querySelector(".sv-ranking-item__index");
7938
+ indexNode.innerText = newIndexText;
7939
+ }
7825
7940
  };
7826
7941
  DragDropRankingChoices.prototype.ghostPositionChanged = function () {
7827
7942
  this.parentElement.currentDropTarget = this.draggedElement;
@@ -7839,7 +7954,7 @@ var DragDropRankingChoices = /** @class */ (function (_super) {
7839
7954
  _super.prototype.clear.call(this);
7840
7955
  };
7841
7956
  return DragDropRankingChoices;
7842
- }(_choices__WEBPACK_IMPORTED_MODULE_0__["DragDropChoices"]));
7957
+ }(_choices__WEBPACK_IMPORTED_MODULE_1__["DragDropChoices"]));
7843
7958
 
7844
7959
 
7845
7960
 
@@ -7855,8 +7970,7 @@ var DragDropRankingChoices = /** @class */ (function (_super) {
7855
7970
  "use strict";
7856
7971
  __webpack_require__.r(__webpack_exports__);
7857
7972
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DragDropRankingSelectToRank", function() { return DragDropRankingSelectToRank; });
7858
- /* harmony import */ var _itemvalue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../itemvalue */ "./src/itemvalue.ts");
7859
- /* harmony import */ var _ranking_choices__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ranking-choices */ "./src/dragdrop/ranking-choices.ts");
7973
+ /* harmony import */ var _ranking_choices__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ranking-choices */ "./src/dragdrop/ranking-choices.ts");
7860
7974
  var __extends = (undefined && undefined.__extends) || (function () {
7861
7975
  var extendStatics = function (d, b) {
7862
7976
  extendStatics = Object.setPrototypeOf ||
@@ -7873,7 +7987,6 @@ var __extends = (undefined && undefined.__extends) || (function () {
7873
7987
  };
7874
7988
  })();
7875
7989
 
7876
-
7877
7990
  var DragDropRankingSelectToRank = /** @class */ (function (_super) {
7878
7991
  __extends(DragDropRankingSelectToRank, _super);
7879
7992
  function DragDropRankingSelectToRank() {
@@ -7890,19 +8003,6 @@ var DragDropRankingSelectToRank = /** @class */ (function (_super) {
7890
8003
  rankingChoices.splice(fromIndex, 1);
7891
8004
  _this.updateChoices(questionModel, rankingChoices);
7892
8005
  };
7893
- _this.reorderRankedItem = function (questionModel, fromIndex, toIndex, dropTargetNode) {
7894
- var rankingChoices = questionModel.rankingChoices;
7895
- var item = rankingChoices[fromIndex];
7896
- if (fromIndex == toIndex)
7897
- return;
7898
- questionModel.isValueSetByUser = true;
7899
- rankingChoices.splice(fromIndex, 1);
7900
- rankingChoices.splice(toIndex, 0, item);
7901
- questionModel.setPropertyValue("rankingChoices", rankingChoices);
7902
- if (dropTargetNode) {
7903
- _this.doUIEffects(dropTargetNode, fromIndex, toIndex);
7904
- }
7905
- };
7906
8006
  return _this;
7907
8007
  }
7908
8008
  DragDropRankingSelectToRank.prototype.findDropTargetNodeByDragOverNode = function (dragOverNode) {
@@ -7959,50 +8059,6 @@ var DragDropRankingSelectToRank = /** @class */ (function (_super) {
7959
8059
  var _a = this.getIndixies(questionModel, fromChoicesArray, toChoicesArray), fromIndex = _a.fromIndex, toIndex = _a.toIndex;
7960
8060
  rankFunction(questionModel, fromIndex, toIndex, dropTargetNode);
7961
8061
  };
7962
- DragDropRankingSelectToRank.prototype.getIndixies = function (model, fromChoicesArray, toChoicesArray) {
7963
- var fromIndex = fromChoicesArray.indexOf(this.draggedElement);
7964
- var toIndex = toChoicesArray.indexOf(this.dropTarget);
7965
- if (toIndex === -1) {
7966
- var length_1 = model.value.length;
7967
- toIndex = length_1;
7968
- }
7969
- else if (fromChoicesArray == toChoicesArray) {
7970
- if (!this.isBottom && fromIndex < toIndex)
7971
- toIndex--;
7972
- if (this.isBottom && fromIndex > toIndex)
7973
- toIndex++;
7974
- }
7975
- else if (fromChoicesArray != toChoicesArray) {
7976
- if (this.isBottom)
7977
- toIndex++;
7978
- }
7979
- return { fromIndex: fromIndex, toIndex: toIndex };
7980
- };
7981
- DragDropRankingSelectToRank.prototype.calculateIsBottom = function (clientY, dropTargetNode) {
7982
- if (this.dropTarget instanceof _itemvalue__WEBPACK_IMPORTED_MODULE_0__["ItemValue"] && this.draggedElement !== this.dropTarget) {
7983
- var rect = dropTargetNode.getBoundingClientRect();
7984
- return clientY >= rect.y + rect.height / 2;
7985
- }
7986
- return _super.prototype.calculateIsBottom.call(this, clientY);
7987
- };
7988
- DragDropRankingSelectToRank.prototype.doUIEffects = function (dropTargetNode, fromIndex, toIndex) {
7989
- var questionModel = this.parentElement;
7990
- var isDropToEmptyRankedContainer = this.dropTarget === "to-container" && questionModel.isEmpty();
7991
- var isNeedToShowIndexAtShortcut = !this.isDropTargetUnranked || isDropToEmptyRankedContainer;
7992
- var shortcutIndex = isNeedToShowIndexAtShortcut ? toIndex + 1 : null;
7993
- this.updateDraggedElementShortcut(shortcutIndex);
7994
- if (fromIndex !== toIndex) {
7995
- dropTargetNode.classList.remove("sv-dragdrop-moveup");
7996
- dropTargetNode.classList.remove("sv-dragdrop-movedown");
7997
- questionModel.dropTargetNodeMove = null;
7998
- }
7999
- if (fromIndex > toIndex) {
8000
- questionModel.dropTargetNodeMove = "down";
8001
- }
8002
- if (fromIndex < toIndex) {
8003
- questionModel.dropTargetNodeMove = "up";
8004
- }
8005
- };
8006
8062
  Object.defineProperty(DragDropRankingSelectToRank.prototype, "isDraggedElementRanked", {
8007
8063
  get: function () {
8008
8064
  return this.parentElement.rankingChoices.indexOf(this.draggedElement) !== -1;
@@ -8026,28 +8082,13 @@ var DragDropRankingSelectToRank = /** @class */ (function (_super) {
8026
8082
  enumerable: false,
8027
8083
  configurable: true
8028
8084
  });
8029
- Object.defineProperty(DragDropRankingSelectToRank.prototype, "isDropTargetUnranked", {
8030
- get: function () {
8031
- return !this.isDropTargetRanked;
8032
- },
8033
- enumerable: false,
8034
- configurable: true
8035
- });
8036
8085
  DragDropRankingSelectToRank.prototype.updateChoices = function (questionModel, rankingChoices) {
8037
8086
  questionModel.isValueSetByUser = true;
8038
8087
  questionModel.rankingChoices = rankingChoices;
8039
8088
  questionModel.updateUnRankingChoices(rankingChoices);
8040
8089
  };
8041
- DragDropRankingSelectToRank.prototype.clear = function () {
8042
- var questionModel = this.parentElement;
8043
- if (!!questionModel) {
8044
- questionModel.rankingChoicesAnimation.cancel();
8045
- questionModel.unRankingChoicesAnimation.cancel();
8046
- }
8047
- _super.prototype.clear.call(this);
8048
- };
8049
8090
  return DragDropRankingSelectToRank;
8050
- }(_ranking_choices__WEBPACK_IMPORTED_MODULE_1__["DragDropRankingChoices"]));
8091
+ }(_ranking_choices__WEBPACK_IMPORTED_MODULE_0__["DragDropRankingChoices"]));
8051
8092
 
8052
8093
 
8053
8094
 
@@ -9744,8 +9785,8 @@ __webpack_require__.r(__webpack_exports__);
9744
9785
 
9745
9786
  var Version;
9746
9787
  var ReleaseDate;
9747
- Version = "" + "1.10.6";
9748
- ReleaseDate = "" + "2024-05-28";
9788
+ Version = "" + "1.11.1";
9789
+ ReleaseDate = "" + "2024-06-06";
9749
9790
  function checkLibraryVersion(ver, libraryName) {
9750
9791
  if (Version != ver) {
9751
9792
  var str = "survey-core has version '" + Version + "' and " + libraryName
@@ -14855,7 +14896,7 @@ var FunctionOperand = /** @class */ (function (_super) {
14855
14896
  return this.evaluateCore(processValue);
14856
14897
  };
14857
14898
  FunctionOperand.prototype.evaluateCore = function (processValue) {
14858
- return _functionsfactory__WEBPACK_IMPORTED_MODULE_1__["FunctionFactory"].Instance.run(this.originalValue, this.parameters.evaluate(processValue), processValue.properties);
14899
+ return _functionsfactory__WEBPACK_IMPORTED_MODULE_1__["FunctionFactory"].Instance.run(this.originalValue, this.parameters.evaluate(processValue), processValue.properties, this.parameters.values);
14859
14900
  };
14860
14901
  FunctionOperand.prototype.toString = function (func) {
14861
14902
  if (func === void 0) { func = undefined; }
@@ -15387,7 +15428,7 @@ var FunctionFactory = /** @class */ (function () {
15387
15428
  }
15388
15429
  return result.sort();
15389
15430
  };
15390
- FunctionFactory.prototype.run = function (name, params, properties) {
15431
+ FunctionFactory.prototype.run = function (name, params, properties, originalParams) {
15391
15432
  if (properties === void 0) { properties = null; }
15392
15433
  var func = this.functionHash[name];
15393
15434
  if (!func) {
@@ -15402,7 +15443,7 @@ var FunctionFactory = /** @class */ (function () {
15402
15443
  classRunner[key] = properties[key];
15403
15444
  }
15404
15445
  }
15405
- return classRunner.func(params);
15446
+ return classRunner.func(params, originalParams);
15406
15447
  };
15407
15448
  FunctionFactory.Instance = new FunctionFactory();
15408
15449
  return FunctionFactory;
@@ -15474,7 +15515,7 @@ function avg(params) {
15474
15515
  return arr.length > 0 ? res / arr.length : 0;
15475
15516
  }
15476
15517
  FunctionFactory.Instance.register("avg", avg);
15477
- function getInArrayParams(params) {
15518
+ function getInArrayParams(params, originalParams) {
15478
15519
  if (params.length < 2 || params.length > 3)
15479
15520
  return null;
15480
15521
  var arr = params[0];
@@ -15485,10 +15526,16 @@ function getInArrayParams(params) {
15485
15526
  var name = params[1];
15486
15527
  if (typeof name !== "string" && !(name instanceof String))
15487
15528
  return null;
15488
- var expression = params.length === 3 ? params[2] : undefined;
15529
+ var expression = params.length > 2 ? params[2] : undefined;
15489
15530
  if (typeof expression !== "string" && !(expression instanceof String)) {
15490
15531
  expression = undefined;
15491
15532
  }
15533
+ if (!expression) {
15534
+ var operand = Array.isArray(originalParams) && originalParams.length > 2 ? originalParams[2] : undefined;
15535
+ if (operand && !!operand.toString()) {
15536
+ expression = operand.toString();
15537
+ }
15538
+ }
15492
15539
  return { data: arr, name: name, expression: expression };
15493
15540
  }
15494
15541
  function convertToNumber(val) {
@@ -15504,9 +15551,9 @@ function processItemInArray(item, name, res, func, needToConvert, condition) {
15504
15551
  var val = needToConvert ? convertToNumber(item[name]) : 1;
15505
15552
  return func(res, val);
15506
15553
  }
15507
- function calcInArray(params, func, needToConvert) {
15554
+ function calcInArray(params, originalParams, func, needToConvert) {
15508
15555
  if (needToConvert === void 0) { needToConvert = true; }
15509
- var v = getInArrayParams(params);
15556
+ var v = getInArrayParams(params, originalParams);
15510
15557
  if (!v)
15511
15558
  return undefined;
15512
15559
  var condition = !!v.expression ? new _conditions__WEBPACK_IMPORTED_MODULE_3__["ConditionRunner"](v.expression) : undefined;
@@ -15526,8 +15573,8 @@ function calcInArray(params, func, needToConvert) {
15526
15573
  }
15527
15574
  return res;
15528
15575
  }
15529
- function sumInArray(params) {
15530
- var res = calcInArray(params, function (res, val) {
15576
+ function sumInArray(params, originalParams) {
15577
+ var res = calcInArray(params, originalParams, function (res, val) {
15531
15578
  if (res == undefined)
15532
15579
  res = 0;
15533
15580
  if (val == undefined || val == null)
@@ -15537,8 +15584,8 @@ function sumInArray(params) {
15537
15584
  return res !== undefined ? res : 0;
15538
15585
  }
15539
15586
  FunctionFactory.Instance.register("sumInArray", sumInArray);
15540
- function minInArray(params) {
15541
- return calcInArray(params, function (res, val) {
15587
+ function minInArray(params, originalParams) {
15588
+ return calcInArray(params, originalParams, function (res, val) {
15542
15589
  if (res == undefined)
15543
15590
  return val;
15544
15591
  if (val == undefined || val == null)
@@ -15547,8 +15594,8 @@ function minInArray(params) {
15547
15594
  });
15548
15595
  }
15549
15596
  FunctionFactory.Instance.register("minInArray", minInArray);
15550
- function maxInArray(params) {
15551
- return calcInArray(params, function (res, val) {
15597
+ function maxInArray(params, originalParams) {
15598
+ return calcInArray(params, originalParams, function (res, val) {
15552
15599
  if (res == undefined)
15553
15600
  return val;
15554
15601
  if (val == undefined || val == null)
@@ -15557,8 +15604,8 @@ function maxInArray(params) {
15557
15604
  });
15558
15605
  }
15559
15606
  FunctionFactory.Instance.register("maxInArray", maxInArray);
15560
- function countInArray(params) {
15561
- var res = calcInArray(params, function (res, val) {
15607
+ function countInArray(params, originalParams) {
15608
+ var res = calcInArray(params, originalParams, function (res, val) {
15562
15609
  if (res == undefined)
15563
15610
  res = 0;
15564
15611
  if (val == undefined || val == null)
@@ -15568,11 +15615,11 @@ function countInArray(params) {
15568
15615
  return res !== undefined ? res : 0;
15569
15616
  }
15570
15617
  FunctionFactory.Instance.register("countInArray", countInArray);
15571
- function avgInArray(params) {
15572
- var count = countInArray(params);
15618
+ function avgInArray(params, originalParams) {
15619
+ var count = countInArray(params, originalParams);
15573
15620
  if (count == 0)
15574
15621
  return 0;
15575
- return sumInArray(params) / count;
15622
+ return sumInArray(params, originalParams) / count;
15576
15623
  }
15577
15624
  FunctionFactory.Instance.register("avgInArray", avgInArray);
15578
15625
  function iif(params) {
@@ -15589,23 +15636,31 @@ function getDate(params) {
15589
15636
  return new Date(params[0]);
15590
15637
  }
15591
15638
  FunctionFactory.Instance.register("getDate", getDate);
15639
+ function dateDiffMonths(date1Param, date2Param, type) {
15640
+ if (type === "days")
15641
+ return diffDays([date1Param, date2Param]);
15642
+ var date1 = !!date1Param ? new Date(date1Param) : new Date();
15643
+ var date2 = !!date2Param ? new Date(date2Param) : new Date();
15644
+ var age = date2.getFullYear() - date1.getFullYear();
15645
+ type = type || "years";
15646
+ var ageInMonths = age * 12 + date2.getMonth() - date1.getMonth();
15647
+ if (date2.getDate() < date1.getDate()) {
15648
+ ageInMonths -= 1;
15649
+ }
15650
+ return type === "months" ? ageInMonths : ~~(ageInMonths / 12);
15651
+ }
15592
15652
  function age(params) {
15593
- if (!params && params.length < 1)
15594
- return null;
15595
- if (!params[0])
15653
+ if (!Array.isArray(params) || params.length < 1 || !params[0])
15596
15654
  return null;
15597
- var birthDate = new Date(params[0]);
15598
- var today = new Date();
15599
- var age = today.getFullYear() - birthDate.getFullYear();
15600
- if (age > 0) {
15601
- var m = today.getMonth() - birthDate.getMonth();
15602
- if (m < 0 || (m === 0 && today.getDate() < birthDate.getDate())) {
15603
- age -= 1;
15604
- }
15605
- }
15606
- return age;
15655
+ return dateDiffMonths(params[0], undefined, (params.length > 1 ? params[1] : "") || "years");
15607
15656
  }
15608
15657
  FunctionFactory.Instance.register("age", age);
15658
+ function dateDiff(params) {
15659
+ if (!Array.isArray(params) || params.length < 2 || !params[0] || !params[1])
15660
+ return null;
15661
+ return dateDiffMonths(params[0], params[1], (params.length > 2 ? params[2] : "") || "days");
15662
+ }
15663
+ FunctionFactory.Instance.register("dateDiff", dateDiff);
15609
15664
  function isContainerReadyCore(container) {
15610
15665
  if (!container)
15611
15666
  return false;
@@ -16820,6 +16875,7 @@ var map = {
16820
16875
  "./full-screen_16x16.svg": "./src/images/full-screen_16x16.svg",
16821
16876
  "./loading.svg": "./src/images/loading.svg",
16822
16877
  "./minimize_16x16.svg": "./src/images/minimize_16x16.svg",
16878
+ "./next_16x16.svg": "./src/images/next_16x16.svg",
16823
16879
  "./no-image.svg": "./src/images/no-image.svg",
16824
16880
  "./ranking-arrows.svg": "./src/images/ranking-arrows.svg",
16825
16881
  "./ranking-dash.svg": "./src/images/ranking-dash.svg",
@@ -17304,6 +17360,17 @@ module.exports = "<svg viewBox=\"0 0 16 16\" xmlns=\"http://www.w3.org/2000/svg\
17304
17360
 
17305
17361
  /***/ }),
17306
17362
 
17363
+ /***/ "./src/images/next_16x16.svg":
17364
+ /*!***********************************!*\
17365
+ !*** ./src/images/next_16x16.svg ***!
17366
+ \***********************************/
17367
+ /*! no static exports found */
17368
+ /***/ (function(module, exports) {
17369
+
17370
+ module.exports = "<svg viewBox=\"0 0 16 16\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M5.64648 12.6465L6.34648 13.3465L11.7465 8.04648L6.34648 2.64648L5.64648 3.34648L10.2465 8.04648L5.64648 12.6465Z\"></path></svg>"
17371
+
17372
+ /***/ }),
17373
+
17307
17374
  /***/ "./src/images/no-image.svg":
17308
17375
  /*!*********************************!*\
17309
17376
  !*** ./src/images/no-image.svg ***!
@@ -20212,8 +20279,10 @@ var defaultListCss = {
20212
20279
  itemWithIcon: "sv-list__item--with-icon",
20213
20280
  itemDisabled: "sv-list__item--disabled",
20214
20281
  itemFocused: "sv-list__item--focused",
20282
+ itemHovered: "sv-list__item--hovered",
20215
20283
  itemTextWrap: "sv-list__item-text--wrap",
20216
20284
  itemIcon: "sv-list__item-icon",
20285
+ itemMarkerIcon: "sv-list-item__marker-icon",
20217
20286
  itemSeparator: "sv-list__item-separator",
20218
20287
  itemBody: "sv-list__item-body",
20219
20288
  itemsContainer: "sv-list",
@@ -20239,10 +20308,17 @@ var ListModel = /** @class */ (function (_super) {
20239
20308
  if (_this.allowSelection) {
20240
20309
  _this.selectedItem = itemValue;
20241
20310
  }
20311
+ var action = itemValue.action;
20312
+ if (!!action) {
20313
+ action(itemValue);
20314
+ }
20242
20315
  if (!!_this.onSelectionChanged) {
20243
20316
  _this.onSelectionChanged(itemValue);
20244
20317
  }
20245
20318
  };
20319
+ _this.onItemHover = function (itemValue) {
20320
+ _this.mouseOverHandler(itemValue);
20321
+ };
20246
20322
  _this.isItemDisabled = function (itemValue) {
20247
20323
  return itemValue.enabled !== undefined && !itemValue.enabled;
20248
20324
  };
@@ -20265,6 +20341,7 @@ var ListModel = /** @class */ (function (_super) {
20265
20341
  .append(_this.cssClasses.itemDisabled, _this.isItemDisabled(itemValue))
20266
20342
  .append(_this.cssClasses.itemFocused, _this.isItemFocused(itemValue))
20267
20343
  .append(_this.cssClasses.itemSelected, _this.isItemSelected(itemValue))
20344
+ .append(_this.cssClasses.itemHovered, itemValue.isHovered)
20268
20345
  .append(_this.cssClasses.itemTextWrap, _this.textWrapEnabled)
20269
20346
  .append(itemValue.css)
20270
20347
  .toString();
@@ -20310,6 +20387,26 @@ var ListModel = /** @class */ (function (_super) {
20310
20387
  ListModel.prototype.isItemVisible = function (item) {
20311
20388
  return item.visible && (!this.shouldProcessFilter || this.hasText(item, this.filterString));
20312
20389
  };
20390
+ ListModel.prototype.getRenderedActions = function () {
20391
+ var actions = _super.prototype.getRenderedActions.call(this);
20392
+ if (this.filterString) {
20393
+ var newActions_1 = [];
20394
+ actions.forEach(function (action) {
20395
+ newActions_1.push(action);
20396
+ if (action.items) {
20397
+ action.items.forEach(function (item) {
20398
+ var a = new _actions_action__WEBPACK_IMPORTED_MODULE_2__["Action"](item);
20399
+ if (!a.iconName) {
20400
+ a.iconName = action.iconName;
20401
+ }
20402
+ newActions_1.push(a);
20403
+ });
20404
+ }
20405
+ });
20406
+ return newActions_1;
20407
+ }
20408
+ return actions;
20409
+ };
20313
20410
  Object.defineProperty(ListModel.prototype, "visibleItems", {
20314
20411
  get: function () {
20315
20412
  var _this = this;
@@ -20370,6 +20467,14 @@ var ListModel = /** @class */ (function (_super) {
20370
20467
  ListModel.prototype.getDefaultCssClasses = function () {
20371
20468
  return defaultListCss;
20372
20469
  };
20470
+ ListModel.prototype.popupAfterShowCallback = function (itemValue) {
20471
+ this.addScrollEventListener(function () {
20472
+ itemValue.hidePopup();
20473
+ });
20474
+ };
20475
+ ListModel.prototype.onItemLeave = function (itemValue) {
20476
+ itemValue.hidePopupDelayed(this.subItemsHideDelay);
20477
+ };
20373
20478
  ListModel.prototype.areSameItems = function (item1, item2) {
20374
20479
  if (!!this.areSameItemsCallback)
20375
20480
  return this.areSameItemsCallback(item1, item2);
@@ -23768,7 +23873,7 @@ var PageModel = /** @class */ (function (_super) {
23768
23873
  configurable: true
23769
23874
  });
23770
23875
  PageModel.prototype.calcCssClasses = function (css) {
23771
- var classes = { page: {}, error: {}, pageTitle: "", pageDescription: "", row: "", rowMultiple: "", pageRow: "", rowCompact: "", rowFadeIn: "", rowFadeOut: "", rowFadeOutActive: "" };
23876
+ var classes = { page: {}, error: {}, pageTitle: "", pageDescription: "", row: "", rowMultiple: "", pageRow: "", rowCompact: "", rowFadeIn: "", rowFadeOut: "", rowDelayedFadeIn: "" };
23772
23877
  this.copyCssClasses(classes.page, css.page);
23773
23878
  this.copyCssClasses(classes.error, css.error);
23774
23879
  if (!!css.pageTitle) {
@@ -23792,12 +23897,12 @@ var PageModel = /** @class */ (function (_super) {
23792
23897
  if (!!css.rowFadeIn) {
23793
23898
  classes.rowFadeIn = css.rowFadeIn;
23794
23899
  }
23900
+ if (!!css.rowDelayedFadeIn) {
23901
+ classes.rowDelayedFadeIn = css.rowDelayedFadeIn;
23902
+ }
23795
23903
  if (!!css.rowFadeOut) {
23796
23904
  classes.rowFadeOut = css.rowFadeOut;
23797
23905
  }
23798
- if (!!css.rowFadeOutActive) {
23799
- classes.rowFadeOutActive = css.rowFadeOutActive;
23800
- }
23801
23906
  if (this.survey) {
23802
23907
  this.survey.updatePageCssClasses(this, classes);
23803
23908
  }
@@ -24074,8 +24179,8 @@ var QuestionRowModel = /** @class */ (function (_super) {
24074
24179
  _this._scrollableParent = undefined;
24075
24180
  _this._updateVisibility = undefined;
24076
24181
  _this.visibleElementsAnimation = new _utils_animation__WEBPACK_IMPORTED_MODULE_11__["AnimationGroup"](_this.getVisibleElementsAnimationOptions(), function (value) {
24182
+ _this.setWidth(value);
24077
24183
  _this.setPropertyValue("visibleElements", value);
24078
- _this.setWidth();
24079
24184
  }, function () { return _this.visibleElements; });
24080
24185
  _this.idValue = QuestionRowModel.getRowId();
24081
24186
  _this.visible = panel.areInvisibleElementsShowing;
@@ -24164,7 +24269,9 @@ var QuestionRowModel = /** @class */ (function (_super) {
24164
24269
  el.style.setProperty("--animation-width", Object(_utils_utils__WEBPACK_IMPORTED_MODULE_8__["getElementWidth"])(el) + "px");
24165
24270
  };
24166
24271
  return {
24272
+ getRerenderEvent: function () { return _this.onElementRerendered; },
24167
24273
  isAnimationEnabled: function () { return _this.animationAllowed; },
24274
+ allowSyncRemovalAddition: false,
24168
24275
  getAnimatedElement: function (element) { return element.getWrapperElement(); },
24169
24276
  getLeaveOptions: function (element) {
24170
24277
  var surveyElement = element;
@@ -24244,12 +24351,12 @@ var QuestionRowModel = /** @class */ (function (_super) {
24244
24351
  enumerable: false,
24245
24352
  configurable: true
24246
24353
  });
24247
- QuestionRowModel.prototype.setWidth = function () {
24354
+ QuestionRowModel.prototype.setWidth = function (visibleElement) {
24248
24355
  var _a;
24249
- var visCount = this.visibleElements.length;
24356
+ var visCount = visibleElement.length;
24250
24357
  if (visCount == 0)
24251
24358
  return;
24252
- var isSingleInRow = this.visibleElements.length === 1;
24359
+ var isSingleInRow = visibleElement.length === 1;
24253
24360
  var counter = 0;
24254
24361
  var preSetWidthElements = [];
24255
24362
  for (var i = 0; i < this.elements.length; i++) {
@@ -24380,6 +24487,7 @@ var PanelModelBase = /** @class */ (function (_super) {
24380
24487
  el.style.setProperty("--animation-height", el.offsetHeight + "px");
24381
24488
  };
24382
24489
  return {
24490
+ getRerenderEvent: function () { return _this.onElementRerendered; },
24383
24491
  isAnimationEnabled: function () { return _this.animationAllowed; },
24384
24492
  getAnimatedElement: function (row) { return row.getRootElement(); },
24385
24493
  getLeaveOptions: function (_) {
@@ -24387,9 +24495,10 @@ var PanelModelBase = /** @class */ (function (_super) {
24387
24495
  onBeforeRunAnimation: beforeRunAnimation
24388
24496
  };
24389
24497
  },
24390
- getEnterOptions: function (_) {
24498
+ getEnterOptions: function (_, animationInfo) {
24499
+ var cssClasses = _this.cssClasses;
24391
24500
  return {
24392
- cssClass: _this.cssClasses.rowFadeIn,
24501
+ cssClass: new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_9__["CssClassBuilder"]().append(cssClasses.rowFadeIn).append(cssClasses.rowDelayedFadeIn, animationInfo.isDeletingRunning).toString(),
24393
24502
  onBeforeRunAnimation: beforeRunAnimation
24394
24503
  };
24395
24504
  }
@@ -24653,7 +24762,7 @@ var PanelModelBase = /** @class */ (function (_super) {
24653
24762
  configurable: true
24654
24763
  });
24655
24764
  PanelModelBase.prototype.calcCssClasses = function (css) {
24656
- var classes = { panel: {}, error: {}, row: "", rowFadeIn: "", rowFadeOut: "", rowFadeOutActive: "", rowMultiple: "", pageRow: "", rowCompact: "" };
24765
+ var classes = { panel: {}, error: {}, row: "", rowFadeIn: "", rowFadeOut: "", rowDelayedFadeIn: "", rowMultiple: "", pageRow: "", rowCompact: "" };
24657
24766
  this.copyCssClasses(classes.panel, css.panel);
24658
24767
  this.copyCssClasses(classes.error, css.error);
24659
24768
  if (!!css.pageRow) {
@@ -24671,8 +24780,8 @@ var PanelModelBase = /** @class */ (function (_super) {
24671
24780
  if (!!css.rowFadeOut) {
24672
24781
  classes.rowFadeOut = css.rowFadeOut;
24673
24782
  }
24674
- if (!!css.rowFadeOutActive) {
24675
- classes.rowFadeOutActive = css.rowFadeOutActive;
24783
+ if (!!css.rowDelayedFadeIn) {
24784
+ classes.rowDelayedFadeIn = css.rowDelayedFadeIn;
24676
24785
  }
24677
24786
  if (!!css.rowMultiple) {
24678
24787
  classes.rowMultiple = css.rowMultiple;
@@ -24992,16 +25101,13 @@ var PanelModelBase = /** @class */ (function (_super) {
24992
25101
  ? rec
24993
25102
  : {
24994
25103
  fireCallback: fireCallback,
24995
- focuseOnFirstError: focusOnFirstError,
25104
+ focusOnFirstError: focusOnFirstError,
24996
25105
  firstErrorQuestion: null,
24997
25106
  result: false,
24998
25107
  };
24999
25108
  if (rec.result !== true)
25000
25109
  rec.result = false;
25001
25110
  this.hasErrorsCore(rec);
25002
- if (rec.focuseOnFirstError && rec.firstErrorQuestion) {
25003
- rec.firstErrorQuestion.focus(true);
25004
- }
25005
25111
  return !rec.result;
25006
25112
  };
25007
25113
  PanelModelBase.prototype.validateContainerOnly = function () {
@@ -25046,13 +25152,14 @@ var PanelModelBase = /** @class */ (function (_super) {
25046
25152
  }
25047
25153
  rec.result = true;
25048
25154
  errors.push(new _error__WEBPACK_IMPORTED_MODULE_6__["OneAnswerRequiredError"](this.requiredErrorText, this));
25049
- if (rec.focuseOnFirstError && !rec.firstErrorQuestion) {
25155
+ if (rec.focusOnFirstError && !rec.firstErrorQuestion) {
25050
25156
  rec.firstErrorQuestion = visQuestions[0];
25051
25157
  }
25052
25158
  };
25053
25159
  PanelModelBase.prototype.hasErrorsCore = function (rec) {
25054
25160
  var elements = this.elements;
25055
25161
  var element = null;
25162
+ var firstErroredEl = null;
25056
25163
  for (var i = 0; i < elements.length; i++) {
25057
25164
  element = elements[i];
25058
25165
  if (!element.isVisible)
@@ -25063,6 +25170,9 @@ var PanelModelBase = /** @class */ (function (_super) {
25063
25170
  else {
25064
25171
  var question = element;
25065
25172
  if (!question.validate(rec.fireCallback, rec)) {
25173
+ if (!firstErroredEl) {
25174
+ firstErroredEl = question;
25175
+ }
25066
25176
  if (!rec.firstErrorQuestion) {
25067
25177
  rec.firstErrorQuestion = question;
25068
25178
  }
@@ -25072,6 +25182,20 @@ var PanelModelBase = /** @class */ (function (_super) {
25072
25182
  }
25073
25183
  this.hasErrorsInPanels(rec);
25074
25184
  this.updateContainsErrors();
25185
+ if (!firstErroredEl && this.errors.length > 0) {
25186
+ firstErroredEl = this.getFirstQuestionToFocus(false, true);
25187
+ if (!rec.firstErrorQuestion) {
25188
+ rec.firstErrorQuestion = firstErroredEl;
25189
+ }
25190
+ }
25191
+ if (rec.fireCallback && firstErroredEl) {
25192
+ if (firstErroredEl === rec.firstErrorQuestion && rec.focusOnFirstError) {
25193
+ firstErroredEl.focus(true);
25194
+ }
25195
+ else {
25196
+ firstErroredEl.expandAllParents();
25197
+ }
25198
+ }
25075
25199
  };
25076
25200
  PanelModelBase.prototype.getContainsErrors = function () {
25077
25201
  var res = _super.prototype.getContainsErrors.call(this);
@@ -25584,21 +25708,10 @@ var PanelModelBase = /** @class */ (function (_super) {
25584
25708
  }
25585
25709
  };
25586
25710
  PanelModelBase.prototype.notifyStateChanged = function (prevState) {
25587
- var _this = this;
25588
25711
  _super.prototype.notifyStateChanged.call(this, prevState);
25589
25712
  if (this.isCollapsed) {
25590
25713
  this.questions.forEach(function (q) { return q.onHidingContent(); });
25591
25714
  }
25592
- if (this.survey != null && !this.isLoadingFromJson && this.isExpanded && prevState === "collapsed") {
25593
- var q_1 = this.getFirstQuestionToFocus(false);
25594
- if (!!q_1) {
25595
- setTimeout(function () {
25596
- if (!_this.isDisposed && !!_this.survey) {
25597
- _this.survey.scrollElementToTop(q_1, q_1, null, q_1.inputId, false);
25598
- }
25599
- }, 15);
25600
- }
25601
- }
25602
25715
  };
25603
25716
  Object.defineProperty(PanelModelBase.prototype, "isVisible", {
25604
25717
  /**
@@ -26195,12 +26308,6 @@ var PanelModel = /** @class */ (function (_super) {
26195
26308
  this.survey.panelVisibilityChanged(this, this.isVisible);
26196
26309
  }
26197
26310
  };
26198
- PanelModel.prototype.hasErrorsCore = function (rec) {
26199
- _super.prototype.hasErrorsCore.call(this, rec);
26200
- if (this.isCollapsed && rec.result && rec.fireCallback) {
26201
- this.expand();
26202
- }
26203
- };
26204
26311
  PanelModel.prototype.getRenderedTitle = function (str) {
26205
26312
  if (!str) {
26206
26313
  if (this.isCollapsed || this.isExpanded)
@@ -26384,6 +26491,19 @@ var PanelModel = /** @class */ (function (_super) {
26384
26491
  enumerable: false,
26385
26492
  configurable: true
26386
26493
  });
26494
+ PanelModel.prototype.onElementExpanded = function (elementIsRendered) {
26495
+ var _this = this;
26496
+ if (this.survey != null && !this.isLoadingFromJson) {
26497
+ var q_1 = this.getFirstQuestionToFocus(false);
26498
+ if (!!q_1) {
26499
+ setTimeout(function () {
26500
+ if (!_this.isDisposed && !!_this.survey) {
26501
+ _this.survey.scrollElementToTop(q_1, q_1, null, q_1.inputId, false, { behavior: "smooth" });
26502
+ }
26503
+ }, elementIsRendered ? 0 : 15);
26504
+ }
26505
+ }
26506
+ };
26387
26507
  PanelModel.prototype.getCssRoot = function (cssClasses) {
26388
26508
  return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_9__["CssClassBuilder"]()
26389
26509
  .append(_super.prototype.getCssRoot.call(this, cssClasses))
@@ -26526,9 +26646,10 @@ var __decorate = (undefined && undefined.__decorate) || function (decorators, ta
26526
26646
 
26527
26647
  var PopupDropdownViewModel = /** @class */ (function (_super) {
26528
26648
  __extends(PopupDropdownViewModel, _super);
26529
- function PopupDropdownViewModel(model, targetElement) {
26649
+ function PopupDropdownViewModel(model, targetElement, areaElement) {
26530
26650
  var _this = _super.call(this, model) || this;
26531
26651
  _this.targetElement = targetElement;
26652
+ _this.areaElement = areaElement;
26532
26653
  _this.scrollEventCallBack = function (event) {
26533
26654
  if (_this.isOverlay && _utils_devices__WEBPACK_IMPORTED_MODULE_3__["IsTouch"]) {
26534
26655
  event.stopPropagation();
@@ -26566,11 +26687,24 @@ var PopupDropdownViewModel = /** @class */ (function (_super) {
26566
26687
  var width = Math.min(windowWidth, windowHeight);
26567
26688
  this.isTablet = width >= PopupDropdownViewModel.tabletSizeBreakpoint;
26568
26689
  };
26690
+ PopupDropdownViewModel.prototype.getAvailableAreaRect = function () {
26691
+ if (this.areaElement) {
26692
+ var areaRect = this.areaElement.getBoundingClientRect();
26693
+ return new _utils_popup__WEBPACK_IMPORTED_MODULE_1__["Rect"](areaRect.x, areaRect.y, areaRect.width, areaRect.height);
26694
+ }
26695
+ return new _utils_popup__WEBPACK_IMPORTED_MODULE_1__["Rect"](0, 0, _global_variables_utils__WEBPACK_IMPORTED_MODULE_6__["DomWindowHelper"].getInnerWidth(), _global_variables_utils__WEBPACK_IMPORTED_MODULE_6__["DomWindowHelper"].getInnerHeight());
26696
+ };
26697
+ PopupDropdownViewModel.prototype.getTargetElementRect = function () {
26698
+ var rect = this.targetElement.getBoundingClientRect();
26699
+ var areaRect = this.getAvailableAreaRect();
26700
+ return new _utils_popup__WEBPACK_IMPORTED_MODULE_1__["Rect"](rect.left - areaRect.left, rect.top - areaRect.top, rect.width, rect.height);
26701
+ };
26569
26702
  PopupDropdownViewModel.prototype._updatePosition = function () {
26570
26703
  var _a, _b, _c;
26571
26704
  if (!this.targetElement)
26572
26705
  return;
26573
- var targetElementRect = this.targetElement.getBoundingClientRect();
26706
+ var targetElementRect = this.getTargetElementRect();
26707
+ var area = this.getAvailableAreaRect();
26574
26708
  var popupContainer = (_a = this.container) === null || _a === void 0 ? void 0 : _a.querySelector(this.containerSelector);
26575
26709
  if (!popupContainer)
26576
26710
  return;
@@ -26587,12 +26721,13 @@ var PopupDropdownViewModel = /** @class */ (function (_super) {
26587
26721
  if (_global_variables_utils__WEBPACK_IMPORTED_MODULE_6__["DomWindowHelper"].isAvailable()) {
26588
26722
  var heightValues = [height, _global_variables_utils__WEBPACK_IMPORTED_MODULE_6__["DomWindowHelper"].getInnerHeight() * 0.9, (_c = _global_variables_utils__WEBPACK_IMPORTED_MODULE_6__["DomWindowHelper"].getVisualViewport()) === null || _c === void 0 ? void 0 : _c.height];
26589
26723
  height = Math.ceil(Math.min.apply(Math, heightValues.filter(function (each) { return typeof each === "number"; })));
26590
- verticalPosition = _utils_popup__WEBPACK_IMPORTED_MODULE_1__["PopupUtils"].updateVerticalPosition(targetElementRect, height, this.model.verticalPosition, this.model.showPointer, _global_variables_utils__WEBPACK_IMPORTED_MODULE_6__["DomWindowHelper"].getInnerHeight());
26724
+ verticalPosition = _utils_popup__WEBPACK_IMPORTED_MODULE_1__["PopupUtils"].updateVerticalPosition(targetElementRect, height, this.model.horizontalPosition, this.model.verticalPosition, area.height);
26725
+ actualHorizontalPosition = _utils_popup__WEBPACK_IMPORTED_MODULE_1__["PopupUtils"].updateHorizontalPosition(targetElementRect, width, this.model.horizontalPosition, area.width);
26591
26726
  }
26592
26727
  this.popupDirection = _utils_popup__WEBPACK_IMPORTED_MODULE_1__["PopupUtils"].calculatePopupDirection(verticalPosition, actualHorizontalPosition);
26593
- var pos = _utils_popup__WEBPACK_IMPORTED_MODULE_1__["PopupUtils"].calculatePosition(targetElementRect, height, width + marginLeft + marginRight, verticalPosition, actualHorizontalPosition, this.showHeader, this.model.positionMode);
26728
+ var pos = _utils_popup__WEBPACK_IMPORTED_MODULE_1__["PopupUtils"].calculatePosition(targetElementRect, height, width + marginLeft + marginRight, verticalPosition, actualHorizontalPosition, this.model.positionMode);
26594
26729
  if (_global_variables_utils__WEBPACK_IMPORTED_MODULE_6__["DomWindowHelper"].isAvailable()) {
26595
- var newVerticalDimensions = _utils_popup__WEBPACK_IMPORTED_MODULE_1__["PopupUtils"].getCorrectedVerticalDimensions(pos.top, height, _global_variables_utils__WEBPACK_IMPORTED_MODULE_6__["DomWindowHelper"].getInnerHeight(), verticalPosition);
26730
+ var newVerticalDimensions = _utils_popup__WEBPACK_IMPORTED_MODULE_1__["PopupUtils"].getCorrectedVerticalDimensions(pos.top, height, area.height, verticalPosition, this.model.canShrink);
26596
26731
  if (!!newVerticalDimensions) {
26597
26732
  this.height = newVerticalDimensions.height + "px";
26598
26733
  pos.top = newVerticalDimensions.top;
@@ -26614,6 +26749,8 @@ var PopupDropdownViewModel = /** @class */ (function (_super) {
26614
26749
  pos.top -= rect.top;
26615
26750
  pos.left -= rect.left;
26616
26751
  }
26752
+ pos.left += area.left;
26753
+ pos.top += area.top;
26617
26754
  this.left = pos.left + "px";
26618
26755
  this.top = pos.top + "px";
26619
26756
  if (this.showHeader) {
@@ -26651,10 +26788,11 @@ var PopupDropdownViewModel = /** @class */ (function (_super) {
26651
26788
  PopupDropdownViewModel.prototype.getPopupHeaderTemplate = function () {
26652
26789
  return "popup-pointer";
26653
26790
  };
26654
- PopupDropdownViewModel.prototype.setComponentElement = function (componentRoot, targetElement) {
26791
+ PopupDropdownViewModel.prototype.setComponentElement = function (componentRoot, targetElement, areaElement) {
26655
26792
  _super.prototype.setComponentElement.call(this, componentRoot);
26656
26793
  if (!!componentRoot && !!componentRoot.parentElement && !this.isModal) {
26657
26794
  this.targetElement = targetElement || componentRoot.parentElement;
26795
+ this.areaElement = areaElement;
26658
26796
  }
26659
26797
  };
26660
26798
  PopupDropdownViewModel.prototype.resetComponentElement = function () {
@@ -26812,6 +26950,7 @@ var PopupModalViewModel = /** @class */ (function (_super) {
26812
26950
  PopupModalViewModel.prototype.createFooterActionBar = function () {
26813
26951
  var _this = this;
26814
26952
  _super.prototype.createFooterActionBar.call(this);
26953
+ this.footerToolbar.containerCss = "sv-footer-action-bar";
26815
26954
  this.footerToolbarValue.addAction({
26816
26955
  id: "apply",
26817
26956
  visibleIndex: 20,
@@ -27468,7 +27607,11 @@ var PopupBaseViewModel = /** @class */ (function (_super) {
27468
27607
  this.model.onHiding();
27469
27608
  };
27470
27609
  PopupBaseViewModel.prototype.getLeaveOptions = function () {
27471
- return { cssClass: "sv-popup--animate-leave" };
27610
+ return { cssClass: "sv-popup--animate-leave", onBeforeRunAnimation: function (el) {
27611
+ el.setAttribute("inert", "");
27612
+ },
27613
+ onAfterRunAnimation: function (el) { return el.removeAttribute("inert"); }
27614
+ };
27472
27615
  };
27473
27616
  PopupBaseViewModel.prototype.getEnterOptions = function () {
27474
27617
  return { cssClass: "sv-popup--animate-enter" };
@@ -27479,6 +27622,7 @@ var PopupBaseViewModel = /** @class */ (function (_super) {
27479
27622
  PopupBaseViewModel.prototype.isAnimationEnabled = function () {
27480
27623
  return this.model.displayMode !== "overlay" && _settings__WEBPACK_IMPORTED_MODULE_4__["settings"].animationEnabled;
27481
27624
  };
27625
+ PopupBaseViewModel.prototype.getRerenderEvent = function () { return this.onElementRerendered; };
27482
27626
  PopupBaseViewModel.prototype.getAnimationContainer = function () {
27483
27627
  var _a;
27484
27628
  return (_a = this.container) === null || _a === void 0 ? void 0 : _a.querySelector(this.fixedPopupContainer);
@@ -27763,7 +27907,7 @@ var PopupBaseViewModel = /** @class */ (function (_super) {
27763
27907
  Object(_utils_utils__WEBPACK_IMPORTED_MODULE_5__["getElement"])(_settings__WEBPACK_IMPORTED_MODULE_4__["settings"].environment.popupMountContainer).appendChild(container);
27764
27908
  }
27765
27909
  };
27766
- PopupBaseViewModel.prototype.setComponentElement = function (componentRoot, targetElement) {
27910
+ PopupBaseViewModel.prototype.setComponentElement = function (componentRoot, targetElement, areaElement) {
27767
27911
  if (!!componentRoot) {
27768
27912
  this.containerElement = componentRoot;
27769
27913
  }
@@ -27943,6 +28087,9 @@ var PopupModel = /** @class */ (function (_super) {
27943
28087
  __decorate([
27944
28088
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])({ defaultValue: false })
27945
28089
  ], PopupModel.prototype, "isModal", void 0);
28090
+ __decorate([
28091
+ Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])({ defaultValue: true })
28092
+ ], PopupModel.prototype, "canShrink", void 0);
27946
28093
  __decorate([
27947
28094
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])({ defaultValue: true })
27948
28095
  ], PopupModel.prototype, "isFocusedContent", void 0);
@@ -29417,6 +29564,7 @@ var Question = /** @class */ (function (_super) {
29417
29564
  .append(cssClasses.hasErrorBottom, hasError && this.getErrorLocation() == "bottom")
29418
29565
  .append(cssClasses.small, !this.width)
29419
29566
  .append(cssClasses.answered, this.isAnswered)
29567
+ .append(cssClasses.noPointerEventsMode, this.isReadOnlyAttr)
29420
29568
  .toString();
29421
29569
  };
29422
29570
  Object.defineProperty(Question.prototype, "cssHeader", {
@@ -29659,7 +29807,7 @@ var Question = /** @class */ (function (_super) {
29659
29807
  Question.prototype.focuscore = function (onError, scrollIfVisible) {
29660
29808
  if (onError === void 0) { onError = false; }
29661
29809
  if (!!this.survey) {
29662
- this.expandAllParents(this);
29810
+ this.expandAllParents();
29663
29811
  this.survey.scrollElementToTop(this, this, null, this.id, scrollIfVisible);
29664
29812
  }
29665
29813
  var id = !onError
@@ -29669,14 +29817,17 @@ var Question = /** @class */ (function (_super) {
29669
29817
  this.fireCallback(this.focusCallback);
29670
29818
  }
29671
29819
  };
29672
- Question.prototype.expandAllParents = function (element) {
29820
+ Question.prototype.expandAllParents = function () {
29821
+ this.expandAllParentsCore(this);
29822
+ };
29823
+ Question.prototype.expandAllParentsCore = function (element) {
29673
29824
  if (!element)
29674
29825
  return;
29675
29826
  if (element.isCollapsed) {
29676
29827
  element.expand();
29677
29828
  }
29678
- this.expandAllParents(element.parent);
29679
- this.expandAllParents(element.parentQuestion);
29829
+ this.expandAllParentsCore(element.parent);
29830
+ this.expandAllParentsCore(element.parentQuestion);
29680
29831
  };
29681
29832
  Question.prototype.focusIn = function () {
29682
29833
  if (!this.survey || this.isDisposed || this.isContainer)
@@ -29885,6 +30036,20 @@ var Question = /** @class */ (function (_super) {
29885
30036
  enumerable: false,
29886
30037
  configurable: true
29887
30038
  });
30039
+ Object.defineProperty(Question.prototype, "isReadOnlyAttr", {
30040
+ get: function () {
30041
+ return this.isReadOnly;
30042
+ },
30043
+ enumerable: false,
30044
+ configurable: true
30045
+ });
30046
+ Object.defineProperty(Question.prototype, "isDisabledAttr", {
30047
+ get: function () {
30048
+ return this.isDesignModeV2;
30049
+ },
30050
+ enumerable: false,
30051
+ configurable: true
30052
+ });
29888
30053
  Question.prototype.onReadOnlyChanged = function () {
29889
30054
  this.setPropertyValue("isInputReadOnly", this.isInputReadOnly);
29890
30055
  _super.prototype.onReadOnlyChanged.call(this);
@@ -30500,6 +30665,13 @@ var Question = /** @class */ (function (_super) {
30500
30665
  return;
30501
30666
  this.setDefaultValue();
30502
30667
  };
30668
+ Object.defineProperty(Question.prototype, "isValueDefault", {
30669
+ get: function () {
30670
+ return !this.isEmpty() && (this.isTwoValueEquals(this.defaultValue, this.value) || !this.isValueChangedDirectly && !!this.defaultValueExpression);
30671
+ },
30672
+ enumerable: false,
30673
+ configurable: true
30674
+ });
30503
30675
  Object.defineProperty(Question.prototype, "isClearValueOnHidden", {
30504
30676
  get: function () {
30505
30677
  var clearIf = this.getClearIfInvisible();
@@ -30576,9 +30748,9 @@ var Question = /** @class */ (function (_super) {
30576
30748
  };
30577
30749
  }
30578
30750
  if (!values)
30579
- values = this.data.getFilteredValues();
30751
+ values = this.defaultValueExpression ? this.data.getFilteredValues() : {};
30580
30752
  if (!properties)
30581
- properties = this.data.getFilteredProperties();
30753
+ properties = this.defaultValueExpression ? this.data.getFilteredProperties() : {};
30582
30754
  if (!!runner && runner.canRun) {
30583
30755
  runner.onRunComplete = function (res) {
30584
30756
  if (res == undefined)
@@ -30928,13 +31100,9 @@ var Question = /** @class */ (function (_super) {
30928
31100
  Question.prototype.isTextValue = function () {
30929
31101
  return false;
30930
31102
  };
30931
- Object.defineProperty(Question.prototype, "isSurveyInputTextUpdate", {
30932
- get: function () {
30933
- return !!this.survey ? this.survey.isUpdateValueTextOnTyping : false;
30934
- },
30935
- enumerable: false,
30936
- configurable: true
30937
- });
31103
+ Question.prototype.getIsInputTextUpdate = function () {
31104
+ return !!this.survey ? this.survey.isUpdateValueTextOnTyping : false;
31105
+ };
30938
31106
  Object.defineProperty(Question.prototype, "requireStrictCompare", {
30939
31107
  get: function () { return false; },
30940
31108
  enumerable: false,
@@ -30945,7 +31113,7 @@ var Question = /** @class */ (function (_super) {
30945
31113
  };
30946
31114
  Object.defineProperty(Question.prototype, "isInputTextUpdate", {
30947
31115
  get: function () {
30948
- return this.isSurveyInputTextUpdate && this.isTextValue();
31116
+ return this.getIsInputTextUpdate() && this.isTextValue();
30949
31117
  },
30950
31118
  enumerable: false,
30951
31119
  configurable: true
@@ -30985,7 +31153,7 @@ var Question = /** @class */ (function (_super) {
30985
31153
  };
30986
31154
  Question.prototype.setCommentIntoData = function (newValue) {
30987
31155
  if (this.data != null) {
30988
- this.data.setComment(this.getValueName(), newValue, this.isSurveyInputTextUpdate ? "text" : false);
31156
+ this.data.setComment(this.getValueName(), newValue, this.getIsInputTextUpdate() ? "text" : false);
30989
31157
  }
30990
31158
  };
30991
31159
  Question.prototype.getValidName = function (name) {
@@ -31991,6 +32159,15 @@ var QuestionSelectBase = /** @class */ (function (_super) {
31991
32159
  _itemvalue__WEBPACK_IMPORTED_MODULE_3__["ItemValue"].locStrsChanged(this.choicesFromUrl);
31992
32160
  _itemvalue__WEBPACK_IMPORTED_MODULE_3__["ItemValue"].locStrsChanged(this.visibleChoices);
31993
32161
  }
32162
+ if (this.isUsingCarryForward) {
32163
+ _itemvalue__WEBPACK_IMPORTED_MODULE_3__["ItemValue"].locStrsChanged(this.visibleChoices);
32164
+ }
32165
+ };
32166
+ QuestionSelectBase.prototype.updatePrevOtherErrorValue = function (val) {
32167
+ var oldVal = this.otherValue;
32168
+ if (val !== oldVal) {
32169
+ this.prevOtherErrorValue = oldVal;
32170
+ }
31994
32171
  };
31995
32172
  Object.defineProperty(QuestionSelectBase.prototype, "otherValue", {
31996
32173
  get: function () {
@@ -31999,6 +32176,7 @@ var QuestionSelectBase = /** @class */ (function (_super) {
31999
32176
  return this.otherValueCore;
32000
32177
  },
32001
32178
  set: function (val) {
32179
+ this.updatePrevOtherErrorValue(val);
32002
32180
  if (!this.showCommentArea) {
32003
32181
  this.comment = val;
32004
32182
  }
@@ -32451,6 +32629,7 @@ var QuestionSelectBase = /** @class */ (function (_super) {
32451
32629
  this.value = val ? this.otherItem.value : undefined;
32452
32630
  };
32453
32631
  QuestionSelectBase.prototype.setQuestionComment = function (newValue) {
32632
+ this.updatePrevOtherErrorValue(newValue);
32454
32633
  if (this.showCommentArea) {
32455
32634
  _super.prototype.setQuestionComment.call(this, newValue);
32456
32635
  return;
@@ -32495,6 +32674,8 @@ var QuestionSelectBase = /** @class */ (function (_super) {
32495
32674
  return this.getPropertyValue("renderedValue", null);
32496
32675
  },
32497
32676
  set: function (val) {
32677
+ if (this.isReadOnlyAttr)
32678
+ return;
32498
32679
  this.setPropertyValue("renderedValue", val);
32499
32680
  var val = this.rendredValueToData(val);
32500
32681
  if (!this.isTwoValueEquals(val, this.value)) {
@@ -33130,6 +33311,8 @@ var QuestionSelectBase = /** @class */ (function (_super) {
33130
33311
  return questionPlainData;
33131
33312
  };
33132
33313
  QuestionSelectBase.prototype.getDisplayValueCore = function (keysAsText, value) {
33314
+ if (!this.useDisplayValuesInDynamicTexts)
33315
+ return value;
33133
33316
  return this.getChoicesDisplayValue(this.visibleChoices, value);
33134
33317
  };
33135
33318
  QuestionSelectBase.prototype.getDisplayValueEmpty = function () {
@@ -33356,7 +33539,8 @@ var QuestionSelectBase = /** @class */ (function (_super) {
33356
33539
  QuestionSelectBase.prototype.onCheckForErrors = function (errors, isOnValueChanged) {
33357
33540
  var _this = this;
33358
33541
  _super.prototype.onCheckForErrors.call(this, errors, isOnValueChanged);
33359
- if (!this.hasOther || !this.isOtherSelected || this.otherValue)
33542
+ if (!this.hasOther || !this.isOtherSelected || this.otherValue
33543
+ || isOnValueChanged && !this.prevOtherErrorValue)
33360
33544
  return;
33361
33545
  var otherEmptyError = new _error__WEBPACK_IMPORTED_MODULE_5__["OtherEmptyError"](this.otherErrorText, this);
33362
33546
  otherEmptyError.onUpdateErrorTextCallback = function (err) { err.text = _this.otherErrorText; };
@@ -33953,7 +34137,7 @@ var QuestionSelectBase = /** @class */ (function (_super) {
33953
34137
  configurable: true
33954
34138
  });
33955
34139
  QuestionSelectBase.prototype.getItemEnabled = function (item) {
33956
- return !this.isInputReadOnly && item.isEnabled;
34140
+ return !this.isDisabledAttr && item.isEnabled;
33957
34141
  };
33958
34142
  QuestionSelectBase.prototype.afterRender = function (el) {
33959
34143
  _super.prototype.afterRender.call(this, el);
@@ -34335,7 +34519,6 @@ var QuestionBooleanModel = /** @class */ (function (_super) {
34335
34519
  this.value = val == true ? this.getValueTrue() : this.getValueFalse();
34336
34520
  this.booleanValueRendered = val;
34337
34521
  }
34338
- this.updateThumbMargin();
34339
34522
  };
34340
34523
  Object.defineProperty(QuestionBooleanModel.prototype, "defaultValue", {
34341
34524
  get: function () {
@@ -34540,6 +34723,15 @@ var QuestionBooleanModel = /** @class */ (function (_super) {
34540
34723
  .append(this.cssClasses.labelFalse, !this.isIndeterminate && checked === this.swapOrder)
34541
34724
  .toString();
34542
34725
  };
34726
+ QuestionBooleanModel.prototype.updateValueFromSurvey = function (newValue, clearData) {
34727
+ if (clearData === void 0) { clearData = false; }
34728
+ _super.prototype.updateValueFromSurvey.call(this, newValue, clearData);
34729
+ this.updateThumbMargin();
34730
+ };
34731
+ QuestionBooleanModel.prototype.onValueChanged = function () {
34732
+ _super.prototype.onValueChanged.call(this);
34733
+ this.updateThumbMargin();
34734
+ };
34543
34735
  Object.defineProperty(QuestionBooleanModel.prototype, "svgIcon", {
34544
34736
  get: function () {
34545
34737
  if (this.booleanValue && this.cssClasses.svgIconCheckedId)
@@ -35159,6 +35351,8 @@ var QuestionCheckboxModel = /** @class */ (function (_super) {
35159
35351
  this.renderedValue = val;
35160
35352
  };
35161
35353
  QuestionCheckboxModel.prototype.clickItemHandler = function (item, checked) {
35354
+ if (this.isReadOnlyAttr)
35355
+ return;
35162
35356
  if (item === this.selectAllItem) {
35163
35357
  if (checked === true || checked === false) {
35164
35358
  this.isAllSelected = checked;
@@ -37043,6 +37237,9 @@ var QuestionCompositeModel = /** @class */ (function (_super) {
37043
37237
  this.contentPanel.getValue() : this.getValueForContentPanel(this.value);
37044
37238
  if (!val)
37045
37239
  val = {};
37240
+ if (!val.getType) {
37241
+ val = _helpers__WEBPACK_IMPORTED_MODULE_3__["Helpers"].getUnbindValue(val);
37242
+ }
37046
37243
  if (this.isValueEmpty(newValue) && !this.isEditingSurveyElement) {
37047
37244
  delete val[name];
37048
37245
  }
@@ -38432,7 +38629,16 @@ var QuestionFileModel = /** @class */ (function (_super) {
38432
38629
  }
38433
38630
  _this.clearFilesCore();
38434
38631
  };
38632
+ _this.doDownloadFileFromContainer = function (event) {
38633
+ event.stopPropagation();
38634
+ var currentTarget = event.currentTarget;
38635
+ if (currentTarget && currentTarget.getElementsByTagName) {
38636
+ var link = currentTarget.getElementsByTagName("a")[0];
38637
+ link === null || link === void 0 ? void 0 : link.click();
38638
+ }
38639
+ };
38435
38640
  _this.doDownloadFile = function (event, data) {
38641
+ event.stopPropagation();
38436
38642
  if (Object(_utils_utils__WEBPACK_IMPORTED_MODULE_6__["detectIEOrEdge"])()) {
38437
38643
  event.preventDefault();
38438
38644
  Object(_utils_utils__WEBPACK_IMPORTED_MODULE_6__["loadFileFromBase64"])(data.content, data.name);
@@ -39347,8 +39553,9 @@ var QuestionFileModel = /** @class */ (function (_super) {
39347
39553
  }
39348
39554
  this.clear();
39349
39555
  };
39350
- QuestionFileModel.prototype.doRemoveFile = function (data) {
39556
+ QuestionFileModel.prototype.doRemoveFile = function (data, event) {
39351
39557
  var _this = this;
39558
+ event.stopPropagation();
39352
39559
  if (this.needConfirmRemoveFile) {
39353
39560
  Object(_utils_utils__WEBPACK_IMPORTED_MODULE_6__["confirmActionAsync"])(this.getConfirmRemoveMessage(data.name), function () { _this.removeFileCore(data); }, undefined, this.getLocale(), this.survey.rootElement);
39354
39561
  return;
@@ -40718,6 +40925,16 @@ var MatrixRowModel = /** @class */ (function (_super) {
40718
40925
  enumerable: false,
40719
40926
  configurable: true
40720
40927
  });
40928
+ Object.defineProperty(MatrixRowModel.prototype, "isReadOnlyAttr", {
40929
+ get: function () { return this.data.isReadOnlyAttr; },
40930
+ enumerable: false,
40931
+ configurable: true
40932
+ });
40933
+ Object.defineProperty(MatrixRowModel.prototype, "isDisabledAttr", {
40934
+ get: function () { return !this.item.enabled || this.data.isDisabledAttr; },
40935
+ enumerable: false,
40936
+ configurable: true
40937
+ });
40721
40938
  Object.defineProperty(MatrixRowModel.prototype, "rowTextClasses", {
40722
40939
  get: function () {
40723
40940
  return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_11__["CssClassBuilder"]().append(this.data.cssClasses.rowTextCell).toString();
@@ -41556,6 +41773,7 @@ var QuestionMatrixDropdownModel = /** @class */ (function (_super) {
41556
41773
  __extends(QuestionMatrixDropdownModel, _super);
41557
41774
  function QuestionMatrixDropdownModel(name) {
41558
41775
  var _this = _super.call(this, name) || this;
41776
+ _this.defaultValuesInRows = {};
41559
41777
  _this.createLocalizableString("totalText", _this, true);
41560
41778
  _this.registerPropertyChangedHandlers(["rows"], function () {
41561
41779
  _this.clearGeneratedRows();
@@ -41678,6 +41896,29 @@ var QuestionMatrixDropdownModel = /** @class */ (function (_super) {
41678
41896
  _super.prototype.clearValueIfInvisibleCore.call(this, reason);
41679
41897
  this.clearInvisibleValuesInRows();
41680
41898
  };
41899
+ QuestionMatrixDropdownModel.prototype.clearGeneratedRows = function () {
41900
+ var _this = this;
41901
+ if (!this.generatedVisibleRows)
41902
+ return;
41903
+ if (!this.isDisposed) {
41904
+ this.generatedVisibleRows.forEach(function (row) {
41905
+ _this.defaultValuesInRows[row.rowName] = row.getNamesWithDefaultValues();
41906
+ });
41907
+ }
41908
+ _super.prototype.clearGeneratedRows.call(this);
41909
+ };
41910
+ QuestionMatrixDropdownModel.prototype.getRowValueForCreation = function (val, rowValue) {
41911
+ var res = val[rowValue];
41912
+ if (!res)
41913
+ return res;
41914
+ var names = this.defaultValuesInRows[rowValue];
41915
+ if (!Array.isArray(names) || names.length === 0)
41916
+ return res;
41917
+ names.forEach(function (name) {
41918
+ delete res[name];
41919
+ });
41920
+ return res;
41921
+ };
41681
41922
  QuestionMatrixDropdownModel.prototype.generateRows = function () {
41682
41923
  var result = new Array();
41683
41924
  var rows = !!this.filteredRows ? this.filteredRows : this.rows;
@@ -41687,9 +41928,10 @@ var QuestionMatrixDropdownModel = /** @class */ (function (_super) {
41687
41928
  if (!val)
41688
41929
  val = {};
41689
41930
  for (var i = 0; i < rows.length; i++) {
41690
- if (this.isValueEmpty(rows[i].value))
41931
+ var row = rows[i];
41932
+ if (this.isValueEmpty(row.value))
41691
41933
  continue;
41692
- result.push(this.createMatrixRow(rows[i], val[rows[i].value]));
41934
+ result.push(this.createMatrixRow(row, this.getRowValueForCreation(val, row.value)));
41693
41935
  }
41694
41936
  return result;
41695
41937
  };
@@ -42150,18 +42392,22 @@ var MatrixDropdownRowModelBase = /** @class */ (function () {
42150
42392
  }
42151
42393
  }
42152
42394
  res.row = this.getAllValues();
42395
+ this.applyRowVariablesToValues(res, this.rowIndex);
42153
42396
  return res;
42154
42397
  };
42155
42398
  MatrixDropdownRowModelBase.prototype.getFilteredProperties = function () {
42156
42399
  return { survey: this.getSurvey(), row: this };
42157
42400
  };
42401
+ MatrixDropdownRowModelBase.prototype.applyRowVariablesToValues = function (res, rowIndex) {
42402
+ res[MatrixDropdownRowModelBase.IndexVariableName] = rowIndex;
42403
+ res[MatrixDropdownRowModelBase.RowValueVariableName] = this.rowName;
42404
+ };
42158
42405
  MatrixDropdownRowModelBase.prototype.runCondition = function (values, properties) {
42159
42406
  if (!!this.data) {
42160
42407
  values[MatrixDropdownRowModelBase.OwnerVariableName] = this.data.value;
42161
42408
  }
42162
42409
  var rowIndex = this.rowIndex;
42163
- values[MatrixDropdownRowModelBase.IndexVariableName] = rowIndex;
42164
- values[MatrixDropdownRowModelBase.RowValueVariableName] = this.rowName;
42410
+ this.applyRowVariablesToValues(values, rowIndex);
42165
42411
  var newProps = _helpers__WEBPACK_IMPORTED_MODULE_2__["Helpers"].createCopy(properties);
42166
42412
  newProps[MatrixDropdownRowModelBase.RowVariableName] = this;
42167
42413
  var rowValues = rowIndex > 0 ? this.data.getRowValue(this.rowIndex - 1) : this.value;
@@ -42176,6 +42422,15 @@ var MatrixDropdownRowModelBase = /** @class */ (function () {
42176
42422
  this.detailPanel.runCondition(values, newProps);
42177
42423
  }
42178
42424
  };
42425
+ MatrixDropdownRowModelBase.prototype.getNamesWithDefaultValues = function () {
42426
+ var res = [];
42427
+ this.questions.forEach(function (q) {
42428
+ if (q.isValueDefault) {
42429
+ res.push(q.getValueName());
42430
+ }
42431
+ });
42432
+ return res;
42433
+ };
42179
42434
  MatrixDropdownRowModelBase.prototype.clearValue = function (keepComment) {
42180
42435
  var questions = this.questions;
42181
42436
  for (var i = 0; i < questions.length; i++) {
@@ -45408,6 +45663,13 @@ var MatrixDropdownColumn = /** @class */ (function (_super) {
45408
45663
  json[prop] = _this.jsonObj[prop];
45409
45664
  });
45410
45665
  }
45666
+ if (json["choicesOrder"] === "random") {
45667
+ json["choicesOrder"] = "none";
45668
+ var visChoices = this.templateQuestion["visibleChoices"];
45669
+ if (Array.isArray(visChoices)) {
45670
+ json["choices"] = visChoices;
45671
+ }
45672
+ }
45411
45673
  new _jsonobject__WEBPACK_IMPORTED_MODULE_0__["JsonObject"]().toObject(json, question);
45412
45674
  question.isContentElement = this.templateQuestion.isContentElement;
45413
45675
  this.previousChoicesId = undefined;
@@ -45430,8 +45692,12 @@ var MatrixDropdownColumn = /** @class */ (function (_super) {
45430
45692
  }
45431
45693
  if (!this.colOwner || this.isLoadingFromJson)
45432
45694
  return;
45433
- if (this.isShowInMultipleColumns && ["visibleChoices", "choices"].indexOf(name) > -1) {
45434
- this.colOwner.onShowInMultipleColumnsChanged(this);
45695
+ if (this.isShowInMultipleColumns) {
45696
+ if (name === "choicesOrder")
45697
+ return;
45698
+ if (["visibleChoices", "choices"].indexOf(name) > -1) {
45699
+ this.colOwner.onShowInMultipleColumnsChanged(this);
45700
+ }
45435
45701
  }
45436
45702
  if (!_jsonobject__WEBPACK_IMPORTED_MODULE_0__["Serializer"].hasOriginalProperty(this, name))
45437
45703
  return;
@@ -45911,11 +46177,9 @@ var QuestionMatrixDropdownRenderedTable = /** @class */ (function (_super) {
45911
46177
  function QuestionMatrixDropdownRenderedTable(matrix) {
45912
46178
  var _this = _super.call(this) || this;
45913
46179
  _this.matrix = matrix;
45914
- _this.renderedRowsChangedCallback = function () { };
45915
46180
  _this._renderedRows = [];
45916
46181
  _this.renderedRowsAnimation = new _utils_animation__WEBPACK_IMPORTED_MODULE_8__["AnimationGroup"](_this.getRenderedRowsAnimationOptions(), function (val) {
45917
46182
  _this._renderedRows = val;
45918
- _this.renderedRowsChangedCallback();
45919
46183
  }, function () { return _this._renderedRows; });
45920
46184
  _this.hasActionCellInRowsValues = {};
45921
46185
  _this.build();
@@ -45935,6 +46199,7 @@ var QuestionMatrixDropdownRenderedTable = /** @class */ (function (_super) {
45935
46199
  isAnimationEnabled: function () {
45936
46200
  return _this.animationAllowed;
45937
46201
  },
46202
+ getRerenderEvent: function () { return _this.onElementRerendered; },
45938
46203
  getAnimatedElement: function (el) {
45939
46204
  return el.getRootElement();
45940
46205
  },
@@ -46795,7 +47060,6 @@ var QuestionMatrixDropdownRenderedTable = /** @class */ (function (_super) {
46795
47060
  __decorate([
46796
47061
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["propertyArray"])({
46797
47062
  onPush: function (_, i, target) {
46798
- target.renderedRowsChangedCallback();
46799
47063
  target.updateRenderedRows();
46800
47064
  },
46801
47065
  onRemove: function (_, i, target) {
@@ -49945,6 +50209,7 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
49945
50209
  .toString();
49946
50210
  };
49947
50211
  return {
50212
+ getRerenderEvent: function () { return _this.onElementRerendered; },
49948
50213
  getAnimatedElement: function (panel) {
49949
50214
  var _a, _b;
49950
50215
  if (panel && _this.cssContent) {
@@ -51449,7 +51714,7 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
51449
51714
  this.setOnCompleteAsyncInPanel(panels[i]);
51450
51715
  }
51451
51716
  for (var i = 0; i < panels.length; i++) {
51452
- var pnlError = panels[i].hasErrors(fireCallback, !!rec && rec.focuseOnFirstError, rec);
51717
+ var pnlError = panels[i].hasErrors(fireCallback, !!rec && rec.focusOnFirstError, rec);
51453
51718
  pnlError = this.isValueDuplicated(panels[i], keyValues, rec, fireCallback) || pnlError;
51454
51719
  if (!this.isRenderModeList && pnlError && !res) {
51455
51720
  this.currentIndex = i;
@@ -52281,6 +52546,8 @@ var QuestionRadiogroupModel = /** @class */ (function (_super) {
52281
52546
  configurable: true
52282
52547
  });
52283
52548
  QuestionRadiogroupModel.prototype.clickItemHandler = function (item) {
52549
+ if (this.isReadOnlyAttr)
52550
+ return;
52284
52551
  this.renderedValue = item.value;
52285
52552
  };
52286
52553
  QuestionRadiogroupModel.prototype.getDefaultTitleActions = function () {
@@ -52353,6 +52620,7 @@ __webpack_require__.r(__webpack_exports__);
52353
52620
  /* harmony import */ var _src_settings__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../src/settings */ "./src/settings.ts");
52354
52621
  /* harmony import */ var _utils_animation__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./utils/animation */ "./src/utils/animation.ts");
52355
52622
  /* harmony import */ var _utils_dragOrClickHelper__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./utils/dragOrClickHelper */ "./src/utils/dragOrClickHelper.ts");
52623
+ /* harmony import */ var _utils_utils__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./utils/utils */ "./src/utils/utils.ts");
52356
52624
  var __extends = (undefined && undefined.__extends) || (function () {
52357
52625
  var extendStatics = function (d, b) {
52358
52626
  extendStatics = Object.setPrototypeOf ||
@@ -52386,6 +52654,7 @@ var __decorate = (undefined && undefined.__decorate) || function (decorators, ta
52386
52654
 
52387
52655
 
52388
52656
 
52657
+
52389
52658
  /**
52390
52659
  * A class that describes the Ranking question type.
52391
52660
  *
@@ -52405,33 +52674,37 @@ var QuestionRankingModel = /** @class */ (function (_super) {
52405
52674
  if (_this.visibleChoices.length === 1 && !_this.selectToRankEnabled) {
52406
52675
  _this.value = [];
52407
52676
  _this.value.push(_this.visibleChoices[0].value);
52408
- _this.updateRankingChoicesSync();
52677
+ _this.updateRankingChoices();
52409
52678
  return;
52410
52679
  }
52411
52680
  if (_this.isEmpty()) {
52412
- _this.updateRankingChoicesSync();
52681
+ _this.updateRankingChoices();
52413
52682
  return;
52414
52683
  }
52415
52684
  if (_this.selectToRankEnabled) {
52416
- _this.updateRankingChoicesSync();
52685
+ _this.updateRankingChoices();
52417
52686
  return;
52418
52687
  }
52419
52688
  if (_this.visibleChoices.length > _this.value.length)
52420
52689
  _this.addToValueByVisibleChoices();
52421
52690
  if (_this.visibleChoices.length < _this.value.length)
52422
52691
  _this.removeFromValueByVisibleChoices();
52423
- _this.updateRankingChoicesSync();
52692
+ _this.updateRankingChoices();
52424
52693
  };
52425
52694
  _this.localeChanged = function () {
52426
52695
  _super.prototype.localeChanged.call(_this);
52427
52696
  _this.updateRankingChoicesSync();
52428
52697
  };
52429
- _this._rankingChoicesAnimation = new _utils_animation__WEBPACK_IMPORTED_MODULE_10__["AnimationGroup"](_this.getChoicesAnimation(true), function (val) {
52430
- _this.setPropertyValue("rankingChoices", val);
52431
- }, function () { return _this.rankingChoices; });
52432
- _this._unRankingChoicesAnimation = new _utils_animation__WEBPACK_IMPORTED_MODULE_10__["AnimationGroup"](_this.getChoicesAnimation(false), function (val) {
52433
- _this.setPropertyValue("unRankingChoices", val);
52434
- }, function () { return _this.unRankingChoices; });
52698
+ _this._rankingChoicesAnimation = new _utils_animation__WEBPACK_IMPORTED_MODULE_10__["AnimationGroup"](_this.getChoicesAnimationOptions(true), function (val) {
52699
+ _this._renderedRankingChoices = val;
52700
+ }, function () { return _this.renderedRankingChoices; });
52701
+ _this._unRankingChoicesAnimation = new _utils_animation__WEBPACK_IMPORTED_MODULE_10__["AnimationGroup"](_this.getChoicesAnimationOptions(false), function (val) {
52702
+ _this._renderedUnRankingChoices = val;
52703
+ }, function () { return _this.renderedUnRankingChoices; });
52704
+ _this.rankingChoices = [];
52705
+ _this.unRankingChoices = [];
52706
+ _this._renderedRankingChoices = [];
52707
+ _this._renderedUnRankingChoices = [];
52435
52708
  _this.handlePointerDown = function (event, choice, node) {
52436
52709
  var target = event.target;
52437
52710
  if (!_this.isDragStartNodeValid(target))
@@ -52455,6 +52728,8 @@ var QuestionRankingModel = /** @class */ (function (_super) {
52455
52728
  }
52456
52729
  };
52457
52730
  _this.handleKeydown = function (event, choice) {
52731
+ if (_this.isReadOnlyAttr)
52732
+ return;
52458
52733
  if (!_this.isDesignMode) {
52459
52734
  var key = event.key;
52460
52735
  var index = _this.rankingChoices.indexOf(choice);
@@ -52462,27 +52737,16 @@ var QuestionRankingModel = /** @class */ (function (_super) {
52462
52737
  _this.handleKeydownSelectToRank(event, choice);
52463
52738
  return;
52464
52739
  }
52465
- if (key === "ArrowUp" && index) {
52466
- _this.handleArrowKeys(index, choice, false);
52467
- event.preventDefault();
52468
- }
52469
- if (key === "ArrowDown" && index !== _this.rankingChoices.length - 1) {
52470
- _this.handleArrowKeys(index, choice, true);
52471
- event.preventDefault();
52740
+ if ((key === "ArrowUp" && index) || (key === "ArrowDown" && index !== _this.rankingChoices.length - 1)) {
52741
+ var toIndex = key == "ArrowUp" ? index - 1 : index + 1;
52742
+ _this.dragDropRankingChoices.reorderRankedItem(_this, index, toIndex);
52743
+ _this.setValueAfterKeydown(toIndex, "", true, event);
52472
52744
  }
52473
52745
  }
52474
52746
  };
52475
- _this.handleArrowKeys = function (index, choice, isDown) {
52476
- var delta = isDown ? 1 : -1;
52477
- var choices = _this.rankingChoices;
52478
- choices.splice(index, 1);
52479
- choices.splice(index + delta, 0, choice);
52480
- _this.setValue();
52481
- setTimeout(function () {
52482
- _this.focusItem(index + delta);
52483
- }, 1);
52484
- };
52485
52747
  _this.focusItem = function (index, container) {
52748
+ if (!_this.domNode)
52749
+ return;
52486
52750
  if (_this.selectToRankEnabled && container) {
52487
52751
  var containerSelector = "[data-ranking='" + container + "']";
52488
52752
  var itemsNodes = _this.domNode.querySelectorAll(containerSelector + " " + "." + _this.cssClasses.item);
@@ -52496,16 +52760,12 @@ var QuestionRankingModel = /** @class */ (function (_super) {
52496
52760
  _this.isValueSetByUser = false;
52497
52761
  _this.setValue = function () {
52498
52762
  var value = [];
52499
- _this.rankingChoicesAnimation.cancel();
52500
- _this.unRankingChoicesAnimation.cancel();
52501
52763
  _this.rankingChoices.forEach(function (choice) {
52502
52764
  value.push(choice.value);
52503
52765
  });
52504
52766
  _this.value = value;
52505
52767
  _this.isValueSetByUser = true;
52506
52768
  };
52507
- _this.createNewArray("rankingChoices");
52508
- _this.createNewArray("unRankingChoices");
52509
52769
  _this.registerFunctionOnPropertyValueChanged("selectToRankEnabled", function () {
52510
52770
  _this.clearValue(true);
52511
52771
  _this.setDragDropRankingChoices();
@@ -52555,15 +52815,9 @@ var QuestionRankingModel = /** @class */ (function (_super) {
52555
52815
  return true;
52556
52816
  };
52557
52817
  QuestionRankingModel.prototype.getItemClassCore = function (item, options) {
52558
- var itemIndex = this.rankingChoices.indexOf(item);
52559
- var unrankedItemIndex = this.unRankingChoices.indexOf(item);
52560
- var dropTargetIndex = this.rankingChoices.indexOf(this.currentDropTarget);
52561
- var isDrop = (this.selectToRankEnabled && itemIndex > -1 && unrankedItemIndex > -1) || this.currentDropTarget === item;
52562
52818
  return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_6__["CssClassBuilder"]()
52563
52819
  .append(_super.prototype.getItemClassCore.call(this, item, options))
52564
- .append(this.cssClasses.itemGhostMod, isDrop)
52565
- .append("sv-dragdrop-movedown", itemIndex === dropTargetIndex + 1 && this.dropTargetNodeMove === "down")
52566
- .append("sv-dragdrop-moveup", itemIndex === dropTargetIndex - 1 && this.dropTargetNodeMove === "up")
52820
+ .append(this.cssClasses.itemGhostMod, this.currentDropTarget === item)
52567
52821
  .toString();
52568
52822
  };
52569
52823
  QuestionRankingModel.prototype.getContainerClasses = function (containerType) {
@@ -52571,10 +52825,10 @@ var QuestionRankingModel = /** @class */ (function (_super) {
52571
52825
  var isToContainer = containerType === "to";
52572
52826
  var isFromContainer = containerType === "from";
52573
52827
  if (isToContainer) {
52574
- isEmpty = this.rankingChoices.length === 0;
52828
+ isEmpty = this.renderedRankingChoices.length === 0;
52575
52829
  }
52576
52830
  else if (isFromContainer) {
52577
- isEmpty = this.unRankingChoices.length === 0;
52831
+ isEmpty = this.renderedUnRankingChoices.length === 0;
52578
52832
  }
52579
52833
  return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_6__["CssClassBuilder"]()
52580
52834
  .append(this.cssClasses.container)
@@ -52635,7 +52889,12 @@ var QuestionRankingModel = /** @class */ (function (_super) {
52635
52889
  _super.prototype.onSurveyValueChanged.call(this, newValue);
52636
52890
  if (this.isLoadingFromJson)
52637
52891
  return;
52638
- this.updateRankingChoicesSync();
52892
+ this.updateRankingChoices();
52893
+ };
52894
+ QuestionRankingModel.prototype.onSurveyLoad = function () {
52895
+ this.blockAnimations();
52896
+ _super.prototype.onSurveyLoad.call(this);
52897
+ this.releaseAnimations();
52639
52898
  };
52640
52899
  QuestionRankingModel.prototype.addToValueByVisibleChoices = function () {
52641
52900
  var newValue = this.value.slice();
@@ -52656,19 +52915,32 @@ var QuestionRankingModel = /** @class */ (function (_super) {
52656
52915
  }
52657
52916
  this.value = newValue;
52658
52917
  };
52659
- QuestionRankingModel.prototype.getChoicesAnimation = function (isRankingChoices) {
52918
+ QuestionRankingModel.prototype.getChoicesAnimationOptions = function (isRankingChoices) {
52660
52919
  var _this = this;
52661
52920
  return {
52662
- isAnimationEnabled: function () { return _this.animationAllowed; },
52921
+ getKey: function (item) {
52922
+ return item.value;
52923
+ },
52924
+ getRerenderEvent: function () {
52925
+ return _this.onElementRerendered;
52926
+ },
52927
+ isAnimationEnabled: function () { return _this.animationAllowed && !_this.isDesignMode && _this.isVisible && !!_this.domNode; },
52928
+ getReorderOptions: function (item, movedForward) {
52929
+ var cssClass = "";
52930
+ if (item !== _this.currentDropTarget) {
52931
+ cssClass = movedForward ? "sv-dragdrop-movedown" : "sv-dragdrop-moveup";
52932
+ }
52933
+ return { cssClass: cssClass };
52934
+ },
52663
52935
  getLeaveOptions: function (item) {
52664
- var choices = isRankingChoices ? _this.rankingChoices : _this.unRankingChoices;
52936
+ var choices = isRankingChoices ? _this.renderedRankingChoices : _this.renderedUnRankingChoices;
52665
52937
  if (_this.renderedSelectToRankAreasLayout == "vertical" && choices.length == 1 && choices.indexOf(item) >= 0) {
52666
52938
  return { cssClass: "sv-ranking-item--animate-item-removing-empty" };
52667
52939
  }
52668
52940
  return { cssClass: "sv-ranking-item--animate-item-removing" };
52669
52941
  },
52670
52942
  getEnterOptions: function (item) {
52671
- var choices = isRankingChoices ? _this.rankingChoices : _this.unRankingChoices;
52943
+ var choices = isRankingChoices ? _this.renderedRankingChoices : _this.renderedUnRankingChoices;
52672
52944
  if (_this.renderedSelectToRankAreasLayout == "vertical" && choices.length == 1 && choices.indexOf(item) >= 0) {
52673
52945
  return { cssClass: "sv-ranking-item--animate-item-adding-empty" };
52674
52946
  }
@@ -52676,9 +52948,20 @@ var QuestionRankingModel = /** @class */ (function (_super) {
52676
52948
  },
52677
52949
  getAnimatedElement: function (item) {
52678
52950
  var _a;
52679
- var containerSelector = isRankingChoices ? ".sv-ranking__container--to" : ".sv-ranking__container--from";
52680
- return (_a = _this.getWrapperElement()) === null || _a === void 0 ? void 0 : _a.querySelector(containerSelector + " .sv-ranking-item--ghost");
52681
- }
52951
+ var cssClasses = _this.cssClasses;
52952
+ var containerSelector = "";
52953
+ if (_this.selectToRankEnabled) {
52954
+ if (!isRankingChoices && cssClasses.containerFromMode) {
52955
+ containerSelector = Object(_utils_utils__WEBPACK_IMPORTED_MODULE_12__["classesToSelector"])(cssClasses.containerFromMode);
52956
+ }
52957
+ else if (isRankingChoices && cssClasses.containerToMode) {
52958
+ containerSelector = Object(_utils_utils__WEBPACK_IMPORTED_MODULE_12__["classesToSelector"])(cssClasses.containerToMode);
52959
+ }
52960
+ }
52961
+ var index = isRankingChoices ? _this.renderedRankingChoices.indexOf(item) : _this.renderedUnRankingChoices.indexOf(item);
52962
+ return (_a = _this.domNode) === null || _a === void 0 ? void 0 : _a.querySelector(containerSelector + " [data-sv-drop-target-ranking-item='" + index + "']");
52963
+ },
52964
+ allowSyncRemovalAddition: true
52682
52965
  };
52683
52966
  };
52684
52967
  Object.defineProperty(QuestionRankingModel.prototype, "rankingChoicesAnimation", {
@@ -52695,26 +52978,32 @@ var QuestionRankingModel = /** @class */ (function (_super) {
52695
52978
  enumerable: false,
52696
52979
  configurable: true
52697
52980
  });
52698
- Object.defineProperty(QuestionRankingModel.prototype, "rankingChoices", {
52981
+ Object.defineProperty(QuestionRankingModel.prototype, "renderedRankingChoices", {
52699
52982
  get: function () {
52700
- return this.getPropertyValue("rankingChoices", []);
52983
+ return this._renderedRankingChoices;
52701
52984
  },
52702
52985
  set: function (val) {
52703
- this._rankingChoicesAnimation.sync(val);
52986
+ this.rankingChoicesAnimation.sync(val);
52704
52987
  },
52705
52988
  enumerable: false,
52706
52989
  configurable: true
52707
52990
  });
52708
- Object.defineProperty(QuestionRankingModel.prototype, "unRankingChoices", {
52991
+ Object.defineProperty(QuestionRankingModel.prototype, "renderedUnRankingChoices", {
52709
52992
  get: function () {
52710
- return this.getPropertyValue("unRankingChoices", []);
52993
+ return this._renderedUnRankingChoices;
52711
52994
  },
52712
52995
  set: function (val) {
52713
- this._unRankingChoicesAnimation.sync(val);
52996
+ this.unRankingChoicesAnimation.sync(val);
52714
52997
  },
52715
52998
  enumerable: false,
52716
52999
  configurable: true
52717
53000
  });
53001
+ QuestionRankingModel.prototype.updateRenderedRankingChoices = function () {
53002
+ this.renderedRankingChoices = this.rankingChoices;
53003
+ };
53004
+ QuestionRankingModel.prototype.updateRenderedUnRankingChoices = function () {
53005
+ this.renderedUnRankingChoices = this.unRankingChoices;
53006
+ };
52718
53007
  QuestionRankingModel.prototype.updateRankingChoices = function (forceUpdate) {
52719
53008
  var _this = this;
52720
53009
  if (forceUpdate === void 0) { forceUpdate = false; }
@@ -52729,9 +53018,9 @@ var QuestionRankingModel = /** @class */ (function (_super) {
52729
53018
  // return;
52730
53019
  // }
52731
53020
  if (forceUpdate)
52732
- this.setPropertyValue("rankingChoices", []);
53021
+ this.rankingChoices = [];
52733
53022
  if (this.isEmpty()) {
52734
- this.setPropertyValue("rankingChoices", this.visibleChoices);
53023
+ this.rankingChoices = this.visibleChoices;
52735
53024
  return;
52736
53025
  }
52737
53026
  this.value.forEach(function (valueItem) {
@@ -52740,7 +53029,7 @@ var QuestionRankingModel = /** @class */ (function (_super) {
52740
53029
  newRankingChoices.push(choice);
52741
53030
  });
52742
53031
  });
52743
- this.setPropertyValue("rankingChoices", newRankingChoices);
53032
+ this.rankingChoices = newRankingChoices;
52744
53033
  };
52745
53034
  QuestionRankingModel.prototype.updateUnRankingChoices = function (newRankingChoices) {
52746
53035
  var unRankingChoices = [];
@@ -52820,6 +53109,7 @@ var QuestionRankingModel = /** @class */ (function (_super) {
52820
53109
  };
52821
53110
  //cross framework destroy
52822
53111
  QuestionRankingModel.prototype.beforeDestroyQuestionElement = function (el) {
53112
+ this.domNode = undefined;
52823
53113
  _super.prototype.beforeDestroyQuestionElement.call(this, el);
52824
53114
  };
52825
53115
  QuestionRankingModel.prototype.supportSelectAll = function () { return false; };
@@ -52848,20 +53138,16 @@ var QuestionRankingModel = /** @class */ (function (_super) {
52848
53138
  if (!this.checkMaxSelectedChoicesUnreached() || !this.canStartDragDueItemEnabled(movedElement))
52849
53139
  return;
52850
53140
  toIndex = this.value.length;
52851
- this.blockAnimations();
52852
53141
  dnd.selectToRank(this, fromIndex, toIndex);
52853
- this.releaseAnimations();
52854
- this.setValueAfterKeydown(toIndex, "to-container", isNeedFocus);
53142
+ this.setValueAfterKeydown(toIndex, "to-container", isNeedFocus, event);
52855
53143
  return;
52856
53144
  }
52857
53145
  if (!isMovedElementRanked)
52858
53146
  return;
52859
53147
  if (key === " ") {
52860
- this.blockAnimations();
52861
53148
  dnd.unselectFromRank(this, fromIndex);
52862
- this.releaseAnimations();
52863
53149
  toIndex = this.unRankingChoices.indexOf(movedElement); //'this.' leads to actual array after the 'unselectFromRank' method
52864
- this.setValueAfterKeydown(toIndex, "from-container", isNeedFocus);
53150
+ this.setValueAfterKeydown(toIndex, "from-container", isNeedFocus, event);
52865
53151
  return;
52866
53152
  }
52867
53153
  var delta = key === "ArrowUp" ? -1 : (key === "ArrowDown" ? 1 : 0);
@@ -52871,9 +53157,9 @@ var QuestionRankingModel = /** @class */ (function (_super) {
52871
53157
  if (toIndex < 0 || toIndex >= rankingChoices.length)
52872
53158
  return;
52873
53159
  dnd.reorderRankedItem(this, fromIndex, toIndex);
52874
- this.setValueAfterKeydown(toIndex, "to-container", isNeedFocus);
53160
+ this.setValueAfterKeydown(toIndex, "to-container", isNeedFocus, event);
52875
53161
  };
52876
- QuestionRankingModel.prototype.setValueAfterKeydown = function (index, container, isNeedFocus) {
53162
+ QuestionRankingModel.prototype.setValueAfterKeydown = function (index, container, isNeedFocus, event) {
52877
53163
  var _this = this;
52878
53164
  if (isNeedFocus === void 0) { isNeedFocus = true; }
52879
53165
  this.setValue();
@@ -52913,6 +53199,19 @@ var QuestionRankingModel = /** @class */ (function (_super) {
52913
53199
  enumerable: false,
52914
53200
  configurable: true
52915
53201
  });
53202
+ Object.defineProperty(QuestionRankingModel.prototype, "itemContentComponent", {
53203
+ /**
53204
+ * The name of a component used to render items.
53205
+ */
53206
+ get: function () {
53207
+ return this.getPropertyValue("itemContentComponent", "sv-ranking-item-content");
53208
+ },
53209
+ set: function (value) {
53210
+ this.setPropertyValue("itemContentComponent", value);
53211
+ },
53212
+ enumerable: false,
53213
+ configurable: true
53214
+ });
52916
53215
  Object.defineProperty(QuestionRankingModel.prototype, "selectToRankEnabled", {
52917
53216
  /**
52918
53217
  * Specifies whether users can select choices they want to rank.
@@ -53002,11 +53301,27 @@ var QuestionRankingModel = /** @class */ (function (_super) {
53002
53301
  configurable: true
53003
53302
  });
53004
53303
  __decorate([
53005
- Object(_jsonobject__WEBPACK_IMPORTED_MODULE_3__["property"])({ defaultValue: null })
53006
- ], QuestionRankingModel.prototype, "currentDropTarget", void 0);
53304
+ Object(_jsonobject__WEBPACK_IMPORTED_MODULE_3__["propertyArray"])({
53305
+ onSet: function (val, target) { return target.updateRenderedRankingChoices(); },
53306
+ onRemove: function (_, _i, target) { return target.updateRenderedRankingChoices(); },
53307
+ onPush: function (_, _i, target) { return target.updateRenderedRankingChoices(); },
53308
+ })
53309
+ ], QuestionRankingModel.prototype, "rankingChoices", void 0);
53310
+ __decorate([
53311
+ Object(_jsonobject__WEBPACK_IMPORTED_MODULE_3__["propertyArray"])({ onSet: function (val, target) { return target.updateRenderedUnRankingChoices(); },
53312
+ onRemove: function (_, _i, target) { return target.updateRenderedUnRankingChoices(); },
53313
+ onPush: function (_, _i, target) { return target.updateRenderedUnRankingChoices(); },
53314
+ })
53315
+ ], QuestionRankingModel.prototype, "unRankingChoices", void 0);
53316
+ __decorate([
53317
+ Object(_jsonobject__WEBPACK_IMPORTED_MODULE_3__["propertyArray"])()
53318
+ ], QuestionRankingModel.prototype, "_renderedRankingChoices", void 0);
53319
+ __decorate([
53320
+ Object(_jsonobject__WEBPACK_IMPORTED_MODULE_3__["propertyArray"])()
53321
+ ], QuestionRankingModel.prototype, "_renderedUnRankingChoices", void 0);
53007
53322
  __decorate([
53008
53323
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_3__["property"])({ defaultValue: null })
53009
- ], QuestionRankingModel.prototype, "dropTargetNodeMove", void 0);
53324
+ ], QuestionRankingModel.prototype, "currentDropTarget", void 0);
53010
53325
  __decorate([
53011
53326
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_3__["property"])({ defaultValue: true })
53012
53327
  ], QuestionRankingModel.prototype, "carryForwardStartUnranked", void 0);
@@ -53089,7 +53404,8 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_3__["Serializer"].addClass("ranking", [
53089
53404
  dependsOn: "selectToRankEnabled", visibleIf: function (obj) {
53090
53405
  return !!obj.selectToRankEnabled;
53091
53406
  }, isSerializable: true },
53092
- { name: "itemComponent", visible: false, default: "" }
53407
+ { name: "itemComponent", visible: false, default: "" },
53408
+ { name: "itemContentComponent", visible: false, default: "sv-ranking-item-content" },
53093
53409
  ], function () {
53094
53410
  return new QuestionRankingModel("");
53095
53411
  }, "checkbox");
@@ -53732,6 +54048,8 @@ var QuestionRatingModel = /** @class */ (function (_super) {
53732
54048
  return !isNaN(val) ? parseFloat(val) : val;
53733
54049
  };
53734
54050
  QuestionRatingModel.prototype.setValueFromClick = function (value) {
54051
+ if (this.isReadOnlyAttr)
54052
+ return;
53735
54053
  if (this.value === parseFloat(value)) {
53736
54054
  this.clearValue(true);
53737
54055
  }
@@ -55793,8 +56111,11 @@ var QuestionTextModel = /** @class */ (function (_super) {
55793
56111
  enumerable: false,
55794
56112
  configurable: true
55795
56113
  });
56114
+ QuestionTextModel.prototype.getIsInputTextUpdate = function () {
56115
+ return this.maskTypeIsEmpty ? _super.prototype.getIsInputTextUpdate.call(this) : false;
56116
+ };
55796
56117
  QuestionTextModel.prototype.supportGoNextPageAutomatic = function () {
55797
- return !this.isSurveyInputTextUpdate &&
56118
+ return !this.getIsInputTextUpdate() &&
55798
56119
  ["date", "datetime-local"].indexOf(this.inputType) < 0;
55799
56120
  };
55800
56121
  QuestionTextModel.prototype.supportGoNextPageError = function () {
@@ -56268,15 +56589,11 @@ var QuestionTextBase = /** @class */ (function (_super) {
56268
56589
  enumerable: false,
56269
56590
  configurable: true
56270
56591
  });
56271
- Object.defineProperty(QuestionTextBase.prototype, "isSurveyInputTextUpdate", {
56272
- get: function () {
56273
- if (this.textUpdateMode == "default")
56274
- return !!this.survey ? this.survey.isUpdateValueTextOnTyping : false;
56275
- return this.textUpdateMode == "onTyping";
56276
- },
56277
- enumerable: false,
56278
- configurable: true
56279
- });
56592
+ QuestionTextBase.prototype.getIsInputTextUpdate = function () {
56593
+ if (this.textUpdateMode == "default")
56594
+ return _super.prototype.getIsInputTextUpdate.call(this);
56595
+ return this.textUpdateMode == "onTyping";
56596
+ };
56280
56597
  Object.defineProperty(QuestionTextBase.prototype, "renderedPlaceholder", {
56281
56598
  get: function () {
56282
56599
  return this.getPropertyValue("renderedPlaceholder");
@@ -58076,12 +58393,12 @@ var SurveyElement = /** @class */ (function (_super) {
58076
58393
  }
58077
58394
  return info;
58078
58395
  };
58079
- SurveyElement.ScrollElementToTop = function (elementId, scrollIfVisible) {
58396
+ SurveyElement.ScrollElementToTop = function (elementId, scrollIfVisible, scrollIntoViewOptions) {
58080
58397
  var root = _settings__WEBPACK_IMPORTED_MODULE_4__["settings"].environment.root;
58081
58398
  if (!elementId || typeof root === "undefined")
58082
58399
  return false;
58083
58400
  var el = root.getElementById(elementId);
58084
- return SurveyElement.ScrollElementToViewCore(el, false, scrollIfVisible);
58401
+ return SurveyElement.ScrollElementToViewCore(el, false, scrollIfVisible, scrollIntoViewOptions);
58085
58402
  };
58086
58403
  SurveyElement.ScrollElementToViewCore = function (el, checkLeft, scrollIfVisible, scrollIntoViewOptions) {
58087
58404
  if (!el || !el.scrollIntoView)
@@ -59172,6 +59489,8 @@ var SurveyElement = /** @class */ (function (_super) {
59172
59489
  enumerable: false,
59173
59490
  configurable: true
59174
59491
  });
59492
+ SurveyElement.prototype.onElementExpanded = function (elementIsRendered) {
59493
+ };
59175
59494
  SurveyElement.prototype.getExpandCollapseAnimationOptions = function () {
59176
59495
  var _this = this;
59177
59496
  var beforeRunAnimation = function (el) {
@@ -59182,12 +59501,16 @@ var SurveyElement = /** @class */ (function (_super) {
59182
59501
  _this.isAnimatingCollapseExpand = false;
59183
59502
  };
59184
59503
  return {
59504
+ getRerenderEvent: function () { return _this.onElementRerendered; },
59185
59505
  getEnterOptions: function () {
59186
59506
  var cssClasses = _this.isPanel ? _this.cssClasses.panel : _this.cssClasses;
59187
59507
  return {
59188
59508
  cssClass: cssClasses.contentFadeIn,
59189
59509
  onBeforeRunAnimation: beforeRunAnimation,
59190
- onAfterRunAnimation: afterRunAnimation,
59510
+ onAfterRunAnimation: function (el) {
59511
+ afterRunAnimation(el);
59512
+ _this.onElementExpanded(true);
59513
+ },
59191
59514
  };
59192
59515
  },
59193
59516
  getLeaveOptions: function () {
@@ -59208,15 +59531,26 @@ var SurveyElement = /** @class */ (function (_super) {
59208
59531
  }
59209
59532
  return undefined;
59210
59533
  },
59211
- isAnimationEnabled: function () { return _this.animationAllowed && !_this.isDesignMode; }
59534
+ isAnimationEnabled: function () { return _this.isExpandCollapseAnimationEnabled; }
59212
59535
  };
59213
59536
  };
59537
+ Object.defineProperty(SurveyElement.prototype, "isExpandCollapseAnimationEnabled", {
59538
+ get: function () {
59539
+ return this.animationAllowed && !this.isDesignMode;
59540
+ },
59541
+ enumerable: false,
59542
+ configurable: true
59543
+ });
59214
59544
  Object.defineProperty(SurveyElement.prototype, "renderedIsExpanded", {
59215
59545
  get: function () {
59216
59546
  return !!this._renderedIsExpanded;
59217
59547
  },
59218
59548
  set: function (val) {
59549
+ var oldValue = this._renderedIsExpanded;
59219
59550
  this.animationCollapsed.sync(val);
59551
+ if (!this.isExpandCollapseAnimationEnabled && !oldValue && this.renderedIsExpanded) {
59552
+ this.onElementExpanded(false);
59553
+ }
59220
59554
  },
59221
59555
  enumerable: false,
59222
59556
  configurable: true
@@ -60317,10 +60651,12 @@ var SurveyModel = /** @class */ (function (_super) {
60317
60651
  component: "sv-progress-requiredquestions",
60318
60652
  data: _this
60319
60653
  });
60654
+ var tocModel = new _surveyToc__WEBPACK_IMPORTED_MODULE_24__["TOCModel"](_this);
60320
60655
  _this.addLayoutElement({
60321
60656
  id: "toc-navigation",
60322
60657
  component: "sv-navigation-toc",
60323
- data: new _surveyToc__WEBPACK_IMPORTED_MODULE_24__["TOCModel"](_this)
60658
+ data: tocModel,
60659
+ processResponsiveness: function (width) { return tocModel.updateStickyTOCSize(_this.rootElement); }
60324
60660
  });
60325
60661
  _this.layoutElements.push({
60326
60662
  id: "buttons-navigation",
@@ -63725,7 +64061,7 @@ var SurveyModel = /** @class */ (function (_super) {
63725
64061
  }
63726
64062
  var visPages = this.visiblePages;
63727
64063
  var res = true;
63728
- var rec = { fireCallback: fireCallback, focuseOnFirstError: focusOnFirstError, firstErrorQuestion: null, result: false };
64064
+ var rec = { fireCallback: fireCallback, focusOnFirstError: focusOnFirstError, firstErrorQuestion: null, result: false };
63729
64065
  for (var i = 0; i < visPages.length; i++) {
63730
64066
  if (!visPages[i].validate(fireCallback, focusOnFirstError, rec)) {
63731
64067
  res = false;
@@ -65064,7 +65400,7 @@ var SurveyModel = /** @class */ (function (_super) {
65064
65400
  this.onGetMatrixRowActions.fire(this, options);
65065
65401
  return options.actions;
65066
65402
  };
65067
- SurveyModel.prototype.scrollElementToTop = function (element, question, page, id, scrollIfVisible) {
65403
+ SurveyModel.prototype.scrollElementToTop = function (element, question, page, id, scrollIfVisible, scrollIntoViewOptions) {
65068
65404
  var options = {
65069
65405
  element: element,
65070
65406
  question: question,
@@ -65074,7 +65410,7 @@ var SurveyModel = /** @class */ (function (_super) {
65074
65410
  };
65075
65411
  this.onScrollingElementToTop.fire(this, options);
65076
65412
  if (!options.cancel) {
65077
- _survey_element__WEBPACK_IMPORTED_MODULE_3__["SurveyElement"].ScrollElementToTop(options.elementId, scrollIfVisible);
65413
+ _survey_element__WEBPACK_IMPORTED_MODULE_3__["SurveyElement"].ScrollElementToTop(options.elementId, scrollIfVisible, scrollIntoViewOptions);
65078
65414
  }
65079
65415
  };
65080
65416
  /**
@@ -68526,10 +68862,15 @@ function createTOCListModel(survey, onAction) {
68526
68862
  }
68527
68863
  function getTocRootCss(survey, isMobile) {
68528
68864
  if (isMobile === void 0) { isMobile = false; }
68865
+ var rootCss = TOCModel.RootStyle;
68529
68866
  if (isMobile) {
68530
- return "sv_progress-toc sv_progress-toc--mobile";
68867
+ return rootCss + " " + TOCModel.RootStyle + "--mobile";
68868
+ }
68869
+ rootCss += (" " + TOCModel.RootStyle + "--" + (survey.tocLocation || "").toLowerCase());
68870
+ if (TOCModel.StickyPosition) {
68871
+ rootCss += " " + TOCModel.RootStyle + "--sticky";
68531
68872
  }
68532
- return "sv_progress-toc" + (" sv_progress-toc--" + (survey.tocLocation || "").toLowerCase());
68873
+ return rootCss;
68533
68874
  }
68534
68875
  var TOCModel = /** @class */ (function () {
68535
68876
  function TOCModel(survey) {
@@ -68543,7 +68884,37 @@ var TOCModel = /** @class */ (function () {
68543
68884
  this.popupModel = new _popup__WEBPACK_IMPORTED_MODULE_5__["PopupModel"]("sv-list", { model: this.listModel });
68544
68885
  this.popupModel.overlayDisplayMode = "overlay";
68545
68886
  this.popupModel.displayMode = new _base__WEBPACK_IMPORTED_MODULE_1__["ComputedUpdater"](function () { return _this.isMobile ? "overlay" : "popup"; });
68887
+ if (TOCModel.StickyPosition) {
68888
+ survey.onAfterRenderSurvey.add(function (s, o) { return _this.initStickyTOCSubscriptions(o.htmlElement); });
68889
+ this.initStickyTOCSubscriptions(survey.rootElement);
68890
+ }
68546
68891
  }
68892
+ TOCModel.prototype.initStickyTOCSubscriptions = function (rootElement) {
68893
+ var _this = this;
68894
+ if (TOCModel.StickyPosition && !!rootElement) {
68895
+ rootElement.addEventListener("scroll", function (event) {
68896
+ _this.updateStickyTOCSize(rootElement);
68897
+ });
68898
+ this.updateStickyTOCSize(rootElement);
68899
+ }
68900
+ };
68901
+ TOCModel.prototype.updateStickyTOCSize = function (rootElement) {
68902
+ if (!rootElement) {
68903
+ return;
68904
+ }
68905
+ var tocRootElement = rootElement.querySelector("." + TOCModel.RootStyle);
68906
+ if (!!tocRootElement) {
68907
+ tocRootElement.style.height = "";
68908
+ if (!this.isMobile && TOCModel.StickyPosition && !!rootElement) {
68909
+ var rootHeight = rootElement.getBoundingClientRect().height;
68910
+ var titleSelector = this.survey.headerView === "advanced" ? ".sv-header" : ".sv_custom_header+div div." + (this.survey.css.title || "sd-title");
68911
+ var titleElement = rootElement.querySelector(titleSelector);
68912
+ var titleElementHeight = titleElement ? titleElement.getBoundingClientRect().height : 0;
68913
+ var scrollCompensationHeight = rootElement.scrollTop > titleElementHeight ? 0 : titleElementHeight - rootElement.scrollTop;
68914
+ tocRootElement.style.height = (rootHeight - scrollCompensationHeight - 2) + "px";
68915
+ }
68916
+ }
68917
+ };
68547
68918
  Object.defineProperty(TOCModel.prototype, "isMobile", {
68548
68919
  get: function () {
68549
68920
  return this.survey.isMobile;
@@ -68562,6 +68933,8 @@ var TOCModel = /** @class */ (function () {
68562
68933
  this.popupModel.dispose();
68563
68934
  this.listModel.dispose();
68564
68935
  };
68936
+ TOCModel.RootStyle = "sv_progress-toc";
68937
+ TOCModel.StickyPosition = true;
68565
68938
  return TOCModel;
68566
68939
  }());
68567
68940
 
@@ -69672,8 +70045,9 @@ __webpack_require__.r(__webpack_exports__);
69672
70045
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AnimationBoolean", function() { return AnimationBoolean; });
69673
70046
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AnimationGroup", function() { return AnimationGroup; });
69674
70047
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AnimationTab", function() { return AnimationTab; });
69675
- /* harmony import */ var _global_variables_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../global_variables_utils */ "./src/global_variables_utils.ts");
69676
- /* harmony import */ var _taskmanager__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./taskmanager */ "./src/utils/taskmanager.ts");
70048
+ /* harmony import */ var _taskmanager__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./taskmanager */ "./src/utils/taskmanager.ts");
70049
+ /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils */ "./src/utils/utils.ts");
70050
+ /* harmony import */ var _global_variables_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../global_variables_utils */ "./src/global_variables_utils.ts");
69677
70051
  var __extends = (undefined && undefined.__extends) || (function () {
69678
70052
  var extendStatics = function (d, b) {
69679
70053
  extendStatics = Object.setPrototypeOf ||
@@ -69691,6 +70065,7 @@ var __extends = (undefined && undefined.__extends) || (function () {
69691
70065
  })();
69692
70066
 
69693
70067
 
70068
+
69694
70069
  var AnimationUtils = /** @class */ (function () {
69695
70070
  function AnimationUtils() {
69696
70071
  this.cancelQueue = [];
@@ -69734,7 +70109,7 @@ var AnimationUtils = /** @class */ (function () {
69734
70109
  var animationsCount = this.getAnimationsCount(element);
69735
70110
  var onEndCallback = function (isCancel) {
69736
70111
  if (isCancel === void 0) { isCancel = true; }
69737
- options.onAfterRunAnimation && options.onAfterRunAnimation(element);
70112
+ _this.afterAnimationRun(element, options);
69738
70113
  callback(isCancel);
69739
70114
  clearTimeout(cancelTimeout);
69740
70115
  _this.removeCancelCallback(onEndCallback);
@@ -69753,9 +70128,15 @@ var AnimationUtils = /** @class */ (function () {
69753
70128
  }, this.getAnimationDuration(element) + 10);
69754
70129
  }
69755
70130
  else {
70131
+ this.afterAnimationRun(element, options);
69756
70132
  callback(true);
69757
70133
  }
69758
70134
  };
70135
+ AnimationUtils.prototype.afterAnimationRun = function (element, options) {
70136
+ if (element && options) {
70137
+ options.onAfterRunAnimation && options.onAfterRunAnimation(element);
70138
+ }
70139
+ };
69759
70140
  AnimationUtils.prototype.beforeAnimationRun = function (element, options) {
69760
70141
  if (element && options) {
69761
70142
  options.onBeforeRunAnimation && options.onBeforeRunAnimation(element);
@@ -69765,7 +70146,7 @@ var AnimationUtils = /** @class */ (function () {
69765
70146
  return options.cssClass.replace(/\s+$/, "").split(/\s+/);
69766
70147
  };
69767
70148
  AnimationUtils.prototype.runAnimation = function (element, options, callback) {
69768
- if (element && options.cssClass) {
70149
+ if (element && (options === null || options === void 0 ? void 0 : options.cssClass)) {
69769
70150
  this.reflow(element);
69770
70151
  this.getCssClasses(options).forEach(function (cssClass) {
69771
70152
  element.classList.add(cssClass);
@@ -69783,30 +70164,24 @@ var AnimationUtils = /** @class */ (function () {
69783
70164
  });
69784
70165
  }
69785
70166
  };
69786
- AnimationUtils.prototype.onNextRender = function (callback, runEarly, isCancel) {
70167
+ AnimationUtils.prototype.onNextRender = function (callback, isCancel) {
69787
70168
  var _this = this;
69788
70169
  if (isCancel === void 0) { isCancel = false; }
69789
- if (!isCancel && _global_variables_utils__WEBPACK_IMPORTED_MODULE_0__["DomWindowHelper"].isAvailable()) {
70170
+ if (!isCancel && _global_variables_utils__WEBPACK_IMPORTED_MODULE_2__["DomWindowHelper"].isAvailable()) {
69790
70171
  var cancelCallback_1 = function () {
69791
- callback();
70172
+ callback(true);
69792
70173
  cancelAnimationFrame(latestRAF_1);
69793
70174
  };
69794
- var latestRAF_1 = _global_variables_utils__WEBPACK_IMPORTED_MODULE_0__["DomWindowHelper"].requestAnimationFrame(function () {
69795
- if (runEarly && runEarly()) {
69796
- callback();
70175
+ var latestRAF_1 = _global_variables_utils__WEBPACK_IMPORTED_MODULE_2__["DomWindowHelper"].requestAnimationFrame(function () {
70176
+ latestRAF_1 = _global_variables_utils__WEBPACK_IMPORTED_MODULE_2__["DomWindowHelper"].requestAnimationFrame(function () {
70177
+ callback(false);
69797
70178
  _this.removeCancelCallback(cancelCallback_1);
69798
- }
69799
- else {
69800
- latestRAF_1 = _global_variables_utils__WEBPACK_IMPORTED_MODULE_0__["DomWindowHelper"].requestAnimationFrame(function () {
69801
- callback();
69802
- _this.removeCancelCallback(cancelCallback_1);
69803
- });
69804
- }
70179
+ });
69805
70180
  });
69806
70181
  this.addCancelCallback(cancelCallback_1);
69807
70182
  }
69808
70183
  else {
69809
- callback();
70184
+ callback(true);
69810
70185
  }
69811
70186
  };
69812
70187
  AnimationUtils.prototype.cancel = function () {
@@ -69824,25 +70199,23 @@ var AnimationPropertyUtils = /** @class */ (function (_super) {
69824
70199
  }
69825
70200
  AnimationPropertyUtils.prototype.onEnter = function (options) {
69826
70201
  var _this = this;
69827
- this.onNextRender(function () {
69828
- var htmlElement = options.getAnimatedElement();
69829
- var enterOptions = options.getEnterOptions();
69830
- _this.beforeAnimationRun(htmlElement, enterOptions);
69831
- _this.runAnimation(htmlElement, enterOptions, function () {
69832
- _this.clearHtmlElement(htmlElement, enterOptions);
69833
- });
69834
- }, function () { return !!options.getAnimatedElement(); });
70202
+ var htmlElement = options.getAnimatedElement();
70203
+ var enterOptions = options.getEnterOptions ? options.getEnterOptions() : {};
70204
+ this.beforeAnimationRun(htmlElement, enterOptions);
70205
+ this.runAnimation(htmlElement, enterOptions, function () {
70206
+ _this.clearHtmlElement(htmlElement, enterOptions);
70207
+ });
69835
70208
  };
69836
70209
  AnimationPropertyUtils.prototype.onLeave = function (options, callback) {
69837
70210
  var _this = this;
69838
70211
  var htmlElement = options.getAnimatedElement();
69839
- var leaveOptions = options.getLeaveOptions();
70212
+ var leaveOptions = options.getLeaveOptions ? options.getLeaveOptions() : {};
69840
70213
  this.beforeAnimationRun(htmlElement, leaveOptions);
69841
70214
  this.runAnimation(htmlElement, leaveOptions, function (isCancel) {
69842
70215
  callback();
69843
70216
  _this.onNextRender(function () {
69844
70217
  _this.clearHtmlElement(htmlElement, leaveOptions);
69845
- }, undefined, isCancel);
70218
+ }, isCancel);
69846
70219
  });
69847
70220
  };
69848
70221
  return AnimationPropertyUtils;
@@ -69853,40 +70226,54 @@ var AnimationGroupUtils = /** @class */ (function (_super) {
69853
70226
  function AnimationGroupUtils() {
69854
70227
  return _super !== null && _super.apply(this, arguments) || this;
69855
70228
  }
69856
- AnimationGroupUtils.prototype.runGroupAnimation = function (options, addedElements, removedElements, callback) {
70229
+ AnimationGroupUtils.prototype.runGroupAnimation = function (options, addedItems, removedItems, reorderedItems, callback) {
69857
70230
  var _this = this;
69858
- this.onNextRender(function () {
69859
- var addedHtmlElements = addedElements.map(function (el) { return options.getAnimatedElement(el); });
69860
- var enterOptions = addedElements.map(function (el) { return options.getEnterOptions(el); });
69861
- var removedHtmlElements = removedElements.map(function (el) { return options.getAnimatedElement(el); });
69862
- var leaveOptions = removedElements.map(function (el) { return options.getLeaveOptions(el); });
69863
- addedElements.forEach(function (_, i) {
69864
- _this.beforeAnimationRun(addedHtmlElements[i], enterOptions[i]);
69865
- });
69866
- removedElements.forEach(function (_, i) {
69867
- _this.beforeAnimationRun(removedHtmlElements[i], leaveOptions[i]);
69868
- });
69869
- var counter = addedElements.length + removedElements.length;
69870
- var onAnimationEndCallback = function (isCancel) {
69871
- if (--counter <= 0) {
69872
- callback && callback();
69873
- _this.onNextRender(function () {
69874
- addedElements.forEach(function (_, i) {
69875
- _this.clearHtmlElement(addedHtmlElements[i], enterOptions[i]);
69876
- });
69877
- removedElements.forEach(function (_, i) {
69878
- _this.clearHtmlElement(removedHtmlElements[i], leaveOptions[i]);
69879
- });
69880
- }, undefined, isCancel);
69881
- }
69882
- };
69883
- addedElements.forEach(function (_, i) {
69884
- _this.runAnimation(addedHtmlElements[i], enterOptions[i], onAnimationEndCallback);
69885
- });
69886
- removedElements.forEach(function (_, i) {
69887
- _this.runAnimation(removedHtmlElements[i], leaveOptions[i], onAnimationEndCallback);
69888
- });
69889
- }, function () { return addedElements.length == 0 || addedElements.some(function (el) { return !!options.getAnimatedElement(el); }); });
70231
+ var info = {
70232
+ isAddingRunning: addedItems.length > 0,
70233
+ isDeletingRunning: removedItems.length > 0,
70234
+ isReorderingRunning: reorderedItems.length > 0
70235
+ };
70236
+ var addedHtmlElements = addedItems.map(function (el) { return options.getAnimatedElement(el); });
70237
+ var enterOptions = addedItems.map(function (el) { return options.getEnterOptions ? options.getEnterOptions(el, info) : {}; });
70238
+ var removedHtmlElements = removedItems.map(function (el) { return options.getAnimatedElement(el); });
70239
+ var leaveOptions = removedItems.map(function (el) { return options.getLeaveOptions ? options.getLeaveOptions(el, info) : {}; });
70240
+ var reorderedHtmlElements = reorderedItems.map(function (el) { return options.getAnimatedElement(el.item); });
70241
+ var reorderedOptions = reorderedItems.map(function (el) { return options.getReorderOptions ? options.getReorderOptions(el.item, el.movedForward, info) : {}; });
70242
+ addedItems.forEach(function (_, i) {
70243
+ _this.beforeAnimationRun(addedHtmlElements[i], enterOptions[i]);
70244
+ });
70245
+ removedItems.forEach(function (_, i) {
70246
+ _this.beforeAnimationRun(removedHtmlElements[i], leaveOptions[i]);
70247
+ });
70248
+ reorderedItems.forEach(function (_, i) {
70249
+ _this.beforeAnimationRun(reorderedHtmlElements[i], reorderedOptions[i]);
70250
+ });
70251
+ var counter = addedItems.length + removedItems.length + reorderedHtmlElements.length;
70252
+ var onAnimationEndCallback = function (isCancel) {
70253
+ if (--counter <= 0) {
70254
+ callback && callback();
70255
+ _this.onNextRender(function () {
70256
+ addedItems.forEach(function (_, i) {
70257
+ _this.clearHtmlElement(addedHtmlElements[i], enterOptions[i]);
70258
+ });
70259
+ removedItems.forEach(function (_, i) {
70260
+ _this.clearHtmlElement(removedHtmlElements[i], leaveOptions[i]);
70261
+ });
70262
+ reorderedItems.forEach(function (_, i) {
70263
+ _this.clearHtmlElement(reorderedHtmlElements[i], reorderedOptions[i]);
70264
+ });
70265
+ }, isCancel);
70266
+ }
70267
+ };
70268
+ addedItems.forEach(function (_, i) {
70269
+ _this.runAnimation(addedHtmlElements[i], enterOptions[i], onAnimationEndCallback);
70270
+ });
70271
+ removedItems.forEach(function (_, i) {
70272
+ _this.runAnimation(removedHtmlElements[i], leaveOptions[i], onAnimationEndCallback);
70273
+ });
70274
+ reorderedItems.forEach(function (_, i) {
70275
+ _this.runAnimation(reorderedHtmlElements[i], reorderedOptions[i], onAnimationEndCallback);
70276
+ });
69890
70277
  };
69891
70278
  return AnimationGroupUtils;
69892
70279
  }(AnimationUtils));
@@ -69897,11 +70284,51 @@ var AnimationProperty = /** @class */ (function () {
69897
70284
  this.animationOptions = animationOptions;
69898
70285
  this.update = update;
69899
70286
  this.getCurrentValue = getCurrentValue;
69900
- this._debouncedSync = Object(_taskmanager__WEBPACK_IMPORTED_MODULE_1__["debounce"])(function (newValue) {
70287
+ this._debouncedSync = Object(_taskmanager__WEBPACK_IMPORTED_MODULE_0__["debounce"])(function (newValue) {
69901
70288
  _this.animation.cancel();
69902
- _this._sync(newValue);
70289
+ try {
70290
+ _this._sync(newValue);
70291
+ }
70292
+ catch (_a) {
70293
+ _this.update(newValue);
70294
+ }
69903
70295
  });
69904
70296
  }
70297
+ AnimationProperty.prototype.onNextRender = function (callback, onCancel) {
70298
+ var _this = this;
70299
+ var rerenderEvent = this.animationOptions.getRerenderEvent();
70300
+ if (!rerenderEvent) {
70301
+ if (_global_variables_utils__WEBPACK_IMPORTED_MODULE_2__["DomWindowHelper"].isAvailable()) {
70302
+ var raf_1 = _global_variables_utils__WEBPACK_IMPORTED_MODULE_2__["DomWindowHelper"].requestAnimationFrame(function () {
70303
+ callback();
70304
+ _this.cancelCallback = undefined;
70305
+ });
70306
+ this.cancelCallback = function () {
70307
+ onCancel && onCancel();
70308
+ cancelAnimationFrame(raf_1);
70309
+ _this.cancelCallback = undefined;
70310
+ };
70311
+ }
70312
+ else {
70313
+ throw new Error("Can't get next render");
70314
+ }
70315
+ }
70316
+ else {
70317
+ var clear_1 = function () {
70318
+ rerenderEvent.remove(nextRenderCallback_1);
70319
+ _this.cancelCallback = undefined;
70320
+ };
70321
+ var nextRenderCallback_1 = function () {
70322
+ callback();
70323
+ clear_1();
70324
+ };
70325
+ this.cancelCallback = function () {
70326
+ onCancel && onCancel();
70327
+ clear_1();
70328
+ };
70329
+ rerenderEvent.add(nextRenderCallback_1);
70330
+ }
70331
+ };
69905
70332
  AnimationProperty.prototype.sync = function (newValue) {
69906
70333
  if (this.animationOptions.isAnimationEnabled()) {
69907
70334
  this._debouncedSync.run(newValue);
@@ -69912,8 +70339,9 @@ var AnimationProperty = /** @class */ (function () {
69912
70339
  }
69913
70340
  };
69914
70341
  AnimationProperty.prototype.cancel = function () {
69915
- this.animation.cancel();
69916
70342
  this._debouncedSync.cancel();
70343
+ this.cancelCallback && this.cancelCallback();
70344
+ this.animation.cancel();
69917
70345
  };
69918
70346
  return AnimationProperty;
69919
70347
  }());
@@ -69929,8 +70357,10 @@ var AnimationBoolean = /** @class */ (function (_super) {
69929
70357
  var _this = this;
69930
70358
  if (newValue !== this.getCurrentValue()) {
69931
70359
  if (newValue) {
70360
+ this.onNextRender(function () {
70361
+ _this.animation.onEnter(_this.animationOptions);
70362
+ });
69932
70363
  this.update(newValue);
69933
- this.animation.onEnter(this.animationOptions);
69934
70364
  }
69935
70365
  else {
69936
70366
  this.animation.onLeave(this.animationOptions, function () {
@@ -69954,15 +70384,34 @@ var AnimationGroup = /** @class */ (function (_super) {
69954
70384
  }
69955
70385
  AnimationGroup.prototype._sync = function (newValue) {
69956
70386
  var _this = this;
70387
+ var _a, _b;
69957
70388
  var oldValue = this.getCurrentValue();
69958
- var itemsToAdd = newValue.filter(function (el) { return oldValue.indexOf(el) < 0; });
69959
- var deletedItems = oldValue.filter(function (el) { return newValue.indexOf(el) < 0; });
69960
- if (itemsToAdd.length == 0 && (deletedItems === null || deletedItems === void 0 ? void 0 : deletedItems.length) > 0) {
69961
- this.animation.runGroupAnimation(this.animationOptions, [], deletedItems, function () { return _this.update(newValue); });
70389
+ var allowSyncRemovalAddition = (_a = this.animationOptions.allowSyncRemovalAddition) !== null && _a !== void 0 ? _a : true;
70390
+ var _c = Object(_utils__WEBPACK_IMPORTED_MODULE_1__["compareArrays"])(oldValue, newValue, (_b = this.animationOptions.getKey) !== null && _b !== void 0 ? _b : (function (item) { return item; })), addedItems = _c.addedItems, deletedItems = _c.deletedItems, reorderedItems = _c.reorderedItems, mergedItems = _c.mergedItems;
70391
+ if (!allowSyncRemovalAddition && (reorderedItems.length > 0 || addedItems.length > 0)) {
70392
+ deletedItems = [];
70393
+ mergedItems = newValue;
70394
+ }
70395
+ var runAnimationCallback = function () {
70396
+ _this.animation.runGroupAnimation(_this.animationOptions, addedItems, deletedItems, reorderedItems, function () {
70397
+ if (deletedItems.length > 0) {
70398
+ _this.update(newValue);
70399
+ }
70400
+ });
70401
+ };
70402
+ if ([addedItems, deletedItems, reorderedItems].some(function (arr) { return arr.length > 0; })) {
70403
+ if (deletedItems.length <= 0 || reorderedItems.length > 0 || addedItems.length > 0) {
70404
+ this.onNextRender(runAnimationCallback, function () {
70405
+ _this.update(newValue);
70406
+ });
70407
+ this.update(mergedItems);
70408
+ }
70409
+ else {
70410
+ runAnimationCallback();
70411
+ }
69962
70412
  }
69963
70413
  else {
69964
70414
  this.update(newValue);
69965
- this.animation.runGroupAnimation(this.animationOptions, itemsToAdd, []);
69966
70415
  }
69967
70416
  };
69968
70417
  return AnimationGroup;
@@ -69981,10 +70430,12 @@ var AnimationTab = /** @class */ (function (_super) {
69981
70430
  var oldValue = [].concat(this.getCurrentValue());
69982
70431
  if (oldValue[0] !== newValue[0]) {
69983
70432
  var tempValue = !!this.mergeValues ? this.mergeValues(newValue, oldValue) : [].concat(oldValue, newValue);
70433
+ this.onNextRender(function () {
70434
+ _this.animation.runGroupAnimation(_this.animationOptions, newValue, oldValue, [], function () {
70435
+ _this.update(newValue);
70436
+ });
70437
+ }, function () { return _this.update(newValue); });
69984
70438
  this.update(tempValue, true);
69985
- this.animation.runGroupAnimation(this.animationOptions, newValue, oldValue, function () {
69986
- _this.update(newValue);
69987
- });
69988
70439
  }
69989
70440
  else {
69990
70441
  this.update(newValue);
@@ -70378,16 +70829,55 @@ var DragOrClickHelper = /** @class */ (function () {
70378
70829
  /*!****************************!*\
70379
70830
  !*** ./src/utils/popup.ts ***!
70380
70831
  \****************************/
70381
- /*! exports provided: PopupUtils */
70832
+ /*! exports provided: Rect, PopupUtils */
70382
70833
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
70383
70834
 
70384
70835
  "use strict";
70385
70836
  __webpack_require__.r(__webpack_exports__);
70837
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Rect", function() { return Rect; });
70386
70838
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PopupUtils", function() { return PopupUtils; });
70839
+ var Rect = /** @class */ (function () {
70840
+ function Rect(x, y, width, height) {
70841
+ this.x = x;
70842
+ this.y = y;
70843
+ this.width = width;
70844
+ this.height = height;
70845
+ }
70846
+ Object.defineProperty(Rect.prototype, "left", {
70847
+ get: function () {
70848
+ return this.x;
70849
+ },
70850
+ enumerable: false,
70851
+ configurable: true
70852
+ });
70853
+ Object.defineProperty(Rect.prototype, "top", {
70854
+ get: function () {
70855
+ return this.y;
70856
+ },
70857
+ enumerable: false,
70858
+ configurable: true
70859
+ });
70860
+ Object.defineProperty(Rect.prototype, "right", {
70861
+ get: function () {
70862
+ return this.x + this.width;
70863
+ },
70864
+ enumerable: false,
70865
+ configurable: true
70866
+ });
70867
+ Object.defineProperty(Rect.prototype, "bottom", {
70868
+ get: function () {
70869
+ return this.y + this.height;
70870
+ },
70871
+ enumerable: false,
70872
+ configurable: true
70873
+ });
70874
+ return Rect;
70875
+ }());
70876
+
70387
70877
  var PopupUtils = /** @class */ (function () {
70388
70878
  function PopupUtils() {
70389
70879
  }
70390
- PopupUtils.calculatePosition = function (targetRect, height, width, verticalPosition, horizontalPosition, showPointer, positionMode) {
70880
+ PopupUtils.calculatePosition = function (targetRect, height, width, verticalPosition, horizontalPosition, positionMode) {
70391
70881
  if (positionMode === void 0) { positionMode = "flex"; }
70392
70882
  var currentLeft = targetRect.left;
70393
70883
  var currentTop = targetRect.top;
@@ -70405,29 +70895,33 @@ var PopupUtils = /** @class */ (function () {
70405
70895
  currentTop = targetRect.top - height;
70406
70896
  else
70407
70897
  currentTop = targetRect.bottom;
70408
- if (showPointer) {
70409
- if (horizontalPosition != "center" && verticalPosition != "middle") {
70410
- if (verticalPosition == "top") {
70411
- currentTop = currentTop + targetRect.height;
70412
- }
70413
- else {
70414
- currentTop = currentTop - targetRect.height;
70415
- }
70898
+ if (horizontalPosition != "center" && verticalPosition != "middle") {
70899
+ if (verticalPosition == "top") {
70900
+ currentTop = currentTop + targetRect.height;
70901
+ }
70902
+ else {
70903
+ currentTop = currentTop - targetRect.height;
70416
70904
  }
70417
70905
  }
70418
70906
  return { left: Math.round(currentLeft), top: Math.round(currentTop) };
70419
70907
  };
70420
- PopupUtils.getCorrectedVerticalDimensions = function (top, height, windowHeight, verticalPosition) {
70908
+ PopupUtils.getCorrectedVerticalDimensions = function (top, height, windowHeight, verticalPosition, canShrink) {
70909
+ if (canShrink === void 0) { canShrink = true; }
70421
70910
  var result;
70911
+ var maxHeight = windowHeight - PopupUtils.bottomIndent;
70422
70912
  if (verticalPosition === "top") {
70423
70913
  result = { height: height, top: top };
70424
70914
  }
70425
70915
  if (top < 0) {
70426
- result = { height: height + top, top: 0 };
70916
+ result = { height: canShrink ? height + top : height, top: 0 };
70427
70917
  }
70428
70918
  else if (height + top > windowHeight) {
70429
- var newHeight = Math.min(height, windowHeight - top - PopupUtils.bottomIndent);
70430
- result = { height: newHeight, top: top };
70919
+ var newHeight = Math.min(height, maxHeight - top);
70920
+ result = { height: canShrink ? newHeight : height, top: canShrink ? top : top - (height - newHeight) };
70921
+ }
70922
+ if (result) {
70923
+ result.height = Math.min(result.height, maxHeight);
70924
+ result.top = Math.max(result.top, 0);
70431
70925
  }
70432
70926
  return result;
70433
70927
  };
@@ -70468,18 +70962,15 @@ var PopupUtils = /** @class */ (function () {
70468
70962
  }
70469
70963
  return { width: newWidth - margins.left - margins.right, left: newLeft };
70470
70964
  };
70471
- PopupUtils.updateVerticalPosition = function (targetRect, height, verticalPosition, showPointer, windowHeight) {
70472
- var deltaTop = height - (targetRect.top + (showPointer ? targetRect.height : 0));
70473
- var deltaBottom = height +
70474
- targetRect.bottom -
70475
- (showPointer ? targetRect.height : 0) -
70476
- windowHeight;
70965
+ PopupUtils.updateVerticalPosition = function (targetRect, height, horizontalPosition, verticalPosition, windowHeight) {
70966
+ if (verticalPosition === "middle")
70967
+ return verticalPosition;
70968
+ var deltaTop = height - (targetRect.top + (horizontalPosition !== "center" ? targetRect.height : 0));
70969
+ var deltaBottom = height + targetRect.bottom - (horizontalPosition !== "center" ? targetRect.height : 0) - windowHeight;
70477
70970
  if (deltaTop > 0 && deltaBottom <= 0 && verticalPosition == "top") {
70478
70971
  verticalPosition = "bottom";
70479
70972
  }
70480
- else if (deltaBottom > 0 &&
70481
- deltaTop <= 0 &&
70482
- verticalPosition == "bottom") {
70973
+ else if (deltaBottom > 0 && deltaTop <= 0 && verticalPosition == "bottom") {
70483
70974
  verticalPosition = "top";
70484
70975
  }
70485
70976
  else if (deltaBottom > 0 && deltaTop > 0) {
@@ -70487,6 +70978,22 @@ var PopupUtils = /** @class */ (function () {
70487
70978
  }
70488
70979
  return verticalPosition;
70489
70980
  };
70981
+ PopupUtils.updateHorizontalPosition = function (targetRect, width, horizontalPosition, windowWidth) {
70982
+ if (horizontalPosition === "center")
70983
+ return horizontalPosition;
70984
+ var deltaLeft = width - targetRect.left;
70985
+ var deltaRight = width + targetRect.right - windowWidth;
70986
+ if (deltaLeft > 0 && deltaRight <= 0 && horizontalPosition == "left") {
70987
+ horizontalPosition = "right";
70988
+ }
70989
+ else if (deltaRight > 0 && deltaLeft <= 0 && horizontalPosition == "right") {
70990
+ horizontalPosition = "left";
70991
+ }
70992
+ else if (deltaRight > 0 && deltaLeft > 0) {
70993
+ horizontalPosition = deltaLeft < deltaRight ? "left" : "right";
70994
+ }
70995
+ return horizontalPosition;
70996
+ };
70490
70997
  PopupUtils.calculatePopupDirection = function (verticalPosition, horizontalPosition) {
70491
70998
  var popupDirection;
70492
70999
  if (horizontalPosition == "center" && verticalPosition != "middle") {
@@ -70851,7 +71358,7 @@ function debounce(func) {
70851
71358
  /*!****************************!*\
70852
71359
  !*** ./src/utils/utils.ts ***!
70853
71360
  \****************************/
70854
- /*! exports provided: unwrap, getRenderedSize, getRenderedStyleSize, doKey2ClickBlur, doKey2ClickUp, doKey2ClickDown, sanitizeEditableContent, Logger, showConfirmDialog, configConfirmDialog, mergeValues, getElementWidth, isContainerVisible, classesToSelector, compareVersions, confirmAction, confirmActionAsync, detectIEOrEdge, detectIEBrowser, loadFileFromBase64, isMobile, isShadowDOM, getElement, isElementVisible, findScrollableParent, scrollElementByChildId, navigateToUrl, wrapUrlForBackgroundImage, createSvg, getIconNameFromProxy, increaseHeightByContent, getOriginalEvent, preventDefaults, findParentByClassNames, getFirstVisibleChild, chooseFiles */
71361
+ /*! exports provided: unwrap, getRenderedSize, getRenderedStyleSize, doKey2ClickBlur, doKey2ClickUp, doKey2ClickDown, sanitizeEditableContent, Logger, showConfirmDialog, configConfirmDialog, compareArrays, mergeValues, getElementWidth, isContainerVisible, classesToSelector, compareVersions, confirmAction, confirmActionAsync, detectIEOrEdge, detectIEBrowser, loadFileFromBase64, isMobile, isShadowDOM, getElement, isElementVisible, findScrollableParent, scrollElementByChildId, navigateToUrl, wrapUrlForBackgroundImage, createSvg, getIconNameFromProxy, increaseHeightByContent, getOriginalEvent, preventDefaults, findParentByClassNames, getFirstVisibleChild, chooseFiles */
70855
71362
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
70856
71363
 
70857
71364
  "use strict";
@@ -70866,6 +71373,7 @@ __webpack_require__.r(__webpack_exports__);
70866
71373
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Logger", function() { return Logger; });
70867
71374
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "showConfirmDialog", function() { return showConfirmDialog; });
70868
71375
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "configConfirmDialog", function() { return configConfirmDialog; });
71376
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "compareArrays", function() { return compareArrays; });
70869
71377
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mergeValues", function() { return mergeValues; });
70870
71378
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getElementWidth", function() { return getElementWidth; });
70871
71379
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isContainerVisible", function() { return isContainerVisible; });
@@ -71186,6 +71694,8 @@ function preventDefaults(event) {
71186
71694
  event.stopPropagation();
71187
71695
  }
71188
71696
  function classesToSelector(str) {
71697
+ if (!str)
71698
+ return str;
71189
71699
  var re = /\s*?([\w-]+)\s*?/g;
71190
71700
  return str.replace(re, ".$1");
71191
71701
  }
@@ -71334,6 +71844,100 @@ function chooseFiles(input, callback) {
71334
71844
  };
71335
71845
  input.click();
71336
71846
  }
71847
+ function compareArrays(oldValue, newValue, getKey) {
71848
+ var oldItemsMap = new Map();
71849
+ var newItemsMap = new Map();
71850
+ var commonItemsInNewMap = new Map();
71851
+ var commonItemsInOldMap = new Map();
71852
+ oldValue.forEach(function (item) {
71853
+ var itemKey = getKey(item);
71854
+ if (!oldItemsMap.has(itemKey)) {
71855
+ oldItemsMap.set(getKey(item), item);
71856
+ }
71857
+ else {
71858
+ //if keys are set incorrectly do not process comparing
71859
+ throw new Error("keys must be unique");
71860
+ }
71861
+ });
71862
+ newValue.forEach(function (item) {
71863
+ var itemKey = getKey(item);
71864
+ if (!newItemsMap.has(itemKey)) {
71865
+ newItemsMap.set(itemKey, item);
71866
+ }
71867
+ else {
71868
+ //if keys are set incorrectly do not process comparing
71869
+ throw new Error("keys must be unique");
71870
+ }
71871
+ });
71872
+ var addedItems = [];
71873
+ var deletedItems = [];
71874
+ //calculating addedItems and items that exist in both arrays
71875
+ newItemsMap.forEach(function (item, key) {
71876
+ if (!oldItemsMap.has(key)) {
71877
+ addedItems.push(item);
71878
+ }
71879
+ else {
71880
+ commonItemsInNewMap.set(key, commonItemsInNewMap.size);
71881
+ }
71882
+ });
71883
+ //calculating deletedItems and items that exist in both arrays
71884
+ oldItemsMap.forEach(function (item, key) {
71885
+ if (!newItemsMap.has(key)) {
71886
+ deletedItems.push(item);
71887
+ }
71888
+ else {
71889
+ commonItemsInOldMap.set(key, commonItemsInOldMap.size);
71890
+ }
71891
+ });
71892
+ //calculating reordered items
71893
+ var reorderedItems = [];
71894
+ commonItemsInNewMap.forEach(function (index, key) {
71895
+ var oldIndex = commonItemsInOldMap.get(key);
71896
+ var item = newItemsMap.get(key);
71897
+ if (oldIndex !== index)
71898
+ reorderedItems.push({ item: item, movedForward: oldIndex < index });
71899
+ });
71900
+ //calculating merged array if multiple operations are applied at once
71901
+ var oldItemsWithCorrectOrder = new Array(oldValue.length);
71902
+ var commonItemsIndex = 0;
71903
+ var commonItemsKeysOrder = Array.from(commonItemsInNewMap.keys());
71904
+ oldValue.forEach(function (item, index) {
71905
+ if (commonItemsInNewMap.has(getKey(item))) {
71906
+ oldItemsWithCorrectOrder[index] = newItemsMap.get(commonItemsKeysOrder[commonItemsIndex]);
71907
+ commonItemsIndex++;
71908
+ }
71909
+ else {
71910
+ oldItemsWithCorrectOrder[index] = item;
71911
+ }
71912
+ });
71913
+ var valuesToInsertBeforeKey = new Map();
71914
+ var tempValuesArray = [];
71915
+ oldItemsWithCorrectOrder.forEach(function (item) {
71916
+ var itemKey = getKey(item);
71917
+ if (newItemsMap.has(itemKey)) {
71918
+ if (tempValuesArray.length > 0) {
71919
+ valuesToInsertBeforeKey.set(itemKey, tempValuesArray);
71920
+ tempValuesArray = [];
71921
+ }
71922
+ }
71923
+ else {
71924
+ tempValuesArray.push(item);
71925
+ }
71926
+ });
71927
+ var mergedItems = new Array();
71928
+ newItemsMap.forEach(function (item, key) {
71929
+ if (valuesToInsertBeforeKey.has(key)) {
71930
+ valuesToInsertBeforeKey.get(key).forEach(function (item) {
71931
+ mergedItems.push(item);
71932
+ });
71933
+ }
71934
+ mergedItems.push(item);
71935
+ });
71936
+ tempValuesArray.forEach(function (item) {
71937
+ mergedItems.push(item);
71938
+ });
71939
+ return { reorderedItems: reorderedItems, deletedItems: deletedItems, addedItems: addedItems, mergedItems: mergedItems };
71940
+ }
71337
71941
 
71338
71942
 
71339
71943