survey-react-ui 2.3.1 → 2.3.2

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.3.1
2
+ * surveyjs - Survey JavaScript library v2.3.2
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
  */
@@ -1930,7 +1930,7 @@ class PopupModal extends SurveyElementBase {
1930
1930
  PopupModal.modalDescriptors = [];
1931
1931
 
1932
1932
  /*!
1933
- * surveyjs - Survey JavaScript library v2.3.1
1933
+ * surveyjs - Survey JavaScript library v2.3.2
1934
1934
  * Copyright (c) 2015-2025 Devsoft Baltic OÜ - http://surveyjs.io/
1935
1935
  * License: MIT (http://www.opensource.org/licenses/mit-license.php)
1936
1936
  */
@@ -2000,7 +2000,7 @@ var iconsV1 = {
2000
2000
  };
2001
2001
 
2002
2002
  /*!
2003
- * surveyjs - Survey JavaScript library v2.3.1
2003
+ * surveyjs - Survey JavaScript library v2.3.2
2004
2004
  * Copyright (c) 2015-2025 Devsoft Baltic OÜ - http://surveyjs.io/
2005
2005
  * License: MIT (http://www.opensource.org/licenses/mit-license.php)
2006
2006
  */
@@ -3694,12 +3694,22 @@ ReactElementFactory.Instance.registerElement("sv-file-choose-btn", (props) => {
3694
3694
  return React.createElement(SurveyFileChooseButton, props);
3695
3695
  });
3696
3696
 
3697
- class SurveyFileItem extends SurveyElementBase {
3697
+ class SurveyFilePage extends SurveyElementBase {
3698
3698
  get question() {
3699
3699
  return this.props.question;
3700
3700
  }
3701
- get item() {
3702
- return this.props.item;
3701
+ get page() {
3702
+ return this.props.page;
3703
+ }
3704
+ renderElement() {
3705
+ const items = this.page.items.map((item, index) => { return ReactElementFactory.Instance.createElement("sv-file-item", { item, question: this.question, key: index }); });
3706
+ return (React.createElement("div", { className: this.page.css, id: this.page.id }, items));
3707
+ }
3708
+ }
3709
+
3710
+ class SurveyFilePreview extends SurveyElementBase {
3711
+ get question() {
3712
+ return this.props.question;
3703
3713
  }
3704
3714
  renderFileSign(className, val) {
3705
3715
  if (!className || !val.name)
@@ -3710,38 +3720,23 @@ class SurveyFileItem extends SurveyElementBase {
3710
3720
  }, title: val.name, download: val.name, style: { width: this.question.imageWidth } }, val.name)));
3711
3721
  }
3712
3722
  renderElement() {
3713
- const val = this.item;
3714
- return (React.createElement("span", { className: this.question.cssClasses.previewItem, onClick: (event) => this.question.doDownloadFileFromContainer(event) },
3715
- this.renderFileSign(this.question.cssClasses.fileSign, val),
3716
- React.createElement("div", { className: this.question.getImageWrapperCss(val) },
3717
- this.question.canPreviewImage(val) ? (React.createElement("img", { src: val.content, style: { height: this.question.imageHeight, width: this.question.imageWidth }, alt: "File preview" })) : (this.question.cssClasses.defaultImage ? (React.createElement(SvgIcon, { iconName: this.question.cssClasses.defaultImageIconId, size: "auto", className: this.question.cssClasses.defaultImage })) : null),
3718
- val.name && !this.question.isReadOnly ? (React.createElement("div", { className: this.question.getRemoveButtonCss(), onClick: (event) => this.question.doRemoveFile(val, event) },
3719
- React.createElement("span", { className: this.question.cssClasses.removeFile }, this.question.removeFileCaption),
3720
- (this.question.cssClasses.removeFileSvgIconId) ?
3721
- (React.createElement(SvgIcon, { title: this.question.removeFileCaption, iconName: this.question.cssClasses.removeFileSvgIconId, size: "auto", className: this.question.cssClasses.removeFileSvg })) : null)) : null),
3722
- this.renderFileSign(this.question.cssClasses.fileSignBottom, val)));
3723
+ const content = this.question.renderedPages.map((page, index) => { return (React.createElement(SurveyFilePage, { page: page, question: this.question, key: page.id })); });
3724
+ return React.createElement("div", { className: this.question.cssClasses.fileList || undefined }, content);
3723
3725
  }
3724
3726
  canRender() {
3725
3727
  return this.question.showPreviewContainer;
3726
3728
  }
3727
3729
  }
3730
+ ReactElementFactory.Instance.registerElement("sv-file-preview", (props) => {
3731
+ return React.createElement(SurveyFilePreview, props);
3732
+ });
3728
3733
 
3729
- class SurveyFilePage extends SurveyElementBase {
3734
+ class SurveyFileItem extends SurveyElementBase {
3730
3735
  get question() {
3731
3736
  return this.props.question;
3732
3737
  }
3733
- get page() {
3734
- return this.props.page;
3735
- }
3736
- renderElement() {
3737
- const items = this.page.items.map((item, index) => { return (React.createElement(SurveyFileItem, { item: item, question: this.question, key: index })); });
3738
- return (React.createElement("div", { className: this.page.css, id: this.page.id }, items));
3739
- }
3740
- }
3741
-
3742
- class SurveyFilePreview extends SurveyElementBase {
3743
- get question() {
3744
- return this.props.question;
3738
+ get item() {
3739
+ return this.props.item;
3745
3740
  }
3746
3741
  renderFileSign(className, val) {
3747
3742
  if (!className || !val.name)
@@ -3752,15 +3747,23 @@ class SurveyFilePreview extends SurveyElementBase {
3752
3747
  }, title: val.name, download: val.name, style: { width: this.question.imageWidth } }, val.name)));
3753
3748
  }
3754
3749
  renderElement() {
3755
- const content = this.question.renderedPages.map((page, index) => { return (React.createElement(SurveyFilePage, { page: page, question: this.question, key: page.id })); });
3756
- return React.createElement("div", { className: this.question.cssClasses.fileList || undefined }, content);
3750
+ const val = this.item;
3751
+ return (React.createElement("span", { className: this.question.cssClasses.previewItem, onClick: (event) => this.question.doDownloadFileFromContainer(event) },
3752
+ this.renderFileSign(this.question.cssClasses.fileSign, val),
3753
+ React.createElement("div", { className: this.question.getImageWrapperCss(val) },
3754
+ this.question.canPreviewImage(val) ? (React.createElement("img", { src: val.content, style: { height: this.question.imageHeight, width: this.question.imageWidth }, alt: "File preview" })) : (this.question.cssClasses.defaultImage ? (React.createElement(SvgIcon, { iconName: this.question.cssClasses.defaultImageIconId, size: "auto", className: this.question.cssClasses.defaultImage })) : null),
3755
+ val.name && !this.question.isReadOnly ? (React.createElement("div", { className: this.question.getRemoveButtonCss(), onClick: (event) => this.question.doRemoveFile(val, event) },
3756
+ React.createElement("span", { className: this.question.cssClasses.removeFile }, this.question.removeFileCaption),
3757
+ (this.question.cssClasses.removeFileSvgIconId) ?
3758
+ (React.createElement(SvgIcon, { title: this.question.removeFileCaption, iconName: this.question.cssClasses.removeFileSvgIconId, size: "auto", className: this.question.cssClasses.removeFileSvg })) : null)) : null),
3759
+ this.renderFileSign(this.question.cssClasses.fileSignBottom, val)));
3757
3760
  }
3758
3761
  canRender() {
3759
3762
  return this.question.showPreviewContainer;
3760
3763
  }
3761
3764
  }
3762
- ReactElementFactory.Instance.registerElement("sv-file-preview", (props) => {
3763
- return React.createElement(SurveyFilePreview, props);
3765
+ ReactElementFactory.Instance.registerElement("sv-file-item", (props) => {
3766
+ return React.createElement(SurveyFileItem, props);
3764
3767
  });
3765
3768
 
3766
3769
  class SurveyQuestionMultipleText extends SurveyQuestionElementBase {
@@ -4181,15 +4184,15 @@ RendererFactory.Instance.registerRenderer("boolean", "checkbox", "sv-boolean-che
4181
4184
  class SurveyQuestionBooleanRadio extends SurveyQuestionBoolean {
4182
4185
  constructor(props) {
4183
4186
  super(props);
4184
- this.handleOnChange = (event) => {
4185
- this.question.booleanValue = event.nativeEvent.target.value == "true";
4186
- };
4187
4187
  }
4188
4188
  renderRadioItem(value, locText) {
4189
4189
  const cssClasses = this.question.cssClasses;
4190
+ const handleOnChange = () => {
4191
+ this.question.value = value;
4192
+ };
4190
4193
  return (React.createElement("div", { role: "presentation", className: this.question.getRadioItemClass(cssClasses, value) },
4191
4194
  React.createElement("label", { className: cssClasses.radioLabel },
4192
- React.createElement("input", { type: "radio", name: this.question.name, value: value, "aria-errormessage": this.question.ariaErrormessage, checked: value === this.question.booleanValueRendered, disabled: this.question.isDisabledAttr, readOnly: this.question.isReadOnlyAttr, className: cssClasses.itemRadioControl, onChange: this.handleOnChange }),
4195
+ React.createElement("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 }),
4193
4196
  this.question.cssClasses.materialRadioDecorator ?
4194
4197
  (React.createElement("span", { className: cssClasses.materialRadioDecorator }, this.question.itemSvgIcon ?
4195
4198
  (React.createElement("svg", { className: cssClasses.itemRadioDecorator },
@@ -4201,12 +4204,12 @@ class SurveyQuestionBooleanRadio extends SurveyQuestionBoolean {
4201
4204
  return (React.createElement("div", { className: cssClasses.rootRadio },
4202
4205
  React.createElement("fieldset", { role: "presentation", className: cssClasses.radioFieldset }, !this.question.swapOrder ?
4203
4206
  (React.createElement(React.Fragment, null,
4204
- this.renderRadioItem(false, this.question.locLabelFalse),
4205
- this.renderRadioItem(true, this.question.locLabelTrue)))
4207
+ this.renderRadioItem(this.question.getValueFalse(), this.question.locLabelFalse),
4208
+ this.renderRadioItem(this.question.getValueTrue(), this.question.locLabelTrue)))
4206
4209
  :
4207
4210
  (React.createElement(React.Fragment, null,
4208
- this.renderRadioItem(true, this.question.locLabelTrue),
4209
- this.renderRadioItem(false, this.question.locLabelFalse))))));
4211
+ this.renderRadioItem(this.question.getValueTrue(), this.question.locLabelTrue),
4212
+ this.renderRadioItem(this.question.getValueFalse(), this.question.locLabelFalse))))));
4210
4213
  }
4211
4214
  }
4212
4215
  ReactQuestionFactory.Instance.registerQuestion("sv-boolean-radio", (props) => {
@@ -6211,7 +6214,7 @@ ReactElementFactory.Instance.registerElement(LocalizableString.editableRenderer,
6211
6214
  return React.createElement(SurveyLocStringEditor, props);
6212
6215
  });
6213
6216
 
6214
- checkLibraryVersion(`${"2.3.1"}`, "survey-react-ui");
6217
+ checkLibraryVersion(`${"2.3.2"}`, "survey-react-ui");
6215
6218
 
6216
- 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 };
6219
+ 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, 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 };
6217
6220
  //# sourceMappingURL=survey-react-ui.mjs.map