survey-react-ui 3.0.0-beta.3 → 3.0.0-beta.5

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 v3.0.0-beta.3
2
+ * surveyjs - Survey JavaScript library v3.0.0-beta.5
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
  */
@@ -415,7 +415,7 @@ class SurveyActionBarSeparator extends React.Component {
415
415
  super(props);
416
416
  }
417
417
  render() {
418
- var className = `sv-action-bar-separator ${this.props.cssClasses}`;
418
+ var className = `sd-action-bar__separator ${this.props.cssClasses}`;
419
419
  return React.createElement("div", { className: className });
420
420
  }
421
421
  }
@@ -501,7 +501,7 @@ class SurveyAction extends SurveyElementBase {
501
501
  item: this.item,
502
502
  });
503
503
  return (React.createElement("div", { className: itemClass, id: "" + this.item.uniqueId, ref: this.ref },
504
- React.createElement("div", { className: "sv-action__content" },
504
+ React.createElement("div", { className: this.item.getActionRootContentCss() },
505
505
  separator,
506
506
  itemComponent)));
507
507
  }
@@ -557,10 +557,9 @@ class SurveyActionBarItem extends SurveyElementBase {
557
557
  }
558
558
  renderInnerButton() {
559
559
  const className = this.item.getActionBarItemCss();
560
- const title = this.item.tooltip || this.item.title;
561
560
  const buttonContent = this.renderButtonContent();
562
561
  const tabIndex = this.item.disableTabStop ? -1 : undefined;
563
- const button = attachKey2click(React.createElement("button", { ref: this.ref, className: className, type: "button", disabled: this.item.disabled, onMouseDown: (args) => this.item.doMouseDown(args), onFocus: (args) => this.item.doFocus(args), onClick: (args) => this.item.doAction(args), title: title, tabIndex: tabIndex, "aria-checked": this.item.ariaChecked, "aria-expanded": this.item.ariaExpanded, "aria-controls": this.item.ariaControls, "aria-labelledby": this.item.ariaLabelledBy, role: this.item.ariaRole }, buttonContent), this.item, { processEsc: false });
562
+ const button = attachKey2click(React.createElement("button", { ref: this.ref, className: className, type: "button", disabled: this.item.disabled, onMouseDown: (args) => this.item.doMouseDown(args), onFocus: (args) => this.item.doFocus(args), onClick: (args) => this.item.doAction(args), title: this.item.getTooltip(), tabIndex: tabIndex, "aria-checked": this.item.ariaChecked, "aria-expanded": this.item.ariaExpanded, "aria-controls": this.item.ariaControls, "aria-labelledby": this.item.ariaLabelledBy, role: this.item.ariaRole }, buttonContent), this.item, { processEsc: false });
564
563
  return button;
565
564
  }
566
565
  componentDidMount() {
@@ -713,7 +712,7 @@ class PopupContainer extends SurveyElementBase {
713
712
  class PopupDropdownContainer extends PopupContainer {
714
713
  renderHeaderPopup(popupModel) {
715
714
  const popupDropdownModel = popupModel;
716
- if (!popupDropdownModel)
715
+ if (!popupDropdownModel || !popupDropdownModel.showHeader)
717
716
  return null;
718
717
  return (React.createElement("span", { style: {
719
718
  left: popupDropdownModel.pointerTarget.left,
@@ -1152,6 +1151,8 @@ var chevrondown_24x24 = "<svg viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/20
1152
1151
 
1153
1152
  var chevronright_16x16 = "<svg viewBox=\"0 0 16 16\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M11.35 8.34627L7.35 12.3463C7.25 12.4463 7.12 12.4963 7 12.4963C6.88 12.4963 6.74 12.4463 6.65 12.3463C6.45 12.1463 6.45 11.8363 6.65 11.6363L10.3 7.98627L6.65 4.34627C6.45 4.15627 6.45 3.83627 6.65 3.64627C6.85 3.45627 7.16 3.44627 7.35 3.64627L11.35 7.64627C11.55 7.84627 11.55 8.15627 11.35 8.35627V8.34627Z\"/></svg>";
1154
1153
 
1154
+ var chevronright_24x24 = "<svg viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M11.2263 7.46872L15.2263 11.4687C15.3763 11.6187 15.4463 11.8087 15.4463 11.9987C15.4463 12.1887 15.3763 12.3787 15.2263 12.5287L11.2263 16.5287C10.9363 16.8187 10.4563 16.8187 10.1663 16.5287C9.87629 16.2387 9.87629 15.7587 10.1663 15.4687L13.6363 11.9987L10.1663 8.52872C9.87629 8.23872 9.87629 7.75872 10.1663 7.46872C10.4563 7.17872 10.9363 7.17872 11.2263 7.46872Z\"/></svg>";
1155
+
1155
1156
  var clear_16x16 = "<svg viewBox=\"0 0 16 16\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M12.35 11.65C12.55 11.85 12.55 12.16 12.35 12.36C12.25 12.46 12.12 12.51 12 12.51C11.88 12.51 11.74 12.46 11.65 12.36L8 8.71L4.35 12.36C4.25 12.46 4.12 12.51 4 12.51C3.88 12.51 3.74 12.46 3.65 12.36C3.45 12.16 3.45 11.85 3.65 11.65L7.3 8L3.65 4.35C3.45 4.16 3.45 3.84 3.65 3.65C3.85 3.46 4.16 3.45 4.35 3.65L8 7.3L11.65 3.65C11.85 3.45 12.16 3.45 12.36 3.65C12.56 3.85 12.56 4.16 12.36 4.36L8.71 8.01L12.36 11.66L12.35 11.65Z\"/></svg>";
1156
1157
 
1157
1158
  var clear_24x24 = "<svg viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M20.12 10.9325C20.64 10.4125 20.93 9.7225 20.93 8.9925C20.93 8.2625 20.64 7.5725 20.12 7.0525L16.95 3.8825C15.88 2.8125 14.13 2.8125 13.06 3.8825L3.88 13.0525C3.36 13.5725 3.07 14.2625 3.07 14.9925C3.07 15.7225 3.36 16.4125 3.88 16.9325L5.64 18.6925C6.57 19.6225 7.78 20.0825 9 20.0825C10.22 20.0825 11.43 19.6225 12.36 18.6925L20.12 10.9325ZM14.12 4.9325C14.36 4.6925 14.67 4.5625 15 4.5625C15.33 4.5625 15.65 4.6925 15.88 4.9325L19.05 8.1025C19.54 8.5925 19.54 9.3825 19.05 9.8725L12.99 15.9325L8.05 10.9925L14.12 4.9325ZM6.7 17.6325L4.94 15.8725C4.45 15.3825 4.45 14.5925 4.94 14.1025L7 12.0425L11.94 16.9825L11.3 17.6225C10.07 18.8525 7.93 18.8525 6.7 17.6225V17.6325ZM22.75 20.9925C22.75 21.4025 22.41 21.7425 22 21.7425H14C13.59 21.7425 13.25 21.4025 13.25 20.9925C13.25 20.5825 13.59 20.2425 14 20.2425H22C22.41 20.2425 22.75 20.5825 22.75 20.9925ZM4.75 20.9925C4.75 21.4025 4.41 21.7425 4 21.7425H2C1.59 21.7425 1.25 21.4025 1.25 20.9925C1.25 20.5825 1.59 20.2425 2 20.2425H4C4.41 20.2425 4.75 20.5825 4.75 20.9925Z\"/></svg>";
@@ -1259,6 +1260,7 @@ const icons = {
1259
1260
  "check-24x24": check_24x24,
1260
1261
  "chevrondown-24x24": chevrondown_24x24,
1261
1262
  "chevronright-16x16": chevronright_16x16,
1263
+ "chevronright-24x24": chevronright_24x24,
1262
1264
  "clear-16x16": clear_16x16,
1263
1265
  "clear-24x24": clear_24x24,
1264
1266
  "close-16x16": close_16x16,
@@ -2896,13 +2898,13 @@ class SurveyQuestionSelectBaseItem extends ReactSurveyElement {
2896
2898
  return null; //{ marginRight: "3px" };
2897
2899
  }
2898
2900
  renderComment() {
2899
- if (!this.item.isCommentShowing)
2901
+ if (!this.item.renderedIsCommentShowing)
2900
2902
  return null;
2901
2903
  return React.createElement("div", { className: this.question.getCommentAreaCss(true) },
2902
2904
  React.createElement(SurveyQuestionCommentValueItem, { question: this.question, item: this.item, cssClasses: this.question.cssClasses }));
2903
2905
  }
2904
2906
  renderPanel() {
2905
- if (this.item.isPanelShowing) {
2907
+ if (this.item.renderedIsPanelShowing) {
2906
2908
  const panel = this.item.panel;
2907
2909
  return (React.createElement(SurveyPanel, { key: panel.id, element: panel, survey: this.question.survey, cssClasses: this.props.cssClasses, isDisplayMode: this.isDisplayMode, creator: this.props.creator }));
2908
2910
  }
@@ -3342,12 +3344,13 @@ class SurveyQuestionDropdownBase extends SurveyQuestionUncontrolledElement {
3342
3344
  return this.questionBase.renderedValue;
3343
3345
  }
3344
3346
  renderReadOnlyElement() {
3347
+ if (this.question.showInputFieldComponent) {
3348
+ return (React.createElement("div", { className: this.question.cssClasses.controlValue }, this.renderValueElement()));
3349
+ }
3345
3350
  if (this.question.readOnlyText) {
3346
3351
  return (React.createElement("div", { className: this.question.cssClasses.controlValue }, this.renderLocString(this.question.locReadOnlyText)));
3347
3352
  }
3348
- else {
3349
- return null;
3350
- }
3353
+ return null;
3351
3354
  }
3352
3355
  renderSelect(cssClasses) {
3353
3356
  let selectElement = null;
@@ -3368,7 +3371,9 @@ class SurveyQuestionDropdownBase extends SurveyQuestionUncontrolledElement {
3368
3371
  }
3369
3372
  renderValueElement() {
3370
3373
  if (this.question.showInputFieldComponent) {
3371
- return ReactElementFactory.Instance.createElement(this.question.inputFieldComponentName, { item: this.dropdownListModel.getSelectedAction(), question: this.question });
3374
+ const listModel = this.dropdownListModel;
3375
+ const actionItem = !!listModel ? listModel.getSelectedAction() : this.question.selectedItem;
3376
+ return ReactElementFactory.Instance.createElement(this.question.inputFieldComponentName, { item: actionItem, question: this.question });
3372
3377
  }
3373
3378
  else if (this.question.showSelectedItemLocText) {
3374
3379
  return this.renderLocString(this.question.selectedItemLocText);
@@ -3851,9 +3856,9 @@ class SurveyFileChooseButton extends ReactSurveyElement {
3851
3856
  return (this.props.item && this.props.item.data.question) || this.props.data.question;
3852
3857
  }
3853
3858
  render() {
3854
- return attachKey2click(React.createElement("label", { tabIndex: 0, className: this.question.getChooseFileCss(), htmlFor: this.question.inputId, "aria-label": this.question.chooseButtonText, onClick: (e) => this.question.chooseFile(e.nativeEvent) },
3855
- (!!this.question.cssClasses.chooseFileIconId) ? React.createElement(SvgIcon, { title: this.question.chooseButtonText, iconName: this.question.cssClasses.chooseFileIconId, size: "auto" }) : null,
3856
- React.createElement("span", null, this.question.chooseButtonText)));
3859
+ return attachKey2click(React.createElement("label", { tabIndex: 0, className: this.props.item.getActionBarItemCss(), htmlFor: this.question.inputId, "aria-label": this.question.chooseButtonText, onClick: (e) => this.question.chooseFile(e.nativeEvent) },
3860
+ !!this.props.item.iconName ? React.createElement(SvgIcon, { title: this.question.chooseButtonText, iconName: this.question.cssClasses.chooseFileIconId, size: "auto", className: this.props.item.cssClasses.itemIcon }) : null,
3861
+ this.props.item.hasTitle ? React.createElement(SurveyLocStringViewer, { model: this.props.item.locTitle, textClass: this.props.item.getActionBarItemTitleCss() }) : null));
3857
3862
  }
3858
3863
  }
3859
3864
  ReactElementFactory.Instance.registerElement("sv-file-choose-btn", (props) => {
@@ -3918,10 +3923,7 @@ class SurveyFileItem extends SurveyElementBase {
3918
3923
  this.renderFileSign(this.question.cssClasses.fileSign, val),
3919
3924
  React.createElement("div", { className: this.question.getImageWrapperCss(val) },
3920
3925
  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),
3921
- val.name && !this.question.isReadOnly ? (React.createElement("div", { className: this.question.getRemoveButtonCss(), onClick: (event) => this.question.doRemoveFile(val, event) },
3922
- React.createElement("span", { className: this.question.cssClasses.removeFile }, this.question.removeFileCaption),
3923
- (this.question.cssClasses.removeFileSvgIconId) ?
3924
- (React.createElement(SvgIcon, { title: this.question.removeFileCaption, iconName: this.question.cssClasses.removeFileSvgIconId, size: "auto", className: this.question.cssClasses.removeFileSvg })) : null)) : null),
3926
+ val.name && !this.question.isReadOnly ? (React.createElement(SurveyAction, { item: this.question.getRemoveFileButton(val) })) : null),
3925
3927
  this.renderFileSign(this.question.cssClasses.fileSignBottom, val)));
3926
3928
  }
3927
3929
  canRender() {
@@ -5122,10 +5124,11 @@ class List extends SurveyElementBase {
5122
5124
  React.createElement("button", { className: this.model.cssClasses.searchClearButtonIcon, onClick: (event) => { this.model.onClickSearchClearButton(event); } },
5123
5125
  React.createElement(SvgIcon, { iconName: "icon-searchclear", size: "auto" })) : null;
5124
5126
  return (React.createElement("div", { className: this.model.cssClasses.filter },
5125
- React.createElement("div", { className: this.model.cssClasses.filterIcon },
5126
- React.createElement(SvgIcon, { iconName: "icon-search", size: "auto" })),
5127
- React.createElement("input", { type: "text", className: this.model.cssClasses.filterInput, "aria-label": this.model.filterStringPlaceholder, placeholder: this.model.filterStringPlaceholder, value: this.state.filterString, onKeyUp: onKeyUp, onChange: onChange }),
5128
- clearButton));
5127
+ React.createElement("div", { className: this.model.cssClasses.filterBox },
5128
+ React.createElement("div", { className: this.model.cssClasses.filterIcon },
5129
+ React.createElement(SvgIcon, { iconName: "icon-search", size: "auto" })),
5130
+ React.createElement("input", { type: "text", className: this.model.cssClasses.filterInput, "aria-label": this.model.filterStringPlaceholder, placeholder: this.model.filterStringPlaceholder, value: this.state.filterString, onKeyUp: onKeyUp, onChange: onChange }),
5131
+ clearButton)));
5129
5132
  }
5130
5133
  }
5131
5134
  emptyContent() {
@@ -5174,6 +5177,10 @@ class SurveyQuestionRating extends SurveyQuestionElementBase {
5174
5177
  this.question.setValueFromClick(event.target.value);
5175
5178
  this.setState({ value: this.question.value });
5176
5179
  }
5180
+ componentDidMount() {
5181
+ super.componentDidMount();
5182
+ this.setState({ value: this.question.value });
5183
+ }
5177
5184
  renderItem(item, index) {
5178
5185
  const renderedItem = ReactElementFactory.Instance.createElement(this.question.itemComponent, {
5179
5186
  question: this.question,
@@ -5334,12 +5341,7 @@ class PopupSurvey extends Survey {
5334
5341
  renderElement() {
5335
5342
  var header = this.renderWindowHeader();
5336
5343
  var body = this.renderBody();
5337
- let style = {};
5338
- if (!!this.popup.renderedWidth) {
5339
- style.width = this.popup.renderedWidth;
5340
- style.maxWidth = this.popup.renderedWidth;
5341
- }
5342
- return (React.createElement("div", { className: this.popup.cssRoot, style: style, onScroll: () => this.popup.onScroll() },
5344
+ return (React.createElement("div", { className: this.popup.cssRoot, style: this.popup.renderedStyle, onScroll: () => this.popup.onScroll() },
5343
5345
  React.createElement("div", { className: this.popup.cssRootContent },
5344
5346
  header,
5345
5347
  body)));
@@ -5644,13 +5646,13 @@ class SurveyQuestionSignaturePad extends SurveyQuestionElementBase {
5644
5646
  renderElement() {
5645
5647
  var cssClasses = this.question.cssClasses;
5646
5648
  const loadingIndicator = this.question.showLoadingIndicator ? this.renderLoadingIndicator() : null;
5647
- var clearButton = this.renderCleanButton();
5649
+ var toolbar = this.renderToolbar();
5648
5650
  return (React.createElement("div", { className: cssClasses.root, ref: (root) => (this.setControl(root)), style: { width: this.question.renderedCanvasWidth } },
5649
5651
  React.createElement("div", { className: cssClasses.placeholder, style: { display: this.question.needShowPlaceholder() ? "" : "none" } }, this.renderLocString(this.question.locRenderedPlaceholder)),
5650
5652
  React.createElement("div", null,
5651
5653
  this.renderBackgroundImage(),
5652
5654
  React.createElement("canvas", { tabIndex: -1, className: this.question.cssClasses.canvas, onBlur: (event) => { this.question.onBlur(event); } })),
5653
- clearButton,
5655
+ toolbar,
5654
5656
  loadingIndicator));
5655
5657
  }
5656
5658
  renderBackgroundImage() {
@@ -5662,14 +5664,8 @@ class SurveyQuestionSignaturePad extends SurveyQuestionElementBase {
5662
5664
  return React.createElement("div", { className: this.question.cssClasses.loadingIndicator },
5663
5665
  React.createElement(LoadingIndicatorComponent, null));
5664
5666
  }
5665
- renderCleanButton() {
5666
- if (!this.question.canShowClearButton)
5667
- return null;
5668
- var cssClasses = this.question.cssClasses;
5669
- return React.createElement("div", { className: cssClasses.controls },
5670
- React.createElement("button", { type: "button", className: cssClasses.clearButton, title: this.question.clearButtonCaption, onClick: () => this.question.clearValueFromUI() },
5671
- this.question.cssClasses.clearButtonIconId ? React.createElement(SvgIcon, { iconName: this.question.cssClasses.clearButtonIconId, size: "auto" }) : React.createElement("span", null, "\u2716"),
5672
- " "));
5667
+ renderToolbar() {
5668
+ return React.createElement(SurveyActionBar, { model: this.question.toolbar });
5673
5669
  }
5674
5670
  }
5675
5671
  ReactQuestionFactory.Instance.registerQuestion("signaturepad", (props) => {
@@ -5774,6 +5770,13 @@ class SurveyQuestionCustom extends SurveyQuestionUncontrolledElement {
5774
5770
  }
5775
5771
  return res;
5776
5772
  }
5773
+ getRenderedElements() {
5774
+ const res = super.getRenderedElements();
5775
+ if (!!this.question.contentQuestion) {
5776
+ res.push(this.question.contentQuestion);
5777
+ }
5778
+ return res;
5779
+ }
5777
5780
  renderElement() {
5778
5781
  return SurveyQuestion.renderQuestionBody(this.creator, this.question.contentQuestion);
5779
5782
  }
@@ -6094,7 +6097,7 @@ ReactElementFactory.Instance.registerElement(LocalizableString.editableRenderer,
6094
6097
  return React.createElement(SurveyLocStringEditor, props);
6095
6098
  });
6096
6099
 
6097
- checkLibraryVersion(`${"3.0.0-beta.3"}`, "survey-react-ui");
6100
+ checkLibraryVersion(`${"3.0.0-beta.5"}`, "survey-react-ui");
6098
6101
 
6099
6102
  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, 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, SurveyQuestionMatrixDropdown, SurveyQuestionMatrixDropdownBase, SurveyQuestionMatrixDropdownCell, SurveyQuestionMatrixDynamic, SurveyQuestionMatrixDynamicDragDropIcon, SurveyQuestionMatrixRow, SurveyQuestionMultipleText, SurveyQuestionOptionItem, SurveyQuestionPanelDynamic, SurveyQuestionPanelDynamicProgressText, SurveyQuestionRadioItem, SurveyQuestionRadiogroup, SurveyQuestionRanking, SurveyQuestionRankingItem, SurveyQuestionRankingItemContent, SurveyQuestionRating, SurveyQuestionRatingDropdown, SurveyQuestionSignaturePad, SurveyQuestionSlider, SurveyQuestionTagbox, SurveyQuestionTagboxItem, SurveyQuestionText, SurveyRow, SurveyTimerPanel, SurveyWindow, SvgBundleComponent, SvgIcon, TagboxFilterString, TitleActions, TitleElement, attachKey2click };
6100
6103
  //# sourceMappingURL=survey-react-ui.mjs.map