survey-react-ui 2.0.2 → 2.0.4

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,10 +1,10 @@
1
1
  /*!
2
- * surveyjs - Survey JavaScript library v2.0.2
2
+ * surveyjs - Survey JavaScript library v2.0.4
3
3
  * Copyright (c) 2015-2025 Devsoft Baltic OÜ - http://surveyjs.io/
4
4
  * License: MIT (http://www.opensource.org/licenses/mit-license.php)
5
5
  */
6
6
 
7
- import { SurveyModel, Helpers, createSvg, createPopupViewModel, CssClassBuilder, ActionDropdownViewModel, RendererFactory, doKey2ClickUp, Question, SvgRegistry, settings, createPopupModalViewModel, doKey2ClickBlur, doKey2ClickDown, addIconsToThemeSet, SurveyProgressModel, ProgressButtonsResponsivityManager, PopupSurveyModel, ButtonGroupItemModel, LocalizableString, checkLibraryVersion } from 'survey-core';
7
+ import { SurveyModel, Helpers, createSvg, createPopupViewModel, CssClassBuilder, ActionDropdownViewModel, RendererFactory, doKey2ClickUp, Question, SvgRegistry, settings, createPopupModalViewModel, ScrollViewModel, doKey2ClickBlur, doKey2ClickDown, addIconsToThemeSet, SurveyProgressModel, ProgressButtonsResponsivityManager, PopupSurveyModel, ButtonGroupItemModel, LocalizableString, checkLibraryVersion } from 'survey-core';
8
8
  export { SurveyModel as Model, SurveyModel, SurveyWindowModel, settings, surveyLocalization, surveyStrings } from 'survey-core';
9
9
  import * as React from 'react';
10
10
  import * as ReactDOM from 'react-dom';
@@ -1401,7 +1401,7 @@ class SurveyQuestion extends SurveyElementBase {
1401
1401
  let rootStyle = question.getRootStyle();
1402
1402
  let questionContent = this.wrapQuestionContent(this.renderQuestionContent());
1403
1403
  return (React.createElement(React.Fragment, null,
1404
- React.createElement("div", { ref: this.rootRef, id: question.id, className: question.getRootCss(), style: rootStyle, role: question.ariaRole, "aria-required": this.question.ariaRequired, "aria-invalid": this.question.ariaInvalid, "aria-labelledby": question.ariaLabelledBy, "aria-describedby": question.ariaDescribedBy, "aria-expanded": question.ariaExpanded, "data-name": question.name },
1404
+ React.createElement("div", { ref: this.rootRef, id: question.id, className: question.getRootCss(), style: rootStyle, role: question.ariaRole, "aria-required": this.question.ariaRequired, "aria-invalid": this.question.ariaInvalid, "aria-label": this.question.ariaLabel, "aria-labelledby": question.ariaLabelledBy, "aria-describedby": question.ariaDescribedBy, "aria-expanded": question.ariaExpanded, "data-name": question.name },
1405
1405
  errorsAboveQuestion,
1406
1406
  headerTop,
1407
1407
  questionContent,
@@ -1842,7 +1842,7 @@ class PopupModal extends SurveyElementBase {
1842
1842
  PopupModal.modalDescriptors = [];
1843
1843
 
1844
1844
  /*!
1845
- * surveyjs - Survey JavaScript library v2.0.2
1845
+ * surveyjs - Survey JavaScript library v2.0.4
1846
1846
  * Copyright (c) 2015-2025 Devsoft Baltic OÜ - http://surveyjs.io/
1847
1847
  * License: MIT (http://www.opensource.org/licenses/mit-license.php)
1848
1848
  */
@@ -1910,7 +1910,7 @@ var iconsV1 = {
1910
1910
  };
1911
1911
 
1912
1912
  /*!
1913
- * surveyjs - Survey JavaScript library v2.0.2
1913
+ * surveyjs - Survey JavaScript library v2.0.4
1914
1914
  * Copyright (c) 2015-2025 Devsoft Baltic OÜ - http://surveyjs.io/
1915
1915
  * License: MIT (http://www.opensource.org/licenses/mit-license.php)
1916
1916
  */
@@ -1977,6 +1977,36 @@ var iconsV2 = {
1977
1977
  "smiley-rate9-24x24": "<svg viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M12.01 24C6.85767 24 1.15509 20.96 0.0145752 14.16C-0.0354475 13.87 0.0445888 13.57 0.234675 13.35C0.424761 13.13 0.704888 13 0.995019 13H23.005C23.2951 13 23.5752 13.13 23.7653 13.35C23.9554 13.57 24.0354 13.87 23.9854 14.16C22.8549 20.95 17.1423 24 11.99 24H12.01ZM2.25559 15C3.61621 19.82 8.0182 22 12.01 22C16.0018 22 20.4038 19.82 21.7644 15H2.25559ZM8.00819 6V2C8.00819 1.45 7.55799 1 7.00774 1C6.45749 1 6.00729 1.45 6.00729 2V6C6.00729 6.55 6.45749 7 7.00774 7C7.55799 7 8.00819 6.55 8.00819 6ZM18.0127 6V2C18.0127 1.45 17.5625 1 17.0123 1C16.462 1 16.0118 1.45 16.0118 2V6C16.0118 6.55 16.462 7 17.0123 7C17.5625 7 18.0127 6.55 18.0127 6Z\"></path></svg>"
1978
1978
  };
1979
1979
 
1980
+ class Scroll extends React.Component {
1981
+ constructor(props) {
1982
+ super(props);
1983
+ this.rootRef = React.createRef();
1984
+ this.model = new ScrollViewModel();
1985
+ }
1986
+ componentDidMount() {
1987
+ const container = this.rootRef.current;
1988
+ if (!container)
1989
+ return;
1990
+ this.model.setRootElement(container);
1991
+ }
1992
+ componentWillUnmount() {
1993
+ this.model.unsubscribeRootElement();
1994
+ this.model.setRootElement(undefined);
1995
+ }
1996
+ render() {
1997
+ return this.props.disabled ?
1998
+ React.createElement(React.Fragment, null, this.props.children) :
1999
+ React.createElement("div", { ref: this.rootRef, className: "sv-scroll__wrapper" },
2000
+ React.createElement("div", { className: "sv-scroll__scroller sv-drag-target-skipped", onScroll: () => this.model.onScrollContainer() },
2001
+ React.createElement("div", { className: "sv-scroll__container" }, this.props.children)),
2002
+ React.createElement("div", { className: "sv-scroll__scrollbar", onScroll: () => this.model.onScrollScrollbar() },
2003
+ React.createElement("div", { className: "sv-scroll__scrollbar-sizer" })));
2004
+ }
2005
+ }
2006
+ ReactElementFactory.Instance.registerElement("svc-scroll", (props) => {
2007
+ return React.createElement(Scroll, props);
2008
+ });
2009
+
1980
2010
  addIconsToThemeSet("v1", iconsV1);
1981
2011
  addIconsToThemeSet("v2", iconsV2);
1982
2012
  SvgRegistry.registerIcons(iconsV2);
@@ -2067,18 +2097,20 @@ class Survey extends SurveyElementBase {
2067
2097
  const rootCss = this.survey.getRootCss();
2068
2098
  const cssClasses = this.rootNodeClassName ? this.rootNodeClassName + " " + rootCss : rootCss;
2069
2099
  return (React.createElement("div", { id: this.rootNodeId, ref: this.rootRef, className: cssClasses, style: this.survey.themeVariables, lang: this.survey.locale || "en", dir: this.survey.localeDir },
2070
- this.survey.needRenderIcons ? React.createElement(SvgBundleComponent, null) : null,
2071
- React.createElement(PopupModal, null),
2072
- React.createElement("div", { className: this.survey.wrapperFormCss },
2073
- backgroundImage,
2074
- React.createElement("form", { onSubmit: onSubmit },
2075
- customHeader,
2076
- React.createElement("div", { className: this.css.container },
2077
- header,
2078
- React.createElement(ComponentsContainer, { survey: this.survey, container: "header", needRenderWrapper: false }),
2079
- renderResult,
2080
- React.createElement(ComponentsContainer, { survey: this.survey, container: "footer", needRenderWrapper: false }))),
2081
- React.createElement(NotifierComponent, { notifier: this.survey.notifier }))));
2100
+ React.createElement(Scroll, { disabled: this.survey.rootScrollDisabled },
2101
+ this.survey.needRenderIcons ? React.createElement(SvgBundleComponent, null) : null,
2102
+ React.createElement(PopupModal, null),
2103
+ React.createElement("div", { className: this.survey.wrapperFormCss },
2104
+ backgroundImage,
2105
+ React.createElement("form", { onSubmit: onSubmit },
2106
+ React.createElement(Scroll, { disabled: this.survey.formScrollDisabled },
2107
+ customHeader,
2108
+ React.createElement("div", { className: this.css.container },
2109
+ header,
2110
+ React.createElement(ComponentsContainer, { survey: this.survey, container: "header", needRenderWrapper: false }),
2111
+ renderResult,
2112
+ React.createElement(ComponentsContainer, { survey: this.survey, container: "footer", needRenderWrapper: false })))),
2113
+ React.createElement(NotifierComponent, { notifier: this.survey.notifier })))));
2082
2114
  }
2083
2115
  renderElement() {
2084
2116
  return this.doRender();
@@ -3086,7 +3118,7 @@ class SurveyQuestionDropdownBase extends SurveyQuestionUncontrolledElement {
3086
3118
  return (React.createElement("div", { id: this.question.inputId, className: this.question.getControlClass(), tabIndex: dropdownListModel.noTabIndex ? undefined : 0,
3087
3119
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
3088
3120
  // @ts-ignore
3089
- disabled: this.question.isDisabledAttr, required: this.question.isRequired, onKeyDown: this.keyhandler, onBlur: this.blur, onFocus: this.focus, role: this.question.ariaRole, "aria-required": this.question.ariaRequired, "aria-label": this.question.ariaLabel, "aria-invalid": this.question.ariaInvalid, "aria-errormessage": this.question.ariaErrormessage, "aria-expanded": this.question.ariaExpanded, "aria-controls": dropdownListModel.listElementId, "aria-activedescendant": dropdownListModel.ariaActivedescendant, ref: (div) => (this.setControl(div)) },
3121
+ disabled: this.question.isDisabledAttr, required: this.question.isRequired, onKeyDown: this.keyhandler, onBlur: this.blur, onFocus: this.focus, role: this.question.ariaRole, "aria-required": this.question.ariaRequired, "aria-label": this.question.ariaLabel, "aria-labelledby": this.question.ariaLabelledBy, "aria-invalid": this.question.ariaInvalid, "aria-errormessage": this.question.ariaErrormessage, "aria-expanded": this.question.ariaExpanded, "aria-controls": dropdownListModel.listElementId, "aria-activedescendant": dropdownListModel.ariaActivedescendant, ref: (div) => (this.setControl(div)) },
3090
3122
  dropdownListModel.showHintPrefix ?
3091
3123
  (React.createElement("div", { className: this.question.cssClasses.hintPrefix },
3092
3124
  React.createElement("span", null, dropdownListModel.hintStringPrefix))) : null,
@@ -4036,7 +4068,7 @@ class SurveyQuestionBooleanCheckbox extends SurveyQuestionBoolean {
4036
4068
  React.createElement("label", { className: cssClasses.checkboxLabel },
4037
4069
  React.createElement("input", { ref: this.checkRef, type: "checkbox", name: this.question.name, value: this.question.booleanValue === null
4038
4070
  ? ""
4039
- : this.question.booleanValue, id: this.question.inputId, className: cssClasses.controlCheckbox, disabled: this.question.isDisabledAttr, readOnly: this.question.isReadOnlyAttr, checked: this.question.booleanValue || false, onChange: this.handleOnChange, "aria-required": this.question.ariaRequired, "aria-label": this.question.ariaLabel, "aria-invalid": this.question.ariaInvalid, "aria-errormessage": this.question.ariaErrormessage }),
4071
+ : this.question.booleanValue, id: this.question.inputId, className: cssClasses.controlCheckbox, disabled: this.question.isDisabledAttr, readOnly: this.question.isReadOnlyAttr, checked: this.question.booleanValue || false, onChange: this.handleOnChange, "aria-required": this.question.a11y_input_ariaRequired, "aria-label": this.question.a11y_input_ariaLabel, "aria-labelledby": this.question.a11y_input_ariaLabelledBy, "aria-describedby": this.question.a11y_input_ariaDescribedBy, "aria-invalid": this.question.a11y_input_ariaInvalid, "aria-errormessage": this.question.a11y_input_ariaErrormessage }),
4040
4072
  React.createElement("span", { className: cssClasses.checkboxMaterialDecorator },
4041
4073
  this.question.svgIcon ?
4042
4074
  React.createElement("svg", { className: cssClasses.checkboxItemDecorator },
@@ -5074,6 +5106,11 @@ ReactElementFactory.Instance.registerElement("sv-list", (props) => {
5074
5106
  });
5075
5107
 
5076
5108
  class SurveyProgressToc extends SurveyNavigationBase {
5109
+ componentDidMount() {
5110
+ super.componentDidMount();
5111
+ const tocModel = this.props.model;
5112
+ tocModel.updateStickyTOCSize(this.survey.rootElement);
5113
+ }
5077
5114
  render() {
5078
5115
  const tocModel = this.props.model;
5079
5116
  let content;
@@ -5966,7 +6003,7 @@ ReactElementFactory.Instance.registerElement(LocalizableString.editableRenderer,
5966
6003
  return React.createElement(SurveyLocStringEditor, props);
5967
6004
  });
5968
6005
 
5969
- checkLibraryVersion(`${"2.0.2"}`, "survey-react-ui");
6006
+ checkLibraryVersion(`${"2.0.4"}`, "survey-react-ui");
5970
6007
 
5971
- 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, Skeleton, Survey, SurveyActionBar, SurveyElementBase, SurveyElementErrors, SurveyFileChooseButton, SurveyFilePreview, SurveyFlowPanel, SurveyHeader, SurveyLocStringEditor, SurveyLocStringViewer, SurveyNavigationBase, SurveyNavigationButton, SurveyPage, SurveyPanel, SurveyProgress, SurveyProgressButtons, SurveyProgressToc, SurveyQuestion, SurveyQuestionAndErrorsCell, SurveyQuestionBoolean, SurveyQuestionBooleanCheckbox, SurveyQuestionBooleanRadio, SurveyQuestionButtonGroup, SurveyQuestionCheckbox, SurveyQuestionCheckboxItem, SurveyQuestionComment, SurveyQuestionCommentItem, SurveyQuestionComposite, SurveyQuestionCustom, SurveyQuestionDropdown, SurveyQuestionDropdownBase, SurveyQuestionDropdownSelect, SurveyQuestionElementBase, SurveyQuestionEmpty, SurveyQuestionExpression, SurveyQuestionFile, SurveyQuestionHtml, SurveyQuestionImage, 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, SurveyQuestionTagbox, SurveyQuestionTagboxItem, SurveyQuestionText, SurveyRow, SurveyTimerPanel, SurveyWindow, SvgBundleComponent, SvgIcon, TagboxFilterString, TitleActions, TitleElement, attachKey2click };
5972
- //# sourceMappingURL=survey-react-ui.js.map
6008
+ 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, Survey, SurveyActionBar, SurveyElementBase, SurveyElementErrors, SurveyFileChooseButton, SurveyFilePreview, SurveyFlowPanel, SurveyHeader, SurveyLocStringEditor, SurveyLocStringViewer, SurveyNavigationBase, SurveyNavigationButton, SurveyPage, SurveyPanel, SurveyProgress, SurveyProgressButtons, SurveyProgressToc, SurveyQuestion, SurveyQuestionAndErrorsCell, SurveyQuestionBoolean, SurveyQuestionBooleanCheckbox, SurveyQuestionBooleanRadio, SurveyQuestionButtonGroup, SurveyQuestionCheckbox, SurveyQuestionCheckboxItem, SurveyQuestionComment, SurveyQuestionCommentItem, SurveyQuestionComposite, SurveyQuestionCustom, SurveyQuestionDropdown, SurveyQuestionDropdownBase, SurveyQuestionDropdownSelect, SurveyQuestionElementBase, SurveyQuestionEmpty, SurveyQuestionExpression, SurveyQuestionFile, SurveyQuestionHtml, SurveyQuestionImage, 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, SurveyQuestionTagbox, SurveyQuestionTagboxItem, SurveyQuestionText, SurveyRow, SurveyTimerPanel, SurveyWindow, SvgBundleComponent, SvgIcon, TagboxFilterString, TitleActions, TitleElement, attachKey2click };
6009
+ //# sourceMappingURL=survey-react-ui.mjs.map