survey-react-ui 1.9.86 → 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 +2 -2
- package/survey-react-ui.js +91 -26
- package/survey-react-ui.js.map +1 -1
- package/survey-react-ui.min.js +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "survey-react-ui",
|
|
3
|
-
"version": "1.9.
|
|
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.
|
|
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
|
}
|
package/survey-react-ui.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* surveyjs - Survey JavaScript library v1.9.
|
|
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.
|
|
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
|
|
2088
|
-
/* harmony import */ var
|
|
2089
|
-
/* harmony import */ var
|
|
2090
|
-
/* harmony import */ var
|
|
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(
|
|
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
|
-
|
|
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(
|
|
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(
|
|
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
|
-
}(
|
|
2204
|
+
}(_reactquestion_element__WEBPACK_IMPORTED_MODULE_3__["SurveyElementBase"]));
|
|
2201
2205
|
|
|
2202
|
-
|
|
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:
|
|
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:
|
|
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
|
-
|
|
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 ===
|
|
4129
|
+
if (e.target === root.activeElement) {
|
|
4124
4130
|
dropdownListModel.inputStringRendered = e.target.value;
|
|
4125
4131
|
}
|
|
4126
4132
|
};
|
|
@@ -10337,7 +10343,8 @@ var TagboxFilterString = /** @class */ (function (_super) {
|
|
|
10337
10343
|
}
|
|
10338
10344
|
};
|
|
10339
10345
|
TagboxFilterString.prototype.onChange = function (e) {
|
|
10340
|
-
|
|
10346
|
+
var root = survey_core__WEBPACK_IMPORTED_MODULE_1__["settings"].environment.root;
|
|
10347
|
+
if (e.target === root.activeElement) {
|
|
10341
10348
|
this.model.inputStringRendered = e.target.value;
|
|
10342
10349
|
}
|
|
10343
10350
|
};
|
|
@@ -10355,7 +10362,16 @@ var TagboxFilterString = /** @class */ (function (_super) {
|
|
|
10355
10362
|
};
|
|
10356
10363
|
TagboxFilterString.prototype.render = function () {
|
|
10357
10364
|
var _this = this;
|
|
10358
|
-
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("
|
|
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); } }))));
|
|
10359
10375
|
};
|
|
10360
10376
|
return TagboxFilterString;
|
|
10361
10377
|
}(_reactquestion_element__WEBPACK_IMPORTED_MODULE_3__["SurveyElementBase"]));
|
|
@@ -10452,7 +10468,29 @@ var SurveyQuestionTagboxItem = /** @class */ (function (_super) {
|
|
|
10452
10468
|
|
|
10453
10469
|
"use strict";
|
|
10454
10470
|
__webpack_require__.r(__webpack_exports__);
|
|
10455
|
-
/* 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);
|
|
10456
10494
|
var columnWidthsByType = {
|
|
10457
10495
|
"file": { minWidth: "240px" },
|
|
10458
10496
|
"comment": { minWidth: "200px" }
|
|
@@ -10834,6 +10872,10 @@ var settings = {
|
|
|
10834
10872
|
* - `"icon"` - Users can only use the choice item icon as a drag handle.
|
|
10835
10873
|
*/
|
|
10836
10874
|
rankingDragHandleArea: "entireItem",
|
|
10875
|
+
/**
|
|
10876
|
+
* Specifies environment in which SurveyJS will exist
|
|
10877
|
+
*/
|
|
10878
|
+
environment: defaultEnvironment,
|
|
10837
10879
|
titleTags: {
|
|
10838
10880
|
survey: "h3",
|
|
10839
10881
|
page: "h4",
|
|
@@ -10921,12 +10963,17 @@ var settings = {
|
|
|
10921
10963
|
* - `columnWidthsByType`: `Object`\
|
|
10922
10964
|
* An object that specifies fixed and minimum column width based on the column type.\
|
|
10923
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.
|
|
10924
10969
|
*/
|
|
10925
10970
|
matrix: {
|
|
10926
|
-
columnWidthsByType: columnWidthsByType
|
|
10971
|
+
columnWidthsByType: columnWidthsByType,
|
|
10972
|
+
rateSize: "small",
|
|
10927
10973
|
}
|
|
10928
10974
|
};
|
|
10929
10975
|
|
|
10976
|
+
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../node_modules/webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
|
|
10930
10977
|
|
|
10931
10978
|
/***/ }),
|
|
10932
10979
|
|
|
@@ -11103,7 +11150,7 @@ var VerticalResponsivityManager = /** @class */ (function (_super) {
|
|
|
11103
11150
|
/*!****************************!*\
|
|
11104
11151
|
!*** ./src/utils/utils.ts ***!
|
|
11105
11152
|
\****************************/
|
|
11106
|
-
/*! 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 */
|
|
11107
11154
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
11108
11155
|
|
|
11109
11156
|
"use strict";
|
|
@@ -11125,6 +11172,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
11125
11172
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "detectIEBrowser", function() { return detectIEBrowser; });
|
|
11126
11173
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "loadFileFromBase64", function() { return loadFileFromBase64; });
|
|
11127
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; });
|
|
11128
11177
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isElementVisible", function() { return isElementVisible; });
|
|
11129
11178
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "findScrollableParent", function() { return findScrollableParent; });
|
|
11130
11179
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "scrollElementByChildId", function() { return scrollElementByChildId; });
|
|
@@ -11202,13 +11251,24 @@ function loadFileFromBase64(b64Data, fileName) {
|
|
|
11202
11251
|
function isMobile() {
|
|
11203
11252
|
return (typeof window !== "undefined" && typeof window.orientation !== "undefined");
|
|
11204
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
|
+
};
|
|
11205
11261
|
function isElementVisible(element, threshold) {
|
|
11206
11262
|
if (threshold === void 0) { threshold = 0; }
|
|
11207
|
-
if (typeof
|
|
11263
|
+
if (typeof _settings__WEBPACK_IMPORTED_MODULE_0__["settings"].environment === "undefined") {
|
|
11208
11264
|
return false;
|
|
11209
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;
|
|
11210
11270
|
var elementRect = element.getBoundingClientRect();
|
|
11211
|
-
var viewHeight = Math.max(
|
|
11271
|
+
var viewHeight = Math.max(clientHeight, window.innerHeight);
|
|
11212
11272
|
var topWin = -threshold;
|
|
11213
11273
|
var bottomWin = viewHeight + threshold;
|
|
11214
11274
|
var topEl = elementRect.top;
|
|
@@ -11218,8 +11278,11 @@ function isElementVisible(element, threshold) {
|
|
|
11218
11278
|
return maxTop <= minBottom;
|
|
11219
11279
|
}
|
|
11220
11280
|
function findScrollableParent(element) {
|
|
11281
|
+
var root = _settings__WEBPACK_IMPORTED_MODULE_0__["settings"].environment.root;
|
|
11221
11282
|
if (!element) {
|
|
11222
|
-
return
|
|
11283
|
+
return isShadowDOM(root)
|
|
11284
|
+
? root.host
|
|
11285
|
+
: root.documentElement;
|
|
11223
11286
|
}
|
|
11224
11287
|
if (element.scrollHeight > element.clientHeight &&
|
|
11225
11288
|
(getComputedStyle(element).overflowY === "scroll" ||
|
|
@@ -11234,9 +11297,11 @@ function findScrollableParent(element) {
|
|
|
11234
11297
|
return findScrollableParent(element.parentElement);
|
|
11235
11298
|
}
|
|
11236
11299
|
function scrollElementByChildId(id) {
|
|
11237
|
-
|
|
11300
|
+
var environment = _settings__WEBPACK_IMPORTED_MODULE_0__["settings"].environment;
|
|
11301
|
+
if (!environment)
|
|
11238
11302
|
return;
|
|
11239
|
-
var
|
|
11303
|
+
var root = environment.root;
|
|
11304
|
+
var el = root.getElementById(id);
|
|
11240
11305
|
if (!el)
|
|
11241
11306
|
return;
|
|
11242
11307
|
var scrollableEl = findScrollableParent(el);
|