survey-react-ui 1.11.7 → 1.11.9

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.11.7",
3
+ "version": "1.11.9",
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
  "peerDependencies": {
24
- "survey-core": "1.11.7",
24
+ "survey-core": "1.11.9",
25
25
  "react": "^16.5.0 || ^17.0.1 || ^18.2.0",
26
26
  "react-dom": "^16.5.0 || ^17.0.1 || ^18.2.0"
27
27
  }
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - Survey JavaScript library v1.11.7
2
+ * surveyjs - Survey JavaScript library v1.11.9
3
3
  * Copyright (c) 2015-2024 Devsoft Baltic OÜ - http://surveyjs.io/
4
4
  * License: MIT (http://www.opensource.org/licenses/mit-license.php)
5
5
  */
@@ -750,7 +750,7 @@ __webpack_require__.r(__webpack_exports__);
750
750
 
751
751
 
752
752
 
753
- Object(survey_core__WEBPACK_IMPORTED_MODULE_2__["checkLibraryVersion"])("" + "1.11.7", "survey-react-ui");
753
+ Object(survey_core__WEBPACK_IMPORTED_MODULE_2__["checkLibraryVersion"])("" + "1.11.9", "survey-react-ui");
754
754
 
755
755
 
756
756
  /***/ }),
@@ -2151,6 +2151,18 @@ var List = /** @class */ (function (_super) {
2151
2151
  this.model.initListContainerHtmlElement(this.listContainerRef.current);
2152
2152
  }
2153
2153
  };
2154
+ List.prototype.componentDidUpdate = function (prevProps, prevState) {
2155
+ var _a;
2156
+ _super.prototype.componentDidUpdate.call(this, prevProps, prevState);
2157
+ if (this.model !== prevProps.model) {
2158
+ if (this.model && !!((_a = this.listContainerRef) === null || _a === void 0 ? void 0 : _a.current)) {
2159
+ this.model.initListContainerHtmlElement(this.listContainerRef.current);
2160
+ }
2161
+ if (prevProps.model) {
2162
+ prevProps.model.initListContainerHtmlElement(undefined);
2163
+ }
2164
+ }
2165
+ };
2154
2166
  List.prototype.componentWillUnmount = function () {
2155
2167
  _super.prototype.componentWillUnmount.call(this);
2156
2168
  if (!!this.model) {
@@ -4311,7 +4323,7 @@ var SurveyQuestionDropdownBase = /** @class */ (function (_super) {
4311
4323
  return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { id: this.question.inputId, className: this.question.getControlClass(), tabIndex: dropdownListModel.noTabIndex ? undefined : 0,
4312
4324
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
4313
4325
  // @ts-ignore
4314
- disabled: this.question.isDisabledAttr, 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-errormessage": this.question.ariaErrormessage, "aria-expanded": this.question.ariaExpanded === null ? undefined : this.question.ariaExpanded === "true", "aria-controls": dropdownListModel.listElementId, "aria-activedescendant": dropdownListModel.ariaActivedescendant },
4326
+ disabled: this.question.isDisabledAttr, 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-errormessage": this.question.ariaErrormessage, "aria-expanded": this.question.ariaExpanded, "aria-controls": dropdownListModel.listElementId, "aria-activedescendant": dropdownListModel.ariaActivedescendant },
4315
4327
  dropdownListModel.showHintPrefix ?
4316
4328
  (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.question.cssClasses.hintPrefix },
4317
4329
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", null, dropdownListModel.hintStringPrefix))) : null,
@@ -4321,7 +4333,7 @@ var SurveyQuestionDropdownBase = /** @class */ (function (_super) {
4321
4333
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", { style: { visibility: "hidden" }, "data-bind": "text: model.filterString" }, dropdownListModel.inputStringRendered),
4322
4334
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", null, dropdownListModel.hintStringSuffix))) : null,
4323
4335
  valueElement,
4324
- react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("input", { type: "text", autoComplete: "off", id: this.question.getInputId(), ref: function (element) { return (_this.inputElement = element); }, className: this.question.cssClasses.filterStringInput, role: dropdownListModel.filterStringEnabled ? this.question.ariaRole : undefined, "aria-expanded": this.question.ariaExpanded === null ? undefined : this.question.ariaExpanded === "true", "aria-label": this.question.a11y_input_ariaLabel, "aria-labelledby": this.question.a11y_input_ariaLabelledBy, "aria-describedby": this.question.a11y_input_ariaDescribedBy, "aria-controls": dropdownListModel.listElementId, "aria-activedescendant": dropdownListModel.ariaActivedescendant, placeholder: dropdownListModel.placeholderRendered, readOnly: dropdownListModel.filterReadOnly ? true : undefined, tabIndex: dropdownListModel.noTabIndex ? undefined : -1, disabled: this.question.isDisabledAttr, inputMode: dropdownListModel.inputMode, onChange: function (e) { onInputChange(e); }, onBlur: this.blur, onFocus: this.focus })),
4336
+ react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("input", { type: "text", autoComplete: "off", id: this.question.getInputId(), ref: function (element) { return (_this.inputElement = element); }, className: this.question.cssClasses.filterStringInput, role: dropdownListModel.filterStringEnabled ? this.question.ariaRole : undefined, "aria-expanded": this.question.ariaExpanded, "aria-label": this.question.a11y_input_ariaLabel, "aria-labelledby": this.question.a11y_input_ariaLabelledBy, "aria-describedby": this.question.a11y_input_ariaDescribedBy, "aria-controls": dropdownListModel.listElementId, "aria-activedescendant": dropdownListModel.ariaActivedescendant, placeholder: dropdownListModel.placeholderRendered, readOnly: dropdownListModel.filterReadOnly ? true : undefined, tabIndex: dropdownListModel.noTabIndex ? undefined : -1, disabled: this.question.isDisabledAttr, inputMode: dropdownListModel.inputMode, onChange: function (e) { onInputChange(e); }, onBlur: this.blur, onFocus: this.focus })),
4325
4337
  this.createClearButton()));
4326
4338
  };
4327
4339
  SurveyQuestionDropdownBase.prototype.createClearButton = function () {
@@ -6672,7 +6684,7 @@ var SurveyQuestion = /** @class */ (function (_super) {
6672
6684
  var rootStyle = question.getRootStyle();
6673
6685
  var questionContent = this.wrapQuestionContent(this.renderQuestionContent());
6674
6686
  return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"](react__WEBPACK_IMPORTED_MODULE_0__["Fragment"], null,
6675
- react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { ref: this.rootRef, id: question.id, className: question.getRootCss(), style: rootStyle, role: question.ariaRole, "aria-required": this.question.ariaRequired, "aria-invalid": this.question.ariaInvalid, "aria-labelledby": question.ariaLabelledBy, "aria-describedby": question.ariaDescribedBy, "aria-expanded": question.ariaExpanded === null ? undefined : question.ariaExpanded === "true" },
6687
+ react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { ref: this.rootRef, id: question.id, className: question.getRootCss(), style: rootStyle, role: question.ariaRole, "aria-required": this.question.ariaRequired, "aria-invalid": this.question.ariaInvalid, "aria-labelledby": question.ariaLabelledBy, "aria-describedby": question.ariaDescribedBy, "aria-expanded": question.ariaExpanded },
6676
6688
  errorsAboveQuestion,
6677
6689
  headerTop,
6678
6690
  questionContent,
@@ -7872,19 +7884,19 @@ var SurveyQuestionElementBase = /** @class */ (function (_super) {
7872
7884
  SurveyQuestionElementBase.prototype.componentWillUnmount = function () {
7873
7885
  _super.prototype.componentWillUnmount.call(this);
7874
7886
  if (!!this.questionBase) {
7875
- var el = this.control;
7876
- this.questionBase.beforeDestroyQuestionElement(el);
7877
- if (!!el) {
7878
- el.removeAttribute("data-rendered");
7887
+ var contentElement = this.content || this.control;
7888
+ this.questionBase.beforeDestroyQuestionElement(contentElement);
7889
+ if (!!contentElement) {
7890
+ contentElement.removeAttribute("data-rendered");
7879
7891
  }
7880
7892
  }
7881
7893
  };
7882
7894
  SurveyQuestionElementBase.prototype.updateDomElement = function () {
7883
- var el = this.control;
7884
- if (!!el) {
7885
- if (el.getAttribute("data-rendered") !== "r") {
7886
- el.setAttribute("data-rendered", "r");
7887
- this.questionBase.afterRenderQuestionElement(el);
7895
+ var contentElement = this.content || this.control;
7896
+ if (!!contentElement) {
7897
+ if (contentElement.getAttribute("data-rendered") !== "r") {
7898
+ contentElement.setAttribute("data-rendered", "r");
7899
+ this.questionBase.afterRenderQuestionElement(contentElement);
7888
7900
  }
7889
7901
  }
7890
7902
  };
@@ -7942,6 +7954,11 @@ var SurveyQuestionElementBase = /** @class */ (function (_super) {
7942
7954
  this.control = element;
7943
7955
  }
7944
7956
  };
7957
+ SurveyQuestionElementBase.prototype.setContent = function (element) {
7958
+ if (!!element) {
7959
+ this.content = element;
7960
+ }
7961
+ };
7945
7962
  return SurveyQuestionElementBase;
7946
7963
  }(SurveyElementBase));
7947
7964
 
@@ -8227,7 +8244,7 @@ var SurveyQuestionFile = /** @class */ (function (_super) {
8227
8244
  else {
8228
8245
  fileInput = null;
8229
8246
  }
8230
- return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.question.fileRootCss },
8247
+ return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.question.fileRootCss, ref: function (el) { return (_this.setContent(el)); } },
8231
8248
  fileInput,
8232
8249
  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 },
8233
8250
  fileDecorator,
@@ -10237,7 +10254,7 @@ var SurveyQuestionTagbox = /** @class */ (function (_super) {
10237
10254
  return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { id: this.question.inputId, className: this.question.getControlClass(), tabIndex: dropdownListModel.noTabIndex ? undefined : 0,
10238
10255
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
10239
10256
  // @ts-ignore
10240
- 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-errormessage": this.question.ariaErrormessage, "aria-expanded": this.question.ariaExpanded === null ? undefined : this.question.ariaExpanded === "true", "aria-controls": dropdownListModel.listElementId, "aria-activedescendant": dropdownListModel.ariaActivedescendant },
10257
+ 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-errormessage": this.question.ariaErrormessage, "aria-expanded": this.question.ariaExpanded, "aria-controls": dropdownListModel.listElementId, "aria-activedescendant": dropdownListModel.ariaActivedescendant },
10241
10258
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.question.cssClasses.controlValue },
10242
10259
  items,
10243
10260
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_tagbox_filter__WEBPACK_IMPORTED_MODULE_4__["TagboxFilterString"], { model: dropdownMultiSelectListModel, question: this.question })),
@@ -11116,7 +11133,7 @@ var TagboxFilterString = /** @class */ (function (_super) {
11116
11133
  (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.question.cssClasses.hintSuffix },
11117
11134
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", { style: { visibility: "hidden" }, "data-bind": "text: model.filterString" }, this.model.inputStringRendered),
11118
11135
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", null, this.model.hintStringSuffix))) : null,
11119
- react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("input", { type: "text", autoComplete: "off", id: this.question.getInputId(), inputMode: this.model.inputMode, ref: function (element) { return (_this.inputElement = element); }, className: this.question.cssClasses.filterStringInput, disabled: this.question.isInputReadOnly, readOnly: this.model.filterReadOnly ? true : undefined, size: !this.model.inputStringRendered ? 1 : undefined, role: this.model.filterStringEnabled ? this.question.ariaRole : undefined, "aria-expanded": this.question.ariaExpanded === null ? undefined : this.question.ariaExpanded === "true", "aria-label": this.question.a11y_input_ariaLabel, "aria-labelledby": this.question.a11y_input_ariaLabelledBy, "aria-describedby": this.question.a11y_input_ariaDescribedBy, "aria-controls": this.model.listElementId, "aria-activedescendant": this.model.ariaActivedescendant, placeholder: this.model.filterStringPlaceholder, onKeyDown: function (e) { _this.keyhandler(e); }, onChange: function (e) { _this.onChange(e); }, onBlur: function (e) { _this.onBlur(e); }, onFocus: function (e) { _this.onFocus(e); } }))));
11136
+ react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("input", { type: "text", autoComplete: "off", id: this.question.getInputId(), inputMode: this.model.inputMode, ref: function (element) { return (_this.inputElement = element); }, className: this.question.cssClasses.filterStringInput, disabled: this.question.isInputReadOnly, readOnly: this.model.filterReadOnly ? true : undefined, size: !this.model.inputStringRendered ? 1 : undefined, role: this.model.filterStringEnabled ? this.question.ariaRole : undefined, "aria-expanded": this.question.ariaExpanded, "aria-label": this.question.a11y_input_ariaLabel, "aria-labelledby": this.question.a11y_input_ariaLabelledBy, "aria-describedby": this.question.a11y_input_ariaDescribedBy, "aria-controls": this.model.listElementId, "aria-activedescendant": this.model.ariaActivedescendant, placeholder: this.model.filterStringPlaceholder, onKeyDown: function (e) { _this.keyhandler(e); }, onChange: function (e) { _this.onChange(e); }, onBlur: function (e) { _this.onBlur(e); }, onFocus: function (e) { _this.onFocus(e); } }))));
11120
11137
  };
11121
11138
  return TagboxFilterString;
11122
11139
  }(_reactquestion_element__WEBPACK_IMPORTED_MODULE_3__["SurveyElementBase"]));