survey-react 1.12.25 → 1.12.26

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/modern.css CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - Survey JavaScript library v1.12.25
2
+ * surveyjs - Survey JavaScript library v1.12.26
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.25
2
+ * surveyjs - Survey JavaScript library v1.12.26
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.25",
3
+ "version": "1.12.26",
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.25
2
+ * surveyjs - Survey JavaScript library v1.12.26
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.25
2
+ * surveyjs - Survey JavaScript library v1.12.26
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
@@ -974,7 +974,7 @@ declare module "packages/survey-core/src/utils/utils" {
974
974
  rootElement?: HTMLElement;
975
975
  cssClass?: string;
976
976
  }
977
- export function showConfirmDialog(message: string, callback: (res: boolean) => void, options: IConfirmDialogOptions): boolean;
977
+ export function showConfirmDialog(message: string, callback: (res: boolean) => void, options?: IConfirmDialogOptions): boolean;
978
978
  export function configConfirmDialog(popupViewModel: PopupBaseViewModel): void;
979
979
  function chooseFiles(input: HTMLInputElement, callback: (files: File[]) => void): void;
980
980
  export function compareArrays<T>(oldValue: Array<T>, newValue: Array<T>, getKey: (item: T) => any): {
@@ -2045,6 +2045,8 @@ declare module "packages/survey-core/src/defaultCss/defaultV2Css" {
2045
2045
  imagepicker: {
2046
2046
  mainRoot: string;
2047
2047
  root: string;
2048
+ rootResponsive: string;
2049
+ rootStatic: string;
2048
2050
  rootColumn: string;
2049
2051
  item: string;
2050
2052
  itemOnError: string;
@@ -15019,6 +15021,7 @@ declare module "packages/survey-core/src/question_matrixdropdownbase" {
15019
15021
  protected getConditionObjectRowText(index: number): string;
15020
15022
  protected getConditionObjectsRowIndeces(): Array<number>;
15021
15023
  getProgressInfo(): IProgressInfo;
15024
+ protected getIsRequireToGenerateRows(): boolean;
15022
15025
  protected updateProgressInfoByValues(res: IProgressInfo): void;
15023
15026
  protected updateProgressInfoByRow(res: IProgressInfo, rowValue: any): void;
15024
15027
  private getCellQuestions;
@@ -17115,6 +17118,7 @@ declare module "packages/survey-core/src/question_matrixdropdown" {
17115
17118
  protected createMatrixRow(item: ItemValue, value: any): MatrixDropdownRowModel;
17116
17119
  protected getFilteredDataCore(): any;
17117
17120
  protected getSearchableItemValueKeys(keys: Array<string>): void;
17121
+ protected getIsRequireToGenerateRows(): boolean;
17118
17122
  protected updateProgressInfoByValues(res: IProgressInfo): void;
17119
17123
  }
17120
17124
  }
@@ -18169,6 +18173,14 @@ declare module "packages/survey-core/src/question_imagepicker" {
18169
18173
  onContentLoaded: (item: ImageItemValue, event: any) => void;
18170
18174
  private responsiveColCount;
18171
18175
  protected getCurrentColCount(): number;
18176
+ gridColCount: number;
18177
+ getContainerStyle(): {
18178
+ gridAutoFlow?: undefined;
18179
+ gridTemplateColumns?: undefined;
18180
+ } | {
18181
+ gridAutoFlow: string;
18182
+ gridTemplateColumns: string;
18183
+ };
18172
18184
  protected processResponsiveness(_: number, availableWidth: number): boolean;
18173
18185
  triggerResponsiveness(hard?: boolean): void;
18174
18186
  private gapBetweenItems;
package/survey.react.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - Survey JavaScript library v1.12.25
2
+ * surveyjs - Survey JavaScript library v1.12.26
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
  */
@@ -12292,7 +12292,9 @@ var popup_PopupModel = /** @class */ (function (_super) {
12292
12292
  };
12293
12293
  PopupModel.prototype.updateDisplayMode = function (menuType) {
12294
12294
  if (this.displayMode !== menuType) {
12295
- this.setWidthByTarget = menuType === "dropdown";
12295
+ var isDropdown = menuType === "dropdown";
12296
+ this.setWidthByTarget = isDropdown;
12297
+ this.isFocusedContent = !isDropdown;
12296
12298
  }
12297
12299
  switch (menuType) {
12298
12300
  case "dropdown": {
@@ -16531,6 +16533,7 @@ var Logger = /** @class */ (function () {
16531
16533
  }());
16532
16534
 
16533
16535
  function showConfirmDialog(message, callback, options) {
16536
+ if (options === void 0) { options = {}; }
16534
16537
  var locStr = new localizablestring_LocalizableString(undefined);
16535
16538
  var popupViewModel = settings.showDialog({
16536
16539
  componentName: "sv-string-viewer",
@@ -30551,11 +30554,14 @@ var question_matrixdropdownbase_QuestionMatrixDropdownModelBase = /** @class */
30551
30554
  this.runFuncForCellQuestions(function (q) { q.localeChanged(); });
30552
30555
  };
30553
30556
  QuestionMatrixDropdownModelBase.prototype.runFuncForCellQuestions = function (func) {
30554
- if (!!this.generatedVisibleRows) {
30555
- for (var i = 0; i < this.generatedVisibleRows.length; i++) {
30556
- var row = this.generatedVisibleRows[i];
30557
- for (var j = 0; j < row.cells.length; j++) {
30558
- func(row.cells[j].question);
30557
+ var rows = this.generatedVisibleRows;
30558
+ if (!!rows) {
30559
+ for (var i = 0; i < rows.length; i++) {
30560
+ var row = rows[i];
30561
+ if (row.isVisible) {
30562
+ for (var j = 0; j < row.cells.length; j++) {
30563
+ func(row.cells[j].question);
30564
+ }
30559
30565
  }
30560
30566
  }
30561
30567
  }
@@ -31148,6 +31154,7 @@ var question_matrixdropdownbase_QuestionMatrixDropdownModelBase = /** @class */
31148
31154
  return [];
31149
31155
  };
31150
31156
  QuestionMatrixDropdownModelBase.prototype.getProgressInfo = function () {
31157
+ this.getIsRequireToGenerateRows() && this.generateVisibleRowsIfNeeded();
31151
31158
  if (!!this.generatedVisibleRows)
31152
31159
  return survey_element_SurveyElement.getProgressInfoByElements(this.getCellQuestions(), this.isRequired);
31153
31160
  var res = base_Base.createProgressInfo();
@@ -31158,6 +31165,9 @@ var question_matrixdropdownbase_QuestionMatrixDropdownModelBase = /** @class */
31158
31165
  }
31159
31166
  return res;
31160
31167
  };
31168
+ QuestionMatrixDropdownModelBase.prototype.getIsRequireToGenerateRows = function () {
31169
+ return !!this.rowsVisibleIf;
31170
+ };
31161
31171
  QuestionMatrixDropdownModelBase.prototype.updateProgressInfoByValues = function (res) { };
31162
31172
  QuestionMatrixDropdownModelBase.prototype.updateProgressInfoByRow = function (res, rowValue) {
31163
31173
  for (var i = 0; i < this.columns.length; i++) {
@@ -32136,6 +32146,15 @@ var question_matrixdropdown_QuestionMatrixDropdownModel = /** @class */ (functio
32136
32146
  QuestionMatrixDropdownModel.prototype.getSearchableItemValueKeys = function (keys) {
32137
32147
  keys.push("rows");
32138
32148
  };
32149
+ QuestionMatrixDropdownModel.prototype.getIsRequireToGenerateRows = function () {
32150
+ if (_super.prototype.getIsRequireToGenerateRows.call(this))
32151
+ return true;
32152
+ for (var i = 0; i < this.rows.length; i++) {
32153
+ if (!!this.rows[i].visibleIf)
32154
+ return true;
32155
+ }
32156
+ return false;
32157
+ };
32139
32158
  QuestionMatrixDropdownModel.prototype.updateProgressInfoByValues = function (res) {
32140
32159
  var val = this.value;
32141
32160
  if (!val)
@@ -34628,6 +34647,8 @@ var defaultV2Css = {
34628
34647
  imagepicker: {
34629
34648
  mainRoot: "sd-element sd-question sd-row__question",
34630
34649
  root: "sd-selectbase sd-imagepicker",
34650
+ rootResponsive: "sd-imagepicker--responsive",
34651
+ rootStatic: "sd-imagepicker--static",
34631
34652
  rootColumn: "sd-imagepicker--column",
34632
34653
  item: "sd-imagepicker__item",
34633
34654
  itemOnError: "sd-imagepicker__item--error",
@@ -45682,6 +45703,7 @@ var survey_SurveyModel = /** @class */ (function (_super) {
45682
45703
  this.startTimerFromUI();
45683
45704
  this.onStarted.fire(this, {});
45684
45705
  this.updateVisibleIndexes();
45706
+ this.currentPageNo = 0;
45685
45707
  if (!!this.currentPage) {
45686
45708
  this.currentPage.locStrsChanged();
45687
45709
  }
@@ -46931,6 +46953,7 @@ var survey_SurveyModel = /** @class */ (function (_super) {
46931
46953
  question.onSurveyValueChanged(newValue);
46932
46954
  }
46933
46955
  }
46956
+ this.updateProgressText(true);
46934
46957
  this.fireOnValueChanged(valueName, newValue, !!questionName ? this.getQuestionByName(questionName) : undefined);
46935
46958
  if (this.isDisposed)
46936
46959
  return;
@@ -62570,7 +62593,7 @@ var question_file_QuestionFileModel = /** @class */ (function (_super) {
62570
62593
  if (this.needConfirmRemoveFile) {
62571
62594
  confirmActionAsync({
62572
62595
  message: this.getConfirmRemoveMessage(data.name),
62573
- funcOnYes: function () { _this.clearFilesCore(); },
62596
+ funcOnYes: function () { _this.removeFileCore(data); },
62574
62597
  locale: this.getLocale(),
62575
62598
  rootElement: this.survey.rootElement,
62576
62599
  cssClass: this.cssClasses.confirmDialog
@@ -63748,21 +63771,13 @@ var question_rating_QuestionRatingModel = /** @class */ (function (_super) {
63748
63771
  });
63749
63772
  Object.defineProperty(QuestionRatingModel.prototype, "ratingRootCss", {
63750
63773
  get: function () {
63751
- var baseClassModifier = ((this.displayMode == "buttons" || (!!this.survey && this.survey.isDesignMode)) && this.cssClasses.rootWrappable) ?
63752
- this.cssClasses.rootWrappable : "";
63753
- var rootClassModifier = "";
63754
- if (this.hasMaxLabel || this.hasMinLabel) {
63755
- if (this.rateDescriptionLocation == "top")
63756
- rootClassModifier = this.cssClasses.rootLabelsTop;
63757
- if (this.rateDescriptionLocation == "bottom")
63758
- rootClassModifier = this.cssClasses.rootLabelsBottom;
63759
- if (this.rateDescriptionLocation == "topBottom")
63760
- rootClassModifier = this.cssClasses.rootLabelsDiagonal;
63761
- }
63774
+ var hasLabel = this.hasMaxLabel || this.hasMinLabel;
63762
63775
  return new CssClassBuilder()
63763
63776
  .append(this.cssClasses.root)
63764
- .append(baseClassModifier)
63765
- .append(rootClassModifier)
63777
+ .append(this.cssClasses.rootWrappable, this.displayMode == "buttons" || (!!this.survey && this.survey.isDesignMode) || (this.displayMode == "auto" && !this.supportResponsiveness()))
63778
+ .append(this.cssClasses.rootLabelsTop, hasLabel && this.rateDescriptionLocation == "top")
63779
+ .append(this.cssClasses.rootLabelsBottom, hasLabel && this.rateDescriptionLocation == "bottom")
63780
+ .append(this.cssClasses.rootLabelsDiagonal, hasLabel && this.rateDescriptionLocation == "topBottom")
63766
63781
  .append(this.cssClasses.itemSmall, this.itemSmallMode && this.rateType != "labels")
63767
63782
  .toString();
63768
63783
  },
@@ -63988,7 +64003,7 @@ var question_rating_QuestionRatingModel = /** @class */ (function (_super) {
63988
64003
  };
63989
64004
  // TODO: return responsiveness after design improvement
63990
64005
  QuestionRatingModel.prototype.supportResponsiveness = function () {
63991
- return true;
64006
+ return !this.inMatrixMode;
63992
64007
  };
63993
64008
  QuestionRatingModel.prototype.onBeforeSetCompactRenderer = function () {
63994
64009
  if (!this.dropdownListModelValue) {
@@ -64822,6 +64837,7 @@ var question_imagepicker_QuestionImagePickerModel = /** @class */ (function (_su
64822
64837
  }
64823
64838
  _this._width && _this.processResponsiveness(0, _this._width);
64824
64839
  };
64840
+ _this.gridColCount = undefined;
64825
64841
  _this.colCount = 0;
64826
64842
  _this.registerPropertyChangedHandlers(["minImageWidth", "maxImageWidth", "minImageHeight", "maxImageHeight", "visibleChoices", "colCount", "isResponsiveValue"], function () {
64827
64843
  if (!!_this._width) {
@@ -65100,7 +65116,13 @@ var question_imagepicker_QuestionImagePickerModel = /** @class */ (function (_su
65100
65116
  this.addNewItemToVisibleChoices(items, isAddAll);
65101
65117
  };
65102
65118
  QuestionImagePickerModel.prototype.getSelectBaseRootCss = function () {
65103
- return new CssClassBuilder().append(_super.prototype.getSelectBaseRootCss.call(this)).append(this.cssClasses.rootColumn, this.getCurrentColCount() == 1).toString();
65119
+ var isResponsive = this.isResponsive;
65120
+ return new CssClassBuilder()
65121
+ .append(_super.prototype.getSelectBaseRootCss.call(this))
65122
+ .append(this.cssClasses.rootResponsive, isResponsive)
65123
+ .append(this.cssClasses.rootStatic, !isResponsive)
65124
+ .append(this.cssClasses.rootColumn, this.getCurrentColCount() == 1)
65125
+ .toString();
65104
65126
  };
65105
65127
  Object.defineProperty(QuestionImagePickerModel.prototype, "isResponsive", {
65106
65128
  get: function () {
@@ -65138,6 +65160,14 @@ var question_imagepicker_QuestionImagePickerModel = /** @class */ (function (_su
65138
65160
  }
65139
65161
  return this.responsiveColCount;
65140
65162
  };
65163
+ QuestionImagePickerModel.prototype.getContainerStyle = function () {
65164
+ if (!this.isResponsive)
65165
+ return {};
65166
+ return {
65167
+ gridAutoFlow: !this.gridColCount ? "column" : null,
65168
+ gridTemplateColumns: this.gridColCount ? "repeat(" + this.gridColCount + ", 1fr)" : null
65169
+ };
65170
+ };
65141
65171
  QuestionImagePickerModel.prototype.processResponsiveness = function (_, availableWidth) {
65142
65172
  this._width = availableWidth = Math.floor(availableWidth);
65143
65173
  var calcAvailableColumnsCount = function (availableWidth, minWidth, gap) {
@@ -65155,24 +65185,25 @@ var question_imagepicker_QuestionImagePickerModel = /** @class */ (function (_su
65155
65185
  var minHeight = this.minImageHeight * this.imageScale;
65156
65186
  var colCount = this.colCount;
65157
65187
  var width_1;
65188
+ var availableColumnsCount = calcAvailableColumnsCount(availableWidth, minWidth, gap);
65158
65189
  if (colCount === 0) {
65159
65190
  if ((gap + minWidth) * itemsCount - gap > availableWidth) {
65160
- var itemsInRow = calcAvailableColumnsCount(availableWidth, minWidth, gap);
65161
- width_1 = Math.floor((availableWidth - gap * (itemsInRow - 1)) / itemsInRow);
65191
+ width_1 = Math.floor((availableWidth - gap * (availableColumnsCount - 1)) / availableColumnsCount);
65162
65192
  }
65163
65193
  else {
65164
65194
  width_1 = Math.floor(((availableWidth - gap * (itemsCount - 1)) / itemsCount));
65165
65195
  }
65196
+ this.gridColCount = Math.max(Math.min(itemsCount, availableColumnsCount), 1);
65166
65197
  }
65167
65198
  else {
65168
- var availableColumnsCount = calcAvailableColumnsCount(availableWidth, minWidth, gap);
65169
65199
  if (availableColumnsCount < colCount) {
65170
- this.responsiveColCount = availableColumnsCount >= 1 ? availableColumnsCount : 1;
65200
+ this.responsiveColCount = Math.max(availableColumnsCount, 1);
65171
65201
  colCount = this.responsiveColCount;
65172
65202
  }
65173
65203
  else {
65174
65204
  this.responsiveColCount = colCount;
65175
65205
  }
65206
+ this.gridColCount = this.responsiveColCount;
65176
65207
  width_1 = Math.floor((availableWidth - gap * (colCount - 1)) / colCount);
65177
65208
  }
65178
65209
  width_1 = Math.max(minWidth, Math.min(width_1, maxWidth));
@@ -65238,6 +65269,9 @@ var question_imagepicker_QuestionImagePickerModel = /** @class */ (function (_su
65238
65269
  question_imagepicker_decorate([
65239
65270
  jsonobject_property({})
65240
65271
  ], QuestionImagePickerModel.prototype, "responsiveColCount", void 0);
65272
+ question_imagepicker_decorate([
65273
+ jsonobject_property()
65274
+ ], QuestionImagePickerModel.prototype, "gridColCount", void 0);
65241
65275
  return QuestionImagePickerModel;
65242
65276
  }(QuestionCheckboxBase));
65243
65277
 
@@ -72764,9 +72798,9 @@ Serializer.addClass("currencymask", [
72764
72798
 
72765
72799
  var Version;
72766
72800
  var ReleaseDate;
72767
- Version = "" + "1.12.25";
72801
+ Version = "" + "1.12.26";
72768
72802
  settings.version = Version;
72769
- ReleaseDate = "" + "2025-02-25";
72803
+ ReleaseDate = "" + "2025-03-03";
72770
72804
  function checkLibraryVersion(ver, libraryName) {
72771
72805
  if (Version != ver) {
72772
72806
  var str = "survey-core has version '" + Version + "' and " + libraryName
@@ -90822,7 +90856,7 @@ var imagepicker_SurveyQuestionImagePicker = /** @class */ (function (_super) {
90822
90856
  });
90823
90857
  SurveyQuestionImagePicker.prototype.renderElement = function () {
90824
90858
  var cssClasses = this.question.cssClasses;
90825
- return (external_root_React_commonjs2_react_commonjs_react_amd_react_["createElement"]("fieldset", { className: this.question.getSelectBaseRootCss() },
90859
+ return (external_root_React_commonjs2_react_commonjs_react_amd_react_["createElement"]("fieldset", { className: this.question.getSelectBaseRootCss(), style: this.question.getContainerStyle() },
90826
90860
  external_root_React_commonjs2_react_commonjs_react_amd_react_["createElement"]("legend", { className: "sv-hidden" }, this.question.locTitle.renderedHtml),
90827
90861
  this.question.hasColumns ? this.getColumns(cssClasses) : this.getItems(cssClasses)));
90828
90862
  };