survey-react-ui 3.0.0-beta.3 → 3.0.0-beta.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.
package/index.html CHANGED
@@ -11,7 +11,6 @@
11
11
  <script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.8.23/browser.js"></script>
12
12
  <script src="./node_modules/survey-core/survey.core.js"></script>
13
13
  <script src="./node_modules/survey-core/themes/index.js"></script>
14
- <script src="./node_modules/survey-core/themes/test.js"></script>
15
14
  <link rel="stylesheet" href="./node_modules/survey-core/survey-core.css" />
16
15
  <script src="./build/survey-react-ui.js"></script>
17
16
  </head>
@@ -20,7 +19,7 @@
20
19
  <div id="surveyElement" style="position: fixed; top: 0; left: 0; bottom: 0; right: 0;"></div>
21
20
  <div id="surveyResultElement"></div>
22
21
  <script type="text/babel" src="./index.js"></script>
23
- <script defer src="survey-react-ui.js"></script>
22
+ <script defer src="./build/survey-react-ui.js"></script>
24
23
  </body>
25
24
 
26
25
  </html>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "survey-react-ui",
3
- "version": "3.0.0-beta.3",
3
+ "version": "3.0.0-beta.4",
4
4
  "license": "MIT",
5
5
  "author": "DevSoft Baltic OU <info@devsoftbaltic.com>",
6
6
  "homepage": "https://surveyjs.io/",
@@ -51,7 +51,7 @@
51
51
  }
52
52
  },
53
53
  "peerDependencies": {
54
- "survey-core": "3.0.0-beta.3",
54
+ "survey-core": "3.0.0-beta.4",
55
55
  "react": "^16.5.0 || ^17.0.1 || ^18.1.0 || ^19.0.0",
56
56
  "react-dom": "^16.5.0 || ^17.0.1 || ^18.1.0 || ^19.0.0"
57
57
  }
@@ -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.4
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
  */
@@ -537,7 +537,7 @@
537
537
  return _super.call(this, props) || this;
538
538
  }
539
539
  SurveyActionBarSeparator.prototype.render = function () {
540
- var className = "sv-action-bar-separator ".concat(this.props.cssClasses);
540
+ var className = "sd-action-bar__separator ".concat(this.props.cssClasses);
541
541
  return React__namespace.createElement("div", { className: className });
542
542
  };
543
543
  return SurveyActionBarSeparator;
@@ -645,7 +645,7 @@
645
645
  item: this.item,
646
646
  });
647
647
  return (React__namespace.createElement("div", { className: itemClass, id: "" + this.item.uniqueId, ref: this.ref },
648
- React__namespace.createElement("div", { className: "sv-action__content" },
648
+ React__namespace.createElement("div", { className: this.item.getActionRootContentCss() },
649
649
  separator,
650
650
  itemComponent)));
651
651
  };
@@ -710,10 +710,9 @@
710
710
  SurveyActionBarItem.prototype.renderInnerButton = function () {
711
711
  var _this = this;
712
712
  var className = this.item.getActionBarItemCss();
713
- var title = this.item.tooltip || this.item.title;
714
713
  var buttonContent = this.renderButtonContent();
715
714
  var tabIndex = this.item.disableTabStop ? -1 : undefined;
716
- var button = attachKey2click(React__namespace.createElement("button", { ref: this.ref, className: className, type: "button", disabled: this.item.disabled, onMouseDown: function (args) { return _this.item.doMouseDown(args); }, onFocus: function (args) { return _this.item.doFocus(args); }, onClick: function (args) { return _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 });
715
+ var button = attachKey2click(React__namespace.createElement("button", { ref: this.ref, className: className, type: "button", disabled: this.item.disabled, onMouseDown: function (args) { return _this.item.doMouseDown(args); }, onFocus: function (args) { return _this.item.doFocus(args); }, onClick: function (args) { return _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 });
717
716
  return button;
718
717
  };
719
718
  SurveyActionBarItem.prototype.componentDidMount = function () {
@@ -888,7 +887,7 @@
888
887
  }
889
888
  PopupDropdownContainer.prototype.renderHeaderPopup = function (popupModel) {
890
889
  var popupDropdownModel = popupModel;
891
- if (!popupDropdownModel)
890
+ if (!popupDropdownModel || !popupDropdownModel.showHeader)
892
891
  return null;
893
892
  return (React__namespace.createElement("span", { style: {
894
893
  left: popupDropdownModel.pointerTarget.left,
@@ -1413,6 +1412,8 @@
1413
1412
 
1414
1413
  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>";
1415
1414
 
1415
+ 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>";
1416
+
1416
1417
  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>";
1417
1418
 
1418
1419
  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>";
@@ -1520,6 +1521,7 @@
1520
1521
  "check-24x24": check_24x24,
1521
1522
  "chevrondown-24x24": chevrondown_24x24,
1522
1523
  "chevronright-16x16": chevronright_16x16,
1524
+ "chevronright-24x24": chevronright_24x24,
1523
1525
  "clear-16x16": clear_16x16,
1524
1526
  "clear-24x24": clear_24x24,
1525
1527
  "close-16x16": close_16x16,
@@ -3431,13 +3433,13 @@
3431
3433
  configurable: true
3432
3434
  });
3433
3435
  SurveyQuestionSelectBaseItem.prototype.renderComment = function () {
3434
- if (!this.item.isCommentShowing)
3436
+ if (!this.item.renderedIsCommentShowing)
3435
3437
  return null;
3436
3438
  return React__namespace.createElement("div", { className: this.question.getCommentAreaCss(true) },
3437
3439
  React__namespace.createElement(SurveyQuestionCommentValueItem, { question: this.question, item: this.item, cssClasses: this.question.cssClasses }));
3438
3440
  };
3439
3441
  SurveyQuestionSelectBaseItem.prototype.renderPanel = function () {
3440
- if (this.item.isPanelShowing) {
3442
+ if (this.item.renderedIsPanelShowing) {
3441
3443
  var panel = this.item.panel;
3442
3444
  return (React__namespace.createElement(SurveyPanel, { key: panel.id, element: panel, survey: this.question.survey, cssClasses: this.props.cssClasses, isDisplayMode: this.isDisplayMode, creator: this.props.creator }));
3443
3445
  }
@@ -4040,12 +4042,13 @@
4040
4042
  return this.questionBase.renderedValue;
4041
4043
  };
4042
4044
  SurveyQuestionDropdownBase.prototype.renderReadOnlyElement = function () {
4045
+ if (this.question.showInputFieldComponent) {
4046
+ return (React__namespace.createElement("div", { className: this.question.cssClasses.controlValue }, this.renderValueElement()));
4047
+ }
4043
4048
  if (this.question.readOnlyText) {
4044
4049
  return (React__namespace.createElement("div", { className: this.question.cssClasses.controlValue }, this.renderLocString(this.question.locReadOnlyText)));
4045
4050
  }
4046
- else {
4047
- return null;
4048
- }
4051
+ return null;
4049
4052
  };
4050
4053
  SurveyQuestionDropdownBase.prototype.renderSelect = function (cssClasses) {
4051
4054
  var _this = this;
@@ -4067,7 +4070,9 @@
4067
4070
  };
4068
4071
  SurveyQuestionDropdownBase.prototype.renderValueElement = function () {
4069
4072
  if (this.question.showInputFieldComponent) {
4070
- return ReactElementFactory.Instance.createElement(this.question.inputFieldComponentName, { item: this.dropdownListModel.getSelectedAction(), question: this.question });
4073
+ var listModel = this.dropdownListModel;
4074
+ var actionItem = !!listModel ? listModel.getSelectedAction() : this.question.selectedItem;
4075
+ return ReactElementFactory.Instance.createElement(this.question.inputFieldComponentName, { item: actionItem, question: this.question });
4071
4076
  }
4072
4077
  else if (this.question.showSelectedItemLocText) {
4073
4078
  return this.renderLocString(this.question.selectedItemLocText);
@@ -4639,9 +4644,9 @@
4639
4644
  });
4640
4645
  SurveyFileChooseButton.prototype.render = function () {
4641
4646
  var _this = this;
4642
- return attachKey2click(React__namespace.createElement("label", { tabIndex: 0, className: this.question.getChooseFileCss(), htmlFor: this.question.inputId, "aria-label": this.question.chooseButtonText, onClick: function (e) { return _this.question.chooseFile(e.nativeEvent); } },
4643
- (!!this.question.cssClasses.chooseFileIconId) ? React__namespace.createElement(SvgIcon, { title: this.question.chooseButtonText, iconName: this.question.cssClasses.chooseFileIconId, size: "auto" }) : null,
4644
- React__namespace.createElement("span", null, this.question.chooseButtonText)));
4647
+ return attachKey2click(React__namespace.createElement("label", { tabIndex: 0, className: this.props.item.getActionBarItemCss(), htmlFor: this.question.inputId, "aria-label": this.question.chooseButtonText, onClick: function (e) { return _this.question.chooseFile(e.nativeEvent); } },
4648
+ !!this.props.item.iconName ? React__namespace.createElement(SvgIcon, { title: this.question.chooseButtonText, iconName: this.question.cssClasses.chooseFileIconId, size: "auto", className: this.props.item.cssClasses.itemIcon }) : null,
4649
+ this.props.item.hasTitle ? React__namespace.createElement(SurveyLocStringViewer, { model: this.props.item.locTitle, textClass: this.props.item.getActionBarItemTitleCss() }) : null));
4645
4650
  };
4646
4651
  return SurveyFileChooseButton;
4647
4652
  }(ReactSurveyElement));
@@ -4746,10 +4751,7 @@
4746
4751
  this.renderFileSign(this.question.cssClasses.fileSign, val),
4747
4752
  React__namespace.createElement("div", { className: this.question.getImageWrapperCss(val) },
4748
4753
  this.question.canPreviewImage(val) ? (React__namespace.createElement("img", { src: val.content, style: { height: this.question.imageHeight, width: this.question.imageWidth }, alt: "File preview" })) : (this.question.cssClasses.defaultImage ? (React__namespace.createElement(SvgIcon, { iconName: this.question.cssClasses.defaultImageIconId, size: "auto", className: this.question.cssClasses.defaultImage })) : null),
4749
- val.name && !this.question.isReadOnly ? (React__namespace.createElement("div", { className: this.question.getRemoveButtonCss(), onClick: function (event) { return _this.question.doRemoveFile(val, event); } },
4750
- React__namespace.createElement("span", { className: this.question.cssClasses.removeFile }, this.question.removeFileCaption),
4751
- (this.question.cssClasses.removeFileSvgIconId) ?
4752
- (React__namespace.createElement(SvgIcon, { title: this.question.removeFileCaption, iconName: this.question.cssClasses.removeFileSvgIconId, size: "auto", className: this.question.cssClasses.removeFileSvg })) : null)) : null),
4754
+ val.name && !this.question.isReadOnly ? (React__namespace.createElement(SurveyAction, { item: this.question.getRemoveFileButton(val) })) : null),
4753
4755
  this.renderFileSign(this.question.cssClasses.fileSignBottom, val)));
4754
4756
  };
4755
4757
  SurveyFileItem.prototype.canRender = function () {
@@ -6202,10 +6204,11 @@
6202
6204
  React__namespace.createElement("button", { className: this.model.cssClasses.searchClearButtonIcon, onClick: function (event) { _this.model.onClickSearchClearButton(event); } },
6203
6205
  React__namespace.createElement(SvgIcon, { iconName: "icon-searchclear", size: "auto" })) : null;
6204
6206
  return (React__namespace.createElement("div", { className: this.model.cssClasses.filter },
6205
- React__namespace.createElement("div", { className: this.model.cssClasses.filterIcon },
6206
- React__namespace.createElement(SvgIcon, { iconName: "icon-search", size: "auto" })),
6207
- React__namespace.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 }),
6208
- clearButton));
6207
+ React__namespace.createElement("div", { className: this.model.cssClasses.filterBox },
6208
+ React__namespace.createElement("div", { className: this.model.cssClasses.filterIcon },
6209
+ React__namespace.createElement(SvgIcon, { iconName: "icon-search", size: "auto" })),
6210
+ React__namespace.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 }),
6211
+ clearButton)));
6209
6212
  }
6210
6213
  };
6211
6214
  List.prototype.emptyContent = function () {
@@ -6266,6 +6269,10 @@
6266
6269
  this.question.setValueFromClick(event.target.value);
6267
6270
  this.setState({ value: this.question.value });
6268
6271
  };
6272
+ SurveyQuestionRating.prototype.componentDidMount = function () {
6273
+ _super.prototype.componentDidMount.call(this);
6274
+ this.setState({ value: this.question.value });
6275
+ };
6269
6276
  SurveyQuestionRating.prototype.renderItem = function (item, index) {
6270
6277
  var renderedItem = ReactElementFactory.Instance.createElement(this.question.itemComponent, {
6271
6278
  question: this.question,
@@ -6449,12 +6456,7 @@
6449
6456
  var _this = this;
6450
6457
  var header = this.renderWindowHeader();
6451
6458
  var body = this.renderBody();
6452
- var style = {};
6453
- if (!!this.popup.renderedWidth) {
6454
- style.width = this.popup.renderedWidth;
6455
- style.maxWidth = this.popup.renderedWidth;
6456
- }
6457
- return (React__namespace.createElement("div", { className: this.popup.cssRoot, style: style, onScroll: function () { return _this.popup.onScroll(); } },
6459
+ return (React__namespace.createElement("div", { className: this.popup.cssRoot, style: this.popup.renderedStyle, onScroll: function () { return _this.popup.onScroll(); } },
6458
6460
  React__namespace.createElement("div", { className: this.popup.cssRootContent },
6459
6461
  header,
6460
6462
  body)));
@@ -6819,13 +6821,13 @@
6819
6821
  var _this = this;
6820
6822
  var cssClasses = this.question.cssClasses;
6821
6823
  var loadingIndicator = this.question.showLoadingIndicator ? this.renderLoadingIndicator() : null;
6822
- var clearButton = this.renderCleanButton();
6824
+ var toolbar = this.renderToolbar();
6823
6825
  return (React__namespace.createElement("div", { className: cssClasses.root, ref: function (root) { return (_this.setControl(root)); }, style: { width: this.question.renderedCanvasWidth } },
6824
6826
  React__namespace.createElement("div", { className: cssClasses.placeholder, style: { display: this.question.needShowPlaceholder() ? "" : "none" } }, this.renderLocString(this.question.locRenderedPlaceholder)),
6825
6827
  React__namespace.createElement("div", null,
6826
6828
  this.renderBackgroundImage(),
6827
6829
  React__namespace.createElement("canvas", { tabIndex: -1, className: this.question.cssClasses.canvas, onBlur: function (event) { _this.question.onBlur(event); } })),
6828
- clearButton,
6830
+ toolbar,
6829
6831
  loadingIndicator));
6830
6832
  };
6831
6833
  SurveyQuestionSignaturePad.prototype.renderBackgroundImage = function () {
@@ -6837,15 +6839,8 @@
6837
6839
  return React__namespace.createElement("div", { className: this.question.cssClasses.loadingIndicator },
6838
6840
  React__namespace.createElement(LoadingIndicatorComponent, null));
6839
6841
  };
6840
- SurveyQuestionSignaturePad.prototype.renderCleanButton = function () {
6841
- var _this = this;
6842
- if (!this.question.canShowClearButton)
6843
- return null;
6844
- var cssClasses = this.question.cssClasses;
6845
- return React__namespace.createElement("div", { className: cssClasses.controls },
6846
- React__namespace.createElement("button", { type: "button", className: cssClasses.clearButton, title: this.question.clearButtonCaption, onClick: function () { return _this.question.clearValueFromUI(); } },
6847
- this.question.cssClasses.clearButtonIconId ? React__namespace.createElement(SvgIcon, { iconName: this.question.cssClasses.clearButtonIconId, size: "auto" }) : React__namespace.createElement("span", null, "\u2716"),
6848
- " "));
6842
+ SurveyQuestionSignaturePad.prototype.renderToolbar = function () {
6843
+ return React__namespace.createElement(SurveyActionBar, { model: this.question.toolbar });
6849
6844
  };
6850
6845
  return SurveyQuestionSignaturePad;
6851
6846
  }(SurveyQuestionElementBase));
@@ -6976,6 +6971,13 @@
6976
6971
  }
6977
6972
  return res;
6978
6973
  };
6974
+ SurveyQuestionCustom.prototype.getRenderedElements = function () {
6975
+ var res = _super.prototype.getRenderedElements.call(this);
6976
+ if (!!this.question.contentQuestion) {
6977
+ res.push(this.question.contentQuestion);
6978
+ }
6979
+ return res;
6980
+ };
6979
6981
  SurveyQuestionCustom.prototype.renderElement = function () {
6980
6982
  return SurveyQuestion.renderQuestionBody(this.creator, this.question.contentQuestion);
6981
6983
  };
@@ -7418,7 +7420,7 @@
7418
7420
  return React__namespace.createElement(SurveyLocStringEditor, props);
7419
7421
  });
7420
7422
 
7421
- surveyCore.checkLibraryVersion("".concat("3.0.0-beta.3"), "survey-react-ui");
7423
+ surveyCore.checkLibraryVersion("".concat("3.0.0-beta.4"), "survey-react-ui");
7422
7424
 
7423
7425
  Object.defineProperty(exports, "Model", {
7424
7426
  enumerable: true,