survey-react-ui 1.9.95 → 1.9.97

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "survey-react-ui",
3
- "version": "1.9.95",
3
+ "version": "1.9.97",
4
4
  "description": "survey.js is a JavaScript Survey Library. It is a modern way to add a survey to your website. It uses JSON for survey metadata and results.",
5
5
  "keywords": [
6
6
  "Survey",
@@ -21,7 +21,7 @@
21
21
  },
22
22
  "typings": "survey-react-ui.d.ts",
23
23
  "dependencies": {
24
- "survey-core": "1.9.95",
24
+ "survey-core": "1.9.97",
25
25
  "react": "^16.5.0 || ^17.0.1 || ^18.1.0",
26
26
  "react-dom": "^16.5.0 || ^17.0.1 || ^18.1.0"
27
27
  }
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - Survey JavaScript library v1.9.95
2
+ * surveyjs - Survey JavaScript library v1.9.97
3
3
  * Copyright (c) 2015-2023 Devsoft Baltic OÜ - http://surveyjs.io/
4
4
  * License: MIT (http://www.opensource.org/licenses/mit-license.php)
5
5
  */
@@ -690,7 +690,7 @@ __webpack_require__.r(__webpack_exports__);
690
690
 
691
691
 
692
692
 
693
- Object(survey_core__WEBPACK_IMPORTED_MODULE_2__["checkLibraryVersion"])("" + "1.9.95", "survey-react-ui");
693
+ Object(survey_core__WEBPACK_IMPORTED_MODULE_2__["checkLibraryVersion"])("" + "1.9.97", "survey-react-ui");
694
694
 
695
695
 
696
696
  /***/ }),
@@ -3563,7 +3563,9 @@ var SurveyQuestionDropdownBase = /** @class */ (function (_super) {
3563
3563
  this.renderInput(this.question["dropdownListModel"]),
3564
3564
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_components_popup_popup__WEBPACK_IMPORTED_MODULE_2__["Popup"], { model: (_b = (_a = this.question) === null || _a === void 0 ? void 0 : _a.dropdownListModel) === null || _b === void 0 ? void 0 : _b.popupModel }));
3565
3565
  }
3566
- return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: cssClasses.selectWrapper }, selectElement));
3566
+ return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: cssClasses.selectWrapper, onClick: this.click },
3567
+ selectElement,
3568
+ this.createChevronButton()));
3567
3569
  };
3568
3570
  SurveyQuestionDropdownBase.prototype.renderValueElement = function (dropdownListModel) {
3569
3571
  if (this.question.showInputFieldComponent) {
@@ -3583,7 +3585,7 @@ var SurveyQuestionDropdownBase = /** @class */ (function (_super) {
3583
3585
  dropdownListModel.inputStringRendered = e.target.value;
3584
3586
  }
3585
3587
  };
3586
- return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { id: this.question.inputId, className: this.question.getControlClass(), tabIndex: dropdownListModel.inputReadOnly ? undefined : 0, onClick: this.click,
3588
+ return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { id: this.question.inputId, className: this.question.getControlClass(), tabIndex: dropdownListModel.inputReadOnly ? undefined : 0,
3587
3589
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
3588
3590
  // @ts-ignore
3589
3591
  disabled: this.question.isInputReadOnly, required: this.question.isRequired, onKeyDown: this.keyhandler, onBlur: this.blur, role: this.question.ariaRole, "aria-required": this.question.ariaRequired, "aria-label": this.question.ariaLabel, "aria-invalid": this.question.ariaInvalid, "aria-describedby": this.question.ariaDescribedBy, "aria-expanded": this.question.ariaExpanded === null ? undefined : this.question.ariaExpanded === "true", "aria-controls": dropdownListModel.listElementId, "aria-activedescendant": dropdownListModel.ariaActivedescendant },
@@ -3606,6 +3608,12 @@ var SurveyQuestionDropdownBase = /** @class */ (function (_super) {
3606
3608
  return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.question.cssClasses.cleanButton, style: style, onClick: this.clear },
3607
3609
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_components_svg_icon_svg_icon__WEBPACK_IMPORTED_MODULE_3__["SvgIcon"], { className: this.question.cssClasses.cleanButtonSvg, iconName: this.question.cssClasses.cleanButtonIconId, title: this.question.clearCaption, size: "auto" })));
3608
3610
  };
3611
+ SurveyQuestionDropdownBase.prototype.createChevronButton = function () {
3612
+ if (!this.question.cssClasses.chevronButtonIconId)
3613
+ return null;
3614
+ return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.question.cssClasses.chevronButton },
3615
+ react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_components_svg_icon_svg_icon__WEBPACK_IMPORTED_MODULE_3__["SvgIcon"], { className: this.question.cssClasses.chevronButtonSvg, iconName: this.question.cssClasses.chevronButtonIconId, size: 24 })));
3616
+ };
3609
3617
  SurveyQuestionDropdownBase.prototype.renderOther = function (cssClasses) {
3610
3618
  return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.question.getCommentAreaCss(true) },
3611
3619
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_reactquestion_comment__WEBPACK_IMPORTED_MODULE_5__["SurveyQuestionOtherValueItem"], { question: this.question, otherCss: cssClasses.other, cssClasses: cssClasses, isDisplayMode: this.isDisplayMode, isOther: true })));
@@ -3770,7 +3778,9 @@ var SurveyQuestionDropdownSelect = /** @class */ (function (_super) {
3770
3778
  (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("select", { id: this.question.inputId, className: this.question.getControlClass(), ref: function (select) { return (_this.setControl(select)); }, autoComplete: this.question.autocomplete, onChange: this.updateValueOnEvent, onInput: this.updateValueOnEvent, onClick: click, onKeyUp: keyup, "aria-required": this.question.ariaRequired, "aria-label": this.question.ariaLabel, "aria-invalid": this.question.ariaInvalid, "aria-describedby": this.question.ariaDescribedBy, required: this.question.isRequired },
3771
3779
  this.question.allowClear ? (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("option", { value: "" }, this.question.placeholder)) : null,
3772
3780
  this.question.visibleChoices.map(function (item, i) { return react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_dropdown_item__WEBPACK_IMPORTED_MODULE_4__["SurveyQuestionOptionItem"], { key: "item" + i, item: item }); })));
3773
- return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: cssClasses.selectWrapper }, selectElement));
3781
+ return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: cssClasses.selectWrapper },
3782
+ selectElement,
3783
+ this.createChevronButton()));
3774
3784
  };
3775
3785
  return SurveyQuestionDropdownSelect;
3776
3786
  }(_reactquestion_dropdown__WEBPACK_IMPORTED_MODULE_3__["SurveyQuestionDropdown"]));
@@ -4844,7 +4854,8 @@ var PopupSurvey = /** @class */ (function (_super) {
4844
4854
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", { className: this.popup.cssHeaderTitle, style: styleTitle }, "X"))) : null));
4845
4855
  };
4846
4856
  PopupSurvey.prototype.renderBody = function () {
4847
- return react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.popup.cssBody }, this.doRender());
4857
+ var _this = this;
4858
+ return react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.popup.cssBody, onScroll: function () { return _this.popup.onScroll(); } }, this.doRender());
4848
4859
  };
4849
4860
  PopupSurvey.prototype.createSurvey = function (newProps) {
4850
4861
  if (!newProps)
@@ -5021,6 +5032,7 @@ var Survey = /** @class */ (function (_super) {
5021
5032
  else {
5022
5033
  renderResult = this.renderSurvey();
5023
5034
  }
5035
+ var backgroundImage = !!this.survey.renderBackgroundImage ? react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.css.rootBackgroundImage, style: this.survey.backgroundImageStyle }) : null;
5024
5036
  var header = react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_components_survey_header_survey_header__WEBPACK_IMPORTED_MODULE_5__["SurveyHeader"], { survey: this.survey });
5025
5037
  var onSubmit = function (event) {
5026
5038
  event.preventDefault();
@@ -5031,11 +5043,9 @@ var Survey = /** @class */ (function (_super) {
5031
5043
  }
5032
5044
  var rootCss = this.survey.getRootCss();
5033
5045
  var cssClasses = this.rootNodeClassName ? this.rootNodeClassName + " " + rootCss : rootCss;
5034
- var formStyle = {
5035
- backgroundColor: this.survey.renderBackgroundOpacity
5036
- };
5037
5046
  return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { id: this.rootNodeId, ref: this.rootRef, className: cssClasses, style: this.survey.themeVariables },
5038
- react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("form", { onSubmit: onSubmit, style: formStyle },
5047
+ backgroundImage,
5048
+ react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("form", { onSubmit: onSubmit },
5039
5049
  customHeader,
5040
5050
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.css.container },
5041
5051
  header,
@@ -5513,6 +5523,8 @@ __webpack_require__.r(__webpack_exports__);
5513
5523
  /* harmony import */ var _reactSurveyNavigationBase__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./reactSurveyNavigationBase */ "./src/react/reactSurveyNavigationBase.tsx");
5514
5524
  /* harmony import */ var _element_factory__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./element-factory */ "./src/react/element-factory.tsx");
5515
5525
  /* harmony import */ var _components_list_list__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./components/list/list */ "./src/react/components/list/list.tsx");
5526
+ /* harmony import */ var _components_popup_popup__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./components/popup/popup */ "./src/react/components/popup/popup.tsx");
5527
+ /* harmony import */ var _components_svg_icon_svg_icon__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./components/svg-icon/svg-icon */ "./src/react/components/svg-icon/svg-icon.tsx");
5516
5528
  var __extends = (undefined && undefined.__extends) || (function () {
5517
5529
  var extendStatics = function (d, b) {
5518
5530
  extendStatics = Object.setPrototypeOf ||
@@ -5533,16 +5545,25 @@ var __extends = (undefined && undefined.__extends) || (function () {
5533
5545
 
5534
5546
 
5535
5547
 
5548
+
5549
+
5536
5550
  var SurveyProgressToc = /** @class */ (function (_super) {
5537
5551
  __extends(SurveyProgressToc, _super);
5538
5552
  function SurveyProgressToc() {
5539
5553
  return _super !== null && _super.apply(this, arguments) || this;
5540
5554
  }
5541
5555
  SurveyProgressToc.prototype.render = function () {
5542
- var listModel = Object(survey_core__WEBPACK_IMPORTED_MODULE_1__["createTOCListModel"])(this.props.model);
5543
- var rootCss = Object(survey_core__WEBPACK_IMPORTED_MODULE_1__["getTocRootCss"])(this.props.model);
5544
- return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: rootCss },
5545
- react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_components_list_list__WEBPACK_IMPORTED_MODULE_4__["List"], { model: listModel })));
5556
+ var tocModel = new survey_core__WEBPACK_IMPORTED_MODULE_1__["TOCModel"](this.props.model);
5557
+ var content;
5558
+ if (tocModel.isMobile) {
5559
+ content = react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { onClick: tocModel.togglePopup },
5560
+ react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_components_svg_icon_svg_icon__WEBPACK_IMPORTED_MODULE_6__["SvgIcon"], { iconName: tocModel.icon, size: 24 }),
5561
+ react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_components_popup_popup__WEBPACK_IMPORTED_MODULE_5__["Popup"], { model: tocModel.popupModel }));
5562
+ }
5563
+ else {
5564
+ content = react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_components_list_list__WEBPACK_IMPORTED_MODULE_4__["List"], { model: tocModel.listModel });
5565
+ }
5566
+ return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: tocModel.containerCss }, content));
5546
5567
  };
5547
5568
  return SurveyProgressToc;
5548
5569
  }(_reactSurveyNavigationBase__WEBPACK_IMPORTED_MODULE_2__["SurveyNavigationBase"]));
@@ -7221,7 +7242,7 @@ var SurveyQuestionFile = /** @class */ (function (_super) {
7221
7242
  fileInput = (this.isDisplayMode ?
7222
7243
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("input", { type: "file", disabled: this.isDisplayMode, className: !this.isDisplayMode ? this.question.cssClasses.fileInput : this.question.getReadOnlyFileCss(), id: this.question.inputId, ref: function (input) { return (_this.setControl(input)); }, style: !this.isDisplayMode ? {} : { color: "transparent" }, onChange: !this.isDisplayMode ? this.question.doChange : (function () { }), multiple: this.question.allowMultiple, placeholder: this.question.title, accept: this.question.acceptedTypes })
7223
7244
  :
7224
- react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("input", { type: "file", disabled: this.isDisplayMode, tabIndex: -1, className: !this.isDisplayMode ? this.question.cssClasses.fileInput : this.question.getReadOnlyFileCss(), id: this.question.inputId, ref: function (input) { return (_this.setControl(input)); }, style: !this.isDisplayMode ? {} : { color: "transparent" }, onChange: !this.isDisplayMode ? this.question.doChange : (function () { }), "aria-required": this.question.ariaRequired, "aria-label": this.question.ariaLabel, "aria-invalid": this.question.ariaInvalid, "aria-describedby": this.question.ariaDescribedBy, multiple: this.question.allowMultiple, title: this.question.inputTitle, accept: this.question.acceptedTypes }));
7245
+ react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("input", { type: "file", disabled: this.isDisplayMode, tabIndex: -1, className: !this.isDisplayMode ? this.question.cssClasses.fileInput : this.question.getReadOnlyFileCss(), id: this.question.inputId, ref: function (input) { return (_this.setControl(input)); }, style: !this.isDisplayMode ? {} : { color: "transparent" }, onChange: !this.isDisplayMode ? this.question.doChange : (function () { }), "aria-required": this.question.ariaRequired, "aria-label": this.question.ariaLabel, "aria-invalid": this.question.ariaInvalid, "aria-describedby": this.question.ariaDescribedBy, multiple: this.question.allowMultiple, title: this.question.inputTitle, accept: this.question.acceptedTypes, capture: this.question.renderCapture }));
7225
7246
  return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.question.fileRootCss },
7226
7247
  fileInput,
7227
7248
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.question.cssClasses.dragArea, onDrop: this.question.onDrop, onDragOver: this.question.onDragOver, onDragLeave: this.question.onDragLeave, onDragEnter: this.question.onDragEnter },
@@ -8790,12 +8811,12 @@ var SurveyQuestionRanking = /** @class */ (function (_super) {
8790
8811
  this.getItems(this.question.unRankingChoices, unrankedItem),
8791
8812
  this.question.unRankingChoices.length === 0 ? react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.question.cssClasses.containerPlaceholder },
8792
8813
  " ",
8793
- this.question.selectToRankFromContainerPlaceholder,
8814
+ this.question.selectToRankEmptyRankedAreaText,
8794
8815
  " ") : null),
8795
8816
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.question.cssClasses.containersDivider }),
8796
8817
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.question.getContainerClasses("to"), "data-ranking": "to-container" },
8797
8818
  this.getItems(),
8798
- this.question.rankingChoices.length === 0 ? react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.question.cssClasses.containerPlaceholder }, this.question.selectToRankToContainerPlaceholder) : null)));
8819
+ this.question.rankingChoices.length === 0 ? react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.question.cssClasses.containerPlaceholder }, this.question.selectToRankEmptyUnrankedAreaText) : null)));
8799
8820
  }
8800
8821
  };
8801
8822
  SurveyQuestionRanking.prototype.getItems = function (choices, unrankedItem) {
@@ -9079,7 +9100,7 @@ var SurveyQuestionTagbox = /** @class */ (function (_super) {
9079
9100
  var _this = this;
9080
9101
  var dropdownMultiSelectListModel = dropdownListModel;
9081
9102
  var items = this.question.selectedChoices.map(function (choice, index) { return _this.renderItem("item" + index, choice); });
9082
- return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { id: this.question.inputId, className: this.question.getControlClass(), tabIndex: dropdownListModel.inputReadOnly ? undefined : 0, onClick: this.click,
9103
+ return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { id: this.question.inputId, className: this.question.getControlClass(), tabIndex: dropdownListModel.inputReadOnly ? undefined : 0,
9083
9104
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
9084
9105
  // @ts-ignore
9085
9106
  disabled: this.question.isInputReadOnly, required: this.question.isRequired, onKeyDown: this.keyhandler, onBlur: this.blur, role: this.question.ariaRole, "aria-required": this.question.ariaRequired, "aria-label": this.question.ariaLabel, "aria-invalid": this.question.ariaInvalid, "aria-describedby": this.question.ariaDescribedBy, "aria-expanded": this.question.ariaExpanded === null ? undefined : this.question.ariaExpanded === "true", "aria-controls": dropdownListModel.listElementId, "aria-activedescendant": dropdownListModel.ariaActivedescendant },