survey-react 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.
package/survey.react.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);
@@ -9370,8 +9398,8 @@ __webpack_require__.r(__webpack_exports__);
9370
9398
  //import "../../modern.scss";
9371
9399
  var Version;
9372
9400
  var ReleaseDate;
9373
- Version = "" + "1.9.116";
9374
- ReleaseDate = "" + "2023-11-07";
9401
+ Version = "" + "1.9.118";
9402
+ ReleaseDate = "" + "2023-11-21";
9375
9403
  function checkLibraryVersion(ver, libraryName) {
9376
9404
  if (Version != ver) {
9377
9405
  var str = "survey-core has version '" + Version + "' and " + libraryName
@@ -9415,6 +9443,8 @@ function _slk(k, lh, rd) {
9415
9443
  var index = v.indexOf(";");
9416
9444
  if (index < 0)
9417
9445
  return;
9446
+ if (!checkPrefix(v.substring(0, index)))
9447
+ return;
9418
9448
  v = v.substring(index + 1);
9419
9449
  v.split(",").forEach(function (s) {
9420
9450
  var i = s.indexOf("=");
@@ -9423,6 +9453,27 @@ function _slk(k, lh, rd) {
9423
9453
  }
9424
9454
  });
9425
9455
  }
9456
+ function checkPrefix(prefix) {
9457
+ if (!prefix)
9458
+ return true;
9459
+ var s = "domains:";
9460
+ var index = prefix.indexOf(s);
9461
+ if (index < 0)
9462
+ return true;
9463
+ var ds = prefix.substring(index + s.length).toLowerCase().split(",");
9464
+ if (!Array.isArray(ds) || ds.length === 0)
9465
+ return true;
9466
+ if (typeof window !== "undefined" && !!window.location && !!window.location.hostname) {
9467
+ var hn = window.location.hostname.toLowerCase();
9468
+ ds.push("localhost");
9469
+ for (var i = 0; i < ds.length; i++) {
9470
+ if (hn.indexOf(ds[i]) > -1)
9471
+ return true;
9472
+ }
9473
+ return false;
9474
+ }
9475
+ return true;
9476
+ }
9426
9477
 
9427
9478
 
9428
9479
 
@@ -15631,8 +15682,8 @@ var OperandMaker = /** @class */ (function () {
15631
15682
  right = OperandMaker.convertValForDateCompare(right, left);
15632
15683
  return OperandMaker.isTwoValueEquals(left, right, strictCompare !== true);
15633
15684
  },
15634
- notequal: function (left, right) {
15635
- return !OperandMaker.binaryFunctions.equal(left, right);
15685
+ notequal: function (left, right, strictCompare) {
15686
+ return !OperandMaker.binaryFunctions.equal(left, right, strictCompare);
15636
15687
  },
15637
15688
  contains: function (left, right) {
15638
15689
  return OperandMaker.binaryFunctions.containsCore(left, right, true);
@@ -18514,6 +18565,10 @@ function property(options) {
18514
18565
  if (!options || !options.localizable) {
18515
18566
  Object.defineProperty(target, key, {
18516
18567
  get: function () {
18568
+ // const serializationProperty = Serializer.getProperty(target.getType(), key);
18569
+ // if(!!serializationProperty && options.defaultValue !== undefined) {
18570
+ // ConsoleWarnings.error("remove defaultValue from @property for class " + target.getType() + " property name is " + key);
18571
+ // }
18517
18572
  var defaultVal = null;
18518
18573
  if (!!options) {
18519
18574
  if (typeof options.getDefaultValue === "function") {
@@ -18720,6 +18775,11 @@ var JsonObjectProperty = /** @class */ (function () {
18720
18775
  return ((value === false && (this.type == "boolean" || this.type == "switch")) ||
18721
18776
  value === "" || _helpers__WEBPACK_IMPORTED_MODULE_2__["Helpers"].isValueEmpty(value));
18722
18777
  };
18778
+ JsonObjectProperty.prototype.getSerializableValue = function (obj) {
18779
+ if (!!this.onSerializeValue)
18780
+ return this.onSerializeValue(obj);
18781
+ return this.getValue(obj);
18782
+ };
18723
18783
  JsonObjectProperty.prototype.getValue = function (obj) {
18724
18784
  if (this.onGetValue)
18725
18785
  return this.onGetValue(obj);
@@ -19311,6 +19371,9 @@ var JsonMetadataClass = /** @class */ (function () {
19311
19371
  if (!!propInfo.baseValue) {
19312
19372
  prop.setBaseValue(propInfo.baseValue);
19313
19373
  }
19374
+ if (propInfo.onSerializeValue) {
19375
+ prop.onSerializeValue = propInfo.onSerializeValue;
19376
+ }
19314
19377
  if (propInfo.onGetValue) {
19315
19378
  prop.onGetValue = propInfo.onGetValue;
19316
19379
  }
@@ -20105,7 +20168,7 @@ var JsonObject = /** @class */ (function () {
20105
20168
  if (property.isSerializable === false ||
20106
20169
  (property.isLightSerializable === false && this.lightSerializing))
20107
20170
  return;
20108
- var value = property.getValue(obj);
20171
+ var value = property.getSerializableValue(obj);
20109
20172
  if (!storeDefaults && property.isDefaultValueByObj(obj, value))
20110
20173
  return;
20111
20174
  if (this.isValueArray(value)) {
@@ -20921,9 +20984,6 @@ var LocalizableString = /** @class */ (function () {
20921
20984
  };
20922
20985
  LocalizableString.prototype.isLocaleTextEqualsWithDefault = function (loc, val) {
20923
20986
  var res = this.getLocaleTextCore(loc);
20924
- if (!res && this.onGetDefaultTextCallback) {
20925
- res = this.onGetDefaultTextCallback();
20926
- }
20927
20987
  if (res === val)
20928
20988
  return true;
20929
20989
  return this.isValueEmpty(res) && this.isValueEmpty(val);
@@ -22488,8 +22548,8 @@ var englishStrings = {
22488
22548
  textMaxLength: "Please enter no more than {0} character(s).",
22489
22549
  textMinMaxLength: "Please enter at least {0} and no more than {1} characters.",
22490
22550
  minRowCountError: "Please fill in at least {0} row(s).",
22491
- minSelectError: "Please select at least {0} variant(s).",
22492
- maxSelectError: "Please select no more than {0} variant(s).",
22551
+ minSelectError: "Please select at least {0} option(s).",
22552
+ maxSelectError: "Please select no more than {0} option(s).",
22493
22553
  numericMinMax: "The '{0}' should be at least {1} and at most {2}",
22494
22554
  numericMin: "The '{0}' should be at least {1}",
22495
22555
  numericMax: "The '{0}' should be at most {1}",
@@ -28386,8 +28446,21 @@ var QuestionMatrixBaseModel = /** @class */ (function (_super) {
28386
28446
  enumerable: false,
28387
28447
  configurable: true
28388
28448
  });
28449
+ //a11y
28450
+ QuestionMatrixBaseModel.prototype.getCellAriaLabel = function (rowTitle, columnTitle) {
28451
+ var row = (this.getLocalizationString("matrix_row") || "row").toLocaleLowerCase();
28452
+ var column = (this.getLocalizationString("matrix_column") || "column").toLocaleLowerCase();
28453
+ return row + " " + rowTitle + ", " + column + " " + columnTitle;
28454
+ };
28455
+ Object.defineProperty(QuestionMatrixBaseModel.prototype, "isNewA11yStructure", {
28456
+ get: function () {
28457
+ return true;
28458
+ },
28459
+ enumerable: false,
28460
+ configurable: true
28461
+ });
28389
28462
  __decorate([
28390
- Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])({ defaultValue: "middle" })
28463
+ Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])()
28391
28464
  ], QuestionMatrixBaseModel.prototype, "verticalAlign", void 0);
28392
28465
  __decorate([
28393
28466
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])()
@@ -28565,6 +28638,7 @@ var Notifier = /** @class */ (function (_super) {
28565
28638
  Notifier.prototype.getCssClass = function (type) {
28566
28639
  return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_3__["CssClassBuilder"]()
28567
28640
  .append(this.cssClasses.root)
28641
+ .append(this.cssClasses.rootWithButtons, this.actionBar.visibleActions.length > 0)
28568
28642
  .append(this.cssClasses.info, type !== "error" && type !== "success")
28569
28643
  .append(this.cssClasses.error, type === "error")
28570
28644
  .append(this.cssClasses.success, type === "success")
@@ -33694,7 +33768,9 @@ var PopupBaseViewModel = /** @class */ (function (_super) {
33694
33768
  }
33695
33769
  currentElement = currentElement.parentElement;
33696
33770
  }
33697
- event.preventDefault();
33771
+ if (event.cancelable) {
33772
+ event.preventDefault();
33773
+ }
33698
33774
  };
33699
33775
  PopupBaseViewModel.SubscriptionId = 0;
33700
33776
  __decorate([
@@ -34014,10 +34090,6 @@ var Question = /** @class */ (function (_super) {
34014
34090
  _this.addExpressionProperty("enableIf", function (obj, res) { _this.readOnly = res === false; });
34015
34091
  _this.addExpressionProperty("requiredIf", function (obj, res) { _this.isRequired = res === true; });
34016
34092
  _this.createLocalizableString("commentText", _this, true, "otherItemText");
34017
- _this.locTitle.onGetDefaultTextCallback = function () {
34018
- return _this.name;
34019
- };
34020
- _this.locTitle.storeDefaultText = true;
34021
34093
  _this.createLocalizableString("requiredErrorText", _this);
34022
34094
  _this.addTriggerInfo("resetValueIf", function () { return !_this.isEmpty(); }, function () {
34023
34095
  _this.clearValue();
@@ -34066,12 +34138,14 @@ var Question = /** @class */ (function (_super) {
34066
34138
  this.isMobile = val && (this.allowMobileInDesignMode() || !this.isDesignMode);
34067
34139
  };
34068
34140
  Question.prototype.themeChanged = function (theme) { };
34141
+ Question.prototype.getDefaultTitle = function () { return this.name; };
34069
34142
  Question.prototype.createLocTitleProperty = function () {
34070
34143
  var _this = this;
34071
34144
  var locTitleValue = _super.prototype.createLocTitleProperty.call(this);
34145
+ locTitleValue.storeDefaultText = true;
34072
34146
  locTitleValue.onGetTextCallback = function (text) {
34073
34147
  if (!text) {
34074
- text = _this.name;
34148
+ text = _this.getDefaultTitle();
34075
34149
  }
34076
34150
  if (!_this.survey)
34077
34151
  return text;
@@ -35478,6 +35552,7 @@ var Question = /** @class */ (function (_super) {
35478
35552
  * @see otherItem
35479
35553
  * @see otherErrorText
35480
35554
  * @see showCommentArea
35555
+ * @see [settings.specialChoicesOrder](https://surveyjs.io/form-library/documentation/api-reference/settings#specialChoicesOrder)
35481
35556
  */
35482
35557
  get: function () {
35483
35558
  return this.getPropertyValue("showOtherItem", false);
@@ -35547,6 +35622,9 @@ var Question = /** @class */ (function (_super) {
35547
35622
  Question.prototype.onReadOnlyChanged = function () {
35548
35623
  this.setPropertyValue("isInputReadOnly", this.isInputReadOnly);
35549
35624
  _super.prototype.onReadOnlyChanged.call(this);
35625
+ if (this.isReadOnly) {
35626
+ this.clearErrors();
35627
+ }
35550
35628
  this.updateQuestionCss();
35551
35629
  this.calcRenderedCommentPlaceholder();
35552
35630
  };
@@ -37463,6 +37541,8 @@ var QuestionSelectBase = /** @class */ (function (_super) {
37463
37541
  _this.isRunningChoices = false;
37464
37542
  _this.isFirstLoadChoicesFromUrl = true;
37465
37543
  _this.isUpdatingChoicesDependedQuestions = false;
37544
+ _this.headItemsCount = 0;
37545
+ _this.footItemsCount = 0;
37466
37546
  _this.prevIsOtherSelected = false;
37467
37547
  var noneItemText = _this.createLocalizableString("noneText", _this.noneItemValue, true, "noneItemText");
37468
37548
  _this.noneItemValue.locOwner = _this;
@@ -37643,6 +37723,7 @@ var QuestionSelectBase = /** @class */ (function (_super) {
37643
37723
  * When users select the "None" item in multi-select questions, all other items become unselected.
37644
37724
  * @see noneItem
37645
37725
  * @see noneText
37726
+ * @see [settings.specialChoicesOrder](https://surveyjs.io/form-library/documentation/api-reference/settings#specialChoicesOrder)
37646
37727
  */
37647
37728
  get: function () {
37648
37729
  return this.getPropertyValue("showNoneItem");
@@ -38124,6 +38205,7 @@ var QuestionSelectBase = /** @class */ (function (_super) {
38124
38205
  *
38125
38206
  * [View Demo](https://surveyjs.io/form-library/examples/questiontype-dropdownrestfull/ (linkStyle))
38126
38207
  * @see choices
38208
+ * @see [settings.specialChoicesOrder](https://surveyjs.io/form-library/documentation/api-reference/settings#specialChoicesOrder)
38127
38209
  */
38128
38210
  get: function () {
38129
38211
  return this.getPropertyValue("choicesByUrl");
@@ -38157,6 +38239,7 @@ var QuestionSelectBase = /** @class */ (function (_super) {
38157
38239
  * 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.
38158
38240
  * @see choicesByUrl
38159
38241
  * @see choicesFromQuestion
38242
+ * @see [settings.specialChoicesOrder](https://surveyjs.io/form-library/documentation/api-reference/settings#specialChoicesOrder)
38160
38243
  */
38161
38244
  get: function () {
38162
38245
  return this.getPropertyValue("choices");
@@ -38299,6 +38382,7 @@ var QuestionSelectBase = /** @class */ (function (_super) {
38299
38382
  * - `"asc"`- Sorts choice items in ascending order.
38300
38383
  * - `"desc"`- Sorts choice items in ascending order.
38301
38384
  * - `"random"` - Displays choice items in random order.
38385
+ * @see [settings.specialChoicesOrder](https://surveyjs.io/form-library/documentation/api-reference/settings#specialChoicesOrder)
38302
38386
  */
38303
38387
  get: function () {
38304
38388
  return this.getPropertyValue("choicesOrder");
@@ -38442,22 +38526,51 @@ var QuestionSelectBase = /** @class */ (function (_super) {
38442
38526
  configurable: true
38443
38527
  });
38444
38528
  QuestionSelectBase.prototype.addToVisibleChoices = function (items, isAddAll) {
38445
- if (isAddAll) {
38446
- if (!this.newItemValue) {
38447
- this.newItemValue = this.createItemValue("newitem"); //TODO
38448
- this.newItemValue.isGhost = true;
38529
+ this.headItemsCount = 0;
38530
+ this.footItemsCount = 0;
38531
+ this.addNewItemToVisibleChoices(items, isAddAll);
38532
+ var dict = new Array();
38533
+ this.addNonChoicesItems(dict, isAddAll);
38534
+ dict.sort(function (a, b) {
38535
+ if (a.index === b.index)
38536
+ return 0;
38537
+ return a.index < b.index ? -1 : 1;
38538
+ });
38539
+ for (var i = 0; i < dict.length; i++) {
38540
+ var rec = dict[i];
38541
+ if (rec.index < 0) {
38542
+ items.splice(i, 0, rec.item);
38543
+ this.headItemsCount++;
38449
38544
  }
38450
- if (!this.isUsingCarryForward && this.canShowOptionItem(this.newItemValue, isAddAll, false)) {
38451
- items.push(this.newItemValue);
38545
+ else {
38546
+ items.push(rec.item);
38547
+ this.footItemsCount++;
38452
38548
  }
38453
38549
  }
38550
+ };
38551
+ QuestionSelectBase.prototype.addNewItemToVisibleChoices = function (items, isAddAll) {
38552
+ if (!isAddAll)
38553
+ return;
38554
+ if (!this.newItemValue) {
38555
+ this.newItemValue = this.createItemValue("newitem"); //TODO
38556
+ this.newItemValue.isGhost = true;
38557
+ }
38558
+ if (!this.isUsingCarryForward && this.canShowOptionItem(this.newItemValue, isAddAll, false)) {
38559
+ this.footItemsCount = 1;
38560
+ items.push(this.newItemValue);
38561
+ }
38562
+ };
38563
+ QuestionSelectBase.prototype.addNonChoicesItems = function (dict, isAddAll) {
38454
38564
  if (this.supportNone() && this.canShowOptionItem(this.noneItem, isAddAll, this.hasNone)) {
38455
- items.push(this.noneItem);
38565
+ this.addNonChoiceItem(dict, this.noneItem, _settings__WEBPACK_IMPORTED_MODULE_9__["settings"].specialChoicesOrder.noneItem);
38456
38566
  }
38457
38567
  if (this.supportOther() && this.canShowOptionItem(this.otherItem, isAddAll, this.hasOther)) {
38458
- items.push(this.otherItem);
38568
+ this.addNonChoiceItem(dict, this.otherItem, _settings__WEBPACK_IMPORTED_MODULE_9__["settings"].specialChoicesOrder.otherItem);
38459
38569
  }
38460
38570
  };
38571
+ QuestionSelectBase.prototype.addNonChoiceItem = function (dict, item, order) {
38572
+ order.forEach(function (val) { return dict.push({ index: val, item: item }); });
38573
+ };
38461
38574
  QuestionSelectBase.prototype.canShowOptionItem = function (item, isAddAll, hasItem) {
38462
38575
  var res = (isAddAll && (!!this.canShowOptionItemCallback ? this.canShowOptionItemCallback(item) : true)) || hasItem;
38463
38576
  if (this.canSurveyChangeItemVisibility()) {
@@ -38689,17 +38802,11 @@ var QuestionSelectBase = /** @class */ (function (_super) {
38689
38802
  enumerable: false,
38690
38803
  configurable: true
38691
38804
  });
38692
- QuestionSelectBase.prototype.isHeadChoice = function (item, question) {
38693
- return false;
38694
- };
38695
- QuestionSelectBase.prototype.isFootChoice = function (item, question) {
38805
+ QuestionSelectBase.prototype.isBuiltInChoice = function (item, question) {
38696
38806
  return (item === question.noneItem ||
38697
38807
  item === question.otherItem ||
38698
38808
  item === question.newItemValue);
38699
38809
  };
38700
- QuestionSelectBase.prototype.isBuiltInChoice = function (item, question) {
38701
- return this.isHeadChoice(item, question) || this.isFootChoice(item, question);
38702
- };
38703
38810
  QuestionSelectBase.prototype.getChoices = function () {
38704
38811
  return this.choices;
38705
38812
  };
@@ -39111,18 +39218,23 @@ var QuestionSelectBase = /** @class */ (function (_super) {
39111
39218
  };
39112
39219
  Object.defineProperty(QuestionSelectBase.prototype, "headItems", {
39113
39220
  get: function () {
39114
- var _this = this;
39115
- return (this.separateSpecialChoices || this.isDesignMode) ?
39116
- this.visibleChoices.filter(function (choice) { return _this.isHeadChoice(choice, _this); }) : [];
39221
+ var count = (this.separateSpecialChoices || this.isDesignMode) ? this.headItemsCount : 0;
39222
+ var res = [];
39223
+ for (var i = 0; i < count; i++)
39224
+ res.push(this.visibleChoices[i]);
39225
+ return res;
39117
39226
  },
39118
39227
  enumerable: false,
39119
39228
  configurable: true
39120
39229
  });
39121
39230
  Object.defineProperty(QuestionSelectBase.prototype, "footItems", {
39122
39231
  get: function () {
39123
- var _this = this;
39124
- return (this.separateSpecialChoices || this.isDesignMode) ?
39125
- this.visibleChoices.filter(function (choice) { return _this.isFootChoice(choice, _this); }) : [];
39232
+ var count = (this.separateSpecialChoices || this.isDesignMode) ? this.footItemsCount : 0;
39233
+ var res = [];
39234
+ var items = this.visibleChoices;
39235
+ for (var i = 0; i < count; i++)
39236
+ res.push(items[items.length - count + i]);
39237
+ return res;
39126
39238
  },
39127
39239
  enumerable: false,
39128
39240
  configurable: true
@@ -39367,7 +39479,7 @@ var QuestionCheckboxBase = /** @class */ (function (_super) {
39367
39479
  * @see separateSpecialChoices
39368
39480
  */
39369
39481
  get: function () {
39370
- return this.getPropertyValue("colCount", this.isFlowLayout ? 0 : 1);
39482
+ return this.getPropertyValue("colCount", this.isFlowLayout ? 0 : undefined);
39371
39483
  },
39372
39484
  set: function (value) {
39373
39485
  if (value < 0 || value > 5 || this.isFlowLayout)
@@ -40193,6 +40305,7 @@ __webpack_require__.r(__webpack_exports__);
40193
40305
  /* harmony import */ var _itemvalue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./itemvalue */ "./src/itemvalue.ts");
40194
40306
  /* harmony import */ var _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils/cssClassBuilder */ "./src/utils/cssClassBuilder.ts");
40195
40307
  /* harmony import */ var _error__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./error */ "./src/error.ts");
40308
+ /* harmony import */ var _settings__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./settings */ "./src/settings.ts");
40196
40309
  var __extends = (undefined && undefined.__extends) || (function () {
40197
40310
  var extendStatics = function (d, b) {
40198
40311
  extendStatics = Object.setPrototypeOf ||
@@ -40215,6 +40328,7 @@ var __extends = (undefined && undefined.__extends) || (function () {
40215
40328
 
40216
40329
 
40217
40330
 
40331
+
40218
40332
  /**
40219
40333
  * A class that describes the Checkboxes question type.
40220
40334
  *
@@ -40342,12 +40456,13 @@ var QuestionCheckboxModel = /** @class */ (function (_super) {
40342
40456
  if (this.isItemSelected(this.noneItem))
40343
40457
  return false;
40344
40458
  var allItemCount = this.visibleChoices.length;
40459
+ var order = _settings__WEBPACK_IMPORTED_MODULE_7__["settings"].specialChoicesOrder;
40345
40460
  if (this.hasOther)
40346
- allItemCount--;
40461
+ allItemCount -= order.otherItem.length;
40347
40462
  if (this.hasNone)
40348
- allItemCount--;
40463
+ allItemCount -= order.noneItem.length;
40349
40464
  if (this.hasSelectAll)
40350
- allItemCount--;
40465
+ allItemCount -= order.selectAllItem.length;
40351
40466
  var selectedCount = val.length;
40352
40467
  if (this.isOtherSelected)
40353
40468
  selectedCount--;
@@ -40455,12 +40570,14 @@ var QuestionCheckboxModel = /** @class */ (function (_super) {
40455
40570
  * @see enabledChoices
40456
40571
  */
40457
40572
  get: function () {
40573
+ var val = this.renderedValue;
40574
+ var visChoices = this.visibleChoices;
40575
+ var selectedItemValues = this.selectedItemValues;
40458
40576
  if (this.isEmpty())
40459
40577
  return [];
40460
- var val = this.renderedValue;
40461
- var allChoices = !!this.defaultSelectedItemValues ? [].concat(this.defaultSelectedItemValues, this.visibleChoices) : this.visibleChoices;
40578
+ var allChoices = !!this.defaultSelectedItemValues ? [].concat(this.defaultSelectedItemValues, visChoices) : visChoices;
40462
40579
  var itemValues = val.map(function (item) { return _itemvalue__WEBPACK_IMPORTED_MODULE_4__["ItemValue"].getItemByValue(allChoices, item); }).filter(function (item) { return !!item; });
40463
- if (!itemValues.length && !this.selectedItemValues) {
40580
+ if (!itemValues.length && !selectedItemValues) {
40464
40581
  this.updateSelectedItemValues();
40465
40582
  }
40466
40583
  return this.validateItemValues(itemValues);
@@ -40640,14 +40757,14 @@ var QuestionCheckboxModel = /** @class */ (function (_super) {
40640
40757
  QuestionCheckboxModel.prototype.supportSelectAll = function () {
40641
40758
  return this.isSupportProperty("showSelectAllItem");
40642
40759
  };
40643
- QuestionCheckboxModel.prototype.addToVisibleChoices = function (items, isAddAll) {
40760
+ QuestionCheckboxModel.prototype.addNonChoicesItems = function (dict, isAddAll) {
40761
+ _super.prototype.addNonChoicesItems.call(this, dict, isAddAll);
40644
40762
  if (this.supportSelectAll() && this.canShowOptionItem(this.selectAllItem, isAddAll, this.hasSelectAll)) {
40645
- items.unshift(this.selectAllItem);
40763
+ this.addNonChoiceItem(dict, this.selectAllItem, _settings__WEBPACK_IMPORTED_MODULE_7__["settings"].specialChoicesOrder.selectAllItem);
40646
40764
  }
40647
- _super.prototype.addToVisibleChoices.call(this, items, isAddAll);
40648
40765
  };
40649
- QuestionCheckboxModel.prototype.isHeadChoice = function (item, question) {
40650
- return (item === question.selectAllItem);
40766
+ QuestionCheckboxModel.prototype.isBuiltInChoice = function (item, question) {
40767
+ return item === question.selectAllItem || _super.prototype.isBuiltInChoice.call(this, item, question);
40651
40768
  };
40652
40769
  QuestionCheckboxModel.prototype.isItemInList = function (item) {
40653
40770
  if (item == this.selectAllItem)
@@ -41058,7 +41175,7 @@ var QuestionCommentModel = /** @class */ (function (_super) {
41058
41175
  this.updateRemainingCharacterCounter(event.target.value);
41059
41176
  };
41060
41177
  QuestionCommentModel.prototype.onKeyDown = function (event) {
41061
- this.checkForUndo(event);
41178
+ this.onKeyDownPreprocess && this.onKeyDownPreprocess(event);
41062
41179
  if (!this.acceptCarriageReturn && (event.key === "Enter" || event.keyCode === 13)) {
41063
41180
  event.preventDefault();
41064
41181
  event.stopPropagation();
@@ -41270,6 +41387,15 @@ var ComponentCollection = /** @class */ (function () {
41270
41387
  this.onAddingJson(name, customQuestion.isComposite);
41271
41388
  this.customQuestionValues.push(customQuestion);
41272
41389
  };
41390
+ ComponentCollection.prototype.remove = function (componentName) {
41391
+ if (!componentName)
41392
+ return false;
41393
+ var index = this.getCustomQuestionIndex(componentName.toLowerCase());
41394
+ if (index < 0)
41395
+ return false;
41396
+ this.removeByIndex(index);
41397
+ return true;
41398
+ };
41273
41399
  Object.defineProperty(ComponentCollection.prototype, "items", {
41274
41400
  get: function () {
41275
41401
  return this.customQuestionValues;
@@ -41278,17 +41404,26 @@ var ComponentCollection = /** @class */ (function () {
41278
41404
  configurable: true
41279
41405
  });
41280
41406
  ComponentCollection.prototype.getCustomQuestionByName = function (name) {
41407
+ var index = this.getCustomQuestionIndex(name);
41408
+ return index >= 0 ? this.customQuestionValues[index] : undefined;
41409
+ };
41410
+ ComponentCollection.prototype.getCustomQuestionIndex = function (name) {
41281
41411
  for (var i = 0; i < this.customQuestionValues.length; i++) {
41282
- if (this.customQuestionValues[i].name == name)
41283
- return this.customQuestionValues[i];
41412
+ if (this.customQuestionValues[i].name === name)
41413
+ return i;
41284
41414
  }
41285
- return null;
41415
+ return -1;
41286
41416
  };
41287
- ComponentCollection.prototype.clear = function () {
41288
- for (var i = 0; i < this.customQuestionValues.length; i++) {
41289
- _jsonobject__WEBPACK_IMPORTED_MODULE_1__["Serializer"].removeClass(this.customQuestionValues[i].name);
41417
+ ComponentCollection.prototype.removeByIndex = function (index) {
41418
+ _jsonobject__WEBPACK_IMPORTED_MODULE_1__["Serializer"].removeClass(this.customQuestionValues[index].name);
41419
+ this.customQuestionValues.splice(index, 1);
41420
+ };
41421
+ ComponentCollection.prototype.clear = function (includeInternal) {
41422
+ for (var i = this.customQuestionValues.length - 1; i >= 0; i--) {
41423
+ if (includeInternal || !this.customQuestionValues[i].json.internal) {
41424
+ this.removeByIndex(i);
41425
+ }
41290
41426
  }
41291
- this.customQuestionValues = [];
41292
41427
  };
41293
41428
  ComponentCollection.prototype.createQuestion = function (name, questionJSON) {
41294
41429
  if (!!questionJSON.isComposite)
@@ -41556,6 +41691,11 @@ var QuestionCustomModel = /** @class */ (function (_super) {
41556
41691
  QuestionCustomModel.prototype.getQuestionByName = function (name) {
41557
41692
  return this.contentQuestion;
41558
41693
  };
41694
+ QuestionCustomModel.prototype.getDefaultTitle = function () {
41695
+ if (this.hasJSONTitle && this.contentQuestion)
41696
+ return this.contentQuestion.title;
41697
+ return _super.prototype.getDefaultTitle.call(this);
41698
+ };
41559
41699
  QuestionCustomModel.prototype.setValue = function (name, newValue, locNotification, allowNotifyValueChanged) {
41560
41700
  if (this.isValueChanging(name, newValue))
41561
41701
  return;
@@ -41610,6 +41750,7 @@ var QuestionCustomModel = /** @class */ (function (_super) {
41610
41750
  var json = this.customQuestion.json;
41611
41751
  var res = null;
41612
41752
  if (!!json.questionJSON) {
41753
+ this.hasJSONTitle = !!json.questionJSON.title;
41613
41754
  var qType = json.questionJSON.type;
41614
41755
  if (!qType || !_jsonobject__WEBPACK_IMPORTED_MODULE_1__["Serializer"].findClass(qType))
41615
41756
  throw "type attribute in questionJSON is empty or incorrect";
@@ -42465,7 +42606,7 @@ var QuestionDropdownModel = /** @class */ (function (_super) {
42465
42606
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])()
42466
42607
  ], QuestionDropdownModel.prototype, "choicesLazyLoadEnabled", void 0);
42467
42608
  __decorate([
42468
- Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])({ defaultValue: 25 })
42609
+ Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])()
42469
42610
  ], QuestionDropdownModel.prototype, "choicesLazyLoadPageSize", void 0);
42470
42611
  __decorate([
42471
42612
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])()
@@ -42748,7 +42889,7 @@ var QuestionExpressionModel = /** @class */ (function (_super) {
42748
42889
  this.updateFormatedValue();
42749
42890
  };
42750
42891
  QuestionExpressionModel.prototype.getDisplayValueCore = function (keysAsText, value) {
42751
- var val = this.isValueEmpty(value) ? this.defaultValue : value;
42892
+ var val = value === undefined || value === null ? this.defaultValue : value;
42752
42893
  var res = "";
42753
42894
  if (!this.isValueEmpty(val)) {
42754
42895
  var str = this.getValueAsStr(val);
@@ -43175,7 +43316,6 @@ var QuestionFileModel = /** @class */ (function (_super) {
43175
43316
  _this.onUploadStateChanged = _this.addEvent();
43176
43317
  _this.onStateChanged = _this.addEvent();
43177
43318
  _this.fileNavigator = new _actions_container__WEBPACK_IMPORTED_MODULE_7__["ActionContainer"]();
43178
- _this.actionsContainer = new _actions_container__WEBPACK_IMPORTED_MODULE_7__["ActionContainer"]();
43179
43319
  _this.canFlipCameraValue = undefined;
43180
43320
  _this.prevPreviewLength = 0;
43181
43321
  _this.calcAvailableItemsCount = function (availableWidth, itemWidth, gap) {
@@ -43234,6 +43374,9 @@ var QuestionFileModel = /** @class */ (function (_super) {
43234
43374
  Object(_utils_utils__WEBPACK_IMPORTED_MODULE_6__["loadFileFromBase64"])(data.content, data.name);
43235
43375
  }
43236
43376
  };
43377
+ _this.createLocalizableString("takePhotoCaption", _this, false, true);
43378
+ _this.actionsContainer = new _actions_container__WEBPACK_IMPORTED_MODULE_7__["ActionContainer"]();
43379
+ _this.actionsContainer.locOwner = _this;
43237
43380
  _this.fileIndexAction = new _actions_action__WEBPACK_IMPORTED_MODULE_8__["Action"]({
43238
43381
  id: "fileIndex",
43239
43382
  title: _this.getFileIndexCaption(),
@@ -43260,7 +43403,7 @@ var QuestionFileModel = /** @class */ (function (_super) {
43260
43403
  id: "sv-file-take-picture",
43261
43404
  iconSize: "auto",
43262
43405
  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(); }),
43263
- title: new _base__WEBPACK_IMPORTED_MODULE_3__["ComputedUpdater"](function () { return _this.takePhotoCaption; }),
43406
+ locTitle: _this.locTakePhotoCaption,
43264
43407
  showTitle: false,
43265
43408
  action: function () {
43266
43409
  _this.snapPicture();
@@ -43296,7 +43439,7 @@ var QuestionFileModel = /** @class */ (function (_super) {
43296
43439
  iconName: "icon-takepicture_24x24",
43297
43440
  id: "sv-file-start-camera",
43298
43441
  iconSize: "auto",
43299
- title: new _base__WEBPACK_IMPORTED_MODULE_3__["ComputedUpdater"](function () { return _this.takePhotoCaption; }),
43442
+ locTitle: _this.locTakePhotoCaption,
43300
43443
  showTitle: new _base__WEBPACK_IMPORTED_MODULE_3__["ComputedUpdater"](function () { return !_this.isAnswered; }),
43301
43444
  enabledIf: function () { return !_this.isInputReadOnly; },
43302
43445
  action: function () {
@@ -43631,6 +43774,17 @@ var QuestionFileModel = /** @class */ (function (_super) {
43631
43774
  QuestionFileModel.prototype.getConfirmRemoveMessage = function (fileName) {
43632
43775
  return this.confirmRemoveMessage.format(fileName);
43633
43776
  };
43777
+ Object.defineProperty(QuestionFileModel.prototype, "takePhotoCaption", {
43778
+ get: function () { return this.getLocalizableStringText("takePhotoCaption"); },
43779
+ set: function (val) { this.setLocalizableStringText("takePhotoCaption", val); },
43780
+ enumerable: false,
43781
+ configurable: true
43782
+ });
43783
+ Object.defineProperty(QuestionFileModel.prototype, "locTakePhotoCaption", {
43784
+ get: function () { return this.getLocalizableString("takePhotoCaption"); },
43785
+ enumerable: false,
43786
+ configurable: true
43787
+ });
43634
43788
  Object.defineProperty(QuestionFileModel.prototype, "locRenderedPlaceholder", {
43635
43789
  get: function () {
43636
43790
  var _this = this;
@@ -44239,9 +44393,6 @@ var QuestionFileModel = /** @class */ (function (_super) {
44239
44393
  __decorate([
44240
44394
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])({ localizable: { defaultStr: "chooseFileCaption" } })
44241
44395
  ], QuestionFileModel.prototype, "chooseButtonCaption", void 0);
44242
- __decorate([
44243
- Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])({ localizable: { defaultStr: "takePhotoCaption" } })
44244
- ], QuestionFileModel.prototype, "takePhotoCaption", void 0);
44245
44396
  __decorate([
44246
44397
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])({ localizable: { defaultStr: "replaceFileCaption" } })
44247
44398
  ], QuestionFileModel.prototype, "replaceButtonCaption", void 0);
@@ -44455,7 +44606,16 @@ var QuestionHtmlModel = /** @class */ (function (_super) {
44455
44606
  return QuestionHtmlModel;
44456
44607
  }(_questionnonvalue__WEBPACK_IMPORTED_MODULE_0__["QuestionNonValue"]));
44457
44608
 
44458
- _jsonobject__WEBPACK_IMPORTED_MODULE_1__["Serializer"].addClass("html", [{ name: "html:html", serializationProperty: "locHtml" }], function () {
44609
+ _jsonobject__WEBPACK_IMPORTED_MODULE_1__["Serializer"].addClass("html", [
44610
+ { name: "html:html", serializationProperty: "locHtml" },
44611
+ { name: "hideNumber", visible: false },
44612
+ { name: "state", visible: false },
44613
+ { name: "titleLocation", visible: false },
44614
+ { name: "descriptionLocation", visible: false },
44615
+ { name: "errorLocation", visible: false },
44616
+ { name: "indent", visible: false },
44617
+ { name: "width", visible: false },
44618
+ ], function () {
44459
44619
  return new QuestionHtmlModel("");
44460
44620
  }, "nonvalue");
44461
44621
  _questionfactory__WEBPACK_IMPORTED_MODULE_2__["QuestionFactory"].Instance.registerQuestion("html", function (name) {
@@ -45215,9 +45375,12 @@ var QuestionImagePickerModel = /** @class */ (function (_super) {
45215
45375
  enumerable: false,
45216
45376
  configurable: true
45217
45377
  });
45218
- QuestionImagePickerModel.prototype.isFootChoice = function (_item, _question) {
45378
+ QuestionImagePickerModel.prototype.isBuiltInChoice = function (item, question) {
45219
45379
  return false;
45220
45380
  };
45381
+ QuestionImagePickerModel.prototype.addToVisibleChoices = function (items, isAddAll) {
45382
+ this.addNewItemToVisibleChoices(items, isAddAll);
45383
+ };
45221
45384
  QuestionImagePickerModel.prototype.getSelectBaseRootCss = function () {
45222
45385
  return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_5__["CssClassBuilder"]().append(_super.prototype.getSelectBaseRootCss.call(this)).append(this.cssClasses.rootColumn, this.getCurrentColCount() == 1).toString();
45223
45386
  };
@@ -46475,7 +46638,19 @@ var MatrixDropdownCell = /** @class */ (function () {
46475
46638
  this.data = data;
46476
46639
  this.questionValue = this.createQuestion(column, row, data);
46477
46640
  this.questionValue.updateCustomWidget();
46641
+ this.updateCellQuestionTitleDueToAccessebility(row);
46478
46642
  }
46643
+ MatrixDropdownCell.prototype.updateCellQuestionTitleDueToAccessebility = function (row) {
46644
+ var _this = this;
46645
+ this.questionValue.locTitle.onGetTextCallback = function (str) {
46646
+ if (!row || !row.getSurvey())
46647
+ return _this.questionValue.title;
46648
+ var rowTitle = row.getAccessbilityText();
46649
+ if (!rowTitle)
46650
+ return _this.questionValue.title;
46651
+ return _this.column.colOwner.getCellAriaLabel(rowTitle, _this.questionValue.title);
46652
+ };
46653
+ };
46479
46654
  MatrixDropdownCell.prototype.locStrsChanged = function () {
46480
46655
  this.question.locStrsChanged();
46481
46656
  };
@@ -46633,6 +46808,13 @@ var MatrixDropdownRowModelBase = /** @class */ (function () {
46633
46808
  enumerable: false,
46634
46809
  configurable: true
46635
46810
  });
46811
+ Object.defineProperty(MatrixDropdownRowModelBase.prototype, "dataName", {
46812
+ get: function () {
46813
+ return this.rowName;
46814
+ },
46815
+ enumerable: false,
46816
+ configurable: true
46817
+ });
46636
46818
  Object.defineProperty(MatrixDropdownRowModelBase.prototype, "text", {
46637
46819
  get: function () {
46638
46820
  return this.rowName;
@@ -46689,6 +46871,9 @@ var MatrixDropdownRowModelBase = /** @class */ (function () {
46689
46871
  enumerable: false,
46690
46872
  configurable: true
46691
46873
  });
46874
+ MatrixDropdownRowModelBase.prototype.getAccessbilityText = function () {
46875
+ return this.locText && this.locText.renderedHtml;
46876
+ };
46692
46877
  Object.defineProperty(MatrixDropdownRowModelBase.prototype, "hasPanel", {
46693
46878
  get: function () {
46694
46879
  if (!this.data)
@@ -48297,7 +48482,7 @@ var QuestionMatrixDropdownModelBase = /** @class */ (function (_super) {
48297
48482
  questionPlainData.isNode = true;
48298
48483
  questionPlainData.data = this.visibleRows.map(function (row) {
48299
48484
  var rowDataItem = {
48300
- name: row.rowName,
48485
+ name: row.dataName,
48301
48486
  title: row.text,
48302
48487
  value: row.value,
48303
48488
  displayValue: _this.getRowDisplayValue(false, row, row.value),
@@ -48371,6 +48556,8 @@ var QuestionMatrixDropdownModelBase = /** @class */ (function (_super) {
48371
48556
  this.collectNestedQuestonsInRows(this.visibleRows, questions, visibleOnly);
48372
48557
  };
48373
48558
  QuestionMatrixDropdownModelBase.prototype.collectNestedQuestonsInRows = function (rows, questions, visibleOnly) {
48559
+ if (!Array.isArray(rows))
48560
+ return;
48374
48561
  rows.forEach(function (row) {
48375
48562
  row.questions.forEach(function (q) { return q.collectNestedQuestions(questions, visibleOnly); });
48376
48563
  });
@@ -50109,12 +50296,6 @@ var QuestionMatrixDropdownRenderedCell = /** @class */ (function () {
50109
50296
  Object.defineProperty(QuestionMatrixDropdownRenderedCell.prototype, "headers", {
50110
50297
  get: function () {
50111
50298
  if (this.cell && this.cell.column) {
50112
- if (this.cell.column.cellHint === " ") {
50113
- return "";
50114
- }
50115
- if (!!this.cell.column.cellHint) {
50116
- return this.cell.column.locCellHint.renderedHtml;
50117
- }
50118
50299
  if (this.matrix.IsMultiplyColumn(this.cell.column)) {
50119
50300
  if (!!this.item) {
50120
50301
  return this.item.locText.renderedHtml;
@@ -50123,6 +50304,13 @@ var QuestionMatrixDropdownRenderedCell = /** @class */ (function () {
50123
50304
  return "";
50124
50305
  }
50125
50306
  }
50307
+ var cellHint = this.cell.column.cellHint;
50308
+ if (!!cellHint) {
50309
+ if (cellHint.trim() === "")
50310
+ return "";
50311
+ return this.cell.column.locCellHint.renderedHtml;
50312
+ }
50313
+ return this.cell.column.title;
50126
50314
  }
50127
50315
  if (this.hasQuestion && this.question.isVisible) {
50128
50316
  return this.question.locTitle.renderedHtml;
@@ -51180,6 +51368,23 @@ var MatrixDynamicRowModel = /** @class */ (function (_super) {
51180
51368
  enumerable: false,
51181
51369
  configurable: true
51182
51370
  });
51371
+ Object.defineProperty(MatrixDynamicRowModel.prototype, "dataName", {
51372
+ get: function () {
51373
+ return "row" + (this.index + 1);
51374
+ },
51375
+ enumerable: false,
51376
+ configurable: true
51377
+ });
51378
+ Object.defineProperty(MatrixDynamicRowModel.prototype, "text", {
51379
+ get: function () {
51380
+ return "row " + (this.index + 1);
51381
+ },
51382
+ enumerable: false,
51383
+ configurable: true
51384
+ });
51385
+ MatrixDynamicRowModel.prototype.getAccessbilityText = function () {
51386
+ return (this.index + 1).toString();
51387
+ };
51183
51388
  Object.defineProperty(MatrixDynamicRowModel.prototype, "shortcutText", {
51184
51389
  get: function () {
51185
51390
  var matrix = this.data;
@@ -52042,7 +52247,7 @@ var QuestionMatrixDynamicModel = /** @class */ (function (_super) {
52042
52247
  var lastDelRow = this.lastDeletedRow;
52043
52248
  this.lastDeletedRow = undefined;
52044
52249
  var rows = this.generatedVisibleRows;
52045
- if (!Array.isArray(val) || Math.abs(rows.length - val.length) > 1)
52250
+ if (!Array.isArray(val) || Math.abs(rows.length - val.length) > 1 || rows.length === val.length)
52046
52251
  return false;
52047
52252
  var index = this.getInsertedDeletedIndex(rows, val);
52048
52253
  if (rows.length > val.length) {
@@ -57717,10 +57922,10 @@ var QuestionRatingModel = /** @class */ (function (_super) {
57717
57922
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])({ defaultValue: false })
57718
57923
  ], QuestionRatingModel.prototype, "inputHasValue", void 0);
57719
57924
  __decorate([
57720
- Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])({ defaultValue: true })
57925
+ Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])()
57721
57926
  ], QuestionRatingModel.prototype, "autoGenerate", void 0);
57722
57927
  __decorate([
57723
- Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])({ defaultValue: 5 })
57928
+ Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])()
57724
57929
  ], QuestionRatingModel.prototype, "rateCount", void 0);
57725
57930
  __decorate([
57726
57931
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["propertyArray"])()
@@ -57732,11 +57937,10 @@ var QuestionRatingModel = /** @class */ (function (_super) {
57732
57937
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])({ defaultValue: false })
57733
57938
  ], QuestionRatingModel.prototype, "hasMaxRateDescription", void 0);
57734
57939
  __decorate([
57735
- Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])({ defaultValue: false })
57940
+ Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])()
57736
57941
  ], QuestionRatingModel.prototype, "displayRateDescriptionsAsExtremeItems", void 0);
57737
57942
  __decorate([
57738
57943
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])({
57739
- defaultValue: "auto",
57740
57944
  onSet: function (val, target) {
57741
57945
  if (!target.isDesignMode) {
57742
57946
  if (val === "dropdown") {
@@ -57750,13 +57954,13 @@ var QuestionRatingModel = /** @class */ (function (_super) {
57750
57954
  })
57751
57955
  ], QuestionRatingModel.prototype, "displayMode", void 0);
57752
57956
  __decorate([
57753
- Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])({ defaultValue: "labels" })
57957
+ Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])()
57754
57958
  ], QuestionRatingModel.prototype, "rateType", void 0);
57755
57959
  __decorate([
57756
- Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])({ defaultValue: "monochrome" })
57960
+ Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])()
57757
57961
  ], QuestionRatingModel.prototype, "scaleColorMode", void 0);
57758
57962
  __decorate([
57759
- Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])({ defaultValue: "scale" })
57963
+ Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])()
57760
57964
  ], QuestionRatingModel.prototype, "rateColorMode", void 0);
57761
57965
  return QuestionRatingModel;
57762
57966
  }(_question__WEBPACK_IMPORTED_MODULE_1__["Question"]));
@@ -58275,13 +58479,13 @@ var QuestionSignaturePadModel = /** @class */ (function (_super) {
58275
58479
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])({ defaultValue: false })
58276
58480
  ], QuestionSignaturePadModel.prototype, "isDrawingValue", void 0);
58277
58481
  __decorate([
58278
- Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])({ defaultValue: false })
58482
+ Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])()
58279
58483
  ], QuestionSignaturePadModel.prototype, "signatureAutoScaleEnabled", void 0);
58280
58484
  __decorate([
58281
- Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])({ defaultValue: 0.5 })
58485
+ Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])()
58282
58486
  ], QuestionSignaturePadModel.prototype, "penMinWidth", void 0);
58283
58487
  __decorate([
58284
- Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])({ defaultValue: 2.5 })
58488
+ Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])()
58285
58489
  ], QuestionSignaturePadModel.prototype, "penMaxWidth", void 0);
58286
58490
  __decorate([
58287
58491
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])({})
@@ -58632,7 +58836,6 @@ var QuestionTagboxModel = /** @class */ (function (_super) {
58632
58836
  ], QuestionTagboxModel.prototype, "allowClear", void 0);
58633
58837
  __decorate([
58634
58838
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])({
58635
- defaultValue: true,
58636
58839
  onSet: function (newValue, target) {
58637
58840
  if (!!target.dropdownListModel) {
58638
58841
  target.dropdownListModel.setSearchEnabled(newValue);
@@ -58653,7 +58856,7 @@ var QuestionTagboxModel = /** @class */ (function (_super) {
58653
58856
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])()
58654
58857
  ], QuestionTagboxModel.prototype, "choicesLazyLoadEnabled", void 0);
58655
58858
  __decorate([
58656
- Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])({ defaultValue: 25 })
58859
+ Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])()
58657
58860
  ], QuestionTagboxModel.prototype, "choicesLazyLoadPageSize", void 0);
58658
58861
  __decorate([
58659
58862
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])({ getDefaultValue: function () { return _settings__WEBPACK_IMPORTED_MODULE_5__["settings"].tagboxCloseOnSelect; } })
@@ -58758,7 +58961,7 @@ var QuestionTextModel = /** @class */ (function (_super) {
58758
58961
  _this.updateRemainingCharacterCounter(event.target.value);
58759
58962
  };
58760
58963
  _this.onKeyDown = function (event) {
58761
- _this.checkForUndo(event);
58964
+ _this.onKeyDownPreprocess && _this.onKeyDownPreprocess(event);
58762
58965
  if (_this.isInputTextUpdate) {
58763
58966
  _this._isWaitingForEnter = event.keyCode === 229;
58764
58967
  }
@@ -59519,7 +59722,6 @@ var QuestionTextBase = /** @class */ (function (_super) {
59519
59722
  function QuestionTextBase(name) {
59520
59723
  var _this = _super.call(this, name) || this;
59521
59724
  _this.characterCounter = new CharacterCounter();
59522
- _this.disableNativeUndoRedo = false;
59523
59725
  return _this;
59524
59726
  }
59525
59727
  QuestionTextBase.prototype.isTextValue = function () {
@@ -59645,13 +59847,6 @@ var QuestionTextBase = /** @class */ (function (_super) {
59645
59847
  return val;
59646
59848
  };
59647
59849
  QuestionTextBase.prototype.getValueSeparator = function () { return ", "; };
59648
- QuestionTextBase.prototype.checkForUndo = function (event) {
59649
- if (this.disableNativeUndoRedo && this.isInputTextUpdate && (event.ctrlKey || event.metaKey)) {
59650
- if ([89, 90].indexOf(event.keyCode) !== -1) {
59651
- event.preventDefault();
59652
- }
59653
- }
59654
- };
59655
59850
  QuestionTextBase.prototype.getControlCssClassBuilder = function () {
59656
59851
  return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_3__["CssClassBuilder"]()
59657
59852
  .append(this.cssClasses.root)
@@ -59695,6 +59890,8 @@ __webpack_require__.r(__webpack_exports__);
59695
59890
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ElementFactory", function() { return ElementFactory; });
59696
59891
  /* harmony import */ var _surveyStrings__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./surveyStrings */ "./src/surveyStrings.ts");
59697
59892
  /* harmony import */ var _jsonobject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./jsonobject */ "./src/jsonobject.ts");
59893
+ /* harmony import */ var _question_custom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./question_custom */ "./src/question_custom.ts");
59894
+
59698
59895
 
59699
59896
 
59700
59897
  var QuestionFactory = /** @class */ (function () {
@@ -59796,6 +59993,9 @@ var ElementFactory = /** @class */ (function () {
59796
59993
  var creator = this.creatorHash[elementType];
59797
59994
  if (!!creator)
59798
59995
  return creator(name);
59996
+ var compJSON = _question_custom__WEBPACK_IMPORTED_MODULE_2__["ComponentCollection"].Instance.getCustomQuestionByName(elementType);
59997
+ if (!!compJSON)
59998
+ return _question_custom__WEBPACK_IMPORTED_MODULE_2__["ComponentCollection"].Instance.createQuestion(name, compJSON);
59799
59999
  return null;
59800
60000
  };
59801
60001
  ElementFactory.Instance = new ElementFactory();
@@ -62695,7 +62895,7 @@ var SvgIcon = /** @class */ (function (_super) {
62695
62895
  className += " " + this.props.className;
62696
62896
  }
62697
62897
  return (this.props.iconName ?
62698
- react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("svg", { className: className, style: this.props.style, onClick: this.props.onClick, ref: this.svgIconRef, role: "img", "aria-label": this.props.title },
62898
+ react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("svg", { className: className, style: this.props.style, onClick: this.props.onClick, ref: this.svgIconRef, role: "img" },
62699
62899
  react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("use", null))
62700
62900
  : null);
62701
62901
  };
@@ -63161,7 +63361,7 @@ var SurveyQuestionDropdownBase = /** @class */ (function (_super) {
63161
63361
  dropdownListModel.inputStringRendered = e.target.value;
63162
63362
  }
63163
63363
  };
63164
- return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { id: this.question.inputId, className: this.question.getControlClass(), tabIndex: dropdownListModel.inputReadOnly ? undefined : 0,
63364
+ return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { id: this.question.inputId, className: this.question.getControlClass(), tabIndex: dropdownListModel.noTabIndex ? undefined : 0,
63165
63365
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
63166
63366
  // @ts-ignore
63167
63367
  disabled: this.question.isInputReadOnly, required: this.question.isRequired, onKeyDown: this.keyhandler, onBlur: this.blur, role: this.question.ariaRole, "aria-required": this.question.ariaRequired, "aria-label": this.question.ariaLabel, "aria-invalid": this.question.ariaInvalid, "aria-describedby": this.question.ariaDescribedBy, "aria-expanded": this.question.ariaExpanded === null ? undefined : this.question.ariaExpanded === "true", "aria-controls": dropdownListModel.listElementId, "aria-activedescendant": dropdownListModel.ariaActivedescendant },
@@ -63174,20 +63374,20 @@ var SurveyQuestionDropdownBase = /** @class */ (function (_super) {
63174
63374
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", { style: { visibility: "hidden" }, "data-bind": "text: model.filterString" }, dropdownListModel.inputStringRendered),
63175
63375
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", null, dropdownListModel.hintStringSuffix))) : null,
63176
63376
  valueElement,
63177
- react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("input", { type: "text", autoComplete: "off", id: this.question.getInputId(), ref: function (element) { return (_this.inputElement = element); }, className: this.question.cssClasses.filterStringInput, role: dropdownListModel.filterStringEnabled ? this.question.ariaRole : undefined, "aria-expanded": this.question.ariaExpanded === null ? undefined : this.question.ariaExpanded === "true", "aria-label": this.question.a11y_input_ariaLabel, "aria-labelledby": this.question.a11y_input_ariaLabelledBy, "aria-controls": dropdownListModel.listElementId, "aria-activedescendant": dropdownListModel.ariaActivedescendant, placeholder: dropdownListModel.placeholderRendered, readOnly: !dropdownListModel.searchEnabled ? true : undefined, tabIndex: dropdownListModel.inputReadOnly ? undefined : -1, disabled: this.question.isInputReadOnly, inputMode: dropdownListModel.inputMode, onChange: function (e) { onInputChange(e); }, onBlur: this.blur, onFocus: this.focus })),
63377
+ react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("input", { type: "text", autoComplete: "off", id: this.question.getInputId(), ref: function (element) { return (_this.inputElement = element); }, className: this.question.cssClasses.filterStringInput, role: dropdownListModel.filterStringEnabled ? this.question.ariaRole : undefined, "aria-expanded": this.question.ariaExpanded === null ? undefined : this.question.ariaExpanded === "true", "aria-label": this.question.a11y_input_ariaLabel, "aria-labelledby": this.question.a11y_input_ariaLabelledBy, "aria-controls": dropdownListModel.listElementId, "aria-activedescendant": dropdownListModel.ariaActivedescendant, placeholder: dropdownListModel.placeholderRendered, readOnly: dropdownListModel.filterReadOnly ? true : undefined, tabIndex: dropdownListModel.noTabIndex ? undefined : -1, disabled: this.question.isInputReadOnly, inputMode: dropdownListModel.inputMode, onChange: function (e) { onInputChange(e); }, onBlur: this.blur, onFocus: this.focus })),
63178
63378
  this.createClearButton()));
63179
63379
  };
63180
63380
  SurveyQuestionDropdownBase.prototype.createClearButton = function () {
63181
63381
  if (!this.question.allowClear || !this.question.cssClasses.cleanButtonIconId)
63182
63382
  return null;
63183
63383
  var style = { display: !this.question.showClearButton ? "none" : "" };
63184
- return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.question.cssClasses.cleanButton, style: style, onClick: this.clear },
63384
+ return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.question.cssClasses.cleanButton, style: style, onClick: this.clear, tabIndex: this.question.showClearButton ? 0 : -1 },
63185
63385
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_components_svg_icon_svg_icon__WEBPACK_IMPORTED_MODULE_3__["SvgIcon"], { className: this.question.cssClasses.cleanButtonSvg, iconName: this.question.cssClasses.cleanButtonIconId, title: this.question.clearCaption, size: "auto" })));
63186
63386
  };
63187
63387
  SurveyQuestionDropdownBase.prototype.createChevronButton = function () {
63188
63388
  if (!this.question.cssClasses.chevronButtonIconId)
63189
63389
  return null;
63190
- return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.question.cssClasses.chevronButton, onPointerDown: this.chevronPointerDown },
63390
+ return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.question.cssClasses.chevronButton, "aria-hidden": "true", onPointerDown: this.chevronPointerDown },
63191
63391
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_components_svg_icon_svg_icon__WEBPACK_IMPORTED_MODULE_3__["SvgIcon"], { className: this.question.cssClasses.chevronButtonSvg, iconName: this.question.cssClasses.chevronButtonIconId, size: "auto" })));
63192
63392
  };
63193
63393
  SurveyQuestionDropdownBase.prototype.renderOther = function (cssClasses) {
@@ -66098,8 +66298,9 @@ __webpack_require__.r(__webpack_exports__);
66098
66298
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
66099
66299
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
66100
66300
  /* harmony import */ var _reactquestion_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./reactquestion_element */ "./src/react/reactquestion_element.tsx");
66101
- /* harmony import */ var _reactquestion_factory__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./reactquestion_factory */ "./src/react/reactquestion_factory.tsx");
66102
- /* harmony import */ var _components_character_counter__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./components/character-counter */ "./src/react/components/character-counter.tsx");
66301
+ /* harmony import */ var survey_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! survey-core */ "./src/entries/core.ts");
66302
+ /* harmony import */ var _reactquestion_factory__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./reactquestion_factory */ "./src/react/reactquestion_factory.tsx");
66303
+ /* harmony import */ var _components_character_counter__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./components/character-counter */ "./src/react/components/character-counter.tsx");
66103
66304
  var __extends = (undefined && undefined.__extends) || (function () {
66104
66305
  var extendStatics = function (d, b) {
66105
66306
  extendStatics = Object.setPrototypeOf ||
@@ -66119,6 +66320,7 @@ var __extends = (undefined && undefined.__extends) || (function () {
66119
66320
 
66120
66321
 
66121
66322
 
66323
+
66122
66324
  var SurveyQuestionComment = /** @class */ (function (_super) {
66123
66325
  __extends(SurveyQuestionComment, _super);
66124
66326
  function SurveyQuestionComment(props) {
@@ -66141,7 +66343,7 @@ var SurveyQuestionComment = /** @class */ (function (_super) {
66141
66343
  if (this.question.isReadOnlyRenderDiv()) {
66142
66344
  return react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", null, this.question.value);
66143
66345
  }
66144
- var counter = !!this.question.getMaxLength() ? (react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_components_character_counter__WEBPACK_IMPORTED_MODULE_3__["CharacterCounterComponent"], { counter: this.question.characterCounter, remainingCharacterCounter: this.question.cssClasses.remainingCharacterCounter })) : null;
66346
+ var counter = !!this.question.getMaxLength() ? (react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_components_character_counter__WEBPACK_IMPORTED_MODULE_4__["CharacterCounterComponent"], { counter: this.question.characterCounter, remainingCharacterCounter: this.question.cssClasses.remainingCharacterCounter })) : null;
66145
66347
  return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"](react__WEBPACK_IMPORTED_MODULE_0__["Fragment"], null,
66146
66348
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("textarea", { id: this.question.inputId, className: this.question.className, disabled: this.question.isInputReadOnly, readOnly: this.question.isInputReadOnly, ref: function (textarea) { return (_this.setControl(textarea)); }, maxLength: this.question.getMaxLength(), placeholder: placeholder, onBlur: onBlur, onInput: onInput, onKeyDown: function (event) { _this.question.onKeyDown(event); }, cols: this.question.cols, rows: this.question.rows, "aria-required": this.question.a11y_input_ariaRequired, "aria-label": this.question.a11y_input_ariaLabel, "aria-labelledby": this.question.a11y_input_ariaLabelledBy, "aria-invalid": this.question.a11y_input_ariaInvalid, "aria-describedby": this.question.a11y_input_ariaDescribedBy, style: { resize: this.question.resizeStyle } }),
66147
66349
  counter));
@@ -66151,9 +66353,19 @@ var SurveyQuestionComment = /** @class */ (function (_super) {
66151
66353
 
66152
66354
  var SurveyQuestionCommentItem = /** @class */ (function (_super) {
66153
66355
  __extends(SurveyQuestionCommentItem, _super);
66154
- function SurveyQuestionCommentItem() {
66155
- return _super !== null && _super.apply(this, arguments) || this;
66356
+ function SurveyQuestionCommentItem(props) {
66357
+ var _this = _super.call(this, props) || this;
66358
+ _this.state = { comment: _this.getComment() || "" };
66359
+ return _this;
66156
66360
  }
66361
+ SurveyQuestionCommentItem.prototype.getStateComment = function () {
66362
+ var comment = this.getComment();
66363
+ var stateComment = this.state.comment;
66364
+ if (stateComment !== undefined && stateComment.trim() !== comment) {
66365
+ stateComment = comment;
66366
+ }
66367
+ return stateComment !== undefined ? stateComment : comment || "";
66368
+ };
66157
66369
  SurveyQuestionCommentItem.prototype.canRender = function () {
66158
66370
  return !!this.props.question;
66159
66371
  };
@@ -66166,6 +66378,9 @@ var SurveyQuestionCommentItem = /** @class */ (function (_super) {
66166
66378
  SurveyQuestionCommentItem.prototype.getComment = function () {
66167
66379
  return this.props.question.comment;
66168
66380
  };
66381
+ SurveyQuestionCommentItem.prototype.setComment = function (value) {
66382
+ this.props.question.comment = value;
66383
+ };
66169
66384
  SurveyQuestionCommentItem.prototype.getId = function () {
66170
66385
  return this.props.question.commentId;
66171
66386
  };
@@ -66178,14 +66393,12 @@ var SurveyQuestionCommentItem = /** @class */ (function (_super) {
66178
66393
  var className = this.props.otherCss || this.cssClasses.comment;
66179
66394
  var handleOnChange = function (event) {
66180
66395
  _this.setState({ comment: event.target.value });
66181
- _this.onCommentChange(event);
66396
+ // https://github.com/surveyjs/survey-library/issues/7252
66397
+ if (!survey_core__WEBPACK_IMPORTED_MODULE_2__["Helpers"].isTwoValueEquals(_this.getComment(), event.target.value, false, true, false)) {
66398
+ _this.setComment(event.target.value);
66399
+ }
66182
66400
  };
66183
- var questionComment = this.getComment();
66184
- var stateComment = !!this.state ? this.state.comment : undefined;
66185
- if (stateComment !== undefined && stateComment.trim() !== questionComment) {
66186
- stateComment = questionComment;
66187
- }
66188
- var comment = stateComment !== undefined ? stateComment : questionComment || "";
66401
+ var comment = this.getStateComment();
66189
66402
  if (question.isReadOnlyRenderDiv()) {
66190
66403
  return react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", null, comment);
66191
66404
  }
@@ -66208,6 +66421,9 @@ var SurveyQuestionOtherValueItem = /** @class */ (function (_super) {
66208
66421
  SurveyQuestionOtherValueItem.prototype.getComment = function () {
66209
66422
  return this.props.question.otherValue;
66210
66423
  };
66424
+ SurveyQuestionOtherValueItem.prototype.setComment = function (value) {
66425
+ this.props.question.otherValue = value;
66426
+ };
66211
66427
  SurveyQuestionOtherValueItem.prototype.getId = function () {
66212
66428
  return this.props.question.otherId;
66213
66429
  };
@@ -66217,7 +66433,7 @@ var SurveyQuestionOtherValueItem = /** @class */ (function (_super) {
66217
66433
  return SurveyQuestionOtherValueItem;
66218
66434
  }(SurveyQuestionCommentItem));
66219
66435
 
66220
- _reactquestion_factory__WEBPACK_IMPORTED_MODULE_2__["ReactQuestionFactory"].Instance.registerQuestion("comment", function (props) {
66436
+ _reactquestion_factory__WEBPACK_IMPORTED_MODULE_3__["ReactQuestionFactory"].Instance.registerQuestion("comment", function (props) {
66221
66437
  return react__WEBPACK_IMPORTED_MODULE_0__["createElement"](SurveyQuestionComment, props);
66222
66438
  });
66223
66439
 
@@ -67263,7 +67479,7 @@ var SurveyQuestionMatrixRow = /** @class */ (function (_super) {
67263
67479
  else {
67264
67480
  td = (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("td", { key: key, "data-responsive-title": column.locText.renderedHtml, className: this.question.cssClasses.cell },
67265
67481
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("label", { onMouseDown: this.handleOnMouseDown, className: itemClass },
67266
- react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("input", { id: inputId, type: "radio", className: this.cssClasses.itemValue, name: row.fullName, value: column.value, disabled: this.isDisplayMode, checked: isChecked, onChange: this.handleOnChange, "aria-required": this.question.ariaRequired, "aria-label": column.locText.renderedHtml, "aria-invalid": this.question.ariaInvalid, "aria-describedby": this.question.ariaDescribedBy }),
67482
+ react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("input", { id: inputId, type: "radio", className: this.cssClasses.itemValue, name: row.fullName, value: column.value, disabled: this.isDisplayMode, checked: isChecked, onChange: this.handleOnChange, "aria-required": this.question.a11y_input_ariaRequired, "aria-label": this.question.getCellAriaLabel(row.locText.renderedHtml, column.locText.renderedHtml), "aria-invalid": this.question.a11y_input_ariaInvalid, "aria-describedby": this.question.a11y_input_ariaDescribedBy }),
67267
67483
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", { className: this.question.cssClasses.materialDecorator }, this.question.itemSvgIcon ?
67268
67484
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("svg", { className: this.cssClasses.itemDecorator },
67269
67485
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("use", { xlinkHref: this.question.itemSvgIcon })) :
@@ -68812,7 +69028,7 @@ var SurveyQuestionTagbox = /** @class */ (function (_super) {
68812
69028
  var _this = this;
68813
69029
  var dropdownMultiSelectListModel = dropdownListModel;
68814
69030
  var items = this.question.selectedChoices.map(function (choice, index) { return _this.renderItem("item" + index, choice); });
68815
- return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { id: this.question.inputId, className: this.question.getControlClass(), tabIndex: dropdownListModel.inputReadOnly ? undefined : 0,
69031
+ return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { id: this.question.inputId, className: this.question.getControlClass(), tabIndex: dropdownListModel.noTabIndex ? undefined : 0,
68816
69032
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
68817
69033
  // @ts-ignore
68818
69034
  disabled: this.question.isInputReadOnly, required: this.question.isRequired, onKeyDown: this.keyhandler, onBlur: this.blur, role: this.question.ariaRole, "aria-required": this.question.ariaRequired, "aria-label": this.question.ariaLabel, "aria-invalid": this.question.ariaInvalid, "aria-describedby": this.question.ariaDescribedBy, "aria-expanded": this.question.ariaExpanded === null ? undefined : this.question.ariaExpanded === "true", "aria-controls": dropdownListModel.listElementId, "aria-activedescendant": dropdownListModel.ariaActivedescendant },
@@ -69603,7 +69819,7 @@ var TagboxFilterString = /** @class */ (function (_super) {
69603
69819
  (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.question.cssClasses.hintSuffix },
69604
69820
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", { style: { visibility: "hidden" }, "data-bind": "text: model.filterString" }, this.model.inputStringRendered),
69605
69821
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", null, this.model.hintStringSuffix))) : null,
69606
- react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("input", { type: "text", autoComplete: "off", id: this.question.getInputId(), inputMode: this.model.inputMode, ref: function (element) { return (_this.inputElement = element); }, className: this.question.cssClasses.filterStringInput, disabled: this.question.isInputReadOnly, readOnly: !this.model.searchEnabled ? true : undefined, size: !this.model.inputStringRendered ? 1 : undefined, role: this.model.filterStringEnabled ? this.question.ariaRole : undefined, "aria-expanded": this.question.ariaExpanded === null ? undefined : this.question.ariaExpanded === "true", "aria-label": this.question.a11y_input_ariaLabel, "aria-labelledby": this.question.a11y_input_ariaLabelledBy, "aria-controls": this.model.listElementId, "aria-activedescendant": this.model.ariaActivedescendant, placeholder: this.model.filterStringPlaceholder, onKeyDown: function (e) { _this.keyhandler(e); }, onChange: function (e) { _this.onChange(e); }, onBlur: function (e) { _this.onBlur(e); }, onFocus: function (e) { _this.onFocus(e); } }))));
69822
+ react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("input", { type: "text", autoComplete: "off", id: this.question.getInputId(), inputMode: this.model.inputMode, ref: function (element) { return (_this.inputElement = element); }, className: this.question.cssClasses.filterStringInput, disabled: this.question.isInputReadOnly, readOnly: this.model.filterReadOnly ? true : undefined, size: !this.model.inputStringRendered ? 1 : undefined, role: this.model.filterStringEnabled ? this.question.ariaRole : undefined, "aria-expanded": this.question.ariaExpanded === null ? undefined : this.question.ariaExpanded === "true", "aria-label": this.question.a11y_input_ariaLabel, "aria-labelledby": this.question.a11y_input_ariaLabelledBy, "aria-controls": this.model.listElementId, "aria-activedescendant": this.model.ariaActivedescendant, placeholder: this.model.filterStringPlaceholder, onKeyDown: function (e) { _this.keyhandler(e); }, onChange: function (e) { _this.onChange(e); }, onBlur: function (e) { _this.onBlur(e); }, onFocus: function (e) { _this.onFocus(e); } }))));
69607
69823
  };
69608
69824
  return TagboxFilterString;
69609
69825
  }(_reactquestion_element__WEBPACK_IMPORTED_MODULE_3__["SurveyElementBase"]));
@@ -70297,6 +70513,32 @@ var settings = {
70297
70513
  * Default value: `"none"`
70298
70514
  */
70299
70515
  noneItemValue: "none",
70516
+ /**
70517
+ * An object whose properties specify the order of the special choice items (None, Other, Select All) in select-based questions.
70518
+ *
70519
+ * Default value: `{ selectAllItem: [-1], noneItem: [1], otherItem: [2] }`
70520
+ *
70521
+ * 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.
70522
+ *
70523
+ * ```js
70524
+ * import { settings } from "survey-core";
70525
+ *
70526
+ * settings.specialChoicesOrder.noneItem = [-2];
70527
+ * settings.specialChoicesOrder.selectAllItem = [-1];
70528
+ * settings.specialChoicesOrder.otherItem = [1];
70529
+ * ```
70530
+ *
70531
+ * If you want to duplicate a special choice item above and below other choices, add two numbers to the corresponding array:
70532
+ *
70533
+ * ```js
70534
+ * settings.specialChoicesOrder.selectAllItem = [-1, 3] // Displays Select All above and below other choices
70535
+ * ```
70536
+ */
70537
+ specialChoicesOrder: {
70538
+ selectAllItem: [-1],
70539
+ noneItem: [1],
70540
+ otherItem: [2]
70541
+ },
70300
70542
  /**
70301
70543
  * A list of supported validators by question type.
70302
70544
  */
@@ -71219,9 +71461,7 @@ var SurveyElement = /** @class */ (function (_super) {
71219
71461
  * @see isExpanded
71220
71462
  */
71221
71463
  get: function () {
71222
- if (this.isDesignMode)
71223
- return;
71224
- return this.state === "collapsed";
71464
+ return this.state === "collapsed" && !this.isDesignMode;
71225
71465
  },
71226
71466
  enumerable: false,
71227
71467
  configurable: true
@@ -75954,13 +76194,23 @@ var SurveyModel = /** @class */ (function (_super) {
75954
76194
  }
75955
76195
  this.setPropertyValue("completedStateText", text);
75956
76196
  if (this.state === "completed" && this.showCompletedPage && !!this.completedState) {
75957
- this.notify(this.completedStateText, this.completedState, true);
76197
+ this.notify(this.completedStateText, this.completedState, value === "error");
75958
76198
  }
75959
76199
  };
76200
+ /**
76201
+ * Displays a toast notification with a specified message.
76202
+ *
76203
+ * Depending on the `type` argument, a survey can display the following notification types:
76204
+ *
76205
+ * ![Toast notification types in SurveyJS Form Library](https://surveyjs.io//Content/Images/docs/notification-types.png)
76206
+ * @param message A message to display.
76207
+ * @param type A notification type: `"info"` (default), `"success"`, or `"error"`.
76208
+ * @param showActions For internal use.
76209
+ */
75960
76210
  SurveyModel.prototype.notify = function (message, type, showActions) {
75961
76211
  if (showActions === void 0) { showActions = false; }
75962
76212
  this.notifier.showActions = showActions;
75963
- this.notifier.notify(message, type, type === "error");
76213
+ this.notifier.notify(message, type, showActions);
75964
76214
  };
75965
76215
  /**
75966
76216
  * 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"`.
@@ -76750,7 +77000,7 @@ var SurveyModel = /** @class */ (function (_super) {
76750
77000
  }
76751
77001
  else {
76752
77002
  if (this.runningPages) {
76753
- this.restoreOrigionalPages(this.runningPages);
77003
+ this.restoreOriginalPages(this.runningPages);
76754
77004
  }
76755
77005
  this.runningPages = undefined;
76756
77006
  }
@@ -76777,25 +77027,27 @@ var SurveyModel = /** @class */ (function (_super) {
76777
77027
  if (this.isShowingPreview)
76778
77028
  return;
76779
77029
  if (this.questionsOnPageMode == "standard" || this.isDesignMode) {
76780
- if (this.origionalPages) {
76781
- this.restoreOrigionalPages(this.origionalPages);
77030
+ if (this.originalPages) {
77031
+ this.restoreOriginalPages(this.originalPages);
76782
77032
  }
76783
- this.origionalPages = undefined;
77033
+ this.originalPages = undefined;
76784
77034
  }
76785
77035
  else {
76786
77036
  if (!oldValue || oldValue == "standard") {
76787
- this.origionalPages = this.pages.slice(0, this.pages.length);
77037
+ this.originalPages = this.pages.slice(0, this.pages.length);
76788
77038
  }
76789
77039
  this.setupPagesForPageModes(this.isSinglePage);
76790
77040
  }
76791
77041
  this.runConditions();
76792
77042
  this.updateVisibleIndexes();
76793
77043
  };
76794
- SurveyModel.prototype.restoreOrigionalPages = function (originalPages) {
77044
+ SurveyModel.prototype.restoreOriginalPages = function (originalPages) {
76795
77045
  this.questionHashesClear();
76796
77046
  this.pages.splice(0, this.pages.length);
76797
77047
  for (var i = 0; i < originalPages.length; i++) {
76798
- this.pages.push(originalPages[i]);
77048
+ var page = originalPages[i];
77049
+ page.setWasShown(false);
77050
+ this.pages.push(page);
76799
77051
  }
76800
77052
  };
76801
77053
  SurveyModel.prototype.getPageStartIndex = function () {
@@ -80339,7 +80591,7 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_1__["Serializer"].addClass("survey", [
80339
80591
  className: "htmlconditionitem", isArray: true
80340
80592
  },
80341
80593
  { name: "loadingHtml:html", serializationProperty: "locLoadingHtml" },
80342
- { name: "pages:surveypages", className: "page", isArray: true },
80594
+ { name: "pages:surveypages", className: "page", isArray: true, onSerializeValue: function (obj) { return obj.originalPages || obj.pages; } },
80343
80595
  {
80344
80596
  name: "elements",
80345
80597
  alternativeName: "questions",
@@ -82782,19 +83034,36 @@ var ResponsivityManager = /** @class */ (function () {
82782
83034
  configurable: true
82783
83035
  });
82784
83036
  ResponsivityManager.prototype.process = function () {
82785
- var _a;
83037
+ var _this = this;
82786
83038
  if (this.isContainerVisible && !this.model.isResponsivenessDisabled) {
82787
83039
  if (!this.isInitialized) {
82788
83040
  this.model.setActionsMode("large");
82789
- this.calcItemsSizes();
82790
- this.isInitialized = true;
83041
+ var recalcItemSizes = function () {
83042
+ _this.calcItemsSizes();
83043
+ _this.isInitialized = true;
83044
+ };
83045
+ if (queueMicrotask) {
83046
+ queueMicrotask(recalcItemSizes);
83047
+ }
83048
+ else {
83049
+ recalcItemSizes();
83050
+ }
82791
83051
  }
82792
- var dotsItemSize = this.dotsItemSize;
82793
- if (!this.dotsItemSize) {
82794
- var dotsItemElement = (_a = this.container) === null || _a === void 0 ? void 0 : _a.querySelector(".sv-dots");
82795
- dotsItemSize = dotsItemElement && this.calcItemSize(dotsItemElement) || this.dotsSizeConst;
83052
+ var processResponsiveness = function () {
83053
+ var _a;
83054
+ var dotsItemSize = _this.dotsItemSize;
83055
+ if (!_this.dotsItemSize) {
83056
+ var dotsItemElement = (_a = _this.container) === null || _a === void 0 ? void 0 : _a.querySelector(".sv-dots");
83057
+ dotsItemSize = dotsItemElement && _this.calcItemSize(dotsItemElement) || _this.dotsSizeConst;
83058
+ }
83059
+ _this.model.fit(_this.getAvailableSpace(), dotsItemSize);
83060
+ };
83061
+ if (queueMicrotask) {
83062
+ queueMicrotask(processResponsiveness);
83063
+ }
83064
+ else {
83065
+ processResponsiveness();
82796
83066
  }
82797
- this.model.fit(this.getAvailableSpace(), dotsItemSize);
82798
83067
  }
82799
83068
  };
82800
83069
  ResponsivityManager.prototype.dispose = function () {
@@ -83216,6 +83485,9 @@ function findParentByClassNames(element, classNames) {
83216
83485
  function sanitizeEditableContent(element) {
83217
83486
  if (window.getSelection && document.createRange && element.childNodes.length > 0) {
83218
83487
  var selection = document.getSelection();
83488
+ if (selection.rangeCount == 0) {
83489
+ return;
83490
+ }
83219
83491
  var range = selection.getRangeAt(0);
83220
83492
  range.setStart(range.endContainer, range.endOffset);
83221
83493
  range.setEndAfter(element.lastChild);