survey-react 1.12.29 → 1.12.31

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.12.29
2
+ * surveyjs - Survey JavaScript library v1.12.31
3
3
  * Copyright (c) 2015-2025 Devsoft Baltic OÜ - http://surveyjs.io/
4
4
  * License: MIT (http://www.opensource.org/licenses/mit-license.php)
5
5
  */
@@ -2101,6 +2101,11 @@ var DomWindowHelper = /** @class */ (function () {
2101
2101
  return null;
2102
2102
  return window.innerHeight;
2103
2103
  };
2104
+ DomWindowHelper.getDevicePixelRatio = function () {
2105
+ if (!DomWindowHelper.isAvailable())
2106
+ return null;
2107
+ return window.devicePixelRatio;
2108
+ };
2104
2109
  DomWindowHelper.getWindow = function () {
2105
2110
  if (!DomWindowHelper.isAvailable())
2106
2111
  return;
@@ -2258,12 +2263,12 @@ var helpers_Helpers = /** @class */ (function () {
2258
2263
  }
2259
2264
  return true;
2260
2265
  };
2261
- Helpers.isArraysEqual = function (x, y, ignoreOrder, caseSensitive, trimStrings) {
2262
- if (ignoreOrder === void 0) { ignoreOrder = false; }
2266
+ Helpers.checkIfArraysEqual = function (x, y, params) {
2263
2267
  if (!Array.isArray(x) || !Array.isArray(y))
2264
2268
  return false;
2265
2269
  if (x.length !== y.length)
2266
2270
  return false;
2271
+ var ignoreOrder = params.ignoreOrder !== undefined ? params.ignoreOrder : false;
2267
2272
  if (ignoreOrder) {
2268
2273
  var xSorted = [];
2269
2274
  var ySorted = [];
@@ -2277,11 +2282,15 @@ var helpers_Helpers = /** @class */ (function () {
2277
2282
  y = ySorted;
2278
2283
  }
2279
2284
  for (var i = 0; i < x.length; i++) {
2280
- if (!Helpers.isTwoValueEquals(x[i], y[i], ignoreOrder, caseSensitive, trimStrings))
2285
+ if (!Helpers.checkIfValuesEqual(x[i], y[i], params))
2281
2286
  return false;
2282
2287
  }
2283
2288
  return true;
2284
2289
  };
2290
+ Helpers.isArraysEqual = function (x, y, ignoreOrder, caseSensitive, trimStrings) {
2291
+ if (ignoreOrder === void 0) { ignoreOrder = false; }
2292
+ return Helpers.checkIfArraysEqual(x, y, { ignoreOrder: ignoreOrder, caseSensitive: caseSensitive, trimStrings: trimStrings });
2293
+ };
2285
2294
  Helpers.compareStrings = function (x, y) {
2286
2295
  var normalize = settings.comparator.normalizeTextCallback;
2287
2296
  if (!!x)
@@ -2314,8 +2323,7 @@ var helpers_Helpers = /** @class */ (function () {
2314
2323
  }
2315
2324
  return x > y ? 1 : -1;
2316
2325
  };
2317
- Helpers.isTwoValueEquals = function (x, y, ignoreOrder, caseSensitive, trimStrings) {
2318
- if (ignoreOrder === void 0) { ignoreOrder = false; }
2326
+ Helpers.checkIfValuesEqual = function (x, y, params) {
2319
2327
  if (x === y)
2320
2328
  return true;
2321
2329
  if (Array.isArray(x) && x.length === 0 && typeof y === "undefined")
@@ -2326,10 +2334,8 @@ var helpers_Helpers = /** @class */ (function () {
2326
2334
  return true;
2327
2335
  if ((y === undefined || y === null) && x === "")
2328
2336
  return true;
2329
- if (trimStrings === undefined)
2330
- trimStrings = settings.comparator.trimStrings;
2331
- if (caseSensitive === undefined)
2332
- caseSensitive = settings.comparator.caseSensitive;
2337
+ var caseSensitive = params.caseSensitive !== undefined ? params.caseSensitive : settings.comparator.caseSensitive;
2338
+ var trimStrings = params.trimStrings !== undefined ? params.trimStrings : settings.comparator.trimStrings;
2333
2339
  if (typeof x === "string" && typeof y === "string") {
2334
2340
  var normalize = settings.comparator.normalizeTextCallback;
2335
2341
  x = normalize(x, "compare");
@@ -2346,7 +2352,8 @@ var helpers_Helpers = /** @class */ (function () {
2346
2352
  }
2347
2353
  if (x instanceof Date && y instanceof Date)
2348
2354
  return x.getTime() == y.getTime();
2349
- if (Helpers.isConvertibleToNumber(x) && Helpers.isConvertibleToNumber(y)) {
2355
+ var convertNumbers = !params.doNotConvertNumbers;
2356
+ if (convertNumbers && Helpers.isConvertibleToNumber(x) && Helpers.isConvertibleToNumber(y)) {
2350
2357
  if (parseInt(x) === parseInt(y) && parseFloat(x) === parseFloat(y)) {
2351
2358
  return true;
2352
2359
  }
@@ -2360,21 +2367,23 @@ var helpers_Helpers = /** @class */ (function () {
2360
2367
  if ((y === true || y === false) && typeof x == "string") {
2361
2368
  return y.toString() === x.toLocaleLowerCase();
2362
2369
  }
2363
- if (!Helpers.isValueObject(x) && !Helpers.isValueObject(y))
2370
+ var isXObj = Helpers.isValueObject(x);
2371
+ var isYObj = Helpers.isValueObject(y);
2372
+ if (!isXObj && !isYObj && (convertNumbers || (typeof x !== "number" && typeof y !== "number")))
2364
2373
  return x == y;
2365
- if (!Helpers.isValueObject(x) || !Helpers.isValueObject(y))
2374
+ if (!isXObj || !isYObj)
2366
2375
  return false;
2367
2376
  if (x["equals"] && y["equals"])
2368
2377
  return x.equals(y);
2369
2378
  if (Array.isArray(x) && Array.isArray(y)) {
2370
- return Helpers.isArraysEqual(x, y, ignoreOrder, caseSensitive, trimStrings);
2379
+ return Helpers.checkIfArraysEqual(x, y, params);
2371
2380
  }
2372
2381
  for (var p in x) {
2373
2382
  if (!x.hasOwnProperty(p))
2374
2383
  continue;
2375
2384
  if (!y.hasOwnProperty(p))
2376
2385
  return false;
2377
- if (!this.isTwoValueEquals(x[p], y[p], ignoreOrder, caseSensitive, trimStrings))
2386
+ if (!this.checkIfValuesEqual(x[p], y[p], params))
2378
2387
  return false;
2379
2388
  }
2380
2389
  for (p in y) {
@@ -2383,6 +2392,10 @@ var helpers_Helpers = /** @class */ (function () {
2383
2392
  }
2384
2393
  return true;
2385
2394
  };
2395
+ Helpers.isTwoValueEquals = function (x, y, ignoreOrder, caseSensitive, trimStrings) {
2396
+ if (ignoreOrder === void 0) { ignoreOrder = false; }
2397
+ return this.checkIfValuesEqual(x, y, { ignoreOrder: ignoreOrder, caseSensitive: caseSensitive, trimStrings: trimStrings });
2398
+ };
2386
2399
  Helpers.randomizeArray = function (array) {
2387
2400
  for (var i = array.length - 1; i > 0; i--) {
2388
2401
  var j = Math.floor(Math.random() * (i + 1));
@@ -2866,7 +2879,7 @@ var surveyLocalization = {
2866
2879
  this.localeNames[loc] = localeConfig.nativeName;
2867
2880
  this.localeNamesInEnglish[loc] = localeConfig.englishName;
2868
2881
  if (localeConfig.rtl !== undefined) {
2869
- this.localeDirections[loc] = localeConfig.rtl;
2882
+ this.localeDirections[loc] = localeConfig.rtl ? "rtl" : "ltr";
2870
2883
  }
2871
2884
  },
2872
2885
  get currentLocale() {
@@ -11045,7 +11058,7 @@ var base_Base = /** @class */ (function () {
11045
11058
  Base.prototype.isTwoValueEquals = function (x, y, caseInSensitive, trimString) {
11046
11059
  if (caseInSensitive === void 0) { caseInSensitive = false; }
11047
11060
  if (trimString === void 0) { trimString = false; }
11048
- return helpers_Helpers.isTwoValueEquals(x, y, false, !caseInSensitive, trimString);
11061
+ return helpers_Helpers.checkIfValuesEqual(x, y, { ignoreOrder: false, caseSensitive: !caseInSensitive, trimStrings: trimString, doNotConvertNumbers: true });
11049
11062
  };
11050
11063
  Base.copyObject = function (dst, src) {
11051
11064
  for (var key in src) {
@@ -18745,7 +18758,7 @@ var text_area_TextAreaModel = /** @class */ (function () {
18745
18758
  _this.updateElement();
18746
18759
  }
18747
18760
  };
18748
- this.question.registerFunctionOnPropertyValueChanged(this.options.propertyName, this.onPropertyChangedCallback, "__textarea");
18761
+ this.question.registerFunctionOnPropertiesValueChanged(this.options.propertyNames, this.onPropertyChangedCallback, "__textarea");
18749
18762
  }
18750
18763
  TextAreaModel.prototype.updateElement = function () {
18751
18764
  var _this = this;
@@ -18916,7 +18929,7 @@ var text_area_TextAreaModel = /** @class */ (function () {
18916
18929
  });
18917
18930
  TextAreaModel.prototype.dispose = function () {
18918
18931
  if (this.question) {
18919
- this.question.unRegisterFunctionOnPropertyValueChanged(this.options.propertyName, "__textarea");
18932
+ this.question.unRegisterFunctionOnPropertiesValueChanged(this.options.propertyNames, "__textarea");
18920
18933
  }
18921
18934
  this.resetElement();
18922
18935
  };
@@ -19105,7 +19118,7 @@ var question_Question = /** @class */ (function (_super) {
19105
19118
  var options = {
19106
19119
  question: this,
19107
19120
  id: function () { return _this.commentId; },
19108
- propertyName: "comment",
19121
+ propertyNames: ["comment"],
19109
19122
  className: function () { return _this.cssClasses.comment; },
19110
19123
  placeholder: function () { return _this.renderedCommentPlaceholder; },
19111
19124
  isDisabledAttr: function () { return _this.isInputReadOnly || false; },
@@ -19220,11 +19233,14 @@ var question_Question = /** @class */ (function (_super) {
19220
19233
  Question.prototype.getIsReadyDependends = function () {
19221
19234
  return this.getIsReadyDependendCore(false);
19222
19235
  };
19236
+ Question.prototype.getDependedQuestionsByValueName = function (isDependOn) {
19237
+ return this.survey.questionsByValueName(this.getValueName());
19238
+ };
19223
19239
  Question.prototype.getIsReadyDependendCore = function (isDependOn) {
19224
19240
  var _this = this;
19225
19241
  if (!this.survey)
19226
19242
  return [];
19227
- var questions = this.survey.questionsByValueName(this.getValueName());
19243
+ var questions = this.getDependedQuestionsByValueName(isDependOn);
19228
19244
  var res = new Array();
19229
19245
  questions.forEach(function (q) { if (q !== _this)
19230
19246
  res.push(q); });
@@ -44496,7 +44512,7 @@ var survey_SurveyModel = /** @class */ (function (_super) {
44496
44512
  if (goToFirstPage) {
44497
44513
  this.currentPage = this.firstVisiblePage;
44498
44514
  if (this.currentSingleElement) {
44499
- var questions = this.getSingleQuestions();
44515
+ var questions = this.getSingleElements();
44500
44516
  this.currentSingleElement = questions.length > 0 ? questions[0] : undefined;
44501
44517
  }
44502
44518
  }
@@ -44805,7 +44821,7 @@ var survey_SurveyModel = /** @class */ (function (_super) {
44805
44821
  return this.nextPage();
44806
44822
  if (this.validationEnabled && !q.validate(true))
44807
44823
  return false;
44808
- var questions = this.getSingleQuestions();
44824
+ var questions = this.getSingleElements();
44809
44825
  var index = questions.indexOf(q);
44810
44826
  if (index < 0 || index === questions.length - 1)
44811
44827
  return false;
@@ -44826,7 +44842,7 @@ var survey_SurveyModel = /** @class */ (function (_super) {
44826
44842
  var q = this.currentSingleElement;
44827
44843
  if (!q)
44828
44844
  return this.prevPage();
44829
- var questions = this.getSingleQuestions();
44845
+ var questions = this.getSingleElements();
44830
44846
  var index = questions.indexOf(q);
44831
44847
  if (index === 0)
44832
44848
  return false;
@@ -45417,17 +45433,16 @@ var survey_SurveyModel = /** @class */ (function (_super) {
45417
45433
  });
45418
45434
  this.updateButtonsVisibility();
45419
45435
  };
45420
- SurveyModel.prototype.getSingleQuestions = function () {
45436
+ SurveyModel.prototype.getSingleElements = function (includeEl) {
45421
45437
  var res = new Array();
45422
45438
  var pages = this.pages;
45423
45439
  var _loop_3 = function () {
45424
45440
  var p = pages[i];
45425
45441
  if (!p.isStartPage && p.isVisible) {
45426
- var qs_1 = [];
45427
- //p.addQuestionsToList(qs, true);
45428
- p.elements.forEach(function (el) { return qs_1.push(el); });
45429
- qs_1.forEach(function (q) { if (q.isVisible)
45430
- res.push(q); });
45442
+ var els_1 = [];
45443
+ p.elements.forEach(function (el) { return els_1.push(el); });
45444
+ els_1.forEach(function (el) { if (el === includeEl || el.isVisible)
45445
+ res.push(el); });
45431
45446
  }
45432
45447
  };
45433
45448
  for (var i = 0; i < pages.length; i++) {
@@ -45484,6 +45499,15 @@ var survey_SurveyModel = /** @class */ (function (_super) {
45484
45499
  enumerable: false,
45485
45500
  configurable: true
45486
45501
  });
45502
+ SurveyModel.prototype.changeCurrentSingleElementOnVisibilityChanged = function () {
45503
+ var el = this.currentSingleElement;
45504
+ if (!el || el.isVisible)
45505
+ return;
45506
+ var els = this.getSingleElements(el);
45507
+ var index = els.indexOf(el);
45508
+ var newEl = (index > 0) ? els[index - 1] : (index < els.length - 1 ? els[index + 1] : undefined);
45509
+ this.currentSingleElement = newEl;
45510
+ };
45487
45511
  SurveyModel.prototype.onQuestionsOnPageModeChanged = function (oldValue) {
45488
45512
  if (this.isShowingPreview || this.isDesignMode)
45489
45513
  return;
@@ -45495,9 +45519,9 @@ var survey_SurveyModel = /** @class */ (function (_super) {
45495
45519
  this.updatePagesContainer();
45496
45520
  }
45497
45521
  if (this.isSingleVisibleQuestion) {
45498
- var questions = this.getSingleQuestions();
45499
- if (questions.length > 0) {
45500
- this.currentSingleElement = questions[0];
45522
+ var els = this.getSingleElements();
45523
+ if (els.length > 0) {
45524
+ this.currentSingleElement = els[0];
45501
45525
  }
45502
45526
  }
45503
45527
  };
@@ -45589,7 +45613,7 @@ var survey_SurveyModel = /** @class */ (function (_super) {
45589
45613
  var lVal = undefined;
45590
45614
  var q = this.currentSingleElement;
45591
45615
  if (!!q) {
45592
- var questions = this.getSingleQuestions();
45616
+ var questions = this.getSingleElements();
45593
45617
  var index = questions.indexOf(q);
45594
45618
  if (index >= 0) {
45595
45619
  fVal = index === 0;
@@ -46345,25 +46369,18 @@ var survey_SurveyModel = /** @class */ (function (_super) {
46345
46369
  this.onMatrixCellValidate.fire(this, options);
46346
46370
  return options.error ? new CustomError(options.error, this) : null;
46347
46371
  };
46348
- SurveyModel.prototype.dynamicPanelAdded = function (question, panelIndex, panel) {
46349
- if (!this.isLoadingFromJson && this.hasQuestionVisibleIndeces(question)) {
46372
+ SurveyModel.prototype.dynamicPanelAdded = function (question, panelIndex, panel, updateIndexes) {
46373
+ if (!this.isLoadingFromJson && updateIndexes) {
46350
46374
  this.updateVisibleIndexes(question.page);
46351
46375
  }
46352
- if (this.onDynamicPanelAdded.isEmpty)
46353
- return;
46354
- var panels = question.panels;
46355
- if (panelIndex === undefined) {
46356
- panelIndex = panels.length - 1;
46357
- panel = panels[panelIndex];
46358
- }
46359
46376
  this.onDynamicPanelAdded.fire(this, { question: question, panel: panel, panelIndex: panelIndex });
46360
46377
  };
46361
- SurveyModel.prototype.dynamicPanelRemoved = function (question, panelIndex, panel) {
46378
+ SurveyModel.prototype.dynamicPanelRemoved = function (question, panelIndex, panel, updateIndexes) {
46362
46379
  var questions = !!panel ? panel.questions : [];
46363
46380
  for (var i = 0; i < questions.length; i++) {
46364
46381
  questions[i].clearOnDeletingContainer();
46365
46382
  }
46366
- if (this.hasQuestionVisibleIndeces(question)) {
46383
+ if (updateIndexes) {
46367
46384
  this.updateVisibleIndexes(question.page);
46368
46385
  }
46369
46386
  this.onDynamicPanelRemoved.fire(this, {
@@ -46372,14 +46389,6 @@ var survey_SurveyModel = /** @class */ (function (_super) {
46372
46389
  panel: panel,
46373
46390
  });
46374
46391
  };
46375
- SurveyModel.prototype.hasQuestionVisibleIndeces = function (question) {
46376
- var qList = question.getNestedQuestions(true);
46377
- for (var i = 0; i < qList.length; i++) {
46378
- if (qList[i].visibleIndex > -1)
46379
- return true;
46380
- }
46381
- return false;
46382
- };
46383
46392
  SurveyModel.prototype.dynamicPanelRemoving = function (question, panelIndex, panel) {
46384
46393
  var options = {
46385
46394
  question: question,
@@ -48010,6 +48019,9 @@ var survey_SurveyModel = /** @class */ (function (_super) {
48010
48019
  if (resetIndexes) {
48011
48020
  this.updateVisibleIndexes(question.page);
48012
48021
  }
48022
+ if (!newValue) {
48023
+ this.changeCurrentSingleElementOnVisibilityChanged();
48024
+ }
48013
48025
  this.onQuestionVisibleChanged.fire(this, {
48014
48026
  question: question,
48015
48027
  name: question.name,
@@ -48023,6 +48035,9 @@ var survey_SurveyModel = /** @class */ (function (_super) {
48023
48035
  this.updateCurrentPage();
48024
48036
  }
48025
48037
  this.updateVisibleIndexes();
48038
+ if (!newValue) {
48039
+ this.changeCurrentSingleElementOnVisibilityChanged();
48040
+ }
48026
48041
  this.onPageVisibleChanged.fire(this, {
48027
48042
  page: page,
48028
48043
  visible: newValue,
@@ -48030,6 +48045,9 @@ var survey_SurveyModel = /** @class */ (function (_super) {
48030
48045
  };
48031
48046
  SurveyModel.prototype.panelVisibilityChanged = function (panel, newValue) {
48032
48047
  this.updateVisibleIndexes(panel.page);
48048
+ if (!newValue) {
48049
+ this.changeCurrentSingleElementOnVisibilityChanged();
48050
+ }
48033
48051
  this.onPanelVisibleChanged.fire(this, {
48034
48052
  panel: panel,
48035
48053
  visible: newValue,
@@ -49784,7 +49802,7 @@ var question_baseselect_QuestionSelectBase = /** @class */ (function (_super) {
49784
49802
  var options = {
49785
49803
  question: this,
49786
49804
  id: function () { return _this.otherId; },
49787
- propertyName: "otherValue",
49805
+ propertyNames: ["otherValue", "comment"],
49788
49806
  className: function () { return _this.cssClasses.other; },
49789
49807
  placeholder: function () { return _this.otherPlaceholder; },
49790
49808
  isDisabledAttr: function () { return _this.isInputReadOnly || false; },
@@ -53429,6 +53447,8 @@ var dropdownListModel_DropdownListModel = /** @class */ (function (_super) {
53429
53447
  }
53430
53448
  var updateAfterFilterStringChanged = function () {
53431
53449
  _this.setFilterStringToListModel(_this.filterString);
53450
+ if (_this.filterString)
53451
+ _this.applyHintString();
53432
53452
  _this.popupRecalculatePosition(true);
53433
53453
  };
53434
53454
  if (this.question.choicesLazyLoadEnabled) {
@@ -53476,7 +53496,8 @@ var dropdownListModel_DropdownListModel = /** @class */ (function (_super) {
53476
53496
  if (hintStringMiddle && this.inputString != hintStringMiddle)
53477
53497
  this.inputString = hintStringMiddle;
53478
53498
  };
53479
- DropdownListModel.prototype.applyHintString = function (item) {
53499
+ DropdownListModel.prototype.applyHintString = function () {
53500
+ var item = this.listModel.focusedItem || this.question.selectedItem;
53480
53501
  var hasHtml = item === null || item === void 0 ? void 0 : item.locText.hasHtml;
53481
53502
  if (hasHtml || this.question.inputFieldComponentName) {
53482
53503
  this._markdownMode = true;
@@ -53496,9 +53517,6 @@ var dropdownListModel_DropdownListModel = /** @class */ (function (_super) {
53496
53517
  if (!val) {
53497
53518
  this.hintString = "";
53498
53519
  }
53499
- else {
53500
- this.applyHintString(this.listModel.focusedItem || this.question.selectedItem);
53501
- }
53502
53520
  },
53503
53521
  enumerable: false,
53504
53522
  configurable: true
@@ -53559,7 +53577,7 @@ var dropdownListModel_DropdownListModel = /** @class */ (function (_super) {
53559
53577
  });
53560
53578
  Object.defineProperty(DropdownListModel.prototype, "hintStringSuffix", {
53561
53579
  get: function () {
53562
- return this.hintString.substring(this.hintStringLC.indexOf(this.inputStringLC) + this.inputStringLC.length);
53580
+ return this.hintStringLC.indexOf(this.inputStringLC) >= 0 ? this.hintString.substring(this.hintStringLC.indexOf(this.inputStringLC) + this.inputStringLC.length) : "";
53563
53581
  },
53564
53582
  enumerable: false,
53565
53583
  configurable: true
@@ -53688,7 +53706,7 @@ var dropdownListModel_DropdownListModel = /** @class */ (function (_super) {
53688
53706
  this.applyInputString(this.listModel.focusedItem || this.question.selectedItem);
53689
53707
  }
53690
53708
  else {
53691
- this.applyHintString(this.listModel.focusedItem || this.question.selectedItem);
53709
+ this.applyHintString();
53692
53710
  }
53693
53711
  this.fixInputCase();
53694
53712
  this.ariaActivedescendant = (_a = this.listModel.focusedItem) === null || _a === void 0 ? void 0 : _a.elementId;
@@ -58199,6 +58217,11 @@ var question_checkbox_QuestionCheckboxModel = /** @class */ (function (_super) {
58199
58217
  }
58200
58218
  return null;
58201
58219
  };
58220
+ QuestionCheckboxModel.prototype.getDependedQuestionsByValueName = function (isDependOn) {
58221
+ if (isDependOn && !!this.valuePropertyName)
58222
+ return [];
58223
+ return _super.prototype.getDependedQuestionsByValueName.call(this, isDependOn);
58224
+ };
58202
58225
  Object.defineProperty(QuestionCheckboxModel.prototype, "selectAllItem", {
58203
58226
  /**
58204
58227
  * Returns the "Select All" choice item. Use this property to change the item's `value` or `text`.
@@ -59221,7 +59244,7 @@ var dropdownMultiSelectListModel_DropdownMultiSelectListModel = /** @class */ (f
59221
59244
  var newValue = [].concat(this.question.renderedValue || []);
59222
59245
  newValue.splice(newValue.indexOf(id), 1);
59223
59246
  this.question.renderedValue = newValue;
59224
- this.applyHintString(this.listModel.focusedItem);
59247
+ this.applyHintString();
59225
59248
  this.updateListState();
59226
59249
  };
59227
59250
  DropdownMultiSelectListModel.prototype.clear = function () {
@@ -59264,7 +59287,7 @@ var dropdownMultiSelectListModel_DropdownMultiSelectListModel = /** @class */ (f
59264
59287
  DropdownMultiSelectListModel.prototype.afterScrollToFocusedItem = function () {
59265
59288
  var _a;
59266
59289
  if (!((_a = this.listModel.focusedItem) === null || _a === void 0 ? void 0 : _a.selected)) {
59267
- this.applyHintString(this.listModel.focusedItem || this.question.selectedItem);
59290
+ this.applyHintString();
59268
59291
  }
59269
59292
  else {
59270
59293
  this.hintString = "";
@@ -60995,7 +61018,7 @@ var question_comment_QuestionCommentModel = /** @class */ (function (_super) {
60995
61018
  var options = {
60996
61019
  question: this,
60997
61020
  id: function () { return _this_1.inputId; },
60998
- propertyName: "value",
61021
+ propertyNames: ["value"],
60999
61022
  className: function () { return _this_1.className; },
61000
61023
  placeholder: function () { return _this_1.renderedPlaceholder; },
61001
61024
  isDisabledAttr: function () { return _this_1.isDisabledAttr; },
@@ -66349,8 +66372,7 @@ var question_signaturepad_QuestionSignaturePadModel = /** @class */ (function (_
66349
66372
  _this._loadedData = undefined;
66350
66373
  _this.updateValueHandler = function () {
66351
66374
  _this._loadedData = undefined;
66352
- _this.scaleCanvas(false, true);
66353
- _this.loadPreview(_this.value);
66375
+ _this.scaleCanvas(true, true);
66354
66376
  };
66355
66377
  return _this;
66356
66378
  }
@@ -66458,7 +66480,13 @@ var question_signaturepad_QuestionSignaturePadModel = /** @class */ (function (_
66458
66480
  QuestionSignaturePadModel.prototype.fromDataUrl = function (data) {
66459
66481
  this._loadedData = data;
66460
66482
  if (this.signaturePad) {
66461
- this.signaturePad.fromDataURL(data, { width: this.canvas.width * this.scale, height: this.canvas.height * this.scale });
66483
+ var devicePixelRatio_1 = DomWindowHelper.getDevicePixelRatio();
66484
+ var ratio = (this.dataFormat === "svg" && !!devicePixelRatio_1) ? devicePixelRatio_1 : 1;
66485
+ var options = {
66486
+ width: this.canvas.width * this.scale / ratio,
66487
+ height: this.canvas.height * this.scale / ratio
66488
+ };
66489
+ this.signaturePad.fromDataURL(data, options);
66462
66490
  }
66463
66491
  };
66464
66492
  Object.defineProperty(QuestionSignaturePadModel.prototype, "loadedData", {
@@ -68691,8 +68719,7 @@ var question_paneldynamic_QuestionPanelDynamicModel = /** @class */ (function (_
68691
68719
  if (!this.isRenderModeList) {
68692
68720
  this.currentIndex = index;
68693
68721
  }
68694
- if (this.survey)
68695
- this.survey.dynamicPanelAdded(this);
68722
+ this.notifyOnPanelAddedRemoved(true, index);
68696
68723
  return this.panelsCore[index];
68697
68724
  };
68698
68725
  QuestionPanelDynamicModel.prototype.updateValueOnAddingPanel = function (prevIndex, index) {
@@ -68825,10 +68852,26 @@ var question_paneldynamic_QuestionPanelDynamicModel = /** @class */ (function (_
68825
68852
  this.value = value;
68826
68853
  this.updateFooterActions();
68827
68854
  this.fireCallback(this.panelCountChangedCallback);
68828
- if (this.survey)
68829
- this.survey.dynamicPanelRemoved(this, index, panel);
68855
+ this.notifyOnPanelAddedRemoved(false, index, panel);
68830
68856
  this.isValueChangingInternally = false;
68831
68857
  };
68858
+ QuestionPanelDynamicModel.prototype.notifyOnPanelAddedRemoved = function (isAdded, index, panel) {
68859
+ if (!panel) {
68860
+ panel = this.panelsCore[index];
68861
+ }
68862
+ if (this.survey) {
68863
+ var updateIndeces = this.showQuestionNumbers === "onSurvey";
68864
+ if (isAdded) {
68865
+ this.survey.dynamicPanelAdded(this, index, panel, updateIndeces);
68866
+ }
68867
+ else {
68868
+ this.survey.dynamicPanelRemoved(this, index, panel, updateIndeces);
68869
+ }
68870
+ }
68871
+ if (isAdded && !!panel && this.showQuestionNumbers === "onPanel") {
68872
+ panel.setVisibleIndex(0);
68873
+ }
68874
+ };
68832
68875
  QuestionPanelDynamicModel.prototype.getVisualPanelIndex = function (val) {
68833
68876
  if (helpers_Helpers.isNumber(val))
68834
68877
  return val;
@@ -69021,7 +69064,7 @@ var question_paneldynamic_QuestionPanelDynamicModel = /** @class */ (function (_
69021
69064
  this.assignOnPropertyChangedToTemplate();
69022
69065
  if (!!this.survey) {
69023
69066
  for (var i = 0; i < this.panelCount; i++) {
69024
- this.survey.dynamicPanelAdded(this);
69067
+ this.notifyOnPanelAddedRemoved(true, i);
69025
69068
  }
69026
69069
  }
69027
69070
  this.updateIsReady();
@@ -72903,9 +72946,9 @@ Serializer.addClass("currencymask", [
72903
72946
 
72904
72947
  var Version;
72905
72948
  var ReleaseDate;
72906
- Version = "" + "1.12.29";
72949
+ Version = "" + "1.12.31";
72907
72950
  settings.version = Version;
72908
- ReleaseDate = "" + "2025-03-24";
72951
+ ReleaseDate = "" + "2025-04-08";
72909
72952
  function checkLibraryVersion(ver, libraryName) {
72910
72953
  if (Version != ver) {
72911
72954
  var str = "survey-core has version '" + Version + "' and " + libraryName