survey-react-ui 2.1.1 → 2.2.1

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.1.1
2
+ * surveyjs - Survey JavaScript library v2.2.1
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
  */
@@ -1450,7 +1450,7 @@ class SurveyQuestion extends SurveyElementBase {
1450
1450
  var descriptionUnderInput = question.hasDescriptionUnderInput
1451
1451
  ? this.renderDescription()
1452
1452
  : null;
1453
- return (React.createElement("div", { className: question.cssContent || undefined, style: contentStyle, role: "presentation" },
1453
+ return (React.createElement("div", { className: question.cssContent || undefined, style: contentStyle, "aria-hidden": question.contentAriaHidden, role: "presentation" },
1454
1454
  questionRender,
1455
1455
  comment,
1456
1456
  descriptionUnderInput));
@@ -1925,7 +1925,7 @@ class PopupModal extends SurveyElementBase {
1925
1925
  PopupModal.modalDescriptors = [];
1926
1926
 
1927
1927
  /*!
1928
- * surveyjs - Survey JavaScript library v2.1.1
1928
+ * surveyjs - Survey JavaScript library v2.2.1
1929
1929
  * Copyright (c) 2015-2025 Devsoft Baltic OÜ - http://surveyjs.io/
1930
1930
  * License: MIT (http://www.opensource.org/licenses/mit-license.php)
1931
1931
  */
@@ -1995,7 +1995,7 @@ var iconsV1 = {
1995
1995
  };
1996
1996
 
1997
1997
  /*!
1998
- * surveyjs - Survey JavaScript library v2.1.1
1998
+ * surveyjs - Survey JavaScript library v2.2.1
1999
1999
  * Copyright (c) 2015-2025 Devsoft Baltic OÜ - http://surveyjs.io/
2000
2000
  * License: MIT (http://www.opensource.org/licenses/mit-license.php)
2001
2001
  */
@@ -5215,7 +5215,7 @@ class SurveyQuestionSlider extends SurveyQuestionElementBase {
5215
5215
  }
5216
5216
  getInputsAndThumbs() {
5217
5217
  const inputsAndThumbs = [];
5218
- const value = this.question.getRenderedValue();
5218
+ const value = this.question.renderedValue;
5219
5219
  for (let i = 0; i < value.length; i++) {
5220
5220
  const thumbAndInput = React.createElement(React.Fragment, { key: i },
5221
5221
  this.getInput(i),
@@ -5225,8 +5225,8 @@ class SurveyQuestionSlider extends SurveyQuestionElementBase {
5225
5225
  return inputsAndThumbs;
5226
5226
  }
5227
5227
  getThumb(i) {
5228
- const { cssClasses, getThumbContainerCss, tooltipVisibility, tooltipCss, getPercent, getRenderedValue, getTooltipValue } = this.question;
5229
- const value = getRenderedValue()[i];
5228
+ const { cssClasses, getThumbContainerCss, tooltipVisibility, tooltipCss, getPercent, renderedValue, getTooltipValue } = this.question;
5229
+ const value = renderedValue[i];
5230
5230
  let tooltip = null;
5231
5231
  if (tooltipVisibility !== "never") {
5232
5232
  tooltip = React.createElement("div", { className: tooltipCss },
@@ -5240,24 +5240,20 @@ class SurveyQuestionSlider extends SurveyQuestionElementBase {
5240
5240
  return thumb;
5241
5241
  }
5242
5242
  getInput(i) {
5243
- const { renderedMax: max, renderedMin: min, step, cssClasses, isDisabledAttr, getRenderedValue, handleOnChange, handlePointerDown, handlePointerUp, handleKeyDown, handleKeyUp, handleOnFocus, handleOnBlur } = this.question;
5244
- const value = getRenderedValue()[i];
5243
+ const { renderedMax: max, renderedMin: min, step, cssClasses, isDisabledAttr, renderedValue, handleOnChange, handlePointerDown, handlePointerUp, handleKeyDown, handleKeyUp, handleOnFocus, handleOnBlur } = this.question;
5244
+ const value = renderedValue[i];
5245
5245
  const input = React.createElement("input", { className: cssClasses.input, id: "sjs-slider-input-" + i, type: "range", min: min, max: max, step: step, value: value, onChange: (e) => { handleOnChange(e.nativeEvent, i); }, onPointerDown: (e) => { handlePointerDown(e.nativeEvent); }, onPointerUp: (e) => { e.stopPropagation(); handlePointerUp(e.nativeEvent); }, onKeyDown: (e) => { handleKeyDown(e.nativeEvent); }, onKeyUp: (e) => { handleKeyUp(e.nativeEvent); }, onFocus: () => { handleOnFocus(i); }, onBlur: () => { handleOnBlur(); }, disabled: isDisabledAttr, "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 });
5246
5246
  return input;
5247
5247
  }
5248
5248
  getRangeInput() {
5249
5249
  const { renderedMax: max, renderedMin: min, step, cssClasses, handleRangeOnChange, handleRangePointerDown, handleRangePointerUp } = this.question;
5250
- return React.createElement("input", { name: "range-input", ref: this.rangeInputRef, className: cssClasses.input, type: "range", "aria-hidden": "true", min: min, max: max, step: step, tabIndex: -1, onChange: (e) => { handleRangeOnChange(e.nativeEvent); }, onPointerDown: (e) => { e.persist(); handleRangePointerDown(e.nativeEvent, this.control); }, onPointerUp: (e) => { handleRangePointerUp(e.nativeEvent, this.control); } });
5250
+ return React.createElement("input", { name: "range-input", id: "sjs-slider-input-range-input", ref: this.rangeInputRef, className: cssClasses.input, type: "range", "aria-hidden": "true", min: min, max: max, step: step, tabIndex: -1, onChange: (e) => { handleRangeOnChange(e.nativeEvent); }, onPointerDown: (e) => { e.persist(); handleRangePointerDown(e.nativeEvent, this.control); }, onPointerUp: (e) => { handleRangePointerUp(e.nativeEvent, this.control); } });
5251
5251
  }
5252
5252
  getLabels() {
5253
5253
  const labels = [];
5254
- const { renderedLabels, cssClasses, handleLabelPointerUp, getLabelCss } = this.question;
5254
+ const { renderedLabels, cssClasses } = this.question;
5255
5255
  for (let i = 0; i < renderedLabels.length; i++) {
5256
- const value = renderedLabels[i].value;
5257
- const text = renderedLabels[i].locText;
5258
- const label = React.createElement("div", { key: i, className: getLabelCss(i), style: { left: value + "%" }, onPointerUp: (e) => { handleLabelPointerUp(e.nativeEvent, i); } },
5259
- React.createElement("div", { className: cssClasses.labelTick }),
5260
- React.createElement("div", { className: cssClasses.labelText }, this.renderLocString(text)));
5256
+ const label = ReactElementFactory.Instance.createElement("sv-slider-label-item", { item: renderedLabels[i], question: this.question, key: renderedLabels[i].id });
5261
5257
  labels.push(label);
5262
5258
  }
5263
5259
  return React.createElement("div", { className: cssClasses.labelsContainer },
@@ -6038,6 +6034,31 @@ ReactElementFactory.Instance.registerElement("sv-question-error", (props) => {
6038
6034
  return React.createElement(QuestionErrorComponent, props);
6039
6035
  });
6040
6036
 
6037
+ class SliderLabelItem extends SurveyElementBase {
6038
+ getStateElement() {
6039
+ return this.item;
6040
+ }
6041
+ get item() {
6042
+ return this.props.item;
6043
+ }
6044
+ get question() {
6045
+ return this.props.question;
6046
+ }
6047
+ componentDidUpdate(prevProps, prevState) {
6048
+ super.componentDidUpdate(prevProps, prevState);
6049
+ }
6050
+ renderElement() {
6051
+ const { cssClasses, handleLabelPointerUp, getLabelCss, getPercent } = this.question;
6052
+ const { value, locText } = this.item;
6053
+ return React.createElement("div", { key: this.item.id, className: getLabelCss(locText), style: { left: getPercent(value) + "%" }, onPointerUp: (e) => { handleLabelPointerUp(e.nativeEvent, value); } },
6054
+ React.createElement("div", { className: cssClasses.labelTick }),
6055
+ React.createElement("div", { className: cssClasses.labelText }, this.renderLocString(locText)));
6056
+ }
6057
+ }
6058
+ ReactElementFactory.Instance.registerElement("sv-slider-label-item", (props) => {
6059
+ return React.createElement(SliderLabelItem, props);
6060
+ });
6061
+
6041
6062
  class Skeleton extends React.Component {
6042
6063
  render() {
6043
6064
  var _a, _b;
@@ -6171,7 +6192,7 @@ ReactElementFactory.Instance.registerElement(LocalizableString.editableRenderer,
6171
6192
  return React.createElement(SurveyLocStringEditor, props);
6172
6193
  });
6173
6194
 
6174
- checkLibraryVersion(`${"2.1.1"}`, "survey-react-ui");
6195
+ checkLibraryVersion(`${"2.2.1"}`, "survey-react-ui");
6175
6196
 
6176
- 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, SurveyQuestionButtonGroupDropdown, 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, SurveyQuestionSlider, SurveyQuestionTagbox, SurveyQuestionTagboxItem, SurveyQuestionText, SurveyRow, SurveyTimerPanel, SurveyWindow, SvgBundleComponent, SvgIcon, TagboxFilterString, TitleActions, TitleElement, attachKey2click };
6197
+ 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, 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, 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 };
6177
6198
  //# sourceMappingURL=survey-react-ui.mjs.map