survey-react 1.12.31 → 1.12.33

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.31
2
+ * surveyjs - Survey JavaScript library v1.12.33
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.31
2
+ * surveyjs - Survey JavaScript library v1.12.33
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.31",
3
+ "version": "1.12.33",
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.31
2
+ * surveyjs - Survey JavaScript library v1.12.33
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.31
2
+ * surveyjs - Survey JavaScript library v1.12.33
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
@@ -3635,6 +3635,7 @@ declare module "packages/survey-core/src/panel" {
3635
3635
  updateElementVisibility(): void;
3636
3636
  getFirstQuestionToFocus(withError?: boolean, ignoreCollapseState?: boolean): Question;
3637
3637
  getFirstVisibleQuestion(): Question;
3638
+ getFirstVisibleElement(): IElement;
3638
3639
  /**
3639
3640
  * Focuses the first question in this panel/page.
3640
3641
  * @see focusFirstErrorQuestion
@@ -4241,6 +4242,7 @@ declare module "packages/survey-core/src/question_file" {
4241
4242
  get multipleRendered(): string;
4242
4243
  get showChooseButton(): boolean;
4243
4244
  get showFileDecorator(): boolean;
4245
+ get showDragAreaPlaceholder(): boolean;
4244
4246
  get allowShowPreview(): boolean;
4245
4247
  get showPreviewContainer(): boolean;
4246
4248
  get showRemoveButtonCore(): boolean;
@@ -9281,6 +9283,7 @@ declare module "packages/survey-core/src/question_text" {
9281
9283
  onCompositionUpdate: (event: any) => void;
9282
9284
  onKeyUp: (event: any) => void;
9283
9285
  private updateDateValidationMessage;
9286
+ readOnlyBlocker: (event: any) => boolean;
9284
9287
  onKeyDown: (event: any) => void;
9285
9288
  onChange: (event: any) => void;
9286
9289
  protected onBlurCore(event: any): void;
@@ -14665,6 +14668,7 @@ declare module "packages/survey-core/src/question_matrixdropdownbase" {
14665
14668
  getAllValues(): any;
14666
14669
  getFilteredValues(): any;
14667
14670
  getFilteredProperties(): any;
14671
+ private getDataRowValue;
14668
14672
  private applyRowVariablesToValues;
14669
14673
  runCondition(values: HashTable<any>, properties: HashTable<any>, rowsVisibleIf?: string): void;
14670
14674
  updateElementVisibility(): void;
package/survey.react.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - Survey JavaScript library v1.12.31
2
+ * surveyjs - Survey JavaScript library v1.12.33
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
  */
@@ -25814,7 +25814,9 @@ var question_custom_QuestionCompositeModel = /** @class */ (function (_super) {
25814
25814
  if (!!q && q.comment !== newValue) {
25815
25815
  q.comment = newValue;
25816
25816
  }
25817
- this.value = val;
25817
+ if (!this.settingNewValue) {
25818
+ this.value = val;
25819
+ }
25818
25820
  };
25819
25821
  QuestionCompositeModel.prototype.getComment = function (name) {
25820
25822
  var q = this.getQuestionByName(name);
@@ -29418,7 +29420,7 @@ var question_matrixdropdownbase_MatrixDropdownRowModelBase = /** @class */ (func
29418
29420
  this.isCreatingDetailPanel = true;
29419
29421
  this.detailPanelValue = this.data.createRowDetailPanel(this);
29420
29422
  var questions = this.detailPanelValue.questions;
29421
- var value = this.data.getRowValue(this.data.getRowIndex(this));
29423
+ var value = this.getDataRowValue();
29422
29424
  if (!helpers_Helpers.isValueEmpty(value)) {
29423
29425
  for (var i = 0; i < questions.length; i++) {
29424
29426
  var key = questions[i].getValueName();
@@ -29443,12 +29445,27 @@ var question_matrixdropdownbase_MatrixDropdownRowModelBase = /** @class */ (func
29443
29445
  }
29444
29446
  }
29445
29447
  res.row = this.getAllValues();
29448
+ if (this.data) {
29449
+ var rowVal = this.getDataRowValue();
29450
+ if (rowVal) {
29451
+ for (var key in rowVal) {
29452
+ if (res.row[key] === undefined) {
29453
+ res.row[key] = rowVal[key];
29454
+ }
29455
+ }
29456
+ }
29457
+ }
29446
29458
  this.applyRowVariablesToValues(res, this.rowIndex);
29447
29459
  return res;
29448
29460
  };
29449
29461
  MatrixDropdownRowModelBase.prototype.getFilteredProperties = function () {
29450
29462
  return { survey: this.getSurvey(), row: this };
29451
29463
  };
29464
+ MatrixDropdownRowModelBase.prototype.getDataRowValue = function () {
29465
+ if (!this.data)
29466
+ return null;
29467
+ return this.data.getRowValue(this.data.getRowIndex(this));
29468
+ };
29452
29469
  MatrixDropdownRowModelBase.prototype.applyRowVariablesToValues = function (res, rowIndex) {
29453
29470
  res[MatrixDropdownRowModelBase.IndexVariableName] = rowIndex;
29454
29471
  res[MatrixDropdownRowModelBase.RowValueVariableName] = this.rowName;
@@ -29462,7 +29479,7 @@ var question_matrixdropdownbase_MatrixDropdownRowModelBase = /** @class */ (func
29462
29479
  this.applyRowVariablesToValues(values, rowIndex);
29463
29480
  var newProps = helpers_Helpers.createCopy(properties);
29464
29481
  newProps[MatrixDropdownRowModelBase.RowVariableName] = this;
29465
- var rowValues = rowIndex > 0 ? this.data.getRowValue(this.rowIndex - 1) : this.value;
29482
+ var rowValues = rowIndex > 0 ? this.getDataRowValue() : this.value;
29466
29483
  if (!!rowsVisibleIf) {
29467
29484
  values[MatrixDropdownRowModelBase.RowVariableName] = rowValues;
29468
29485
  this.setRowsVisibleIfValues(values);
@@ -37579,6 +37596,14 @@ var panel_PanelModelBase = /** @class */ (function (_super) {
37579
37596
  }
37580
37597
  return null;
37581
37598
  };
37599
+ PanelModelBase.prototype.getFirstVisibleElement = function () {
37600
+ var els = this.elements;
37601
+ for (var i = 0; i < els.length; i++) {
37602
+ if (els[i].isVisible)
37603
+ return els[i];
37604
+ }
37605
+ return null;
37606
+ };
37582
37607
  /**
37583
37608
  * Focuses the first question in this panel/page.
37584
37609
  * @see focusFirstErrorQuestion
@@ -38896,7 +38921,7 @@ var panel_PanelModel = /** @class */ (function (_super) {
38896
38921
  return this.showQuestionNumbers !== "off" && this.showQuestionNumbers !== "onpanel";
38897
38922
  };
38898
38923
  PanelModel.prototype.notifySurveyOnVisibilityChanged = function () {
38899
- if (this.survey != null && !this.isLoadingFromJson && !!this.page) {
38924
+ if (this.survey != null && !this.isLoadingFromJson) {
38900
38925
  this.survey.panelVisibilityChanged(this, this.isVisible);
38901
38926
  }
38902
38927
  };
@@ -39818,7 +39843,7 @@ var page_PageModel = /** @class */ (function (_super) {
39818
39843
  */
39819
39844
  PageModel.prototype.scrollToTop = function () {
39820
39845
  if (!!this.survey) {
39821
- this.survey.scrollElementToTop(this, null, this, this.id);
39846
+ this.survey.scrollElementToTop(this, null, this, this.id, true, { block: "start" });
39822
39847
  }
39823
39848
  };
39824
39849
  /**
@@ -42773,7 +42798,7 @@ var survey_SurveyModel = /** @class */ (function (_super) {
42773
42798
  get: function () {
42774
42799
  if (this.isDesignMode)
42775
42800
  return this.isPropertyVisible("description");
42776
- return !!this.hasDescription;
42801
+ return !!this.hasDescription && this.showTitle;
42777
42802
  },
42778
42803
  enumerable: false,
42779
42804
  configurable: true
@@ -48038,20 +48063,24 @@ var survey_SurveyModel = /** @class */ (function (_super) {
48038
48063
  if (!newValue) {
48039
48064
  this.changeCurrentSingleElementOnVisibilityChanged();
48040
48065
  }
48066
+ var el = this.currentSingleElement;
48067
+ var curPage = this.currentPage;
48068
+ if (!!el && !!curPage && el.page !== curPage) {
48069
+ this.currentSingleElement = curPage.getFirstVisibleElement();
48070
+ }
48041
48071
  this.onPageVisibleChanged.fire(this, {
48042
48072
  page: page,
48043
48073
  visible: newValue,
48044
48074
  });
48045
48075
  };
48046
48076
  SurveyModel.prototype.panelVisibilityChanged = function (panel, newValue) {
48047
- this.updateVisibleIndexes(panel.page);
48048
- if (!newValue) {
48049
- this.changeCurrentSingleElementOnVisibilityChanged();
48077
+ if (!!panel.page) {
48078
+ this.updateVisibleIndexes(panel.page);
48079
+ if (!newValue) {
48080
+ this.changeCurrentSingleElementOnVisibilityChanged();
48081
+ }
48050
48082
  }
48051
- this.onPanelVisibleChanged.fire(this, {
48052
- panel: panel,
48053
- visible: newValue,
48054
- });
48083
+ this.onPanelVisibleChanged.fire(this, { panel: panel, visible: newValue });
48055
48084
  };
48056
48085
  SurveyModel.prototype.questionCreated = function (question) {
48057
48086
  this.onQuestionCreated.fire(this, { question: question });
@@ -51184,8 +51213,10 @@ var question_baseselect_QuestionSelectBase = /** @class */ (function (_super) {
51184
51213
  return this.getQuestionWithChoicesCore(this.findCarryForwardQuestion());
51185
51214
  };
51186
51215
  QuestionSelectBase.prototype.findCarryForwardQuestion = function (data) {
51187
- if (!data)
51188
- data = this.data;
51216
+ var _a;
51217
+ if (!data) {
51218
+ data = this.data || ((_a = this.parentQuestion) === null || _a === void 0 ? void 0 : _a.data);
51219
+ }
51189
51220
  this.carryForwardQuestion = null;
51190
51221
  if (this.choicesFromQuestion && data) {
51191
51222
  this.carryForwardQuestion = data.findQuestionByName(this.choicesFromQuestion);
@@ -55516,7 +55547,7 @@ var InputElementAdapter = /** @class */ (function () {
55516
55547
  if (_value === null || _value === undefined) {
55517
55548
  _value = "";
55518
55549
  }
55519
- this.setInputValue(inputMaskInstance.getMaskedValue(_value));
55550
+ this.setInputValue(inputMaskInstance.saveMaskedValue ? _value : inputMaskInstance.getMaskedValue(_value));
55520
55551
  this.prevUnmaskedValue = _value;
55521
55552
  inputMaskInstance.onPropertyChanged.add(this.inputMaskInstancePropertyChangedHandler);
55522
55553
  this.addInputEventListener();
@@ -55653,7 +55684,16 @@ var question_text_QuestionTextModel = /** @class */ (function (_super) {
55653
55684
  }
55654
55685
  _this.updateRemainingCharacterCounter(event.target.value);
55655
55686
  };
55687
+ _this.readOnlyBlocker = function (event) {
55688
+ if (_this.isReadOnlyAttr) {
55689
+ event.preventDefault();
55690
+ return true;
55691
+ }
55692
+ };
55656
55693
  _this.onKeyDown = function (event) {
55694
+ if (_this.readOnlyBlocker(event)) {
55695
+ return;
55696
+ }
55657
55697
  _this.onKeyDownPreprocess && _this.onKeyDownPreprocess(event);
55658
55698
  if (_this.isInputTextUpdate) {
55659
55699
  _this._isWaitingForEnter = event.keyCode === 229;
@@ -56663,7 +56703,9 @@ var question_multipletext_MultipleTextItemModel = /** @class */ (function (_supe
56663
56703
  _this.title = title;
56664
56704
  }
56665
56705
  _this.editor.onPropertyChanged.add(function (sender, options) {
56666
- _this.onPropertyChanged.fire(_this, options);
56706
+ if (options.name !== "maskSettings") {
56707
+ _this.onPropertyChanged.fire(_this, options);
56708
+ }
56667
56709
  });
56668
56710
  return _this;
56669
56711
  }
@@ -62307,6 +62349,13 @@ var question_file_QuestionFileModel = /** @class */ (function (_super) {
62307
62349
  enumerable: false,
62308
62350
  configurable: true
62309
62351
  });
62352
+ Object.defineProperty(QuestionFileModel.prototype, "showDragAreaPlaceholder", {
62353
+ get: function () {
62354
+ return !this.isAnswered;
62355
+ },
62356
+ enumerable: false,
62357
+ configurable: true
62358
+ });
62310
62359
  Object.defineProperty(QuestionFileModel.prototype, "allowShowPreview", {
62311
62360
  get: function () {
62312
62361
  var isShowLoadingIndicator = this.showLoadingIndicator;
@@ -68100,6 +68149,7 @@ var question_paneldynamic_QuestionPanelDynamicModel = /** @class */ (function (_
68100
68149
  return;
68101
68150
  if (!this.canBuildPanels || this.wasNotRenderedInSurvey) {
68102
68151
  this.setPropertyValue("panelCount", val);
68152
+ this.updateFooterActions();
68103
68153
  return;
68104
68154
  }
68105
68155
  if (val == this.panelsCore.length || this.useTemplatePanel)
@@ -68845,15 +68895,18 @@ var question_paneldynamic_QuestionPanelDynamicModel = /** @class */ (function (_
68845
68895
  this.panelsCore.splice(index, 1);
68846
68896
  this.updateBindings("panelCount", this.panelCount);
68847
68897
  var value = this.value;
68848
- if (!value || !Array.isArray(value) || index >= value.length)
68849
- return;
68850
- this.isValueChangingInternally = true;
68851
- value.splice(index, 1);
68852
- this.value = value;
68853
- this.updateFooterActions();
68854
- this.fireCallback(this.panelCountChangedCallback);
68855
- this.notifyOnPanelAddedRemoved(false, index, panel);
68856
- this.isValueChangingInternally = false;
68898
+ if (!value || !Array.isArray(value) || index >= value.length) {
68899
+ this.updateFooterActions();
68900
+ }
68901
+ else {
68902
+ this.isValueChangingInternally = true;
68903
+ value.splice(index, 1);
68904
+ this.value = value;
68905
+ this.updateFooterActions();
68906
+ this.fireCallback(this.panelCountChangedCallback);
68907
+ this.notifyOnPanelAddedRemoved(false, index, panel);
68908
+ this.isValueChangingInternally = false;
68909
+ }
68857
68910
  };
68858
68911
  QuestionPanelDynamicModel.prototype.notifyOnPanelAddedRemoved = function (isAdded, index, panel) {
68859
68912
  if (!panel) {
@@ -72946,9 +72999,9 @@ Serializer.addClass("currencymask", [
72946
72999
 
72947
73000
  var Version;
72948
73001
  var ReleaseDate;
72949
- Version = "" + "1.12.31";
73002
+ Version = "" + "1.12.33";
72950
73003
  settings.version = Version;
72951
- ReleaseDate = "" + "2025-04-08";
73004
+ ReleaseDate = "" + "2025-04-24";
72952
73005
  function checkLibraryVersion(ver, libraryName) {
72953
73006
  if (Version != ver) {
72954
73007
  var str = "survey-core has version '" + Version + "' and " + libraryName
@@ -86982,7 +87035,7 @@ var reactquestion_ranking_SurveyQuestionRankingItem = /** @class */ (function (_
86982
87035
  };
86983
87036
  SurveyQuestionRankingItem.prototype.renderElement = function () {
86984
87037
  var itemContent = ReactElementFactory.Instance.createElement(this.question.itemComponent, { item: this.item, cssClasses: this.cssClasses });
86985
- return (external_root_React_commonjs2_react_commonjs_react_amd_react_["createElement"]("div", { tabIndex: this.itemTabIndex, className: this.itemClass, onKeyDown: this.handleKeydown, onPointerDown: this.handlePointerDown, onPointerUp: this.handlePointerUp, "data-sv-drop-target-ranking-item": this.index },
87038
+ return (external_root_React_commonjs2_react_commonjs_react_amd_react_["createElement"]("div", { id: this.question.getItemId(this.item), tabIndex: this.itemTabIndex, className: this.itemClass, onKeyDown: this.handleKeydown, onPointerDown: this.handlePointerDown, onPointerUp: this.handlePointerUp, "data-sv-drop-target-ranking-item": this.index },
86986
87039
  external_root_React_commonjs2_react_commonjs_react_amd_react_["createElement"]("div", { tabIndex: -1, style: { outline: "none" } },
86987
87040
  external_root_React_commonjs2_react_commonjs_react_amd_react_["createElement"]("div", { className: this.cssClasses.itemGhostNode }),
86988
87041
  external_root_React_commonjs2_react_commonjs_react_amd_react_["createElement"]("div", { className: this.cssClasses.itemContent },
@@ -88246,7 +88299,7 @@ var reactquestion_file_SurveyQuestionFile = /** @class */ (function (_super) {
88246
88299
  var actionsContainer = this.question.actionsContainerVisible ? external_root_React_commonjs2_react_commonjs_react_amd_react_["createElement"](action_bar_SurveyActionBar, { model: this.question.actionsContainer }) : null;
88247
88300
  var noFileChosen = this.question.isEmpty() ? (external_root_React_commonjs2_react_commonjs_react_amd_react_["createElement"]("span", { className: this.question.cssClasses.noFileChosen }, this.question.noFileChosenCaption)) : null;
88248
88301
  return (external_root_React_commonjs2_react_commonjs_react_amd_react_["createElement"]("div", { className: this.question.getFileDecoratorCss() },
88249
- external_root_React_commonjs2_react_commonjs_react_amd_react_["createElement"]("span", { className: this.question.cssClasses.dragAreaPlaceholder }, this.renderLocString(this.question.locRenderedPlaceholder)),
88302
+ this.question.showDragAreaPlaceholder ? external_root_React_commonjs2_react_commonjs_react_amd_react_["createElement"]("span", { className: this.question.cssClasses.dragAreaPlaceholder }, this.renderLocString(this.question.locRenderedPlaceholder)) : false,
88250
88303
  external_root_React_commonjs2_react_commonjs_react_amd_react_["createElement"]("div", { className: this.question.cssClasses.wrapper },
88251
88304
  chooseButton,
88252
88305
  actionsContainer,
@@ -88867,7 +88920,7 @@ var reactquestion_text_SurveyQuestionText = /** @class */ (function (_super) {
88867
88920
  // disabled={this.isDisplayMode}
88868
88921
  disabled: this.question.isDisabledAttr, readOnly: this.question.isReadOnlyAttr, className: inputClass, type: this.question.inputType,
88869
88922
  //ref={this.controlRef}
88870
- ref: function (input) { return (_this.setControl(input)); }, style: this.question.inputStyle, maxLength: this.question.getMaxLength(), min: this.question.renderedMin, max: this.question.renderedMax, step: this.question.renderedStep, size: this.question.inputSize, placeholder: placeholder, list: this.question.dataListId, autoComplete: this.question.autocomplete, onBlur: function (event) { _this.question.onBlur(event); }, onFocus: function (event) { _this.question.onFocus(event); }, onChange: this.question.onChange, onKeyUp: this.question.onKeyUp, onKeyDown: this.question.onKeyDown, onCompositionUpdate: function (event) { return _this.question.onCompositionUpdate(event.nativeEvent); }, "aria-required": this.question.a11y_input_ariaRequired, "aria-label": this.question.a11y_input_ariaLabel, "aria-labelledby": this.question.a11y_input_ariaLabelledBy, "aria-describedby": this.question.a11y_input_ariaDescribedBy, "aria-invalid": this.question.a11y_input_ariaInvalid, "aria-errormessage": this.question.a11y_input_ariaErrormessage }),
88923
+ ref: function (input) { return (_this.setControl(input)); }, style: this.question.inputStyle, maxLength: this.question.getMaxLength(), min: this.question.renderedMin, max: this.question.renderedMax, step: this.question.renderedStep, size: this.question.inputSize, placeholder: placeholder, list: this.question.dataListId, autoComplete: this.question.autocomplete, onBlur: function (event) { _this.question.onBlur(event); }, onFocus: function (event) { _this.question.onFocus(event); }, onChange: this.question.onChange, onClick: this.question.readOnlyBlocker, onPointerDown: this.question.readOnlyBlocker, onKeyUp: this.question.onKeyUp, onKeyDown: this.question.onKeyDown, onCompositionUpdate: function (event) { return _this.question.onCompositionUpdate(event.nativeEvent); }, "aria-required": this.question.a11y_input_ariaRequired, "aria-label": this.question.a11y_input_ariaLabel, "aria-labelledby": this.question.a11y_input_ariaLabelledBy, "aria-describedby": this.question.a11y_input_ariaDescribedBy, "aria-invalid": this.question.a11y_input_ariaInvalid, "aria-errormessage": this.question.a11y_input_ariaErrormessage }),
88871
88924
  counter));
88872
88925
  };
88873
88926
  SurveyQuestionText.prototype.renderElement = function () {