survey-react 1.9.115 → 1.9.117

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.115
2
+ * surveyjs - Survey JavaScript library v1.9.117
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
  */
@@ -4380,6 +4380,10 @@ var ConsoleWarnings = /** @class */ (function () {
4380
4380
  // eslint-disable-next-line no-console
4381
4381
  console.warn(text);
4382
4382
  };
4383
+ ConsoleWarnings.error = function (text) {
4384
+ // eslint-disable-next-line no-console
4385
+ console.error(text);
4386
+ };
4383
4387
  return ConsoleWarnings;
4384
4388
  }());
4385
4389
 
@@ -8086,13 +8090,20 @@ var DropdownListModel = /** @class */ (function (_super) {
8086
8090
  enumerable: false,
8087
8091
  configurable: true
8088
8092
  });
8089
- Object.defineProperty(DropdownListModel.prototype, "inputReadOnly", {
8093
+ Object.defineProperty(DropdownListModel.prototype, "noTabIndex", {
8090
8094
  get: function () {
8091
8095
  return this.question.isInputReadOnly || this.searchEnabled;
8092
8096
  },
8093
8097
  enumerable: false,
8094
8098
  configurable: true
8095
8099
  });
8100
+ Object.defineProperty(DropdownListModel.prototype, "filterReadOnly", {
8101
+ get: function () {
8102
+ return this.question.isInputReadOnly || !this.searchEnabled || !this.focused;
8103
+ },
8104
+ enumerable: false,
8105
+ configurable: true
8106
+ });
8096
8107
  Object.defineProperty(DropdownListModel.prototype, "filterStringEnabled", {
8097
8108
  get: function () {
8098
8109
  return !this.question.isInputReadOnly && this.searchEnabled;
@@ -8299,6 +8310,9 @@ var DropdownListModel = /** @class */ (function (_super) {
8299
8310
  DropdownListModel.prototype.scrollToFocusedItem = function () {
8300
8311
  this.listModel.scrollToFocusedItem();
8301
8312
  };
8313
+ __decorate([
8314
+ Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])({ defaultValue: false })
8315
+ ], DropdownListModel.prototype, "focused", void 0);
8302
8316
  __decorate([
8303
8317
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])({ defaultValue: true })
8304
8318
  ], DropdownListModel.prototype, "searchEnabled", void 0);
@@ -9370,8 +9384,8 @@ __webpack_require__.r(__webpack_exports__);
9370
9384
  //import "../../modern.scss";
9371
9385
  var Version;
9372
9386
  var ReleaseDate;
9373
- Version = "" + "1.9.115";
9374
- ReleaseDate = "" + "2023-11-01";
9387
+ Version = "" + "1.9.117";
9388
+ ReleaseDate = "" + "2023-11-14";
9375
9389
  function checkLibraryVersion(ver, libraryName) {
9376
9390
  if (Version != ver) {
9377
9391
  var str = "survey-core has version '" + Version + "' and " + libraryName
@@ -9415,6 +9429,8 @@ function _slk(k, lh, rd) {
9415
9429
  var index = v.indexOf(";");
9416
9430
  if (index < 0)
9417
9431
  return;
9432
+ if (!checkPrefix(v.substring(0, index)))
9433
+ return;
9418
9434
  v = v.substring(index + 1);
9419
9435
  v.split(",").forEach(function (s) {
9420
9436
  var i = s.indexOf("=");
@@ -9423,6 +9439,27 @@ function _slk(k, lh, rd) {
9423
9439
  }
9424
9440
  });
9425
9441
  }
9442
+ function checkPrefix(prefix) {
9443
+ if (!prefix)
9444
+ return true;
9445
+ var s = "domains:";
9446
+ var index = prefix.indexOf(s);
9447
+ if (index < 0)
9448
+ return true;
9449
+ var ds = prefix.substring(index + s.length).toLowerCase().split(",");
9450
+ if (!Array.isArray(ds) || ds.length === 0)
9451
+ return true;
9452
+ if (typeof window !== "undefined" && !!window.location && !!window.location.hostname) {
9453
+ var hn = window.location.hostname.toLowerCase();
9454
+ ds.push("localhost");
9455
+ for (var i = 0; i < ds.length; i++) {
9456
+ if (hn.indexOf(ds[i]) > -1)
9457
+ return true;
9458
+ }
9459
+ return false;
9460
+ }
9461
+ return true;
9462
+ }
9426
9463
 
9427
9464
 
9428
9465
 
@@ -15631,8 +15668,8 @@ var OperandMaker = /** @class */ (function () {
15631
15668
  right = OperandMaker.convertValForDateCompare(right, left);
15632
15669
  return OperandMaker.isTwoValueEquals(left, right, strictCompare !== true);
15633
15670
  },
15634
- notequal: function (left, right) {
15635
- return !OperandMaker.binaryFunctions.equal(left, right);
15671
+ notequal: function (left, right, strictCompare) {
15672
+ return !OperandMaker.binaryFunctions.equal(left, right, strictCompare);
15636
15673
  },
15637
15674
  contains: function (left, right) {
15638
15675
  return OperandMaker.binaryFunctions.containsCore(left, right, true);
@@ -18514,6 +18551,10 @@ function property(options) {
18514
18551
  if (!options || !options.localizable) {
18515
18552
  Object.defineProperty(target, key, {
18516
18553
  get: function () {
18554
+ // const serializationProperty = Serializer.getProperty(target.getType(), key);
18555
+ // if(!!serializationProperty && options.defaultValue !== undefined) {
18556
+ // ConsoleWarnings.error("remove defaultValue from @property for class " + target.getType() + " property name is " + key);
18557
+ // }
18517
18558
  var defaultVal = null;
18518
18559
  if (!!options) {
18519
18560
  if (typeof options.getDefaultValue === "function") {
@@ -20921,9 +20962,6 @@ var LocalizableString = /** @class */ (function () {
20921
20962
  };
20922
20963
  LocalizableString.prototype.isLocaleTextEqualsWithDefault = function (loc, val) {
20923
20964
  var res = this.getLocaleTextCore(loc);
20924
- if (!res && this.onGetDefaultTextCallback) {
20925
- res = this.onGetDefaultTextCallback();
20926
- }
20927
20965
  if (res === val)
20928
20966
  return true;
20929
20967
  return this.isValueEmpty(res) && this.isValueEmpty(val);
@@ -28386,8 +28424,11 @@ var QuestionMatrixBaseModel = /** @class */ (function (_super) {
28386
28424
  enumerable: false,
28387
28425
  configurable: true
28388
28426
  });
28427
+ QuestionMatrixBaseModel.prototype.getCellAriaLabel = function (rowTitle, columnTitle) {
28428
+ return "row " + rowTitle + ", column " + columnTitle;
28429
+ };
28389
28430
  __decorate([
28390
- Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])({ defaultValue: "middle" })
28431
+ Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])()
28391
28432
  ], QuestionMatrixBaseModel.prototype, "verticalAlign", void 0);
28392
28433
  __decorate([
28393
28434
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])()
@@ -33694,7 +33735,9 @@ var PopupBaseViewModel = /** @class */ (function (_super) {
33694
33735
  }
33695
33736
  currentElement = currentElement.parentElement;
33696
33737
  }
33697
- event.preventDefault();
33738
+ if (event.cancelable) {
33739
+ event.preventDefault();
33740
+ }
33698
33741
  };
33699
33742
  PopupBaseViewModel.SubscriptionId = 0;
33700
33743
  __decorate([
@@ -34014,10 +34057,6 @@ var Question = /** @class */ (function (_super) {
34014
34057
  _this.addExpressionProperty("enableIf", function (obj, res) { _this.readOnly = res === false; });
34015
34058
  _this.addExpressionProperty("requiredIf", function (obj, res) { _this.isRequired = res === true; });
34016
34059
  _this.createLocalizableString("commentText", _this, true, "otherItemText");
34017
- _this.locTitle.onGetDefaultTextCallback = function () {
34018
- return _this.name;
34019
- };
34020
- _this.locTitle.storeDefaultText = true;
34021
34060
  _this.createLocalizableString("requiredErrorText", _this);
34022
34061
  _this.addTriggerInfo("resetValueIf", function () { return !_this.isEmpty(); }, function () {
34023
34062
  _this.clearValue();
@@ -34066,12 +34105,14 @@ var Question = /** @class */ (function (_super) {
34066
34105
  this.isMobile = val && (this.allowMobileInDesignMode() || !this.isDesignMode);
34067
34106
  };
34068
34107
  Question.prototype.themeChanged = function (theme) { };
34108
+ Question.prototype.getDefaultTitle = function () { return this.name; };
34069
34109
  Question.prototype.createLocTitleProperty = function () {
34070
34110
  var _this = this;
34071
34111
  var locTitleValue = _super.prototype.createLocTitleProperty.call(this);
34112
+ locTitleValue.storeDefaultText = true;
34072
34113
  locTitleValue.onGetTextCallback = function (text) {
34073
34114
  if (!text) {
34074
- text = _this.name;
34115
+ text = _this.getDefaultTitle();
34075
34116
  }
34076
34117
  if (!_this.survey)
34077
34118
  return text;
@@ -34951,6 +34992,16 @@ var Question = /** @class */ (function (_super) {
34951
34992
  this.updateCommentElements();
34952
34993
  }
34953
34994
  };
34995
+ Question.prototype.onCompositionUpdateComment = function (event) {
34996
+ var _this = this;
34997
+ if (this.isInputTextUpdate) {
34998
+ setTimeout(function () {
34999
+ if (event.target) {
35000
+ _this.comment = event.target.value;
35001
+ }
35002
+ }, 1);
35003
+ }
35004
+ };
34954
35005
  Question.prototype.onCommentChange = function (event) {
34955
35006
  this.comment = event.target.value;
34956
35007
  if (this.comment !== event.target.value) {
@@ -35547,6 +35598,9 @@ var Question = /** @class */ (function (_super) {
35547
35598
  Question.prototype.onReadOnlyChanged = function () {
35548
35599
  this.setPropertyValue("isInputReadOnly", this.isInputReadOnly);
35549
35600
  _super.prototype.onReadOnlyChanged.call(this);
35601
+ if (this.isReadOnly) {
35602
+ this.clearErrors();
35603
+ }
35550
35604
  this.updateQuestionCss();
35551
35605
  this.calcRenderedCommentPlaceholder();
35552
35606
  };
@@ -36668,7 +36722,7 @@ var Question = /** @class */ (function (_super) {
36668
36722
  if (updateIsAnswered === void 0) { updateIsAnswered = true; }
36669
36723
  newValue = this.convertToCorrectValue(newValue);
36670
36724
  var isEqual = this.isTwoValueEquals(this.questionValue, newValue);
36671
- if (!isEqual && !this.isChangingViaDefaultValue) {
36725
+ if (!isEqual && !this.isChangingViaDefaultValue && !this.isParentChangingViaDefaultValue) {
36672
36726
  this.setValueChangedDirectly(true);
36673
36727
  }
36674
36728
  this.questionValue = newValue;
@@ -36680,6 +36734,14 @@ var Question = /** @class */ (function (_super) {
36680
36734
  if (updateIsAnswered)
36681
36735
  this.updateIsAnswered();
36682
36736
  };
36737
+ Object.defineProperty(Question.prototype, "isParentChangingViaDefaultValue", {
36738
+ get: function () {
36739
+ var _a;
36740
+ return ((_a = this.data) === null || _a === void 0 ? void 0 : _a.isChangingViaDefaultValue) === true;
36741
+ },
36742
+ enumerable: false,
36743
+ configurable: true
36744
+ });
36683
36745
  Question.prototype.onSurveyValueChanged = function (newValue) { };
36684
36746
  Question.prototype.setVisibleIndex = function (val) {
36685
36747
  if (!this.isVisible ||
@@ -37142,7 +37204,7 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_1__["Serializer"].addClass("question", [
37142
37204
  "enableIf:condition",
37143
37205
  "resetValueIf:condition",
37144
37206
  "setValueIf:condition",
37145
- { name: "setValueExpression:expression", visibleIf: function (obj) { return !!obj.setValueIf; } },
37207
+ "setValueExpression:expression",
37146
37208
  "defaultValue:value",
37147
37209
  {
37148
37210
  name: "defaultValueExpression:expression",
@@ -37455,6 +37517,8 @@ var QuestionSelectBase = /** @class */ (function (_super) {
37455
37517
  _this.isRunningChoices = false;
37456
37518
  _this.isFirstLoadChoicesFromUrl = true;
37457
37519
  _this.isUpdatingChoicesDependedQuestions = false;
37520
+ _this.headItemsCount = 0;
37521
+ _this.footItemsCount = 0;
37458
37522
  _this.prevIsOtherSelected = false;
37459
37523
  var noneItemText = _this.createLocalizableString("noneText", _this.noneItemValue, true, "noneItemText");
37460
37524
  _this.noneItemValue.locOwner = _this;
@@ -38434,22 +38498,51 @@ var QuestionSelectBase = /** @class */ (function (_super) {
38434
38498
  configurable: true
38435
38499
  });
38436
38500
  QuestionSelectBase.prototype.addToVisibleChoices = function (items, isAddAll) {
38437
- if (isAddAll) {
38438
- if (!this.newItemValue) {
38439
- this.newItemValue = this.createItemValue("newitem"); //TODO
38440
- this.newItemValue.isGhost = true;
38501
+ this.headItemsCount = 0;
38502
+ this.footItemsCount = 0;
38503
+ this.addNewItemToVisibleChoices(items, isAddAll);
38504
+ var dict = new Array();
38505
+ this.addNonChoicesItems(dict, isAddAll);
38506
+ dict.sort(function (a, b) {
38507
+ if (a.index === b.index)
38508
+ return 0;
38509
+ return a.index < b.index ? -1 : 1;
38510
+ });
38511
+ for (var i = 0; i < dict.length; i++) {
38512
+ var rec = dict[i];
38513
+ if (rec.index < 0) {
38514
+ items.splice(i, 0, rec.item);
38515
+ this.headItemsCount++;
38441
38516
  }
38442
- if (!this.isUsingCarryForward && this.canShowOptionItem(this.newItemValue, isAddAll, false)) {
38443
- items.push(this.newItemValue);
38517
+ else {
38518
+ items.push(rec.item);
38519
+ this.footItemsCount++;
38444
38520
  }
38445
38521
  }
38522
+ };
38523
+ QuestionSelectBase.prototype.addNewItemToVisibleChoices = function (items, isAddAll) {
38524
+ if (!isAddAll)
38525
+ return;
38526
+ if (!this.newItemValue) {
38527
+ this.newItemValue = this.createItemValue("newitem"); //TODO
38528
+ this.newItemValue.isGhost = true;
38529
+ }
38530
+ if (!this.isUsingCarryForward && this.canShowOptionItem(this.newItemValue, isAddAll, false)) {
38531
+ this.footItemsCount = 1;
38532
+ items.push(this.newItemValue);
38533
+ }
38534
+ };
38535
+ QuestionSelectBase.prototype.addNonChoicesItems = function (dict, isAddAll) {
38446
38536
  if (this.supportNone() && this.canShowOptionItem(this.noneItem, isAddAll, this.hasNone)) {
38447
- items.push(this.noneItem);
38537
+ this.addNonChoiceItem(dict, this.noneItem, _settings__WEBPACK_IMPORTED_MODULE_9__["settings"].specialChoicesOrder.noneItem);
38448
38538
  }
38449
38539
  if (this.supportOther() && this.canShowOptionItem(this.otherItem, isAddAll, this.hasOther)) {
38450
- items.push(this.otherItem);
38540
+ this.addNonChoiceItem(dict, this.otherItem, _settings__WEBPACK_IMPORTED_MODULE_9__["settings"].specialChoicesOrder.otherItem);
38451
38541
  }
38452
38542
  };
38543
+ QuestionSelectBase.prototype.addNonChoiceItem = function (dict, item, order) {
38544
+ order.forEach(function (val) { return dict.push({ index: val, item: item }); });
38545
+ };
38453
38546
  QuestionSelectBase.prototype.canShowOptionItem = function (item, isAddAll, hasItem) {
38454
38547
  var res = (isAddAll && (!!this.canShowOptionItemCallback ? this.canShowOptionItemCallback(item) : true)) || hasItem;
38455
38548
  if (this.canSurveyChangeItemVisibility()) {
@@ -38681,17 +38774,11 @@ var QuestionSelectBase = /** @class */ (function (_super) {
38681
38774
  enumerable: false,
38682
38775
  configurable: true
38683
38776
  });
38684
- QuestionSelectBase.prototype.isHeadChoice = function (item, question) {
38685
- return false;
38686
- };
38687
- QuestionSelectBase.prototype.isFootChoice = function (item, question) {
38777
+ QuestionSelectBase.prototype.isBuiltInChoice = function (item, question) {
38688
38778
  return (item === question.noneItem ||
38689
38779
  item === question.otherItem ||
38690
38780
  item === question.newItemValue);
38691
38781
  };
38692
- QuestionSelectBase.prototype.isBuiltInChoice = function (item, question) {
38693
- return this.isHeadChoice(item, question) || this.isFootChoice(item, question);
38694
- };
38695
38782
  QuestionSelectBase.prototype.getChoices = function () {
38696
38783
  return this.choices;
38697
38784
  };
@@ -38792,6 +38879,16 @@ var QuestionSelectBase = /** @class */ (function (_super) {
38792
38879
  this.updateCommentElements();
38793
38880
  }
38794
38881
  };
38882
+ QuestionSelectBase.prototype.onCompositionUpdateOtherValue = function (event) {
38883
+ var _this = this;
38884
+ if (this.isInputTextUpdate) {
38885
+ setTimeout(function () {
38886
+ if (event.target) {
38887
+ _this.otherValue = event.target.value;
38888
+ }
38889
+ }, 1);
38890
+ }
38891
+ };
38795
38892
  QuestionSelectBase.prototype.onOtherValueChange = function (event) {
38796
38893
  this.otherValue = event.target.value;
38797
38894
  if (this.otherValue !== event.target.value) {
@@ -39103,18 +39200,23 @@ var QuestionSelectBase = /** @class */ (function (_super) {
39103
39200
  };
39104
39201
  Object.defineProperty(QuestionSelectBase.prototype, "headItems", {
39105
39202
  get: function () {
39106
- var _this = this;
39107
- return (this.separateSpecialChoices || this.isDesignMode) ?
39108
- this.visibleChoices.filter(function (choice) { return _this.isHeadChoice(choice, _this); }) : [];
39203
+ var count = (this.separateSpecialChoices || this.isDesignMode) ? this.headItemsCount : 0;
39204
+ var res = [];
39205
+ for (var i = 0; i < count; i++)
39206
+ res.push(this.visibleChoices[i]);
39207
+ return res;
39109
39208
  },
39110
39209
  enumerable: false,
39111
39210
  configurable: true
39112
39211
  });
39113
39212
  Object.defineProperty(QuestionSelectBase.prototype, "footItems", {
39114
39213
  get: function () {
39115
- var _this = this;
39116
- return (this.separateSpecialChoices || this.isDesignMode) ?
39117
- this.visibleChoices.filter(function (choice) { return _this.isFootChoice(choice, _this); }) : [];
39214
+ var count = (this.separateSpecialChoices || this.isDesignMode) ? this.footItemsCount : 0;
39215
+ var res = [];
39216
+ var items = this.visibleChoices;
39217
+ for (var i = 0; i < count; i++)
39218
+ res.push(items[items.length - count + i]);
39219
+ return res;
39118
39220
  },
39119
39221
  enumerable: false,
39120
39222
  configurable: true
@@ -39359,7 +39461,7 @@ var QuestionCheckboxBase = /** @class */ (function (_super) {
39359
39461
  * @see separateSpecialChoices
39360
39462
  */
39361
39463
  get: function () {
39362
- return this.getPropertyValue("colCount", this.isFlowLayout ? 0 : 1);
39464
+ return this.getPropertyValue("colCount", this.isFlowLayout ? 0 : undefined);
39363
39465
  },
39364
39466
  set: function (value) {
39365
39467
  if (value < 0 || value > 5 || this.isFlowLayout)
@@ -40185,6 +40287,7 @@ __webpack_require__.r(__webpack_exports__);
40185
40287
  /* harmony import */ var _itemvalue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./itemvalue */ "./src/itemvalue.ts");
40186
40288
  /* harmony import */ var _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils/cssClassBuilder */ "./src/utils/cssClassBuilder.ts");
40187
40289
  /* harmony import */ var _error__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./error */ "./src/error.ts");
40290
+ /* harmony import */ var _settings__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./settings */ "./src/settings.ts");
40188
40291
  var __extends = (undefined && undefined.__extends) || (function () {
40189
40292
  var extendStatics = function (d, b) {
40190
40293
  extendStatics = Object.setPrototypeOf ||
@@ -40207,6 +40310,7 @@ var __extends = (undefined && undefined.__extends) || (function () {
40207
40310
 
40208
40311
 
40209
40312
 
40313
+
40210
40314
  /**
40211
40315
  * A class that describes the Checkboxes question type.
40212
40316
  *
@@ -40334,12 +40438,13 @@ var QuestionCheckboxModel = /** @class */ (function (_super) {
40334
40438
  if (this.isItemSelected(this.noneItem))
40335
40439
  return false;
40336
40440
  var allItemCount = this.visibleChoices.length;
40441
+ var order = _settings__WEBPACK_IMPORTED_MODULE_7__["settings"].specialChoicesOrder;
40337
40442
  if (this.hasOther)
40338
- allItemCount--;
40443
+ allItemCount -= order.otherItem.length;
40339
40444
  if (this.hasNone)
40340
- allItemCount--;
40445
+ allItemCount -= order.noneItem.length;
40341
40446
  if (this.hasSelectAll)
40342
- allItemCount--;
40447
+ allItemCount -= order.selectAllItem.length;
40343
40448
  var selectedCount = val.length;
40344
40449
  if (this.isOtherSelected)
40345
40450
  selectedCount--;
@@ -40632,14 +40737,14 @@ var QuestionCheckboxModel = /** @class */ (function (_super) {
40632
40737
  QuestionCheckboxModel.prototype.supportSelectAll = function () {
40633
40738
  return this.isSupportProperty("showSelectAllItem");
40634
40739
  };
40635
- QuestionCheckboxModel.prototype.addToVisibleChoices = function (items, isAddAll) {
40740
+ QuestionCheckboxModel.prototype.addNonChoicesItems = function (dict, isAddAll) {
40741
+ _super.prototype.addNonChoicesItems.call(this, dict, isAddAll);
40636
40742
  if (this.supportSelectAll() && this.canShowOptionItem(this.selectAllItem, isAddAll, this.hasSelectAll)) {
40637
- items.unshift(this.selectAllItem);
40743
+ this.addNonChoiceItem(dict, this.selectAllItem, _settings__WEBPACK_IMPORTED_MODULE_7__["settings"].specialChoicesOrder.selectAllItem);
40638
40744
  }
40639
- _super.prototype.addToVisibleChoices.call(this, items, isAddAll);
40640
40745
  };
40641
- QuestionCheckboxModel.prototype.isHeadChoice = function (item, question) {
40642
- return (item === question.selectAllItem);
40746
+ QuestionCheckboxModel.prototype.isBuiltInChoice = function (item, question) {
40747
+ return item === question.selectAllItem || _super.prototype.isBuiltInChoice.call(this, item, question);
40643
40748
  };
40644
40749
  QuestionCheckboxModel.prototype.isItemInList = function (item) {
40645
40750
  if (item == this.selectAllItem)
@@ -41056,6 +41161,11 @@ var QuestionCommentModel = /** @class */ (function (_super) {
41056
41161
  event.stopPropagation();
41057
41162
  }
41058
41163
  };
41164
+ QuestionCommentModel.prototype.setQuestionValue = function (newValue, updateIsAnswered) {
41165
+ if (updateIsAnswered === void 0) { updateIsAnswered = true; }
41166
+ _super.prototype.setQuestionValue.call(this, newValue, updateIsAnswered);
41167
+ this.updateElement();
41168
+ };
41059
41169
  QuestionCommentModel.prototype.onValueChanged = function () {
41060
41170
  _super.prototype.onValueChanged.call(this);
41061
41171
  this.updateElement();
@@ -41257,6 +41367,15 @@ var ComponentCollection = /** @class */ (function () {
41257
41367
  this.onAddingJson(name, customQuestion.isComposite);
41258
41368
  this.customQuestionValues.push(customQuestion);
41259
41369
  };
41370
+ ComponentCollection.prototype.remove = function (componentName) {
41371
+ if (!componentName)
41372
+ return false;
41373
+ var index = this.getCustomQuestionIndex(componentName.toLowerCase());
41374
+ if (index < 0)
41375
+ return false;
41376
+ this.removeByIndex(index);
41377
+ return true;
41378
+ };
41260
41379
  Object.defineProperty(ComponentCollection.prototype, "items", {
41261
41380
  get: function () {
41262
41381
  return this.customQuestionValues;
@@ -41265,17 +41384,26 @@ var ComponentCollection = /** @class */ (function () {
41265
41384
  configurable: true
41266
41385
  });
41267
41386
  ComponentCollection.prototype.getCustomQuestionByName = function (name) {
41387
+ var index = this.getCustomQuestionIndex(name);
41388
+ return index >= 0 ? this.customQuestionValues[index] : undefined;
41389
+ };
41390
+ ComponentCollection.prototype.getCustomQuestionIndex = function (name) {
41268
41391
  for (var i = 0; i < this.customQuestionValues.length; i++) {
41269
- if (this.customQuestionValues[i].name == name)
41270
- return this.customQuestionValues[i];
41392
+ if (this.customQuestionValues[i].name === name)
41393
+ return i;
41271
41394
  }
41272
- return null;
41395
+ return -1;
41273
41396
  };
41274
- ComponentCollection.prototype.clear = function () {
41275
- for (var i = 0; i < this.customQuestionValues.length; i++) {
41276
- _jsonobject__WEBPACK_IMPORTED_MODULE_1__["Serializer"].removeClass(this.customQuestionValues[i].name);
41397
+ ComponentCollection.prototype.removeByIndex = function (index) {
41398
+ _jsonobject__WEBPACK_IMPORTED_MODULE_1__["Serializer"].removeClass(this.customQuestionValues[index].name);
41399
+ this.customQuestionValues.splice(index, 1);
41400
+ };
41401
+ ComponentCollection.prototype.clear = function (includeInternal) {
41402
+ for (var i = this.customQuestionValues.length - 1; i >= 0; i--) {
41403
+ if (includeInternal || !this.customQuestionValues[i].json.internal) {
41404
+ this.removeByIndex(i);
41405
+ }
41277
41406
  }
41278
- this.customQuestionValues = [];
41279
41407
  };
41280
41408
  ComponentCollection.prototype.createQuestion = function (name, questionJSON) {
41281
41409
  if (!!questionJSON.isComposite)
@@ -41543,6 +41671,11 @@ var QuestionCustomModel = /** @class */ (function (_super) {
41543
41671
  QuestionCustomModel.prototype.getQuestionByName = function (name) {
41544
41672
  return this.contentQuestion;
41545
41673
  };
41674
+ QuestionCustomModel.prototype.getDefaultTitle = function () {
41675
+ if (this.hasJSONTitle && this.contentQuestion)
41676
+ return this.contentQuestion.title;
41677
+ return _super.prototype.getDefaultTitle.call(this);
41678
+ };
41546
41679
  QuestionCustomModel.prototype.setValue = function (name, newValue, locNotification, allowNotifyValueChanged) {
41547
41680
  if (this.isValueChanging(name, newValue))
41548
41681
  return;
@@ -41597,6 +41730,7 @@ var QuestionCustomModel = /** @class */ (function (_super) {
41597
41730
  var json = this.customQuestion.json;
41598
41731
  var res = null;
41599
41732
  if (!!json.questionJSON) {
41733
+ this.hasJSONTitle = !!json.questionJSON.title;
41600
41734
  var qType = json.questionJSON.type;
41601
41735
  if (!qType || !_jsonobject__WEBPACK_IMPORTED_MODULE_1__["Serializer"].findClass(qType))
41602
41736
  throw "type attribute in questionJSON is empty or incorrect";
@@ -42452,7 +42586,7 @@ var QuestionDropdownModel = /** @class */ (function (_super) {
42452
42586
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])()
42453
42587
  ], QuestionDropdownModel.prototype, "choicesLazyLoadEnabled", void 0);
42454
42588
  __decorate([
42455
- Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])({ defaultValue: 25 })
42589
+ Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])()
42456
42590
  ], QuestionDropdownModel.prototype, "choicesLazyLoadPageSize", void 0);
42457
42591
  __decorate([
42458
42592
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])()
@@ -42735,7 +42869,7 @@ var QuestionExpressionModel = /** @class */ (function (_super) {
42735
42869
  this.updateFormatedValue();
42736
42870
  };
42737
42871
  QuestionExpressionModel.prototype.getDisplayValueCore = function (keysAsText, value) {
42738
- var val = this.isValueEmpty(value) ? this.defaultValue : value;
42872
+ var val = value === undefined || value === null ? this.defaultValue : value;
42739
42873
  var res = "";
42740
42874
  if (!this.isValueEmpty(val)) {
42741
42875
  var str = this.getValueAsStr(val);
@@ -43857,7 +43991,9 @@ var QuestionFileModel = /** @class */ (function (_super) {
43857
43991
  if (_this.survey) {
43858
43992
  _this.survey.uploadFiles(_this, _this.name, files, function (status, data) {
43859
43993
  if (status === "error") {
43994
+ _this.errors.push(new _error__WEBPACK_IMPORTED_MODULE_4__["UploadingFileError"](data, _this));
43860
43995
  _this.stateChanged("error");
43996
+ _this.stateChanged("loaded");
43861
43997
  }
43862
43998
  if (status === "success") {
43863
43999
  _this.value = (_this.value || []).concat(data.map(function (r) {
@@ -44440,7 +44576,16 @@ var QuestionHtmlModel = /** @class */ (function (_super) {
44440
44576
  return QuestionHtmlModel;
44441
44577
  }(_questionnonvalue__WEBPACK_IMPORTED_MODULE_0__["QuestionNonValue"]));
44442
44578
 
44443
- _jsonobject__WEBPACK_IMPORTED_MODULE_1__["Serializer"].addClass("html", [{ name: "html:html", serializationProperty: "locHtml" }], function () {
44579
+ _jsonobject__WEBPACK_IMPORTED_MODULE_1__["Serializer"].addClass("html", [
44580
+ { name: "html:html", serializationProperty: "locHtml" },
44581
+ { name: "hideNumber", visible: false },
44582
+ { name: "state", visible: false },
44583
+ { name: "titleLocation", visible: false },
44584
+ { name: "descriptionLocation", visible: false },
44585
+ { name: "errorLocation", visible: false },
44586
+ { name: "indent", visible: false },
44587
+ { name: "width", visible: false },
44588
+ ], function () {
44444
44589
  return new QuestionHtmlModel("");
44445
44590
  }, "nonvalue");
44446
44591
  _questionfactory__WEBPACK_IMPORTED_MODULE_2__["QuestionFactory"].Instance.registerQuestion("html", function (name) {
@@ -45200,9 +45345,12 @@ var QuestionImagePickerModel = /** @class */ (function (_super) {
45200
45345
  enumerable: false,
45201
45346
  configurable: true
45202
45347
  });
45203
- QuestionImagePickerModel.prototype.isFootChoice = function (_item, _question) {
45348
+ QuestionImagePickerModel.prototype.isBuiltInChoice = function (item, question) {
45204
45349
  return false;
45205
45350
  };
45351
+ QuestionImagePickerModel.prototype.addToVisibleChoices = function (items, isAddAll) {
45352
+ this.addNewItemToVisibleChoices(items, isAddAll);
45353
+ };
45206
45354
  QuestionImagePickerModel.prototype.getSelectBaseRootCss = function () {
45207
45355
  return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_5__["CssClassBuilder"]().append(_super.prototype.getSelectBaseRootCss.call(this)).append(this.cssClasses.rootColumn, this.getCurrentColCount() == 1).toString();
45208
45356
  };
@@ -48356,6 +48504,8 @@ var QuestionMatrixDropdownModelBase = /** @class */ (function (_super) {
48356
48504
  this.collectNestedQuestonsInRows(this.visibleRows, questions, visibleOnly);
48357
48505
  };
48358
48506
  QuestionMatrixDropdownModelBase.prototype.collectNestedQuestonsInRows = function (rows, questions, visibleOnly) {
48507
+ if (!Array.isArray(rows))
48508
+ return;
48359
48509
  rows.forEach(function (row) {
48360
48510
  row.questions.forEach(function (q) { return q.collectNestedQuestions(questions, visibleOnly); });
48361
48511
  });
@@ -49883,7 +50033,7 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_0__["Serializer"].addClass("matrixdropdownc
49883
50033
  "requiredIf:condition",
49884
50034
  "resetValueIf:condition",
49885
50035
  "setValueIf:condition",
49886
- { name: "setValueExpression:expression", visibleIf: function (obj) { return !!obj.setValueIf; } },
50036
+ "setValueExpression:expression",
49887
50037
  {
49888
50038
  name: "showInMultipleColumns:boolean",
49889
50039
  dependsOn: "cellType",
@@ -52027,7 +52177,7 @@ var QuestionMatrixDynamicModel = /** @class */ (function (_super) {
52027
52177
  var lastDelRow = this.lastDeletedRow;
52028
52178
  this.lastDeletedRow = undefined;
52029
52179
  var rows = this.generatedVisibleRows;
52030
- if (!Array.isArray(val) || Math.abs(rows.length - val.length) > 1)
52180
+ if (!Array.isArray(val) || Math.abs(rows.length - val.length) > 1 || rows.length === val.length)
52031
52181
  return false;
52032
52182
  var index = this.getInsertedDeletedIndex(rows, val);
52033
52183
  if (rows.length > val.length) {
@@ -52295,7 +52445,7 @@ var MultipleTextEditorModel = /** @class */ (function (_super) {
52295
52445
  /**
52296
52446
  * A class that describes an item in a [Multiple Textboxes](https://surveyjs.io/form-library/documentation/api-reference/multiple-text-entry-question-model) question.
52297
52447
  *
52298
- * [View Demo](/form-library/examples/multiple-text-box-question/)
52448
+ * [View Demo](https://surveyjs.io/form-library/examples/multiple-text-box-question/)
52299
52449
  */
52300
52450
  var MultipleTextItemModel = /** @class */ (function (_super) {
52301
52451
  __extends(MultipleTextItemModel, _super);
@@ -53776,7 +53926,7 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
53776
53926
  *
53777
53927
  * If you want to customize individual tab titles, handle `SurveyModel`'s [`onGetDynamicPanelTabTitle`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#onGetDynamicPanelTabTitle) event.
53778
53928
  *
53779
- * [View Demo](/form-library/examples/tabbed-interface-for-duplicate-group-option/ (linkStyle))
53929
+ * [View Demo](https://surveyjs.io/form-library/examples/tabbed-interface-for-duplicate-group-option/ (linkStyle))
53780
53930
  * @see templateTitle
53781
53931
  * @see renderMode
53782
53932
  */
@@ -54563,7 +54713,7 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
54563
54713
  * - `"progressTop"` - Renders each panel as a card and displays a progress bar at the top. [View Demo](https://surveyjs.io/form-library/examples/questiontype-paneldynamic/)
54564
54714
  * - `"progressBottom"` - Renders each panel panel as a card and displays a progress bar at the bottom.
54565
54715
  * - `"progressTopBottom"` - Renders each panel as a card and displays a progress bar at the top and bottom.
54566
- * - `"tab"` - Renders each panel within a tab. Use the [`templateTabTitle`](https://surveyjs.io/form-library/documentation/api-reference/dynamic-panel-model#templateTabTitle) to specify a template for tab titles. [View Demo](/form-library/examples/tabbed-interface-for-duplicate-group-option/)
54716
+ * - `"tab"` - Renders each panel within a tab. Use the [`templateTabTitle`](https://surveyjs.io/form-library/documentation/api-reference/dynamic-panel-model#templateTabTitle) to specify a template for tab titles. [View Demo](https://surveyjs.io/form-library/examples/tabbed-interface-for-duplicate-group-option/)
54567
54717
  */
54568
54718
  get: function () {
54569
54719
  return this.getPropertyValue("renderMode");
@@ -57046,7 +57196,7 @@ var QuestionRatingModel = /** @class */ (function (_super) {
57046
57196
  *
57047
57197
  * If you do not specify the `rateValues` property, rate values are generated automatically based upon the [`rateMin`](https://surveyjs.io/form-library/documentation/api-reference/rating-scale-question-model#rateMin), [`rateMax`](https://surveyjs.io/form-library/documentation/api-reference/rating-scale-question-model#rateMax), [`rateStep`](https://surveyjs.io/form-library/documentation/api-reference/rating-scale-question-model#rateStep), and [`rateCount`](https://surveyjs.io/form-library/documentation/api-reference/rating-scale-question-model#rateCount) property values.
57048
57198
  *
57049
- * [View Demo](/form-library/examples/rating-scale/ (linkStyle))
57199
+ * [View Demo](https://surveyjs.io/form-library/examples/rating-scale/ (linkStyle))
57050
57200
  */
57051
57201
  get: function () {
57052
57202
  return this.getPropertyValue("rateValues");
@@ -57064,7 +57214,7 @@ var QuestionRatingModel = /** @class */ (function (_super) {
57064
57214
  *
57065
57215
  * Default value: 1
57066
57216
  *
57067
- * [View Demo](/form-library/examples/rating-scale/ (linkStyle))
57217
+ * [View Demo](https://surveyjs.io/form-library/examples/rating-scale/ (linkStyle))
57068
57218
  * @see rateMax
57069
57219
  * @see rateStep
57070
57220
  * @see rateCount
@@ -57084,7 +57234,7 @@ var QuestionRatingModel = /** @class */ (function (_super) {
57084
57234
  *
57085
57235
  * Default value: 5
57086
57236
  *
57087
- * [View Demo](/form-library/examples/rating-scale/ (linkStyle))
57237
+ * [View Demo](https://surveyjs.io/form-library/examples/rating-scale/ (linkStyle))
57088
57238
  * @see rateMin
57089
57239
  * @see rateStep
57090
57240
  * @see rateCount
@@ -57104,7 +57254,7 @@ var QuestionRatingModel = /** @class */ (function (_super) {
57104
57254
  *
57105
57255
  * Default value: 1
57106
57256
  *
57107
- * [View Demo](/form-library/examples/rating-scale/ (linkStyle))
57257
+ * [View Demo](https://surveyjs.io/form-library/examples/rating-scale/ (linkStyle))
57108
57258
  * @see rateMin
57109
57259
  * @see rateMax
57110
57260
  * @see rateCount
@@ -57702,10 +57852,10 @@ var QuestionRatingModel = /** @class */ (function (_super) {
57702
57852
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])({ defaultValue: false })
57703
57853
  ], QuestionRatingModel.prototype, "inputHasValue", void 0);
57704
57854
  __decorate([
57705
- Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])({ defaultValue: true })
57855
+ Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])()
57706
57856
  ], QuestionRatingModel.prototype, "autoGenerate", void 0);
57707
57857
  __decorate([
57708
- Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])({ defaultValue: 5 })
57858
+ Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])()
57709
57859
  ], QuestionRatingModel.prototype, "rateCount", void 0);
57710
57860
  __decorate([
57711
57861
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["propertyArray"])()
@@ -57717,11 +57867,10 @@ var QuestionRatingModel = /** @class */ (function (_super) {
57717
57867
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])({ defaultValue: false })
57718
57868
  ], QuestionRatingModel.prototype, "hasMaxRateDescription", void 0);
57719
57869
  __decorate([
57720
- Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])({ defaultValue: false })
57870
+ Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])()
57721
57871
  ], QuestionRatingModel.prototype, "displayRateDescriptionsAsExtremeItems", void 0);
57722
57872
  __decorate([
57723
57873
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])({
57724
- defaultValue: "auto",
57725
57874
  onSet: function (val, target) {
57726
57875
  if (!target.isDesignMode) {
57727
57876
  if (val === "dropdown") {
@@ -57735,13 +57884,13 @@ var QuestionRatingModel = /** @class */ (function (_super) {
57735
57884
  })
57736
57885
  ], QuestionRatingModel.prototype, "displayMode", void 0);
57737
57886
  __decorate([
57738
- Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])({ defaultValue: "labels" })
57887
+ Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])()
57739
57888
  ], QuestionRatingModel.prototype, "rateType", void 0);
57740
57889
  __decorate([
57741
- Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])({ defaultValue: "monochrome" })
57890
+ Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])()
57742
57891
  ], QuestionRatingModel.prototype, "scaleColorMode", void 0);
57743
57892
  __decorate([
57744
- Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])({ defaultValue: "scale" })
57893
+ Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])()
57745
57894
  ], QuestionRatingModel.prototype, "rateColorMode", void 0);
57746
57895
  return QuestionRatingModel;
57747
57896
  }(_question__WEBPACK_IMPORTED_MODULE_1__["Question"]));
@@ -57890,12 +58039,11 @@ _questionfactory__WEBPACK_IMPORTED_MODULE_3__["QuestionFactory"].Instance.regist
57890
58039
  /*!**************************************!*\
57891
58040
  !*** ./src/question_signaturepad.ts ***!
57892
58041
  \**************************************/
57893
- /*! exports provided: getCanvasRatio, QuestionSignaturePadModel */
58042
+ /*! exports provided: QuestionSignaturePadModel */
57894
58043
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
57895
58044
 
57896
58045
  "use strict";
57897
58046
  __webpack_require__.r(__webpack_exports__);
57898
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getCanvasRatio", function() { return getCanvasRatio; });
57899
58047
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "QuestionSignaturePadModel", function() { return QuestionSignaturePadModel; });
57900
58048
  /* harmony import */ var _jsonobject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./jsonobject */ "./src/jsonobject.ts");
57901
58049
  /* harmony import */ var _questionfactory__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./questionfactory */ "./src/questionfactory.ts");
@@ -57932,28 +58080,6 @@ var __decorate = (undefined && undefined.__decorate) || function (decorators, ta
57932
58080
 
57933
58081
  var defaultWidth = 300;
57934
58082
  var defaultHeight = 200;
57935
- function getCanvasRatio(canvas) {
57936
- var context = canvas.getContext("2d");
57937
- var devicePixelRatio = window.devicePixelRatio || 1;
57938
- var backingStoreRatio = context.webkitBackingStorePixelRatio ||
57939
- context.mozBackingStorePixelRatio ||
57940
- context.msBackingStorePixelRatio ||
57941
- context.oBackingStorePixelRatio ||
57942
- context.backingStorePixelRatio ||
57943
- 1;
57944
- return devicePixelRatio / backingStoreRatio;
57945
- }
57946
- function resizeCanvas(canvas) {
57947
- var context = canvas.getContext("2d");
57948
- var ratio = getCanvasRatio(canvas);
57949
- var oldWidth = canvas.width;
57950
- var oldHeight = canvas.height;
57951
- canvas.width = oldWidth * ratio;
57952
- canvas.height = oldHeight * ratio;
57953
- canvas.style.width = oldWidth + "px";
57954
- canvas.style.height = oldHeight + "px";
57955
- context.scale(ratio, ratio);
57956
- }
57957
58083
  /**
57958
58084
  * A class that describes the Signature question type.
57959
58085
  *
@@ -57962,7 +58088,13 @@ function resizeCanvas(canvas) {
57962
58088
  var QuestionSignaturePadModel = /** @class */ (function (_super) {
57963
58089
  __extends(QuestionSignaturePadModel, _super);
57964
58090
  function QuestionSignaturePadModel(name) {
57965
- return _super.call(this, name) || this;
58091
+ var _this = _super.call(this, name) || this;
58092
+ _this.valueIsUpdatingInternally = false;
58093
+ _this.updateValueHandler = function () {
58094
+ _this.scaleCanvas(false, true);
58095
+ _this.refreshCanvas();
58096
+ };
58097
+ return _this;
57966
58098
  }
57967
58099
  QuestionSignaturePadModel.prototype.getPenColorFromTheme = function () {
57968
58100
  var _survey = this.survey;
@@ -57988,7 +58120,9 @@ var QuestionSignaturePadModel = /** @class */ (function (_super) {
57988
58120
  var format = this.dataFormat === "jpeg" ? "image/jpeg" :
57989
58121
  (this.dataFormat === "svg" ? "image/svg+xml" : "");
57990
58122
  var data = this.signaturePad.toDataURL(format);
58123
+ this.valueIsUpdatingInternally = true;
57991
58124
  this.value = data;
58125
+ this.valueIsUpdatingInternally = false;
57992
58126
  }
57993
58127
  };
57994
58128
  QuestionSignaturePadModel.prototype.getType = function () {
@@ -58010,10 +58144,44 @@ var QuestionSignaturePadModel = /** @class */ (function (_super) {
58010
58144
  this.updateColors(this.signaturePad);
58011
58145
  }
58012
58146
  };
58147
+ QuestionSignaturePadModel.prototype.resizeCanvas = function () {
58148
+ this.canvas.width = this.containerWidth;
58149
+ this.canvas.height = this.containerHeight;
58150
+ };
58151
+ QuestionSignaturePadModel.prototype.scaleCanvas = function (refresh, resize) {
58152
+ if (refresh === void 0) { refresh = true; }
58153
+ if (resize === void 0) { resize = false; }
58154
+ var canvas = this.canvas;
58155
+ var scale = canvas.offsetWidth / this.containerWidth;
58156
+ if (this.scale != scale || resize) {
58157
+ this.scale = scale;
58158
+ canvas.style.width = this.renderedCanvasWidth;
58159
+ this.resizeCanvas();
58160
+ this.signaturePad.minWidth = this.penMinWidth * scale;
58161
+ this.signaturePad.maxWidth = this.penMaxWidth * scale;
58162
+ canvas.getContext("2d").scale(1 / scale, 1 / scale);
58163
+ if (refresh)
58164
+ this.refreshCanvas();
58165
+ }
58166
+ };
58167
+ QuestionSignaturePadModel.prototype.refreshCanvas = function () {
58168
+ var data = this.value;
58169
+ var canvas = this.canvas;
58170
+ if (!data) {
58171
+ canvas.getContext("2d").clearRect(0, 0, canvas.width * this.scale, canvas.height * this.scale);
58172
+ this.signaturePad.clear();
58173
+ }
58174
+ else {
58175
+ this.signaturePad.fromDataURL(data, { width: canvas.width * this.scale, height: canvas.height * this.scale });
58176
+ }
58177
+ };
58013
58178
  QuestionSignaturePadModel.prototype.initSignaturePad = function (el) {
58014
58179
  var _this = this;
58015
58180
  var canvas = el.getElementsByTagName("canvas")[0];
58181
+ this.canvas = canvas;
58182
+ this.resizeCanvas();
58016
58183
  var signaturePad = new signature_pad__WEBPACK_IMPORTED_MODULE_3__["default"](canvas, { backgroundColor: "#ffffff" });
58184
+ this.signaturePad = signaturePad;
58017
58185
  if (this.isInputReadOnly) {
58018
58186
  signaturePad.off();
58019
58187
  }
@@ -58027,6 +58195,7 @@ var QuestionSignaturePadModel = /** @class */ (function (_super) {
58027
58195
  };
58028
58196
  this.updateColors(signaturePad);
58029
58197
  signaturePad.addEventListener("beginStroke", function () {
58198
+ _this.scaleCanvas();
58030
58199
  _this.isDrawingValue = true;
58031
58200
  canvas.focus();
58032
58201
  }, { once: false });
@@ -58034,24 +58203,12 @@ var QuestionSignaturePadModel = /** @class */ (function (_super) {
58034
58203
  _this.isDrawingValue = false;
58035
58204
  _this.updateValue();
58036
58205
  }, { once: false });
58037
- var updateValueHandler = function () {
58038
- var data = _this.value;
58039
- canvas.width = _this.signatureWidth || defaultWidth;
58040
- canvas.height = _this.signatureHeight || defaultHeight;
58041
- resizeCanvas(canvas);
58042
- if (!data) {
58043
- signaturePad.clear();
58044
- }
58045
- else {
58046
- signaturePad.fromDataURL(data);
58047
- }
58048
- };
58049
- updateValueHandler();
58206
+ this.updateValueHandler();
58050
58207
  this.readOnlyChangedCallback();
58051
- this.signaturePad = signaturePad;
58052
58208
  var propertyChangedHandler = function (sender, options) {
58053
58209
  if (options.name === "signatureWidth" || options.name === "signatureHeight" || options.name === "value") {
58054
- updateValueHandler();
58210
+ if (!_this.valueIsUpdatingInternally)
58211
+ _this.updateValueHandler();
58055
58212
  }
58056
58213
  };
58057
58214
  this.onPropertyChanged.add(propertyChangedHandler);
@@ -58110,6 +58267,27 @@ var QuestionSignaturePadModel = /** @class */ (function (_super) {
58110
58267
  enumerable: false,
58111
58268
  configurable: true
58112
58269
  });
58270
+ Object.defineProperty(QuestionSignaturePadModel.prototype, "containerHeight", {
58271
+ get: function () {
58272
+ return this.signatureHeight || defaultHeight;
58273
+ },
58274
+ enumerable: false,
58275
+ configurable: true
58276
+ });
58277
+ Object.defineProperty(QuestionSignaturePadModel.prototype, "containerWidth", {
58278
+ get: function () {
58279
+ return this.signatureWidth || defaultWidth;
58280
+ },
58281
+ enumerable: false,
58282
+ configurable: true
58283
+ });
58284
+ Object.defineProperty(QuestionSignaturePadModel.prototype, "renderedCanvasWidth", {
58285
+ get: function () {
58286
+ return this.signatureAutoScaleEnabled ? "100%" : this.containerWidth + "px";
58287
+ },
58288
+ enumerable: false,
58289
+ configurable: true
58290
+ });
58113
58291
  Object.defineProperty(QuestionSignaturePadModel.prototype, "height", {
58114
58292
  //todo: need to remove this property
58115
58293
  get: function () {
@@ -58230,6 +58408,15 @@ var QuestionSignaturePadModel = /** @class */ (function (_super) {
58230
58408
  __decorate([
58231
58409
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])({ defaultValue: false })
58232
58410
  ], QuestionSignaturePadModel.prototype, "isDrawingValue", void 0);
58411
+ __decorate([
58412
+ Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])()
58413
+ ], QuestionSignaturePadModel.prototype, "signatureAutoScaleEnabled", void 0);
58414
+ __decorate([
58415
+ Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])()
58416
+ ], QuestionSignaturePadModel.prototype, "penMinWidth", void 0);
58417
+ __decorate([
58418
+ Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])()
58419
+ ], QuestionSignaturePadModel.prototype, "penMaxWidth", void 0);
58233
58420
  __decorate([
58234
58421
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])({})
58235
58422
  ], QuestionSignaturePadModel.prototype, "showPlaceholder", void 0);
@@ -58258,6 +58445,21 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_0__["Serializer"].addClass("signaturepad",
58258
58445
  category: "general",
58259
58446
  default: 200,
58260
58447
  },
58448
+ {
58449
+ name: "signatureAutoScaleEnabled:boolean",
58450
+ category: "general",
58451
+ default: false,
58452
+ },
58453
+ {
58454
+ name: "penMinWidth:number",
58455
+ category: "general",
58456
+ default: 0.5,
58457
+ },
58458
+ {
58459
+ name: "penMaxWidth:number",
58460
+ category: "general",
58461
+ default: 2.5,
58462
+ },
58261
58463
  //need to remove this property
58262
58464
  {
58263
58465
  name: "height:number",
@@ -58564,7 +58766,6 @@ var QuestionTagboxModel = /** @class */ (function (_super) {
58564
58766
  ], QuestionTagboxModel.prototype, "allowClear", void 0);
58565
58767
  __decorate([
58566
58768
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])({
58567
- defaultValue: true,
58568
58769
  onSet: function (newValue, target) {
58569
58770
  if (!!target.dropdownListModel) {
58570
58771
  target.dropdownListModel.setSearchEnabled(newValue);
@@ -58585,7 +58786,7 @@ var QuestionTagboxModel = /** @class */ (function (_super) {
58585
58786
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])()
58586
58787
  ], QuestionTagboxModel.prototype, "choicesLazyLoadEnabled", void 0);
58587
58788
  __decorate([
58588
- Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])({ defaultValue: 25 })
58789
+ Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])()
58589
58790
  ], QuestionTagboxModel.prototype, "choicesLazyLoadPageSize", void 0);
58590
58791
  __decorate([
58591
58792
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])({ getDefaultValue: function () { return _settings__WEBPACK_IMPORTED_MODULE_5__["settings"].tagboxCloseOnSelect; } })
@@ -59627,6 +59828,8 @@ __webpack_require__.r(__webpack_exports__);
59627
59828
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ElementFactory", function() { return ElementFactory; });
59628
59829
  /* harmony import */ var _surveyStrings__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./surveyStrings */ "./src/surveyStrings.ts");
59629
59830
  /* harmony import */ var _jsonobject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./jsonobject */ "./src/jsonobject.ts");
59831
+ /* harmony import */ var _question_custom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./question_custom */ "./src/question_custom.ts");
59832
+
59630
59833
 
59631
59834
 
59632
59835
  var QuestionFactory = /** @class */ (function () {
@@ -59728,6 +59931,9 @@ var ElementFactory = /** @class */ (function () {
59728
59931
  var creator = this.creatorHash[elementType];
59729
59932
  if (!!creator)
59730
59933
  return creator(name);
59934
+ var compJSON = _question_custom__WEBPACK_IMPORTED_MODULE_2__["ComponentCollection"].Instance.getCustomQuestionByName(elementType);
59935
+ if (!!compJSON)
59936
+ return _question_custom__WEBPACK_IMPORTED_MODULE_2__["ComponentCollection"].Instance.createQuestion(name, compJSON);
59731
59937
  return null;
59732
59938
  };
59733
59939
  ElementFactory.Instance = new ElementFactory();
@@ -60291,7 +60497,7 @@ var SurveyActionBarItem = /** @class */ (function (_super) {
60291
60497
  var title = this.item.tooltip || this.item.title;
60292
60498
  var buttonContent = this.renderButtonContent();
60293
60499
  var tabIndex = this.item.disableTabStop ? -1 : undefined;
60294
- var button = Object(_reactSurvey__WEBPACK_IMPORTED_MODULE_3__["attachKey2click"])(react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("button", { className: className, type: "button", disabled: this.item.disabled, onClick: function (args) { return _this.item.action(_this.item, _this.item.getIsTrusted(args)); }, title: title, tabIndex: tabIndex, "aria-checked": this.item.ariaChecked, "aria-expanded": this.item.ariaExpanded, role: this.item.ariaRole }, buttonContent), null, { processEsc: false });
60500
+ var button = Object(_reactSurvey__WEBPACK_IMPORTED_MODULE_3__["attachKey2click"])(react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("button", { className: className, type: "button", disabled: this.item.disabled, onClick: function (args) { return _this.item.action(_this.item, _this.item.getIsTrusted(args)); }, title: title, tabIndex: tabIndex, "aria-checked": this.item.ariaChecked, "aria-expanded": this.item.ariaExpanded, role: this.item.ariaRole }, buttonContent), this.item, { processEsc: false });
60295
60501
  return button;
60296
60502
  };
60297
60503
  return SurveyActionBarItem;
@@ -62627,7 +62833,7 @@ var SvgIcon = /** @class */ (function (_super) {
62627
62833
  className += " " + this.props.className;
62628
62834
  }
62629
62835
  return (this.props.iconName ?
62630
- 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 },
62836
+ react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("svg", { className: className, style: this.props.style, onClick: this.props.onClick, ref: this.svgIconRef, role: "img" },
62631
62837
  react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("use", null))
62632
62838
  : null);
62633
62839
  };
@@ -63093,7 +63299,7 @@ var SurveyQuestionDropdownBase = /** @class */ (function (_super) {
63093
63299
  dropdownListModel.inputStringRendered = e.target.value;
63094
63300
  }
63095
63301
  };
63096
- return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { id: this.question.inputId, className: this.question.getControlClass(), tabIndex: dropdownListModel.inputReadOnly ? undefined : 0,
63302
+ return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { id: this.question.inputId, className: this.question.getControlClass(), tabIndex: dropdownListModel.noTabIndex ? undefined : 0,
63097
63303
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
63098
63304
  // @ts-ignore
63099
63305
  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 },
@@ -63106,20 +63312,20 @@ var SurveyQuestionDropdownBase = /** @class */ (function (_super) {
63106
63312
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", { style: { visibility: "hidden" }, "data-bind": "text: model.filterString" }, dropdownListModel.inputStringRendered),
63107
63313
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", null, dropdownListModel.hintStringSuffix))) : null,
63108
63314
  valueElement,
63109
- 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 })),
63315
+ 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 })),
63110
63316
  this.createClearButton()));
63111
63317
  };
63112
63318
  SurveyQuestionDropdownBase.prototype.createClearButton = function () {
63113
63319
  if (!this.question.allowClear || !this.question.cssClasses.cleanButtonIconId)
63114
63320
  return null;
63115
63321
  var style = { display: !this.question.showClearButton ? "none" : "" };
63116
- return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.question.cssClasses.cleanButton, style: style, onClick: this.clear },
63322
+ return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.question.cssClasses.cleanButton, style: style, onClick: this.clear, tabIndex: this.question.showClearButton ? 0 : -1 },
63117
63323
  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" })));
63118
63324
  };
63119
63325
  SurveyQuestionDropdownBase.prototype.createChevronButton = function () {
63120
63326
  if (!this.question.cssClasses.chevronButtonIconId)
63121
63327
  return null;
63122
- return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.question.cssClasses.chevronButton, onPointerDown: this.chevronPointerDown },
63328
+ return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.question.cssClasses.chevronButton, "aria-hidden": "true", onPointerDown: this.chevronPointerDown },
63123
63329
  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" })));
63124
63330
  };
63125
63331
  SurveyQuestionDropdownBase.prototype.renderOther = function (cssClasses) {
@@ -66095,6 +66301,9 @@ var SurveyQuestionCommentItem = /** @class */ (function (_super) {
66095
66301
  SurveyQuestionCommentItem.prototype.onCommentInput = function (event) {
66096
66302
  this.props.question.onCommentInput(event);
66097
66303
  };
66304
+ SurveyQuestionCommentItem.prototype.onCommentCompositionUpdate = function (event) {
66305
+ this.props.question.onCompositionUpdateComment(event);
66306
+ };
66098
66307
  SurveyQuestionCommentItem.prototype.getComment = function () {
66099
66308
  return this.props.question.comment;
66100
66309
  };
@@ -66121,7 +66330,7 @@ var SurveyQuestionCommentItem = /** @class */ (function (_super) {
66121
66330
  if (question.isReadOnlyRenderDiv()) {
66122
66331
  return react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", null, comment);
66123
66332
  }
66124
- return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("textarea", { id: this.getId(), className: className, value: comment, disabled: this.isDisplayMode, maxLength: question.getOthersMaxLength(), placeholder: this.getPlaceholder(), onChange: handleOnChange, onBlur: function (e) { _this.onCommentChange(e); handleOnChange(e); }, onInput: function (e) { return _this.onCommentInput(e); }, "aria-required": question.isRequired || question.a11y_input_ariaRequired, "aria-label": question.ariaLabel || question.a11y_input_ariaLabel, style: { resize: question.resizeStyle } }));
66333
+ return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("textarea", { id: this.getId(), className: className, value: comment, disabled: this.isDisplayMode, maxLength: question.getOthersMaxLength(), placeholder: this.getPlaceholder(), onChange: handleOnChange, onBlur: function (e) { _this.onCommentChange(e); handleOnChange(e); }, onInput: function (e) { return _this.onCommentInput(e); }, onCompositionUpdate: function (e) { return _this.onCommentCompositionUpdate(e); }, "aria-required": question.isRequired || question.a11y_input_ariaRequired, "aria-label": question.ariaLabel || question.a11y_input_ariaLabel, style: { resize: question.resizeStyle } }));
66125
66334
  };
66126
66335
  return SurveyQuestionCommentItem;
66127
66336
  }(_reactquestion_element__WEBPACK_IMPORTED_MODULE_1__["ReactSurveyElement"]));
@@ -66137,6 +66346,9 @@ var SurveyQuestionOtherValueItem = /** @class */ (function (_super) {
66137
66346
  SurveyQuestionOtherValueItem.prototype.onCommentInput = function (event) {
66138
66347
  this.props.question.onOtherValueInput(event);
66139
66348
  };
66349
+ SurveyQuestionOtherValueItem.prototype.onCommentCompositionUpdate = function (event) {
66350
+ this.props.question.onCompositionUpdateOtherValue(event);
66351
+ };
66140
66352
  SurveyQuestionOtherValueItem.prototype.getComment = function () {
66141
66353
  return this.props.question.otherValue;
66142
66354
  };
@@ -67195,7 +67407,7 @@ var SurveyQuestionMatrixRow = /** @class */ (function (_super) {
67195
67407
  else {
67196
67408
  td = (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("td", { key: key, "data-responsive-title": column.locText.renderedHtml, className: this.question.cssClasses.cell },
67197
67409
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("label", { onMouseDown: this.handleOnMouseDown, className: itemClass },
67198
- 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 }),
67410
+ 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": this.question.getCellAriaLabel(row.locText.renderedHtml, column.locText.renderedHtml), "aria-invalid": this.question.ariaInvalid, "aria-describedby": this.question.ariaDescribedBy }),
67199
67411
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", { className: this.question.cssClasses.materialDecorator }, this.question.itemSvgIcon ?
67200
67412
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("svg", { className: this.cssClasses.itemDecorator },
67201
67413
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("use", { xlinkHref: this.question.itemSvgIcon })) :
@@ -68744,7 +68956,7 @@ var SurveyQuestionTagbox = /** @class */ (function (_super) {
68744
68956
  var _this = this;
68745
68957
  var dropdownMultiSelectListModel = dropdownListModel;
68746
68958
  var items = this.question.selectedChoices.map(function (choice, index) { return _this.renderItem("item" + index, choice); });
68747
- return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { id: this.question.inputId, className: this.question.getControlClass(), tabIndex: dropdownListModel.inputReadOnly ? undefined : 0,
68959
+ return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { id: this.question.inputId, className: this.question.getControlClass(), tabIndex: dropdownListModel.noTabIndex ? undefined : 0,
68748
68960
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
68749
68961
  // @ts-ignore
68750
68962
  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 },
@@ -69211,7 +69423,7 @@ var SurveyQuestionSignaturePad = /** @class */ (function (_super) {
69211
69423
  var _this = this;
69212
69424
  var cssClasses = this.question.cssClasses;
69213
69425
  var clearButton = this.renderCleanButton();
69214
- return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: cssClasses.root, ref: function (root) { return (_this.setControl(root)); }, style: { height: this.question.signatureHeight, width: this.question.signatureWidth } },
69426
+ return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: cssClasses.root, ref: function (root) { return (_this.setControl(root)); }, style: { width: this.question.renderedCanvasWidth } },
69215
69427
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: cssClasses.placeholder, style: { display: this.question.needShowPlaceholder() ? "" : "none" } }, this.renderLocString(this.question.locPlaceholder)),
69216
69428
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", null,
69217
69429
  this.renderBackgroundImage(),
@@ -69221,7 +69433,7 @@ var SurveyQuestionSignaturePad = /** @class */ (function (_super) {
69221
69433
  SurveyQuestionSignaturePad.prototype.renderBackgroundImage = function () {
69222
69434
  if (!this.question.backgroundImage)
69223
69435
  return null;
69224
- return react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("img", { className: this.question.cssClasses.backgroundImage, src: this.question.backgroundImage, width: this.question.signatureWidth, height: this.question.signatureHeight });
69436
+ return react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("img", { className: this.question.cssClasses.backgroundImage, src: this.question.backgroundImage, style: { width: this.question.renderedCanvasWidth } });
69225
69437
  };
69226
69438
  SurveyQuestionSignaturePad.prototype.renderCleanButton = function () {
69227
69439
  var _this = this;
@@ -69535,7 +69747,7 @@ var TagboxFilterString = /** @class */ (function (_super) {
69535
69747
  (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.question.cssClasses.hintSuffix },
69536
69748
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", { style: { visibility: "hidden" }, "data-bind": "text: model.filterString" }, this.model.inputStringRendered),
69537
69749
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", null, this.model.hintStringSuffix))) : null,
69538
- 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); } }))));
69750
+ 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); } }))));
69539
69751
  };
69540
69752
  return TagboxFilterString;
69541
69753
  }(_reactquestion_element__WEBPACK_IMPORTED_MODULE_3__["SurveyElementBase"]));
@@ -70229,6 +70441,11 @@ var settings = {
70229
70441
  * Default value: `"none"`
70230
70442
  */
70231
70443
  noneItemValue: "none",
70444
+ specialChoicesOrder: {
70445
+ selectAllItem: [-1],
70446
+ noneItem: [1],
70447
+ otherItem: [2]
70448
+ },
70232
70449
  /**
70233
70450
  * A list of supported validators by question type.
70234
70451
  */
@@ -72581,16 +72798,16 @@ var SurveyModel = /** @class */ (function (_super) {
72581
72798
  *
72582
72799
  * For information on event handler parameters, refer to descriptions within the interface.
72583
72800
  *
72584
- * [View Demo](/form-library/examples/customize-survey-with-css/ (linkStyle))
72801
+ * [View Demo](https://surveyjs.io/form-library/examples/customize-survey-with-css/ (linkStyle))
72585
72802
  * @see css
72586
72803
  */
72587
72804
  _this.onUpdateQuestionCssClasses = _this.addEvent();
72588
72805
  /**
72589
- * An event that is raised before rendering a standalone panel and panels within [Dynamic Panel](/form-library/examples/duplicate-group-of-fields-in-form/). Use it to override default panel CSS classes.
72806
+ * An event that is raised before rendering a standalone panel and panels within [Dynamic Panel](https://surveyjs.io/form-library/examples/duplicate-group-of-fields-in-form/). Use it to override default panel CSS classes.
72590
72807
  *
72591
72808
  * For information on event handler parameters, refer to descriptions within the interface.
72592
72809
  *
72593
- * [View Demo](/form-library/examples/customize-survey-with-css/ (linkStyle))
72810
+ * [View Demo](https://surveyjs.io/form-library/examples/customize-survey-with-css/ (linkStyle))
72594
72811
  * @see css
72595
72812
  */
72596
72813
  _this.onUpdatePanelCssClasses = _this.addEvent();
@@ -72599,7 +72816,7 @@ var SurveyModel = /** @class */ (function (_super) {
72599
72816
  *
72600
72817
  * For information on event handler parameters, refer to descriptions within the interface.
72601
72818
  *
72602
- * [View Demo](/form-library/examples/customize-survey-with-css/ (linkStyle))
72819
+ * [View Demo](https://surveyjs.io/form-library/examples/customize-survey-with-css/ (linkStyle))
72603
72820
  * @see css
72604
72821
  */
72605
72822
  _this.onUpdatePageCssClasses = _this.addEvent();
@@ -72608,7 +72825,7 @@ var SurveyModel = /** @class */ (function (_super) {
72608
72825
  *
72609
72826
  * For information on event handler parameters, refer to descriptions within the interface.
72610
72827
  *
72611
- * [View Demo](/form-library/examples/customize-survey-with-css/ (linkStyle))
72828
+ * [View Demo](https://surveyjs.io/form-library/examples/customize-survey-with-css/ (linkStyle))
72612
72829
  * @see css
72613
72830
  */
72614
72831
  _this.onUpdateChoiceItemCss = _this.addEvent();
@@ -72700,7 +72917,7 @@ var SurveyModel = /** @class */ (function (_super) {
72700
72917
  */
72701
72918
  _this.onMatrixRowAdding = _this.addEvent();
72702
72919
  /**
72703
- * This event is obsolete. Use the [`onMatrixRowAdding`](/form-library/documentation/api-reference/survey-data-model#onMatrixRowAdding) event instead.
72920
+ * This event is obsolete. Use the [`onMatrixRowAdding`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#onMatrixRowAdding) event instead.
72704
72921
  */
72705
72922
  _this.onMatrixBeforeRowAdded = _this.onMatrixRowAdding;
72706
72923
  /**
@@ -72720,7 +72937,7 @@ var SurveyModel = /** @class */ (function (_super) {
72720
72937
  */
72721
72938
  _this.onMatrixRenderRemoveButton = _this.addEvent();
72722
72939
  /**
72723
- * This event is obsolete. Use the [`onMatrixRenderRemoveButton`](/form-library/documentation/api-reference/survey-data-model#onMatrixRenderRemoveButton) event instead.
72940
+ * This event is obsolete. Use the [`onMatrixRenderRemoveButton`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#onMatrixRenderRemoveButton) event instead.
72724
72941
  */
72725
72942
  _this.onMatrixAllowRemoveRow = _this.onMatrixRenderRemoveButton;
72726
72943
  /**
@@ -72739,7 +72956,7 @@ var SurveyModel = /** @class */ (function (_super) {
72739
72956
  */
72740
72957
  _this.onAfterRenderMatrixCell = _this.addEvent();
72741
72958
  /**
72742
- * This event is obsolete. Use the [`onAfterRenderMatrixCell`](/form-library/documentation/api-reference/survey-data-model#onAfterRenderMatrixCell) event instead.
72959
+ * This event is obsolete. Use the [`onAfterRenderMatrixCell`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#onAfterRenderMatrixCell) event instead.
72743
72960
  */
72744
72961
  _this.onMatrixAfterCellRender = _this.onAfterRenderMatrixCell;
72745
72962
  /**
@@ -72797,7 +73014,7 @@ var SurveyModel = /** @class */ (function (_super) {
72797
73014
  *
72798
73015
  * For information on event handler parameters, refer to descriptions within the interface.
72799
73016
  *
72800
- * [View Demo](/form-library/examples/tabbed-interface-for-duplicate-group-option/ (linkStyle))
73017
+ * [View Demo](https://surveyjs.io/form-library/examples/tabbed-interface-for-duplicate-group-option/ (linkStyle))
72801
73018
  */
72802
73019
  _this.onGetDynamicPanelTabTitle = _this.addEvent();
72803
73020
  /**
@@ -73226,7 +73443,7 @@ var SurveyModel = /** @class */ (function (_super) {
73226
73443
  /**
73227
73444
  * Gets or sets an object in which keys are UI elements and values are CSS classes applied to them.
73228
73445
  *
73229
- * [View Demo](/form-library/examples/customize-survey-with-css/ (linkStyle))
73446
+ * [View Demo](https://surveyjs.io/form-library/examples/customize-survey-with-css/ (linkStyle))
73230
73447
  */
73231
73448
  get: function () {
73232
73449
  if (!this.cssValue) {
@@ -75886,13 +76103,13 @@ var SurveyModel = /** @class */ (function (_super) {
75886
76103
  }
75887
76104
  this.setPropertyValue("completedStateText", text);
75888
76105
  if (this.state === "completed" && this.showCompletedPage && !!this.completedState) {
75889
- this.notify(this.completedStateText, this.completedState, true);
76106
+ this.notify(this.completedStateText, this.completedState, value === "error");
75890
76107
  }
75891
76108
  };
75892
76109
  SurveyModel.prototype.notify = function (message, type, showActions) {
75893
76110
  if (showActions === void 0) { showActions = false; }
75894
76111
  this.notifier.showActions = showActions;
75895
- this.notifier.notify(message, type, type === "error");
76112
+ this.notifier.notify(message, type, showActions);
75896
76113
  };
75897
76114
  /**
75898
76115
  * 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"`.
@@ -76682,7 +76899,7 @@ var SurveyModel = /** @class */ (function (_super) {
76682
76899
  }
76683
76900
  else {
76684
76901
  if (this.runningPages) {
76685
- this.restoreOrigionalPages(this.runningPages);
76902
+ this.restoreOriginalPages(this.runningPages);
76686
76903
  }
76687
76904
  this.runningPages = undefined;
76688
76905
  }
@@ -76710,7 +76927,7 @@ var SurveyModel = /** @class */ (function (_super) {
76710
76927
  return;
76711
76928
  if (this.questionsOnPageMode == "standard" || this.isDesignMode) {
76712
76929
  if (this.origionalPages) {
76713
- this.restoreOrigionalPages(this.origionalPages);
76930
+ this.restoreOriginalPages(this.origionalPages);
76714
76931
  }
76715
76932
  this.origionalPages = undefined;
76716
76933
  }
@@ -76723,11 +76940,13 @@ var SurveyModel = /** @class */ (function (_super) {
76723
76940
  this.runConditions();
76724
76941
  this.updateVisibleIndexes();
76725
76942
  };
76726
- SurveyModel.prototype.restoreOrigionalPages = function (originalPages) {
76943
+ SurveyModel.prototype.restoreOriginalPages = function (originalPages) {
76727
76944
  this.questionHashesClear();
76728
76945
  this.pages.splice(0, this.pages.length);
76729
76946
  for (var i = 0; i < originalPages.length; i++) {
76730
- this.pages.push(originalPages[i]);
76947
+ var page = originalPages[i];
76948
+ page.setWasShown(false);
76949
+ this.pages.push(page);
76731
76950
  }
76732
76951
  };
76733
76952
  SurveyModel.prototype.getPageStartIndex = function () {
@@ -80043,8 +80262,8 @@ var SurveyModel = /** @class */ (function (_super) {
80043
80262
  /**
80044
80263
  * Applies a specified theme to the survey.
80045
80264
  *
80046
- * [Themes & Styles](/form-library/documentation/manage-default-themes-and-styles (linkStyle))
80047
- * @param theme An [`ITheme`](/form-library/documentation/api-reference/itheme) object with theme settings.
80265
+ * [Themes & Styles](https://surveyjs.io/form-library/documentation/manage-default-themes-and-styles (linkStyle))
80266
+ * @param theme An [`ITheme`](https://surveyjs.io/form-library/documentation/api-reference/itheme) object with theme settings.
80048
80267
  */
80049
80268
  SurveyModel.prototype.applyTheme = function (theme) {
80050
80269
  var _this = this;