survey-react-ui 1.9.128 → 1.9.130

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.128",
3
+ "version": "1.9.130",
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.128
2
+ * surveyjs - Survey JavaScript library v1.9.130
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
  */
@@ -817,18 +817,23 @@ var Base = /** @class */ (function () {
817
817
  configurable: true
818
818
  });
819
819
  Base.prototype.doPropertyValueChangedCallback = function (name, oldValue, newValue, arrayChanges, target) {
820
- if (this.isInternal)
820
+ var fireCallback = function (obj) {
821
+ if (!!obj && !!obj.onPropertyValueChangedCallback) {
822
+ obj.onPropertyValueChangedCallback(name, oldValue, newValue, target, arrayChanges);
823
+ }
824
+ };
825
+ if (this.isInternal) {
826
+ fireCallback(this);
821
827
  return;
828
+ }
822
829
  if (!target)
823
830
  target = this;
824
831
  var notifier = this.getSurvey();
825
832
  if (!notifier)
826
833
  notifier = this;
827
- if (!!notifier.onPropertyValueChangedCallback) {
828
- notifier.onPropertyValueChangedCallback(name, oldValue, newValue, target, arrayChanges);
829
- }
830
- if (notifier !== this && !!this.onPropertyValueChangedCallback) {
831
- this.onPropertyValueChangedCallback(name, oldValue, newValue, target, arrayChanges);
834
+ fireCallback(notifier);
835
+ if (notifier !== this) {
836
+ fireCallback(this);
832
837
  }
833
838
  };
834
839
  Base.prototype.addExpressionProperty = function (name, onExecute, canRun) {
@@ -2620,7 +2625,7 @@ __webpack_require__.r(__webpack_exports__);
2620
2625
 
2621
2626
 
2622
2627
 
2623
- Object(survey_core__WEBPACK_IMPORTED_MODULE_2__["checkLibraryVersion"])("" + "1.9.128", "survey-react-ui");
2628
+ Object(survey_core__WEBPACK_IMPORTED_MODULE_2__["checkLibraryVersion"])("" + "1.9.130", "survey-react-ui");
2624
2629
 
2625
2630
 
2626
2631
  /***/ }),
@@ -6798,6 +6803,21 @@ function propertyValue(params) {
6798
6803
  return q ? q[params[1]] : undefined;
6799
6804
  }
6800
6805
  FunctionFactory.Instance.register("propertyValue", propertyValue);
6806
+ function substring_(params) {
6807
+ if (params.length < 2)
6808
+ return "";
6809
+ var s = params[0];
6810
+ if (!s || typeof s !== "string")
6811
+ return "";
6812
+ var start = params[1];
6813
+ if (!_helpers__WEBPACK_IMPORTED_MODULE_0__["Helpers"].isNumber(start))
6814
+ return "";
6815
+ var end = params.length > 2 ? params[2] : undefined;
6816
+ if (!_helpers__WEBPACK_IMPORTED_MODULE_0__["Helpers"].isNumber(end))
6817
+ return s.substring(start);
6818
+ return s.substring(start, end);
6819
+ }
6820
+ FunctionFactory.Instance.register("substring", substring_);
6801
6821
 
6802
6822
 
6803
6823
  /***/ }),
@@ -7696,22 +7716,32 @@ var JsonObjectProperty = /** @class */ (function () {
7696
7716
  enumerable: false,
7697
7717
  configurable: true
7698
7718
  });
7719
+ JsonObjectProperty.prototype.isEnable = function (obj) {
7720
+ if (this.readOnly)
7721
+ return false;
7722
+ if (!obj || !this.enableIf)
7723
+ return true;
7724
+ return this.enableIf(this.getOriginalObj(obj));
7725
+ };
7699
7726
  JsonObjectProperty.prototype.isVisible = function (layout, obj) {
7700
7727
  if (obj === void 0) { obj = null; }
7701
7728
  var isLayout = !this.layout || this.layout == layout;
7702
7729
  if (!this.visible || !isLayout)
7703
7730
  return false;
7704
7731
  if (!!this.visibleIf && !!obj) {
7705
- if (obj.getOriginalObj) {
7706
- var orjObj = obj.getOriginalObj();
7707
- if (orjObj && Serializer.findProperty(orjObj.getType(), this.name)) {
7708
- obj = orjObj;
7709
- }
7710
- }
7711
- return this.visibleIf(obj);
7732
+ return this.visibleIf(this.getOriginalObj(obj));
7712
7733
  }
7713
7734
  return true;
7714
7735
  };
7736
+ JsonObjectProperty.prototype.getOriginalObj = function (obj) {
7737
+ if (obj && obj.getOriginalObj) {
7738
+ var orjObj = obj.getOriginalObj();
7739
+ if (orjObj && Serializer.findProperty(orjObj.getType(), this.name)) {
7740
+ return orjObj;
7741
+ }
7742
+ }
7743
+ return obj;
7744
+ };
7715
7745
  Object.defineProperty(JsonObjectProperty.prototype, "visible", {
7716
7746
  get: function () {
7717
7747
  return this.visibleValue != null ? this.visibleValue : true;
@@ -7723,14 +7753,21 @@ var JsonObjectProperty = /** @class */ (function () {
7723
7753
  configurable: true
7724
7754
  });
7725
7755
  JsonObjectProperty.prototype.isAvailableInVersion = function (ver) {
7726
- if (!!this.alternativeName)
7756
+ if (!!this.alternativeName || this.oldName)
7727
7757
  return true;
7728
7758
  return this.isAvailableInVersionCore(ver);
7729
7759
  };
7730
7760
  JsonObjectProperty.prototype.getSerializedName = function (ver) {
7731
7761
  if (!this.alternativeName)
7732
7762
  return this.name;
7733
- return this.isAvailableInVersionCore(ver) ? this.name : this.alternativeName;
7763
+ return this.isAvailableInVersionCore(ver) ? this.name : this.alternativeName || this.oldName;
7764
+ };
7765
+ JsonObjectProperty.prototype.getSerializedProperty = function (obj, ver) {
7766
+ if (!this.oldName || this.isAvailableInVersionCore(ver))
7767
+ return this;
7768
+ if (!obj || !obj.getType)
7769
+ return null;
7770
+ return Serializer.findProperty(obj.getType(), this.oldName);
7734
7771
  };
7735
7772
  JsonObjectProperty.prototype.isAvailableInVersionCore = function (ver) {
7736
7773
  if (!ver || !this.version)
@@ -7816,6 +7853,7 @@ var JsonObjectProperty = /** @class */ (function () {
7816
7853
  "isLocalizableValue",
7817
7854
  "className",
7818
7855
  "alternativeName",
7856
+ "oldName",
7819
7857
  "layout",
7820
7858
  "version",
7821
7859
  "classNamePart",
@@ -7835,6 +7873,7 @@ var JsonObjectProperty = /** @class */ (function () {
7835
7873
  "showMode",
7836
7874
  "dependedProperties",
7837
7875
  "visibleIf",
7876
+ "enableIf",
7838
7877
  "onExecuteExpression",
7839
7878
  "onPropertyEditorUpdate",
7840
7879
  "maxLength",
@@ -8153,7 +8192,7 @@ var JsonMetadataClass = /** @class */ (function () {
8153
8192
  if (!_helpers__WEBPACK_IMPORTED_MODULE_2__["Helpers"].isValueEmpty(propInfo.maxLength)) {
8154
8193
  prop.maxLength = propInfo.maxLength;
8155
8194
  }
8156
- if (!_helpers__WEBPACK_IMPORTED_MODULE_2__["Helpers"].isValueEmpty(propInfo.displayName)) {
8195
+ if (propInfo.displayName !== undefined) {
8157
8196
  prop.displayName = propInfo.displayName;
8158
8197
  }
8159
8198
  if (!_helpers__WEBPACK_IMPORTED_MODULE_2__["Helpers"].isValueEmpty(propInfo.category)) {
@@ -8204,6 +8243,9 @@ var JsonMetadataClass = /** @class */ (function () {
8204
8243
  if (!!propInfo.visibleIf) {
8205
8244
  prop.visibleIf = propInfo.visibleIf;
8206
8245
  }
8246
+ if (!!propInfo.enableIf) {
8247
+ prop.enableIf = propInfo.enableIf;
8248
+ }
8207
8249
  if (!!propInfo.onExecuteExpression) {
8208
8250
  prop.onExecuteExpression = propInfo.onExecuteExpression;
8209
8251
  }
@@ -8263,6 +8305,9 @@ var JsonMetadataClass = /** @class */ (function () {
8263
8305
  if (propInfo.alternativeName) {
8264
8306
  prop.alternativeName = propInfo.alternativeName;
8265
8307
  }
8308
+ if (propInfo.oldName) {
8309
+ prop.oldName = propInfo.oldName;
8310
+ }
8266
8311
  if (propInfo.layout) {
8267
8312
  prop.layout = propInfo.layout;
8268
8313
  }
@@ -8325,11 +8370,11 @@ var JsonMetadata = /** @class */ (function () {
8325
8370
  this.dynamicPropsCache = {};
8326
8371
  }
8327
8372
  JsonMetadata.prototype.getObjPropertyValue = function (obj, name) {
8328
- if (this.isObjWrapper(obj)) {
8373
+ if (this.isObjWrapper(obj) && this.isNeedUseObjWrapper(obj, name)) {
8329
8374
  var orignalObj = obj.getOriginalObj();
8330
- var prop = Serializer.findProperty(orignalObj.getType(), name);
8331
- if (!!prop)
8332
- return this.getObjPropertyValueCore(orignalObj, prop);
8375
+ var prop_1 = Serializer.findProperty(orignalObj.getType(), name);
8376
+ if (!!prop_1)
8377
+ return this.getObjPropertyValueCore(orignalObj, prop_1);
8333
8378
  }
8334
8379
  var prop = Serializer.findProperty(obj.getType(), name);
8335
8380
  if (!prop)
@@ -8366,6 +8411,18 @@ var JsonMetadata = /** @class */ (function () {
8366
8411
  JsonMetadata.prototype.isObjWrapper = function (obj) {
8367
8412
  return !!obj.getOriginalObj && !!obj.getOriginalObj();
8368
8413
  };
8414
+ JsonMetadata.prototype.isNeedUseObjWrapper = function (obj, name) {
8415
+ if (!obj.getDynamicProperties)
8416
+ return true;
8417
+ var props = obj.getDynamicProperties();
8418
+ if (!Array.isArray(props))
8419
+ return false;
8420
+ for (var i = 0; i < props.length; i++) {
8421
+ if (props[i].name === name)
8422
+ return true;
8423
+ }
8424
+ return false;
8425
+ };
8369
8426
  JsonMetadata.prototype.addClass = function (name, properties, creator, parentName) {
8370
8427
  if (creator === void 0) { creator = null; }
8371
8428
  if (parentName === void 0) { parentName = null; }
@@ -9067,6 +9124,14 @@ var JsonObject = /** @class */ (function () {
9067
9124
  return;
9068
9125
  if (options.version && !prop.isAvailableInVersion(options.version))
9069
9126
  return;
9127
+ this.valueToJsonCore(obj, result, prop, options);
9128
+ };
9129
+ JsonObject.prototype.valueToJsonCore = function (obj, result, prop, options) {
9130
+ var serProp = prop.getSerializedProperty(obj, options.version);
9131
+ if (serProp && serProp !== prop) {
9132
+ this.valueToJsonCore(obj, result, serProp, options);
9133
+ return;
9134
+ }
9070
9135
  var value = prop.getSerializableValue(obj);
9071
9136
  if (!options.storeDefaults && prop.isDefaultValueByObj(obj, value))
9072
9137
  return;
@@ -9130,9 +9195,7 @@ var JsonObject = /** @class */ (function () {
9130
9195
  JsonObject.prototype.removePosOnValueToJson = function (property, value) {
9131
9196
  if (!property.isCustom || !value)
9132
9197
  return value;
9133
- if (!!value[JsonObject.positionPropertyName]) {
9134
- delete value[JsonObject.positionPropertyName];
9135
- }
9198
+ this.removePosFromObj(value);
9136
9199
  return value;
9137
9200
  };
9138
9201
  JsonObject.prototype.removePos = function (property, value) {
@@ -9148,9 +9211,14 @@ var JsonObject = /** @class */ (function () {
9148
9211
  this.removePosFromObj(obj[i]);
9149
9212
  }
9150
9213
  }
9214
+ if (typeof obj !== "object")
9215
+ return;
9151
9216
  if (!!obj[JsonObject.positionPropertyName]) {
9152
9217
  delete obj[JsonObject.positionPropertyName];
9153
9218
  }
9219
+ for (var key in obj) {
9220
+ this.removePosFromObj(obj[key]);
9221
+ }
9154
9222
  };
9155
9223
  JsonObject.prototype.isValueArray = function (value) {
9156
9224
  return value && Array.isArray(value);
@@ -9607,7 +9675,11 @@ var LocalizableString = /** @class */ (function () {
9607
9675
  keys[0] == _settings__WEBPACK_IMPORTED_MODULE_2__["settings"].localization.defaultLocaleName &&
9608
9676
  !_settings__WEBPACK_IMPORTED_MODULE_2__["settings"].serialization.localizableStringSerializeAsObject)
9609
9677
  return this.values[keys[0]];
9610
- return this.values;
9678
+ var res = {};
9679
+ for (var key in this.values) {
9680
+ res[key] = this.values[key];
9681
+ }
9682
+ return res;
9611
9683
  };
9612
9684
  LocalizableString.prototype.setJson = function (value) {
9613
9685
  if (!!this.sharedData) {
@@ -9953,7 +10025,7 @@ var englishStrings = {
9953
10025
  chooseFile: "Choose file(s)...",
9954
10026
  noFileChosen: "No file chosen",
9955
10027
  filePlaceholder: "Drag and drop a file here or click the button below to select a file to upload.",
9956
- confirmDelete: "Do you want to delete the record?",
10028
+ confirmDelete: "Are you sure you want to delete this record?",
9957
10029
  keyDuplicationError: "This value should be unique.",
9958
10030
  addColumn: "Add Column",
9959
10031
  addRow: "Add Row",
@@ -9996,12 +10068,12 @@ var englishStrings = {
9996
10068
  modalApplyButtonText: "Apply",
9997
10069
  filterStringPlaceholder: "Type to search...",
9998
10070
  emptyMessage: "No data to display",
9999
- noEntriesText: "There are no entries yet.\nClick the button below to add a new entry.",
10000
- noEntriesReadonlyText: "There are no entries.",
10071
+ noEntriesText: "No entries yet.\nClick the button below to add a new entry.",
10072
+ noEntriesReadonlyText: "No entries.",
10001
10073
  more: "More",
10002
10074
  tagboxDoneButtonCaption: "OK",
10003
- selectToRankEmptyRankedAreaText: "All choices are ranked",
10004
- selectToRankEmptyUnrankedAreaText: "Drag and drop choices here to rank them",
10075
+ selectToRankEmptyRankedAreaText: "All choices are selected for ranking",
10076
+ selectToRankEmptyUnrankedAreaText: "Drag choices here to rank them",
10005
10077
  ok: "OK",
10006
10078
  cancel: "Cancel",
10007
10079
  };
@@ -10258,14 +10330,14 @@ var SurveyQuestionBoolean = /** @class */ (function (_super) {
10258
10330
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("input", { ref: this.checkRef, type: "checkbox", name: this.question.name, value: this.question.booleanValue === null
10259
10331
  ? ""
10260
10332
  : this.question.booleanValue, id: this.question.inputId, className: cssClasses.control, disabled: this.isDisplayMode, checked: this.question.booleanValue || false, onChange: this.handleOnChange, role: this.question.a11y_input_ariaRole, "aria-required": this.question.a11y_input_ariaRequired, "aria-label": this.question.a11y_input_ariaLabel, "aria-labelledby": this.question.a11y_input_ariaLabelledBy, "aria-invalid": this.question.a11y_input_ariaInvalid, "aria-describedby": this.question.a11y_input_ariaDescribedBy }),
10261
- react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: cssClasses.sliderGhost, onClick: function (event) { return _this.handleOnLabelClick(event, false); } },
10262
- react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", { className: this.question.getLabelCss(false) }, this.renderLocString(this.question.locLabelFalse))),
10333
+ react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: cssClasses.sliderGhost, onClick: function (event) { return _this.handleOnLabelClick(event, _this.question.swapOrder); } },
10334
+ react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", { className: this.question.getLabelCss(this.question.swapOrder) }, this.renderLocString(this.question.locLabelLeft))),
10263
10335
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: cssClasses.switch, onClick: this.handleOnSwitchClick },
10264
10336
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", { className: cssClasses.slider }, this.question.isDeterminated && cssClasses.sliderText ?
10265
10337
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", { className: cssClasses.sliderText }, this.renderLocString(this.question.getCheckedLabel()))
10266
10338
  : null)),
10267
- react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: cssClasses.sliderGhost, onClick: function (event) { return _this.handleOnLabelClick(event, true); } },
10268
- react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", { className: this.question.getLabelCss(true) }, this.renderLocString(this.question.locLabelTrue))))));
10339
+ react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: cssClasses.sliderGhost, onClick: function (event) { return _this.handleOnLabelClick(event, !_this.question.swapOrder); } },
10340
+ react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", { className: this.question.getLabelCss(!this.question.swapOrder) }, this.renderLocString(this.question.locLabelRight))))));
10269
10341
  };
10270
10342
  return SurveyQuestionBoolean;
10271
10343
  }(_reactquestion_element__WEBPACK_IMPORTED_MODULE_1__["SurveyQuestionElementBase"]));
@@ -10826,7 +10898,8 @@ var SurveyFileChooseButton = /** @class */ (function (_super) {
10826
10898
  configurable: true
10827
10899
  });
10828
10900
  SurveyFileChooseButton.prototype.render = function () {
10829
- return Object(_reactSurvey__WEBPACK_IMPORTED_MODULE_1__["attachKey2click"])(react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", { tabIndex: 0, className: this.question.getChooseFileCss(), htmlFor: this.question.inputId, "aria-label": this.question.chooseButtonText },
10901
+ var _this = this;
10902
+ return Object(_reactSurvey__WEBPACK_IMPORTED_MODULE_1__["attachKey2click"])(react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", { tabIndex: 0, className: this.question.getChooseFileCss(), htmlFor: this.question.inputId, "aria-label": this.question.chooseButtonText, onClick: function (e) { return _this.question.chooseFile(e.nativeEvent); } },
10830
10903
  (!!this.question.cssClasses.chooseFileIconId) ? react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_svg_icon_svg_icon__WEBPACK_IMPORTED_MODULE_3__["SvgIcon"], { title: this.question.chooseButtonText, iconName: this.question.cssClasses.chooseFileIconId, size: "auto" }) : null,
10831
10904
  react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", null, this.question.chooseButtonText)));
10832
10905
  };
@@ -11039,7 +11112,7 @@ var Header = /** @class */ (function (_super) {
11039
11112
  };
11040
11113
  Header.prototype.renderElement = function () {
11041
11114
  this.model.survey = this.props.survey;
11042
- if (!(this.props.survey.headerView === "advanced" && this.props.survey.renderedHasHeader)) {
11115
+ if (!(this.props.survey.headerView === "advanced")) {
11043
11116
  return null;
11044
11117
  }
11045
11118
  var headerContent = null;
@@ -14351,7 +14424,6 @@ var SurveyPanelBase = /** @class */ (function (_super) {
14351
14424
  __extends(SurveyPanelBase, _super);
14352
14425
  function SurveyPanelBase(props) {
14353
14426
  var _this = _super.call(this, props) || this;
14354
- _this.renderedRowsCache = {};
14355
14427
  _this.rootRef = react__WEBPACK_IMPORTED_MODULE_0__["createRef"]();
14356
14428
  return _this;
14357
14429
  }
@@ -14434,20 +14506,8 @@ var SurveyPanelBase = /** @class */ (function (_super) {
14434
14506
  && this.panelBase.isVisible && !!this.panelBase.survey);
14435
14507
  };
14436
14508
  SurveyPanelBase.prototype.renderRows = function (css) {
14437
- if (this.changedStatePropName !== "rows") {
14438
- this.renderedRowsCache = {};
14439
- }
14440
- var rows = [];
14441
- var questionRows = this.panelBase.rows;
14442
- for (var i = 0; i < questionRows.length; i++) {
14443
- var row = this.renderedRowsCache[questionRows[i].id];
14444
- if (!row) {
14445
- row = this.createRow(questionRows[i], css);
14446
- this.renderedRowsCache[questionRows[i].id] = row;
14447
- }
14448
- rows.push(row);
14449
- }
14450
- return rows;
14509
+ var _this = this;
14510
+ return this.panelBase.rows.map(function (row) { return _this.createRow(row, css); });
14451
14511
  };
14452
14512
  SurveyPanelBase.prototype.createRow = function (row, css) {
14453
14513
  return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_row__WEBPACK_IMPORTED_MODULE_2__["SurveyRow"], { key: row.id, row: row, survey: this.survey, creator: this.creator, css: css }));
@@ -14793,7 +14853,9 @@ var SurveyProgressButtons = /** @class */ (function (_super) {
14793
14853
  }, 10);
14794
14854
  };
14795
14855
  SurveyProgressButtons.prototype.componentWillUnmount = function () {
14796
- this.respManager.dispose();
14856
+ if (!!this.respManager) {
14857
+ this.respManager.dispose();
14858
+ }
14797
14859
  _super.prototype.componentWillUnmount.call(this);
14798
14860
  };
14799
14861
  return SurveyProgressButtons;
@@ -15004,6 +15066,7 @@ var PopupSurvey = /** @class */ (function (_super) {
15004
15066
  var titleCollapsed = null;
15005
15067
  var expandCollapseIcon;
15006
15068
  var closeButton = null;
15069
+ var allowFullScreenButon = null;
15007
15070
  if (popup.isCollapsed) {
15008
15071
  headerCss += " " + popup.cssRootCollapsedMod;
15009
15072
  titleCollapsed = this.renderTitleCollapsed(popup);
@@ -15015,9 +15078,13 @@ var PopupSurvey = /** @class */ (function (_super) {
15015
15078
  if (popup.allowClose) {
15016
15079
  closeButton = this.renderCloseButton(this.popup);
15017
15080
  }
15081
+ if (popup.allowFullScreen) {
15082
+ allowFullScreenButon = this.renderAllowFullScreenButon(this.popup);
15083
+ }
15018
15084
  return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: popup.cssHeaderRoot },
15019
15085
  titleCollapsed,
15020
15086
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: popup.cssHeaderButtonsContainer },
15087
+ allowFullScreenButon,
15021
15088
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: popup.cssHeaderCollapseButton, onClick: this.handleOnExpanded }, expandCollapseIcon),
15022
15089
  closeButton)));
15023
15090
  };
@@ -15036,6 +15103,16 @@ var PopupSurvey = /** @class */ (function (_super) {
15036
15103
  return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: popup.cssHeaderCloseButton, onClick: function () { popup.hide(); } },
15037
15104
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_components_svg_icon_svg_icon__WEBPACK_IMPORTED_MODULE_3__["SvgIcon"], { iconName: "icon-close_16x16", size: 16 })));
15038
15105
  };
15106
+ PopupSurvey.prototype.renderAllowFullScreenButon = function (popup) {
15107
+ var Icon;
15108
+ if (popup.isFullScreen) {
15109
+ Icon = react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_components_svg_icon_svg_icon__WEBPACK_IMPORTED_MODULE_3__["SvgIcon"], { iconName: "icon-back-to-panel_16x16", size: 16 });
15110
+ }
15111
+ else {
15112
+ Icon = react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_components_svg_icon_svg_icon__WEBPACK_IMPORTED_MODULE_3__["SvgIcon"], { iconName: "icon-full-screen_16x16", size: 16 });
15113
+ }
15114
+ return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: popup.cssHeaderFullScreenButton, onClick: function () { popup.toggleFullScreen(); } }, Icon));
15115
+ };
15039
15116
  PopupSurvey.prototype.renderBody = function () {
15040
15117
  return react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.popup.cssBody }, this.doRender());
15041
15118
  };
@@ -15048,6 +15125,7 @@ var PopupSurvey = /** @class */ (function (_super) {
15048
15125
  this.popup.closeOnCompleteTimeout = newProps.closeOnCompleteTimeout;
15049
15126
  }
15050
15127
  this.popup.allowClose = newProps.allowClose;
15128
+ this.popup.allowFullScreen = newProps.allowFullScreen;
15051
15129
  this.popup.isShowing = true;
15052
15130
  if (!this.popup.isExpanded && (newProps.expanded || newProps.isExpanded))
15053
15131
  this.popup.expand();
@@ -15832,7 +15910,7 @@ var SurveyQuestionAndErrorsCell = /** @class */ (function (_super) {
15832
15910
  var style = this.getCellStyle();
15833
15911
  var cell = this.props.cell;
15834
15912
  var focusIn = function () { cell.focusIn(); };
15835
- return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("td", { ref: this.cellRef, className: this.itemCss, colSpan: cell.colSpans, "data-responsive-title": this.getHeaderText(), title: cell.getTitle(), style: style, onFocus: focusIn }, this.wrapCell(this.props.cell, (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.cssClasses.cellQuestionWrapper }, this.renderQuestion())))));
15913
+ return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("td", { ref: this.cellRef, className: this.itemCss, colSpan: cell.colSpans, "data-responsive-title": this.getHeaderText(), title: cell.getTitle(), style: style, onFocus: focusIn }, this.wrapCell(this.props.cell, (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.props.cell.cellQuestionWrapperClassName }, this.renderQuestion())))));
15836
15914
  };
15837
15915
  SurveyQuestionAndErrorsCell.prototype.getCellStyle = function () {
15838
15916
  return null;
@@ -17185,8 +17263,8 @@ var SurveyQuestionFile = /** @class */ (function (_super) {
17185
17263
  var clearButtonBottom = this.question.showRemoveButtonBottom ? this.renderClearButton(this.question.cssClasses.removeButtonBottom) : null;
17186
17264
  var fileNavigator = this.question.fileNavigatorVisible ? (react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_components_action_bar_action_bar__WEBPACK_IMPORTED_MODULE_1__["SurveyActionBar"], { model: this.question.fileNavigator })) : null;
17187
17265
  var fileInput = (this.isDisplayMode ?
17188
- react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("input", { type: "file", disabled: this.isDisplayMode, className: !this.isDisplayMode ? this.question.cssClasses.fileInput : this.question.getReadOnlyFileCss(), id: this.question.inputId, ref: function (input) { return (_this.setControl(input)); }, style: !this.isDisplayMode ? {} : { color: "transparent" }, onChange: !this.isDisplayMode ? this.question.doChange : (function () { }), multiple: this.question.allowMultiple, placeholder: this.question.title, accept: this.question.acceptedTypes }) : this.question.hasFileUI ?
17189
- react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("input", { type: "file", disabled: this.isDisplayMode, tabIndex: -1, className: !this.isDisplayMode ? this.question.cssClasses.fileInput : this.question.getReadOnlyFileCss(), id: this.question.inputId, ref: function (input) { return (_this.setControl(input)); }, style: !this.isDisplayMode ? {} : { color: "transparent" }, onChange: !this.isDisplayMode ? this.question.doChange : (function () { }), "aria-required": this.question.ariaRequired, "aria-label": this.question.ariaLabel, "aria-invalid": this.question.ariaInvalid, "aria-describedby": this.question.ariaDescribedBy, multiple: this.question.allowMultiple, title: this.question.inputTitle, accept: this.question.acceptedTypes, capture: this.question.renderCapture }) : null);
17266
+ react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("input", { type: "file", disabled: this.isDisplayMode, className: !this.isDisplayMode ? this.question.cssClasses.fileInput : this.question.getReadOnlyFileCss(), id: this.question.inputId, ref: function (input) { return (_this.setControl(input)); }, style: !this.isDisplayMode ? {} : { color: "transparent" }, multiple: this.question.allowMultiple, placeholder: this.question.title, accept: this.question.acceptedTypes }) : this.question.hasFileUI ?
17267
+ react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("input", { type: "file", disabled: this.isDisplayMode, tabIndex: -1, className: !this.isDisplayMode ? this.question.cssClasses.fileInput : this.question.getReadOnlyFileCss(), id: this.question.inputId, ref: function (input) { return (_this.setControl(input)); }, style: !this.isDisplayMode ? {} : { color: "transparent" }, "aria-required": this.question.ariaRequired, "aria-label": this.question.ariaLabel, "aria-invalid": this.question.ariaInvalid, "aria-describedby": this.question.ariaDescribedBy, multiple: this.question.allowMultiple, title: this.question.inputTitle, accept: this.question.acceptedTypes, capture: this.question.renderCapture }) : null);
17190
17268
  return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.question.fileRootCss },
17191
17269
  fileInput,
17192
17270
  react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.question.cssClasses.dragArea, onDrop: this.question.onDrop, onDragOver: this.question.onDragOver, onDragLeave: this.question.onDragLeave, onDragEnter: this.question.onDragEnter },
@@ -20489,34 +20567,50 @@ var settings = {
20489
20567
  */
20490
20568
  tagboxCloseOnSelect: false,
20491
20569
  /**
20492
- * A property that allows you to display a custom confirm dialog.
20570
+ * A function that activates a browser confirm dialog.
20571
+ *
20572
+ * Use the following code to execute this function:
20573
+ *
20574
+ * ```js
20575
+ * import { settings } from "survey-core";
20576
+ *
20577
+ * // `result` contains `true` if the action was confirmed or `false` otherwise
20578
+ * const result = settings.confirmActionFunc("Are you sure?");
20579
+ * ```
20493
20580
  *
20494
- * Set this property to a function that renders your custom dialog window. This function should return `true` if a user confirms an action or `false` otherwise.
20581
+ * You can redefine the `confirmActionFunc` function if you want to display a custom dialog window. Your function should return `true` if a user confirms an action or `false` otherwise.
20495
20582
  * @param message A message to be displayed in the confirm dialog window.
20496
20583
  */
20497
20584
  confirmActionFunc: function (message) {
20498
20585
  return confirm(message);
20499
20586
  },
20500
20587
  /**
20501
- * A property that allows you to display a custom confirm dialog in async mode or activate the standard browser dialog.
20588
+ * A function that activates a proprietary SurveyJS confirm dialog.
20502
20589
  *
20503
- * To display a custom confirm dialog, set this property to a function that renders it. This function should return `true` to be enabled; otherwise, a survey executes the [`confirmActionFunc`](#confirmActionFunc) function. Pass the dialog result as the `callback` parameter: `true` if a user confirms an action, `false` otherwise.
20504
- *
20505
- * To activate the standard browser dialog, set the `confirmActionAsync` property to a function that returns `false`. With this configuration, a survey falls back to the [`confirmActionFunc`](#confirmActionFunc) function, which renders the standard browser dialog by default.
20590
+ * Use the following code to execute this function:
20506
20591
  *
20507
20592
  * ```js
20508
20593
  * import { settings } from "survey-core";
20509
20594
  *
20510
- * // Display the standard browser dialog
20511
- * settings.confirmActionAsync = () => {
20512
- * return false;
20513
- * }
20595
+ * settings.confirmActionAsync("Are you sure?", (confirmed) => {
20596
+ * if (confirmed) {
20597
+ * // ...
20598
+ * // Proceed with the action
20599
+ * // ...
20600
+ * } else {
20601
+ * // ...
20602
+ * // Cancel the action
20603
+ * // ...
20604
+ * }
20605
+ * });
20514
20606
  * ```
20607
+ *
20608
+ * You can redefine the `confirmActionAsync` function if you want to display a custom dialog window. Your function should return `true` to be enabled; otherwise, a survey executes the [`confirmActionFunc`](#confirmActionFunc) function. Pass the dialog result as the `callback` parameter: `true` if a user confirms an action, `false` otherwise.
20515
20609
  * @param message A message to be displayed in the confirm dialog window.
20516
20610
  * @param callback A callback function that should be called with `true` if a user confirms an action or `false` otherwise.
20517
20611
  */
20518
- confirmActionAsync: function (message, callback, applyTitle, locale) {
20519
- return Object(_utils_utils__WEBPACK_IMPORTED_MODULE_0__["showConfirmDialog"])(message, callback, applyTitle, locale);
20612
+ confirmActionAsync: function (message, callback, applyTitle, locale, rootElement) {
20613
+ return Object(_utils_utils__WEBPACK_IMPORTED_MODULE_0__["showConfirmDialog"])(message, callback, applyTitle, locale, rootElement);
20520
20614
  },
20521
20615
  /**
20522
20616
  * A minimum width value for all survey elements.
@@ -21082,7 +21176,7 @@ var VerticalResponsivityManager = /** @class */ (function (_super) {
21082
21176
  /*!****************************!*\
21083
21177
  !*** ./src/utils/utils.ts ***!
21084
21178
  \****************************/
21085
- /*! exports provided: unwrap, getRenderedSize, getRenderedStyleSize, doKey2ClickBlur, doKey2ClickUp, doKey2ClickDown, sanitizeEditableContent, Logger, showConfirmDialog, mergeValues, getElementWidth, isContainerVisible, classesToSelector, compareVersions, confirmAction, confirmActionAsync, detectIEOrEdge, detectIEBrowser, loadFileFromBase64, isMobile, isShadowDOM, getElement, isElementVisible, findScrollableParent, scrollElementByChildId, navigateToUrl, wrapUrlForBackgroundImage, createSvg, getIconNameFromProxy, increaseHeightByContent, getOriginalEvent, preventDefaults, findParentByClassNames, getFirstVisibleChild */
21179
+ /*! exports provided: unwrap, getRenderedSize, getRenderedStyleSize, doKey2ClickBlur, doKey2ClickUp, doKey2ClickDown, sanitizeEditableContent, Logger, showConfirmDialog, mergeValues, getElementWidth, isContainerVisible, classesToSelector, compareVersions, confirmAction, confirmActionAsync, detectIEOrEdge, detectIEBrowser, loadFileFromBase64, isMobile, isShadowDOM, getElement, isElementVisible, findScrollableParent, scrollElementByChildId, navigateToUrl, wrapUrlForBackgroundImage, createSvg, getIconNameFromProxy, increaseHeightByContent, getOriginalEvent, preventDefaults, findParentByClassNames, getFirstVisibleChild, chooseFiles */
21086
21180
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
21087
21181
 
21088
21182
  "use strict";
@@ -21121,6 +21215,7 @@ __webpack_require__.r(__webpack_exports__);
21121
21215
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "preventDefaults", function() { return preventDefaults; });
21122
21216
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "findParentByClassNames", function() { return findParentByClassNames; });
21123
21217
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getFirstVisibleChild", function() { return getFirstVisibleChild; });
21218
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "chooseFiles", function() { return chooseFiles; });
21124
21219
  /* harmony import */ var _localizablestring__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../localizablestring */ "./src/localizablestring.ts");
21125
21220
  /* harmony import */ var _settings__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./../settings */ "./src/settings.ts");
21126
21221
  /* harmony import */ var _surveyStrings__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../surveyStrings */ "./src/surveyStrings.ts");
@@ -21145,7 +21240,7 @@ function confirmAction(message) {
21145
21240
  return _settings__WEBPACK_IMPORTED_MODULE_1__["settings"].confirmActionFunc(message);
21146
21241
  return confirm(message);
21147
21242
  }
21148
- function confirmActionAsync(message, funcOnYes, funcOnNo, locale) {
21243
+ function confirmActionAsync(message, funcOnYes, funcOnNo, locale, rootElement) {
21149
21244
  var callbackFunc = function (res) {
21150
21245
  if (res)
21151
21246
  funcOnYes();
@@ -21153,7 +21248,7 @@ function confirmActionAsync(message, funcOnYes, funcOnNo, locale) {
21153
21248
  funcOnNo();
21154
21249
  };
21155
21250
  if (!!_settings__WEBPACK_IMPORTED_MODULE_1__["settings"] && !!_settings__WEBPACK_IMPORTED_MODULE_1__["settings"].confirmActionAsync) {
21156
- if (_settings__WEBPACK_IMPORTED_MODULE_1__["settings"].confirmActionAsync(message, callbackFunc, undefined, locale))
21251
+ if (_settings__WEBPACK_IMPORTED_MODULE_1__["settings"].confirmActionAsync(message, callbackFunc, undefined, locale, rootElement))
21157
21252
  return;
21158
21253
  }
21159
21254
  callbackFunc(confirmAction(message));
@@ -21502,7 +21597,7 @@ var Logger = /** @class */ (function () {
21502
21597
  return Logger;
21503
21598
  }());
21504
21599
 
21505
- function showConfirmDialog(message, callback, applyTitle, locale) {
21600
+ function showConfirmDialog(message, callback, applyTitle, locale, rootElement) {
21506
21601
  var locStr = new _localizablestring__WEBPACK_IMPORTED_MODULE_0__["LocalizableString"](undefined);
21507
21602
  var popupViewModel = _settings__WEBPACK_IMPORTED_MODULE_1__["settings"].showDialog({
21508
21603
  componentName: "sv-string-viewer",
@@ -21519,7 +21614,7 @@ function showConfirmDialog(message, callback, applyTitle, locale) {
21519
21614
  displayMode: "popup",
21520
21615
  isFocusedContent: false,
21521
21616
  cssClass: "sv-popup--confirm-delete"
21522
- }, /*settings.rootElement*/ document.body); //TODO survey root
21617
+ }, rootElement);
21523
21618
  var toolbar = popupViewModel.footerToolbar;
21524
21619
  var applyBtn = toolbar.getActionById("apply");
21525
21620
  var cancelBtn = toolbar.getActionById("cancel");
@@ -21530,6 +21625,23 @@ function showConfirmDialog(message, callback, applyTitle, locale) {
21530
21625
  popupViewModel.width = "452px";
21531
21626
  return true;
21532
21627
  }
21628
+ function chooseFiles(input, callback) {
21629
+ if (!window || !window["FileReader"])
21630
+ return;
21631
+ input.value = "";
21632
+ input.onchange = function (event) {
21633
+ if (!window["FileReader"])
21634
+ return;
21635
+ if (!input || !input.files || input.files.length < 1)
21636
+ return;
21637
+ var files = [];
21638
+ for (var i = 0; i < input.files.length; i++) {
21639
+ files.push(input.files[i]);
21640
+ }
21641
+ callback(files);
21642
+ };
21643
+ input.click();
21644
+ }
21533
21645
 
21534
21646
 
21535
21647