survey-react 1.12.30 → 1.12.32

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/defaultV2.css CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - Survey JavaScript library v1.12.30
2
+ * surveyjs - Survey JavaScript library v1.12.32
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
  */
package/defaultV2.min.css CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - Survey JavaScript library v1.12.30
2
+ * surveyjs - Survey JavaScript library v1.12.32
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
  */
package/modern.css CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - Survey JavaScript library v1.12.30
2
+ * surveyjs - Survey JavaScript library v1.12.32
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
  */
package/modern.min.css CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - Survey JavaScript library v1.12.30
2
+ * surveyjs - Survey JavaScript library v1.12.32
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
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "survey-react",
3
- "version": "1.12.30",
3
+ "version": "1.12.32",
4
4
  "description": "survey.js is a JavaScript Survey Library. It is a modern way to add a survey to your website. It uses JSON for survey metadata and results.",
5
5
  "keywords": [
6
6
  "Survey",
package/survey.css CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - Survey JavaScript library v1.12.30
2
+ * surveyjs - Survey JavaScript library v1.12.32
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
  */
package/survey.min.css CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - Survey JavaScript library v1.12.30
2
+ * surveyjs - Survey JavaScript library v1.12.32
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
  */
package/survey.react.d.ts CHANGED
@@ -36,6 +36,12 @@ declare module "packages/survey-core/src/helpers" {
36
36
  export interface HashTable<T = any> {
37
37
  [key: string]: T;
38
38
  }
39
+ export interface IEqualValuesParameters {
40
+ ignoreOrder?: boolean;
41
+ caseSensitive?: boolean;
42
+ trimStrings?: boolean;
43
+ doNotConvertNumbers?: boolean;
44
+ }
39
45
  export function createDate(reason: string, val?: number | string | Date): Date;
40
46
  export class Helpers {
41
47
  /**
@@ -45,8 +51,10 @@ declare module "packages/survey-core/src/helpers" {
45
51
  static isValueEmpty(value: any): boolean;
46
52
  static isValueUndefined(value: any): boolean;
47
53
  static isArrayContainsEqual(x: any, y: any): boolean;
54
+ static checkIfArraysEqual(x: any, y: any, params: IEqualValuesParameters): boolean;
48
55
  static isArraysEqual(x: any, y: any, ignoreOrder?: boolean, caseSensitive?: boolean, trimStrings?: boolean): boolean;
49
56
  static compareStrings(x: string, y: string): number;
57
+ static checkIfValuesEqual(x: any, y: any, params: IEqualValuesParameters): boolean;
50
58
  static isTwoValueEquals(x: any, y: any, ignoreOrder?: boolean, caseSensitive?: boolean, trimStrings?: boolean): boolean;
51
59
  static randomizeArray<T>(array: Array<T>): Array<T>;
52
60
  static getUnbindValue(value: any): any;
@@ -4494,7 +4502,7 @@ declare module "packages/survey-core/src/utils/text-area" {
4494
4502
  export interface ITextArea {
4495
4503
  question: any;
4496
4504
  id: () => string;
4497
- propertyName: string;
4505
+ propertyNames: Array<string>;
4498
4506
  className: () => string;
4499
4507
  isDisabledAttr: () => boolean;
4500
4508
  isReadOnlyAttr?: () => boolean;
@@ -13485,6 +13493,7 @@ declare module "packages/survey-core/src/question" {
13485
13493
  private setIsReady;
13486
13494
  protected getIsReadyDependsOn(): Array<Question>;
13487
13495
  private getIsReadyDependends;
13496
+ protected getDependedQuestionsByValueName(isDependOn: boolean): Array<IQuestion>;
13488
13497
  private getIsReadyDependendCore;
13489
13498
  choicesLoaded(): void;
13490
13499
  /**
@@ -17732,6 +17741,7 @@ declare module "packages/survey-core/src/question_checkbox" {
17732
17741
  get valuePropertyName(): string;
17733
17742
  set valuePropertyName(val: string);
17734
17743
  getQuestionFromArray(name: string, index: number): IQuestion;
17744
+ protected getDependedQuestionsByValueName(isDependOn: boolean): Array<IQuestion>;
17735
17745
  /**
17736
17746
  * Returns the "Select All" choice item. Use this property to change the item's `value` or `text`.
17737
17747
  * @see showSelectAllItem
package/survey.react.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - Survey JavaScript library v1.12.30
2
+ * surveyjs - Survey JavaScript library v1.12.32
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
  */
@@ -2263,12 +2263,12 @@ var helpers_Helpers = /** @class */ (function () {
2263
2263
  }
2264
2264
  return true;
2265
2265
  };
2266
- Helpers.isArraysEqual = function (x, y, ignoreOrder, caseSensitive, trimStrings) {
2267
- if (ignoreOrder === void 0) { ignoreOrder = false; }
2266
+ Helpers.checkIfArraysEqual = function (x, y, params) {
2268
2267
  if (!Array.isArray(x) || !Array.isArray(y))
2269
2268
  return false;
2270
2269
  if (x.length !== y.length)
2271
2270
  return false;
2271
+ var ignoreOrder = params.ignoreOrder !== undefined ? params.ignoreOrder : false;
2272
2272
  if (ignoreOrder) {
2273
2273
  var xSorted = [];
2274
2274
  var ySorted = [];
@@ -2282,11 +2282,15 @@ var helpers_Helpers = /** @class */ (function () {
2282
2282
  y = ySorted;
2283
2283
  }
2284
2284
  for (var i = 0; i < x.length; i++) {
2285
- if (!Helpers.isTwoValueEquals(x[i], y[i], ignoreOrder, caseSensitive, trimStrings))
2285
+ if (!Helpers.checkIfValuesEqual(x[i], y[i], params))
2286
2286
  return false;
2287
2287
  }
2288
2288
  return true;
2289
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
+ };
2290
2294
  Helpers.compareStrings = function (x, y) {
2291
2295
  var normalize = settings.comparator.normalizeTextCallback;
2292
2296
  if (!!x)
@@ -2319,8 +2323,7 @@ var helpers_Helpers = /** @class */ (function () {
2319
2323
  }
2320
2324
  return x > y ? 1 : -1;
2321
2325
  };
2322
- Helpers.isTwoValueEquals = function (x, y, ignoreOrder, caseSensitive, trimStrings) {
2323
- if (ignoreOrder === void 0) { ignoreOrder = false; }
2326
+ Helpers.checkIfValuesEqual = function (x, y, params) {
2324
2327
  if (x === y)
2325
2328
  return true;
2326
2329
  if (Array.isArray(x) && x.length === 0 && typeof y === "undefined")
@@ -2331,10 +2334,8 @@ var helpers_Helpers = /** @class */ (function () {
2331
2334
  return true;
2332
2335
  if ((y === undefined || y === null) && x === "")
2333
2336
  return true;
2334
- if (trimStrings === undefined)
2335
- trimStrings = settings.comparator.trimStrings;
2336
- if (caseSensitive === undefined)
2337
- 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;
2338
2339
  if (typeof x === "string" && typeof y === "string") {
2339
2340
  var normalize = settings.comparator.normalizeTextCallback;
2340
2341
  x = normalize(x, "compare");
@@ -2351,7 +2352,8 @@ var helpers_Helpers = /** @class */ (function () {
2351
2352
  }
2352
2353
  if (x instanceof Date && y instanceof Date)
2353
2354
  return x.getTime() == y.getTime();
2354
- if (Helpers.isConvertibleToNumber(x) && Helpers.isConvertibleToNumber(y)) {
2355
+ var convertNumbers = !params.doNotConvertNumbers;
2356
+ if (convertNumbers && Helpers.isConvertibleToNumber(x) && Helpers.isConvertibleToNumber(y)) {
2355
2357
  if (parseInt(x) === parseInt(y) && parseFloat(x) === parseFloat(y)) {
2356
2358
  return true;
2357
2359
  }
@@ -2365,21 +2367,23 @@ var helpers_Helpers = /** @class */ (function () {
2365
2367
  if ((y === true || y === false) && typeof x == "string") {
2366
2368
  return y.toString() === x.toLocaleLowerCase();
2367
2369
  }
2368
- 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")))
2369
2373
  return x == y;
2370
- if (!Helpers.isValueObject(x) || !Helpers.isValueObject(y))
2374
+ if (!isXObj || !isYObj)
2371
2375
  return false;
2372
2376
  if (x["equals"] && y["equals"])
2373
2377
  return x.equals(y);
2374
2378
  if (Array.isArray(x) && Array.isArray(y)) {
2375
- return Helpers.isArraysEqual(x, y, ignoreOrder, caseSensitive, trimStrings);
2379
+ return Helpers.checkIfArraysEqual(x, y, params);
2376
2380
  }
2377
2381
  for (var p in x) {
2378
2382
  if (!x.hasOwnProperty(p))
2379
2383
  continue;
2380
2384
  if (!y.hasOwnProperty(p))
2381
2385
  return false;
2382
- if (!this.isTwoValueEquals(x[p], y[p], ignoreOrder, caseSensitive, trimStrings))
2386
+ if (!this.checkIfValuesEqual(x[p], y[p], params))
2383
2387
  return false;
2384
2388
  }
2385
2389
  for (p in y) {
@@ -2388,6 +2392,10 @@ var helpers_Helpers = /** @class */ (function () {
2388
2392
  }
2389
2393
  return true;
2390
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
+ };
2391
2399
  Helpers.randomizeArray = function (array) {
2392
2400
  for (var i = array.length - 1; i > 0; i--) {
2393
2401
  var j = Math.floor(Math.random() * (i + 1));
@@ -2871,7 +2879,7 @@ var surveyLocalization = {
2871
2879
  this.localeNames[loc] = localeConfig.nativeName;
2872
2880
  this.localeNamesInEnglish[loc] = localeConfig.englishName;
2873
2881
  if (localeConfig.rtl !== undefined) {
2874
- this.localeDirections[loc] = localeConfig.rtl;
2882
+ this.localeDirections[loc] = localeConfig.rtl ? "rtl" : "ltr";
2875
2883
  }
2876
2884
  },
2877
2885
  get currentLocale() {
@@ -11050,7 +11058,7 @@ var base_Base = /** @class */ (function () {
11050
11058
  Base.prototype.isTwoValueEquals = function (x, y, caseInSensitive, trimString) {
11051
11059
  if (caseInSensitive === void 0) { caseInSensitive = false; }
11052
11060
  if (trimString === void 0) { trimString = false; }
11053
- return helpers_Helpers.isTwoValueEquals(x, y, false, !caseInSensitive, trimString);
11061
+ return helpers_Helpers.checkIfValuesEqual(x, y, { ignoreOrder: false, caseSensitive: !caseInSensitive, trimStrings: trimString, doNotConvertNumbers: true });
11054
11062
  };
11055
11063
  Base.copyObject = function (dst, src) {
11056
11064
  for (var key in src) {
@@ -18750,7 +18758,7 @@ var text_area_TextAreaModel = /** @class */ (function () {
18750
18758
  _this.updateElement();
18751
18759
  }
18752
18760
  };
18753
- this.question.registerFunctionOnPropertyValueChanged(this.options.propertyName, this.onPropertyChangedCallback, "__textarea");
18761
+ this.question.registerFunctionOnPropertiesValueChanged(this.options.propertyNames, this.onPropertyChangedCallback, "__textarea");
18754
18762
  }
18755
18763
  TextAreaModel.prototype.updateElement = function () {
18756
18764
  var _this = this;
@@ -18921,7 +18929,7 @@ var text_area_TextAreaModel = /** @class */ (function () {
18921
18929
  });
18922
18930
  TextAreaModel.prototype.dispose = function () {
18923
18931
  if (this.question) {
18924
- this.question.unRegisterFunctionOnPropertyValueChanged(this.options.propertyName, "__textarea");
18932
+ this.question.unRegisterFunctionOnPropertiesValueChanged(this.options.propertyNames, "__textarea");
18925
18933
  }
18926
18934
  this.resetElement();
18927
18935
  };
@@ -19110,7 +19118,7 @@ var question_Question = /** @class */ (function (_super) {
19110
19118
  var options = {
19111
19119
  question: this,
19112
19120
  id: function () { return _this.commentId; },
19113
- propertyName: "comment",
19121
+ propertyNames: ["comment"],
19114
19122
  className: function () { return _this.cssClasses.comment; },
19115
19123
  placeholder: function () { return _this.renderedCommentPlaceholder; },
19116
19124
  isDisabledAttr: function () { return _this.isInputReadOnly || false; },
@@ -19225,11 +19233,14 @@ var question_Question = /** @class */ (function (_super) {
19225
19233
  Question.prototype.getIsReadyDependends = function () {
19226
19234
  return this.getIsReadyDependendCore(false);
19227
19235
  };
19236
+ Question.prototype.getDependedQuestionsByValueName = function (isDependOn) {
19237
+ return this.survey.questionsByValueName(this.getValueName());
19238
+ };
19228
19239
  Question.prototype.getIsReadyDependendCore = function (isDependOn) {
19229
19240
  var _this = this;
19230
19241
  if (!this.survey)
19231
19242
  return [];
19232
- var questions = this.survey.questionsByValueName(this.getValueName());
19243
+ var questions = this.getDependedQuestionsByValueName(isDependOn);
19233
19244
  var res = new Array();
19234
19245
  questions.forEach(function (q) { if (q !== _this)
19235
19246
  res.push(q); });
@@ -38885,7 +38896,7 @@ var panel_PanelModel = /** @class */ (function (_super) {
38885
38896
  return this.showQuestionNumbers !== "off" && this.showQuestionNumbers !== "onpanel";
38886
38897
  };
38887
38898
  PanelModel.prototype.notifySurveyOnVisibilityChanged = function () {
38888
- if (this.survey != null && !this.isLoadingFromJson && !!this.page) {
38899
+ if (this.survey != null && !this.isLoadingFromJson) {
38889
38900
  this.survey.panelVisibilityChanged(this, this.isVisible);
38890
38901
  }
38891
38902
  };
@@ -48033,14 +48044,13 @@ var survey_SurveyModel = /** @class */ (function (_super) {
48033
48044
  });
48034
48045
  };
48035
48046
  SurveyModel.prototype.panelVisibilityChanged = function (panel, newValue) {
48036
- this.updateVisibleIndexes(panel.page);
48037
- if (!newValue) {
48038
- this.changeCurrentSingleElementOnVisibilityChanged();
48047
+ if (!!panel.page) {
48048
+ this.updateVisibleIndexes(panel.page);
48049
+ if (!newValue) {
48050
+ this.changeCurrentSingleElementOnVisibilityChanged();
48051
+ }
48039
48052
  }
48040
- this.onPanelVisibleChanged.fire(this, {
48041
- panel: panel,
48042
- visible: newValue,
48043
- });
48053
+ this.onPanelVisibleChanged.fire(this, { panel: panel, visible: newValue });
48044
48054
  };
48045
48055
  SurveyModel.prototype.questionCreated = function (question) {
48046
48056
  this.onQuestionCreated.fire(this, { question: question });
@@ -49791,7 +49801,7 @@ var question_baseselect_QuestionSelectBase = /** @class */ (function (_super) {
49791
49801
  var options = {
49792
49802
  question: this,
49793
49803
  id: function () { return _this.otherId; },
49794
- propertyName: "otherValue",
49804
+ propertyNames: ["otherValue", "comment"],
49795
49805
  className: function () { return _this.cssClasses.other; },
49796
49806
  placeholder: function () { return _this.otherPlaceholder; },
49797
49807
  isDisabledAttr: function () { return _this.isInputReadOnly || false; },
@@ -51173,8 +51183,10 @@ var question_baseselect_QuestionSelectBase = /** @class */ (function (_super) {
51173
51183
  return this.getQuestionWithChoicesCore(this.findCarryForwardQuestion());
51174
51184
  };
51175
51185
  QuestionSelectBase.prototype.findCarryForwardQuestion = function (data) {
51176
- if (!data)
51177
- data = this.data;
51186
+ var _a;
51187
+ if (!data) {
51188
+ data = this.data || ((_a = this.parentQuestion) === null || _a === void 0 ? void 0 : _a.data);
51189
+ }
51178
51190
  this.carryForwardQuestion = null;
51179
51191
  if (this.choicesFromQuestion && data) {
51180
51192
  this.carryForwardQuestion = data.findQuestionByName(this.choicesFromQuestion);
@@ -58206,6 +58218,11 @@ var question_checkbox_QuestionCheckboxModel = /** @class */ (function (_super) {
58206
58218
  }
58207
58219
  return null;
58208
58220
  };
58221
+ QuestionCheckboxModel.prototype.getDependedQuestionsByValueName = function (isDependOn) {
58222
+ if (isDependOn && !!this.valuePropertyName)
58223
+ return [];
58224
+ return _super.prototype.getDependedQuestionsByValueName.call(this, isDependOn);
58225
+ };
58209
58226
  Object.defineProperty(QuestionCheckboxModel.prototype, "selectAllItem", {
58210
58227
  /**
58211
58228
  * Returns the "Select All" choice item. Use this property to change the item's `value` or `text`.
@@ -61002,7 +61019,7 @@ var question_comment_QuestionCommentModel = /** @class */ (function (_super) {
61002
61019
  var options = {
61003
61020
  question: this,
61004
61021
  id: function () { return _this_1.inputId; },
61005
- propertyName: "value",
61022
+ propertyNames: ["value"],
61006
61023
  className: function () { return _this_1.className; },
61007
61024
  placeholder: function () { return _this_1.renderedPlaceholder; },
61008
61025
  isDisabledAttr: function () { return _this_1.isDisabledAttr; },
@@ -68084,6 +68101,7 @@ var question_paneldynamic_QuestionPanelDynamicModel = /** @class */ (function (_
68084
68101
  return;
68085
68102
  if (!this.canBuildPanels || this.wasNotRenderedInSurvey) {
68086
68103
  this.setPropertyValue("panelCount", val);
68104
+ this.updateFooterActions();
68087
68105
  return;
68088
68106
  }
68089
68107
  if (val == this.panelsCore.length || this.useTemplatePanel)
@@ -68829,15 +68847,18 @@ var question_paneldynamic_QuestionPanelDynamicModel = /** @class */ (function (_
68829
68847
  this.panelsCore.splice(index, 1);
68830
68848
  this.updateBindings("panelCount", this.panelCount);
68831
68849
  var value = this.value;
68832
- if (!value || !Array.isArray(value) || index >= value.length)
68833
- return;
68834
- this.isValueChangingInternally = true;
68835
- value.splice(index, 1);
68836
- this.value = value;
68837
- this.updateFooterActions();
68838
- this.fireCallback(this.panelCountChangedCallback);
68839
- this.notifyOnPanelAddedRemoved(false, index, panel);
68840
- this.isValueChangingInternally = false;
68850
+ if (!value || !Array.isArray(value) || index >= value.length) {
68851
+ this.updateFooterActions();
68852
+ }
68853
+ else {
68854
+ this.isValueChangingInternally = true;
68855
+ value.splice(index, 1);
68856
+ this.value = value;
68857
+ this.updateFooterActions();
68858
+ this.fireCallback(this.panelCountChangedCallback);
68859
+ this.notifyOnPanelAddedRemoved(false, index, panel);
68860
+ this.isValueChangingInternally = false;
68861
+ }
68841
68862
  };
68842
68863
  QuestionPanelDynamicModel.prototype.notifyOnPanelAddedRemoved = function (isAdded, index, panel) {
68843
68864
  if (!panel) {
@@ -72930,9 +72951,9 @@ Serializer.addClass("currencymask", [
72930
72951
 
72931
72952
  var Version;
72932
72953
  var ReleaseDate;
72933
- Version = "" + "1.12.30";
72954
+ Version = "" + "1.12.32";
72934
72955
  settings.version = Version;
72935
- ReleaseDate = "" + "2025-03-31";
72956
+ ReleaseDate = "" + "2025-04-13";
72936
72957
  function checkLibraryVersion(ver, libraryName) {
72937
72958
  if (Version != ver) {
72938
72959
  var str = "survey-core has version '" + Version + "' and " + libraryName