survey-core 1.9.121 → 1.9.122

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 (237) hide show
  1. package/README.md +4 -0
  2. package/defaultV2.css +56 -1
  3. package/defaultV2.css.map +1 -1
  4. package/defaultV2.fontless.css +56 -1
  5. package/defaultV2.fontless.css.map +1 -1
  6. package/defaultV2.fontless.min.css +2 -2
  7. package/defaultV2.min.css +2 -2
  8. package/i18n/arabic.js +1 -1
  9. package/i18n/arabic.min.js +1 -1
  10. package/i18n/basque.js +1 -1
  11. package/i18n/basque.min.js +1 -1
  12. package/i18n/bulgarian.js +1 -1
  13. package/i18n/bulgarian.min.js +1 -1
  14. package/i18n/catalan.js +1 -1
  15. package/i18n/catalan.min.js +1 -1
  16. package/i18n/croatian.js +1 -1
  17. package/i18n/croatian.min.js +1 -1
  18. package/i18n/czech.js +1 -1
  19. package/i18n/czech.min.js +1 -1
  20. package/i18n/danish.js +1 -1
  21. package/i18n/danish.min.js +1 -1
  22. package/i18n/dutch.js +1 -1
  23. package/i18n/dutch.min.js +1 -1
  24. package/i18n/english.js +1 -1
  25. package/i18n/english.min.js +1 -1
  26. package/i18n/estonian.js +1 -1
  27. package/i18n/estonian.min.js +1 -1
  28. package/i18n/finnish.js +1 -1
  29. package/i18n/finnish.min.js +1 -1
  30. package/i18n/french.js +1 -1
  31. package/i18n/french.min.js +1 -1
  32. package/i18n/georgian.js +1 -1
  33. package/i18n/georgian.min.js +1 -1
  34. package/i18n/german.js +1 -1
  35. package/i18n/german.min.js +1 -1
  36. package/i18n/greek.js +1 -1
  37. package/i18n/greek.min.js +1 -1
  38. package/i18n/hebrew.js +1 -1
  39. package/i18n/hebrew.min.js +1 -1
  40. package/i18n/hindi.js +1 -1
  41. package/i18n/hindi.min.js +1 -1
  42. package/i18n/hungarian.js +1 -1
  43. package/i18n/hungarian.min.js +1 -1
  44. package/i18n/icelandic.js +1 -1
  45. package/i18n/icelandic.min.js +1 -1
  46. package/i18n/index.js +1 -1
  47. package/i18n/index.min.js +1 -1
  48. package/i18n/indonesian.js +1 -1
  49. package/i18n/indonesian.min.js +1 -1
  50. package/i18n/italian.js +1 -1
  51. package/i18n/italian.min.js +1 -1
  52. package/i18n/japanese.js +1 -1
  53. package/i18n/japanese.min.js +1 -1
  54. package/i18n/kazakh.js +1 -1
  55. package/i18n/kazakh.min.js +1 -1
  56. package/i18n/korean.js +1 -1
  57. package/i18n/korean.min.js +1 -1
  58. package/i18n/latvian.js +1 -1
  59. package/i18n/latvian.min.js +1 -1
  60. package/i18n/lithuanian.js +1 -1
  61. package/i18n/lithuanian.min.js +1 -1
  62. package/i18n/macedonian.js +1 -1
  63. package/i18n/macedonian.min.js +1 -1
  64. package/i18n/malay.js +1 -1
  65. package/i18n/malay.min.js +1 -1
  66. package/i18n/nl-BE.js +1 -1
  67. package/i18n/nl-BE.min.js +1 -1
  68. package/i18n/norwegian.js +1 -1
  69. package/i18n/norwegian.min.js +1 -1
  70. package/i18n/persian.js +1 -1
  71. package/i18n/persian.min.js +1 -1
  72. package/i18n/polish.js +1 -1
  73. package/i18n/polish.min.js +1 -1
  74. package/i18n/portuguese-br.js +1 -1
  75. package/i18n/portuguese-br.min.js +1 -1
  76. package/i18n/portuguese.js +1 -1
  77. package/i18n/portuguese.min.js +1 -1
  78. package/i18n/romanian.js +1 -1
  79. package/i18n/romanian.min.js +1 -1
  80. package/i18n/russian.js +1 -1
  81. package/i18n/russian.min.js +1 -1
  82. package/i18n/serbian.js +1 -1
  83. package/i18n/serbian.min.js +1 -1
  84. package/i18n/simplified-chinese.js +1 -1
  85. package/i18n/simplified-chinese.min.js +1 -1
  86. package/i18n/slovak.js +1 -1
  87. package/i18n/slovak.min.js +1 -1
  88. package/i18n/spanish.js +1 -1
  89. package/i18n/spanish.min.js +1 -1
  90. package/i18n/swahili.js +1 -1
  91. package/i18n/swahili.min.js +1 -1
  92. package/i18n/swedish.js +1 -1
  93. package/i18n/swedish.min.js +1 -1
  94. package/i18n/tajik.js +1 -1
  95. package/i18n/tajik.min.js +1 -1
  96. package/i18n/telugu.js +1 -1
  97. package/i18n/telugu.min.js +1 -1
  98. package/i18n/thai.js +1 -1
  99. package/i18n/thai.min.js +1 -1
  100. package/i18n/traditional-chinese.js +1 -1
  101. package/i18n/traditional-chinese.min.js +1 -1
  102. package/i18n/turkish.js +1 -1
  103. package/i18n/turkish.min.js +1 -1
  104. package/i18n/ukrainian.js +1 -1
  105. package/i18n/ukrainian.min.js +1 -1
  106. package/i18n/urdu.js +1 -1
  107. package/i18n/urdu.min.js +1 -1
  108. package/i18n/vietnamese.js +1 -1
  109. package/i18n/vietnamese.min.js +1 -1
  110. package/i18n/welsh.js +1 -1
  111. package/i18n/welsh.min.js +1 -1
  112. package/modern.css +1 -1
  113. package/modern.fontless.css +1 -1
  114. package/modern.fontless.min.css +1 -1
  115. package/modern.min.css +1 -1
  116. package/package.json +1 -1
  117. package/plugins/bootstrap-integration.js +1 -1
  118. package/plugins/bootstrap-integration.min.js +1 -1
  119. package/plugins/bootstrap-material-integration.js +1 -1
  120. package/plugins/bootstrap-material-integration.min.js +1 -1
  121. package/survey.core.js +169 -74
  122. package/survey.core.js.map +1 -1
  123. package/survey.core.min.js +3 -3
  124. package/survey.css +1 -1
  125. package/survey.i18n.js +1 -1
  126. package/survey.i18n.min.js +1 -1
  127. package/survey.min.css +1 -1
  128. package/themes/borderless-dark-panelless.js +1 -1
  129. package/themes/borderless-dark-panelless.min.js +1 -1
  130. package/themes/borderless-dark.js +1 -1
  131. package/themes/borderless-dark.min.js +1 -1
  132. package/themes/borderless-light-panelless..js +1 -1
  133. package/themes/borderless-light-panelless..min.js +1 -1
  134. package/themes/borderless-light.js +1 -1
  135. package/themes/borderless-light.min.js +1 -1
  136. package/themes/contrast-dark-panelless.js +1 -1
  137. package/themes/contrast-dark-panelless.min.js +1 -1
  138. package/themes/contrast-dark.js +1 -1
  139. package/themes/contrast-dark.min.js +1 -1
  140. package/themes/contrast-light-panelless.js +1 -1
  141. package/themes/contrast-light-panelless.min.js +1 -1
  142. package/themes/contrast-light.js +1 -1
  143. package/themes/contrast-light.min.js +1 -1
  144. package/themes/default-dark-panelless.js +1 -1
  145. package/themes/default-dark-panelless.min.js +1 -1
  146. package/themes/default-dark.js +1 -1
  147. package/themes/default-dark.min.js +1 -1
  148. package/themes/default-light-panelless.js +1 -1
  149. package/themes/default-light-panelless.min.js +1 -1
  150. package/themes/default-light.js +1 -1
  151. package/themes/default-light.min.js +1 -1
  152. package/themes/doubleborder-dark-panelless.js +1 -1
  153. package/themes/doubleborder-dark-panelless.min.js +1 -1
  154. package/themes/doubleborder-dark.js +1 -1
  155. package/themes/doubleborder-dark.min.js +1 -1
  156. package/themes/doubleborder-light-panelles.js +1 -1
  157. package/themes/doubleborder-light-panelles.min.js +1 -1
  158. package/themes/doubleborder-light.js +1 -1
  159. package/themes/doubleborder-light.min.js +1 -1
  160. package/themes/flat-dark-panelless.js +1 -1
  161. package/themes/flat-dark-panelless.min.js +1 -1
  162. package/themes/flat-dark.js +1 -1
  163. package/themes/flat-dark.min.js +1 -1
  164. package/themes/flat-light-panelless.js +1 -1
  165. package/themes/flat-light-panelless.min.js +1 -1
  166. package/themes/flat-light.js +1 -1
  167. package/themes/flat-light.min.js +1 -1
  168. package/themes/index.js +1 -1
  169. package/themes/index.min.js +1 -1
  170. package/themes/layered-dark-panelless.js +1 -1
  171. package/themes/layered-dark-panelless.min.js +1 -1
  172. package/themes/layered-dark.js +1 -1
  173. package/themes/layered-dark.min.js +1 -1
  174. package/themes/layered-light-panelless.js +1 -1
  175. package/themes/layered-light-panelless.min.js +1 -1
  176. package/themes/layered-light.js +1 -1
  177. package/themes/layered-light.min.js +1 -1
  178. package/themes/plain-dark-panelless.js +1 -1
  179. package/themes/plain-dark-panelless.min.js +1 -1
  180. package/themes/plain-dark.js +1 -1
  181. package/themes/plain-dark.min.js +1 -1
  182. package/themes/plain-light-panelless.js +1 -1
  183. package/themes/plain-light-panelless.min.js +1 -1
  184. package/themes/plain-light.js +1 -1
  185. package/themes/plain-light.min.js +1 -1
  186. package/themes/sharp-dark-panelless.js +1 -1
  187. package/themes/sharp-dark-panelless.min.js +1 -1
  188. package/themes/sharp-dark.js +1 -1
  189. package/themes/sharp-dark.min.js +1 -1
  190. package/themes/sharp-light-panelless.js +1 -1
  191. package/themes/sharp-light-panelless.min.js +1 -1
  192. package/themes/sharp-light.js +1 -1
  193. package/themes/sharp-light.min.js +1 -1
  194. package/themes/solid-dark-panelless.js +1 -1
  195. package/themes/solid-dark-panelless.min.js +1 -1
  196. package/themes/solid-dark.js +1 -1
  197. package/themes/solid-dark.min.js +1 -1
  198. package/themes/solid-light-panelless.js +1 -1
  199. package/themes/solid-light-panelless.min.js +1 -1
  200. package/themes/solid-light.js +1 -1
  201. package/themes/solid-light.min.js +1 -1
  202. package/themes/three-dimensional-dark-panelless.js +1 -1
  203. package/themes/three-dimensional-dark-panelless.min.js +1 -1
  204. package/themes/three-dimensional-dark.js +1 -1
  205. package/themes/three-dimensional-dark.min.js +1 -1
  206. package/themes/three-dimensional-light-panelless.js +1 -1
  207. package/themes/three-dimensional-light-panelless.min.js +1 -1
  208. package/themes/three-dimensional-light.js +1 -1
  209. package/themes/three-dimensional-light.min.js +1 -1
  210. package/ts3.4/typings/base-interfaces.d.ts +1 -0
  211. package/ts3.4/typings/base.d.ts +4 -4
  212. package/ts3.4/typings/defaultCss/defaultV2Css.d.ts +3 -0
  213. package/ts3.4/typings/header.d.ts +1 -0
  214. package/ts3.4/typings/question_baseselect.d.ts +0 -1
  215. package/ts3.4/typings/question_checkbox.d.ts +1 -0
  216. package/ts3.4/typings/question_custom.d.ts +2 -0
  217. package/ts3.4/typings/question_file.d.ts +3 -0
  218. package/ts3.4/typings/question_imagepicker.d.ts +1 -3
  219. package/ts3.4/typings/question_multipletext.d.ts +1 -1
  220. package/ts3.4/typings/question_paneldynamic.d.ts +4 -4
  221. package/ts3.4/typings/question_rating.d.ts +18 -5
  222. package/ts3.4/typings/survey-events-api.d.ts +4 -2
  223. package/ts3.4/typings/survey.d.ts +15 -14
  224. package/typings/base-interfaces.d.ts +1 -0
  225. package/typings/base.d.ts +4 -4
  226. package/typings/defaultCss/defaultV2Css.d.ts +3 -0
  227. package/typings/header.d.ts +1 -0
  228. package/typings/question_baseselect.d.ts +0 -1
  229. package/typings/question_checkbox.d.ts +1 -0
  230. package/typings/question_custom.d.ts +2 -0
  231. package/typings/question_file.d.ts +3 -0
  232. package/typings/question_imagepicker.d.ts +1 -3
  233. package/typings/question_multipletext.d.ts +1 -1
  234. package/typings/question_paneldynamic.d.ts +4 -4
  235. package/typings/question_rating.d.ts +18 -5
  236. package/typings/survey-events-api.d.ts +4 -2
  237. package/typings/survey.d.ts +15 -14
package/survey.core.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - Survey JavaScript library v1.9.121
2
+ * surveyjs - Survey JavaScript library v1.9.122
3
3
  * Copyright (c) 2015-2023 Devsoft Baltic OÜ - http://surveyjs.io/
4
4
  * License: MIT (http://www.opensource.org/licenses/mit-license.php)
5
5
  */
@@ -1891,7 +1891,7 @@ var Base = /** @class */ (function () {
1891
1891
  * Returns `true` if a passed `value` is an empty string, array, or object or if it equals to `undefined` or `null`.
1892
1892
  *
1893
1893
  * @param value A value to be checked.
1894
- * @param trimString (Optional) When this parameter is `true`, the method ignores whitespace characters at the beginning and end of a string value. Pass `false` to disable this functionality.
1894
+ * @param trimString *(Optional)* When this parameter is `true`, the method ignores whitespace characters at the beginning and end of a string value. Pass `false` to disable this functionality.
1895
1895
  */
1896
1896
  Base.prototype.isValueEmpty = function (value, trimString) {
1897
1897
  if (trimString === void 0) { trimString = true; }
@@ -2098,7 +2098,7 @@ var Base = /** @class */ (function () {
2098
2098
  * If the property is not found or does not have a value, this method returns either `undefined`, `defaultValue` specified in the property configuration, or a value passed as the `defaultValue` parameter.
2099
2099
  *
2100
2100
  * @param name A property name.
2101
- * @param defaultValue (Optional) A value to return if the property is not found or does not have a value.
2101
+ * @param defaultValue *(Optional)* A value to return if the property is not found or does not have a value.
2102
2102
  */
2103
2103
  Base.prototype.getPropertyValue = function (name, defaultValue) {
2104
2104
  if (defaultValue === void 0) { defaultValue = null; }
@@ -2369,7 +2369,7 @@ var Base = /** @class */ (function () {
2369
2369
  * Registers a function to call when a property value changes.
2370
2370
  * @param propertyNames An array of one or multiple property names.
2371
2371
  * @param handler A function to call when one of the listed properties change.
2372
- * @param key (Optional) A key that identifies the current registration. If a function for one of the properties is already registered with the same key, the function will be overwritten. You can also use the key to subsequently unregister handlers.
2372
+ * @param key *(Optional)* A key that identifies the current registration. If a function for one of the properties is already registered with the same key, the function will be overwritten. You can also use the key to subsequently unregister handlers.
2373
2373
  * @see unregisterPropertyChangedHandlers
2374
2374
  */
2375
2375
  Base.prototype.registerPropertyChangedHandlers = function (propertyNames, handler, key) {
@@ -2381,7 +2381,7 @@ var Base = /** @class */ (function () {
2381
2381
  /**
2382
2382
  * Unregisters value change event handlers for the specified properties.
2383
2383
  * @param propertyNames An array of one or multiple property names.
2384
- * @param key (Optional) A key of the registration that you want to cancel.
2384
+ * @param key *(Optional)* A key of the registration that you want to cancel.
2385
2385
  * @see registerPropertyChangedHandlers
2386
2386
  */
2387
2387
  Base.prototype.unregisterPropertyChangedHandlers = function (propertyNames, key) {
@@ -5821,6 +5821,9 @@ var defaultV2Css = {
5821
5821
  rootDropdown: "sd-scrollable-container sd-scrollable-container--compact sd-selectbase",
5822
5822
  root: "sd-scrollable-container sd-rating",
5823
5823
  rootWrappable: "sd-scrollable-container sd-rating sd-rating--wrappable",
5824
+ rootLabelsTop: "sd-rating--labels-top",
5825
+ rootLabelsBottom: "sd-rating--labels-bottom",
5826
+ rootLabelsDiagonal: "sd-rating--labels-diagonal",
5824
5827
  item: "sd-rating__item",
5825
5828
  itemOnError: "sd-rating__item--error",
5826
5829
  itemHover: "sd-rating__item--allowhover",
@@ -8488,7 +8491,7 @@ var DropdownMultiSelectListModel = /** @class */ (function (_super) {
8488
8491
  if (!_onSelectionChanged) {
8489
8492
  _onSelectionChanged = function (item, status) {
8490
8493
  _this.resetFilterString();
8491
- if (item.value === "selectall") {
8494
+ if (item.id === "selectall") {
8492
8495
  _this.selectAllItems();
8493
8496
  }
8494
8497
  else if (status === "added" && item.value === _settings__WEBPACK_IMPORTED_MODULE_4__["settings"].noneItemValue) {
@@ -9312,8 +9315,8 @@ __webpack_require__.r(__webpack_exports__);
9312
9315
  //import "../../modern.scss";
9313
9316
  var Version;
9314
9317
  var ReleaseDate;
9315
- Version = "" + "1.9.121";
9316
- ReleaseDate = "" + "2023-12-12";
9318
+ Version = "" + "1.9.122";
9319
+ ReleaseDate = "" + "2023-12-19";
9317
9320
  function checkLibraryVersion(ver, libraryName) {
9318
9321
  if (Version != ver) {
9319
9322
  var str = "survey-core has version '" + Version + "' and " + libraryName
@@ -15370,7 +15373,7 @@ var Cover = /** @class */ (function (_super) {
15370
15373
  Cover.prototype.updateHeaderClasses = function () {
15371
15374
  this.headerClasses = new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_2__["CssClassBuilder"]()
15372
15375
  .append("sv-header")
15373
- .append("sv-header__without-background", (this.backgroundColor === "trasparent") && !this.backgroundImage)
15376
+ .append("sv-header__without-background", (this.backgroundColor === "transparent") && !this.backgroundImage)
15374
15377
  .append("sv-header__overlap", this.overlapEnabled)
15375
15378
  .toString();
15376
15379
  };
@@ -15489,6 +15492,13 @@ var Cover = /** @class */ (function (_super) {
15489
15492
  this.actualHeight = this.calculateActualHeight(logoHeight, titleHeight, descriptionHeight);
15490
15493
  }
15491
15494
  };
15495
+ Object.defineProperty(Cover.prototype, "hasBackground", {
15496
+ get: function () {
15497
+ return !!this.backgroundImage || this.backgroundColor !== "transparent";
15498
+ },
15499
+ enumerable: false,
15500
+ configurable: true
15501
+ });
15492
15502
  __decorate([
15493
15503
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])({ defaultValue: 0 })
15494
15504
  ], Cover.prototype, "actualHeight", void 0);
@@ -26822,9 +26832,9 @@ var Question = /** @class */ (function (_super) {
26822
26832
  return false;
26823
26833
  if (!!this.page && this.page.isStartPage)
26824
26834
  return false;
26825
- if (!this.survey || !this.valueName)
26835
+ if (!this.survey)
26826
26836
  return true;
26827
- return !this.survey.hasVisibleQuestionByValueName(this.valueName);
26837
+ return !this.survey.hasVisibleQuestionByValueName(this.getValueName());
26828
26838
  };
26829
26839
  Object.defineProperty(Question.prototype, "isParentVisible", {
26830
26840
  /**
@@ -30448,21 +30458,6 @@ var QuestionCheckboxBase = /** @class */ (function (_super) {
30448
30458
  enumerable: false,
30449
30459
  configurable: true
30450
30460
  });
30451
- QuestionCheckboxBase.prototype.clickItemHandler = function (item, checked) {
30452
- var newValue = [].concat(this.renderedValue || []);
30453
- var index = newValue.indexOf(item.value);
30454
- if (checked) {
30455
- if (index < 0) {
30456
- newValue.push(item.value);
30457
- }
30458
- }
30459
- else {
30460
- if (index > -1) {
30461
- newValue.splice(index, 1);
30462
- }
30463
- }
30464
- this.renderedValue = newValue;
30465
- };
30466
30461
  QuestionCheckboxBase.prototype.onParentChanged = function () {
30467
30462
  _super.prototype.onParentChanged.call(this);
30468
30463
  if (this.isFlowLayout) {
@@ -31296,9 +31291,10 @@ var QuestionCheckboxModel = /** @class */ (function (_super) {
31296
31291
  __extends(QuestionCheckboxModel, _super);
31297
31292
  function QuestionCheckboxModel(name) {
31298
31293
  var _this = _super.call(this, name) || this;
31299
- _this.selectAllItemValue = new _itemvalue__WEBPACK_IMPORTED_MODULE_4__["ItemValue"]("selectall");
31300
31294
  _this.invisibleOldValues = {};
31301
31295
  _this.isChangingValueOnClearIncorrect = false;
31296
+ _this.selectAllItemValue = new _itemvalue__WEBPACK_IMPORTED_MODULE_4__["ItemValue"]("");
31297
+ _this.selectAllItemValue.id = "selectall";
31302
31298
  var selectAllItemText = _this.createLocalizableString("selectAllText", _this.selectAllItem, true, "selectAllItemText");
31303
31299
  _this.selectAllItem.locOwner = _this;
31304
31300
  _this.selectAllItem.setLocText(selectAllItemText);
@@ -31456,6 +31452,31 @@ var QuestionCheckboxModel = /** @class */ (function (_super) {
31456
31452
  }
31457
31453
  this.renderedValue = val;
31458
31454
  };
31455
+ QuestionCheckboxModel.prototype.clickItemHandler = function (item, checked) {
31456
+ if (item === this.selectAllItem) {
31457
+ if (checked === true || checked === false) {
31458
+ this.isAllSelected = checked;
31459
+ }
31460
+ else {
31461
+ this.toggleSelectAll();
31462
+ }
31463
+ }
31464
+ else {
31465
+ var newValue = [].concat(this.renderedValue || []);
31466
+ var index = newValue.indexOf(item.value);
31467
+ if (checked) {
31468
+ if (index < 0) {
31469
+ newValue.push(item.value);
31470
+ }
31471
+ }
31472
+ else {
31473
+ if (index > -1) {
31474
+ newValue.splice(index, 1);
31475
+ }
31476
+ }
31477
+ this.renderedValue = newValue;
31478
+ }
31479
+ };
31459
31480
  QuestionCheckboxModel.prototype.isItemSelectedCore = function (item) {
31460
31481
  if (item === this.selectAllItem)
31461
31482
  return this.isAllSelected;
@@ -32456,6 +32477,16 @@ var QuestionCustomModelBase = /** @class */ (function (_super) {
32456
32477
  this.getElement().localeChanged();
32457
32478
  }
32458
32479
  };
32480
+ QuestionCustomModelBase.prototype.addUsedLocales = function (locales) {
32481
+ _super.prototype.addUsedLocales.call(this, locales);
32482
+ if (!!this.getElement()) {
32483
+ this.getElement().addUsedLocales(locales);
32484
+ }
32485
+ };
32486
+ QuestionCustomModelBase.prototype.needResponsiveWidth = function () {
32487
+ var el = this.getElement();
32488
+ return !!el ? el.needResponsiveWidth() : false;
32489
+ };
32459
32490
  QuestionCustomModelBase.prototype.createWrapper = function () { };
32460
32491
  QuestionCustomModelBase.prototype.onPropertyValueChanged = function (name, oldValue, newValue) {
32461
32492
  _super.prototype.onPropertyValueChanged.call(this, name, oldValue, newValue);
@@ -34288,6 +34319,9 @@ function dataUrl2File(dataUrl, fileName, type) {
34288
34319
  var buffer = new Uint8Array(str.split("").map(function (c) { return c.charCodeAt(0); })).buffer;
34289
34320
  return new File([buffer], fileName, { type: type });
34290
34321
  }
34322
+ /**
34323
+ * A base class for question types that support file upload: `QuestionFileModel` and `QuestionSignaturePadModel`.
34324
+ */
34291
34325
  var QuestionFileModelBase = /** @class */ (function (_super) {
34292
34326
  __extends(QuestionFileModelBase, _super);
34293
34327
  function QuestionFileModelBase() {
@@ -36373,10 +36407,8 @@ var QuestionImagePickerModel = /** @class */ (function (_super) {
36373
36407
  *
36374
36408
  * Possible values:
36375
36409
  *
36376
- * - `"image"` - Images in one of the following formats: JPEG, GIF, PNG, APNG, SVG, BMP, ICO.
36410
+ * - `"image"` (default) - Images in one of the following formats: JPEG, GIF, PNG, APNG, SVG, BMP, ICO.
36377
36411
  * - `"video"` - Videos in one of the following formats: MP4, MOV, WMV, FLV, AVI, MKV.
36378
- * - `"youtube"` - Links to YouTube videos.
36379
- * - `"auto"` (default) - Selects one of the above based on the `imageLink` property value of each choice item.
36380
36412
  */
36381
36413
  get: function () {
36382
36414
  return this.getPropertyValue("contentMode");
@@ -44051,7 +44083,7 @@ var QuestionMultipleTextModel = /** @class */ (function (_super) {
44051
44083
  /**
44052
44084
  * Adds a new input item.
44053
44085
  * @param name An item name.
44054
- * @param title (Optional) An item title.
44086
+ * @param title *(Optional)* An item title.
44055
44087
  * @see items
44056
44088
  */
44057
44089
  QuestionMultipleTextModel.prototype.addItem = function (name, title) {
@@ -45239,7 +45271,8 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
45239
45271
  if (this.isRenderModeList || this.useTemplatePanel)
45240
45272
  return;
45241
45273
  var curPanel = this.getPropertyValue("currentPanel");
45242
- if (!!val && this.visiblePanels.indexOf(val) < 0 || val === curPanel)
45274
+ var index = !!val ? this.visiblePanels.indexOf(val) : -1;
45275
+ if (!!val && index < 0 || val === curPanel)
45243
45276
  return;
45244
45277
  if (curPanel) {
45245
45278
  curPanel.onHidingContent();
@@ -45248,6 +45281,13 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
45248
45281
  this.updateFooterActions();
45249
45282
  this.updateTabToolbarItemsPressedState();
45250
45283
  this.fireCallback(this.currentIndexChangedCallback);
45284
+ if (index > -1 && this.survey) {
45285
+ var options = {
45286
+ panel: val,
45287
+ visiblePanelIndex: index
45288
+ };
45289
+ this.survey.dynamicPanelCurrentIndexChanged(this, options);
45290
+ }
45251
45291
  },
45252
45292
  enumerable: false,
45253
45293
  configurable: true
@@ -46079,48 +46119,59 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
46079
46119
  return newPanel;
46080
46120
  };
46081
46121
  /**
46082
- * Add a new dynamic panel based on the template Panel.
46083
- * @see template
46122
+ * Adds a new panel based on the [template](https://surveyjs.io/form-library/documentation/api-reference/dynamic-panel-model#template).
46123
+ * @param index *(Optional)* An index at which to insert the new panel. `undefined` adds the panel to the end or inserts it after the current panel if [`renderMode`](https://surveyjs.io/form-library/documentation/api-reference/dynamic-panel-model#renderMode) is `"tab"`. A negative index (for instance, -1) adds the panel to the end in all cases, regardless of the `renderMode` value.
46084
46124
  * @see panelCount
46085
46125
  * @see panels
46086
- * @see renderMode
46087
46126
  */
46088
- QuestionPanelDynamicModel.prototype.addPanel = function () {
46089
- this.panelCount++;
46127
+ QuestionPanelDynamicModel.prototype.addPanel = function (index) {
46128
+ var curIndex = this.currentIndex;
46129
+ if (index === undefined) {
46130
+ index = curIndex < 0 ? this.panelCount : curIndex + 1;
46131
+ }
46132
+ if (index < 0 || index > this.panelCount) {
46133
+ index = this.panelCount;
46134
+ }
46135
+ this.updateValueOnAddingPanel(curIndex < 0 ? this.panelCount - 1 : curIndex, index);
46090
46136
  if (!this.isRenderModeList) {
46091
- this.currentIndex = this.panelCount - 1;
46137
+ this.currentIndex = index;
46092
46138
  }
46139
+ if (this.survey)
46140
+ this.survey.dynamicPanelAdded(this);
46141
+ return this.panels[index];
46142
+ };
46143
+ QuestionPanelDynamicModel.prototype.updateValueOnAddingPanel = function (prevIndex, index) {
46144
+ this.panelCount++;
46093
46145
  var newValue = this.value;
46146
+ if (!Array.isArray(newValue) || newValue.length !== this.panelCount)
46147
+ return;
46094
46148
  var hasModified = false;
46149
+ var lastIndex = this.panelCount - 1;
46150
+ if (index < lastIndex) {
46151
+ hasModified = true;
46152
+ var rec = newValue[lastIndex];
46153
+ newValue.splice(lastIndex, 1);
46154
+ newValue.splice(index, 0, rec);
46155
+ }
46095
46156
  if (!this.isValueEmpty(this.defaultPanelValue)) {
46096
- if (!!newValue &&
46097
- Array.isArray(newValue) &&
46098
- newValue.length == this.panelCount) {
46099
- hasModified = true;
46100
- this.copyValue(newValue[newValue.length - 1], this.defaultPanelValue);
46101
- }
46102
- }
46103
- if (this.defaultValueFromLastPanel &&
46104
- !!newValue &&
46105
- Array.isArray(newValue) &&
46106
- newValue.length > 1 &&
46107
- newValue.length == this.panelCount) {
46108
46157
  hasModified = true;
46109
- this.copyValue(newValue[newValue.length - 1], newValue[newValue.length - 2]);
46158
+ this.copyValue(newValue[index], this.defaultPanelValue);
46159
+ }
46160
+ if (this.defaultValueFromLastPanel && newValue.length > 1) {
46161
+ var fromIndex = prevIndex > -1 && prevIndex <= lastIndex ? prevIndex : lastIndex;
46162
+ hasModified = true;
46163
+ this.copyValue(newValue[index], newValue[fromIndex]);
46110
46164
  }
46111
46165
  if (hasModified) {
46112
46166
  this.value = newValue;
46113
46167
  }
46114
- if (this.survey)
46115
- this.survey.dynamicPanelAdded(this);
46116
- return this.panels[this.panelCount - 1];
46117
46168
  };
46118
46169
  QuestionPanelDynamicModel.prototype.canLeaveCurrentPanel = function () {
46119
46170
  return !(this.renderMode !== "list" && this.currentPanel && this.currentPanel.hasErrors(true, true));
46120
46171
  };
46121
- QuestionPanelDynamicModel.prototype.copyValue = function (src, dest) {
46122
- for (var key in dest) {
46123
- src[key] = dest[key];
46172
+ QuestionPanelDynamicModel.prototype.copyValue = function (dest, src) {
46173
+ for (var key in src) {
46174
+ dest[key] = src[key];
46124
46175
  }
46125
46176
  };
46126
46177
  /**
@@ -48557,9 +48608,10 @@ var QuestionRatingModel = /** @class */ (function (_super) {
48557
48608
  Object.defineProperty(QuestionRatingModel.prototype, "minRateDescription", {
48558
48609
  /**
48559
48610
  * Specifies a description for the minimum (first) rate value.
48611
+ * @see rateDescriptionLocation
48612
+ * @see displayRateDescriptionsAsExtremeItems
48560
48613
  * @see rateValues
48561
48614
  * @see rateMin
48562
- * @see displayRateDescriptionsAsExtremeItems
48563
48615
  */
48564
48616
  get: function () {
48565
48617
  return this.getLocalizableStringText("minRateDescription");
@@ -48581,9 +48633,10 @@ var QuestionRatingModel = /** @class */ (function (_super) {
48581
48633
  Object.defineProperty(QuestionRatingModel.prototype, "maxRateDescription", {
48582
48634
  /**
48583
48635
  * Specifies a description for the maximum (last) rate value.
48636
+ * @see rateDescriptionLocation
48637
+ * @see displayRateDescriptionsAsExtremeItems
48584
48638
  * @see rateValues
48585
48639
  * @see rateMax
48586
- * @see displayRateDescriptionsAsExtremeItems
48587
48640
  */
48588
48641
  get: function () {
48589
48642
  return this.getLocalizableStringText("maxRateDescription");
@@ -48715,8 +48768,18 @@ var QuestionRatingModel = /** @class */ (function (_super) {
48715
48768
  get: function () {
48716
48769
  var baseClass = ((this.displayMode == "buttons" || (!!this.survey && this.survey.isDesignMode)) && this.cssClasses.rootWrappable) ?
48717
48770
  this.cssClasses.rootWrappable : this.cssClasses.root;
48771
+ var rootClassModifier = "";
48772
+ if (this.hasMaxLabel || this.hasMinLabel) {
48773
+ if (this.rateDescriptionLocation == "top")
48774
+ rootClassModifier = this.cssClasses.rootLabelsTop;
48775
+ if (this.rateDescriptionLocation == "bottom")
48776
+ rootClassModifier = this.cssClasses.rootLabelsBottom;
48777
+ if (this.rateDescriptionLocation == "topBottom")
48778
+ rootClassModifier = this.cssClasses.rootLabelsDiagonal;
48779
+ }
48718
48780
  return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_6__["CssClassBuilder"]()
48719
48781
  .append(baseClass)
48782
+ .append(rootClassModifier)
48720
48783
  .append(this.cssClasses.itemSmall, this.itemSmallMode && this.rateType != "labels")
48721
48784
  .toString();
48722
48785
  },
@@ -49045,6 +49108,9 @@ var QuestionRatingModel = /** @class */ (function (_super) {
49045
49108
  }
49046
49109
  })
49047
49110
  ], QuestionRatingModel.prototype, "displayMode", void 0);
49111
+ __decorate([
49112
+ Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])()
49113
+ ], QuestionRatingModel.prototype, "rateDescriptionLocation", void 0);
49048
49114
  __decorate([
49049
49115
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])()
49050
49116
  ], QuestionRatingModel.prototype, "rateType", void 0);
@@ -49174,6 +49240,12 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_2__["Serializer"].addClass("rating", [
49174
49240
  return obj.rateType == "labels";
49175
49241
  }
49176
49242
  },
49243
+ {
49244
+ name: "rateDescriptionLocation",
49245
+ default: "leftRight",
49246
+ category: "layout",
49247
+ choices: ["leftRight", "top", "bottom", "topBottom"],
49248
+ },
49177
49249
  {
49178
49250
  name: "displayMode",
49179
49251
  default: "auto",
@@ -54501,6 +54573,10 @@ var SurveyModel = /** @class */ (function (_super) {
54501
54573
  * [View Demo](https://surveyjs.io/form-library/examples/tabbed-interface-for-duplicate-group-option/ (linkStyle))
54502
54574
  */
54503
54575
  _this.onGetDynamicPanelTabTitle = _this.addEvent();
54576
+ /**
54577
+ * An event that is raised after the current panel is changed in a [Dynamic Panel](https://surveyjs.io/form-library/examples/questiontype-paneldynamic/) question.
54578
+ */
54579
+ _this.onDynamicPanelCurrentIndexChanged = _this.addEvent();
54504
54580
  /**
54505
54581
  * An event that is raised to define whether a question answer is correct. Applies only to [quiz surveys](https://surveyjs.io/form-library/documentation/design-survey/create-a-quiz).
54506
54582
  */
@@ -56934,7 +57010,7 @@ var SurveyModel = /** @class */ (function (_super) {
56934
57010
  /**
56935
57011
  * Merges a specified data object with the object from the [`data`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#data) property.
56936
57012
  *
56937
- * Refer to the following help topic for more information: [Merge Question Values](https://surveyjs.io/form-library/documentation/design-survey/merge-question-values).
57013
+ * Refer to the following help topic for more information: [Populate Form Fields | Multiple Question Values](https://surveyjs.io/form-library/documentation/design-survey/pre-populate-form-fields#multiple-question-values).
56938
57014
  *
56939
57015
  * @param data A data object to merge. It should have the following structure: `{ questionName: questionValue, ... }`
56940
57016
  * @see setValue
@@ -58494,6 +58570,7 @@ var SurveyModel = /** @class */ (function (_super) {
58494
58570
  };
58495
58571
  SurveyModel.prototype.setupPagesForPageModes = function (isSinglePage) {
58496
58572
  this.questionHashesClear();
58573
+ this.isCreatingPagesForPreview = true;
58497
58574
  var startIndex = this.getPageStartIndex();
58498
58575
  _super.prototype.startLoadingFromJson.call(this);
58499
58576
  var newPages = this.createPagesForQuestionOnPageMode(isSinglePage, startIndex);
@@ -58508,6 +58585,7 @@ var SurveyModel = /** @class */ (function (_super) {
58508
58585
  }
58509
58586
  this.doElementsOnLoad();
58510
58587
  this.updateCurrentPage();
58588
+ this.isCreatingPagesForPreview = false;
58511
58589
  };
58512
58590
  SurveyModel.prototype.createPagesForQuestionOnPageMode = function (isSinglePage, startIndex) {
58513
58591
  if (isSinglePage) {
@@ -59159,7 +59237,8 @@ var SurveyModel = /** @class */ (function (_super) {
59159
59237
  SurveyModel.prototype.afterRenderPage = function (htmlElement) {
59160
59238
  var _this = this;
59161
59239
  if (!this.isDesignMode && !this.focusingQuestionInfo) {
59162
- setTimeout(function () { return _this.scrollToTopOnPageChange(!_this.isFirstPageRendering); }, 1);
59240
+ var doScroll_1 = !this.isFirstPageRendering;
59241
+ setTimeout(function () { return _this.scrollToTopOnPageChange(doScroll_1); }, 1);
59163
59242
  }
59164
59243
  this.focusQuestionInfo();
59165
59244
  this.isFirstPageRendering = false;
@@ -59378,6 +59457,10 @@ var SurveyModel = /** @class */ (function (_super) {
59378
59457
  options.question = question;
59379
59458
  this.onGetDynamicPanelTabTitle.fire(this, options);
59380
59459
  };
59460
+ SurveyModel.prototype.dynamicPanelCurrentIndexChanged = function (question, options) {
59461
+ options.question = question;
59462
+ this.onDynamicPanelCurrentIndexChanged.fire(this, options);
59463
+ };
59381
59464
  SurveyModel.prototype.dragAndDropAllow = function (options) {
59382
59465
  this.onDragDropAllow.fire(this, options);
59383
59466
  return options.allow;
@@ -59461,13 +59544,8 @@ var SurveyModel = /** @class */ (function (_super) {
59461
59544
  * question,
59462
59545
  * question.name,
59463
59546
  * question.value,
59464
- * (status, data) => {
59465
- * if (status === "success") {
59466
- * // Handle success
59467
- * }
59468
- * if (status === "error") {
59469
- * // Handle error
59470
- * }
59547
+ * (data, errors) => {
59548
+ * // ...
59471
59549
  * }
59472
59550
  * );
59473
59551
  * ```
@@ -59656,7 +59734,7 @@ var SurveyModel = /** @class */ (function (_super) {
59656
59734
  /**
59657
59735
  * Returns a question with a specified [`name`](https://surveyjs.io/form-library/documentation/api-reference/question#name).
59658
59736
  * @param name A question name
59659
- * @param caseInsensitive (Optional) A Boolean value that specifies case sensitivity when searching for the question. Default value: `false` (uppercase and lowercase letters are treated as distinct).
59737
+ * @param caseInsensitive *(Optional)* A Boolean value that specifies case sensitivity when searching for the question. Default value: `false` (uppercase and lowercase letters are treated as distinct).
59660
59738
  * @returns A question with a specified name.
59661
59739
  * @see getAllQuestions
59662
59740
  * @see getQuestionByValueName
@@ -59684,7 +59762,7 @@ var SurveyModel = /** @class */ (function (_super) {
59684
59762
  *
59685
59763
  * > Since `valueName` does not have to be unique, multiple questions can have the same `valueName` value. In this case, the `getQuestionByValueName()` method returns the first such question. If you need to get all questions with the same `valueName`, call the `getQuestionsByValueName()` method.
59686
59764
  * @param valueName A question's `valueName` property value.
59687
- * @param caseInsensitive (Optional) A Boolean value that specifies case sensitivity when searching for the question. Default value: `false` (uppercase and lowercase letters are treated as distinct).
59765
+ * @param caseInsensitive *(Optional)* A Boolean value that specifies case sensitivity when searching for the question. Default value: `false` (uppercase and lowercase letters are treated as distinct).
59688
59766
  * @returns A question with a specified `valueName`.
59689
59767
  * @see getAllQuestions
59690
59768
  * @see getQuestionByName
@@ -59697,7 +59775,7 @@ var SurveyModel = /** @class */ (function (_super) {
59697
59775
  /**
59698
59776
  * Returns all questions with a specified [`valueName`](https://surveyjs.io/form-library/documentation/api-reference/question#valueName). If a question's `valueName` is undefined, its [`name`](https://surveyjs.io/form-library/documentation/api-reference/question#name) property is used.
59699
59777
  * @param valueName A question's `valueName` property value.
59700
- * @param caseInsensitive (Optional) A Boolean value that specifies case sensitivity when searching for the questions. Default value: `false` (uppercase and lowercase letters are treated as distinct).
59778
+ * @param caseInsensitive *(Optional)* A Boolean value that specifies case sensitivity when searching for the questions. Default value: `false` (uppercase and lowercase letters are treated as distinct).
59701
59779
  * @returns An array of questions with a specified `valueName`.
59702
59780
  * @see getAllQuestions
59703
59781
  * @see getQuestionByName
@@ -59722,7 +59800,7 @@ var SurveyModel = /** @class */ (function (_super) {
59722
59800
  /**
59723
59801
  * Returns an array of questions with specified [names](https://surveyjs.io/form-library/documentation/api-reference/question#name).
59724
59802
  * @param names An array of question names.
59725
- * @param caseInsensitive (Optional) A Boolean value that specifies case sensitivity when searching for the questions. Default value: `false` (uppercase and lowercase letters are treated as distinct).
59803
+ * @param caseInsensitive *(Optional)* A Boolean value that specifies case sensitivity when searching for the questions. Default value: `false` (uppercase and lowercase letters are treated as distinct).
59726
59804
  * @returns An array of questions with specified names
59727
59805
  * @see getAllQuestions
59728
59806
  */
@@ -59840,7 +59918,7 @@ var SurveyModel = /** @class */ (function (_super) {
59840
59918
  /**
59841
59919
  * Returns a [panel](https://surveyjs.io/form-library/documentation/api-reference/panel-model) with a specified [`name`](https://surveyjs.io/form-library/documentation/api-reference/panel-model#name).
59842
59920
  * @param name A panel name.
59843
- * @param caseInsensitive (Optional) A Boolean value that specifies case sensitivity when searching for the panel. Default value: `false` (uppercase and lowercase letters are treated as distinct).
59921
+ * @param caseInsensitive *(Optional)* A Boolean value that specifies case sensitivity when searching for the panel. Default value: `false` (uppercase and lowercase letters are treated as distinct).
59844
59922
  * @returns A panel with a specified name.
59845
59923
  * @see getAllPanels
59846
59924
  */
@@ -60672,6 +60750,8 @@ var SurveyModel = /** @class */ (function (_super) {
60672
60750
  SurveyModel.prototype.setValue = function (name, newQuestionValue, locNotification, allowNotifyValueChanged, questionName) {
60673
60751
  if (locNotification === void 0) { locNotification = false; }
60674
60752
  if (allowNotifyValueChanged === void 0) { allowNotifyValueChanged = true; }
60753
+ if (this.isCreatingPagesForPreview)
60754
+ return;
60675
60755
  var newValue = newQuestionValue;
60676
60756
  if (allowNotifyValueChanged) {
60677
60757
  newValue = this.questionOnValueChanging(name, newQuestionValue);
@@ -61404,6 +61484,9 @@ var SurveyModel = /** @class */ (function (_super) {
61404
61484
  return this.getLocalizationFormatString(strName, surveySpent, surveyLimit);
61405
61485
  };
61406
61486
  SurveyModel.prototype.getDisplayClockTime = function (val) {
61487
+ if (val < 0) {
61488
+ val = 0;
61489
+ }
61407
61490
  var min = Math.floor(val / 60);
61408
61491
  var sec = val % 60;
61409
61492
  var secStr = sec.toString();
@@ -61759,7 +61842,19 @@ var SurveyModel = /** @class */ (function (_super) {
61759
61842
  }
61760
61843
  }
61761
61844
  else if (this.state === "running" && isStrCiEqual(layoutElement.id, "progress-" + this.progressBarType)) {
61762
- if (container === "center") {
61845
+ var headerLayoutElement = this.layoutElements.filter(function (a) { return a.id === "advanced-header"; })[0];
61846
+ var advHeader = headerLayoutElement && headerLayoutElement.data;
61847
+ var isBelowHeader = !advHeader || advHeader.hasBackground;
61848
+ if (container === "header" && !isBelowHeader) {
61849
+ layoutElement.index = -150;
61850
+ if (this.isShowProgressBarOnTop && !this.isShowStartingPage) {
61851
+ containerLayoutElements.push(layoutElement);
61852
+ }
61853
+ }
61854
+ if (container === "center" && isBelowHeader) {
61855
+ if (!!layoutElement.index) {
61856
+ delete layoutElement.index;
61857
+ }
61763
61858
  if (this.isShowProgressBarOnTop && !this.isShowStartingPage) {
61764
61859
  containerLayoutElements.push(layoutElement);
61765
61860
  }