survey-react-ui 1.9.85 → 1.9.87

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.85",
3
+ "version": "1.9.87",
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.85",
24
+ "survey-core": "1.9.87",
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.85
2
+ * surveyjs - Survey JavaScript library v1.9.87
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.85", "survey-react-ui");
1192
+ Object(survey_core__WEBPACK_IMPORTED_MODULE_2__["checkLibraryVersion"])("" + "1.9.87", "survey-react-ui");
1193
1193
 
1194
1194
 
1195
1195
  /***/ }),
@@ -2084,10 +2084,12 @@ __webpack_require__.r(__webpack_exports__);
2084
2084
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "List", function() { return List; });
2085
2085
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
2086
2086
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
2087
- /* harmony import */ var _element_factory__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../element-factory */ "./src/react/element-factory.tsx");
2088
- /* harmony import */ var _reactquestion_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../reactquestion_element */ "./src/react/reactquestion_element.tsx");
2089
- /* harmony import */ var _svg_icon_svg_icon__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../svg-icon/svg-icon */ "./src/react/components/svg-icon/svg-icon.tsx");
2090
- /* harmony import */ var _list_item__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./list-item */ "./src/react/components/list/list-item.tsx");
2087
+ /* harmony import */ var survey_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! survey-core */ "survey-core");
2088
+ /* harmony import */ var survey_core__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(survey_core__WEBPACK_IMPORTED_MODULE_1__);
2089
+ /* harmony import */ var _element_factory__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../element-factory */ "./src/react/element-factory.tsx");
2090
+ /* harmony import */ var _reactquestion_element__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../reactquestion_element */ "./src/react/reactquestion_element.tsx");
2091
+ /* harmony import */ var _svg_icon_svg_icon__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../svg-icon/svg-icon */ "./src/react/components/svg-icon/svg-icon.tsx");
2092
+ /* harmony import */ var _list_item__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./list-item */ "./src/react/components/list/list-item.tsx");
2091
2093
  var __extends = (undefined && undefined.__extends) || (function () {
2092
2094
  var extendStatics = function (d, b) {
2093
2095
  extendStatics = Object.setPrototypeOf ||
@@ -2108,6 +2110,7 @@ var __extends = (undefined && undefined.__extends) || (function () {
2108
2110
 
2109
2111
 
2110
2112
 
2113
+
2111
2114
  var List = /** @class */ (function (_super) {
2112
2115
  __extends(List, _super);
2113
2116
  function List(props) {
@@ -2165,7 +2168,7 @@ var List = /** @class */ (function (_super) {
2165
2168
  return null;
2166
2169
  }
2167
2170
  return items.map(function (item, itemIndex) {
2168
- return (react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_list_item__WEBPACK_IMPORTED_MODULE_4__["ListItem"], { model: _this.model, item: item, key: "item" + itemIndex }));
2171
+ return (react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_list_item__WEBPACK_IMPORTED_MODULE_5__["ListItem"], { model: _this.model, item: item, key: "item" + itemIndex }));
2169
2172
  });
2170
2173
  };
2171
2174
  List.prototype.searchElementContent = function () {
@@ -2174,7 +2177,8 @@ var List = /** @class */ (function (_super) {
2174
2177
  return null;
2175
2178
  else {
2176
2179
  var onChange = function (e) {
2177
- if (e.target === document.activeElement) {
2180
+ var root = survey_core__WEBPACK_IMPORTED_MODULE_1__["settings"].environment.root;
2181
+ if (e.target === root.activeElement) {
2178
2182
  _this.model.filterString = e.target.value;
2179
2183
  }
2180
2184
  };
@@ -2183,10 +2187,10 @@ var List = /** @class */ (function (_super) {
2183
2187
  };
2184
2188
  var clearButton = this.model.showSearchClearButton && !!this.model.filterString ?
2185
2189
  react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("button", { className: this.model.cssClasses.searchClearButtonIcon, onClick: function (event) { _this.model.onClickSearchClearButton(event); } },
2186
- react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_svg_icon_svg_icon__WEBPACK_IMPORTED_MODULE_3__["SvgIcon"], { iconName: "icon-searchclear", size: "auto" })) : null;
2190
+ react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_svg_icon_svg_icon__WEBPACK_IMPORTED_MODULE_4__["SvgIcon"], { iconName: "icon-searchclear", size: "auto" })) : null;
2187
2191
  return (react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { className: this.model.cssClasses.filter },
2188
2192
  react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { className: this.model.cssClasses.filterIcon },
2189
- react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_svg_icon_svg_icon__WEBPACK_IMPORTED_MODULE_3__["SvgIcon"], { iconName: "icon-search", size: "auto" })),
2193
+ react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_svg_icon_svg_icon__WEBPACK_IMPORTED_MODULE_4__["SvgIcon"], { iconName: "icon-search", size: "auto" })),
2190
2194
  react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", { type: "text", className: this.model.cssClasses.filterInput, "aria-label": this.model.filterStringPlaceholder, placeholder: this.model.filterStringPlaceholder, value: this.state.filterString, onKeyUp: onKeyUp, onChange: onChange }),
2191
2195
  clearButton));
2192
2196
  }
@@ -2197,9 +2201,9 @@ var List = /** @class */ (function (_super) {
2197
2201
  react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { className: this.model.cssClasses.emptyText, "aria-label": this.model.emptyMessage }, this.model.emptyMessage)));
2198
2202
  };
2199
2203
  return List;
2200
- }(_reactquestion_element__WEBPACK_IMPORTED_MODULE_2__["SurveyElementBase"]));
2204
+ }(_reactquestion_element__WEBPACK_IMPORTED_MODULE_3__["SurveyElementBase"]));
2201
2205
 
2202
- _element_factory__WEBPACK_IMPORTED_MODULE_1__["ReactElementFactory"].Instance.registerElement("sv-list", function (props) {
2206
+ _element_factory__WEBPACK_IMPORTED_MODULE_2__["ReactElementFactory"].Instance.registerElement("sv-list", function (props) {
2203
2207
  return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(List, props);
2204
2208
  });
2205
2209
 
@@ -3250,8 +3254,8 @@ var RatingItemStar = /** @class */ (function (_super) {
3250
3254
  var _this = this;
3251
3255
  return (react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", { className: this.question.getItemClass(this.item.itemValue), onMouseOver: function (e) { return _this.question.onItemMouseIn(_this.item); }, onMouseOut: function (e) { return _this.question.onItemMouseOut(_this.item); } },
3252
3256
  react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", { type: "radio", className: "sv-visuallyhidden", name: this.question.name, id: this.question.getInputId(this.index), value: this.item.value, disabled: this.isDisplayMode, checked: this.question.value == this.item.value, onClick: this.props.handleOnClick, onChange: function () { }, "aria-required": this.question.ariaRequired, "aria-label": this.question.ariaLabel, "aria-invalid": this.question.ariaInvalid, "aria-describedby": this.question.ariaDescribedBy }),
3253
- react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_svg_icon_svg_icon__WEBPACK_IMPORTED_MODULE_3__["SvgIcon"], { className: "sv-star", size: "auto", iconName: "icon-rating-star", title: this.item.text }),
3254
- react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_svg_icon_svg_icon__WEBPACK_IMPORTED_MODULE_3__["SvgIcon"], { className: "sv-star-2", size: "auto", iconName: "icon-rating-star-2", title: this.item.text })));
3257
+ react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_svg_icon_svg_icon__WEBPACK_IMPORTED_MODULE_3__["SvgIcon"], { className: "sv-star", size: "auto", iconName: this.question.itemStarIcon, title: this.item.text }),
3258
+ react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_svg_icon_svg_icon__WEBPACK_IMPORTED_MODULE_3__["SvgIcon"], { className: "sv-star-2", size: "auto", iconName: this.question.itemStarIconAlt, title: this.item.text })));
3255
3259
  };
3256
3260
  return RatingItemStar;
3257
3261
  }(_reactquestion_element__WEBPACK_IMPORTED_MODULE_2__["SurveyElementBase"]));
@@ -3821,7 +3825,8 @@ var TitleContent = /** @class */ (function (_super) {
3821
3825
  }
3822
3826
  var questionNumber = element.no;
3823
3827
  if (questionNumber) {
3824
- spans.push(react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", { "data-key": "q_num", key: "q_num", className: cssClasses.number || cssClasses.panel.number, style: { position: "static" }, "aria-hidden": true }, questionNumber));
3828
+ var panelNumber = !!cssClasses.panel ? cssClasses.panel.number : undefined;
3829
+ spans.push(react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", { "data-key": "q_num", key: "q_num", className: cssClasses.number || panelNumber, style: { position: "static" }, "aria-hidden": true }, questionNumber));
3825
3830
  spans.push(getSpaceSpan("num-sp"));
3826
3831
  }
3827
3832
  if (element.isRequireTextBeforeTitle) {
@@ -4119,8 +4124,9 @@ var SurveyQuestionDropdownBase = /** @class */ (function (_super) {
4119
4124
  SurveyQuestionDropdownBase.prototype.renderInput = function (dropdownListModel) {
4120
4125
  var _this = this;
4121
4126
  var valueElement = this.renderValueElement(dropdownListModel);
4127
+ var root = survey_core__WEBPACK_IMPORTED_MODULE_1__["settings"].environment.root;
4122
4128
  var onInputChange = function (e) {
4123
- if (e.target === document.activeElement) {
4129
+ if (e.target === root.activeElement) {
4124
4130
  dropdownListModel.inputStringRendered = e.target.value;
4125
4131
  }
4126
4132
  };
@@ -5192,8 +5198,9 @@ var SurveyPanel = /** @class */ (function (_super) {
5192
5198
  _this.panelBase.focusIn();
5193
5199
  };
5194
5200
  return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { ref: this.rootRef, className: this.panelBase.getContainerCss(), onFocus: focusIn, id: this.panelBase.id },
5201
+ this.panel.showErrorsAbovePanel ? errors : null,
5195
5202
  header,
5196
- errors,
5203
+ this.panel.showErrorsAbovePanel ? null : errors,
5197
5204
  content));
5198
5205
  };
5199
5206
  SurveyPanel.prototype.renderHeader = function () {
@@ -5558,7 +5565,8 @@ var Survey = /** @class */ (function (_super) {
5558
5565
  var rootCss = this.survey.getRootCss();
5559
5566
  var cssClasses = this.rootNodeClassName ? this.rootNodeClassName + " " + rootCss : rootCss;
5560
5567
  var rootStyle = {
5561
- backgroundImage: this.survey.renderBackgroundImage
5568
+ backgroundImage: this.survey.renderBackgroundImage,
5569
+ backgroundSize: this.survey.backgroundImageFit
5562
5570
  };
5563
5571
  var formStyle = {
5564
5572
  backgroundColor: this.survey.renderBackgroundOpacity
@@ -10335,7 +10343,8 @@ var TagboxFilterString = /** @class */ (function (_super) {
10335
10343
  }
10336
10344
  };
10337
10345
  TagboxFilterString.prototype.onChange = function (e) {
10338
- if (e.target === document.activeElement) {
10346
+ var root = survey_core__WEBPACK_IMPORTED_MODULE_1__["settings"].environment.root;
10347
+ if (e.target === root.activeElement) {
10339
10348
  this.model.inputStringRendered = e.target.value;
10340
10349
  }
10341
10350
  };
@@ -10353,7 +10362,16 @@ var TagboxFilterString = /** @class */ (function (_super) {
10353
10362
  };
10354
10363
  TagboxFilterString.prototype.render = function () {
10355
10364
  var _this = this;
10356
- return (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); } }));
10365
+ return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.question.cssClasses.hint },
10366
+ this.model.showHintPrefix ?
10367
+ (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.question.cssClasses.hintPrefix },
10368
+ react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", null, this.model.hintStringPrefix))) : null,
10369
+ react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.question.cssClasses.hintSuffixWrapper },
10370
+ this.model.showHintString ?
10371
+ (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.question.cssClasses.hintSuffix },
10372
+ react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", { style: { visibility: "hidden" }, "data-bind": "text: model.filterString" }, this.model.inputStringRendered),
10373
+ react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", null, this.model.hintStringSuffix))) : null,
10374
+ 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); } }))));
10357
10375
  };
10358
10376
  return TagboxFilterString;
10359
10377
  }(_reactquestion_element__WEBPACK_IMPORTED_MODULE_3__["SurveyElementBase"]));
@@ -10450,7 +10468,29 @@ var SurveyQuestionTagboxItem = /** @class */ (function (_super) {
10450
10468
 
10451
10469
  "use strict";
10452
10470
  __webpack_require__.r(__webpack_exports__);
10453
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "settings", function() { return settings; });
10471
+ /* WEBPACK VAR INJECTION */(function(global) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "settings", function() { return settings; });
10472
+ var document = global.document;
10473
+ var defaultEnvironment = (!!document ? {
10474
+ root: document,
10475
+ _rootElement: document.body,
10476
+ get rootElement() {
10477
+ var _a;
10478
+ return (_a = this._rootElement) !== null && _a !== void 0 ? _a : document.body;
10479
+ },
10480
+ set rootElement(rootElement) {
10481
+ this._rootElement = rootElement;
10482
+ },
10483
+ _popupMountContainer: document.body,
10484
+ get popupMountContainer() {
10485
+ var _a;
10486
+ return (_a = this._popupMountContainer) !== null && _a !== void 0 ? _a : document.body;
10487
+ },
10488
+ set popupMountContainer(popupMountContainer) {
10489
+ this._popupMountContainer = popupMountContainer;
10490
+ },
10491
+ svgMountContainer: document.head,
10492
+ stylesSheetsMountContainer: document.head,
10493
+ } : undefined);
10454
10494
  var columnWidthsByType = {
10455
10495
  "file": { minWidth: "240px" },
10456
10496
  "comment": { minWidth: "200px" }
@@ -10832,6 +10872,10 @@ var settings = {
10832
10872
  * - `"icon"` - Users can only use the choice item icon as a drag handle.
10833
10873
  */
10834
10874
  rankingDragHandleArea: "entireItem",
10875
+ /**
10876
+ * Specifies environment in which SurveyJS will exist
10877
+ */
10878
+ environment: defaultEnvironment,
10835
10879
  titleTags: {
10836
10880
  survey: "h3",
10837
10881
  page: "h4",
@@ -10919,12 +10963,17 @@ var settings = {
10919
10963
  * - `columnWidthsByType`: `Object`\
10920
10964
  * An object that specifies fixed and minimum column width based on the column type.\
10921
10965
  * Example: `settings.matrix.columnWidthsByType = { "tagbox": { minWidth: "240px", width: "300px" } }`
10966
+ *
10967
+ * - `rateSize`: `"small"` (default) | `"normal"`\
10968
+ * Specifies the size of rate values. Applies to [Rating Scale](https://surveyjs.io/form-library/examples/rating-scale/) questions within matrixes.
10922
10969
  */
10923
10970
  matrix: {
10924
- columnWidthsByType: columnWidthsByType
10971
+ columnWidthsByType: columnWidthsByType,
10972
+ rateSize: "small",
10925
10973
  }
10926
10974
  };
10927
10975
 
10976
+ /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
10928
10977
 
10929
10978
  /***/ }),
10930
10979
 
@@ -11101,7 +11150,7 @@ var VerticalResponsivityManager = /** @class */ (function (_super) {
11101
11150
  /*!****************************!*\
11102
11151
  !*** ./src/utils/utils.ts ***!
11103
11152
  \****************************/
11104
- /*! exports provided: unwrap, getSize, doKey2ClickBlur, doKey2ClickUp, doKey2ClickDown, sanitizeEditableContent, Logger, mergeValues, getElementWidth, isContainerVisible, classesToSelector, compareVersions, confirmAction, detectIEOrEdge, detectIEBrowser, loadFileFromBase64, isMobile, isElementVisible, findScrollableParent, scrollElementByChildId, navigateToUrl, createSvg, getIconNameFromProxy, increaseHeightByContent, getOriginalEvent, preventDefaults, findParentByClassNames */
11153
+ /*! 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 */
11105
11154
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
11106
11155
 
11107
11156
  "use strict";
@@ -11123,6 +11172,8 @@ __webpack_require__.r(__webpack_exports__);
11123
11172
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "detectIEBrowser", function() { return detectIEBrowser; });
11124
11173
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "loadFileFromBase64", function() { return loadFileFromBase64; });
11125
11174
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isMobile", function() { return isMobile; });
11175
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isShadowDOM", function() { return isShadowDOM; });
11176
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getElement", function() { return getElement; });
11126
11177
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isElementVisible", function() { return isElementVisible; });
11127
11178
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "findScrollableParent", function() { return findScrollableParent; });
11128
11179
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scrollElementByChildId", function() { return scrollElementByChildId; });
@@ -11200,13 +11251,24 @@ function loadFileFromBase64(b64Data, fileName) {
11200
11251
  function isMobile() {
11201
11252
  return (typeof window !== "undefined" && typeof window.orientation !== "undefined");
11202
11253
  }
11254
+ var isShadowDOM = function (rootElement) {
11255
+ return !!rootElement && !!("host" in rootElement && rootElement.host);
11256
+ };
11257
+ var getElement = function (element) {
11258
+ var root = _settings__WEBPACK_IMPORTED_MODULE_0__["settings"].environment.root;
11259
+ return typeof element === "string" ? root.getElementById(element) : element;
11260
+ };
11203
11261
  function isElementVisible(element, threshold) {
11204
11262
  if (threshold === void 0) { threshold = 0; }
11205
- if (typeof document === "undefined") {
11263
+ if (typeof _settings__WEBPACK_IMPORTED_MODULE_0__["settings"].environment === "undefined") {
11206
11264
  return false;
11207
11265
  }
11266
+ var root = _settings__WEBPACK_IMPORTED_MODULE_0__["settings"].environment.root;
11267
+ var clientHeight = isShadowDOM(root)
11268
+ ? root.host.clientHeight
11269
+ : root.documentElement.clientHeight;
11208
11270
  var elementRect = element.getBoundingClientRect();
11209
- var viewHeight = Math.max(document.documentElement.clientHeight, window.innerHeight);
11271
+ var viewHeight = Math.max(clientHeight, window.innerHeight);
11210
11272
  var topWin = -threshold;
11211
11273
  var bottomWin = viewHeight + threshold;
11212
11274
  var topEl = elementRect.top;
@@ -11216,8 +11278,11 @@ function isElementVisible(element, threshold) {
11216
11278
  return maxTop <= minBottom;
11217
11279
  }
11218
11280
  function findScrollableParent(element) {
11281
+ var root = _settings__WEBPACK_IMPORTED_MODULE_0__["settings"].environment.root;
11219
11282
  if (!element) {
11220
- return document.documentElement;
11283
+ return isShadowDOM(root)
11284
+ ? root.host
11285
+ : root.documentElement;
11221
11286
  }
11222
11287
  if (element.scrollHeight > element.clientHeight &&
11223
11288
  (getComputedStyle(element).overflowY === "scroll" ||
@@ -11232,9 +11297,11 @@ function findScrollableParent(element) {
11232
11297
  return findScrollableParent(element.parentElement);
11233
11298
  }
11234
11299
  function scrollElementByChildId(id) {
11235
- if (!document)
11300
+ var environment = _settings__WEBPACK_IMPORTED_MODULE_0__["settings"].environment;
11301
+ if (!environment)
11236
11302
  return;
11237
- var el = document.getElementById(id);
11303
+ var root = environment.root;
11304
+ var el = root.getElementById(id);
11238
11305
  if (!el)
11239
11306
  return;
11240
11307
  var scrollableEl = findScrollableParent(el);