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.
@@ -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
  */
@@ -506,8 +506,8 @@ class SurveyLocStringViewer extends x$3 {
506
506
  this.locStr.onStringChanged.remove(this.onChangedHandler);
507
507
  }
508
508
  componentDidUpdate(prevProps, prevState) {
509
- if (!!prevProps.locStr) {
510
- prevProps.locStr.onStringChanged.remove(this.onChangedHandler);
509
+ if (!!prevProps.model) {
510
+ prevProps.model.onStringChanged.remove(this.onChangedHandler);
511
511
  }
512
512
  this.reactOnStrChanged();
513
513
  }
@@ -4509,7 +4509,9 @@ class SurveyQuestionBooleanRadio extends SurveyQuestionBoolean {
4509
4509
  renderRadioItem(value, locText) {
4510
4510
  const cssClasses = this.question.cssClasses;
4511
4511
  const handleOnChange = () => {
4512
- this.question.value = value;
4512
+ if (!this.question.isInputReadOnly) {
4513
+ this.question.value = value;
4514
+ }
4513
4515
  };
4514
4516
  return (_$1("div", { role: "presentation", className: this.question.getRadioItemClass(cssClasses, value) },
4515
4517
  _$1("label", { className: cssClasses.radioLabel },
@@ -4522,7 +4524,7 @@ class SurveyQuestionBooleanRadio extends SurveyQuestionBoolean {
4522
4524
  }
4523
4525
  renderElement() {
4524
4526
  const cssClasses = this.question.cssClasses;
4525
- return (_$1("div", { className: cssClasses.rootRadio },
4527
+ return (_$1("div", { className: cssClasses.rootRadio, onKeyDown: this.handleOnKeyDown },
4526
4528
  _$1("fieldset", { role: "presentation", className: cssClasses.radioFieldset }, !this.question.swapOrder ?
4527
4529
  (_$1(k$3, null,
4528
4530
  this.renderRadioItem(this.question.getValueFalse(), this.question.locLabelFalse),
@@ -6258,11 +6260,16 @@ class SurveyQuestionPanelDynamicAction extends ReactSurveyElement {
6258
6260
  get question() {
6259
6261
  return (this.props.item && this.props.item.data.question) || this.props.data.question;
6260
6262
  }
6263
+ get isActionEnabled() {
6264
+ return !this.props.item || this.props.item.enabled !== false;
6265
+ }
6261
6266
  }
6262
6267
  class SurveyQuestionPanelDynamicAddButton extends SurveyQuestionPanelDynamicAction {
6263
6268
  constructor() {
6264
6269
  super(...arguments);
6265
6270
  this.handleClick = (event) => {
6271
+ if (!this.isActionEnabled)
6272
+ return;
6266
6273
  this.question.addPanelUI();
6267
6274
  };
6268
6275
  }
@@ -6270,7 +6277,7 @@ class SurveyQuestionPanelDynamicAddButton extends SurveyQuestionPanelDynamicActi
6270
6277
  if (!this.question.canAddPanel)
6271
6278
  return null;
6272
6279
  const btnText = this.renderLocString(this.question.locAddPanelText);
6273
- return (_$1("button", { type: "button", id: this.question.addButtonId, className: this.question.getAddButtonCss(), onClick: this.handleClick },
6280
+ return (_$1("button", { type: "button", id: this.question.addButtonId, className: this.question.getAddButtonCss(), onClick: this.handleClick, disabled: !this.isActionEnabled },
6274
6281
  _$1("span", { className: this.question.cssClasses.buttonAddText }, btnText)));
6275
6282
  }
6276
6283
  }
@@ -6282,13 +6289,15 @@ class SurveyQuestionPanelDynamicRemoveButton extends SurveyQuestionPanelDynamicA
6282
6289
  constructor() {
6283
6290
  super(...arguments);
6284
6291
  this.handleClick = (event) => {
6292
+ if (!this.isActionEnabled)
6293
+ return;
6285
6294
  this.question.removePanelUI(this.data.panel);
6286
6295
  };
6287
6296
  }
6288
6297
  renderElement() {
6289
6298
  const btnText = this.renderLocString(this.question.locRemovePanelText);
6290
6299
  const id = this.question.getPanelRemoveButtonId(this.data.panel);
6291
- return (_$1("button", { id: id, className: this.question.getPanelRemoveButtonCss(), onClick: this.handleClick, type: "button" },
6300
+ return (_$1("button", { id: id, className: this.question.getPanelRemoveButtonCss(), onClick: this.handleClick, disabled: !this.isActionEnabled, type: "button" },
6292
6301
  _$1("span", { className: this.question.cssClasses.buttonRemoveText }, btnText),
6293
6302
  _$1("span", { className: this.question.cssClasses.iconRemove })));
6294
6303
  }
@@ -6339,6 +6348,19 @@ ReactElementFactory.Instance.registerElement("sv-paneldynamic-progress-text", (p
6339
6348
  });
6340
6349
 
6341
6350
  class SurveyNavigationButton extends ReactSurveyElement {
6351
+ constructor() {
6352
+ super(...arguments);
6353
+ this.inputElement = null;
6354
+ this.inputParent = null;
6355
+ this.setInputRef = (element) => {
6356
+ var _a;
6357
+ if (!element && !!this.inputElement && !!this.inputParent && this.inputElement.parentNode !== this.inputParent) {
6358
+ this.inputParent.appendChild(this.inputElement);
6359
+ }
6360
+ this.inputElement = element;
6361
+ this.inputParent = (_a = element === null || element === void 0 ? void 0 : element.parentNode) !== null && _a !== void 0 ? _a : this.inputParent;
6362
+ };
6363
+ }
6342
6364
  get item() {
6343
6365
  return this.props.item;
6344
6366
  }
@@ -6346,7 +6368,7 @@ class SurveyNavigationButton extends ReactSurveyElement {
6346
6368
  return this.item.isVisible;
6347
6369
  }
6348
6370
  renderElement() {
6349
- 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 }));
6371
+ 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 }));
6350
6372
  }
6351
6373
  }
6352
6374
  ReactElementFactory.Instance.registerElement("sv-nav-btn", (props) => {
@@ -6585,7 +6607,7 @@ SurveyModel.prototype["render"] = function (element = null) {
6585
6607
  }
6586
6608
  };
6587
6609
  const preact = React;
6588
- checkLibraryVersion(`${"2.5.24"}`, "survey-js-ui");
6610
+ checkLibraryVersion(`${"2.5.26"}`, "survey-js-ui");
6589
6611
 
6590
6612
  export { CharacterCounterComponent, O as Children, x$3 as Component, ComponentsContainer, k$3 as Fragment, Header, HeaderCell, HeaderMobile, List, ListItemContent, ListItemGroup, LoadingIndicatorComponent, LogoImage, MatrixRow, NotifierComponent, Popup, PopupModal, PopupSurvey, N as PureComponent, QuestionErrorComponent, RatingDropdownItem, RatingItem, RatingItemSmiley, RatingItemStar, ReactElementFactory, ReactQuestionFactory, ReactSurveyElement, ReactSurveyElementsWrapper, Scroll, Skeleton, SliderLabelItem, Cn as StrictMode, 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, P as Suspense, B as SuspenseList, SvgBundleComponent, SvgIcon, TagboxFilterString, TitleActions, TitleElement, attachKey2click, _n as cloneElement, Q$2 as createContext, _$1 as createElement, dn as createFactory, $ as createPortal, b$1 as createRef, Sn as findDOMNode, En as flushSync, D as forwardRef, tn as hydrate, pn as isFragment, yn as isMemo, mn as isValidElement, z as lazy, M as memo, preact, nn as render, renderPopupSurvey, renderSurvey, R as startTransition, bn as unmountComponentAtNode, gn as unstable_batchedUpdates, q$2 as useCallback, x$2 as useContext, P$2 as useDebugValue, w as useDeferredValue, y as useEffect, g$2 as useId, F$2 as useImperativeHandle, I as useInsertionEffect, _ as useLayoutEffect, T$2 as useMemo, h as useReducer, A$2 as useRef, d as useState, C as useSyncExternalStore, k as useTransition, vn as version };
6591
6613
  //# sourceMappingURL=survey-js-ui.mjs.map