survey-js-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-js-ui",
3
- "version": "2.5.24",
3
+ "version": "2.5.26",
4
4
  "license": "MIT",
5
5
  "description": "A free MIT-licensed UI component that renders dynamic, interactive JSON-based forms and surveys in apps built with HTML, CSS, and JavaScript. You can use it to collect responses from users and send them to your own database.",
6
6
  "homepage": "https://surveyjs.io/",
@@ -53,7 +53,7 @@
53
53
  },
54
54
  "dependencies": {},
55
55
  "peerDependencies": {
56
- "survey-core": "2.5.24",
56
+ "survey-core": "2.5.26",
57
57
  "@types/react-dom": "*",
58
58
  "@types/react": "*"
59
59
  }
package/survey-js-ui.js CHANGED
@@ -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
  */
@@ -624,8 +624,8 @@
624
624
  this.locStr.onStringChanged.remove(this.onChangedHandler);
625
625
  };
626
626
  SurveyLocStringViewer.prototype.componentDidUpdate = function (prevProps, prevState) {
627
- if (!!prevProps.locStr) {
628
- prevProps.locStr.onStringChanged.remove(this.onChangedHandler);
627
+ if (!!prevProps.model) {
628
+ prevProps.model.onStringChanged.remove(this.onChangedHandler);
629
629
  }
630
630
  this.reactOnStrChanged();
631
631
  };
@@ -5387,7 +5387,9 @@
5387
5387
  var _this = this;
5388
5388
  var cssClasses = this.question.cssClasses;
5389
5389
  var handleOnChange = function () {
5390
- _this.question.value = value;
5390
+ if (!_this.question.isInputReadOnly) {
5391
+ _this.question.value = value;
5392
+ }
5391
5393
  };
5392
5394
  return (_$1("div", { role: "presentation", className: this.question.getRadioItemClass(cssClasses, value) },
5393
5395
  _$1("label", { className: cssClasses.radioLabel },
@@ -5400,7 +5402,7 @@
5400
5402
  };
5401
5403
  SurveyQuestionBooleanRadio.prototype.renderElement = function () {
5402
5404
  var cssClasses = this.question.cssClasses;
5403
- return (_$1("div", { className: cssClasses.rootRadio },
5405
+ return (_$1("div", { className: cssClasses.rootRadio, onKeyDown: this.handleOnKeyDown },
5404
5406
  _$1("fieldset", { role: "presentation", className: cssClasses.radioFieldset }, !this.question.swapOrder ?
5405
5407
  (_$1(k$2, null,
5406
5408
  this.renderRadioItem(this.question.getValueFalse(), this.question.locLabelFalse),
@@ -7527,6 +7529,13 @@
7527
7529
  enumerable: false,
7528
7530
  configurable: true
7529
7531
  });
7532
+ Object.defineProperty(SurveyQuestionPanelDynamicAction.prototype, "isActionEnabled", {
7533
+ get: function () {
7534
+ return !this.props.item || this.props.item.enabled !== false;
7535
+ },
7536
+ enumerable: false,
7537
+ configurable: true
7538
+ });
7530
7539
  return SurveyQuestionPanelDynamicAction;
7531
7540
  }(ReactSurveyElement));
7532
7541
  var SurveyQuestionPanelDynamicAddButton = /** @class */ (function (_super) {
@@ -7534,6 +7543,8 @@
7534
7543
  function SurveyQuestionPanelDynamicAddButton() {
7535
7544
  var _this = _super !== null && _super.apply(this, arguments) || this;
7536
7545
  _this.handleClick = function (event) {
7546
+ if (!_this.isActionEnabled)
7547
+ return;
7537
7548
  _this.question.addPanelUI();
7538
7549
  };
7539
7550
  return _this;
@@ -7542,7 +7553,7 @@
7542
7553
  if (!this.question.canAddPanel)
7543
7554
  return null;
7544
7555
  var btnText = this.renderLocString(this.question.locAddPanelText);
7545
- return (_$1("button", { type: "button", id: this.question.addButtonId, className: this.question.getAddButtonCss(), onClick: this.handleClick },
7556
+ return (_$1("button", { type: "button", id: this.question.addButtonId, className: this.question.getAddButtonCss(), onClick: this.handleClick, disabled: !this.isActionEnabled },
7546
7557
  _$1("span", { className: this.question.cssClasses.buttonAddText }, btnText)));
7547
7558
  };
7548
7559
  return SurveyQuestionPanelDynamicAddButton;
@@ -7556,6 +7567,8 @@
7556
7567
  function SurveyQuestionPanelDynamicRemoveButton() {
7557
7568
  var _this = _super !== null && _super.apply(this, arguments) || this;
7558
7569
  _this.handleClick = function (event) {
7570
+ if (!_this.isActionEnabled)
7571
+ return;
7559
7572
  _this.question.removePanelUI(_this.data.panel);
7560
7573
  };
7561
7574
  return _this;
@@ -7563,7 +7576,7 @@
7563
7576
  SurveyQuestionPanelDynamicRemoveButton.prototype.renderElement = function () {
7564
7577
  var btnText = this.renderLocString(this.question.locRemovePanelText);
7565
7578
  var id = this.question.getPanelRemoveButtonId(this.data.panel);
7566
- return (_$1("button", { id: id, className: this.question.getPanelRemoveButtonCss(), onClick: this.handleClick, type: "button" },
7579
+ return (_$1("button", { id: id, className: this.question.getPanelRemoveButtonCss(), onClick: this.handleClick, disabled: !this.isActionEnabled, type: "button" },
7567
7580
  _$1("span", { className: this.question.cssClasses.buttonRemoveText }, btnText),
7568
7581
  _$1("span", { className: this.question.cssClasses.iconRemove })));
7569
7582
  };
@@ -7628,7 +7641,18 @@
7628
7641
  var SurveyNavigationButton = /** @class */ (function (_super) {
7629
7642
  __extends(SurveyNavigationButton, _super);
7630
7643
  function SurveyNavigationButton() {
7631
- return _super !== null && _super.apply(this, arguments) || this;
7644
+ var _this = _super !== null && _super.apply(this, arguments) || this;
7645
+ _this.inputElement = null;
7646
+ _this.inputParent = null;
7647
+ _this.setInputRef = function (element) {
7648
+ var _a;
7649
+ if (!element && !!_this.inputElement && !!_this.inputParent && _this.inputElement.parentNode !== _this.inputParent) {
7650
+ _this.inputParent.appendChild(_this.inputElement);
7651
+ }
7652
+ _this.inputElement = element;
7653
+ _this.inputParent = (_a = element === null || element === void 0 ? void 0 : element.parentNode) !== null && _a !== void 0 ? _a : _this.inputParent;
7654
+ };
7655
+ return _this;
7632
7656
  }
7633
7657
  Object.defineProperty(SurveyNavigationButton.prototype, "item", {
7634
7658
  get: function () {
@@ -7641,7 +7665,7 @@
7641
7665
  return this.item.isVisible;
7642
7666
  };
7643
7667
  SurveyNavigationButton.prototype.renderElement = function () {
7644
- return (_$1("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 }));
7668
+ return (_$1("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 }));
7645
7669
  };
7646
7670
  return SurveyNavigationButton;
7647
7671
  }(ReactSurveyElement));
@@ -7945,7 +7969,7 @@
7945
7969
  }
7946
7970
  };
7947
7971
  var preact = React;
7948
- surveyCore.checkLibraryVersion("".concat("2.5.24"), "survey-js-ui");
7972
+ surveyCore.checkLibraryVersion("".concat("2.5.26"), "survey-js-ui");
7949
7973
 
7950
7974
  Object.defineProperty(exports, 'Model', {
7951
7975
  enumerable: true,