survey-core 1.9.116 → 1.9.118

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 (261) hide show
  1. package/README.md +4 -0
  2. package/defaultV2.css +16 -6
  3. package/defaultV2.css.map +1 -1
  4. package/defaultV2.fontless.css +16 -6
  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 +3 -3
  25. package/i18n/english.js.map +1 -1
  26. package/i18n/english.min.js +2 -2
  27. package/i18n/estonian.js +1 -1
  28. package/i18n/estonian.min.js +1 -1
  29. package/i18n/finnish.js +1 -1
  30. package/i18n/finnish.min.js +1 -1
  31. package/i18n/french.js +1 -1
  32. package/i18n/french.min.js +1 -1
  33. package/i18n/georgian.js +1 -1
  34. package/i18n/georgian.min.js +1 -1
  35. package/i18n/german.js +1 -1
  36. package/i18n/german.min.js +1 -1
  37. package/i18n/greek.js +1 -1
  38. package/i18n/greek.min.js +1 -1
  39. package/i18n/hebrew.js +1 -1
  40. package/i18n/hebrew.min.js +1 -1
  41. package/i18n/hindi.js +1 -1
  42. package/i18n/hindi.min.js +1 -1
  43. package/i18n/hungarian.js +1 -1
  44. package/i18n/hungarian.min.js +1 -1
  45. package/i18n/icelandic.js +1 -1
  46. package/i18n/icelandic.min.js +1 -1
  47. package/i18n/index.js +1 -1
  48. package/i18n/index.min.js +1 -1
  49. package/i18n/indonesian.js +1 -1
  50. package/i18n/indonesian.min.js +1 -1
  51. package/i18n/italian.js +1 -1
  52. package/i18n/italian.min.js +1 -1
  53. package/i18n/japanese.js +1 -1
  54. package/i18n/japanese.min.js +1 -1
  55. package/i18n/kazakh.js +1 -1
  56. package/i18n/kazakh.min.js +1 -1
  57. package/i18n/korean.js +1 -1
  58. package/i18n/korean.min.js +1 -1
  59. package/i18n/latvian.js +1 -1
  60. package/i18n/latvian.min.js +1 -1
  61. package/i18n/lithuanian.js +1 -1
  62. package/i18n/lithuanian.min.js +1 -1
  63. package/i18n/macedonian.js +1 -1
  64. package/i18n/macedonian.min.js +1 -1
  65. package/i18n/malay.js +1 -1
  66. package/i18n/malay.min.js +1 -1
  67. package/i18n/nl-BE.js +1 -1
  68. package/i18n/nl-BE.min.js +1 -1
  69. package/i18n/norwegian.js +1 -1
  70. package/i18n/norwegian.min.js +1 -1
  71. package/i18n/persian.js +1 -1
  72. package/i18n/persian.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 +5 -2
  114. package/modern.css.map +1 -1
  115. package/modern.fontless.css +5 -2
  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 +404 -148
  125. package/survey.core.js.map +1 -1
  126. package/survey.core.min.js +4 -4
  127. package/survey.css +5 -2
  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/console-warnings.d.ts +1 -0
  215. package/ts3.4/typings/defaultCss/cssmodern.d.ts +1 -0
  216. package/ts3.4/typings/defaultCss/cssstandard.d.ts +1 -0
  217. package/ts3.4/typings/defaultCss/defaultV2Css.d.ts +1 -0
  218. package/ts3.4/typings/dragdrop/choices.d.ts +1 -0
  219. package/ts3.4/typings/dropdownListModel.d.ts +2 -1
  220. package/ts3.4/typings/jsonobject.d.ts +2 -0
  221. package/ts3.4/typings/localizablestring.d.ts +0 -1
  222. package/ts3.4/typings/martixBase.d.ts +2 -0
  223. package/ts3.4/typings/notifier.d.ts +11 -8
  224. package/ts3.4/typings/question.d.ts +2 -0
  225. package/ts3.4/typings/question_baseselect.d.ts +16 -2
  226. package/ts3.4/typings/question_checkbox.d.ts +5 -2
  227. package/ts3.4/typings/question_custom.d.ts +7 -1
  228. package/ts3.4/typings/question_file.d.ts +1 -0
  229. package/ts3.4/typings/question_imagepicker.d.ts +2 -1
  230. package/ts3.4/typings/question_matrixdropdownbase.d.ts +3 -0
  231. package/ts3.4/typings/question_matrixdropdowncolumn.d.ts +1 -0
  232. package/ts3.4/typings/question_matrixdynamic.d.ts +3 -0
  233. package/ts3.4/typings/question_signaturepad.d.ts +3 -1
  234. package/ts3.4/typings/question_textbase.d.ts +1 -2
  235. package/ts3.4/typings/settings.d.ts +26 -0
  236. package/ts3.4/typings/survey-events-api.d.ts +20 -8
  237. package/ts3.4/typings/survey.d.ts +14 -2
  238. package/typings/console-warnings.d.ts +1 -0
  239. package/typings/defaultCss/cssmodern.d.ts +1 -0
  240. package/typings/defaultCss/cssstandard.d.ts +1 -0
  241. package/typings/defaultCss/defaultV2Css.d.ts +1 -0
  242. package/typings/dragdrop/choices.d.ts +1 -0
  243. package/typings/dropdownListModel.d.ts +2 -1
  244. package/typings/jsonobject.d.ts +2 -0
  245. package/typings/localizablestring.d.ts +0 -1
  246. package/typings/martixBase.d.ts +2 -0
  247. package/typings/notifier.d.ts +11 -8
  248. package/typings/question.d.ts +2 -0
  249. package/typings/question_baseselect.d.ts +16 -2
  250. package/typings/question_checkbox.d.ts +5 -2
  251. package/typings/question_custom.d.ts +7 -1
  252. package/typings/question_file.d.ts +3 -1
  253. package/typings/question_imagepicker.d.ts +2 -1
  254. package/typings/question_matrixdropdownbase.d.ts +3 -0
  255. package/typings/question_matrixdropdowncolumn.d.ts +1 -0
  256. package/typings/question_matrixdynamic.d.ts +3 -0
  257. package/typings/question_signaturepad.d.ts +3 -1
  258. package/typings/question_textbase.d.ts +1 -2
  259. package/typings/settings.d.ts +26 -0
  260. package/typings/survey-events-api.d.ts +20 -8
  261. package/typings/survey.d.ts +14 -2
package/survey.core.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - Survey JavaScript library v1.9.116
2
+ * surveyjs - Survey JavaScript library v1.9.118
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
  */
@@ -112,7 +112,7 @@ return /******/ (function(modules) { // webpackBootstrap
112
112
  __webpack_require__.r(__webpack_exports__);
113
113
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return SignaturePad; });
114
114
  /*!
115
- * Signature Pad v4.1.6 | https://github.com/szimek/signature_pad
115
+ * Signature Pad v4.1.7 | https://github.com/szimek/signature_pad
116
116
  * (c) 2023 Szymon Nowak | Released under the MIT license
117
117
  */
118
118
 
@@ -143,14 +143,6 @@ class Point {
143
143
  }
144
144
 
145
145
  class Bezier {
146
- constructor(startPoint, control2, control1, endPoint, startWidth, endWidth) {
147
- this.startPoint = startPoint;
148
- this.control2 = control2;
149
- this.control1 = control1;
150
- this.endPoint = endPoint;
151
- this.startWidth = startWidth;
152
- this.endWidth = endWidth;
153
- }
154
146
  static fromPoints(points, widths) {
155
147
  const c2 = this.calculateControlPoints(points[0], points[1], points[2]).c2;
156
148
  const c3 = this.calculateControlPoints(points[1], points[2], points[3]).c1;
@@ -176,6 +168,14 @@ class Bezier {
176
168
  c2: new Point(m2.x + tx, m2.y + ty),
177
169
  };
178
170
  }
171
+ constructor(startPoint, control2, control1, endPoint, startWidth, endWidth) {
172
+ this.startPoint = startPoint;
173
+ this.control2 = control2;
174
+ this.control1 = control1;
175
+ this.endPoint = endPoint;
176
+ this.startWidth = startWidth;
177
+ this.endWidth = endWidth;
178
+ }
179
179
  length() {
180
180
  const steps = 10;
181
181
  let length = 0;
@@ -266,7 +266,7 @@ class SignaturePad extends SignatureEventTarget {
266
266
  constructor(canvas, options = {}) {
267
267
  super();
268
268
  this.canvas = canvas;
269
- this._drawningStroke = false;
269
+ this._drawingStroke = false;
270
270
  this._isEmpty = true;
271
271
  this._lastPoints = [];
272
272
  this._data = [];
@@ -274,18 +274,14 @@ class SignaturePad extends SignatureEventTarget {
274
274
  this._lastWidth = 0;
275
275
  this._handleMouseDown = (event) => {
276
276
  if (event.buttons === 1) {
277
- this._drawningStroke = true;
278
277
  this._strokeBegin(event);
279
278
  }
280
279
  };
281
280
  this._handleMouseMove = (event) => {
282
- if (this._drawningStroke) {
283
- this._strokeMoveUpdate(event);
284
- }
281
+ this._strokeMoveUpdate(event);
285
282
  };
286
283
  this._handleMouseUp = (event) => {
287
- if (event.buttons === 1 && this._drawningStroke) {
288
- this._drawningStroke = false;
284
+ if (event.buttons === 1) {
289
285
  this._strokeEnd(event);
290
286
  }
291
287
  };
@@ -316,20 +312,15 @@ class SignaturePad extends SignatureEventTarget {
316
312
  }
317
313
  };
318
314
  this._handlePointerStart = (event) => {
319
- this._drawningStroke = true;
320
315
  event.preventDefault();
321
316
  this._strokeBegin(event);
322
317
  };
323
318
  this._handlePointerMove = (event) => {
324
- if (this._drawningStroke) {
325
- event.preventDefault();
326
- this._strokeMoveUpdate(event);
327
- }
319
+ this._strokeMoveUpdate(event);
328
320
  };
329
321
  this._handlePointerEnd = (event) => {
330
- if (this._drawningStroke) {
322
+ if (this._drawingStroke) {
331
323
  event.preventDefault();
332
- this._drawningStroke = false;
333
324
  this._strokeEnd(event);
334
325
  }
335
326
  };
@@ -450,7 +441,11 @@ class SignaturePad extends SignatureEventTarget {
450
441
  };
451
442
  }
452
443
  _strokeBegin(event) {
453
- this.dispatchEvent(new CustomEvent('beginStroke', { detail: event }));
444
+ const cancelled = !this.dispatchEvent(new CustomEvent('beginStroke', { detail: event, cancelable: true }));
445
+ if (cancelled) {
446
+ return;
447
+ }
448
+ this._drawingStroke = true;
454
449
  const pointGroupOptions = this._getPointGroupOptions();
455
450
  const newPointGroup = Object.assign(Object.assign({}, pointGroupOptions), { points: [] });
456
451
  this._data.push(newPointGroup);
@@ -458,6 +453,9 @@ class SignaturePad extends SignatureEventTarget {
458
453
  this._strokeUpdate(event);
459
454
  }
460
455
  _strokeUpdate(event) {
456
+ if (!this._drawingStroke) {
457
+ return;
458
+ }
461
459
  if (this._data.length === 0) {
462
460
  this._strokeBegin(event);
463
461
  return;
@@ -496,17 +494,21 @@ class SignaturePad extends SignatureEventTarget {
496
494
  this.dispatchEvent(new CustomEvent('afterUpdateStroke', { detail: event }));
497
495
  }
498
496
  _strokeEnd(event) {
497
+ if (!this._drawingStroke) {
498
+ return;
499
+ }
499
500
  this._strokeUpdate(event);
501
+ this._drawingStroke = false;
500
502
  this.dispatchEvent(new CustomEvent('endStroke', { detail: event }));
501
503
  }
502
504
  _handlePointerEvents() {
503
- this._drawningStroke = false;
505
+ this._drawingStroke = false;
504
506
  this.canvas.addEventListener('pointerdown', this._handlePointerStart);
505
507
  this.canvas.addEventListener('pointermove', this._handlePointerMove);
506
508
  this.canvas.ownerDocument.addEventListener('pointerup', this._handlePointerEnd);
507
509
  }
508
510
  _handleMouseEvents() {
509
- this._drawningStroke = false;
511
+ this._drawingStroke = false;
510
512
  this.canvas.addEventListener('mousedown', this._handleMouseDown);
511
513
  this.canvas.addEventListener('mousemove', this._handleMouseMove);
512
514
  this.canvas.ownerDocument.addEventListener('mouseup', this._handleMouseUp);
@@ -4380,6 +4382,10 @@ var ConsoleWarnings = /** @class */ (function () {
4380
4382
  // eslint-disable-next-line no-console
4381
4383
  console.warn(text);
4382
4384
  };
4385
+ ConsoleWarnings.error = function (text) {
4386
+ // eslint-disable-next-line no-console
4387
+ console.error(text);
4388
+ };
4383
4389
  return ConsoleWarnings;
4384
4390
  }());
4385
4391
 
@@ -4816,6 +4822,7 @@ var modernCss = {
4816
4822
  },
4817
4823
  saveData: {
4818
4824
  root: "sv-save-data_root",
4825
+ rootWithButtons: "sv-save-data_root--with-buttons",
4819
4826
  info: "sv-save-data_info",
4820
4827
  error: "sv-save-data_error",
4821
4828
  success: "sv-save-data_success",
@@ -5208,6 +5215,7 @@ var defaultStandardCss = {
5208
5215
  },
5209
5216
  saveData: {
5210
5217
  root: "sv-save-data_root",
5218
+ rootWithButtons: "sv-save-data_root--with-buttons",
5211
5219
  info: "sv-save-data_info",
5212
5220
  error: "sv-save-data_error",
5213
5221
  success: "sv-save-data_success",
@@ -5905,6 +5913,7 @@ var defaultV2Css = {
5905
5913
  },
5906
5914
  saveData: {
5907
5915
  root: "sv-save-data_root",
5916
+ rootWithButtons: "sv-save-data_root--with-buttons",
5908
5917
  info: "sv-save-data_info",
5909
5918
  error: "sv-save-data_error",
5910
5919
  success: "sv-save-data_success",
@@ -6170,7 +6179,10 @@ var DragDropPageHelperV1 = /** @class */ (function () {
6170
6179
  allow: true,
6171
6180
  target: this.dragDropInfo.target,
6172
6181
  source: this.dragDropInfo.source,
6182
+ toElement: this.dragDropInfo.target,
6183
+ draggedElement: this.dragDropInfo.source,
6173
6184
  parent: parent,
6185
+ fromElement: this.dragDropInfo.source ? this.dragDropInfo.source.parent : null,
6174
6186
  insertAfter: insertAfter,
6175
6187
  insertBefore: insertBefore,
6176
6188
  };
@@ -6583,10 +6595,12 @@ var DragDropChoices = /** @class */ (function (_super) {
6583
6595
  var draggedElementShortcut = document.createElement("div");
6584
6596
  draggedElementShortcut.style.cssText = " \n cursor: grabbing;\n position: absolute;\n z-index: 10000;\n box-shadow: var(--sjs-shadow-large, 0px 8px 16px 0px rgba(0, 0, 0, 0.1)), var(--sjs-shadow-medium, 0px 2px 6px 0px rgba(0, 0, 0, 0.1));\n background-color: var(--sjs-general-backcolor, var(--background, #fff));\n padding: calc(0.5 * var(--sjs-base-unit, var(--base-unit, 8px)));\n border-radius: calc(0.5 * var(--sjs-base-unit, var(--base-unit, 8px)));\n ";
6585
6597
  var itemValueNode = draggedElementNode.closest("[data-sv-drop-target-item-value]");
6586
- var controlsNode = itemValueNode.querySelector(".svc-image-item-value-controls");
6598
+ this.imagepickerControlsNode = itemValueNode.querySelector(".svc-image-item-value-controls");
6587
6599
  var imageContainerNode = itemValueNode.querySelector(".sd-imagepicker__image-container");
6588
6600
  var imageNode = itemValueNode.querySelector(item.imageLink ? "img" : ".sd-imagepicker__no-image").cloneNode(true);
6589
- controlsNode.style.display = "none";
6601
+ if (!!this.imagepickerControlsNode) {
6602
+ this.imagepickerControlsNode.style.display = "none";
6603
+ }
6590
6604
  imageContainerNode.style.width = imageNode.width + "px";
6591
6605
  imageContainerNode.style.height = imageNode.height + "px";
6592
6606
  imageNode.style.objectFit = "cover";
@@ -6676,6 +6690,10 @@ var DragDropChoices = /** @class */ (function (_super) {
6676
6690
  if (!!this.parentElement) {
6677
6691
  this.updateVisibleChoices(this.parentElement);
6678
6692
  }
6693
+ if (!!this.imagepickerControlsNode) {
6694
+ this.imagepickerControlsNode.style.display = "flex";
6695
+ this.imagepickerControlsNode = null;
6696
+ }
6679
6697
  _super.prototype.clear.call(this);
6680
6698
  };
6681
6699
  DragDropChoices.prototype.updateVisibleChoices = function (parent) {
@@ -8086,13 +8104,20 @@ var DropdownListModel = /** @class */ (function (_super) {
8086
8104
  enumerable: false,
8087
8105
  configurable: true
8088
8106
  });
8089
- Object.defineProperty(DropdownListModel.prototype, "inputReadOnly", {
8107
+ Object.defineProperty(DropdownListModel.prototype, "noTabIndex", {
8090
8108
  get: function () {
8091
8109
  return this.question.isInputReadOnly || this.searchEnabled;
8092
8110
  },
8093
8111
  enumerable: false,
8094
8112
  configurable: true
8095
8113
  });
8114
+ Object.defineProperty(DropdownListModel.prototype, "filterReadOnly", {
8115
+ get: function () {
8116
+ return this.question.isInputReadOnly || !this.searchEnabled || !this.focused;
8117
+ },
8118
+ enumerable: false,
8119
+ configurable: true
8120
+ });
8096
8121
  Object.defineProperty(DropdownListModel.prototype, "filterStringEnabled", {
8097
8122
  get: function () {
8098
8123
  return !this.question.isInputReadOnly && this.searchEnabled;
@@ -8299,6 +8324,9 @@ var DropdownListModel = /** @class */ (function (_super) {
8299
8324
  DropdownListModel.prototype.scrollToFocusedItem = function () {
8300
8325
  this.listModel.scrollToFocusedItem();
8301
8326
  };
8327
+ __decorate([
8328
+ Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])({ defaultValue: false })
8329
+ ], DropdownListModel.prototype, "focused", void 0);
8302
8330
  __decorate([
8303
8331
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])({ defaultValue: true })
8304
8332
  ], DropdownListModel.prototype, "searchEnabled", void 0);
@@ -9259,8 +9287,8 @@ __webpack_require__.r(__webpack_exports__);
9259
9287
  //import "../../modern.scss";
9260
9288
  var Version;
9261
9289
  var ReleaseDate;
9262
- Version = "" + "1.9.116";
9263
- ReleaseDate = "" + "2023-11-07";
9290
+ Version = "" + "1.9.118";
9291
+ ReleaseDate = "" + "2023-11-21";
9264
9292
  function checkLibraryVersion(ver, libraryName) {
9265
9293
  if (Version != ver) {
9266
9294
  var str = "survey-core has version '" + Version + "' and " + libraryName
@@ -9304,6 +9332,8 @@ function _slk(k, lh, rd) {
9304
9332
  var index = v.indexOf(";");
9305
9333
  if (index < 0)
9306
9334
  return;
9335
+ if (!checkPrefix(v.substring(0, index)))
9336
+ return;
9307
9337
  v = v.substring(index + 1);
9308
9338
  v.split(",").forEach(function (s) {
9309
9339
  var i = s.indexOf("=");
@@ -9312,6 +9342,27 @@ function _slk(k, lh, rd) {
9312
9342
  }
9313
9343
  });
9314
9344
  }
9345
+ function checkPrefix(prefix) {
9346
+ if (!prefix)
9347
+ return true;
9348
+ var s = "domains:";
9349
+ var index = prefix.indexOf(s);
9350
+ if (index < 0)
9351
+ return true;
9352
+ var ds = prefix.substring(index + s.length).toLowerCase().split(",");
9353
+ if (!Array.isArray(ds) || ds.length === 0)
9354
+ return true;
9355
+ if (typeof window !== "undefined" && !!window.location && !!window.location.hostname) {
9356
+ var hn = window.location.hostname.toLowerCase();
9357
+ ds.push("localhost");
9358
+ for (var i = 0; i < ds.length; i++) {
9359
+ if (hn.indexOf(ds[i]) > -1)
9360
+ return true;
9361
+ }
9362
+ return false;
9363
+ }
9364
+ return true;
9365
+ }
9315
9366
 
9316
9367
 
9317
9368
 
@@ -14462,8 +14513,8 @@ var OperandMaker = /** @class */ (function () {
14462
14513
  right = OperandMaker.convertValForDateCompare(right, left);
14463
14514
  return OperandMaker.isTwoValueEquals(left, right, strictCompare !== true);
14464
14515
  },
14465
- notequal: function (left, right) {
14466
- return !OperandMaker.binaryFunctions.equal(left, right);
14516
+ notequal: function (left, right, strictCompare) {
14517
+ return !OperandMaker.binaryFunctions.equal(left, right, strictCompare);
14467
14518
  },
14468
14519
  contains: function (left, right) {
14469
14520
  return OperandMaker.binaryFunctions.containsCore(left, right, true);
@@ -17345,6 +17396,10 @@ function property(options) {
17345
17396
  if (!options || !options.localizable) {
17346
17397
  Object.defineProperty(target, key, {
17347
17398
  get: function () {
17399
+ // const serializationProperty = Serializer.getProperty(target.getType(), key);
17400
+ // if(!!serializationProperty && options.defaultValue !== undefined) {
17401
+ // ConsoleWarnings.error("remove defaultValue from @property for class " + target.getType() + " property name is " + key);
17402
+ // }
17348
17403
  var defaultVal = null;
17349
17404
  if (!!options) {
17350
17405
  if (typeof options.getDefaultValue === "function") {
@@ -17551,6 +17606,11 @@ var JsonObjectProperty = /** @class */ (function () {
17551
17606
  return ((value === false && (this.type == "boolean" || this.type == "switch")) ||
17552
17607
  value === "" || _helpers__WEBPACK_IMPORTED_MODULE_2__["Helpers"].isValueEmpty(value));
17553
17608
  };
17609
+ JsonObjectProperty.prototype.getSerializableValue = function (obj) {
17610
+ if (!!this.onSerializeValue)
17611
+ return this.onSerializeValue(obj);
17612
+ return this.getValue(obj);
17613
+ };
17554
17614
  JsonObjectProperty.prototype.getValue = function (obj) {
17555
17615
  if (this.onGetValue)
17556
17616
  return this.onGetValue(obj);
@@ -18142,6 +18202,9 @@ var JsonMetadataClass = /** @class */ (function () {
18142
18202
  if (!!propInfo.baseValue) {
18143
18203
  prop.setBaseValue(propInfo.baseValue);
18144
18204
  }
18205
+ if (propInfo.onSerializeValue) {
18206
+ prop.onSerializeValue = propInfo.onSerializeValue;
18207
+ }
18145
18208
  if (propInfo.onGetValue) {
18146
18209
  prop.onGetValue = propInfo.onGetValue;
18147
18210
  }
@@ -18936,7 +18999,7 @@ var JsonObject = /** @class */ (function () {
18936
18999
  if (property.isSerializable === false ||
18937
19000
  (property.isLightSerializable === false && this.lightSerializing))
18938
19001
  return;
18939
- var value = property.getValue(obj);
19002
+ var value = property.getSerializableValue(obj);
18940
19003
  if (!storeDefaults && property.isDefaultValueByObj(obj, value))
18941
19004
  return;
18942
19005
  if (this.isValueArray(value)) {
@@ -19752,9 +19815,6 @@ var LocalizableString = /** @class */ (function () {
19752
19815
  };
19753
19816
  LocalizableString.prototype.isLocaleTextEqualsWithDefault = function (loc, val) {
19754
19817
  var res = this.getLocaleTextCore(loc);
19755
- if (!res && this.onGetDefaultTextCallback) {
19756
- res = this.onGetDefaultTextCallback();
19757
- }
19758
19818
  if (res === val)
19759
19819
  return true;
19760
19820
  return this.isValueEmpty(res) && this.isValueEmpty(val);
@@ -20186,8 +20246,8 @@ var englishStrings = {
20186
20246
  textMaxLength: "Please enter no more than {0} character(s).",
20187
20247
  textMinMaxLength: "Please enter at least {0} and no more than {1} characters.",
20188
20248
  minRowCountError: "Please fill in at least {0} row(s).",
20189
- minSelectError: "Please select at least {0} variant(s).",
20190
- maxSelectError: "Please select no more than {0} variant(s).",
20249
+ minSelectError: "Please select at least {0} option(s).",
20250
+ maxSelectError: "Please select no more than {0} option(s).",
20191
20251
  numericMinMax: "The '{0}' should be at least {1} and at most {2}",
20192
20252
  numericMin: "The '{0}' should be at least {1}",
20193
20253
  numericMax: "The '{0}' should be at most {1}",
@@ -20639,8 +20699,21 @@ var QuestionMatrixBaseModel = /** @class */ (function (_super) {
20639
20699
  enumerable: false,
20640
20700
  configurable: true
20641
20701
  });
20702
+ //a11y
20703
+ QuestionMatrixBaseModel.prototype.getCellAriaLabel = function (rowTitle, columnTitle) {
20704
+ var row = (this.getLocalizationString("matrix_row") || "row").toLocaleLowerCase();
20705
+ var column = (this.getLocalizationString("matrix_column") || "column").toLocaleLowerCase();
20706
+ return row + " " + rowTitle + ", " + column + " " + columnTitle;
20707
+ };
20708
+ Object.defineProperty(QuestionMatrixBaseModel.prototype, "isNewA11yStructure", {
20709
+ get: function () {
20710
+ return true;
20711
+ },
20712
+ enumerable: false,
20713
+ configurable: true
20714
+ });
20642
20715
  __decorate([
20643
- Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])({ defaultValue: "middle" })
20716
+ Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])()
20644
20717
  ], QuestionMatrixBaseModel.prototype, "verticalAlign", void 0);
20645
20718
  __decorate([
20646
20719
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])()
@@ -20818,6 +20891,7 @@ var Notifier = /** @class */ (function (_super) {
20818
20891
  Notifier.prototype.getCssClass = function (type) {
20819
20892
  return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_3__["CssClassBuilder"]()
20820
20893
  .append(this.cssClasses.root)
20894
+ .append(this.cssClasses.rootWithButtons, this.actionBar.visibleActions.length > 0)
20821
20895
  .append(this.cssClasses.info, type !== "error" && type !== "success")
20822
20896
  .append(this.cssClasses.error, type === "error")
20823
20897
  .append(this.cssClasses.success, type === "success")
@@ -24589,7 +24663,9 @@ var PopupBaseViewModel = /** @class */ (function (_super) {
24589
24663
  }
24590
24664
  currentElement = currentElement.parentElement;
24591
24665
  }
24592
- event.preventDefault();
24666
+ if (event.cancelable) {
24667
+ event.preventDefault();
24668
+ }
24593
24669
  };
24594
24670
  PopupBaseViewModel.SubscriptionId = 0;
24595
24671
  __decorate([
@@ -24909,10 +24985,6 @@ var Question = /** @class */ (function (_super) {
24909
24985
  _this.addExpressionProperty("enableIf", function (obj, res) { _this.readOnly = res === false; });
24910
24986
  _this.addExpressionProperty("requiredIf", function (obj, res) { _this.isRequired = res === true; });
24911
24987
  _this.createLocalizableString("commentText", _this, true, "otherItemText");
24912
- _this.locTitle.onGetDefaultTextCallback = function () {
24913
- return _this.name;
24914
- };
24915
- _this.locTitle.storeDefaultText = true;
24916
24988
  _this.createLocalizableString("requiredErrorText", _this);
24917
24989
  _this.addTriggerInfo("resetValueIf", function () { return !_this.isEmpty(); }, function () {
24918
24990
  _this.clearValue();
@@ -24961,12 +25033,14 @@ var Question = /** @class */ (function (_super) {
24961
25033
  this.isMobile = val && (this.allowMobileInDesignMode() || !this.isDesignMode);
24962
25034
  };
24963
25035
  Question.prototype.themeChanged = function (theme) { };
25036
+ Question.prototype.getDefaultTitle = function () { return this.name; };
24964
25037
  Question.prototype.createLocTitleProperty = function () {
24965
25038
  var _this = this;
24966
25039
  var locTitleValue = _super.prototype.createLocTitleProperty.call(this);
25040
+ locTitleValue.storeDefaultText = true;
24967
25041
  locTitleValue.onGetTextCallback = function (text) {
24968
25042
  if (!text) {
24969
- text = _this.name;
25043
+ text = _this.getDefaultTitle();
24970
25044
  }
24971
25045
  if (!_this.survey)
24972
25046
  return text;
@@ -26373,6 +26447,7 @@ var Question = /** @class */ (function (_super) {
26373
26447
  * @see otherItem
26374
26448
  * @see otherErrorText
26375
26449
  * @see showCommentArea
26450
+ * @see [settings.specialChoicesOrder](https://surveyjs.io/form-library/documentation/api-reference/settings#specialChoicesOrder)
26376
26451
  */
26377
26452
  get: function () {
26378
26453
  return this.getPropertyValue("showOtherItem", false);
@@ -26442,6 +26517,9 @@ var Question = /** @class */ (function (_super) {
26442
26517
  Question.prototype.onReadOnlyChanged = function () {
26443
26518
  this.setPropertyValue("isInputReadOnly", this.isInputReadOnly);
26444
26519
  _super.prototype.onReadOnlyChanged.call(this);
26520
+ if (this.isReadOnly) {
26521
+ this.clearErrors();
26522
+ }
26445
26523
  this.updateQuestionCss();
26446
26524
  this.calcRenderedCommentPlaceholder();
26447
26525
  };
@@ -28358,6 +28436,8 @@ var QuestionSelectBase = /** @class */ (function (_super) {
28358
28436
  _this.isRunningChoices = false;
28359
28437
  _this.isFirstLoadChoicesFromUrl = true;
28360
28438
  _this.isUpdatingChoicesDependedQuestions = false;
28439
+ _this.headItemsCount = 0;
28440
+ _this.footItemsCount = 0;
28361
28441
  _this.prevIsOtherSelected = false;
28362
28442
  var noneItemText = _this.createLocalizableString("noneText", _this.noneItemValue, true, "noneItemText");
28363
28443
  _this.noneItemValue.locOwner = _this;
@@ -28538,6 +28618,7 @@ var QuestionSelectBase = /** @class */ (function (_super) {
28538
28618
  * When users select the "None" item in multi-select questions, all other items become unselected.
28539
28619
  * @see noneItem
28540
28620
  * @see noneText
28621
+ * @see [settings.specialChoicesOrder](https://surveyjs.io/form-library/documentation/api-reference/settings#specialChoicesOrder)
28541
28622
  */
28542
28623
  get: function () {
28543
28624
  return this.getPropertyValue("showNoneItem");
@@ -29019,6 +29100,7 @@ var QuestionSelectBase = /** @class */ (function (_super) {
29019
29100
  *
29020
29101
  * [View Demo](https://surveyjs.io/form-library/examples/questiontype-dropdownrestfull/ (linkStyle))
29021
29102
  * @see choices
29103
+ * @see [settings.specialChoicesOrder](https://surveyjs.io/form-library/documentation/api-reference/settings#specialChoicesOrder)
29022
29104
  */
29023
29105
  get: function () {
29024
29106
  return this.getPropertyValue("choicesByUrl");
@@ -29052,6 +29134,7 @@ var QuestionSelectBase = /** @class */ (function (_super) {
29052
29134
  * If you need to specify only the `value` property, you can set the `choices` property to an array of primitive values, for example, `[ "item1", "item2", "item3" ]`. These values are both saved in survey results and used as display text.
29053
29135
  * @see choicesByUrl
29054
29136
  * @see choicesFromQuestion
29137
+ * @see [settings.specialChoicesOrder](https://surveyjs.io/form-library/documentation/api-reference/settings#specialChoicesOrder)
29055
29138
  */
29056
29139
  get: function () {
29057
29140
  return this.getPropertyValue("choices");
@@ -29194,6 +29277,7 @@ var QuestionSelectBase = /** @class */ (function (_super) {
29194
29277
  * - `"asc"`- Sorts choice items in ascending order.
29195
29278
  * - `"desc"`- Sorts choice items in ascending order.
29196
29279
  * - `"random"` - Displays choice items in random order.
29280
+ * @see [settings.specialChoicesOrder](https://surveyjs.io/form-library/documentation/api-reference/settings#specialChoicesOrder)
29197
29281
  */
29198
29282
  get: function () {
29199
29283
  return this.getPropertyValue("choicesOrder");
@@ -29337,22 +29421,51 @@ var QuestionSelectBase = /** @class */ (function (_super) {
29337
29421
  configurable: true
29338
29422
  });
29339
29423
  QuestionSelectBase.prototype.addToVisibleChoices = function (items, isAddAll) {
29340
- if (isAddAll) {
29341
- if (!this.newItemValue) {
29342
- this.newItemValue = this.createItemValue("newitem"); //TODO
29343
- this.newItemValue.isGhost = true;
29424
+ this.headItemsCount = 0;
29425
+ this.footItemsCount = 0;
29426
+ this.addNewItemToVisibleChoices(items, isAddAll);
29427
+ var dict = new Array();
29428
+ this.addNonChoicesItems(dict, isAddAll);
29429
+ dict.sort(function (a, b) {
29430
+ if (a.index === b.index)
29431
+ return 0;
29432
+ return a.index < b.index ? -1 : 1;
29433
+ });
29434
+ for (var i = 0; i < dict.length; i++) {
29435
+ var rec = dict[i];
29436
+ if (rec.index < 0) {
29437
+ items.splice(i, 0, rec.item);
29438
+ this.headItemsCount++;
29344
29439
  }
29345
- if (!this.isUsingCarryForward && this.canShowOptionItem(this.newItemValue, isAddAll, false)) {
29346
- items.push(this.newItemValue);
29440
+ else {
29441
+ items.push(rec.item);
29442
+ this.footItemsCount++;
29347
29443
  }
29348
29444
  }
29445
+ };
29446
+ QuestionSelectBase.prototype.addNewItemToVisibleChoices = function (items, isAddAll) {
29447
+ if (!isAddAll)
29448
+ return;
29449
+ if (!this.newItemValue) {
29450
+ this.newItemValue = this.createItemValue("newitem"); //TODO
29451
+ this.newItemValue.isGhost = true;
29452
+ }
29453
+ if (!this.isUsingCarryForward && this.canShowOptionItem(this.newItemValue, isAddAll, false)) {
29454
+ this.footItemsCount = 1;
29455
+ items.push(this.newItemValue);
29456
+ }
29457
+ };
29458
+ QuestionSelectBase.prototype.addNonChoicesItems = function (dict, isAddAll) {
29349
29459
  if (this.supportNone() && this.canShowOptionItem(this.noneItem, isAddAll, this.hasNone)) {
29350
- items.push(this.noneItem);
29460
+ this.addNonChoiceItem(dict, this.noneItem, _settings__WEBPACK_IMPORTED_MODULE_9__["settings"].specialChoicesOrder.noneItem);
29351
29461
  }
29352
29462
  if (this.supportOther() && this.canShowOptionItem(this.otherItem, isAddAll, this.hasOther)) {
29353
- items.push(this.otherItem);
29463
+ this.addNonChoiceItem(dict, this.otherItem, _settings__WEBPACK_IMPORTED_MODULE_9__["settings"].specialChoicesOrder.otherItem);
29354
29464
  }
29355
29465
  };
29466
+ QuestionSelectBase.prototype.addNonChoiceItem = function (dict, item, order) {
29467
+ order.forEach(function (val) { return dict.push({ index: val, item: item }); });
29468
+ };
29356
29469
  QuestionSelectBase.prototype.canShowOptionItem = function (item, isAddAll, hasItem) {
29357
29470
  var res = (isAddAll && (!!this.canShowOptionItemCallback ? this.canShowOptionItemCallback(item) : true)) || hasItem;
29358
29471
  if (this.canSurveyChangeItemVisibility()) {
@@ -29584,17 +29697,11 @@ var QuestionSelectBase = /** @class */ (function (_super) {
29584
29697
  enumerable: false,
29585
29698
  configurable: true
29586
29699
  });
29587
- QuestionSelectBase.prototype.isHeadChoice = function (item, question) {
29588
- return false;
29589
- };
29590
- QuestionSelectBase.prototype.isFootChoice = function (item, question) {
29700
+ QuestionSelectBase.prototype.isBuiltInChoice = function (item, question) {
29591
29701
  return (item === question.noneItem ||
29592
29702
  item === question.otherItem ||
29593
29703
  item === question.newItemValue);
29594
29704
  };
29595
- QuestionSelectBase.prototype.isBuiltInChoice = function (item, question) {
29596
- return this.isHeadChoice(item, question) || this.isFootChoice(item, question);
29597
- };
29598
29705
  QuestionSelectBase.prototype.getChoices = function () {
29599
29706
  return this.choices;
29600
29707
  };
@@ -30006,18 +30113,23 @@ var QuestionSelectBase = /** @class */ (function (_super) {
30006
30113
  };
30007
30114
  Object.defineProperty(QuestionSelectBase.prototype, "headItems", {
30008
30115
  get: function () {
30009
- var _this = this;
30010
- return (this.separateSpecialChoices || this.isDesignMode) ?
30011
- this.visibleChoices.filter(function (choice) { return _this.isHeadChoice(choice, _this); }) : [];
30116
+ var count = (this.separateSpecialChoices || this.isDesignMode) ? this.headItemsCount : 0;
30117
+ var res = [];
30118
+ for (var i = 0; i < count; i++)
30119
+ res.push(this.visibleChoices[i]);
30120
+ return res;
30012
30121
  },
30013
30122
  enumerable: false,
30014
30123
  configurable: true
30015
30124
  });
30016
30125
  Object.defineProperty(QuestionSelectBase.prototype, "footItems", {
30017
30126
  get: function () {
30018
- var _this = this;
30019
- return (this.separateSpecialChoices || this.isDesignMode) ?
30020
- this.visibleChoices.filter(function (choice) { return _this.isFootChoice(choice, _this); }) : [];
30127
+ var count = (this.separateSpecialChoices || this.isDesignMode) ? this.footItemsCount : 0;
30128
+ var res = [];
30129
+ var items = this.visibleChoices;
30130
+ for (var i = 0; i < count; i++)
30131
+ res.push(items[items.length - count + i]);
30132
+ return res;
30021
30133
  },
30022
30134
  enumerable: false,
30023
30135
  configurable: true
@@ -30262,7 +30374,7 @@ var QuestionCheckboxBase = /** @class */ (function (_super) {
30262
30374
  * @see separateSpecialChoices
30263
30375
  */
30264
30376
  get: function () {
30265
- return this.getPropertyValue("colCount", this.isFlowLayout ? 0 : 1);
30377
+ return this.getPropertyValue("colCount", this.isFlowLayout ? 0 : undefined);
30266
30378
  },
30267
30379
  set: function (value) {
30268
30380
  if (value < 0 || value > 5 || this.isFlowLayout)
@@ -31088,6 +31200,7 @@ __webpack_require__.r(__webpack_exports__);
31088
31200
  /* harmony import */ var _itemvalue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./itemvalue */ "./src/itemvalue.ts");
31089
31201
  /* harmony import */ var _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils/cssClassBuilder */ "./src/utils/cssClassBuilder.ts");
31090
31202
  /* harmony import */ var _error__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./error */ "./src/error.ts");
31203
+ /* harmony import */ var _settings__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./settings */ "./src/settings.ts");
31091
31204
  var __extends = (undefined && undefined.__extends) || (function () {
31092
31205
  var extendStatics = function (d, b) {
31093
31206
  extendStatics = Object.setPrototypeOf ||
@@ -31110,6 +31223,7 @@ var __extends = (undefined && undefined.__extends) || (function () {
31110
31223
 
31111
31224
 
31112
31225
 
31226
+
31113
31227
  /**
31114
31228
  * A class that describes the Checkboxes question type.
31115
31229
  *
@@ -31237,12 +31351,13 @@ var QuestionCheckboxModel = /** @class */ (function (_super) {
31237
31351
  if (this.isItemSelected(this.noneItem))
31238
31352
  return false;
31239
31353
  var allItemCount = this.visibleChoices.length;
31354
+ var order = _settings__WEBPACK_IMPORTED_MODULE_7__["settings"].specialChoicesOrder;
31240
31355
  if (this.hasOther)
31241
- allItemCount--;
31356
+ allItemCount -= order.otherItem.length;
31242
31357
  if (this.hasNone)
31243
- allItemCount--;
31358
+ allItemCount -= order.noneItem.length;
31244
31359
  if (this.hasSelectAll)
31245
- allItemCount--;
31360
+ allItemCount -= order.selectAllItem.length;
31246
31361
  var selectedCount = val.length;
31247
31362
  if (this.isOtherSelected)
31248
31363
  selectedCount--;
@@ -31350,12 +31465,14 @@ var QuestionCheckboxModel = /** @class */ (function (_super) {
31350
31465
  * @see enabledChoices
31351
31466
  */
31352
31467
  get: function () {
31468
+ var val = this.renderedValue;
31469
+ var visChoices = this.visibleChoices;
31470
+ var selectedItemValues = this.selectedItemValues;
31353
31471
  if (this.isEmpty())
31354
31472
  return [];
31355
- var val = this.renderedValue;
31356
- var allChoices = !!this.defaultSelectedItemValues ? [].concat(this.defaultSelectedItemValues, this.visibleChoices) : this.visibleChoices;
31473
+ var allChoices = !!this.defaultSelectedItemValues ? [].concat(this.defaultSelectedItemValues, visChoices) : visChoices;
31357
31474
  var itemValues = val.map(function (item) { return _itemvalue__WEBPACK_IMPORTED_MODULE_4__["ItemValue"].getItemByValue(allChoices, item); }).filter(function (item) { return !!item; });
31358
- if (!itemValues.length && !this.selectedItemValues) {
31475
+ if (!itemValues.length && !selectedItemValues) {
31359
31476
  this.updateSelectedItemValues();
31360
31477
  }
31361
31478
  return this.validateItemValues(itemValues);
@@ -31535,14 +31652,14 @@ var QuestionCheckboxModel = /** @class */ (function (_super) {
31535
31652
  QuestionCheckboxModel.prototype.supportSelectAll = function () {
31536
31653
  return this.isSupportProperty("showSelectAllItem");
31537
31654
  };
31538
- QuestionCheckboxModel.prototype.addToVisibleChoices = function (items, isAddAll) {
31655
+ QuestionCheckboxModel.prototype.addNonChoicesItems = function (dict, isAddAll) {
31656
+ _super.prototype.addNonChoicesItems.call(this, dict, isAddAll);
31539
31657
  if (this.supportSelectAll() && this.canShowOptionItem(this.selectAllItem, isAddAll, this.hasSelectAll)) {
31540
- items.unshift(this.selectAllItem);
31658
+ this.addNonChoiceItem(dict, this.selectAllItem, _settings__WEBPACK_IMPORTED_MODULE_7__["settings"].specialChoicesOrder.selectAllItem);
31541
31659
  }
31542
- _super.prototype.addToVisibleChoices.call(this, items, isAddAll);
31543
31660
  };
31544
- QuestionCheckboxModel.prototype.isHeadChoice = function (item, question) {
31545
- return (item === question.selectAllItem);
31661
+ QuestionCheckboxModel.prototype.isBuiltInChoice = function (item, question) {
31662
+ return item === question.selectAllItem || _super.prototype.isBuiltInChoice.call(this, item, question);
31546
31663
  };
31547
31664
  QuestionCheckboxModel.prototype.isItemInList = function (item) {
31548
31665
  if (item == this.selectAllItem)
@@ -31953,7 +32070,7 @@ var QuestionCommentModel = /** @class */ (function (_super) {
31953
32070
  this.updateRemainingCharacterCounter(event.target.value);
31954
32071
  };
31955
32072
  QuestionCommentModel.prototype.onKeyDown = function (event) {
31956
- this.checkForUndo(event);
32073
+ this.onKeyDownPreprocess && this.onKeyDownPreprocess(event);
31957
32074
  if (!this.acceptCarriageReturn && (event.key === "Enter" || event.keyCode === 13)) {
31958
32075
  event.preventDefault();
31959
32076
  event.stopPropagation();
@@ -32165,6 +32282,15 @@ var ComponentCollection = /** @class */ (function () {
32165
32282
  this.onAddingJson(name, customQuestion.isComposite);
32166
32283
  this.customQuestionValues.push(customQuestion);
32167
32284
  };
32285
+ ComponentCollection.prototype.remove = function (componentName) {
32286
+ if (!componentName)
32287
+ return false;
32288
+ var index = this.getCustomQuestionIndex(componentName.toLowerCase());
32289
+ if (index < 0)
32290
+ return false;
32291
+ this.removeByIndex(index);
32292
+ return true;
32293
+ };
32168
32294
  Object.defineProperty(ComponentCollection.prototype, "items", {
32169
32295
  get: function () {
32170
32296
  return this.customQuestionValues;
@@ -32173,17 +32299,26 @@ var ComponentCollection = /** @class */ (function () {
32173
32299
  configurable: true
32174
32300
  });
32175
32301
  ComponentCollection.prototype.getCustomQuestionByName = function (name) {
32302
+ var index = this.getCustomQuestionIndex(name);
32303
+ return index >= 0 ? this.customQuestionValues[index] : undefined;
32304
+ };
32305
+ ComponentCollection.prototype.getCustomQuestionIndex = function (name) {
32176
32306
  for (var i = 0; i < this.customQuestionValues.length; i++) {
32177
- if (this.customQuestionValues[i].name == name)
32178
- return this.customQuestionValues[i];
32307
+ if (this.customQuestionValues[i].name === name)
32308
+ return i;
32179
32309
  }
32180
- return null;
32310
+ return -1;
32181
32311
  };
32182
- ComponentCollection.prototype.clear = function () {
32183
- for (var i = 0; i < this.customQuestionValues.length; i++) {
32184
- _jsonobject__WEBPACK_IMPORTED_MODULE_1__["Serializer"].removeClass(this.customQuestionValues[i].name);
32312
+ ComponentCollection.prototype.removeByIndex = function (index) {
32313
+ _jsonobject__WEBPACK_IMPORTED_MODULE_1__["Serializer"].removeClass(this.customQuestionValues[index].name);
32314
+ this.customQuestionValues.splice(index, 1);
32315
+ };
32316
+ ComponentCollection.prototype.clear = function (includeInternal) {
32317
+ for (var i = this.customQuestionValues.length - 1; i >= 0; i--) {
32318
+ if (includeInternal || !this.customQuestionValues[i].json.internal) {
32319
+ this.removeByIndex(i);
32320
+ }
32185
32321
  }
32186
- this.customQuestionValues = [];
32187
32322
  };
32188
32323
  ComponentCollection.prototype.createQuestion = function (name, questionJSON) {
32189
32324
  if (!!questionJSON.isComposite)
@@ -32451,6 +32586,11 @@ var QuestionCustomModel = /** @class */ (function (_super) {
32451
32586
  QuestionCustomModel.prototype.getQuestionByName = function (name) {
32452
32587
  return this.contentQuestion;
32453
32588
  };
32589
+ QuestionCustomModel.prototype.getDefaultTitle = function () {
32590
+ if (this.hasJSONTitle && this.contentQuestion)
32591
+ return this.contentQuestion.title;
32592
+ return _super.prototype.getDefaultTitle.call(this);
32593
+ };
32454
32594
  QuestionCustomModel.prototype.setValue = function (name, newValue, locNotification, allowNotifyValueChanged) {
32455
32595
  if (this.isValueChanging(name, newValue))
32456
32596
  return;
@@ -32505,6 +32645,7 @@ var QuestionCustomModel = /** @class */ (function (_super) {
32505
32645
  var json = this.customQuestion.json;
32506
32646
  var res = null;
32507
32647
  if (!!json.questionJSON) {
32648
+ this.hasJSONTitle = !!json.questionJSON.title;
32508
32649
  var qType = json.questionJSON.type;
32509
32650
  if (!qType || !_jsonobject__WEBPACK_IMPORTED_MODULE_1__["Serializer"].findClass(qType))
32510
32651
  throw "type attribute in questionJSON is empty or incorrect";
@@ -33360,7 +33501,7 @@ var QuestionDropdownModel = /** @class */ (function (_super) {
33360
33501
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])()
33361
33502
  ], QuestionDropdownModel.prototype, "choicesLazyLoadEnabled", void 0);
33362
33503
  __decorate([
33363
- Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])({ defaultValue: 25 })
33504
+ Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])()
33364
33505
  ], QuestionDropdownModel.prototype, "choicesLazyLoadPageSize", void 0);
33365
33506
  __decorate([
33366
33507
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])()
@@ -33643,7 +33784,7 @@ var QuestionExpressionModel = /** @class */ (function (_super) {
33643
33784
  this.updateFormatedValue();
33644
33785
  };
33645
33786
  QuestionExpressionModel.prototype.getDisplayValueCore = function (keysAsText, value) {
33646
- var val = this.isValueEmpty(value) ? this.defaultValue : value;
33787
+ var val = value === undefined || value === null ? this.defaultValue : value;
33647
33788
  var res = "";
33648
33789
  if (!this.isValueEmpty(val)) {
33649
33790
  var str = this.getValueAsStr(val);
@@ -34070,7 +34211,6 @@ var QuestionFileModel = /** @class */ (function (_super) {
34070
34211
  _this.onUploadStateChanged = _this.addEvent();
34071
34212
  _this.onStateChanged = _this.addEvent();
34072
34213
  _this.fileNavigator = new _actions_container__WEBPACK_IMPORTED_MODULE_7__["ActionContainer"]();
34073
- _this.actionsContainer = new _actions_container__WEBPACK_IMPORTED_MODULE_7__["ActionContainer"]();
34074
34214
  _this.canFlipCameraValue = undefined;
34075
34215
  _this.prevPreviewLength = 0;
34076
34216
  _this.calcAvailableItemsCount = function (availableWidth, itemWidth, gap) {
@@ -34129,6 +34269,9 @@ var QuestionFileModel = /** @class */ (function (_super) {
34129
34269
  Object(_utils_utils__WEBPACK_IMPORTED_MODULE_6__["loadFileFromBase64"])(data.content, data.name);
34130
34270
  }
34131
34271
  };
34272
+ _this.createLocalizableString("takePhotoCaption", _this, false, true);
34273
+ _this.actionsContainer = new _actions_container__WEBPACK_IMPORTED_MODULE_7__["ActionContainer"]();
34274
+ _this.actionsContainer.locOwner = _this;
34132
34275
  _this.fileIndexAction = new _actions_action__WEBPACK_IMPORTED_MODULE_8__["Action"]({
34133
34276
  id: "fileIndex",
34134
34277
  title: _this.getFileIndexCaption(),
@@ -34155,7 +34298,7 @@ var QuestionFileModel = /** @class */ (function (_super) {
34155
34298
  id: "sv-file-take-picture",
34156
34299
  iconSize: "auto",
34157
34300
  innerCss: new _base__WEBPACK_IMPORTED_MODULE_3__["ComputedUpdater"](function () { return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_5__["CssClassBuilder"]().append(_this.cssClasses.contextButton).append(_this.cssClasses.takePictureButton).toString(); }),
34158
- title: new _base__WEBPACK_IMPORTED_MODULE_3__["ComputedUpdater"](function () { return _this.takePhotoCaption; }),
34301
+ locTitle: _this.locTakePhotoCaption,
34159
34302
  showTitle: false,
34160
34303
  action: function () {
34161
34304
  _this.snapPicture();
@@ -34191,7 +34334,7 @@ var QuestionFileModel = /** @class */ (function (_super) {
34191
34334
  iconName: "icon-takepicture_24x24",
34192
34335
  id: "sv-file-start-camera",
34193
34336
  iconSize: "auto",
34194
- title: new _base__WEBPACK_IMPORTED_MODULE_3__["ComputedUpdater"](function () { return _this.takePhotoCaption; }),
34337
+ locTitle: _this.locTakePhotoCaption,
34195
34338
  showTitle: new _base__WEBPACK_IMPORTED_MODULE_3__["ComputedUpdater"](function () { return !_this.isAnswered; }),
34196
34339
  enabledIf: function () { return !_this.isInputReadOnly; },
34197
34340
  action: function () {
@@ -34526,6 +34669,17 @@ var QuestionFileModel = /** @class */ (function (_super) {
34526
34669
  QuestionFileModel.prototype.getConfirmRemoveMessage = function (fileName) {
34527
34670
  return this.confirmRemoveMessage.format(fileName);
34528
34671
  };
34672
+ Object.defineProperty(QuestionFileModel.prototype, "takePhotoCaption", {
34673
+ get: function () { return this.getLocalizableStringText("takePhotoCaption"); },
34674
+ set: function (val) { this.setLocalizableStringText("takePhotoCaption", val); },
34675
+ enumerable: false,
34676
+ configurable: true
34677
+ });
34678
+ Object.defineProperty(QuestionFileModel.prototype, "locTakePhotoCaption", {
34679
+ get: function () { return this.getLocalizableString("takePhotoCaption"); },
34680
+ enumerable: false,
34681
+ configurable: true
34682
+ });
34529
34683
  Object.defineProperty(QuestionFileModel.prototype, "locRenderedPlaceholder", {
34530
34684
  get: function () {
34531
34685
  var _this = this;
@@ -35134,9 +35288,6 @@ var QuestionFileModel = /** @class */ (function (_super) {
35134
35288
  __decorate([
35135
35289
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])({ localizable: { defaultStr: "chooseFileCaption" } })
35136
35290
  ], QuestionFileModel.prototype, "chooseButtonCaption", void 0);
35137
- __decorate([
35138
- Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])({ localizable: { defaultStr: "takePhotoCaption" } })
35139
- ], QuestionFileModel.prototype, "takePhotoCaption", void 0);
35140
35291
  __decorate([
35141
35292
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])({ localizable: { defaultStr: "replaceFileCaption" } })
35142
35293
  ], QuestionFileModel.prototype, "replaceButtonCaption", void 0);
@@ -35350,7 +35501,16 @@ var QuestionHtmlModel = /** @class */ (function (_super) {
35350
35501
  return QuestionHtmlModel;
35351
35502
  }(_questionnonvalue__WEBPACK_IMPORTED_MODULE_0__["QuestionNonValue"]));
35352
35503
 
35353
- _jsonobject__WEBPACK_IMPORTED_MODULE_1__["Serializer"].addClass("html", [{ name: "html:html", serializationProperty: "locHtml" }], function () {
35504
+ _jsonobject__WEBPACK_IMPORTED_MODULE_1__["Serializer"].addClass("html", [
35505
+ { name: "html:html", serializationProperty: "locHtml" },
35506
+ { name: "hideNumber", visible: false },
35507
+ { name: "state", visible: false },
35508
+ { name: "titleLocation", visible: false },
35509
+ { name: "descriptionLocation", visible: false },
35510
+ { name: "errorLocation", visible: false },
35511
+ { name: "indent", visible: false },
35512
+ { name: "width", visible: false },
35513
+ ], function () {
35354
35514
  return new QuestionHtmlModel("");
35355
35515
  }, "nonvalue");
35356
35516
  _questionfactory__WEBPACK_IMPORTED_MODULE_2__["QuestionFactory"].Instance.registerQuestion("html", function (name) {
@@ -36110,9 +36270,12 @@ var QuestionImagePickerModel = /** @class */ (function (_super) {
36110
36270
  enumerable: false,
36111
36271
  configurable: true
36112
36272
  });
36113
- QuestionImagePickerModel.prototype.isFootChoice = function (_item, _question) {
36273
+ QuestionImagePickerModel.prototype.isBuiltInChoice = function (item, question) {
36114
36274
  return false;
36115
36275
  };
36276
+ QuestionImagePickerModel.prototype.addToVisibleChoices = function (items, isAddAll) {
36277
+ this.addNewItemToVisibleChoices(items, isAddAll);
36278
+ };
36116
36279
  QuestionImagePickerModel.prototype.getSelectBaseRootCss = function () {
36117
36280
  return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_5__["CssClassBuilder"]().append(_super.prototype.getSelectBaseRootCss.call(this)).append(this.cssClasses.rootColumn, this.getCurrentColCount() == 1).toString();
36118
36281
  };
@@ -37370,7 +37533,19 @@ var MatrixDropdownCell = /** @class */ (function () {
37370
37533
  this.data = data;
37371
37534
  this.questionValue = this.createQuestion(column, row, data);
37372
37535
  this.questionValue.updateCustomWidget();
37536
+ this.updateCellQuestionTitleDueToAccessebility(row);
37373
37537
  }
37538
+ MatrixDropdownCell.prototype.updateCellQuestionTitleDueToAccessebility = function (row) {
37539
+ var _this = this;
37540
+ this.questionValue.locTitle.onGetTextCallback = function (str) {
37541
+ if (!row || !row.getSurvey())
37542
+ return _this.questionValue.title;
37543
+ var rowTitle = row.getAccessbilityText();
37544
+ if (!rowTitle)
37545
+ return _this.questionValue.title;
37546
+ return _this.column.colOwner.getCellAriaLabel(rowTitle, _this.questionValue.title);
37547
+ };
37548
+ };
37374
37549
  MatrixDropdownCell.prototype.locStrsChanged = function () {
37375
37550
  this.question.locStrsChanged();
37376
37551
  };
@@ -37528,6 +37703,13 @@ var MatrixDropdownRowModelBase = /** @class */ (function () {
37528
37703
  enumerable: false,
37529
37704
  configurable: true
37530
37705
  });
37706
+ Object.defineProperty(MatrixDropdownRowModelBase.prototype, "dataName", {
37707
+ get: function () {
37708
+ return this.rowName;
37709
+ },
37710
+ enumerable: false,
37711
+ configurable: true
37712
+ });
37531
37713
  Object.defineProperty(MatrixDropdownRowModelBase.prototype, "text", {
37532
37714
  get: function () {
37533
37715
  return this.rowName;
@@ -37584,6 +37766,9 @@ var MatrixDropdownRowModelBase = /** @class */ (function () {
37584
37766
  enumerable: false,
37585
37767
  configurable: true
37586
37768
  });
37769
+ MatrixDropdownRowModelBase.prototype.getAccessbilityText = function () {
37770
+ return this.locText && this.locText.renderedHtml;
37771
+ };
37587
37772
  Object.defineProperty(MatrixDropdownRowModelBase.prototype, "hasPanel", {
37588
37773
  get: function () {
37589
37774
  if (!this.data)
@@ -39192,7 +39377,7 @@ var QuestionMatrixDropdownModelBase = /** @class */ (function (_super) {
39192
39377
  questionPlainData.isNode = true;
39193
39378
  questionPlainData.data = this.visibleRows.map(function (row) {
39194
39379
  var rowDataItem = {
39195
- name: row.rowName,
39380
+ name: row.dataName,
39196
39381
  title: row.text,
39197
39382
  value: row.value,
39198
39383
  displayValue: _this.getRowDisplayValue(false, row, row.value),
@@ -39266,6 +39451,8 @@ var QuestionMatrixDropdownModelBase = /** @class */ (function (_super) {
39266
39451
  this.collectNestedQuestonsInRows(this.visibleRows, questions, visibleOnly);
39267
39452
  };
39268
39453
  QuestionMatrixDropdownModelBase.prototype.collectNestedQuestonsInRows = function (rows, questions, visibleOnly) {
39454
+ if (!Array.isArray(rows))
39455
+ return;
39269
39456
  rows.forEach(function (row) {
39270
39457
  row.questions.forEach(function (q) { return q.collectNestedQuestions(questions, visibleOnly); });
39271
39458
  });
@@ -41004,12 +41191,6 @@ var QuestionMatrixDropdownRenderedCell = /** @class */ (function () {
41004
41191
  Object.defineProperty(QuestionMatrixDropdownRenderedCell.prototype, "headers", {
41005
41192
  get: function () {
41006
41193
  if (this.cell && this.cell.column) {
41007
- if (this.cell.column.cellHint === " ") {
41008
- return "";
41009
- }
41010
- if (!!this.cell.column.cellHint) {
41011
- return this.cell.column.locCellHint.renderedHtml;
41012
- }
41013
41194
  if (this.matrix.IsMultiplyColumn(this.cell.column)) {
41014
41195
  if (!!this.item) {
41015
41196
  return this.item.locText.renderedHtml;
@@ -41018,6 +41199,13 @@ var QuestionMatrixDropdownRenderedCell = /** @class */ (function () {
41018
41199
  return "";
41019
41200
  }
41020
41201
  }
41202
+ var cellHint = this.cell.column.cellHint;
41203
+ if (!!cellHint) {
41204
+ if (cellHint.trim() === "")
41205
+ return "";
41206
+ return this.cell.column.locCellHint.renderedHtml;
41207
+ }
41208
+ return this.cell.column.title;
41021
41209
  }
41022
41210
  if (this.hasQuestion && this.question.isVisible) {
41023
41211
  return this.question.locTitle.renderedHtml;
@@ -42075,6 +42263,23 @@ var MatrixDynamicRowModel = /** @class */ (function (_super) {
42075
42263
  enumerable: false,
42076
42264
  configurable: true
42077
42265
  });
42266
+ Object.defineProperty(MatrixDynamicRowModel.prototype, "dataName", {
42267
+ get: function () {
42268
+ return "row" + (this.index + 1);
42269
+ },
42270
+ enumerable: false,
42271
+ configurable: true
42272
+ });
42273
+ Object.defineProperty(MatrixDynamicRowModel.prototype, "text", {
42274
+ get: function () {
42275
+ return "row " + (this.index + 1);
42276
+ },
42277
+ enumerable: false,
42278
+ configurable: true
42279
+ });
42280
+ MatrixDynamicRowModel.prototype.getAccessbilityText = function () {
42281
+ return (this.index + 1).toString();
42282
+ };
42078
42283
  Object.defineProperty(MatrixDynamicRowModel.prototype, "shortcutText", {
42079
42284
  get: function () {
42080
42285
  var matrix = this.data;
@@ -42937,7 +43142,7 @@ var QuestionMatrixDynamicModel = /** @class */ (function (_super) {
42937
43142
  var lastDelRow = this.lastDeletedRow;
42938
43143
  this.lastDeletedRow = undefined;
42939
43144
  var rows = this.generatedVisibleRows;
42940
- if (!Array.isArray(val) || Math.abs(rows.length - val.length) > 1)
43145
+ if (!Array.isArray(val) || Math.abs(rows.length - val.length) > 1 || rows.length === val.length)
42941
43146
  return false;
42942
43147
  var index = this.getInsertedDeletedIndex(rows, val);
42943
43148
  if (rows.length > val.length) {
@@ -48612,10 +48817,10 @@ var QuestionRatingModel = /** @class */ (function (_super) {
48612
48817
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])({ defaultValue: false })
48613
48818
  ], QuestionRatingModel.prototype, "inputHasValue", void 0);
48614
48819
  __decorate([
48615
- Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])({ defaultValue: true })
48820
+ Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])()
48616
48821
  ], QuestionRatingModel.prototype, "autoGenerate", void 0);
48617
48822
  __decorate([
48618
- Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])({ defaultValue: 5 })
48823
+ Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])()
48619
48824
  ], QuestionRatingModel.prototype, "rateCount", void 0);
48620
48825
  __decorate([
48621
48826
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["propertyArray"])()
@@ -48627,11 +48832,10 @@ var QuestionRatingModel = /** @class */ (function (_super) {
48627
48832
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])({ defaultValue: false })
48628
48833
  ], QuestionRatingModel.prototype, "hasMaxRateDescription", void 0);
48629
48834
  __decorate([
48630
- Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])({ defaultValue: false })
48835
+ Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])()
48631
48836
  ], QuestionRatingModel.prototype, "displayRateDescriptionsAsExtremeItems", void 0);
48632
48837
  __decorate([
48633
48838
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])({
48634
- defaultValue: "auto",
48635
48839
  onSet: function (val, target) {
48636
48840
  if (!target.isDesignMode) {
48637
48841
  if (val === "dropdown") {
@@ -48645,13 +48849,13 @@ var QuestionRatingModel = /** @class */ (function (_super) {
48645
48849
  })
48646
48850
  ], QuestionRatingModel.prototype, "displayMode", void 0);
48647
48851
  __decorate([
48648
- Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])({ defaultValue: "labels" })
48852
+ Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])()
48649
48853
  ], QuestionRatingModel.prototype, "rateType", void 0);
48650
48854
  __decorate([
48651
- Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])({ defaultValue: "monochrome" })
48855
+ Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])()
48652
48856
  ], QuestionRatingModel.prototype, "scaleColorMode", void 0);
48653
48857
  __decorate([
48654
- Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])({ defaultValue: "scale" })
48858
+ Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])()
48655
48859
  ], QuestionRatingModel.prototype, "rateColorMode", void 0);
48656
48860
  return QuestionRatingModel;
48657
48861
  }(_question__WEBPACK_IMPORTED_MODULE_1__["Question"]));
@@ -49170,13 +49374,13 @@ var QuestionSignaturePadModel = /** @class */ (function (_super) {
49170
49374
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])({ defaultValue: false })
49171
49375
  ], QuestionSignaturePadModel.prototype, "isDrawingValue", void 0);
49172
49376
  __decorate([
49173
- Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])({ defaultValue: false })
49377
+ Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])()
49174
49378
  ], QuestionSignaturePadModel.prototype, "signatureAutoScaleEnabled", void 0);
49175
49379
  __decorate([
49176
- Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])({ defaultValue: 0.5 })
49380
+ Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])()
49177
49381
  ], QuestionSignaturePadModel.prototype, "penMinWidth", void 0);
49178
49382
  __decorate([
49179
- Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])({ defaultValue: 2.5 })
49383
+ Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])()
49180
49384
  ], QuestionSignaturePadModel.prototype, "penMaxWidth", void 0);
49181
49385
  __decorate([
49182
49386
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])({})
@@ -49527,7 +49731,6 @@ var QuestionTagboxModel = /** @class */ (function (_super) {
49527
49731
  ], QuestionTagboxModel.prototype, "allowClear", void 0);
49528
49732
  __decorate([
49529
49733
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])({
49530
- defaultValue: true,
49531
49734
  onSet: function (newValue, target) {
49532
49735
  if (!!target.dropdownListModel) {
49533
49736
  target.dropdownListModel.setSearchEnabled(newValue);
@@ -49548,7 +49751,7 @@ var QuestionTagboxModel = /** @class */ (function (_super) {
49548
49751
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])()
49549
49752
  ], QuestionTagboxModel.prototype, "choicesLazyLoadEnabled", void 0);
49550
49753
  __decorate([
49551
- Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])({ defaultValue: 25 })
49754
+ Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])()
49552
49755
  ], QuestionTagboxModel.prototype, "choicesLazyLoadPageSize", void 0);
49553
49756
  __decorate([
49554
49757
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])({ getDefaultValue: function () { return _settings__WEBPACK_IMPORTED_MODULE_5__["settings"].tagboxCloseOnSelect; } })
@@ -49653,7 +49856,7 @@ var QuestionTextModel = /** @class */ (function (_super) {
49653
49856
  _this.updateRemainingCharacterCounter(event.target.value);
49654
49857
  };
49655
49858
  _this.onKeyDown = function (event) {
49656
- _this.checkForUndo(event);
49859
+ _this.onKeyDownPreprocess && _this.onKeyDownPreprocess(event);
49657
49860
  if (_this.isInputTextUpdate) {
49658
49861
  _this._isWaitingForEnter = event.keyCode === 229;
49659
49862
  }
@@ -50414,7 +50617,6 @@ var QuestionTextBase = /** @class */ (function (_super) {
50414
50617
  function QuestionTextBase(name) {
50415
50618
  var _this = _super.call(this, name) || this;
50416
50619
  _this.characterCounter = new CharacterCounter();
50417
- _this.disableNativeUndoRedo = false;
50418
50620
  return _this;
50419
50621
  }
50420
50622
  QuestionTextBase.prototype.isTextValue = function () {
@@ -50540,13 +50742,6 @@ var QuestionTextBase = /** @class */ (function (_super) {
50540
50742
  return val;
50541
50743
  };
50542
50744
  QuestionTextBase.prototype.getValueSeparator = function () { return ", "; };
50543
- QuestionTextBase.prototype.checkForUndo = function (event) {
50544
- if (this.disableNativeUndoRedo && this.isInputTextUpdate && (event.ctrlKey || event.metaKey)) {
50545
- if ([89, 90].indexOf(event.keyCode) !== -1) {
50546
- event.preventDefault();
50547
- }
50548
- }
50549
- };
50550
50745
  QuestionTextBase.prototype.getControlCssClassBuilder = function () {
50551
50746
  return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_3__["CssClassBuilder"]()
50552
50747
  .append(this.cssClasses.root)
@@ -50590,6 +50785,8 @@ __webpack_require__.r(__webpack_exports__);
50590
50785
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ElementFactory", function() { return ElementFactory; });
50591
50786
  /* harmony import */ var _surveyStrings__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./surveyStrings */ "./src/surveyStrings.ts");
50592
50787
  /* harmony import */ var _jsonobject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./jsonobject */ "./src/jsonobject.ts");
50788
+ /* harmony import */ var _question_custom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./question_custom */ "./src/question_custom.ts");
50789
+
50593
50790
 
50594
50791
 
50595
50792
  var QuestionFactory = /** @class */ (function () {
@@ -50691,6 +50888,9 @@ var ElementFactory = /** @class */ (function () {
50691
50888
  var creator = this.creatorHash[elementType];
50692
50889
  if (!!creator)
50693
50890
  return creator(name);
50891
+ var compJSON = _question_custom__WEBPACK_IMPORTED_MODULE_2__["ComponentCollection"].Instance.getCustomQuestionByName(elementType);
50892
+ if (!!compJSON)
50893
+ return _question_custom__WEBPACK_IMPORTED_MODULE_2__["ComponentCollection"].Instance.createQuestion(name, compJSON);
50694
50894
  return null;
50695
50895
  };
50696
50896
  ElementFactory.Instance = new ElementFactory();
@@ -51433,6 +51633,32 @@ var settings = {
51433
51633
  * Default value: `"none"`
51434
51634
  */
51435
51635
  noneItemValue: "none",
51636
+ /**
51637
+ * An object whose properties specify the order of the special choice items (None, Other, Select All) in select-based questions.
51638
+ *
51639
+ * Default value: `{ selectAllItem: [-1], noneItem: [1], otherItem: [2] }`
51640
+ *
51641
+ * Use this object to reorder special choices. Each property accepts an array of integer numbers. Negative numbers place a special choice item above regular choice items, positive numbers place it below them. For instance, the code below specifies the following order of choices: None, Select All, regular choices, Other.
51642
+ *
51643
+ * ```js
51644
+ * import { settings } from "survey-core";
51645
+ *
51646
+ * settings.specialChoicesOrder.noneItem = [-2];
51647
+ * settings.specialChoicesOrder.selectAllItem = [-1];
51648
+ * settings.specialChoicesOrder.otherItem = [1];
51649
+ * ```
51650
+ *
51651
+ * If you want to duplicate a special choice item above and below other choices, add two numbers to the corresponding array:
51652
+ *
51653
+ * ```js
51654
+ * settings.specialChoicesOrder.selectAllItem = [-1, 3] // Displays Select All above and below other choices
51655
+ * ```
51656
+ */
51657
+ specialChoicesOrder: {
51658
+ selectAllItem: [-1],
51659
+ noneItem: [1],
51660
+ otherItem: [2]
51661
+ },
51436
51662
  /**
51437
51663
  * A list of supported validators by question type.
51438
51664
  */
@@ -52355,9 +52581,7 @@ var SurveyElement = /** @class */ (function (_super) {
52355
52581
  * @see isExpanded
52356
52582
  */
52357
52583
  get: function () {
52358
- if (this.isDesignMode)
52359
- return;
52360
- return this.state === "collapsed";
52584
+ return this.state === "collapsed" && !this.isDesignMode;
52361
52585
  },
52362
52586
  enumerable: false,
52363
52587
  configurable: true
@@ -57090,13 +57314,23 @@ var SurveyModel = /** @class */ (function (_super) {
57090
57314
  }
57091
57315
  this.setPropertyValue("completedStateText", text);
57092
57316
  if (this.state === "completed" && this.showCompletedPage && !!this.completedState) {
57093
- this.notify(this.completedStateText, this.completedState, true);
57317
+ this.notify(this.completedStateText, this.completedState, value === "error");
57094
57318
  }
57095
57319
  };
57320
+ /**
57321
+ * Displays a toast notification with a specified message.
57322
+ *
57323
+ * Depending on the `type` argument, a survey can display the following notification types:
57324
+ *
57325
+ * ![Toast notification types in SurveyJS Form Library](https://surveyjs.io//Content/Images/docs/notification-types.png)
57326
+ * @param message A message to display.
57327
+ * @param type A notification type: `"info"` (default), `"success"`, or `"error"`.
57328
+ * @param showActions For internal use.
57329
+ */
57096
57330
  SurveyModel.prototype.notify = function (message, type, showActions) {
57097
57331
  if (showActions === void 0) { showActions = false; }
57098
57332
  this.notifier.showActions = showActions;
57099
- this.notifier.notify(message, type, type === "error");
57333
+ this.notifier.notify(message, type, showActions);
57100
57334
  };
57101
57335
  /**
57102
57336
  * Resets the survey [`state`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#state) and, optionally, [`data`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#data). If `state` is `"completed"`, it becomes `"running"`.
@@ -57886,7 +58120,7 @@ var SurveyModel = /** @class */ (function (_super) {
57886
58120
  }
57887
58121
  else {
57888
58122
  if (this.runningPages) {
57889
- this.restoreOrigionalPages(this.runningPages);
58123
+ this.restoreOriginalPages(this.runningPages);
57890
58124
  }
57891
58125
  this.runningPages = undefined;
57892
58126
  }
@@ -57913,25 +58147,27 @@ var SurveyModel = /** @class */ (function (_super) {
57913
58147
  if (this.isShowingPreview)
57914
58148
  return;
57915
58149
  if (this.questionsOnPageMode == "standard" || this.isDesignMode) {
57916
- if (this.origionalPages) {
57917
- this.restoreOrigionalPages(this.origionalPages);
58150
+ if (this.originalPages) {
58151
+ this.restoreOriginalPages(this.originalPages);
57918
58152
  }
57919
- this.origionalPages = undefined;
58153
+ this.originalPages = undefined;
57920
58154
  }
57921
58155
  else {
57922
58156
  if (!oldValue || oldValue == "standard") {
57923
- this.origionalPages = this.pages.slice(0, this.pages.length);
58157
+ this.originalPages = this.pages.slice(0, this.pages.length);
57924
58158
  }
57925
58159
  this.setupPagesForPageModes(this.isSinglePage);
57926
58160
  }
57927
58161
  this.runConditions();
57928
58162
  this.updateVisibleIndexes();
57929
58163
  };
57930
- SurveyModel.prototype.restoreOrigionalPages = function (originalPages) {
58164
+ SurveyModel.prototype.restoreOriginalPages = function (originalPages) {
57931
58165
  this.questionHashesClear();
57932
58166
  this.pages.splice(0, this.pages.length);
57933
58167
  for (var i = 0; i < originalPages.length; i++) {
57934
- this.pages.push(originalPages[i]);
58168
+ var page = originalPages[i];
58169
+ page.setWasShown(false);
58170
+ this.pages.push(page);
57935
58171
  }
57936
58172
  };
57937
58173
  SurveyModel.prototype.getPageStartIndex = function () {
@@ -61475,7 +61711,7 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_1__["Serializer"].addClass("survey", [
61475
61711
  className: "htmlconditionitem", isArray: true
61476
61712
  },
61477
61713
  { name: "loadingHtml:html", serializationProperty: "locLoadingHtml" },
61478
- { name: "pages:surveypages", className: "page", isArray: true },
61714
+ { name: "pages:surveypages", className: "page", isArray: true, onSerializeValue: function (obj) { return obj.originalPages || obj.pages; } },
61479
61715
  {
61480
61716
  name: "elements",
61481
61717
  alternativeName: "questions",
@@ -63918,19 +64154,36 @@ var ResponsivityManager = /** @class */ (function () {
63918
64154
  configurable: true
63919
64155
  });
63920
64156
  ResponsivityManager.prototype.process = function () {
63921
- var _a;
64157
+ var _this = this;
63922
64158
  if (this.isContainerVisible && !this.model.isResponsivenessDisabled) {
63923
64159
  if (!this.isInitialized) {
63924
64160
  this.model.setActionsMode("large");
63925
- this.calcItemsSizes();
63926
- this.isInitialized = true;
64161
+ var recalcItemSizes = function () {
64162
+ _this.calcItemsSizes();
64163
+ _this.isInitialized = true;
64164
+ };
64165
+ if (queueMicrotask) {
64166
+ queueMicrotask(recalcItemSizes);
64167
+ }
64168
+ else {
64169
+ recalcItemSizes();
64170
+ }
63927
64171
  }
63928
- var dotsItemSize = this.dotsItemSize;
63929
- if (!this.dotsItemSize) {
63930
- var dotsItemElement = (_a = this.container) === null || _a === void 0 ? void 0 : _a.querySelector(".sv-dots");
63931
- dotsItemSize = dotsItemElement && this.calcItemSize(dotsItemElement) || this.dotsSizeConst;
64172
+ var processResponsiveness = function () {
64173
+ var _a;
64174
+ var dotsItemSize = _this.dotsItemSize;
64175
+ if (!_this.dotsItemSize) {
64176
+ var dotsItemElement = (_a = _this.container) === null || _a === void 0 ? void 0 : _a.querySelector(".sv-dots");
64177
+ dotsItemSize = dotsItemElement && _this.calcItemSize(dotsItemElement) || _this.dotsSizeConst;
64178
+ }
64179
+ _this.model.fit(_this.getAvailableSpace(), dotsItemSize);
64180
+ };
64181
+ if (queueMicrotask) {
64182
+ queueMicrotask(processResponsiveness);
64183
+ }
64184
+ else {
64185
+ processResponsiveness();
63932
64186
  }
63933
- this.model.fit(this.getAvailableSpace(), dotsItemSize);
63934
64187
  }
63935
64188
  };
63936
64189
  ResponsivityManager.prototype.dispose = function () {
@@ -64352,6 +64605,9 @@ function findParentByClassNames(element, classNames) {
64352
64605
  function sanitizeEditableContent(element) {
64353
64606
  if (window.getSelection && document.createRange && element.childNodes.length > 0) {
64354
64607
  var selection = document.getSelection();
64608
+ if (selection.rangeCount == 0) {
64609
+ return;
64610
+ }
64355
64611
  var range = selection.getRangeAt(0);
64356
64612
  range.setStart(range.endContainer, range.endOffset);
64357
64613
  range.setEndAfter(element.lastChild);