survey-react-ui 2.5.24 → 2.5.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "survey-react-ui",
3
- "version": "2.5.24",
3
+ "version": "2.5.26",
4
4
  "license": "MIT",
5
5
  "author": "DevSoft Baltic OU <info@devsoftbaltic.com>",
6
6
  "homepage": "https://surveyjs.io/",
@@ -51,7 +51,7 @@
51
51
  }
52
52
  },
53
53
  "peerDependencies": {
54
- "survey-core": "2.5.24",
54
+ "survey-core": "2.5.26",
55
55
  "react": "^16.5.0 || ^17.0.1 || ^18.1.0 || ^19.0.0",
56
56
  "react-dom": "^16.5.0 || ^17.0.1 || ^18.1.0 || ^19.0.0"
57
57
  }
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - Survey JavaScript library v2.5.24
2
+ * surveyjs - Survey JavaScript library v2.5.26
3
3
  * Copyright (c) 2015-2026 Devsoft Baltic OÜ - http://surveyjs.io/
4
4
  * License: MIT (http://www.opensource.org/licenses/mit-license.php)
5
5
  */
@@ -588,8 +588,8 @@
588
588
  this.locStr.onStringChanged.remove(this.onChangedHandler);
589
589
  };
590
590
  SurveyLocStringViewer.prototype.componentDidUpdate = function (prevProps, prevState) {
591
- if (!!prevProps.locStr) {
592
- prevProps.locStr.onStringChanged.remove(this.onChangedHandler);
591
+ if (!!prevProps.model) {
592
+ prevProps.model.onStringChanged.remove(this.onChangedHandler);
593
593
  }
594
594
  this.reactOnStrChanged();
595
595
  };
@@ -5307,7 +5307,9 @@
5307
5307
  var _this = this;
5308
5308
  var cssClasses = this.question.cssClasses;
5309
5309
  var handleOnChange = function () {
5310
- _this.question.value = value;
5310
+ if (!_this.question.isInputReadOnly) {
5311
+ _this.question.value = value;
5312
+ }
5311
5313
  };
5312
5314
  return (React__namespace.createElement("div", { role: "presentation", className: this.question.getRadioItemClass(cssClasses, value) },
5313
5315
  React__namespace.createElement("label", { className: cssClasses.radioLabel },
@@ -5320,7 +5322,7 @@
5320
5322
  };
5321
5323
  SurveyQuestionBooleanRadio.prototype.renderElement = function () {
5322
5324
  var cssClasses = this.question.cssClasses;
5323
- return (React__namespace.createElement("div", { className: cssClasses.rootRadio },
5325
+ return (React__namespace.createElement("div", { className: cssClasses.rootRadio, onKeyDown: this.handleOnKeyDown },
5324
5326
  React__namespace.createElement("fieldset", { role: "presentation", className: cssClasses.radioFieldset }, !this.question.swapOrder ?
5325
5327
  (React__namespace.createElement(React__namespace.Fragment, null,
5326
5328
  this.renderRadioItem(this.question.getValueFalse(), this.question.locLabelFalse),
@@ -7447,6 +7449,13 @@
7447
7449
  enumerable: false,
7448
7450
  configurable: true
7449
7451
  });
7452
+ Object.defineProperty(SurveyQuestionPanelDynamicAction.prototype, "isActionEnabled", {
7453
+ get: function () {
7454
+ return !this.props.item || this.props.item.enabled !== false;
7455
+ },
7456
+ enumerable: false,
7457
+ configurable: true
7458
+ });
7450
7459
  return SurveyQuestionPanelDynamicAction;
7451
7460
  }(ReactSurveyElement));
7452
7461
  var SurveyQuestionPanelDynamicAddButton = /** @class */ (function (_super) {
@@ -7454,6 +7463,8 @@
7454
7463
  function SurveyQuestionPanelDynamicAddButton() {
7455
7464
  var _this = _super !== null && _super.apply(this, arguments) || this;
7456
7465
  _this.handleClick = function (event) {
7466
+ if (!_this.isActionEnabled)
7467
+ return;
7457
7468
  _this.question.addPanelUI();
7458
7469
  };
7459
7470
  return _this;
@@ -7462,7 +7473,7 @@
7462
7473
  if (!this.question.canAddPanel)
7463
7474
  return null;
7464
7475
  var btnText = this.renderLocString(this.question.locAddPanelText);
7465
- return (React__namespace.createElement("button", { type: "button", id: this.question.addButtonId, className: this.question.getAddButtonCss(), onClick: this.handleClick },
7476
+ return (React__namespace.createElement("button", { type: "button", id: this.question.addButtonId, className: this.question.getAddButtonCss(), onClick: this.handleClick, disabled: !this.isActionEnabled },
7466
7477
  React__namespace.createElement("span", { className: this.question.cssClasses.buttonAddText }, btnText)));
7467
7478
  };
7468
7479
  return SurveyQuestionPanelDynamicAddButton;
@@ -7476,6 +7487,8 @@
7476
7487
  function SurveyQuestionPanelDynamicRemoveButton() {
7477
7488
  var _this = _super !== null && _super.apply(this, arguments) || this;
7478
7489
  _this.handleClick = function (event) {
7490
+ if (!_this.isActionEnabled)
7491
+ return;
7479
7492
  _this.question.removePanelUI(_this.data.panel);
7480
7493
  };
7481
7494
  return _this;
@@ -7483,7 +7496,7 @@
7483
7496
  SurveyQuestionPanelDynamicRemoveButton.prototype.renderElement = function () {
7484
7497
  var btnText = this.renderLocString(this.question.locRemovePanelText);
7485
7498
  var id = this.question.getPanelRemoveButtonId(this.data.panel);
7486
- return (React__namespace.createElement("button", { id: id, className: this.question.getPanelRemoveButtonCss(), onClick: this.handleClick, type: "button" },
7499
+ return (React__namespace.createElement("button", { id: id, className: this.question.getPanelRemoveButtonCss(), onClick: this.handleClick, disabled: !this.isActionEnabled, type: "button" },
7487
7500
  React__namespace.createElement("span", { className: this.question.cssClasses.buttonRemoveText }, btnText),
7488
7501
  React__namespace.createElement("span", { className: this.question.cssClasses.iconRemove })));
7489
7502
  };
@@ -7548,7 +7561,18 @@
7548
7561
  var SurveyNavigationButton = /** @class */ (function (_super) {
7549
7562
  __extends(SurveyNavigationButton, _super);
7550
7563
  function SurveyNavigationButton() {
7551
- return _super !== null && _super.apply(this, arguments) || this;
7564
+ var _this = _super !== null && _super.apply(this, arguments) || this;
7565
+ _this.inputElement = null;
7566
+ _this.inputParent = null;
7567
+ _this.setInputRef = function (element) {
7568
+ var _a;
7569
+ if (!element && !!_this.inputElement && !!_this.inputParent && _this.inputElement.parentNode !== _this.inputParent) {
7570
+ _this.inputParent.appendChild(_this.inputElement);
7571
+ }
7572
+ _this.inputElement = element;
7573
+ _this.inputParent = (_a = element === null || element === void 0 ? void 0 : element.parentNode) !== null && _a !== void 0 ? _a : _this.inputParent;
7574
+ };
7575
+ return _this;
7552
7576
  }
7553
7577
  Object.defineProperty(SurveyNavigationButton.prototype, "item", {
7554
7578
  get: function () {
@@ -7561,7 +7585,7 @@
7561
7585
  return this.item.isVisible;
7562
7586
  };
7563
7587
  SurveyNavigationButton.prototype.renderElement = function () {
7564
- return (React__namespace.createElement("input", { className: this.item.innerCss, type: "button", disabled: this.item.disabled, onMouseDown: this.item.data && this.item.data.mouseDown, onClick: this.item.action, title: this.item.getTooltip(), value: this.item.title }));
7588
+ return (React__namespace.createElement("input", { ref: this.setInputRef, className: this.item.innerCss, type: "button", disabled: this.item.disabled, onMouseDown: this.item.data && this.item.data.mouseDown, onClick: this.item.action, title: this.item.getTooltip(), value: this.item.title }));
7565
7589
  };
7566
7590
  return SurveyNavigationButton;
7567
7591
  }(ReactSurveyElement));
@@ -7813,7 +7837,7 @@
7813
7837
  return React__namespace.createElement(SurveyLocStringEditor, props);
7814
7838
  });
7815
7839
 
7816
- surveyCore.checkLibraryVersion("".concat("2.5.24"), "survey-react-ui");
7840
+ surveyCore.checkLibraryVersion("".concat("2.5.26"), "survey-react-ui");
7817
7841
 
7818
7842
  Object.defineProperty(exports, "Model", {
7819
7843
  enumerable: true,