survey-react-ui 1.9.132 → 1.9.134

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.132",
3
+ "version": "1.9.134",
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.132
2
+ * surveyjs - Survey JavaScript library v1.9.134
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
  */
@@ -495,6 +495,7 @@ var Action = /** @class */ (function (_super) {
495
495
  return this._component;
496
496
  };
497
497
  Action.prototype.dispose = function () {
498
+ this.updateCallback = undefined;
498
499
  this.action = undefined;
499
500
  _super.prototype.dispose.call(this);
500
501
  if (this.popupModel) {
@@ -3584,7 +3585,7 @@ __webpack_require__.r(__webpack_exports__);
3584
3585
 
3585
3586
 
3586
3587
 
3587
- Object(survey_core__WEBPACK_IMPORTED_MODULE_2__["checkLibraryVersion"])("" + "1.9.132", "survey-react-ui");
3588
+ Object(survey_core__WEBPACK_IMPORTED_MODULE_2__["checkLibraryVersion"])("" + "1.9.134", "survey-react-ui");
3588
3589
 
3589
3590
 
3590
3591
  /***/ }),
@@ -7620,9 +7621,11 @@ function age(params) {
7620
7621
  var birthDate = new Date(params[0]);
7621
7622
  var today = new Date();
7622
7623
  var age = today.getFullYear() - birthDate.getFullYear();
7623
- var m = today.getMonth() - birthDate.getMonth();
7624
- if (m < 0 || (m === 0 && today.getDate() < birthDate.getDate())) {
7625
- age -= age > 0 ? 1 : 0;
7624
+ if (age > 0) {
7625
+ var m = today.getMonth() - birthDate.getMonth();
7626
+ if (m < 0 || (m === 0 && today.getDate() < birthDate.getDate())) {
7627
+ age -= 1;
7628
+ }
7626
7629
  }
7627
7630
  return age;
7628
7631
  }
@@ -12230,6 +12233,19 @@ var SurveyActionBar = /** @class */ (function (_super) {
12230
12233
  this.model.resetResponsivityManager();
12231
12234
  }
12232
12235
  };
12236
+ SurveyActionBar.prototype.componentDidUpdate = function (prevProps, prevState) {
12237
+ _super.prototype.componentDidUpdate.call(this, prevProps, prevState);
12238
+ if (prevProps.model == this.props.model) {
12239
+ return;
12240
+ }
12241
+ if (!!this.model.hasActions) {
12242
+ this.model.resetResponsivityManager();
12243
+ var container = this.rootRef.current;
12244
+ if (!!container) {
12245
+ this.model.initResponsivityManager(container, function (callback) { setTimeout(callback); });
12246
+ }
12247
+ }
12248
+ };
12233
12249
  SurveyActionBar.prototype.getStateElement = function () {
12234
12250
  return this.model;
12235
12251
  };
@@ -16378,7 +16394,7 @@ var SurveyProgressButtons = /** @class */ (function (_super) {
16378
16394
  };
16379
16395
  SurveyProgressButtons.prototype.render = function () {
16380
16396
  var _this = this;
16381
- return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.model.getRootCss(this.props.container), role: "progressbar", "aria-valuemin": 0, "aria-valuemax": 100, "aria-label": "progress" },
16397
+ return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.model.getRootCss(this.props.container), style: { "maxWidth": this.model.progressWidth }, role: "progressbar", "aria-valuemin": 0, "aria-valuemax": 100, "aria-label": "progress" },
16382
16398
  this.state.canShowHeader ? react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.css.progressButtonsHeader },
16383
16399
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.css.progressButtonsPageTitle, title: this.model.headerText }, this.model.headerText)) : null,
16384
16400
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.css.progressButtonsContainer },
@@ -20855,7 +20871,7 @@ var SurveyQuestionText = /** @class */ (function (_super) {
20855
20871
  var inputClass = this.question.getControlClass();
20856
20872
  var placeholder = this.question.renderedPlaceholder;
20857
20873
  if (this.question.isReadOnlyRenderDiv()) {
20858
- return react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", null, this.question.value);
20874
+ return react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", null, this.question.inputValue);
20859
20875
  }
20860
20876
  var counter = !!this.question.getMaxLength() ? (react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_components_character_counter__WEBPACK_IMPORTED_MODULE_3__["CharacterCounterComponent"], { counter: this.question.characterCounter, remainingCharacterCounter: this.question.cssClasses.remainingCharacterCounter })) : null;
20861
20877
  return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"](react__WEBPACK_IMPORTED_MODULE_0__["Fragment"], null,
@@ -20871,6 +20887,12 @@ var SurveyQuestionText = /** @class */ (function (_super) {
20871
20887
  this.renderDataList()) :
20872
20888
  this.renderInput());
20873
20889
  };
20890
+ SurveyQuestionText.prototype.setValueCore = function (newValue) {
20891
+ this.question.inputValue = newValue;
20892
+ };
20893
+ SurveyQuestionText.prototype.getValueCore = function () {
20894
+ return this.question.inputValue;
20895
+ };
20874
20896
  SurveyQuestionText.prototype.renderDataList = function () {
20875
20897
  if (!this.question.dataListId)
20876
20898
  return null;
@@ -22422,7 +22444,16 @@ var settings = {
22422
22444
  "impp",
22423
22445
  ]
22424
22446
  },
22425
- legacyProgressBarView: false
22447
+ legacyProgressBarView: false,
22448
+ maskSettings: {
22449
+ patternPlaceholderChar: "_",
22450
+ patternEscapeChar: "\\",
22451
+ patternDefinitions: {
22452
+ "9": /[0-9]/,
22453
+ "a": /[a-zA-Z]/,
22454
+ "#": /[a-zA-Z0-9]/
22455
+ }
22456
+ }
22426
22457
  };
22427
22458
 
22428
22459
 
@@ -22692,13 +22723,25 @@ var SurveyElement = /** @class */ (function (_super) {
22692
22723
  if (!elementId || typeof root === "undefined")
22693
22724
  return false;
22694
22725
  var el = root.getElementById(elementId);
22726
+ return SurveyElement.ScrollElementToViewCore(el, false, scrollIfVisible);
22727
+ };
22728
+ SurveyElement.ScrollElementToViewCore = function (el, checkLeft, scrollIfVisible) {
22695
22729
  if (!el || !el.scrollIntoView)
22696
22730
  return false;
22697
- var elemTop = scrollIfVisible ? -1 : el.getBoundingClientRect().top;
22698
- var needScroll = elemTop < 0;
22699
- if (!needScroll && !!window) {
22731
+ var elTop = scrollIfVisible ? -1 : el.getBoundingClientRect().top;
22732
+ var needScroll = elTop < 0;
22733
+ var elLeft = -1;
22734
+ if (!needScroll && checkLeft) {
22735
+ elLeft = el.getBoundingClientRect().left;
22736
+ needScroll = elLeft < 0;
22737
+ }
22738
+ if (!!window && !needScroll) {
22700
22739
  var height = window.innerHeight;
22701
- needScroll = height > 0 && height < elemTop;
22740
+ needScroll = height > 0 && height < elTop;
22741
+ if (!needScroll && checkLeft) {
22742
+ var width = window.innerWidth;
22743
+ needScroll = width > 0 && width < elLeft;
22744
+ }
22702
22745
  }
22703
22746
  if (needScroll) {
22704
22747
  el.scrollIntoView();
@@ -22741,6 +22784,7 @@ var SurveyElement = /** @class */ (function (_super) {
22741
22784
  var el = root.getElementById(elementId);
22742
22785
  // https://stackoverflow.com/questions/19669786/check-if-element-is-visible-in-dom
22743
22786
  if (el && !el["disabled"] && el.style.display !== "none" && el.offsetParent !== null) {
22787
+ SurveyElement.ScrollElementToViewCore(el, true, false);
22744
22788
  el.focus();
22745
22789
  return true;
22746
22790
  }