survey-react-ui 1.9.88 → 1.9.89

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.88",
3
+ "version": "1.9.89",
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.88",
24
+ "survey-core": "1.9.89",
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.88
2
+ * surveyjs - Survey JavaScript library v1.9.89
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
  */
@@ -1189,7 +1189,7 @@ __webpack_require__.r(__webpack_exports__);
1189
1189
 
1190
1190
 
1191
1191
 
1192
- Object(survey_core__WEBPACK_IMPORTED_MODULE_2__["checkLibraryVersion"])("" + "1.9.88", "survey-react-ui");
1192
+ Object(survey_core__WEBPACK_IMPORTED_MODULE_2__["checkLibraryVersion"])("" + "1.9.89", "survey-react-ui");
1193
1193
 
1194
1194
 
1195
1195
  /***/ }),
@@ -4133,7 +4133,7 @@ var SurveyQuestionDropdownBase = /** @class */ (function (_super) {
4133
4133
  return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { id: this.question.inputId, className: this.question.getControlClass(), tabIndex: dropdownListModel.inputReadOnly ? undefined : 0, onClick: this.click,
4134
4134
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
4135
4135
  // @ts-ignore
4136
- 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 ? "true" : "false", "aria-controls": dropdownListModel.listElementId, "aria-activedescendant": dropdownListModel.ariaActivedescendant },
4136
+ 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 },
4137
4137
  dropdownListModel.showHintPrefix ?
4138
4138
  (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.question.cssClasses.hintPrefix },
4139
4139
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", null, dropdownListModel.hintStringPrefix))) : null,
@@ -4143,7 +4143,7 @@ var SurveyQuestionDropdownBase = /** @class */ (function (_super) {
4143
4143
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", { style: { visibility: "hidden" }, "data-bind": "text: model.filterString" }, dropdownListModel.inputStringRendered),
4144
4144
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", null, dropdownListModel.hintStringSuffix))) : null,
4145
4145
  valueElement,
4146
- 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-label": this.question.placeholder, "aria-expanded": this.question.ariaExpanded ? "true" : "false", "aria-controls": dropdownListModel.listElementId, "aria-activedescendant": dropdownListModel.ariaActivedescendant, placeholder: dropdownListModel.placeholderRendered, readOnly: !dropdownListModel.searchEnabled ? true : undefined, tabIndex: dropdownListModel.inputReadOnly ? undefined : -1, disabled: this.question.isInputReadOnly, inputMode: dropdownListModel.inputMode, onChange: function (e) { onInputChange(e); }, onBlur: this.blur, onFocus: this.focus })),
4146
+ 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-label": this.question.placeholder, "aria-expanded": this.question.ariaExpanded === null ? undefined : this.question.ariaExpanded === "true", "aria-controls": dropdownListModel.listElementId, "aria-activedescendant": dropdownListModel.ariaActivedescendant, placeholder: dropdownListModel.placeholderRendered, readOnly: !dropdownListModel.searchEnabled ? true : undefined, tabIndex: dropdownListModel.inputReadOnly ? undefined : -1, disabled: this.question.isInputReadOnly, inputMode: dropdownListModel.inputMode, onChange: function (e) { onInputChange(e); }, onBlur: this.blur, onFocus: this.focus })),
4147
4147
  this.createClearButton()));
4148
4148
  };
4149
4149
  SurveyQuestionDropdownBase.prototype.createClearButton = function () {
@@ -4664,6 +4664,9 @@ var SurveyQuestionImage = /** @class */ (function (_super) {
4664
4664
  var _this = this;
4665
4665
  var cssClasses = this.question.getImageCss();
4666
4666
  var style = { objectFit: this.question.imageFit };
4667
+ if (!this.question.imageLink || this.question.contentNotLoaded) {
4668
+ style["display"] = "none";
4669
+ }
4667
4670
  var control = null;
4668
4671
  if (this.question.renderedMode === "image") {
4669
4672
  control = (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("img", { className: cssClasses, src: this.question.locImageLink.renderedHtml, alt: this.question.altText || this.question.title, width: this.question.renderedWidth, height: this.question.renderedHeight,
@@ -5459,6 +5462,17 @@ var __extends = (undefined && undefined.__extends) || (function () {
5459
5462
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
5460
5463
  };
5461
5464
  })();
5465
+ var __assign = (undefined && undefined.__assign) || function () {
5466
+ __assign = Object.assign || function(t) {
5467
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5468
+ s = arguments[i];
5469
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
5470
+ t[p] = s[p];
5471
+ }
5472
+ return t;
5473
+ };
5474
+ return __assign.apply(this, arguments);
5475
+ };
5462
5476
 
5463
5477
 
5464
5478
 
@@ -5741,6 +5755,7 @@ function attachKey2click(element, viewModel, options) {
5741
5755
  if ((!!viewModel && viewModel.disableTabStop) || (!!options && options.disableTabStop)) {
5742
5756
  return react__WEBPACK_IMPORTED_MODULE_0__["cloneElement"](element, { tabIndex: -1 });
5743
5757
  }
5758
+ options = __assign({}, options);
5744
5759
  return react__WEBPACK_IMPORTED_MODULE_0__["cloneElement"](element, {
5745
5760
  tabIndex: 0,
5746
5761
  onKeyUp: function (evt) {
@@ -6258,7 +6273,7 @@ var SurveyQuestion = /** @class */ (function (_super) {
6258
6273
  var rootStyle = question.getRootStyle();
6259
6274
  var questionContent = this.wrapQuestionContent(this.renderQuestionContent());
6260
6275
  return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"](react__WEBPACK_IMPORTED_MODULE_0__["Fragment"], null,
6261
- 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 },
6276
+ 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-expanded": question.ariaExpanded === null ? undefined : question.ariaExpanded === "true" },
6262
6277
  errorsAboveQuestion,
6263
6278
  headerTop,
6264
6279
  questionContent,
@@ -6951,7 +6966,7 @@ var SurveyQuestionComment = /** @class */ (function (_super) {
6951
6966
  }
6952
6967
  var counter = !!this.question.getMaxLength() ? (react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_components_character_counter__WEBPACK_IMPORTED_MODULE_3__["CharacterCounterComponent"], { counter: this.question.characterCounter, remainingCharacterCounter: this.question.cssClasses.remainingCharacterCounter })) : null;
6953
6968
  return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"](react__WEBPACK_IMPORTED_MODULE_0__["Fragment"], null,
6954
- react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("textarea", { id: this.question.inputId, className: this.question.className, disabled: this.question.isInputReadOnly, readOnly: this.question.isInputReadOnly, ref: function (textarea) { return (_this.setControl(textarea)); }, maxLength: this.question.getMaxLength(), placeholder: placeholder, onBlur: onBlur, onInput: onInput, onKeyDown: function (event) { _this.question.onKeyDown(event); }, cols: this.question.cols, rows: this.question.rows, "aria-required": this.question.ariaRequired, "aria-label": this.question.ariaLabel, "aria-invalid": this.question.ariaInvalid, "aria-describedby": this.question.ariaDescribedBy, style: { resize: this.question.resizeStyle } }),
6969
+ react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("textarea", { id: this.question.inputId, className: this.question.className, disabled: this.question.isInputReadOnly, readOnly: this.question.isInputReadOnly, ref: function (textarea) { return (_this.setControl(textarea)); }, maxLength: this.question.getMaxLength(), placeholder: placeholder, onBlur: onBlur, onInput: onInput, onKeyDown: function (event) { _this.question.onKeyDown(event); }, cols: this.question.cols, rows: this.question.rows, "aria-required": this.question.a11y_input_ariaRequired, "aria-label": this.question.a11y_input_ariaLabel, "aria-labelledby": this.question.a11y_input_ariaLabelledBy, "aria-invalid": this.question.a11y_input_ariaInvalid, "aria-describedby": this.question.a11y_input_ariaDescribedBy, style: { resize: this.question.resizeStyle } }),
6955
6970
  counter));
6956
6971
  };
6957
6972
  return SurveyQuestionComment;
@@ -8945,11 +8960,8 @@ var SurveyQuestionPanelDynamic = /** @class */ (function (_super) {
8945
8960
  });
8946
8961
  };
8947
8962
  SurveyQuestionPanelDynamic.prototype.renderNavigatorV2 = function () {
8948
- if (this.question.panelCount === 0 || this.question["showLegacyNavigation"])
8963
+ if (!this.question.showNavigation)
8949
8964
  return null;
8950
- if (!this.question.cssClasses.footer) {
8951
- return null;
8952
- }
8953
8965
  var range = this.question.isRangeShowing && this.question.isProgressBottomShowing ? this.renderRange() : null;
8954
8966
  return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.question.cssClasses.footer },
8955
8967
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("hr", { className: this.question.cssClasses.separator }),
@@ -8997,7 +9009,7 @@ var SurveyQuestionPanelDynamicItem = /** @class */ (function (_super) {
8997
9009
  SurveyQuestionPanelDynamicItem.prototype.render = function () {
8998
9010
  var panel = _super.prototype.render.call(this);
8999
9011
  var removeButton = this.renderButton();
9000
- var separator = this.question.isRenderModeList && this.index < this.question.panelCount - 1 ?
9012
+ var separator = this.question.showSeparator(this.index) ?
9001
9013
  (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("hr", { className: this.question.cssClasses.separator })) : null;
9002
9014
  return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"](react__WEBPACK_IMPORTED_MODULE_0__["Fragment"], null,
9003
9015
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.question.getPanelWrapperCss() },
@@ -9583,7 +9595,7 @@ var SurveyQuestionTagbox = /** @class */ (function (_super) {
9583
9595
  return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { id: this.question.inputId, className: this.question.getControlClass(), tabIndex: dropdownListModel.inputReadOnly ? undefined : 0, onClick: this.click,
9584
9596
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
9585
9597
  // @ts-ignore
9586
- 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 ? "true" : "false", "aria-controls": dropdownListModel.listElementId, "aria-activedescendant": dropdownListModel.ariaActivedescendant },
9598
+ 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 },
9587
9599
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.question.cssClasses.controlValue },
9588
9600
  items,
9589
9601
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_tagbox_filter__WEBPACK_IMPORTED_MODULE_4__["TagboxFilterString"], { model: dropdownMultiSelectListModel, question: this.question })),
@@ -9659,7 +9671,7 @@ var SurveyQuestionText = /** @class */ (function (_super) {
9659
9671
  return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"](react__WEBPACK_IMPORTED_MODULE_0__["Fragment"], null,
9660
9672
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("input", { id: this.question.inputId, disabled: this.isDisplayMode, className: inputClass, type: this.question.inputType,
9661
9673
  //ref={this.controlRef}
9662
- ref: function (input) { return (_this.setControl(input)); }, style: this.question.inputStyle, maxLength: this.question.getMaxLength(), min: this.question.renderedMin, max: this.question.renderedMax, step: this.question.renderedStep, size: this.question.inputSize, placeholder: placeholder, list: this.question.dataListId, autoComplete: this.question.autocomplete, onBlur: this.question.onBlur, onFocus: this.question.onFocus, onChange: this.question.onChange, onKeyUp: this.question.onKeyUp, onKeyDown: this.question.onKeyDown, onCompositionUpdate: function (event) { return _this.question.onCompositionUpdate(event.nativeEvent); }, "aria-required": this.question.ariaRequired, "aria-label": this.question.ariaLabel, "aria-invalid": this.question.ariaInvalid, "aria-describedby": this.question.ariaDescribedBy }),
9674
+ ref: function (input) { return (_this.setControl(input)); }, style: this.question.inputStyle, maxLength: this.question.getMaxLength(), min: this.question.renderedMin, max: this.question.renderedMax, step: this.question.renderedStep, size: this.question.inputSize, placeholder: placeholder, list: this.question.dataListId, autoComplete: this.question.autocomplete, onBlur: this.question.onBlur, onFocus: this.question.onFocus, onChange: this.question.onChange, onKeyUp: this.question.onKeyUp, onKeyDown: this.question.onKeyDown, onCompositionUpdate: function (event) { return _this.question.onCompositionUpdate(event.nativeEvent); }, "aria-required": this.question.a11y_input_ariaRequired, "aria-label": this.question.a11y_input_ariaLabel, "aria-labelledby": this.question.a11y_input_ariaLabelledBy, "aria-invalid": this.question.a11y_input_ariaInvalid, "aria-describedby": this.question.a11y_input_ariaDescribedBy }),
9663
9675
  counter));
9664
9676
  };
9665
9677
  SurveyQuestionText.prototype.renderElement = function () {
@@ -10373,7 +10385,7 @@ var TagboxFilterString = /** @class */ (function (_super) {
10373
10385
  (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.question.cssClasses.hintSuffix },
10374
10386
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", { style: { visibility: "hidden" }, "data-bind": "text: model.filterString" }, this.model.inputStringRendered),
10375
10387
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", null, this.model.hintStringSuffix))) : null,
10376
- 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.searchEnabled ? true : undefined, size: !this.model.inputStringRendered ? 1 : undefined, role: this.model.filterStringEnabled ? this.question.ariaRole : undefined, "aria-label": this.question.placeholder, "aria-expanded": this.question.ariaExpanded ? "true" : "false", "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); } }))));
10388
+ 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.searchEnabled ? true : undefined, size: !this.model.inputStringRendered ? 1 : undefined, role: this.model.filterStringEnabled ? this.question.ariaRole : undefined, "aria-label": this.question.placeholder, "aria-expanded": this.question.ariaExpanded === null ? undefined : this.question.ariaExpanded === "true", "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); } }))));
10377
10389
  };
10378
10390
  return TagboxFilterString;
10379
10391
  }(_reactquestion_element__WEBPACK_IMPORTED_MODULE_3__["SurveyElementBase"]));
@@ -11387,8 +11399,14 @@ function doKey2ClickUp(evt, options) {
11387
11399
  if (!!element.classList && !element.classList.contains(keyFocusedClassName)) {
11388
11400
  element.classList.add(keyFocusedClassName);
11389
11401
  }
11402
+ return;
11403
+ }
11404
+ if (options) {
11405
+ if (!options.__keyDownReceived)
11406
+ return;
11407
+ options.__keyDownReceived = false;
11390
11408
  }
11391
- else if (char === 13 || char === 32) {
11409
+ if (char === 13 || char === 32) {
11392
11410
  if (element.click)
11393
11411
  element.click();
11394
11412
  }
@@ -11399,6 +11417,8 @@ function doKey2ClickUp(evt, options) {
11399
11417
  }
11400
11418
  function doKey2ClickDown(evt, options) {
11401
11419
  if (options === void 0) { options = { processEsc: true }; }
11420
+ if (options)
11421
+ options.__keyDownReceived = true;
11402
11422
  if (!!evt.target && evt.target["contentEditable"] === "true") {
11403
11423
  return;
11404
11424
  }