survey-react-ui 1.9.134 → 1.9.135

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.134",
3
+ "version": "1.9.135",
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",
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - Survey JavaScript library v1.9.134
2
+ * surveyjs - Survey JavaScript library v1.9.135
3
3
  * Copyright (c) 2015-2024 Devsoft Baltic OÜ - http://surveyjs.io/
4
4
  * License: MIT (http://www.opensource.org/licenses/mit-license.php)
5
5
  */
@@ -2899,6 +2899,8 @@ var ConsoleWarnings = /** @class */ (function () {
2899
2899
  "use strict";
2900
2900
  __webpack_require__.r(__webpack_exports__);
2901
2901
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ElementHelper", function() { return ElementHelper; });
2902
+ /* harmony import */ var _global_variables_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./global_variables_utils */ "./src/global_variables_utils.ts");
2903
+
2902
2904
  var ElementHelper = /** @class */ (function () {
2903
2905
  function ElementHelper() {
2904
2906
  }
@@ -2906,7 +2908,7 @@ var ElementHelper = /** @class */ (function () {
2906
2908
  element && element.focus();
2907
2909
  };
2908
2910
  ElementHelper.visibility = function (node) {
2909
- var style = window.getComputedStyle(node);
2911
+ var style = _global_variables_utils__WEBPACK_IMPORTED_MODULE_0__["DomDocumentHelper"].getComputedStyle(node);
2910
2912
  if (style.display === "none" || style.visibility === "hidden")
2911
2913
  return false;
2912
2914
  return node.parentElement ? this.visibility(node.parentElement) : true;
@@ -3585,7 +3587,7 @@ __webpack_require__.r(__webpack_exports__);
3585
3587
 
3586
3588
 
3587
3589
 
3588
- Object(survey_core__WEBPACK_IMPORTED_MODULE_2__["checkLibraryVersion"])("" + "1.9.134", "survey-react-ui");
3590
+ Object(survey_core__WEBPACK_IMPORTED_MODULE_2__["checkLibraryVersion"])("" + "1.9.135", "survey-react-ui");
3589
3591
 
3590
3592
 
3591
3593
  /***/ }),
@@ -7782,6 +7784,148 @@ function substring_(params) {
7782
7784
  FunctionFactory.Instance.register("substring", substring_);
7783
7785
 
7784
7786
 
7787
+ /***/ }),
7788
+
7789
+ /***/ "./src/global_variables_utils.ts":
7790
+ /*!***************************************!*\
7791
+ !*** ./src/global_variables_utils.ts ***!
7792
+ \***************************************/
7793
+ /*! exports provided: DomWindowHelper, DomDocumentHelper */
7794
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
7795
+
7796
+ "use strict";
7797
+ __webpack_require__.r(__webpack_exports__);
7798
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DomWindowHelper", function() { return DomWindowHelper; });
7799
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DomDocumentHelper", function() { return DomDocumentHelper; });
7800
+ /* eslint-disable no-restricted-globals */
7801
+ var DomWindowHelper = /** @class */ (function () {
7802
+ function DomWindowHelper() {
7803
+ }
7804
+ DomWindowHelper.isAvailable = function () {
7805
+ return "undefined" !== typeof window;
7806
+ };
7807
+ DomWindowHelper.isFileReaderAvailable = function () {
7808
+ if (!DomWindowHelper.isAvailable())
7809
+ return false;
7810
+ return !!window["FileReader"];
7811
+ };
7812
+ DomWindowHelper.getLocation = function () {
7813
+ if (!DomWindowHelper.isAvailable())
7814
+ return;
7815
+ return window.location;
7816
+ };
7817
+ DomWindowHelper.getVisualViewport = function () {
7818
+ if (!DomWindowHelper.isAvailable())
7819
+ return null;
7820
+ return window.visualViewport;
7821
+ };
7822
+ DomWindowHelper.getInnerWidth = function () {
7823
+ if (!DomWindowHelper.isAvailable())
7824
+ return;
7825
+ return window.innerWidth;
7826
+ };
7827
+ DomWindowHelper.getInnerHeight = function () {
7828
+ if (!DomWindowHelper.isAvailable())
7829
+ return null;
7830
+ return window.innerHeight;
7831
+ };
7832
+ DomWindowHelper.getWindow = function () {
7833
+ if (!DomWindowHelper.isAvailable())
7834
+ return;
7835
+ return window;
7836
+ };
7837
+ DomWindowHelper.hasOwn = function (propertyName) {
7838
+ if (!DomWindowHelper.isAvailable())
7839
+ return;
7840
+ return propertyName in window;
7841
+ };
7842
+ DomWindowHelper.getSelection = function () {
7843
+ if (DomWindowHelper.isAvailable() && window.getSelection) {
7844
+ return window.getSelection();
7845
+ }
7846
+ };
7847
+ DomWindowHelper.requestAnimationFrame = function (callback) {
7848
+ if (DomWindowHelper.isAvailable()) {
7849
+ return window.requestAnimationFrame(callback);
7850
+ }
7851
+ };
7852
+ DomWindowHelper.addEventListener = function (type, listener) {
7853
+ if (!DomWindowHelper.isAvailable())
7854
+ return;
7855
+ window.addEventListener(type, listener);
7856
+ };
7857
+ DomWindowHelper.removeEventListener = function (type, listener) {
7858
+ if (!DomWindowHelper.isAvailable())
7859
+ return;
7860
+ window.removeEventListener(type, listener);
7861
+ };
7862
+ return DomWindowHelper;
7863
+ }());
7864
+
7865
+ var DomDocumentHelper = /** @class */ (function () {
7866
+ function DomDocumentHelper() {
7867
+ }
7868
+ DomDocumentHelper.isAvailable = function () {
7869
+ return "undefined" !== typeof document;
7870
+ };
7871
+ DomDocumentHelper.getBody = function () {
7872
+ if (!DomDocumentHelper.isAvailable())
7873
+ return;
7874
+ return document.body;
7875
+ };
7876
+ DomDocumentHelper.getDocumentElement = function () {
7877
+ if (!DomDocumentHelper.isAvailable())
7878
+ return;
7879
+ return document.documentElement;
7880
+ };
7881
+ DomDocumentHelper.getDocument = function () {
7882
+ if (!DomDocumentHelper.isAvailable())
7883
+ return;
7884
+ return document;
7885
+ };
7886
+ DomDocumentHelper.getCookie = function () {
7887
+ if (!DomDocumentHelper.isAvailable())
7888
+ return;
7889
+ return document.cookie;
7890
+ };
7891
+ DomDocumentHelper.setCookie = function (newCookie) {
7892
+ if (!DomDocumentHelper.isAvailable())
7893
+ return;
7894
+ document.cookie = newCookie;
7895
+ };
7896
+ DomDocumentHelper.activeElementBlur = function () {
7897
+ if (!DomDocumentHelper.isAvailable())
7898
+ return;
7899
+ var activeElement = document.activeElement;
7900
+ if (!!activeElement && !!activeElement.blur) {
7901
+ activeElement.blur();
7902
+ }
7903
+ };
7904
+ DomDocumentHelper.createElement = function (tagName) {
7905
+ if (!DomDocumentHelper.isAvailable())
7906
+ return;
7907
+ return document.createElement(tagName);
7908
+ };
7909
+ DomDocumentHelper.getComputedStyle = function (elt) {
7910
+ if (!DomDocumentHelper.isAvailable())
7911
+ return new CSSStyleDeclaration();
7912
+ return document.defaultView.getComputedStyle(elt);
7913
+ };
7914
+ DomDocumentHelper.addEventListener = function (type, listener) {
7915
+ if (!DomDocumentHelper.isAvailable())
7916
+ return;
7917
+ document.addEventListener(type, listener);
7918
+ };
7919
+ DomDocumentHelper.removeEventListener = function (type, listener) {
7920
+ if (!DomDocumentHelper.isAvailable())
7921
+ return;
7922
+ document.removeEventListener(type, listener);
7923
+ };
7924
+ return DomDocumentHelper;
7925
+ }());
7926
+
7927
+
7928
+
7785
7929
  /***/ }),
7786
7930
 
7787
7931
  /***/ "./src/helpers.ts":
@@ -9870,23 +10014,9 @@ var JsonError = /** @class */ (function () {
9870
10014
  var JsonUnknownPropertyError = /** @class */ (function (_super) {
9871
10015
  __extends(JsonUnknownPropertyError, _super);
9872
10016
  function JsonUnknownPropertyError(propertyName, className) {
9873
- var _this = _super.call(this, "unknownproperty", "The property '" +
9874
- propertyName +
9875
- "' in class '" +
9876
- className +
9877
- "' is unknown.") || this;
10017
+ var _this = _super.call(this, "unknownproperty", "Unknown property in class '" + className + "': '" + propertyName + "'.") || this;
9878
10018
  _this.propertyName = propertyName;
9879
10019
  _this.className = className;
9880
- var properties = Serializer.getProperties(className);
9881
- if (properties) {
9882
- _this.description = "The list of available properties are: ";
9883
- for (var i = 0; i < properties.length; i++) {
9884
- if (i > 0)
9885
- _this.description += ", ";
9886
- _this.description += properties[i].name;
9887
- }
9888
- _this.description += ".";
9889
- }
9890
10020
  return _this;
9891
10021
  }
9892
10022
  return JsonUnknownPropertyError;
@@ -9899,14 +10029,6 @@ var JsonMissingTypeErrorBase = /** @class */ (function (_super) {
9899
10029
  _this.baseClassName = baseClassName;
9900
10030
  _this.type = type;
9901
10031
  _this.message = message;
9902
- _this.description = "The following types are available: ";
9903
- var types = Serializer.getChildrenClasses(baseClassName, true);
9904
- for (var i = 0; i < types.length; i++) {
9905
- if (i > 0)
9906
- _this.description += ", ";
9907
- _this.description += "'" + types[i].name + "'";
9908
- }
9909
- _this.description += ".";
9910
10032
  return _this;
9911
10033
  }
9912
10034
  return JsonMissingTypeErrorBase;
@@ -10369,6 +10491,7 @@ var defaultListCss = {
10369
10491
  itemWithIcon: "sv-list__item--with-icon",
10370
10492
  itemDisabled: "sv-list__item--disabled",
10371
10493
  itemFocused: "sv-list__item--focused",
10494
+ itemTextWrap: "sv-list__item-text--wrap",
10372
10495
  itemIcon: "sv-list__item-icon",
10373
10496
  itemSeparator: "sv-list__item-separator",
10374
10497
  itemBody: "sv-list__item-body",
@@ -10422,6 +10545,7 @@ var ListModel = /** @class */ (function (_super) {
10422
10545
  .append(_this.cssClasses.itemDisabled, _this.isItemDisabled(itemValue))
10423
10546
  .append(_this.cssClasses.itemFocused, _this.isItemFocused(itemValue))
10424
10547
  .append(_this.cssClasses.itemSelected, _this.isItemSelected(itemValue))
10548
+ .append(_this.cssClasses.itemTextWrap, _this.textWrapEnabled)
10425
10549
  .append(itemValue.css)
10426
10550
  .toString();
10427
10551
  };
@@ -10719,6 +10843,9 @@ var ListModel = /** @class */ (function (_super) {
10719
10843
  __decorate([
10720
10844
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])({ defaultValue: true })
10721
10845
  ], ListModel.prototype, "renderElements", void 0);
10846
+ __decorate([
10847
+ Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])({ defaultValue: false })
10848
+ ], ListModel.prototype, "textWrapEnabled", void 0);
10722
10849
  return ListModel;
10723
10850
  }(_actions_container__WEBPACK_IMPORTED_MODULE_1__["ActionContainer"]));
10724
10851
 
@@ -11489,6 +11616,7 @@ __webpack_require__.r(__webpack_exports__);
11489
11616
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createDialogOptions", function() { return createDialogOptions; });
11490
11617
  /* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./base */ "./src/base.ts");
11491
11618
  /* harmony import */ var _jsonobject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./jsonobject */ "./src/jsonobject.ts");
11619
+ /* harmony import */ var _console_warnings__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./console-warnings */ "./src/console-warnings.ts");
11492
11620
  var __extends = (undefined && undefined.__extends) || (function () {
11493
11621
  var extendStatics = function (d, b) {
11494
11622
  extendStatics = Object.setPrototypeOf ||
@@ -11512,6 +11640,7 @@ var __decorate = (undefined && undefined.__decorate) || function (decorators, ta
11512
11640
  };
11513
11641
 
11514
11642
 
11643
+
11515
11644
  var PopupModel = /** @class */ (function (_super) {
11516
11645
  __extends(PopupModel, _super);
11517
11646
  function PopupModel(contentComponentName, contentComponentData, verticalPosition, horizontalPosition, showPointer, isModal, onCancel, onApply, onHide, onShow, cssClass, title, onDispose) {
@@ -11644,6 +11773,7 @@ function createDialogOptions(componentName, data, onApply, onCancel, onHide, onS
11644
11773
  if (onHide === void 0) { onHide = function () { }; }
11645
11774
  if (onShow === void 0) { onShow = function () { }; }
11646
11775
  if (displayMode === void 0) { displayMode = "popup"; }
11776
+ _console_warnings__WEBPACK_IMPORTED_MODULE_2__["ConsoleWarnings"].warn("The `showModal()` and `createDialogOptions()` methods are obsolete. Use the `showDialog()` method instead.");
11647
11777
  return {
11648
11778
  componentName: componentName,
11649
11779
  data: data,
@@ -16072,8 +16202,8 @@ var SurveyPanelBase = /** @class */ (function (_super) {
16072
16202
  _super.prototype.componentDidUpdate.call(this, prevProps, prevState);
16073
16203
  if (!!prevProps.page &&
16074
16204
  !!this.survey &&
16075
- !!this.survey.currentPage &&
16076
- prevProps.page.id === this.survey.currentPage.id)
16205
+ !!this.survey.activePage &&
16206
+ prevProps.page.id === this.survey.activePage.id)
16077
16207
  return;
16078
16208
  this.doAfterRender();
16079
16209
  };
@@ -21759,23 +21889,25 @@ var SurveyQuestionTagboxItem = /** @class */ (function (_super) {
21759
21889
  "use strict";
21760
21890
  __webpack_require__.r(__webpack_exports__);
21761
21891
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "settings", function() { return settings; });
21762
- /* harmony import */ var _utils_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils/utils */ "./src/utils/utils.ts");
21892
+ /* harmony import */ var _global_variables_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./global_variables_utils */ "./src/global_variables_utils.ts");
21893
+ /* harmony import */ var _utils_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils/utils */ "./src/utils/utils.ts");
21894
+
21763
21895
 
21764
21896
  var document = typeof globalThis !== "undefined" ? globalThis.document : undefined.document;
21765
21897
  var defaultEnvironment = (!!document ? {
21766
21898
  root: document,
21767
- _rootElement: document.body,
21899
+ _rootElement: _global_variables_utils__WEBPACK_IMPORTED_MODULE_0__["DomDocumentHelper"].getBody(),
21768
21900
  get rootElement() {
21769
21901
  var _a;
21770
- return (_a = this._rootElement) !== null && _a !== void 0 ? _a : document.body;
21902
+ return (_a = this._rootElement) !== null && _a !== void 0 ? _a : _global_variables_utils__WEBPACK_IMPORTED_MODULE_0__["DomDocumentHelper"].getBody();
21771
21903
  },
21772
21904
  set rootElement(rootElement) {
21773
21905
  this._rootElement = rootElement;
21774
21906
  },
21775
- _popupMountContainer: document.body,
21907
+ _popupMountContainer: _global_variables_utils__WEBPACK_IMPORTED_MODULE_0__["DomDocumentHelper"].getBody(),
21776
21908
  get popupMountContainer() {
21777
21909
  var _a;
21778
- return (_a = this._popupMountContainer) !== null && _a !== void 0 ? _a : document.body;
21910
+ return (_a = this._popupMountContainer) !== null && _a !== void 0 ? _a : _global_variables_utils__WEBPACK_IMPORTED_MODULE_0__["DomDocumentHelper"].getBody();
21779
21911
  },
21780
21912
  set popupMountContainer(popupMountContainer) {
21781
21913
  this._popupMountContainer = popupMountContainer;
@@ -21824,7 +21956,7 @@ var settings = {
21824
21956
  * Nested properties:
21825
21957
  *
21826
21958
  * - `useLocalTimeZone`: `boolean`\
21827
- * Disable this property if you want internal SurveyJS functions to use methods that work with UTC date and time (`setUTCDate()` `setUTCHours()`, etc.) instead of methods that work with local date and time (`setYear`, `setHours()`, etc.). Default value: `true`.
21959
+ * Disable this property if you want internal SurveyJS functions to use methods that work with UTC date and time (`setUTCDate()` `setUTCHours()`, etc.) instead of methods that work with local date and time (`setYear()`, `setHours()`, etc.). Default value: `true`.
21828
21960
  *
21829
21961
  * - `defaultLocaleName`: `string`\
21830
21962
  * A property key that stores a translation for the default locale. Default value: `"default"`.
@@ -21970,7 +22102,8 @@ var settings = {
21970
22102
  * - `enabled`: `boolean`\
21971
22103
  * Specifies whether to add questions to the DOM only when they get into the viewport. Default value: `false`.
21972
22104
  *
21973
- * > Lazy rendering is an experimental feature that may not work as expected in all use cases.
22105
+ * [View Demo](https://surveyjs.io/form-library/examples/survey-lazy/ (linkStyle))
22106
+ * @see [SurveyModel.lazyRendering](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#lazyRendering)
21974
22107
  */
21975
22108
  lazyRender: {
21976
22109
  enabled: false,
@@ -22204,7 +22337,7 @@ var settings = {
22204
22337
  * @param callback A callback function that should be called with `true` if a user confirms an action or `false` otherwise.
22205
22338
  */
22206
22339
  confirmActionAsync: function (message, callback, applyTitle, locale, rootElement) {
22207
- return Object(_utils_utils__WEBPACK_IMPORTED_MODULE_0__["showConfirmDialog"])(message, callback, applyTitle, locale, rootElement);
22340
+ return Object(_utils_utils__WEBPACK_IMPORTED_MODULE_1__["showConfirmDialog"])(message, callback, applyTitle, locale, rootElement);
22208
22341
  },
22209
22342
  /**
22210
22343
  * A minimum width value for all survey elements.
@@ -22445,6 +22578,20 @@ var settings = {
22445
22578
  ]
22446
22579
  },
22447
22580
  legacyProgressBarView: false,
22581
+ /**
22582
+ * An object with properties that configure input masks.
22583
+ *
22584
+ * Nested properties:
22585
+ *
22586
+ * - `patternPlaceholderChar`: `string`\
22587
+ * A symbol used as a placeholder for characters to be entered in [pattern masks](https://surveyjs.io/form-library/documentation/api-reference/inputmaskpattern). Default value: `"_"`.
22588
+ *
22589
+ * - `patternEscapeChar`: `string`\
22590
+ * A symbol used to insert literal representations of special characters in [pattern masks](https://surveyjs.io/form-library/documentation/api-reference/inputmaskpattern). Default value: `"\\"`.
22591
+ *
22592
+ * - `patternDefinitions`: `<{ [key: string]: RegExp }>`\
22593
+ * An object that maps placeholder symbols to regular expressions in [pattern masks](https://surveyjs.io/form-library/documentation/api-reference/inputmaskpattern). Default value: `{ "9": /[0-9]/, "a": /[a-zA-Z]/, "#": /[a-zA-Z0-9]/ }`.
22594
+ */
22448
22595
  maskSettings: {
22449
22596
  patternPlaceholderChar: "_",
22450
22597
  patternEscapeChar: "\\",
@@ -22478,6 +22625,7 @@ __webpack_require__.r(__webpack_exports__);
22478
22625
  /* harmony import */ var _settings__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./settings */ "./src/settings.ts");
22479
22626
  /* harmony import */ var _actions_container__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./actions/container */ "./src/actions/container.ts");
22480
22627
  /* harmony import */ var _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./utils/cssClassBuilder */ "./src/utils/cssClassBuilder.ts");
22628
+ /* harmony import */ var _global_variables_utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./global_variables_utils */ "./src/global_variables_utils.ts");
22481
22629
  var __extends = (undefined && undefined.__extends) || (function () {
22482
22630
  var extendStatics = function (d, b) {
22483
22631
  extendStatics = Object.setPrototypeOf ||
@@ -22506,6 +22654,7 @@ var __decorate = (undefined && undefined.__decorate) || function (decorators, ta
22506
22654
 
22507
22655
 
22508
22656
 
22657
+
22509
22658
  /**
22510
22659
  * A base class for the [`SurveyElement`](https://surveyjs.io/form-library/documentation/surveyelement) and [`SurveyModel`](https://surveyjs.io/form-library/documentation/surveymodel) classes.
22511
22660
  */
@@ -22735,11 +22884,11 @@ var SurveyElement = /** @class */ (function (_super) {
22735
22884
  elLeft = el.getBoundingClientRect().left;
22736
22885
  needScroll = elLeft < 0;
22737
22886
  }
22738
- if (!!window && !needScroll) {
22739
- var height = window.innerHeight;
22887
+ if (!needScroll && _global_variables_utils__WEBPACK_IMPORTED_MODULE_7__["DomWindowHelper"].isAvailable()) {
22888
+ var height = _global_variables_utils__WEBPACK_IMPORTED_MODULE_7__["DomWindowHelper"].getInnerHeight();
22740
22889
  needScroll = height > 0 && height < elTop;
22741
22890
  if (!needScroll && checkLeft) {
22742
- var width = window.innerWidth;
22891
+ var width = _global_variables_utils__WEBPACK_IMPORTED_MODULE_7__["DomWindowHelper"].getInnerWidth();
22743
22892
  needScroll = width > 0 && width < elLeft;
22744
22893
  }
22745
22894
  }
@@ -22767,7 +22916,7 @@ var SurveyElement = /** @class */ (function (_super) {
22767
22916
  return null;
22768
22917
  };
22769
22918
  SurveyElement.FocusElement = function (elementId) {
22770
- if (!elementId || typeof document === "undefined")
22919
+ if (!elementId || !_global_variables_utils__WEBPACK_IMPORTED_MODULE_7__["DomDocumentHelper"].isAvailable())
22771
22920
  return false;
22772
22921
  var res = SurveyElement.focusElementCore(elementId);
22773
22922
  if (!res) {
@@ -23682,12 +23831,13 @@ var SurveyElement = /** @class */ (function (_super) {
23682
23831
  });
23683
23832
  SurveyElement.prototype.isContainsSelection = function (el) {
23684
23833
  var elementWithSelection = undefined;
23685
- if ((typeof document !== "undefined") && document["selection"]) {
23686
- elementWithSelection = document["selection"].createRange().parentElement();
23834
+ var _document = _global_variables_utils__WEBPACK_IMPORTED_MODULE_7__["DomDocumentHelper"].getDocument();
23835
+ if (_global_variables_utils__WEBPACK_IMPORTED_MODULE_7__["DomDocumentHelper"].isAvailable() && !!_document && _document["selection"]) {
23836
+ elementWithSelection = _document["selection"].createRange().parentElement();
23687
23837
  }
23688
23838
  else {
23689
- var selection = window.getSelection();
23690
- if (selection.rangeCount > 0) {
23839
+ var selection = _global_variables_utils__WEBPACK_IMPORTED_MODULE_7__["DomWindowHelper"].getSelection();
23840
+ if (!!selection && selection.rangeCount > 0) {
23691
23841
  var range = selection.getRangeAt(0);
23692
23842
  if (range.startOffset !== range.endOffset) {
23693
23843
  elementWithSelection = range.startContainer.parentNode;
@@ -23940,7 +24090,8 @@ var CssClassBuilder = /** @class */ (function () {
23940
24090
  __webpack_require__.r(__webpack_exports__);
23941
24091
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ResponsivityManager", function() { return ResponsivityManager; });
23942
24092
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VerticalResponsivityManager", function() { return VerticalResponsivityManager; });
23943
- /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils */ "./src/utils/utils.ts");
24093
+ /* harmony import */ var _global_variables_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../global_variables_utils */ "./src/global_variables_utils.ts");
24094
+ /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils */ "./src/utils/utils.ts");
23944
24095
  var __extends = (undefined && undefined.__extends) || (function () {
23945
24096
  var extendStatics = function (d, b) {
23946
24097
  extendStatics = Object.setPrototypeOf ||
@@ -23957,6 +24108,7 @@ var __extends = (undefined && undefined.__extends) || (function () {
23957
24108
  };
23958
24109
  })();
23959
24110
 
24111
+
23960
24112
  var ResponsivityManager = /** @class */ (function () {
23961
24113
  function ResponsivityManager(container, model, itemsSelector, dotsItemSize, delayedUpdateFunction) {
23962
24114
  var _this = this;
@@ -23974,7 +24126,9 @@ var ResponsivityManager = /** @class */ (function () {
23974
24126
  this.paddingSizeConst = 8;
23975
24127
  this.dotsSizeConst = 48;
23976
24128
  this.recalcMinDimensionConst = true;
23977
- this.getComputedStyle = window.getComputedStyle.bind(window);
24129
+ this.getComputedStyle = function (elt) {
24130
+ return _global_variables_utils__WEBPACK_IMPORTED_MODULE_0__["DomDocumentHelper"].getComputedStyle(elt);
24131
+ };
23978
24132
  this.model.updateCallback = function (isResetInitialized) {
23979
24133
  if (isResetInitialized)
23980
24134
  _this.isInitialized = false;
@@ -23982,7 +24136,7 @@ var ResponsivityManager = /** @class */ (function () {
23982
24136
  };
23983
24137
  if (typeof ResizeObserver !== "undefined") {
23984
24138
  this.resizeObserver = new ResizeObserver(function (entries) {
23985
- window.requestAnimationFrame(function () {
24139
+ _global_variables_utils__WEBPACK_IMPORTED_MODULE_0__["DomWindowHelper"].requestAnimationFrame(function () {
23986
24140
  _this.process();
23987
24141
  });
23988
24142
  });
@@ -24041,7 +24195,7 @@ var ResponsivityManager = /** @class */ (function () {
24041
24195
  };
24042
24196
  Object.defineProperty(ResponsivityManager.prototype, "isContainerVisible", {
24043
24197
  get: function () {
24044
- return Object(_utils__WEBPACK_IMPORTED_MODULE_0__["isContainerVisible"])(this.container);
24198
+ return Object(_utils__WEBPACK_IMPORTED_MODULE_1__["isContainerVisible"])(this.container);
24045
24199
  },
24046
24200
  enumerable: false,
24047
24201
  configurable: true
@@ -24181,6 +24335,8 @@ __webpack_require__.r(__webpack_exports__);
24181
24335
  /* harmony import */ var _localizablestring__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../localizablestring */ "./src/localizablestring.ts");
24182
24336
  /* harmony import */ var _settings__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./../settings */ "./src/settings.ts");
24183
24337
  /* harmony import */ var _surveyStrings__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../surveyStrings */ "./src/surveyStrings.ts");
24338
+ /* harmony import */ var _global_variables_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../global_variables_utils */ "./src/global_variables_utils.ts");
24339
+
24184
24340
 
24185
24341
 
24186
24342
 
@@ -24216,18 +24372,14 @@ function confirmActionAsync(message, funcOnYes, funcOnNo, locale, rootElement) {
24216
24372
  callbackFunc(confirmAction(message));
24217
24373
  }
24218
24374
  function detectIEBrowser() {
24219
- if (typeof window === "undefined")
24220
- return false;
24221
- var ua = window.navigator.userAgent;
24375
+ var ua = navigator.userAgent;
24222
24376
  var oldIe = ua.indexOf("MSIE ");
24223
24377
  var elevenIe = ua.indexOf("Trident/");
24224
24378
  return oldIe > -1 || elevenIe > -1;
24225
24379
  }
24226
24380
  function detectIEOrEdge() {
24227
- if (typeof window === "undefined")
24228
- return false;
24229
24381
  if (typeof detectIEOrEdge.isIEOrEdge === "undefined") {
24230
- var ua = window.navigator.userAgent;
24382
+ var ua = navigator.userAgent;
24231
24383
  var msie = ua.indexOf("MSIE ");
24232
24384
  var trident = ua.indexOf("Trident/");
24233
24385
  var edge = ua.indexOf("Edge/");
@@ -24251,16 +24403,14 @@ function loadFileFromBase64(b64Data, fileName) {
24251
24403
  }
24252
24404
  // write the ArrayBuffer to a blob, and you're done
24253
24405
  var bb = new Blob([ab], { type: mimeString });
24254
- if (typeof window !== "undefined" &&
24255
- window.navigator &&
24256
- window.navigator["msSaveBlob"]) {
24257
- window.navigator["msSaveOrOpenBlob"](bb, fileName);
24406
+ if (!!navigator && navigator["msSaveBlob"]) {
24407
+ navigator["msSaveOrOpenBlob"](bb, fileName);
24258
24408
  }
24259
24409
  }
24260
24410
  catch (err) { }
24261
24411
  }
24262
24412
  function isMobile() {
24263
- return (typeof window !== "undefined" && typeof window.orientation !== "undefined");
24413
+ return (_global_variables_utils__WEBPACK_IMPORTED_MODULE_3__["DomWindowHelper"].isAvailable() && _global_variables_utils__WEBPACK_IMPORTED_MODULE_3__["DomWindowHelper"].hasOwn("orientation"));
24264
24414
  }
24265
24415
  var isShadowDOM = function (rootElement) {
24266
24416
  return !!rootElement && !!("host" in rootElement && rootElement.host);
@@ -24279,7 +24429,7 @@ function isElementVisible(element, threshold) {
24279
24429
  ? root.host.clientHeight
24280
24430
  : root.documentElement.clientHeight;
24281
24431
  var elementRect = element.getBoundingClientRect();
24282
- var viewHeight = Math.max(clientHeight, window.innerHeight);
24432
+ var viewHeight = Math.max(clientHeight, _global_variables_utils__WEBPACK_IMPORTED_MODULE_3__["DomWindowHelper"].getInnerHeight());
24283
24433
  var topWin = -threshold;
24284
24434
  var bottomWin = viewHeight + threshold;
24285
24435
  var topEl = elementRect.top;
@@ -24321,9 +24471,10 @@ function scrollElementByChildId(id) {
24321
24471
  }
24322
24472
  }
24323
24473
  function navigateToUrl(url) {
24324
- if (!url || typeof window === "undefined" || !window.location)
24474
+ var location = _global_variables_utils__WEBPACK_IMPORTED_MODULE_3__["DomWindowHelper"].getLocation();
24475
+ if (!url || !location)
24325
24476
  return;
24326
- window.location.href = url;
24477
+ location.href = url;
24327
24478
  }
24328
24479
  function wrapUrlForBackgroundImage(url) {
24329
24480
  return !!url ? ["url(", url, ")"].join("") : "";
@@ -24353,7 +24504,7 @@ function createSvg(size, width, height, iconName, svgElem, title) {
24353
24504
  }
24354
24505
  else {
24355
24506
  if (!titleElement) {
24356
- titleElement = document.createElementNS("http://www.w3.org/2000/svg", "title");
24507
+ titleElement = _global_variables_utils__WEBPACK_IMPORTED_MODULE_3__["DomDocumentHelper"].getDocument().createElementNS("http://www.w3.org/2000/svg", "title");
24357
24508
  svgElem.appendChild(titleElement);
24358
24509
  }
24359
24510
  }
@@ -24460,7 +24611,7 @@ function increaseHeightByContent(element, getComputedStyle) {
24460
24611
  if (!element)
24461
24612
  return;
24462
24613
  if (!getComputedStyle)
24463
- getComputedStyle = function (elt) { return window.getComputedStyle(elt); };
24614
+ getComputedStyle = function (elt) { return _global_variables_utils__WEBPACK_IMPORTED_MODULE_3__["DomDocumentHelper"].getComputedStyle(elt); };
24464
24615
  var style = getComputedStyle(element);
24465
24616
  element.style.height = "auto";
24466
24617
  if (!!element.scrollHeight) {
@@ -24507,8 +24658,8 @@ function findParentByClassNames(element, classNames) {
24507
24658
  }
24508
24659
  function sanitizeEditableContent(element, cleanLineBreaks) {
24509
24660
  if (cleanLineBreaks === void 0) { cleanLineBreaks = true; }
24510
- if (window.getSelection && document.createRange && element.childNodes.length > 0) {
24511
- var selection = document.getSelection();
24661
+ if (_global_variables_utils__WEBPACK_IMPORTED_MODULE_3__["DomWindowHelper"].isAvailable() && _global_variables_utils__WEBPACK_IMPORTED_MODULE_3__["DomDocumentHelper"].isAvailable() && element.childNodes.length > 0) {
24662
+ var selection = _global_variables_utils__WEBPACK_IMPORTED_MODULE_3__["DomWindowHelper"].getSelection();
24512
24663
  if (selection.rangeCount == 0) {
24513
24664
  return;
24514
24665
  }
@@ -24526,14 +24677,19 @@ function sanitizeEditableContent(element, cleanLineBreaks) {
24526
24677
  }
24527
24678
  var tail_len = tail.length;
24528
24679
  element.innerText = innerText;
24529
- range = document.createRange();
24680
+ range = _global_variables_utils__WEBPACK_IMPORTED_MODULE_3__["DomDocumentHelper"].getDocument().createRange();
24530
24681
  range.setStart(element.firstChild, 0);
24531
24682
  range.setEnd(element.firstChild, 0);
24532
24683
  selection.removeAllRanges();
24533
24684
  selection.addRange(range);
24534
- for (var i = 0; i < innerText.length - tail_len; i++) {
24535
- selection.modify("move", "forward", "character");
24685
+ while (selection.toString().length < innerText.length - tail_len) {
24686
+ var selLen = selection.toString().length;
24687
+ selection.modify("extend", "forward", "character");
24688
+ if (selection.toString().length == selLen)
24689
+ break;
24536
24690
  }
24691
+ range = selection.getRangeAt(0);
24692
+ range.setStart(range.endContainer, range.endOffset);
24537
24693
  }
24538
24694
  }
24539
24695
  function mergeValues(src, dest) {
@@ -24602,11 +24758,11 @@ function configConfirmDialog(popupViewModel) {
24602
24758
  popupViewModel.width = "min-content";
24603
24759
  }
24604
24760
  function chooseFiles(input, callback) {
24605
- if (!window || !window["FileReader"])
24761
+ if (!_global_variables_utils__WEBPACK_IMPORTED_MODULE_3__["DomWindowHelper"].isFileReaderAvailable())
24606
24762
  return;
24607
24763
  input.value = "";
24608
24764
  input.onchange = function (event) {
24609
- if (!window["FileReader"])
24765
+ if (!_global_variables_utils__WEBPACK_IMPORTED_MODULE_3__["DomWindowHelper"].isFileReaderAvailable())
24610
24766
  return;
24611
24767
  if (!input || !input.files || input.files.length < 1)
24612
24768
  return;