survey-js-ui 2.5.25 → 2.5.27

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.25",
3
+ "version": "2.5.27",
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.25",
56
+ "survey-core": "2.5.27",
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.25
2
+ * surveyjs - Survey JavaScript library v2.5.27
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,11 +5387,13 @@
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 },
5394
- _$1("input", { type: "radio", name: this.question.name, value: value, "aria-errormessage": this.question.ariaErrormessage, checked: value === this.question.value, disabled: this.question.isDisabledAttr, readOnly: this.question.isReadOnlyAttr, className: cssClasses.itemRadioControl, onChange: handleOnChange }),
5396
+ _$1("input", { type: "radio", name: this.question.questionName, value: value, "aria-errormessage": this.question.ariaErrormessage, checked: value === this.question.value, disabled: this.question.isDisabledAttr, readOnly: this.question.isReadOnlyAttr, className: cssClasses.itemRadioControl, onChange: handleOnChange }),
5395
5397
  this.question.cssClasses.materialRadioDecorator ?
5396
5398
  (_$1("span", { className: cssClasses.materialRadioDecorator }, this.question.itemSvgIcon ?
5397
5399
  (_$1("svg", { className: cssClasses.itemRadioDecorator },
@@ -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),
@@ -7547,6 +7549,15 @@
7547
7549
  };
7548
7550
  return _this;
7549
7551
  }
7552
+ Object.defineProperty(SurveyQuestionPanelDynamicAddButton.prototype, "isActionEnabled", {
7553
+ get: function () {
7554
+ if (this.props.item)
7555
+ return this.props.item.enabled !== false;
7556
+ return this.question.enableAddPanel !== false;
7557
+ },
7558
+ enumerable: false,
7559
+ configurable: true
7560
+ });
7550
7561
  SurveyQuestionPanelDynamicAddButton.prototype.renderElement = function () {
7551
7562
  if (!this.question.canAddPanel)
7552
7563
  return null;
@@ -7639,7 +7650,18 @@
7639
7650
  var SurveyNavigationButton = /** @class */ (function (_super) {
7640
7651
  __extends(SurveyNavigationButton, _super);
7641
7652
  function SurveyNavigationButton() {
7642
- return _super !== null && _super.apply(this, arguments) || this;
7653
+ var _this = _super !== null && _super.apply(this, arguments) || this;
7654
+ _this.inputElement = null;
7655
+ _this.inputParent = null;
7656
+ _this.setInputRef = function (element) {
7657
+ var _a;
7658
+ if (!element && !!_this.inputElement && !!_this.inputParent && _this.inputElement.parentNode !== _this.inputParent) {
7659
+ _this.inputParent.appendChild(_this.inputElement);
7660
+ }
7661
+ _this.inputElement = element;
7662
+ _this.inputParent = (_a = element === null || element === void 0 ? void 0 : element.parentNode) !== null && _a !== void 0 ? _a : _this.inputParent;
7663
+ };
7664
+ return _this;
7643
7665
  }
7644
7666
  Object.defineProperty(SurveyNavigationButton.prototype, "item", {
7645
7667
  get: function () {
@@ -7652,7 +7674,7 @@
7652
7674
  return this.item.isVisible;
7653
7675
  };
7654
7676
  SurveyNavigationButton.prototype.renderElement = function () {
7655
- 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 }));
7677
+ 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 }));
7656
7678
  };
7657
7679
  return SurveyNavigationButton;
7658
7680
  }(ReactSurveyElement));
@@ -7956,7 +7978,7 @@
7956
7978
  }
7957
7979
  };
7958
7980
  var preact = React;
7959
- surveyCore.checkLibraryVersion("".concat("2.5.25"), "survey-js-ui");
7981
+ surveyCore.checkLibraryVersion("".concat("2.5.27"), "survey-js-ui");
7960
7982
 
7961
7983
  Object.defineProperty(exports, 'Model', {
7962
7984
  enumerable: true,