survey-react-ui 1.9.103 → 1.9.105

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.103",
3
+ "version": "1.9.105",
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.103",
24
+ "survey-core": "1.9.105",
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.103
2
+ * surveyjs - Survey JavaScript library v1.9.105
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.103", "survey-react-ui");
693
+ Object(survey_core__WEBPACK_IMPORTED_MODULE_2__["checkLibraryVersion"])("" + "1.9.105", "survey-react-ui");
694
694
 
695
695
 
696
696
  /***/ }),
@@ -3617,7 +3617,7 @@ var SurveyQuestionDropdownBase = /** @class */ (function (_super) {
3617
3617
  if (!this.question.cssClasses.chevronButtonIconId)
3618
3618
  return null;
3619
3619
  return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.question.cssClasses.chevronButton },
3620
- 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 })));
3620
+ 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: "auto" })));
3621
3621
  };
3622
3622
  SurveyQuestionDropdownBase.prototype.renderOther = function (cssClasses) {
3623
3623
  return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.question.getCommentAreaCss(true) },
@@ -5965,7 +5965,9 @@ var SurveyQuestionAndErrorsCell = /** @class */ (function (_super) {
5965
5965
  };
5966
5966
  SurveyQuestionAndErrorsCell.prototype.renderElement = function () {
5967
5967
  var style = this.getCellStyle();
5968
- return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("td", { ref: this.cellRef, className: this.itemCss, colSpan: this.props.cell.colSpans, "data-responsive-title": this.getHeaderText(), title: this.props.cell.getTitle(), style: style }, this.wrapCell(this.props.cell, (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.cssClasses.cellQuestionWrapper }, this.renderQuestion())))));
5968
+ var cell = this.props.cell;
5969
+ var focusIn = function () { cell.focusIn(); };
5970
+ return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("td", { ref: this.cellRef, className: this.itemCss, colSpan: cell.colSpans, "data-responsive-title": this.getHeaderText(), title: cell.getTitle(), style: style, onFocus: focusIn }, this.wrapCell(this.props.cell, (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.cssClasses.cellQuestionWrapper }, this.renderQuestion())))));
5969
5971
  };
5970
5972
  SurveyQuestionAndErrorsCell.prototype.getCellStyle = function () {
5971
5973
  return null;
@@ -6469,7 +6471,7 @@ var SurveyQuestionCommentItem = /** @class */ (function (_super) {
6469
6471
  return this.props.question.commentId;
6470
6472
  };
6471
6473
  SurveyQuestionCommentItem.prototype.getPlaceholder = function () {
6472
- return this.props.question.commentPlaceholder;
6474
+ return this.props.question.renderedCommentPlaceholder;
6473
6475
  };
6474
6476
  SurveyQuestionCommentItem.prototype.renderElement = function () {
6475
6477
  var _this = this;
@@ -7269,7 +7271,7 @@ var SurveyQuestionFile = /** @class */ (function (_super) {
7269
7271
  noFileChosen = (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", { className: this.question.cssClasses.noFileChosen }, this.question.noFileChosenCaption));
7270
7272
  }
7271
7273
  return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.question.getFileDecoratorCss() },
7272
- react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", { className: this.question.cssClasses.dragAreaPlaceholder }, this.question.dragAreaPlaceholder),
7274
+ react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", { className: this.question.cssClasses.dragAreaPlaceholder }, this.question.renderedPlaceholder),
7273
7275
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.question.cssClasses.wrapper },
7274
7276
  chooseFile,
7275
7277
  noFileChosen)));
@@ -8264,10 +8266,15 @@ var SurveyQuestionMultipleText = /** @class */ (function (_super) {
8264
8266
  SurveyQuestionMultipleText.prototype.renderRow = function (rowIndex, items, cssClasses) {
8265
8267
  var key = "item" + rowIndex;
8266
8268
  var tds = [];
8267
- for (var i = 0; i < items.length; i++) {
8269
+ var _loop_1 = function (i) {
8268
8270
  var item = items[i];
8269
- tds.push(react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("td", { key: "item" + i, className: this.question.cssClasses.cell },
8270
- react__WEBPACK_IMPORTED_MODULE_0__["createElement"](SurveyMultipleTextItem, { question: this.question, item: item, creator: this.creator, cssClasses: cssClasses })));
8271
+ var focusIn = function () { item.focusIn(); };
8272
+ tds.push(react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("td", { key: "item" + i, className: this_1.question.cssClasses.cell, onFocus: focusIn },
8273
+ react__WEBPACK_IMPORTED_MODULE_0__["createElement"](SurveyMultipleTextItem, { question: this_1.question, item: item, creator: this_1.creator, cssClasses: cssClasses })));
8274
+ };
8275
+ var this_1 = this;
8276
+ for (var i = 0; i < items.length; i++) {
8277
+ _loop_1(i);
8271
8278
  }
8272
8279
  return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("tr", { key: key, className: cssClasses.row }, tds));
8273
8280
  };
@@ -9518,7 +9525,7 @@ var SurveyRow = /** @class */ (function (_super) {
9518
9525
  var css = element.cssClassesValue;
9519
9526
  var focusIn = function () {
9520
9527
  var el = element;
9521
- if (el && !el.isDisposed && el.isQuestion) {
9528
+ if (el && el.isQuestion) {
9522
9529
  el.focusIn();
9523
9530
  }
9524
9531
  };
@@ -9637,9 +9644,15 @@ var SurveyQuestionSignaturePad = /** @class */ (function (_super) {
9637
9644
  return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: cssClasses.root, ref: function (root) { return (_this.setControl(root)); }, style: { height: this.question.signatureHeight, width: this.question.signatureWidth } },
9638
9645
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: cssClasses.placeholder, style: { display: this.question.needShowPlaceholder() ? "" : "none" } }, this.question.placeHolderText),
9639
9646
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", null,
9640
- react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("canvas", { tabIndex: 0 })),
9647
+ this.renderBackgroundImage(),
9648
+ react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("canvas", { tabIndex: 0, className: this.question.cssClasses.canvas })),
9641
9649
  clearButton));
9642
9650
  };
9651
+ SurveyQuestionSignaturePad.prototype.renderBackgroundImage = function () {
9652
+ if (!this.question.backgroundImage)
9653
+ return null;
9654
+ return react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("img", { className: this.question.cssClasses.backgroundImage, src: this.question.backgroundImage, width: this.question.signatureWidth, height: this.question.signatureHeight });
9655
+ };
9643
9656
  SurveyQuestionSignaturePad.prototype.renderCleanButton = function () {
9644
9657
  var _this = this;
9645
9658
  if (!this.question.canShowClearButton)
@@ -10521,12 +10534,24 @@ var settings = {
10521
10534
  */
10522
10535
  tagboxCloseOnSelect: false,
10523
10536
  /**
10524
- * A property that allows you to display a custom confirm dialog instead of the standard browser dialog. Set this property to a function that renders your custom dialog window.
10537
+ * A property that allows you to display a custom confirm dialog instead of the standard browser dialog.
10538
+ *
10539
+ * Set this property to a function that renders your custom dialog window. This function should return `true` if a user confirms an action or `false` otherwise.
10525
10540
  * @param message A message to be displayed in the confirm dialog window.
10526
10541
  */
10527
10542
  confirmActionFunc: function (message) {
10528
10543
  return confirm(message);
10529
10544
  },
10545
+ /**
10546
+ * A property that allows you to display a custom confirm dialog instead of the standard browser dialog in async mode.
10547
+ *
10548
+ * Set this property to a function that renders your custom dialog window. This function should return `true` to be enabled; otherwise, a survey executes the [`confirmActionFunc`](#confirmActionFunc) function. Pass the dialog result as the `callback` parameter: `true` if a user confirms an action, `false` otherwise.
10549
+ * @param message A message to be displayed in the confirm dialog window.
10550
+ * @param callback A callback function that should be called with `true` if a user confirms an action or `false` otherwise.
10551
+ */
10552
+ confirmActionAsync: function (message, callback) {
10553
+ return false;
10554
+ },
10530
10555
  /**
10531
10556
  * A minimum width value for all survey elements.
10532
10557
  *
@@ -10886,7 +10911,7 @@ var VerticalResponsivityManager = /** @class */ (function (_super) {
10886
10911
  /*!****************************!*\
10887
10912
  !*** ./src/utils/utils.ts ***!
10888
10913
  \****************************/
10889
- /*! exports provided: unwrap, getRenderedSize, getRenderedStyleSize, doKey2ClickBlur, doKey2ClickUp, doKey2ClickDown, sanitizeEditableContent, Logger, mergeValues, getElementWidth, isContainerVisible, classesToSelector, compareVersions, confirmAction, detectIEOrEdge, detectIEBrowser, loadFileFromBase64, isMobile, isShadowDOM, getElement, isElementVisible, findScrollableParent, scrollElementByChildId, navigateToUrl, createSvg, getIconNameFromProxy, increaseHeightByContent, getOriginalEvent, preventDefaults, findParentByClassNames, getFirstVisibleChild */
10914
+ /*! exports provided: unwrap, getRenderedSize, getRenderedStyleSize, doKey2ClickBlur, doKey2ClickUp, doKey2ClickDown, sanitizeEditableContent, Logger, mergeValues, getElementWidth, isContainerVisible, classesToSelector, compareVersions, confirmAction, confirmActionAsync, detectIEOrEdge, detectIEBrowser, loadFileFromBase64, isMobile, isShadowDOM, getElement, isElementVisible, findScrollableParent, scrollElementByChildId, navigateToUrl, createSvg, getIconNameFromProxy, increaseHeightByContent, getOriginalEvent, preventDefaults, findParentByClassNames, getFirstVisibleChild */
10890
10915
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
10891
10916
 
10892
10917
  "use strict";
@@ -10905,6 +10930,7 @@ __webpack_require__.r(__webpack_exports__);
10905
10930
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "classesToSelector", function() { return classesToSelector; });
10906
10931
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "compareVersions", function() { return compareVersions; });
10907
10932
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "confirmAction", function() { return confirmAction; });
10933
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "confirmActionAsync", function() { return confirmActionAsync; });
10908
10934
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "detectIEOrEdge", function() { return detectIEOrEdge; });
10909
10935
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "detectIEBrowser", function() { return detectIEBrowser; });
10910
10936
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "loadFileFromBase64", function() { return loadFileFromBase64; });
@@ -10942,6 +10968,19 @@ function confirmAction(message) {
10942
10968
  return _settings__WEBPACK_IMPORTED_MODULE_0__["settings"].confirmActionFunc(message);
10943
10969
  return confirm(message);
10944
10970
  }
10971
+ function confirmActionAsync(message, funcOnYes, funcOnNo) {
10972
+ var callbackFunc = function (res) {
10973
+ if (res)
10974
+ funcOnYes();
10975
+ else if (!!funcOnNo)
10976
+ funcOnNo();
10977
+ };
10978
+ if (!!_settings__WEBPACK_IMPORTED_MODULE_0__["settings"] && !!_settings__WEBPACK_IMPORTED_MODULE_0__["settings"].confirmActionAsync) {
10979
+ if (_settings__WEBPACK_IMPORTED_MODULE_0__["settings"].confirmActionAsync(message, callbackFunc))
10980
+ return;
10981
+ }
10982
+ callbackFunc(confirmAction(message));
10983
+ }
10945
10984
  function detectIEBrowser() {
10946
10985
  if (typeof window === "undefined")
10947
10986
  return false;