survey-react-ui 1.9.137 → 1.9.139

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.137",
3
+ "version": "1.9.139",
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.137
2
+ * surveyjs - Survey JavaScript library v1.9.139
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
  */
@@ -188,9 +188,27 @@ var BaseAction = /** @class */ (function (_super) {
188
188
  __extends(BaseAction, _super);
189
189
  function BaseAction() {
190
190
  var _this = _super !== null && _super.apply(this, arguments) || this;
191
+ _this.rendredIdValue = BaseAction.getNextRendredId();
191
192
  _this.iconSize = 24;
192
193
  return _this;
193
194
  }
195
+ BaseAction.getNextRendredId = function () { return BaseAction.renderedId++; };
196
+ Object.defineProperty(BaseAction.prototype, "renderedId", {
197
+ get: function () { return this.rendredIdValue; },
198
+ enumerable: false,
199
+ configurable: true
200
+ });
201
+ Object.defineProperty(BaseAction.prototype, "owner", {
202
+ get: function () { return this.ownerValue; },
203
+ set: function (val) {
204
+ if (val !== this.owner) {
205
+ this.ownerValue = val;
206
+ this.locStrsChanged();
207
+ }
208
+ },
209
+ enumerable: false,
210
+ configurable: true
211
+ });
194
212
  Object.defineProperty(BaseAction.prototype, "visible", {
195
213
  get: function () {
196
214
  return this.getVisible();
@@ -315,6 +333,7 @@ var BaseAction = /** @class */ (function (_super) {
315
333
  }
316
334
  return args.isTrusted;
317
335
  };
336
+ BaseAction.renderedId = 1;
318
337
  __decorate([
319
338
  Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])()
320
339
  ], BaseAction.prototype, "tooltip", void 0);
@@ -3589,7 +3608,7 @@ __webpack_require__.r(__webpack_exports__);
3589
3608
 
3590
3609
 
3591
3610
 
3592
- Object(survey_core__WEBPACK_IMPORTED_MODULE_2__["checkLibraryVersion"])("" + "1.9.137", "survey-react-ui");
3611
+ Object(survey_core__WEBPACK_IMPORTED_MODULE_2__["checkLibraryVersion"])("" + "1.9.139", "survey-react-ui");
3593
3612
 
3594
3613
 
3595
3614
  /***/ }),
@@ -11542,7 +11561,7 @@ var englishStrings = {
11542
11561
  uploadingFile: "Your file is uploading. Please wait several seconds and try again.",
11543
11562
  loadingFile: "Loading...",
11544
11563
  chooseFile: "Choose file(s)...",
11545
- noFileChosen: "No file chosen",
11564
+ noFileChosen: "No file selected",
11546
11565
  filePlaceholder: "Drag and drop a file here or click the button below to select a file to upload.",
11547
11566
  confirmDelete: "Are you sure you want to delete this record?",
11548
11567
  keyDuplicationError: "This value should be unique.",
@@ -11572,6 +11591,7 @@ var englishStrings = {
11572
11591
  timerLimitSurvey: "You have spent {0} of {1} in total.",
11573
11592
  clearCaption: "Clear",
11574
11593
  signaturePlaceHolder: "Sign here",
11594
+ signaturePlaceHolderReadOnly: "No signature",
11575
11595
  chooseFileCaption: "Select File",
11576
11596
  takePhotoCaption: "Take Photo",
11577
11597
  photoPlaceholder: "Click the button below to take a photo using the camera.",
@@ -11588,7 +11608,7 @@ var englishStrings = {
11588
11608
  filterStringPlaceholder: "Type to search...",
11589
11609
  emptyMessage: "No data to display",
11590
11610
  noEntriesText: "No entries yet.\nClick the button below to add a new entry.",
11591
- noEntriesReadonlyText: "No entries.",
11611
+ noEntriesReadonlyText: "No entries",
11592
11612
  more: "More",
11593
11613
  tagboxDoneButtonCaption: "OK",
11594
11614
  selectToRankEmptyRankedAreaText: "All choices are selected for ranking",
@@ -11925,9 +11945,14 @@ var SurveyQuestionBooleanRadio = /** @class */ (function (_super) {
11925
11945
  SurveyQuestionBooleanRadio.prototype.renderElement = function () {
11926
11946
  var cssClasses = this.question.cssClasses;
11927
11947
  return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: cssClasses.rootRadio },
11928
- react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("fieldset", { role: "presentation", className: cssClasses.radioFieldset },
11929
- this.renderRadioItem(false, this.question.locLabelFalse),
11930
- this.renderRadioItem(true, this.question.locLabelTrue))));
11948
+ react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("fieldset", { role: "presentation", className: cssClasses.radioFieldset }, !this.question.swapOrder ?
11949
+ (react__WEBPACK_IMPORTED_MODULE_0__["createElement"](react__WEBPACK_IMPORTED_MODULE_0__["Fragment"], null,
11950
+ this.renderRadioItem(false, this.question.locLabelFalse),
11951
+ this.renderRadioItem(true, this.question.locLabelTrue)))
11952
+ :
11953
+ (react__WEBPACK_IMPORTED_MODULE_0__["createElement"](react__WEBPACK_IMPORTED_MODULE_0__["Fragment"], null,
11954
+ this.renderRadioItem(true, this.question.locLabelTrue),
11955
+ this.renderRadioItem(false, this.question.locLabelFalse))))));
11931
11956
  };
11932
11957
  return SurveyQuestionBooleanRadio;
11933
11958
  }(_boolean__WEBPACK_IMPORTED_MODULE_3__["SurveyQuestionBoolean"]));
@@ -12692,7 +12717,7 @@ var SurveyFilePreview = /** @class */ (function (_super) {
12692
12717
  var previews = this.question.previewValue.map(function (val, index) {
12693
12718
  if (!val)
12694
12719
  return null;
12695
- return (react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", { key: _this.question.inputId + "_" + index, className: _this.question.cssClasses.preview, style: { display: _this.question.isPreviewVisible(index) ? undefined : "none" } },
12720
+ return (react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", { key: _this.question.inputId + "_" + index, className: _this.question.cssClasses.previewItem, style: { display: _this.question.isPreviewVisible(index) ? undefined : "none" } },
12696
12721
  _this.renderFileSign(_this.question.cssClasses.fileSign, val),
12697
12722
  react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { className: _this.question.getImageWrapperCss(val) },
12698
12723
  _this.question.canPreviewImage(val) ? (react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("img", { src: val.content, style: { height: _this.question.imageHeight, width: _this.question.imageWidth }, alt: "File preview" })) : (_this.question.cssClasses.defaultImage ? (react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_svg_icon_svg_icon__WEBPACK_IMPORTED_MODULE_2__["SvgIcon"], { iconName: _this.question.cssClasses.defaultImageIconId, size: "auto", className: _this.question.cssClasses.defaultImage })) : null),
@@ -12954,7 +12979,7 @@ var ListItem = /** @class */ (function (_super) {
12954
12979
  event.stopPropagation();
12955
12980
  }, onPointerDown: function (event) { return _this.model.onPointerDown(event, _this.item); } },
12956
12981
  separator,
12957
- contentWrap));
12982
+ contentWrap), this.item);
12958
12983
  };
12959
12984
  ListItem.prototype.componentDidMount = function () {
12960
12985
  _super.prototype.componentDidMount.call(this);
@@ -20208,8 +20233,8 @@ var SurveyQuestionPanelDynamic = /** @class */ (function (_super) {
20208
20233
  SurveyQuestionPanelDynamic.prototype.renderElement = function () {
20209
20234
  var panels = [];
20210
20235
  if (this.question.isRenderModeList) {
20211
- for (var i = 0; i < this.question.panels.length; i++) {
20212
- var panel = this.question.panels[i];
20236
+ for (var i = 0; i < this.question.visiblePanels.length; i++) {
20237
+ var panel = this.question.visiblePanels[i];
20213
20238
  panels.push(react__WEBPACK_IMPORTED_MODULE_0__["createElement"](SurveyQuestionPanelDynamicItem, { key: panel.id, element: panel, question: this.question, index: i, cssClasses: this.question.cssClasses, isDisplayMode: this.isDisplayMode, creator: this.creator }));
20214
20239
  }
20215
20240
  }
@@ -20692,12 +20717,12 @@ var SurveyQuestionRanking = /** @class */ (function (_super) {
20692
20717
  return items;
20693
20718
  };
20694
20719
  SurveyQuestionRanking.prototype.renderItem = function (item, i, handleKeydown, handlePointerDown, cssClasses, itemClass, question, unrankedItem) {
20695
- var key = item.value + "-" + i + "-item";
20720
+ var key = "id-" + item.renderedId;
20696
20721
  var text = this.renderLocString(item.locText);
20697
20722
  var index = i;
20698
- var indexText = this.question.getNumberByIndex(i);
20723
+ var indexText = this.question.getNumberByIndex(index);
20699
20724
  var tabIndex = this.question.getItemTabIndex(item);
20700
- var renderedItem = (react__WEBPACK_IMPORTED_MODULE_0__["createElement"](SurveyQuestionRankingItem, { key: key, text: text, index: index, indexText: indexText, itemTabIndex: tabIndex, handleKeydown: handleKeydown, handlePointerDown: handlePointerDown, cssClasses: cssClasses, itemClass: itemClass, question: question, unrankedItem: unrankedItem, item: item }));
20725
+ var renderedItem = (react__WEBPACK_IMPORTED_MODULE_0__["createElement"](SurveyQuestionRankingItem, { key: item.value, text: text, index: index, indexText: indexText, itemTabIndex: tabIndex, handleKeydown: handleKeydown, handlePointerDown: handlePointerDown, cssClasses: cssClasses, itemClass: itemClass, question: question, unrankedItem: unrankedItem, item: item }));
20701
20726
  var survey = this.question.survey;
20702
20727
  var wrappedItem = null;
20703
20728
  if (!!survey) {
@@ -21447,7 +21472,7 @@ var SurveyQuestionSignaturePad = /** @class */ (function (_super) {
21447
21472
  var loadingIndicator = this.question.showLoadingIndicator ? this.renderLoadingIndicator() : null;
21448
21473
  var clearButton = this.renderCleanButton();
21449
21474
  return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: cssClasses.root, ref: function (root) { return (_this.setControl(root)); }, style: { width: this.question.renderedCanvasWidth } },
21450
- react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: cssClasses.placeholder, style: { display: this.question.needShowPlaceholder() ? "" : "none" } }, this.renderLocString(this.question.locPlaceholder)),
21475
+ react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: cssClasses.placeholder, style: { display: this.question.needShowPlaceholder() ? "" : "none" } }, this.renderLocString(this.question.locRenderedPlaceholder)),
21451
21476
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", null,
21452
21477
  this.renderBackgroundImage(),
21453
21478
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("canvas", { tabIndex: -1, className: this.question.cssClasses.canvas, onBlur: this.question.onBlur })),
@@ -23728,11 +23753,14 @@ var SurveyElement = /** @class */ (function (_super) {
23728
23753
  enumerable: false,
23729
23754
  configurable: true
23730
23755
  });
23756
+ SurveyElement.prototype.canHaveFrameStyles = function () {
23757
+ return (this.parent !== undefined && (!this.hasParent || this.parent && this.parent.showPanelAsPage));
23758
+ };
23731
23759
  SurveyElement.prototype.getHasFrameV2 = function () {
23732
- return this.shouldAddRunnerStyles() && (!this.hasParent);
23760
+ return this.shouldAddRunnerStyles() && this.canHaveFrameStyles();
23733
23761
  };
23734
23762
  SurveyElement.prototype.getIsNested = function () {
23735
- return this.shouldAddRunnerStyles() && (this.hasParent);
23763
+ return this.shouldAddRunnerStyles() && !this.canHaveFrameStyles();
23736
23764
  };
23737
23765
  SurveyElement.prototype.getCssRoot = function (cssClasses) {
23738
23766
  var isExpanadable = !!this.isCollapsed || !!this.isExpanded;
@@ -23952,9 +23980,31 @@ var SurveyElement = /** @class */ (function (_super) {
23952
23980
  .append(cssClasses.titleExpandable, isExpandable)
23953
23981
  .append(cssClasses.titleExpanded, this.isExpanded)
23954
23982
  .append(cssClasses.titleCollapsed, this.isCollapsed)
23955
- .append(cssClasses.titleDisabled, this.isReadOnly)
23983
+ .append(cssClasses.titleDisabled, this.isDisabledStyle)
23984
+ .append(cssClasses.titleReadOnly, this.isReadOnly)
23956
23985
  .append(cssClasses.titleOnError, this.containsErrors).toString();
23957
23986
  };
23987
+ Object.defineProperty(SurveyElement.prototype, "isDisabledStyle", {
23988
+ get: function () {
23989
+ return !this.isDefaultV2Theme && (this.isReadOnlyStyle || this.isPreviewStyle);
23990
+ },
23991
+ enumerable: false,
23992
+ configurable: true
23993
+ });
23994
+ Object.defineProperty(SurveyElement.prototype, "isReadOnlyStyle", {
23995
+ get: function () {
23996
+ return this.isReadOnly && !this.isPreviewStyle;
23997
+ },
23998
+ enumerable: false,
23999
+ configurable: true
24000
+ });
24001
+ Object.defineProperty(SurveyElement.prototype, "isPreviewStyle", {
24002
+ get: function () {
24003
+ return !!this.survey && this.survey.state === "preview";
24004
+ },
24005
+ enumerable: false,
24006
+ configurable: true
24007
+ });
23958
24008
  SurveyElement.prototype.localeChanged = function () {
23959
24009
  _super.prototype.localeChanged.call(this);
23960
24010
  this.updateDescriptionVisibility(this.description);
@@ -24200,7 +24250,8 @@ __webpack_require__.r(__webpack_exports__);
24200
24250
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AnimationGroupUtils", function() { return AnimationGroupUtils; });
24201
24251
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AnimationBoolean", function() { return AnimationBoolean; });
24202
24252
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AnimationGroup", function() { return AnimationGroup; });
24203
- /* harmony import */ var _taskmanager__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./taskmanager */ "./src/utils/taskmanager.ts");
24253
+ /* harmony import */ var _global_variables_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../global_variables_utils */ "./src/global_variables_utils.ts");
24254
+ /* harmony import */ var _taskmanager__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./taskmanager */ "./src/utils/taskmanager.ts");
24204
24255
  var __extends = (undefined && undefined.__extends) || (function () {
24205
24256
  var extendStatics = function (d, b) {
24206
24257
  extendStatics = Object.setPrototypeOf ||
@@ -24217,6 +24268,7 @@ var __extends = (undefined && undefined.__extends) || (function () {
24217
24268
  };
24218
24269
  })();
24219
24270
 
24271
+
24220
24272
  var AnimationUtils = /** @class */ (function () {
24221
24273
  function AnimationUtils() {
24222
24274
  this.cancelQueue = [];
@@ -24285,8 +24337,8 @@ var AnimationUtils = /** @class */ (function () {
24285
24337
  element.classList.remove(options.cssClass);
24286
24338
  }
24287
24339
  else {
24288
- requestAnimationFrame(function () {
24289
- requestAnimationFrame(function () {
24340
+ _global_variables_utils__WEBPACK_IMPORTED_MODULE_0__["DomWindowHelper"].requestAnimationFrame(function () {
24341
+ _global_variables_utils__WEBPACK_IMPORTED_MODULE_0__["DomWindowHelper"].requestAnimationFrame(function () {
24290
24342
  element.classList.remove(options.cssClass);
24291
24343
  });
24292
24344
  });
@@ -24307,7 +24359,8 @@ var AnimationUtils = /** @class */ (function () {
24307
24359
  }
24308
24360
  };
24309
24361
  AnimationUtils.prototype.cancel = function () {
24310
- this.cancelQueue.forEach(function (func) { return func(); });
24362
+ var cancelQueue = [].concat(this.cancelQueue);
24363
+ cancelQueue.forEach(function (callback) { return callback(); });
24311
24364
  this.cancelQueue = [];
24312
24365
  };
24313
24366
  return AnimationUtils;
@@ -24325,12 +24378,12 @@ var AnimationPropertyUtils = /** @class */ (function (_super) {
24325
24378
  _this.beforeAnimationRun(element, options);
24326
24379
  _this.runEnterAnimation(element, options);
24327
24380
  };
24328
- requestAnimationFrame(function () {
24381
+ _global_variables_utils__WEBPACK_IMPORTED_MODULE_0__["DomWindowHelper"].requestAnimationFrame(function () {
24329
24382
  if (getElement()) {
24330
24383
  callback();
24331
24384
  }
24332
24385
  else {
24333
- requestAnimationFrame(callback);
24386
+ _global_variables_utils__WEBPACK_IMPORTED_MODULE_0__["DomWindowHelper"].requestAnimationFrame(callback);
24334
24387
  }
24335
24388
  });
24336
24389
  };
@@ -24351,7 +24404,7 @@ var AnimationGroupUtils = /** @class */ (function (_super) {
24351
24404
  var _this = this;
24352
24405
  if (elements.length == 0)
24353
24406
  return;
24354
- requestAnimationFrame(function () {
24407
+ _global_variables_utils__WEBPACK_IMPORTED_MODULE_0__["DomWindowHelper"].requestAnimationFrame(function () {
24355
24408
  var callback = function () {
24356
24409
  elements.forEach(function (el) {
24357
24410
  _this.beforeAnimationRun(getElement(el), getOptions(el));
@@ -24361,7 +24414,7 @@ var AnimationGroupUtils = /** @class */ (function (_super) {
24361
24414
  });
24362
24415
  };
24363
24416
  if (!getElement(elements[0])) {
24364
- requestAnimationFrame(callback);
24417
+ _global_variables_utils__WEBPACK_IMPORTED_MODULE_0__["DomWindowHelper"].requestAnimationFrame(callback);
24365
24418
  }
24366
24419
  else {
24367
24420
  callback();
@@ -24392,7 +24445,7 @@ var AnimationProperty = /** @class */ (function () {
24392
24445
  this.animationOptions = animationOptions;
24393
24446
  this.update = update;
24394
24447
  this.getCurrentValue = getCurrentValue;
24395
- this._debouncedSync = Object(_taskmanager__WEBPACK_IMPORTED_MODULE_0__["debounce"])(function (newValue) {
24448
+ this._debouncedSync = Object(_taskmanager__WEBPACK_IMPORTED_MODULE_1__["debounce"])(function (newValue) {
24396
24449
  _this.animation.cancel();
24397
24450
  _this._sync(newValue);
24398
24451
  });