survey-react-ui 2.5.24 → 2.5.25

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.25",
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.25",
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.25
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
  */
@@ -7447,6 +7447,13 @@
7447
7447
  enumerable: false,
7448
7448
  configurable: true
7449
7449
  });
7450
+ Object.defineProperty(SurveyQuestionPanelDynamicAction.prototype, "isActionEnabled", {
7451
+ get: function () {
7452
+ return !this.props.item || this.props.item.enabled !== false;
7453
+ },
7454
+ enumerable: false,
7455
+ configurable: true
7456
+ });
7450
7457
  return SurveyQuestionPanelDynamicAction;
7451
7458
  }(ReactSurveyElement));
7452
7459
  var SurveyQuestionPanelDynamicAddButton = /** @class */ (function (_super) {
@@ -7454,6 +7461,8 @@
7454
7461
  function SurveyQuestionPanelDynamicAddButton() {
7455
7462
  var _this = _super !== null && _super.apply(this, arguments) || this;
7456
7463
  _this.handleClick = function (event) {
7464
+ if (!_this.isActionEnabled)
7465
+ return;
7457
7466
  _this.question.addPanelUI();
7458
7467
  };
7459
7468
  return _this;
@@ -7462,7 +7471,7 @@
7462
7471
  if (!this.question.canAddPanel)
7463
7472
  return null;
7464
7473
  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 },
7474
+ return (React__namespace.createElement("button", { type: "button", id: this.question.addButtonId, className: this.question.getAddButtonCss(), onClick: this.handleClick, disabled: !this.isActionEnabled },
7466
7475
  React__namespace.createElement("span", { className: this.question.cssClasses.buttonAddText }, btnText)));
7467
7476
  };
7468
7477
  return SurveyQuestionPanelDynamicAddButton;
@@ -7476,6 +7485,8 @@
7476
7485
  function SurveyQuestionPanelDynamicRemoveButton() {
7477
7486
  var _this = _super !== null && _super.apply(this, arguments) || this;
7478
7487
  _this.handleClick = function (event) {
7488
+ if (!_this.isActionEnabled)
7489
+ return;
7479
7490
  _this.question.removePanelUI(_this.data.panel);
7480
7491
  };
7481
7492
  return _this;
@@ -7483,7 +7494,7 @@
7483
7494
  SurveyQuestionPanelDynamicRemoveButton.prototype.renderElement = function () {
7484
7495
  var btnText = this.renderLocString(this.question.locRemovePanelText);
7485
7496
  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" },
7497
+ return (React__namespace.createElement("button", { id: id, className: this.question.getPanelRemoveButtonCss(), onClick: this.handleClick, disabled: !this.isActionEnabled, type: "button" },
7487
7498
  React__namespace.createElement("span", { className: this.question.cssClasses.buttonRemoveText }, btnText),
7488
7499
  React__namespace.createElement("span", { className: this.question.cssClasses.iconRemove })));
7489
7500
  };
@@ -7813,7 +7824,7 @@
7813
7824
  return React__namespace.createElement(SurveyLocStringEditor, props);
7814
7825
  });
7815
7826
 
7816
- surveyCore.checkLibraryVersion("".concat("2.5.24"), "survey-react-ui");
7827
+ surveyCore.checkLibraryVersion("".concat("2.5.25"), "survey-react-ui");
7817
7828
 
7818
7829
  Object.defineProperty(exports, "Model", {
7819
7830
  enumerable: true,