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.
@@ -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
  */
@@ -451,8 +451,8 @@ class SurveyLocStringViewer extends React.Component {
451
451
  this.locStr.onStringChanged.remove(this.onChangedHandler);
452
452
  }
453
453
  componentDidUpdate(prevProps, prevState) {
454
- if (!!prevProps.locStr) {
455
- prevProps.locStr.onStringChanged.remove(this.onChangedHandler);
454
+ if (!!prevProps.model) {
455
+ prevProps.model.onStringChanged.remove(this.onChangedHandler);
456
456
  }
457
457
  this.reactOnStrChanged();
458
458
  }
@@ -4410,7 +4410,9 @@ class SurveyQuestionBooleanRadio extends SurveyQuestionBoolean {
4410
4410
  renderRadioItem(value, locText) {
4411
4411
  const cssClasses = this.question.cssClasses;
4412
4412
  const handleOnChange = () => {
4413
- this.question.value = value;
4413
+ if (!this.question.isInputReadOnly) {
4414
+ this.question.value = value;
4415
+ }
4414
4416
  };
4415
4417
  return (React.createElement("div", { role: "presentation", className: this.question.getRadioItemClass(cssClasses, value) },
4416
4418
  React.createElement("label", { className: cssClasses.radioLabel },
@@ -4423,7 +4425,7 @@ class SurveyQuestionBooleanRadio extends SurveyQuestionBoolean {
4423
4425
  }
4424
4426
  renderElement() {
4425
4427
  const cssClasses = this.question.cssClasses;
4426
- return (React.createElement("div", { className: cssClasses.rootRadio },
4428
+ return (React.createElement("div", { className: cssClasses.rootRadio, onKeyDown: this.handleOnKeyDown },
4427
4429
  React.createElement("fieldset", { role: "presentation", className: cssClasses.radioFieldset }, !this.question.swapOrder ?
4428
4430
  (React.createElement(React.Fragment, null,
4429
4431
  this.renderRadioItem(this.question.getValueFalse(), this.question.locLabelFalse),
@@ -6159,11 +6161,16 @@ class SurveyQuestionPanelDynamicAction extends ReactSurveyElement {
6159
6161
  get question() {
6160
6162
  return (this.props.item && this.props.item.data.question) || this.props.data.question;
6161
6163
  }
6164
+ get isActionEnabled() {
6165
+ return !this.props.item || this.props.item.enabled !== false;
6166
+ }
6162
6167
  }
6163
6168
  class SurveyQuestionPanelDynamicAddButton extends SurveyQuestionPanelDynamicAction {
6164
6169
  constructor() {
6165
6170
  super(...arguments);
6166
6171
  this.handleClick = (event) => {
6172
+ if (!this.isActionEnabled)
6173
+ return;
6167
6174
  this.question.addPanelUI();
6168
6175
  };
6169
6176
  }
@@ -6171,7 +6178,7 @@ class SurveyQuestionPanelDynamicAddButton extends SurveyQuestionPanelDynamicActi
6171
6178
  if (!this.question.canAddPanel)
6172
6179
  return null;
6173
6180
  const btnText = this.renderLocString(this.question.locAddPanelText);
6174
- return (React.createElement("button", { type: "button", id: this.question.addButtonId, className: this.question.getAddButtonCss(), onClick: this.handleClick },
6181
+ return (React.createElement("button", { type: "button", id: this.question.addButtonId, className: this.question.getAddButtonCss(), onClick: this.handleClick, disabled: !this.isActionEnabled },
6175
6182
  React.createElement("span", { className: this.question.cssClasses.buttonAddText }, btnText)));
6176
6183
  }
6177
6184
  }
@@ -6183,13 +6190,15 @@ class SurveyQuestionPanelDynamicRemoveButton extends SurveyQuestionPanelDynamicA
6183
6190
  constructor() {
6184
6191
  super(...arguments);
6185
6192
  this.handleClick = (event) => {
6193
+ if (!this.isActionEnabled)
6194
+ return;
6186
6195
  this.question.removePanelUI(this.data.panel);
6187
6196
  };
6188
6197
  }
6189
6198
  renderElement() {
6190
6199
  const btnText = this.renderLocString(this.question.locRemovePanelText);
6191
6200
  const id = this.question.getPanelRemoveButtonId(this.data.panel);
6192
- return (React.createElement("button", { id: id, className: this.question.getPanelRemoveButtonCss(), onClick: this.handleClick, type: "button" },
6201
+ return (React.createElement("button", { id: id, className: this.question.getPanelRemoveButtonCss(), onClick: this.handleClick, disabled: !this.isActionEnabled, type: "button" },
6193
6202
  React.createElement("span", { className: this.question.cssClasses.buttonRemoveText }, btnText),
6194
6203
  React.createElement("span", { className: this.question.cssClasses.iconRemove })));
6195
6204
  }
@@ -6240,6 +6249,19 @@ ReactElementFactory.Instance.registerElement("sv-paneldynamic-progress-text", (p
6240
6249
  });
6241
6250
 
6242
6251
  class SurveyNavigationButton extends ReactSurveyElement {
6252
+ constructor() {
6253
+ super(...arguments);
6254
+ this.inputElement = null;
6255
+ this.inputParent = null;
6256
+ this.setInputRef = (element) => {
6257
+ var _a;
6258
+ if (!element && !!this.inputElement && !!this.inputParent && this.inputElement.parentNode !== this.inputParent) {
6259
+ this.inputParent.appendChild(this.inputElement);
6260
+ }
6261
+ this.inputElement = element;
6262
+ this.inputParent = (_a = element === null || element === void 0 ? void 0 : element.parentNode) !== null && _a !== void 0 ? _a : this.inputParent;
6263
+ };
6264
+ }
6243
6265
  get item() {
6244
6266
  return this.props.item;
6245
6267
  }
@@ -6247,7 +6269,7 @@ class SurveyNavigationButton extends ReactSurveyElement {
6247
6269
  return this.item.isVisible;
6248
6270
  }
6249
6271
  renderElement() {
6250
- return (React.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 }));
6272
+ return (React.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 }));
6251
6273
  }
6252
6274
  }
6253
6275
  ReactElementFactory.Instance.registerElement("sv-nav-btn", (props) => {
@@ -6437,7 +6459,7 @@ ReactElementFactory.Instance.registerElement(LocalizableString.editableRenderer,
6437
6459
  return React.createElement(SurveyLocStringEditor, props);
6438
6460
  });
6439
6461
 
6440
- checkLibraryVersion(`${"2.5.24"}`, "survey-react-ui");
6462
+ checkLibraryVersion(`${"2.5.26"}`, "survey-react-ui");
6441
6463
 
6442
6464
  export { CharacterCounterComponent, ComponentsContainer, Header, HeaderCell, HeaderMobile, List, ListItemContent, ListItemGroup, LoadingIndicatorComponent, LogoImage, MatrixRow, NotifierComponent, Popup, PopupModal, PopupSurvey, QuestionErrorComponent, RatingDropdownItem, RatingItem, RatingItemSmiley, RatingItemStar, ReactElementFactory, ReactQuestionFactory, ReactSurveyElement, ReactSurveyElementsWrapper, Scroll, Skeleton, SliderLabelItem, Survey, SurveyActionBar, SurveyElementBase, SurveyElementErrors, SurveyFileChooseButton, SurveyFileItem, SurveyFilePreview, SurveyFlowPanel, SurveyHeader, SurveyLocStringEditor, SurveyLocStringViewer, SurveyNavigationBase, SurveyNavigationButton, SurveyPage, SurveyPanel, SurveyProgress, SurveyProgressButtons, SurveyProgressToc, SurveyQuestion, SurveyQuestionAndErrorsCell, SurveyQuestionBoolean, SurveyQuestionBooleanCheckbox, SurveyQuestionBooleanRadio, SurveyQuestionButtonGroup, SurveyQuestionButtonGroupDropdown, SurveyQuestionCheckbox, SurveyQuestionCheckboxItem, SurveyQuestionComment, SurveyQuestionCommentItem, SurveyQuestionComposite, SurveyQuestionCustom, SurveyQuestionDropdown, SurveyQuestionDropdownBase, SurveyQuestionDropdownSelect, SurveyQuestionElementBase, SurveyQuestionEmpty, SurveyQuestionExpression, SurveyQuestionFile, SurveyQuestionHtml, SurveyQuestionImage, SurveyQuestionImageMap, SurveyQuestionImagePicker, SurveyQuestionMatrix, SurveyQuestionMatrixCell, SurveyQuestionMatrixDetailButton, SurveyQuestionMatrixDropdown, SurveyQuestionMatrixDropdownBase, SurveyQuestionMatrixDropdownCell, SurveyQuestionMatrixDynamic, SurveyQuestionMatrixDynamicAddButton, SurveyQuestionMatrixDynamicDragDropIcon, SurveyQuestionMatrixDynamicRemoveButton, SurveyQuestionMatrixRow, SurveyQuestionMultipleText, SurveyQuestionOptionItem, SurveyQuestionPanelDynamic, SurveyQuestionPanelDynamicAddButton, SurveyQuestionPanelDynamicNextButton, SurveyQuestionPanelDynamicPrevButton, SurveyQuestionPanelDynamicProgressText, SurveyQuestionPanelDynamicRemoveButton, SurveyQuestionRadioItem, SurveyQuestionRadiogroup, SurveyQuestionRanking, SurveyQuestionRankingItem, SurveyQuestionRankingItemContent, SurveyQuestionRating, SurveyQuestionRatingDropdown, SurveyQuestionSignaturePad, SurveyQuestionSlider, SurveyQuestionTagbox, SurveyQuestionTagboxItem, SurveyQuestionText, SurveyRow, SurveyTimerPanel, SurveyWindow, SvgBundleComponent, SvgIcon, TagboxFilterString, TitleActions, TitleElement, attachKey2click };
6443
6465
  //# sourceMappingURL=survey-react-ui.mjs.map