survey-react-ui 1.9.98 → 1.9.100

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.98",
3
+ "version": "1.9.100",
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.98",
24
+ "survey-core": "1.9.100",
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.98
2
+ * surveyjs - Survey JavaScript library v1.9.100
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.98", "survey-react-ui");
693
+ Object(survey_core__WEBPACK_IMPORTED_MODULE_2__["checkLibraryVersion"])("" + "1.9.100", "survey-react-ui");
694
694
 
695
695
 
696
696
  /***/ }),
@@ -1532,7 +1532,7 @@ var ListItem = /** @class */ (function (_super) {
1532
1532
  if (!this.item.component) {
1533
1533
  var text = this.renderLocString(this.item.locTitle, undefined, "locString");
1534
1534
  if (this.item.iconName) {
1535
- var icon = react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_svg_icon_svg_icon__WEBPACK_IMPORTED_MODULE_4__["SvgIcon"], { key: 1, className: this.model.cssClasses.itemIcon, iconName: this.item.iconName, size: 24, "aria-label": this.item.title });
1535
+ var icon = react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_svg_icon_svg_icon__WEBPACK_IMPORTED_MODULE_4__["SvgIcon"], { key: 1, className: this.model.cssClasses.itemIcon, iconName: this.item.iconName, size: this.item.iconSize, "aria-label": this.item.title });
1536
1536
  content.push(icon);
1537
1537
  content.push(react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", { key: 2 }, text));
1538
1538
  }
@@ -2580,17 +2580,18 @@ function showModal(componentName, data, onApply, onCancel, cssClass, title, disp
2580
2580
  var options = Object(survey_core__WEBPACK_IMPORTED_MODULE_2__["createDialogOptions"])(componentName, data, onApply, onCancel, undefined, undefined, cssClass, title, displayMode);
2581
2581
  return showDialog(options);
2582
2582
  }
2583
- function showDialog(dialogOptions, container) {
2583
+ function showDialog(dialogOptions, rootElement) {
2584
2584
  dialogOptions.onHide = function () {
2585
2585
  react_dom__WEBPACK_IMPORTED_MODULE_0___default.a.unmountComponentAtNode(popupViewModel.container);
2586
2586
  popupViewModel.dispose();
2587
2587
  };
2588
- var popupViewModel = Object(survey_core__WEBPACK_IMPORTED_MODULE_2__["createPopupModalViewModel"])(dialogOptions, container);
2588
+ var popupViewModel = Object(survey_core__WEBPACK_IMPORTED_MODULE_2__["createPopupModalViewModel"])(dialogOptions, rootElement);
2589
2589
  react_dom__WEBPACK_IMPORTED_MODULE_0___default.a.render(react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(PopupContainer, { model: popupViewModel }), popupViewModel.container);
2590
2590
  popupViewModel.model.isVisible = true;
2591
2591
  return popupViewModel;
2592
2592
  }
2593
2593
  survey_core__WEBPACK_IMPORTED_MODULE_2__["settings"].showModal = showModal;
2594
+ survey_core__WEBPACK_IMPORTED_MODULE_2__["settings"].showDialog = showDialog;
2594
2595
 
2595
2596
 
2596
2597
  /***/ }),
@@ -2954,7 +2955,7 @@ var LogoImage = /** @class */ (function (_super) {
2954
2955
  LogoImage.prototype.render = function () {
2955
2956
  var content = [];
2956
2957
  content.push(react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { key: "logo-image", className: this.survey.logoClassNames },
2957
- react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("img", { className: this.survey.css.logoImage, src: this.survey.locLogo.renderedHtml, alt: this.survey.locTitle.renderedHtml, width: this.survey.logoWidth ? this.survey.logoWidth : undefined, height: this.survey.logoHeight ? this.survey.logoHeight : undefined, style: { objectFit: this.survey.logoFit } })));
2958
+ react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("img", { className: this.survey.css.logoImage, src: this.survey.locLogo.renderedHtml, alt: this.survey.locTitle.renderedHtml, width: this.survey.renderedLogoWidth, height: this.survey.renderedLogoHeight, style: { objectFit: this.survey.logoFit, width: this.survey.renderedStyleLogoWidth, height: this.survey.renderedStyleLogoHeight } })));
2958
2959
  return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_0___default.a.Fragment, null, content);
2959
2960
  };
2960
2961
  return LogoImage;
@@ -3006,6 +3007,7 @@ var SurveyHeader = /** @class */ (function (_super) {
3006
3007
  function SurveyHeader(props) {
3007
3008
  var _this = _super.call(this, props) || this;
3008
3009
  _this.state = { changed: 0 };
3010
+ _this.rootRef = react__WEBPACK_IMPORTED_MODULE_0___default.a.createRef();
3009
3011
  return _this;
3010
3012
  }
3011
3013
  Object.defineProperty(SurveyHeader.prototype, "survey", {
@@ -3024,6 +3026,7 @@ var SurveyHeader = /** @class */ (function (_super) {
3024
3026
  });
3025
3027
  SurveyHeader.prototype.componentDidMount = function () {
3026
3028
  var self = this;
3029
+ this.survey.afterRenderHeader(this.rootRef.current);
3027
3030
  this.survey.locLogo.onChanged = function () {
3028
3031
  self.setState({ changed: self.state.changed + 1 });
3029
3032
  };
@@ -3051,7 +3054,7 @@ var SurveyHeader = /** @class */ (function (_super) {
3051
3054
  SurveyHeader.prototype.render = function () {
3052
3055
  if (!this.survey.renderedHasHeader)
3053
3056
  return null;
3054
- return (react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { className: this.css.header },
3057
+ return (react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { className: this.css.header, ref: this.rootRef },
3055
3058
  this.renderLogoImage(this.survey.isLogoBefore),
3056
3059
  this.renderTitle(),
3057
3060
  this.renderLogoImage(this.survey.isLogoAfter),
@@ -4126,7 +4129,7 @@ var SurveyQuestionImage = /** @class */ (function (_super) {
4126
4129
  SurveyQuestionImage.prototype.renderElement = function () {
4127
4130
  var _this = this;
4128
4131
  var cssClasses = this.question.getImageCss();
4129
- var style = { objectFit: this.question.imageFit };
4132
+ var style = { objectFit: this.question.imageFit, width: this.question.renderedStyleWidth, height: this.question.renderedStyleHeight };
4130
4133
  if (!this.question.imageLink || this.question.contentNotLoaded) {
4131
4134
  style["display"] = "none";
4132
4135
  }
@@ -4541,7 +4544,7 @@ var SurveyPanelBase = /** @class */ (function (_super) {
4541
4544
  if (!!prevProps.page &&
4542
4545
  !!this.survey &&
4543
4546
  !!this.survey.currentPage &&
4544
- prevProps.page.name === this.survey.currentPage.name)
4547
+ prevProps.page.id === this.survey.currentPage.id)
4545
4548
  return;
4546
4549
  this.doAfterRender();
4547
4550
  };
@@ -4789,6 +4792,7 @@ __webpack_require__.r(__webpack_exports__);
4789
4792
  /* harmony import */ var _reactquestion_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./reactquestion_element */ "./src/react/reactquestion_element.tsx");
4790
4793
  /* harmony import */ var survey_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! survey-core */ "survey-core");
4791
4794
  /* harmony import */ var survey_core__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(survey_core__WEBPACK_IMPORTED_MODULE_3__);
4795
+ /* harmony import */ var _components_svg_icon_svg_icon__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./components/svg-icon/svg-icon */ "./src/react/components/svg-icon/svg-icon.tsx");
4792
4796
  var __extends = (undefined && undefined.__extends) || (function () {
4793
4797
  var extendStatics = function (d, b) {
4794
4798
  extendStatics = Object.setPrototypeOf ||
@@ -4808,6 +4812,7 @@ var __extends = (undefined && undefined.__extends) || (function () {
4808
4812
 
4809
4813
 
4810
4814
 
4815
+
4811
4816
  var PopupSurvey = /** @class */ (function (_super) {
4812
4817
  __extends(PopupSurvey, _super);
4813
4818
  function PopupSurvey(props) {
@@ -4841,6 +4846,7 @@ var PopupSurvey = /** @class */ (function (_super) {
4841
4846
  body));
4842
4847
  };
4843
4848
  PopupSurvey.prototype.renderWindowHeader = function () {
4849
+ var _this = this;
4844
4850
  var styleA = { width: "100%", cursor: "pointer" };
4845
4851
  var styleTitle = { paddingRight: "10px" };
4846
4852
  var glyphClassName = this.popup.cssButton;
@@ -4850,8 +4856,10 @@ var PopupSurvey = /** @class */ (function (_super) {
4850
4856
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", { onClick: this.handleOnExpanded, style: styleA },
4851
4857
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", { className: this.popup.cssHeaderTitle, style: styleTitle }, title),
4852
4858
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", { className: glyphClassName, "aria-hidden": "true" })),
4853
- this.popup.isExpanded ? (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", { onClick: this.handleOnExpanded, style: { float: "right", cursor: "pointer" } },
4854
- react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", { className: this.popup.cssHeaderTitle, style: styleTitle }, "X"))) : null));
4859
+ this.popup.allowClose ? (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", { className: this.popup.cssHeaderButton, onClick: function () { _this.popup.hide(); }, style: { transform: "rotate(45deg)", float: "right", cursor: "pointer", width: "24px", height: "24px" } },
4860
+ react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_components_svg_icon_svg_icon__WEBPACK_IMPORTED_MODULE_4__["SvgIcon"], { iconName: "icon-expanddetail", size: 16 }))) : null,
4861
+ this.popup.isExpanded ? (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", { className: this.popup.cssHeaderButton, onClick: this.handleOnExpanded, style: { float: "right", cursor: "pointer", width: "24px", height: "24px" } },
4862
+ react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_components_svg_icon_svg_icon__WEBPACK_IMPORTED_MODULE_4__["SvgIcon"], { iconName: "icon-collapsedetail", size: 16 }))) : null));
4855
4863
  };
4856
4864
  PopupSurvey.prototype.renderBody = function () {
4857
4865
  var _this = this;
@@ -4865,6 +4873,7 @@ var PopupSurvey = /** @class */ (function (_super) {
4865
4873
  if (newProps.closeOnCompleteTimeout) {
4866
4874
  this.popup.closeOnCompleteTimeout = newProps.closeOnCompleteTimeout;
4867
4875
  }
4876
+ this.popup.allowClose = newProps.allowClose;
4868
4877
  this.popup.isShowing = true;
4869
4878
  if (!this.popup.isExpanded && (newProps.expanded || newProps.isExpanded))
4870
4879
  this.popup.expand();
@@ -10422,10 +10431,17 @@ var settings = {
10422
10431
  *
10423
10432
  * - `caseSensitive`: `Boolean`\
10424
10433
  * Specifies whether to differentiate between capital and lower-case letters. Default value: `false`.
10434
+ *
10435
+ * - `normalizedTextCallback`: `(str: string, reason: string) => string`
10436
+ * Use the following function { str.normalize("NFD").replace(/[\u0300-\u036f]/g, ""); }
10437
+ * If you want to 'Brouillé' to be equal to 'Brouille'.
10438
+ * Use the following function { return reason === "filter" ? str.normalize("NFD").replace(/[\u0300-\u036f]/g, ""): ""; }
10439
+ * If you want to use this functionality during filtering only, for example in list.
10425
10440
  */
10426
10441
  comparator: {
10427
10442
  trimStrings: true,
10428
- caseSensitive: false
10443
+ caseSensitive: false,
10444
+ normalizeTextCallback: function (str, reason) { return str; }
10429
10445
  },
10430
10446
  expressionDisableConversionChar: "#",
10431
10447
  get commentPrefix() { return settings.commentSuffix; },
@@ -10530,6 +10546,7 @@ var settings = {
10530
10546
  */
10531
10547
  maxDate: "",
10532
10548
  showModal: undefined,
10549
+ showDialog: undefined,
10533
10550
  supportCreatorV2: false,
10534
10551
  showDefaultItemsInCreatorV2: true,
10535
10552
  /**
@@ -10810,13 +10827,14 @@ var VerticalResponsivityManager = /** @class */ (function (_super) {
10810
10827
  /*!****************************!*\
10811
10828
  !*** ./src/utils/utils.ts ***!
10812
10829
  \****************************/
10813
- /*! exports provided: unwrap, getSize, 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 */
10830
+ /*! 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 */
10814
10831
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
10815
10832
 
10816
10833
  "use strict";
10817
10834
  __webpack_require__.r(__webpack_exports__);
10818
10835
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "unwrap", function() { return unwrap; });
10819
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getSize", function() { return getSize; });
10836
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getRenderedSize", function() { return getRenderedSize; });
10837
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getRenderedStyleSize", function() { return getRenderedStyleSize; });
10820
10838
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "doKey2ClickBlur", function() { return doKey2ClickBlur; });
10821
10839
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "doKey2ClickUp", function() { return doKey2ClickUp; });
10822
10840
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "doKey2ClickDown", function() { return doKey2ClickDown; });
@@ -11014,21 +11032,43 @@ function unwrap(value) {
11014
11032
  return value();
11015
11033
  }
11016
11034
  }
11017
- function getSize(value) {
11018
- if (typeof value === "number") {
11019
- return "" + value + "px";
11020
- }
11021
- if (!!value && typeof value === "string" && value.length > 0) {
11022
- var lastSymbol = value[value.length - 1];
11023
- if ((lastSymbol >= "0" && lastSymbol <= "9") || lastSymbol == ".") {
11024
- try {
11025
- var num = parseFloat(value);
11026
- return "" + num + "px";
11027
- }
11028
- catch (_a) { }
11029
- }
11035
+ // export function getSize(value: any): number {
11036
+ // if (typeof value === "number") {
11037
+ // return value;
11038
+ // }
11039
+ // if (typeof value === "string" && value.includes("px")) {
11040
+ // return parseInt(value);
11041
+ // }
11042
+ // if (!!value && typeof value === "string" && value.length > 0) {
11043
+ // const lastSymbol: string = value[value.length - 1];
11044
+ // if ((lastSymbol >= "0" && lastSymbol <= "9") || lastSymbol == ".") {
11045
+ // try {
11046
+ // const num: number = parseInt(value);
11047
+ // return num;
11048
+ // } catch { }
11049
+ // }
11050
+ // }
11051
+ // return value;
11052
+ // }
11053
+ function getRenderedSize(val) {
11054
+ if (typeof val == "string") {
11055
+ if (!isNaN(Number(val))) {
11056
+ return Number(val);
11057
+ }
11058
+ else if (val.includes("px")) {
11059
+ return parseFloat(val);
11060
+ }
11061
+ }
11062
+ if (typeof val == "number") {
11063
+ return val;
11064
+ }
11065
+ return undefined;
11066
+ }
11067
+ function getRenderedStyleSize(val) {
11068
+ if (getRenderedSize(val) !== undefined) {
11069
+ return undefined;
11030
11070
  }
11031
- return value;
11071
+ return val;
11032
11072
  }
11033
11073
  var keyFocusedClassName = "sv-focused--by-key";
11034
11074
  function doKey2ClickBlur(evt) {