survey-react 1.11.8 → 1.11.10
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/defaultV2.css +23 -9
- package/defaultV2.css.map +1 -1
- package/defaultV2.min.css +2 -2
- package/modern.css +1 -1
- package/modern.min.css +1 -1
- package/package.json +1 -1
- package/survey.css +1 -1
- package/survey.min.css +1 -1
- package/survey.react.d.ts +154 -61
- package/survey.react.js +399 -177
- package/survey.react.js.map +1 -1
- package/survey.react.min.js +3 -3
package/survey.react.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
* surveyjs - Survey JavaScript library v1.11.
|
2
|
+
* surveyjs - Survey JavaScript library v1.11.10
|
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
|
*/
|
@@ -7142,6 +7142,7 @@ var DragDropCore = /** @class */ (function () {
|
|
7142
7142
|
this.onGhostPositionChanged = new _base__WEBPACK_IMPORTED_MODULE_0__["EventBase"]();
|
7143
7143
|
this.onDragStart = new _base__WEBPACK_IMPORTED_MODULE_0__["EventBase"]();
|
7144
7144
|
this.onDragEnd = new _base__WEBPACK_IMPORTED_MODULE_0__["EventBase"]();
|
7145
|
+
this.onDragClear = new _base__WEBPACK_IMPORTED_MODULE_0__["EventBase"]();
|
7145
7146
|
this.onBeforeDrop = this.onDragStart;
|
7146
7147
|
this.onAfterDrop = this.onDragEnd;
|
7147
7148
|
this.draggedElement = null;
|
@@ -7201,6 +7202,8 @@ var DragDropCore = /** @class */ (function () {
|
|
7201
7202
|
var shortcutText = this.getShortcutText(this.draggedElement);
|
7202
7203
|
this.domAdapter.draggedElementShortcut = this.createDraggedElementShortcut(shortcutText, draggedElementNode, event);
|
7203
7204
|
this.onStartDrag(event);
|
7205
|
+
var fromElement = this.draggedElement && this.draggedElement.parent;
|
7206
|
+
this.onDragStart.fire(this, { fromElement: fromElement, draggedElement: this.draggedElement });
|
7204
7207
|
};
|
7205
7208
|
DragDropCore.prototype.onStartDrag = function (event) {
|
7206
7209
|
};
|
@@ -7294,7 +7297,6 @@ var DragDropCore = /** @class */ (function () {
|
|
7294
7297
|
DragDropCore.prototype.drop = function () {
|
7295
7298
|
if (this.allowDropHere) {
|
7296
7299
|
var fromElement = this.draggedElement.parent;
|
7297
|
-
this.onDragStart.fire(this, { fromElement: fromElement, draggedElement: this.draggedElement });
|
7298
7300
|
var newElement = this.doDrop();
|
7299
7301
|
this.onDragEnd.fire(this, { fromElement: fromElement, draggedElement: newElement, toElement: this.dropTarget });
|
7300
7302
|
}
|
@@ -7305,6 +7307,7 @@ var DragDropCore = /** @class */ (function () {
|
|
7305
7307
|
this.draggedElement = null;
|
7306
7308
|
this.isBottom = null;
|
7307
7309
|
this.parentElement = null;
|
7310
|
+
this.onDragClear.fire(this, {});
|
7308
7311
|
};
|
7309
7312
|
return DragDropCore;
|
7310
7313
|
}());
|
@@ -8159,11 +8162,12 @@ __webpack_require__.r(__webpack_exports__);
|
|
8159
8162
|
/* harmony import */ var _jsonobject__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./jsonobject */ "./src/jsonobject.ts");
|
8160
8163
|
/* harmony import */ var _list__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./list */ "./src/list.ts");
|
8161
8164
|
/* harmony import */ var _popup__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./popup */ "./src/popup.ts");
|
8162
|
-
/* harmony import */ var
|
8163
|
-
/* harmony import */ var
|
8164
|
-
/* harmony import */ var
|
8165
|
-
/* harmony import */ var
|
8166
|
-
/* harmony import */ var
|
8165
|
+
/* harmony import */ var _popup_dropdown_view_model__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./popup-dropdown-view-model */ "./src/popup-dropdown-view-model.ts");
|
8166
|
+
/* harmony import */ var _question_dropdown__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./question_dropdown */ "./src/question_dropdown.ts");
|
8167
|
+
/* harmony import */ var _settings__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./settings */ "./src/settings.ts");
|
8168
|
+
/* harmony import */ var _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./utils/cssClassBuilder */ "./src/utils/cssClassBuilder.ts");
|
8169
|
+
/* harmony import */ var _utils_devices__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./utils/devices */ "./src/utils/devices.ts");
|
8170
|
+
/* harmony import */ var _utils_utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./utils/utils */ "./src/utils/utils.ts");
|
8167
8171
|
var __extends = (undefined && undefined.__extends) || (function () {
|
8168
8172
|
var extendStatics = function (d, b) {
|
8169
8173
|
extendStatics = Object.setPrototypeOf ||
|
@@ -8196,6 +8200,7 @@ var __decorate = (undefined && undefined.__decorate) || function (decorators, ta
|
|
8196
8200
|
|
8197
8201
|
|
8198
8202
|
|
8203
|
+
|
8199
8204
|
var DropdownListModel = /** @class */ (function (_super) {
|
8200
8205
|
__extends(DropdownListModel, _super);
|
8201
8206
|
function DropdownListModel(question, onSelectionChanged) {
|
@@ -8240,7 +8245,7 @@ var DropdownListModel = /** @class */ (function (_super) {
|
|
8240
8245
|
configurable: true
|
8241
8246
|
});
|
8242
8247
|
DropdownListModel.prototype.getFocusFirstInputSelector = function () {
|
8243
|
-
if (
|
8248
|
+
if (_utils_devices__WEBPACK_IMPORTED_MODULE_10__["IsTouch"]) {
|
8244
8249
|
return this.isValueEmpty(this.question.value) ? this.itemSelector : this.selectedItemSelector;
|
8245
8250
|
}
|
8246
8251
|
else {
|
@@ -8280,14 +8285,14 @@ var DropdownListModel = /** @class */ (function (_super) {
|
|
8280
8285
|
var _this = this;
|
8281
8286
|
var isUpdate = (this.itemsSettings.skip + 1) < this.itemsSettings.totalCount;
|
8282
8287
|
if (!this.itemsSettings.skip || isUpdate) {
|
8283
|
-
if (!!this.filterString &&
|
8288
|
+
if (!!this.filterString && _settings__WEBPACK_IMPORTED_MODULE_8__["settings"].dropdownSearchDelay > 0) {
|
8284
8289
|
if (!!this.timer) {
|
8285
8290
|
clearTimeout(this.timer);
|
8286
8291
|
this.timer = undefined;
|
8287
8292
|
}
|
8288
8293
|
this.timer = setTimeout(function () {
|
8289
8294
|
_this.loadQuestionChoices(callbackAfterItemsLoaded);
|
8290
|
-
},
|
8295
|
+
}, _settings__WEBPACK_IMPORTED_MODULE_8__["settings"].dropdownSearchDelay);
|
8291
8296
|
}
|
8292
8297
|
else {
|
8293
8298
|
this.loadQuestionChoices(callbackAfterItemsLoaded);
|
@@ -8297,15 +8302,33 @@ var DropdownListModel = /** @class */ (function (_super) {
|
|
8297
8302
|
DropdownListModel.prototype.updatePopupFocusFirstInputSelector = function () {
|
8298
8303
|
this._popupModel.focusFirstInputSelector = this.focusFirstInputSelector;
|
8299
8304
|
};
|
8305
|
+
DropdownListModel.prototype.getDropdownMenuOptions = function () {
|
8306
|
+
var windowWidth = _global_variables_utils__WEBPACK_IMPORTED_MODULE_1__["DomWindowHelper"].getInnerWidth();
|
8307
|
+
var windowHeight = _global_variables_utils__WEBPACK_IMPORTED_MODULE_1__["DomWindowHelper"].getInnerHeight();
|
8308
|
+
var isTablet = Object(_popup_dropdown_view_model__WEBPACK_IMPORTED_MODULE_6__["calculateIsTablet"])(windowWidth, windowHeight);
|
8309
|
+
var menuType = "dropdown";
|
8310
|
+
var deviceType = "desktop";
|
8311
|
+
if (_utils_devices__WEBPACK_IMPORTED_MODULE_10__["IsTouch"]) {
|
8312
|
+
menuType = isTablet ? "popup" : "overlay";
|
8313
|
+
deviceType = isTablet ? "tablet" : "mobile";
|
8314
|
+
}
|
8315
|
+
return {
|
8316
|
+
menuType: menuType,
|
8317
|
+
deviceType: deviceType,
|
8318
|
+
hasTouchScreen: _utils_devices__WEBPACK_IMPORTED_MODULE_10__["IsTouch"],
|
8319
|
+
screenHeight: windowHeight,
|
8320
|
+
screenWidth: windowWidth
|
8321
|
+
};
|
8322
|
+
};
|
8300
8323
|
DropdownListModel.prototype.createPopup = function () {
|
8301
8324
|
var _this = this;
|
8302
8325
|
var popupOptions = { verticalPosition: "bottom", horizontalPosition: "center", showPointer: false };
|
8303
8326
|
this._popupModel = new _popup__WEBPACK_IMPORTED_MODULE_5__["PopupModel"]("sv-list", { model: this.listModel }, popupOptions);
|
8304
|
-
this._popupModel.displayMode =
|
8327
|
+
this._popupModel.displayMode = _utils_devices__WEBPACK_IMPORTED_MODULE_10__["IsTouch"] ? "overlay" : "popup";
|
8305
8328
|
this._popupModel.positionMode = "fixed";
|
8306
8329
|
this._popupModel.isFocusedContainer = false;
|
8307
|
-
this._popupModel.isFocusedContent =
|
8308
|
-
this._popupModel.setWidthByTarget = !
|
8330
|
+
this._popupModel.isFocusedContent = _utils_devices__WEBPACK_IMPORTED_MODULE_10__["IsTouch"];
|
8331
|
+
this._popupModel.setWidthByTarget = !_utils_devices__WEBPACK_IMPORTED_MODULE_10__["IsTouch"];
|
8309
8332
|
this._popupModel.locale = this.question.getLocale();
|
8310
8333
|
this.updatePopupFocusFirstInputSelector();
|
8311
8334
|
this.listModel.registerPropertyChangedHandlers(["showFilter"], function () {
|
@@ -8321,9 +8344,14 @@ var DropdownListModel = /** @class */ (function (_super) {
|
|
8321
8344
|
_this.resetItemsSettings();
|
8322
8345
|
_this.updateQuestionChoices();
|
8323
8346
|
}
|
8324
|
-
if (option.isVisible
|
8347
|
+
if (option.isVisible) {
|
8325
8348
|
_this.updatePopupFocusFirstInputSelector();
|
8326
|
-
_this.
|
8349
|
+
var dropdownMenuOptions = _this.getDropdownMenuOptions();
|
8350
|
+
_this.question.processOpenDropdownMenu(dropdownMenuOptions);
|
8351
|
+
_this._popupModel.updateDisplayMode(dropdownMenuOptions.menuType);
|
8352
|
+
if (!!_this.question.onOpenedCallBack) {
|
8353
|
+
_this.question.onOpenedCallBack();
|
8354
|
+
}
|
8327
8355
|
}
|
8328
8356
|
if (!option.isVisible) {
|
8329
8357
|
_this.onHidePopup();
|
@@ -8372,7 +8400,7 @@ var DropdownListModel = /** @class */ (function (_super) {
|
|
8372
8400
|
if (_this.filteredItems)
|
8373
8401
|
return _this.filteredItems.indexOf(item) >= 0;
|
8374
8402
|
var textInLow = item.text.toLocaleLowerCase();
|
8375
|
-
textInLow =
|
8403
|
+
textInLow = _settings__WEBPACK_IMPORTED_MODULE_8__["settings"].comparator.normalizeTextCallback(textInLow, "filter");
|
8376
8404
|
var index = textInLow.indexOf(textToSearch.toLocaleLowerCase());
|
8377
8405
|
return _this.question.searchMode == "startsWith" ? index == 0 : index > -1;
|
8378
8406
|
});
|
@@ -8417,7 +8445,7 @@ var DropdownListModel = /** @class */ (function (_super) {
|
|
8417
8445
|
model.actions.forEach(function (a) { return a.disableTabStop = true; });
|
8418
8446
|
};
|
8419
8447
|
DropdownListModel.prototype.updateCssClasses = function (popupCssClass, listCssClasses) {
|
8420
|
-
this.popupModel.cssClass = new
|
8448
|
+
this.popupModel.cssClass = new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_9__["CssClassBuilder"]().append(popupCssClass).append(this.popupCssClasses).toString();
|
8421
8449
|
this.listModel.cssClasses = listCssClasses;
|
8422
8450
|
};
|
8423
8451
|
DropdownListModel.prototype.resetFilterString = function () {
|
@@ -8618,14 +8646,14 @@ var DropdownListModel = /** @class */ (function (_super) {
|
|
8618
8646
|
});
|
8619
8647
|
Object.defineProperty(DropdownListModel.prototype, "inputMode", {
|
8620
8648
|
get: function () {
|
8621
|
-
return
|
8649
|
+
return _utils_devices__WEBPACK_IMPORTED_MODULE_10__["IsTouch"] ? "none" : "text";
|
8622
8650
|
},
|
8623
8651
|
enumerable: false,
|
8624
8652
|
configurable: true
|
8625
8653
|
});
|
8626
8654
|
DropdownListModel.prototype.setSearchEnabled = function (newValue) {
|
8627
|
-
this.listModel.searchEnabled =
|
8628
|
-
this.listModel.showSearchClearButton =
|
8655
|
+
this.listModel.searchEnabled = _utils_devices__WEBPACK_IMPORTED_MODULE_10__["IsTouch"];
|
8656
|
+
this.listModel.showSearchClearButton = _utils_devices__WEBPACK_IMPORTED_MODULE_10__["IsTouch"];
|
8629
8657
|
this.searchEnabled = newValue;
|
8630
8658
|
};
|
8631
8659
|
DropdownListModel.prototype.setChoicesLazyLoadEnabled = function (newValue) {
|
@@ -8736,7 +8764,7 @@ var DropdownListModel = /** @class */ (function (_super) {
|
|
8736
8764
|
event.stopPropagation();
|
8737
8765
|
}
|
8738
8766
|
else if (this.popupModel.isVisible && (event.keyCode === 13 || event.keyCode === 32 && (!this.question.searchEnabled || !this.inputString))) {
|
8739
|
-
if (event.keyCode === 13 && this.question.searchEnabled && !this.inputString && this.question instanceof
|
8767
|
+
if (event.keyCode === 13 && this.question.searchEnabled && !this.inputString && this.question instanceof _question_dropdown__WEBPACK_IMPORTED_MODULE_7__["QuestionDropdownModel"] && !this._markdownMode && this.question.value) {
|
8740
8768
|
this._popupModel.hide();
|
8741
8769
|
this.onClear(event);
|
8742
8770
|
}
|
@@ -8765,7 +8793,7 @@ var DropdownListModel = /** @class */ (function (_super) {
|
|
8765
8793
|
if (event.keyCode === 32 && this.question.searchEnabled) {
|
8766
8794
|
return;
|
8767
8795
|
}
|
8768
|
-
Object(
|
8796
|
+
Object(_utils_utils__WEBPACK_IMPORTED_MODULE_11__["doKey2ClickUp"])(event, { processEsc: false, disableTabStop: this.question.isInputReadOnly });
|
8769
8797
|
}
|
8770
8798
|
};
|
8771
8799
|
DropdownListModel.prototype.onEscape = function () {
|
@@ -8780,11 +8808,11 @@ var DropdownListModel = /** @class */ (function (_super) {
|
|
8780
8808
|
};
|
8781
8809
|
DropdownListModel.prototype.onBlur = function (event) {
|
8782
8810
|
this.focused = false;
|
8783
|
-
if (this.popupModel.isVisible &&
|
8811
|
+
if (this.popupModel.isVisible && _utils_devices__WEBPACK_IMPORTED_MODULE_10__["IsTouch"]) {
|
8784
8812
|
this._popupModel.show();
|
8785
8813
|
return;
|
8786
8814
|
}
|
8787
|
-
Object(
|
8815
|
+
Object(_utils_utils__WEBPACK_IMPORTED_MODULE_11__["doKey2ClickBlur"])(event);
|
8788
8816
|
this._popupModel.hide();
|
8789
8817
|
this.resetFilterString();
|
8790
8818
|
this.inputString = null;
|
@@ -9960,8 +9988,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
9960
9988
|
|
9961
9989
|
var Version;
|
9962
9990
|
var ReleaseDate;
|
9963
|
-
Version = "" + "1.11.
|
9964
|
-
ReleaseDate = "" + "2024-
|
9991
|
+
Version = "" + "1.11.10";
|
9992
|
+
ReleaseDate = "" + "2024-08-06";
|
9965
9993
|
function checkLibraryVersion(ver, libraryName) {
|
9966
9994
|
if (Version != ver) {
|
9967
9995
|
var str = "survey-core has version '" + Version + "' and " + libraryName
|
@@ -16064,18 +16092,20 @@ var Const = /** @class */ (function (_super) {
|
|
16064
16092
|
Const.prototype.getCorrectValue = function (value) {
|
16065
16093
|
if (!value || typeof value != "string")
|
16066
16094
|
return value;
|
16067
|
-
if (
|
16095
|
+
if (OperandMaker.isBooleanValue(value))
|
16068
16096
|
return value.toLowerCase() === "true";
|
16069
16097
|
if (value.length > 1 &&
|
16070
16098
|
this.isQuote(value[0]) &&
|
16071
16099
|
this.isQuote(value[value.length - 1]))
|
16072
16100
|
return value.substring(1, value.length - 1);
|
16073
|
-
if (
|
16074
|
-
if (value.indexOf("0x")
|
16075
|
-
|
16076
|
-
|
16077
|
-
|
16078
|
-
|
16101
|
+
if (_helpers__WEBPACK_IMPORTED_MODULE_0__["Helpers"].isNumber(value)) {
|
16102
|
+
if (value[0] === "0" && value.indexOf("0x") != 0) {
|
16103
|
+
var len = value.length;
|
16104
|
+
var hasPoint = len > 1 && (value[1] === "." || value[1] === ",");
|
16105
|
+
if (!hasPoint && len > 1 || hasPoint && len < 2)
|
16106
|
+
return value;
|
16107
|
+
}
|
16108
|
+
return _helpers__WEBPACK_IMPORTED_MODULE_0__["Helpers"].getNumber(value);
|
16079
16109
|
}
|
16080
16110
|
return value;
|
16081
16111
|
};
|
@@ -16086,10 +16116,6 @@ var Const = /** @class */ (function (_super) {
|
|
16086
16116
|
Const.prototype.isQuote = function (ch) {
|
16087
16117
|
return ch == "'" || ch == '"';
|
16088
16118
|
};
|
16089
|
-
Const.prototype.isBooleanValue = function (value) {
|
16090
|
-
return (value &&
|
16091
|
-
(value.toLowerCase() === "true" || value.toLowerCase() === "false"));
|
16092
|
-
};
|
16093
16119
|
return Const;
|
16094
16120
|
}(Operand));
|
16095
16121
|
|
@@ -16247,27 +16273,11 @@ var OperandMaker = /** @class */ (function () {
|
|
16247
16273
|
};
|
16248
16274
|
OperandMaker.toOperandString = function (value) {
|
16249
16275
|
if (!!value &&
|
16250
|
-
!
|
16276
|
+
!_helpers__WEBPACK_IMPORTED_MODULE_0__["Helpers"].isNumber(value) &&
|
16251
16277
|
!OperandMaker.isBooleanValue(value))
|
16252
16278
|
value = "'" + value + "'";
|
16253
16279
|
return value;
|
16254
16280
|
};
|
16255
|
-
OperandMaker.isSpaceString = function (str) {
|
16256
|
-
return !!str && !str.replace(" ", "");
|
16257
|
-
};
|
16258
|
-
OperandMaker.isNumeric = function (value) {
|
16259
|
-
if (!!value &&
|
16260
|
-
(value.indexOf("-") > -1 ||
|
16261
|
-
value.indexOf("+") > 1 ||
|
16262
|
-
value.indexOf("*") > -1 ||
|
16263
|
-
value.indexOf("^") > -1 ||
|
16264
|
-
value.indexOf("/") > -1 ||
|
16265
|
-
value.indexOf("%") > -1))
|
16266
|
-
return false;
|
16267
|
-
if (OperandMaker.isSpaceString(value))
|
16268
|
-
return false;
|
16269
|
-
return _helpers__WEBPACK_IMPORTED_MODULE_0__["Helpers"].isNumber(value);
|
16270
|
-
};
|
16271
16281
|
OperandMaker.isBooleanValue = function (value) {
|
16272
16282
|
return (!!value &&
|
16273
16283
|
(value.toLowerCase() === "true" || value.toLowerCase() === "false"));
|
@@ -17089,7 +17099,7 @@ function displayValue(params) {
|
|
17089
17099
|
var q = getQuestionValueByContext(this, params[0]);
|
17090
17100
|
if (!q)
|
17091
17101
|
return "";
|
17092
|
-
if (params.length > 1 &&
|
17102
|
+
if (params.length > 1 && !_helpers__WEBPACK_IMPORTED_MODULE_0__["Helpers"].isValueEmpty(params[1]))
|
17093
17103
|
return q.getDisplayValue(true, params[1]);
|
17094
17104
|
return q.displayValue;
|
17095
17105
|
}
|
@@ -17883,17 +17893,39 @@ var Helpers = /** @class */ (function () {
|
|
17883
17893
|
return !isNaN(this.getNumber(value));
|
17884
17894
|
};
|
17885
17895
|
Helpers.getNumber = function (value) {
|
17886
|
-
|
17887
|
-
|
17888
|
-
|
17889
|
-
|
17890
|
-
|
17896
|
+
var newValue = Helpers.getNumberCore(value);
|
17897
|
+
return _settings__WEBPACK_IMPORTED_MODULE_0__["settings"].parseNumber(value, newValue);
|
17898
|
+
};
|
17899
|
+
Helpers.getNumberCore = function (value) {
|
17900
|
+
if (typeof value == "string") {
|
17901
|
+
if (!value.trim())
|
17902
|
+
return NaN;
|
17903
|
+
if (value.indexOf("0x") == 0) {
|
17904
|
+
if (value.length > 32)
|
17905
|
+
return NaN;
|
17906
|
+
return parseInt(value);
|
17907
|
+
}
|
17908
|
+
if (Helpers.isStringHasOperator(value))
|
17909
|
+
return NaN;
|
17910
|
+
}
|
17891
17911
|
value = this.prepareStringToNumber(value);
|
17892
17912
|
var res = parseFloat(value);
|
17893
17913
|
if (isNaN(res) || !isFinite(value))
|
17894
17914
|
return NaN;
|
17895
17915
|
return res;
|
17896
17916
|
};
|
17917
|
+
Helpers.isStringHasOperator = function (str) {
|
17918
|
+
if (str.lastIndexOf("-") > 0)
|
17919
|
+
return false;
|
17920
|
+
if (str.lastIndexOf("+") > 0)
|
17921
|
+
return false;
|
17922
|
+
var operators = "*^/%";
|
17923
|
+
for (var i = 0; i < operators.length; i++) {
|
17924
|
+
if (str.indexOf(operators[i]) > -1)
|
17925
|
+
return true;
|
17926
|
+
}
|
17927
|
+
return false;
|
17928
|
+
};
|
17897
17929
|
Helpers.prepareStringToNumber = function (val) {
|
17898
17930
|
if (typeof val !== "string" || !val)
|
17899
17931
|
return val;
|
@@ -20523,13 +20555,10 @@ var JsonMetadataClass = /** @class */ (function () {
|
|
20523
20555
|
return prop;
|
20524
20556
|
};
|
20525
20557
|
JsonMetadataClass.prototype.addDependsOnProperties = function (prop, dependsOn) {
|
20526
|
-
|
20527
|
-
|
20528
|
-
|
20529
|
-
|
20530
|
-
}
|
20531
|
-
else {
|
20532
|
-
this.addDependsOnProperty(prop, dependsOn);
|
20558
|
+
var dArray = Array.isArray(dependsOn) ? dependsOn : [dependsOn];
|
20559
|
+
prop.dependsOn = dArray;
|
20560
|
+
for (var i = 0; i < dArray.length; i++) {
|
20561
|
+
this.addDependsOnProperty(prop, dArray[i]);
|
20533
20562
|
}
|
20534
20563
|
};
|
20535
20564
|
JsonMetadataClass.prototype.addDependsOnProperty = function (prop, dependsOn) {
|
@@ -21237,27 +21266,43 @@ var JsonObject = /** @class */ (function () {
|
|
21237
21266
|
}
|
21238
21267
|
properties = this.addDynamicProperties(obj, jsonObj, properties);
|
21239
21268
|
this.options = options;
|
21269
|
+
var processedProps = {};
|
21270
|
+
processedProps[JsonObject.typePropertyName] = true;
|
21271
|
+
var parentProps = {};
|
21240
21272
|
for (var key in jsonObj) {
|
21241
|
-
|
21242
|
-
continue;
|
21243
|
-
if (key === JsonObject.positionPropertyName) {
|
21244
|
-
obj[key] = jsonObj[key];
|
21245
|
-
continue;
|
21246
|
-
}
|
21247
|
-
var property = this.findProperty(properties, key);
|
21248
|
-
if (!property) {
|
21249
|
-
if (needAddErrors) {
|
21250
|
-
this.addNewError(new JsonUnknownPropertyError(key.toString(), objType), jsonObj, obj);
|
21251
|
-
}
|
21252
|
-
continue;
|
21253
|
-
}
|
21254
|
-
this.valueToObj(jsonObj[key], obj, property, jsonObj, options);
|
21273
|
+
this.setPropertyValueToObj(jsonObj, obj, key, properties, processedProps, parentProps, objType, needAddErrors, options);
|
21255
21274
|
}
|
21256
21275
|
this.options = undefined;
|
21257
21276
|
if (obj.endLoadingFromJson) {
|
21258
21277
|
obj.endLoadingFromJson();
|
21259
21278
|
}
|
21260
21279
|
};
|
21280
|
+
JsonObject.prototype.setPropertyValueToObj = function (jsonObj, obj, key, properties, processedProps, parentProps, objType, needAddErrors, options) {
|
21281
|
+
var _this = this;
|
21282
|
+
if (processedProps[key])
|
21283
|
+
return;
|
21284
|
+
if (key === JsonObject.positionPropertyName) {
|
21285
|
+
obj[key] = jsonObj[key];
|
21286
|
+
return;
|
21287
|
+
}
|
21288
|
+
var property = this.findProperty(properties, key);
|
21289
|
+
if (!property && needAddErrors) {
|
21290
|
+
this.addNewError(new JsonUnknownPropertyError(key.toString(), objType), jsonObj, obj);
|
21291
|
+
}
|
21292
|
+
if (property) {
|
21293
|
+
var dProps = property.dependsOn;
|
21294
|
+
if (Array.isArray(dProps)) {
|
21295
|
+
parentProps[key] = true;
|
21296
|
+
dProps.forEach(function (propKey) {
|
21297
|
+
if (!parentProps[propKey]) {
|
21298
|
+
_this.setPropertyValueToObj(jsonObj, obj, propKey, properties, processedProps, parentProps, objType, needAddErrors, options);
|
21299
|
+
}
|
21300
|
+
});
|
21301
|
+
}
|
21302
|
+
this.valueToObj(jsonObj[key], obj, property, jsonObj, options);
|
21303
|
+
processedProps[key] = true;
|
21304
|
+
}
|
21305
|
+
};
|
21261
21306
|
JsonObject.prototype.toJsonObjectCore = function (obj, property, options) {
|
21262
21307
|
if (!obj || !obj.getType)
|
21263
21308
|
return obj;
|
@@ -35748,7 +35793,8 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_0__["Serializer"].addClass("panelbase", [
|
|
35748
35793
|
{
|
35749
35794
|
name: "layoutColumns:panellayoutcolumns",
|
35750
35795
|
className: "panellayoutcolumn", isArray: true,
|
35751
|
-
onSerializeValue: function (obj) { return obj.getSerializableColumnsValue(); }
|
35796
|
+
onSerializeValue: function (obj) { return obj.getSerializableColumnsValue(); },
|
35797
|
+
visibleIf: function (obj) { return !!obj && !!obj.survey && obj.survey.gridLayoutEnabled; }
|
35752
35798
|
},
|
35753
35799
|
{ name: "title:text", serializationProperty: "locTitle" },
|
35754
35800
|
{ name: "description:text", serializationProperty: "locDescription" },
|
@@ -35780,7 +35826,10 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_0__["Serializer"].addClass("panel", [
|
|
35780
35826
|
name: "colSpan:number", visible: false,
|
35781
35827
|
onSerializeValue: function (obj) { return obj.getPropertyValue("colSpan"); },
|
35782
35828
|
},
|
35783
|
-
{
|
35829
|
+
{
|
35830
|
+
name: "effectiveColSpan:number", minValue: 1, isSerializable: false,
|
35831
|
+
visibleIf: function (obj) { return !!obj && !!obj.survey && obj.survey.gridLayoutEnabled; }
|
35832
|
+
},
|
35784
35833
|
{ name: "innerIndent:number", default: 0, choices: [0, 1, 2, 3] },
|
35785
35834
|
{ name: "indent:number", default: 0, choices: [0, 1, 2, 3], visible: false },
|
35786
35835
|
{
|
@@ -37179,11 +37228,12 @@ function setStyles() {
|
|
37179
37228
|
/*!******************************************!*\
|
37180
37229
|
!*** ./src/popup-dropdown-view-model.ts ***!
|
37181
37230
|
\******************************************/
|
37182
|
-
/*! exports provided: PopupDropdownViewModel */
|
37231
|
+
/*! exports provided: calculateIsTablet, PopupDropdownViewModel */
|
37183
37232
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
37184
37233
|
|
37185
37234
|
"use strict";
|
37186
37235
|
__webpack_require__.r(__webpack_exports__);
|
37236
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "calculateIsTablet", function() { return calculateIsTablet; });
|
37187
37237
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "PopupDropdownViewModel", function() { return PopupDropdownViewModel; });
|
37188
37238
|
/* harmony import */ var _jsonobject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./jsonobject */ "./src/jsonobject.ts");
|
37189
37239
|
/* harmony import */ var _utils_popup__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils/popup */ "./src/utils/popup.ts");
|
@@ -37220,6 +37270,13 @@ var __decorate = (undefined && undefined.__decorate) || function (decorators, ta
|
|
37220
37270
|
|
37221
37271
|
|
37222
37272
|
|
37273
|
+
function calculateIsTablet(windowWidth, windowHeight) {
|
37274
|
+
var _windowWidth = windowWidth || _global_variables_utils__WEBPACK_IMPORTED_MODULE_6__["DomWindowHelper"].getInnerWidth();
|
37275
|
+
var _windowHeight = windowHeight || _global_variables_utils__WEBPACK_IMPORTED_MODULE_6__["DomWindowHelper"].getInnerHeight();
|
37276
|
+
var width = Math.min(_windowWidth, _windowHeight);
|
37277
|
+
var isTablet = width >= PopupDropdownViewModel.tabletSizeBreakpoint;
|
37278
|
+
return isTablet;
|
37279
|
+
}
|
37223
37280
|
var PopupDropdownViewModel = /** @class */ (function (_super) {
|
37224
37281
|
__extends(PopupDropdownViewModel, _super);
|
37225
37282
|
function PopupDropdownViewModel(model, targetElement, areaElement) {
|
@@ -37260,8 +37317,7 @@ var PopupDropdownViewModel = /** @class */ (function (_super) {
|
|
37260
37317
|
return _this;
|
37261
37318
|
}
|
37262
37319
|
PopupDropdownViewModel.prototype.calculateIsTablet = function (windowWidth, windowHeight) {
|
37263
|
-
|
37264
|
-
this.isTablet = width >= PopupDropdownViewModel.tabletSizeBreakpoint;
|
37320
|
+
this.isTablet = calculateIsTablet(windowWidth, windowHeight);
|
37265
37321
|
};
|
37266
37322
|
PopupDropdownViewModel.prototype.getAvailableAreaRect = function () {
|
37267
37323
|
if (this.areaElement) {
|
@@ -37351,10 +37407,11 @@ var PopupDropdownViewModel = /** @class */ (function (_super) {
|
|
37351
37407
|
return actualHorizontalPosition;
|
37352
37408
|
};
|
37353
37409
|
PopupDropdownViewModel.prototype.getStyleClass = function () {
|
37410
|
+
var overlayMode = this.model.overlayDisplayMode;
|
37354
37411
|
return _super.prototype.getStyleClass.call(this)
|
37355
37412
|
.append("sv-popup--dropdown", !this.isOverlay)
|
37356
|
-
.append("sv-popup--dropdown-overlay", this.isOverlay &&
|
37357
|
-
.append("sv-popup--tablet", this.
|
37413
|
+
.append("sv-popup--dropdown-overlay", this.isOverlay && overlayMode !== "plain")
|
37414
|
+
.append("sv-popup--tablet", this.isOverlay && (overlayMode == "tablet-dropdown-overlay" || (overlayMode == "auto" && this.isTablet)))
|
37358
37415
|
.append("sv-popup--show-pointer", !this.isOverlay && this.showHeader)
|
37359
37416
|
.append("sv-popup--" + this.popupDirection, !this.isOverlay && (this.showHeader || this.popupDirection == "top" || this.popupDirection == "bottom"));
|
37360
37417
|
};
|
@@ -37392,7 +37449,7 @@ var PopupDropdownViewModel = /** @class */ (function (_super) {
|
|
37392
37449
|
this.container.addEventListener("touchstart", this.touchStartEventCallback);
|
37393
37450
|
this.container.addEventListener("touchmove", this.touchMoveEventCallback);
|
37394
37451
|
}
|
37395
|
-
this.calculateIsTablet(
|
37452
|
+
this.calculateIsTablet();
|
37396
37453
|
this.resizeEventCallback();
|
37397
37454
|
}
|
37398
37455
|
_global_variables_utils__WEBPACK_IMPORTED_MODULE_6__["DomWindowHelper"].addEventListener("scroll", this.scrollEventCallBack);
|
@@ -38637,6 +38694,24 @@ var PopupModel = /** @class */ (function (_super) {
|
|
38637
38694
|
this.onFooterActionsCreated.fire(this, options);
|
38638
38695
|
return options.actions;
|
38639
38696
|
};
|
38697
|
+
PopupModel.prototype.updateDisplayMode = function (menuType) {
|
38698
|
+
switch (menuType) {
|
38699
|
+
case "dropdown": {
|
38700
|
+
this.displayMode = "popup";
|
38701
|
+
break;
|
38702
|
+
}
|
38703
|
+
case "popup": {
|
38704
|
+
this.displayMode = "overlay";
|
38705
|
+
this.overlayDisplayMode = "tablet-dropdown-overlay";
|
38706
|
+
break;
|
38707
|
+
}
|
38708
|
+
case "overlay": {
|
38709
|
+
this.displayMode = "overlay";
|
38710
|
+
this.overlayDisplayMode = "dropdown-overlay";
|
38711
|
+
break;
|
38712
|
+
}
|
38713
|
+
}
|
38714
|
+
};
|
38640
38715
|
PopupModel.prototype.onHiding = function () {
|
38641
38716
|
this.refreshInnerModel();
|
38642
38717
|
this.onHide();
|
@@ -38831,9 +38906,10 @@ var ProgressButtons = /** @class */ (function (_super) {
|
|
38831
38906
|
if (!listContainerElement)
|
38832
38907
|
return;
|
38833
38908
|
var listContainerElements = element.querySelectorAll(".sd-progress-buttons__connector");
|
38834
|
-
var circleWidth = this.showItemNumbers ?
|
38835
|
-
|
38836
|
-
|
38909
|
+
var circleWidth = this.showItemNumbers ? 36 : 20;
|
38910
|
+
// const sideCorrection = this.survey.isMobile ? circleWidth : listContainerElement.children[0].clientWidth;
|
38911
|
+
// const connectorWidth = (listContainerElement.clientWidth - sideCorrection) / (listContainerElement.children.length - 1) - circleWidth;
|
38912
|
+
var connectorWidth = (listContainerElement.clientWidth - circleWidth) / (listContainerElement.children.length - 1) - circleWidth;
|
38837
38913
|
for (var i = 0; i < listContainerElements.length; i++) {
|
38838
38914
|
listContainerElements[i].style.width = connectorWidth + "px";
|
38839
38915
|
}
|
@@ -38915,6 +38991,7 @@ var ProgressButtonsResponsivityManager = /** @class */ (function () {
|
|
38915
38991
|
this.canShowItemTitles = true;
|
38916
38992
|
this.processResponsiveness = function (model, options) {
|
38917
38993
|
_this.viewModel.onUpdateScroller(model.isListContainerHasScroller(_this.element));
|
38994
|
+
_this.model.clearConnectorsWidth(_this.element);
|
38918
38995
|
if (!model.showItemTitles) {
|
38919
38996
|
_this.model.adjustConnectors(_this.element);
|
38920
38997
|
return;
|
@@ -38926,7 +39003,6 @@ var ProgressButtonsResponsivityManager = /** @class */ (function () {
|
|
38926
39003
|
_this.viewModel.onResize(_this.canShowItemTitles);
|
38927
39004
|
return;
|
38928
39005
|
}
|
38929
|
-
_this.model.clearConnectorsWidth(_this.element);
|
38930
39006
|
if (_this.timer !== undefined) {
|
38931
39007
|
clearTimeout(_this.timer);
|
38932
39008
|
}
|
@@ -39031,9 +39107,6 @@ var TriggerExpressionInfo = /** @class */ (function () {
|
|
39031
39107
|
}
|
39032
39108
|
return TriggerExpressionInfo;
|
39033
39109
|
}());
|
39034
|
-
function querySelectorIncludingSelf(el, selector) {
|
39035
|
-
return el.querySelector(selector) || el != _global_variables_utils__WEBPACK_IMPORTED_MODULE_14__["DomWindowHelper"].getWindow() && el.matches(selector) && el;
|
39036
|
-
}
|
39037
39110
|
/**
|
39038
39111
|
* A base class for all questions.
|
39039
39112
|
*/
|
@@ -41938,6 +42011,9 @@ var Question = /** @class */ (function (_super) {
|
|
41938
42011
|
Question.prototype.processPopupVisiblilityChanged = function (popupModel, visible) {
|
41939
42012
|
this.survey.processPopupVisiblityChanged(this, popupModel, visible);
|
41940
42013
|
};
|
42014
|
+
Question.prototype.processOpenDropdownMenu = function (options) {
|
42015
|
+
this.survey.processOpenDropdownMenu(this, options);
|
42016
|
+
};
|
41941
42017
|
Question.prototype.onTextKeyDownHandler = function (event) {
|
41942
42018
|
if (event.keyCode === 13) {
|
41943
42019
|
this.survey.questionEditFinishCallback(this, event);
|
@@ -41991,7 +42067,7 @@ var Question = /** @class */ (function (_super) {
|
|
41991
42067
|
var scrollableSelector_1 = this.getObservedElementSelector();
|
41992
42068
|
if (!scrollableSelector_1)
|
41993
42069
|
return;
|
41994
|
-
var defaultRootEl =
|
42070
|
+
var defaultRootEl = el.querySelector(scrollableSelector_1);
|
41995
42071
|
if (!defaultRootEl)
|
41996
42072
|
return;
|
41997
42073
|
var isProcessed_1 = false;
|
@@ -42003,7 +42079,7 @@ var Question = /** @class */ (function (_super) {
|
|
42003
42079
|
isProcessed_1 = false;
|
42004
42080
|
}
|
42005
42081
|
var callback = function () {
|
42006
|
-
var rootEl =
|
42082
|
+
var rootEl = el.querySelector(scrollableSelector_1);
|
42007
42083
|
if (!requiredWidth_1 && _this.isDefaultRendering()) {
|
42008
42084
|
requiredWidth_1 = rootEl.scrollWidth;
|
42009
42085
|
}
|
@@ -42028,10 +42104,8 @@ var Question = /** @class */ (function (_super) {
|
|
42028
42104
|
});
|
42029
42105
|
this.onMobileChangedCallback = function () {
|
42030
42106
|
setTimeout(function () {
|
42031
|
-
var rootEl =
|
42032
|
-
|
42033
|
-
_this.processResponsiveness(requiredWidth_1, Object(_utils_utils__WEBPACK_IMPORTED_MODULE_11__["getElementWidth"])(rootEl));
|
42034
|
-
}
|
42107
|
+
var rootEl = el.querySelector(scrollableSelector_1);
|
42108
|
+
_this.processResponsiveness(requiredWidth_1, Object(_utils_utils__WEBPACK_IMPORTED_MODULE_11__["getElementWidth"])(rootEl));
|
42035
42109
|
}, 0);
|
42036
42110
|
};
|
42037
42111
|
this.resizeObserver.observe(el);
|
@@ -42279,7 +42353,10 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_1__["Serializer"].addClass("question", [
|
|
42279
42353
|
name: "colSpan:number", visible: false,
|
42280
42354
|
onSerializeValue: function (obj) { return obj.getPropertyValue("colSpan"); },
|
42281
42355
|
},
|
42282
|
-
{
|
42356
|
+
{
|
42357
|
+
name: "effectiveColSpan:number", minValue: 1, isSerializable: false,
|
42358
|
+
visibleIf: function (obj) { return !!obj && !!obj.survey && obj.survey.gridLayoutEnabled; }
|
42359
|
+
},
|
42283
42360
|
{ name: "startWithNewLine:boolean", default: true, layout: "row" },
|
42284
42361
|
{ name: "indent:number", default: 0, choices: [0, 1, 2, 3], layout: "row" },
|
42285
42362
|
{
|
@@ -42665,7 +42742,6 @@ var QuestionSelectBase = /** @class */ (function (_super) {
|
|
42665
42742
|
_this.isUpdatingChoicesDependedQuestions = false;
|
42666
42743
|
_this.headItemsCount = 0;
|
42667
42744
|
_this.footItemsCount = 0;
|
42668
|
-
_this.allowMultiColumns = true;
|
42669
42745
|
_this.prevIsOtherSelected = false;
|
42670
42746
|
_this.noneItemValue = _this.createDefaultItem(_settings__WEBPACK_IMPORTED_MODULE_9__["settings"].noneItemValue, "noneText", "noneItemText");
|
42671
42747
|
_this.refuseItemValue = _this.createDefaultItem(_settings__WEBPACK_IMPORTED_MODULE_9__["settings"].refuseItemValue, "refuseText", "refuseItemText");
|
@@ -43081,6 +43157,9 @@ var QuestionSelectBase = /** @class */ (function (_super) {
|
|
43081
43157
|
_super.prototype.runCondition.call(this, values, properties);
|
43082
43158
|
this.runItemsEnableCondition(values, properties);
|
43083
43159
|
this.runItemsCondition(values, properties);
|
43160
|
+
this.choices.forEach(function (item) {
|
43161
|
+
item.runConditionCore(values, properties);
|
43162
|
+
});
|
43084
43163
|
};
|
43085
43164
|
QuestionSelectBase.prototype.isTextValue = function () {
|
43086
43165
|
return true; //for comments and others
|
@@ -44686,23 +44765,9 @@ var QuestionSelectBase = /** @class */ (function (_super) {
|
|
44686
44765
|
enumerable: false,
|
44687
44766
|
configurable: true
|
44688
44767
|
});
|
44689
|
-
QuestionSelectBase.prototype.getObservedElementSelector = function () {
|
44690
|
-
return Object(_utils_utils__WEBPACK_IMPORTED_MODULE_11__["classesToSelector"])(this.cssClasses.mainRoot);
|
44691
|
-
};
|
44692
|
-
QuestionSelectBase.prototype.supportResponsiveness = function () {
|
44693
|
-
return true;
|
44694
|
-
};
|
44695
|
-
QuestionSelectBase.prototype.onBeforeSetCompactRenderer = function () {
|
44696
|
-
_super.prototype.onBeforeSetDesktopRenderer.call(this);
|
44697
|
-
this.allowMultiColumns = false;
|
44698
|
-
};
|
44699
|
-
QuestionSelectBase.prototype.onBeforeSetDesktopRenderer = function () {
|
44700
|
-
_super.prototype.onBeforeSetDesktopRenderer.call(this);
|
44701
|
-
this.allowMultiColumns = true;
|
44702
|
-
};
|
44703
44768
|
Object.defineProperty(QuestionSelectBase.prototype, "hasColumns", {
|
44704
44769
|
get: function () {
|
44705
|
-
return !this.isMobile &&
|
44770
|
+
return !this.isMobile &&
|
44706
44771
|
(this.getCurrentColCount() > 1);
|
44707
44772
|
},
|
44708
44773
|
enumerable: false,
|
@@ -44860,9 +44925,6 @@ var QuestionSelectBase = /** @class */ (function (_super) {
|
|
44860
44925
|
__decorate([
|
44861
44926
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])({ localizable: true })
|
44862
44927
|
], QuestionSelectBase.prototype, "otherPlaceholder", void 0);
|
44863
|
-
__decorate([
|
44864
|
-
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])()
|
44865
|
-
], QuestionSelectBase.prototype, "allowMultiColumns", void 0);
|
44866
44928
|
return QuestionSelectBase;
|
44867
44929
|
}(_question__WEBPACK_IMPORTED_MODULE_2__["Question"]));
|
44868
44930
|
|
@@ -47316,6 +47378,9 @@ var QuestionCustomModelBase = /** @class */ (function (_super) {
|
|
47316
47378
|
QuestionCustomModelBase.prototype.findQuestionByName = function (name) {
|
47317
47379
|
return !!this.data ? this.data.findQuestionByName(name) : null;
|
47318
47380
|
};
|
47381
|
+
QuestionCustomModelBase.prototype.getEditingSurveyElement = function () {
|
47382
|
+
return undefined;
|
47383
|
+
};
|
47319
47384
|
//IPanel
|
47320
47385
|
QuestionCustomModelBase.prototype.addElement = function (element, index) { };
|
47321
47386
|
QuestionCustomModelBase.prototype.removeElement = function (element) {
|
@@ -47698,6 +47763,40 @@ var QuestionCompositeModel = /** @class */ (function (_super) {
|
|
47698
47763
|
this.contentPanel.updateElementCss(reNew);
|
47699
47764
|
}
|
47700
47765
|
};
|
47766
|
+
QuestionCompositeModel.prototype.dispose = function () {
|
47767
|
+
this.unConnectEditingObj();
|
47768
|
+
_super.prototype.dispose.call(this);
|
47769
|
+
};
|
47770
|
+
QuestionCompositeModel.prototype.updateEditingObj = function () {
|
47771
|
+
var _this = this;
|
47772
|
+
var _a;
|
47773
|
+
var obj = (_a = this.data) === null || _a === void 0 ? void 0 : _a.getEditingSurveyElement();
|
47774
|
+
if (!obj)
|
47775
|
+
return undefined;
|
47776
|
+
var newObj = obj[this.getValueName()];
|
47777
|
+
if (!!newObj && !newObj.onPropertyChanged) {
|
47778
|
+
newObj = undefined;
|
47779
|
+
}
|
47780
|
+
if (newObj !== this.editingObjValue) {
|
47781
|
+
this.unConnectEditingObj();
|
47782
|
+
this.editingObjValue = newObj;
|
47783
|
+
if (!!newObj) {
|
47784
|
+
this.onEditingObjPropertyChanged = function (sender, options) {
|
47785
|
+
_this.setNewValueIntoQuestion(options.name, _this.editingObjValue[options.name]);
|
47786
|
+
};
|
47787
|
+
newObj.onPropertyChanged.add(this.onEditingObjPropertyChanged);
|
47788
|
+
}
|
47789
|
+
}
|
47790
|
+
return this.editingObjValue;
|
47791
|
+
};
|
47792
|
+
QuestionCompositeModel.prototype.unConnectEditingObj = function () {
|
47793
|
+
if (!!this.editingObjValue && !this.editingObjValue.isDisposed) {
|
47794
|
+
this.editingObjValue.onPropertyChanged.remove(this.onEditingObjPropertyChanged);
|
47795
|
+
}
|
47796
|
+
};
|
47797
|
+
QuestionCompositeModel.prototype.getEditingSurveyElement = function () {
|
47798
|
+
return this.editingObjValue;
|
47799
|
+
};
|
47701
47800
|
QuestionCompositeModel.prototype.getTextProcessor = function () {
|
47702
47801
|
return this.textProcessing;
|
47703
47802
|
};
|
@@ -47757,6 +47856,11 @@ var QuestionCompositeModel = /** @class */ (function (_super) {
|
|
47757
47856
|
}
|
47758
47857
|
_super.prototype.onReadOnlyChanged.call(this);
|
47759
47858
|
};
|
47859
|
+
QuestionCompositeModel.prototype.updateValueFromSurvey = function (newValue, clearData) {
|
47860
|
+
if (clearData === void 0) { clearData = false; }
|
47861
|
+
this.updateEditingObj();
|
47862
|
+
_super.prototype.updateValueFromSurvey.call(this, newValue, clearData);
|
47863
|
+
};
|
47760
47864
|
QuestionCompositeModel.prototype.onSurveyLoad = function () {
|
47761
47865
|
this.isSettingValOnLoading = true;
|
47762
47866
|
if (!!this.contentPanel) {
|
@@ -47928,7 +48032,7 @@ var QuestionCompositeModel = /** @class */ (function (_super) {
|
|
47928
48032
|
var key = questions[i].getValueName();
|
47929
48033
|
var val = !!newValue ? newValue[key] : undefined;
|
47930
48034
|
var q = questions[i];
|
47931
|
-
if (!this.isTwoValueEquals(q.value, val)) {
|
48035
|
+
if (!this.isTwoValueEquals(q.value, val) && (val !== undefined || !q.isEmpty())) {
|
47932
48036
|
q.value = val;
|
47933
48037
|
}
|
47934
48038
|
}
|
@@ -49216,6 +49320,14 @@ var QuestionFileModelBase = /** @class */ (function (_super) {
|
|
49216
49320
|
});
|
49217
49321
|
}
|
49218
49322
|
};
|
49323
|
+
QuestionFileModelBase.prototype.loadPreview = function (newValue) { };
|
49324
|
+
QuestionFileModelBase.prototype.onChangeQuestionValue = function (newValue) {
|
49325
|
+
_super.prototype.onChangeQuestionValue.call(this, newValue);
|
49326
|
+
this.stateChanged(this.isEmpty() ? "empty" : "loaded");
|
49327
|
+
if (!this.isLoadingFromJson) {
|
49328
|
+
this.loadPreview(newValue);
|
49329
|
+
}
|
49330
|
+
};
|
49219
49331
|
__decorate([
|
49220
49332
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])()
|
49221
49333
|
], QuestionFileModelBase.prototype, "isUploading", void 0);
|
@@ -49399,6 +49511,15 @@ var QuestionFileModel = /** @class */ (function (_super) {
|
|
49399
49511
|
_this.fileNavigator.actions = [_this.prevFileAction, _this.fileIndexAction, _this.nextFileAction];
|
49400
49512
|
return _this;
|
49401
49513
|
}
|
49514
|
+
Object.defineProperty(QuestionFileModel.prototype, "isFileLoading", {
|
49515
|
+
get: function () { return this.isFileLoadingValue; },
|
49516
|
+
set: function (val) {
|
49517
|
+
this.isFileLoadingValue = val;
|
49518
|
+
this.updateIsReady();
|
49519
|
+
},
|
49520
|
+
enumerable: false,
|
49521
|
+
configurable: true
|
49522
|
+
});
|
49402
49523
|
Object.defineProperty(QuestionFileModel.prototype, "fileNavigatorVisible", {
|
49403
49524
|
get: function () {
|
49404
49525
|
var isUploading = this.isUploading;
|
@@ -49650,9 +49771,11 @@ var QuestionFileModel = /** @class */ (function (_super) {
|
|
49650
49771
|
});
|
49651
49772
|
QuestionFileModel.prototype.chooseFile = function (event) {
|
49652
49773
|
var _this = this;
|
49653
|
-
if (!
|
49774
|
+
if (!this.rootElement)
|
49775
|
+
return;
|
49776
|
+
var inputElement = this.rootElement.querySelector("#" + this.inputId);
|
49777
|
+
if (!inputElement)
|
49654
49778
|
return;
|
49655
|
-
var inputElement = _global_variables_utils__WEBPACK_IMPORTED_MODULE_12__["DomDocumentHelper"].getDocument().getElementById(this.inputId);
|
49656
49779
|
event.preventDefault();
|
49657
49780
|
event.stopImmediatePropagation();
|
49658
49781
|
if (inputElement) {
|
@@ -49997,7 +50120,7 @@ var QuestionFileModel = /** @class */ (function (_super) {
|
|
49997
50120
|
}
|
49998
50121
|
this.isFileLoading = true;
|
49999
50122
|
this._previewLoader = new FileLoader(this, function (status, loaded) {
|
50000
|
-
if (status
|
50123
|
+
if (status !== "error") {
|
50001
50124
|
loaded.forEach(function (val) {
|
50002
50125
|
_this.previewValue.push(val);
|
50003
50126
|
});
|
@@ -50011,15 +50134,6 @@ var QuestionFileModel = /** @class */ (function (_super) {
|
|
50011
50134
|
}
|
50012
50135
|
this.previewValueChanged();
|
50013
50136
|
};
|
50014
|
-
Object.defineProperty(QuestionFileModel.prototype, "isFileLoading", {
|
50015
|
-
get: function () { return this.isFileLoadingValue; },
|
50016
|
-
set: function (val) {
|
50017
|
-
this.isFileLoadingValue = val;
|
50018
|
-
this.updateIsReady();
|
50019
|
-
},
|
50020
|
-
enumerable: false,
|
50021
|
-
configurable: true
|
50022
|
-
});
|
50023
50137
|
QuestionFileModel.prototype.getIsQuestionReady = function () {
|
50024
50138
|
return _super.prototype.getIsQuestionReady.call(this) && !this.isFileLoading;
|
50025
50139
|
};
|
@@ -50135,13 +50249,6 @@ var QuestionFileModel = /** @class */ (function (_super) {
|
|
50135
50249
|
src.value = "";
|
50136
50250
|
this.loadFiles(files);
|
50137
50251
|
};
|
50138
|
-
QuestionFileModel.prototype.onChangeQuestionValue = function (newValue) {
|
50139
|
-
_super.prototype.onChangeQuestionValue.call(this, newValue);
|
50140
|
-
this.stateChanged(this.isEmpty() ? "empty" : "loaded");
|
50141
|
-
if (!this.isLoadingFromJson) {
|
50142
|
-
this.loadPreview(newValue);
|
50143
|
-
}
|
50144
|
-
};
|
50145
50252
|
QuestionFileModel.prototype.calcCssClasses = function (css) {
|
50146
50253
|
var classes = _super.prototype.calcCssClasses.call(this, css);
|
50147
50254
|
this.actionsContainer.cssClasses = css.actionBar;
|
@@ -50199,9 +50306,11 @@ var QuestionFileModel = /** @class */ (function (_super) {
|
|
50199
50306
|
return false;
|
50200
50307
|
};
|
50201
50308
|
QuestionFileModel.prototype.canDragDrop = function () { return !this.isInputReadOnly && this.currentMode !== "camera" && !this.isPlayingVideo; };
|
50202
|
-
QuestionFileModel.prototype.
|
50309
|
+
QuestionFileModel.prototype.afterRenderQuestionElement = function (el) {
|
50203
50310
|
this.rootElement = el;
|
50204
|
-
|
50311
|
+
};
|
50312
|
+
QuestionFileModel.prototype.beforeDestroyQuestionElement = function (el) {
|
50313
|
+
this.rootElement = undefined;
|
50205
50314
|
};
|
50206
50315
|
QuestionFileModel.prototype.clearFilesCore = function () {
|
50207
50316
|
if (this.rootElement) {
|
@@ -50354,7 +50463,7 @@ var FileLoader = /** @class */ (function () {
|
|
50354
50463
|
if (!_this.fileQuestion || !_this.callback) {
|
50355
50464
|
return;
|
50356
50465
|
}
|
50357
|
-
if (status
|
50466
|
+
if (status !== "error") {
|
50358
50467
|
_this.loaded[index] = {
|
50359
50468
|
content: data,
|
50360
50469
|
name: value.name,
|
@@ -50362,7 +50471,7 @@ var FileLoader = /** @class */ (function () {
|
|
50362
50471
|
};
|
50363
50472
|
downloadedCount++;
|
50364
50473
|
if (downloadedCount === files.length) {
|
50365
|
-
_this.callback(
|
50474
|
+
_this.callback(status, _this.loaded);
|
50366
50475
|
}
|
50367
50476
|
}
|
50368
50477
|
else {
|
@@ -51890,8 +51999,8 @@ var QuestionMatrixModel = /** @class */ (function (_super) {
|
|
51890
51999
|
*
|
51891
52000
|
* Possible values:
|
51892
52001
|
*
|
51893
|
-
* - "initial" (default) - Preserves the original order of the `rows` array.
|
51894
|
-
* - "random" - Arranges matrix rows in random order each time the question is displayed.
|
52002
|
+
* - `"initial"` (default) - Preserves the original order of the `rows` array.
|
52003
|
+
* - `"random"` - Arranges matrix rows in random order each time the question is displayed.
|
51895
52004
|
* @see rows
|
51896
52005
|
*/
|
51897
52006
|
get: function () {
|
@@ -53148,6 +53257,7 @@ var MatrixDropdownRowModelBase = /** @class */ (function () {
|
|
53148
53257
|
var survey = this.getSurvey();
|
53149
53258
|
return !!survey ? survey.getQuestionByName(name) : null;
|
53150
53259
|
};
|
53260
|
+
MatrixDropdownRowModelBase.prototype.getEditingSurveyElement = function () { return undefined; };
|
53151
53261
|
MatrixDropdownRowModelBase.prototype.setValueCore = function (name, newColumnValue, isComment) {
|
53152
53262
|
if (this.isSettingValue)
|
53153
53263
|
return;
|
@@ -56495,30 +56605,34 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_0__["Serializer"].addClass("matrixdropdownc
|
|
56495
56605
|
},
|
56496
56606
|
{
|
56497
56607
|
name: "totalType",
|
56608
|
+
visibleIf: function (obj) { return !obj.isShowInMultipleColumns; },
|
56498
56609
|
default: "none",
|
56499
56610
|
choices: ["none", "sum", "count", "min", "max", "avg"],
|
56500
56611
|
},
|
56501
|
-
"totalExpression:expression",
|
56502
|
-
{ name: "totalFormat", serializationProperty: "locTotalFormat" },
|
56612
|
+
{ name: "totalExpression:expression", visibleIf: function (obj) { return !obj.isShowInMultipleColumns; } },
|
56613
|
+
{ name: "totalFormat", serializationProperty: "locTotalFormat", visibleIf: function (obj) { return obj.hasTotal; } },
|
56503
56614
|
{
|
56504
56615
|
name: "totalDisplayStyle",
|
56616
|
+
visibleIf: function (obj) { return obj.hasTotal; },
|
56505
56617
|
default: "none",
|
56506
56618
|
choices: ["none", "decimal", "currency", "percent"],
|
56507
56619
|
},
|
56508
56620
|
{
|
56509
56621
|
name: "totalAlignment",
|
56622
|
+
visibleIf: function (obj) { return obj.hasTotal; },
|
56510
56623
|
default: "auto",
|
56511
56624
|
choices: ["auto", "left", "center", "right"],
|
56512
56625
|
},
|
56513
56626
|
{
|
56514
56627
|
name: "totalCurrency",
|
56628
|
+
visibleIf: function (obj) { return obj.hasTotal; },
|
56515
56629
|
choices: function () {
|
56516
56630
|
return Object(_question_expression__WEBPACK_IMPORTED_MODULE_2__["getCurrecyCodes"])();
|
56517
56631
|
},
|
56518
56632
|
default: "USD",
|
56519
56633
|
},
|
56520
|
-
{ name: "totalMaximumFractionDigits:number", default: -1 },
|
56521
|
-
{ name: "totalMinimumFractionDigits:number", default: -1 },
|
56634
|
+
{ name: "totalMaximumFractionDigits:number", default: -1, visibleIf: function (obj) { return obj.hasTotal; } },
|
56635
|
+
{ name: "totalMinimumFractionDigits:number", default: -1, visibleIf: function (obj) { return obj.hasTotal; } },
|
56522
56636
|
{ name: "renderAs", default: "default", visible: false },
|
56523
56637
|
], function () {
|
56524
56638
|
return new MatrixDropdownColumn("");
|
@@ -59455,6 +59569,7 @@ var MultipleTextItemModel = /** @class */ (function (_super) {
|
|
59455
59569
|
var survey = this.getSurvey();
|
59456
59570
|
return !!survey ? survey.getQuestionByName(name) : null;
|
59457
59571
|
};
|
59572
|
+
MultipleTextItemModel.prototype.getEditingSurveyElement = function () { return undefined; };
|
59458
59573
|
//IValidatorOwner
|
59459
59574
|
MultipleTextItemModel.prototype.getValidatorTitle = function () {
|
59460
59575
|
return this.title;
|
@@ -60388,6 +60503,7 @@ var QuestionPanelDynamicItem = /** @class */ (function () {
|
|
60388
60503
|
var survey = this.getSurvey();
|
60389
60504
|
return !!survey ? survey.getQuestionByName(name) : null;
|
60390
60505
|
};
|
60506
|
+
QuestionPanelDynamicItem.prototype.getEditingSurveyElement = function () { return undefined; };
|
60391
60507
|
QuestionPanelDynamicItem.prototype.getAllValues = function () {
|
60392
60508
|
return this.data.getPanelItemData(this);
|
60393
60509
|
};
|
@@ -61337,7 +61453,7 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
61337
61453
|
var panel = this.createNewPanel();
|
61338
61454
|
this.panelsCore.push(panel);
|
61339
61455
|
if (this.renderMode == "list" && this.panelsState != "default") {
|
61340
|
-
if (this.panelsState === "
|
61456
|
+
if (this.panelsState === "expanded") {
|
61341
61457
|
panel.expand();
|
61342
61458
|
}
|
61343
61459
|
else {
|
@@ -65504,6 +65620,28 @@ var QuestionSignaturePadModel = /** @class */ (function (_super) {
|
|
65504
65620
|
}
|
65505
65621
|
}
|
65506
65622
|
};
|
65623
|
+
QuestionSignaturePadModel.prototype.loadPreview = function (newValue) {
|
65624
|
+
var _this = this;
|
65625
|
+
if (!this.storeDataAsText) {
|
65626
|
+
var newValues = !!newValue ? [newValue] : [];
|
65627
|
+
if (!!this._previewLoader) {
|
65628
|
+
this._previewLoader.dispose();
|
65629
|
+
}
|
65630
|
+
this.isFileLoading = true;
|
65631
|
+
this._previewLoader = new _question_file__WEBPACK_IMPORTED_MODULE_5__["FileLoader"](this, function (status, loaded) {
|
65632
|
+
_this.isFileLoading = false;
|
65633
|
+
if (loaded && loaded.length > 0 && loaded[0].content && status === "success")
|
65634
|
+
_this.fromDataUrl(loaded[0].content);
|
65635
|
+
_this._previewLoader.dispose();
|
65636
|
+
_this._previewLoader = undefined;
|
65637
|
+
});
|
65638
|
+
this._previewLoader.load(newValues);
|
65639
|
+
}
|
65640
|
+
};
|
65641
|
+
QuestionSignaturePadModel.prototype.onSurveyLoad = function () {
|
65642
|
+
_super.prototype.onSurveyLoad.call(this);
|
65643
|
+
this.loadPreview(this.value);
|
65644
|
+
};
|
65507
65645
|
QuestionSignaturePadModel.prototype.initSignaturePad = function (el) {
|
65508
65646
|
var _this = this;
|
65509
65647
|
var canvas = el.getElementsByTagName("canvas")[0];
|
@@ -66307,6 +66445,7 @@ var QuestionTextModel = /** @class */ (function (_super) {
|
|
66307
66445
|
_this.updateRemainingCharacterCounter(event.target.value);
|
66308
66446
|
};
|
66309
66447
|
_this.onKeyDown = function (event) {
|
66448
|
+
_this.updateDateValidationMessage(event);
|
66310
66449
|
_this.onKeyDownPreprocess && _this.onKeyDownPreprocess(event);
|
66311
66450
|
if (_this.isInputTextUpdate) {
|
66312
66451
|
_this._isWaitingForEnter = event.keyCode === 229;
|
@@ -66314,6 +66453,7 @@ var QuestionTextModel = /** @class */ (function (_super) {
|
|
66314
66453
|
_this.onTextKeyDownHandler(event);
|
66315
66454
|
};
|
66316
66455
|
_this.onChange = function (event) {
|
66456
|
+
_this.updateDateValidationMessage(event);
|
66317
66457
|
var elementIsFocused = event.target === _settings__WEBPACK_IMPORTED_MODULE_6__["settings"].environment.root.activeElement;
|
66318
66458
|
if (elementIsFocused) {
|
66319
66459
|
if (_this.isInputTextUpdate) {
|
@@ -66745,6 +66885,9 @@ var QuestionTextModel = /** @class */ (function (_super) {
|
|
66745
66885
|
};
|
66746
66886
|
errors.push(maxError);
|
66747
66887
|
}
|
66888
|
+
if (!!this.dateValidationMessage) {
|
66889
|
+
errors.push(new _error__WEBPACK_IMPORTED_MODULE_5__["CustomError"](this.dateValidationMessage, this));
|
66890
|
+
}
|
66748
66891
|
var valName = this.getValidatorTitle();
|
66749
66892
|
var emailValidator = new _validator__WEBPACK_IMPORTED_MODULE_4__["EmailValidator"]();
|
66750
66893
|
if (this.inputType === "email" &&
|
@@ -66895,6 +67038,9 @@ var QuestionTextModel = /** @class */ (function (_super) {
|
|
66895
67038
|
};
|
66896
67039
|
QuestionTextModel.prototype.setNewValue = function (newValue) {
|
66897
67040
|
newValue = this.correctValueType(newValue);
|
67041
|
+
if (!!newValue) {
|
67042
|
+
this.dateValidationMessage = undefined;
|
67043
|
+
}
|
66898
67044
|
_super.prototype.setNewValue.call(this, newValue);
|
66899
67045
|
};
|
66900
67046
|
QuestionTextModel.prototype.correctValueType = function (newValue) {
|
@@ -66945,6 +67091,9 @@ var QuestionTextModel = /** @class */ (function (_super) {
|
|
66945
67091
|
this.inputValue = newValue;
|
66946
67092
|
}
|
66947
67093
|
};
|
67094
|
+
QuestionTextModel.prototype.updateDateValidationMessage = function (event) {
|
67095
|
+
this.dateValidationMessage = this.isDateInputType && !!event.target ? event.target.validationMessage : undefined;
|
67096
|
+
};
|
66948
67097
|
QuestionTextModel.prototype.afterRenderQuestionElement = function (el) {
|
66949
67098
|
if (!!el) {
|
66950
67099
|
this.input = el instanceof HTMLInputElement ? el : el.querySelector("input");
|
@@ -67143,7 +67292,7 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_1__["Serializer"].addClass("text", [
|
|
67143
67292
|
name: "maskSettings:masksettings",
|
67144
67293
|
className: "masksettings",
|
67145
67294
|
visibleIndex: 1,
|
67146
|
-
dependsOn: "inputType",
|
67295
|
+
dependsOn: ["inputType", "maskType"],
|
67147
67296
|
visibleIf: function (obj) {
|
67148
67297
|
return obj.inputType === "text" || obj.inputType === "tel";
|
67149
67298
|
},
|
@@ -69076,6 +69225,18 @@ var List = /** @class */ (function (_super) {
|
|
69076
69225
|
this.model.initListContainerHtmlElement(this.listContainerRef.current);
|
69077
69226
|
}
|
69078
69227
|
};
|
69228
|
+
List.prototype.componentDidUpdate = function (prevProps, prevState) {
|
69229
|
+
var _a;
|
69230
|
+
_super.prototype.componentDidUpdate.call(this, prevProps, prevState);
|
69231
|
+
if (this.model !== prevProps.model) {
|
69232
|
+
if (this.model && !!((_a = this.listContainerRef) === null || _a === void 0 ? void 0 : _a.current)) {
|
69233
|
+
this.model.initListContainerHtmlElement(this.listContainerRef.current);
|
69234
|
+
}
|
69235
|
+
if (prevProps.model) {
|
69236
|
+
prevProps.model.initListContainerHtmlElement(undefined);
|
69237
|
+
}
|
69238
|
+
}
|
69239
|
+
};
|
69079
69240
|
List.prototype.componentWillUnmount = function () {
|
69080
69241
|
_super.prototype.componentWillUnmount.call(this);
|
69081
69242
|
if (!!this.model) {
|
@@ -74782,19 +74943,19 @@ var SurveyQuestionElementBase = /** @class */ (function (_super) {
|
|
74782
74943
|
SurveyQuestionElementBase.prototype.componentWillUnmount = function () {
|
74783
74944
|
_super.prototype.componentWillUnmount.call(this);
|
74784
74945
|
if (!!this.questionBase) {
|
74785
|
-
var
|
74786
|
-
this.questionBase.beforeDestroyQuestionElement(
|
74787
|
-
if (!!
|
74788
|
-
|
74946
|
+
var contentElement = this.content || this.control;
|
74947
|
+
this.questionBase.beforeDestroyQuestionElement(contentElement);
|
74948
|
+
if (!!contentElement) {
|
74949
|
+
contentElement.removeAttribute("data-rendered");
|
74789
74950
|
}
|
74790
74951
|
}
|
74791
74952
|
};
|
74792
74953
|
SurveyQuestionElementBase.prototype.updateDomElement = function () {
|
74793
|
-
var
|
74794
|
-
if (!!
|
74795
|
-
if (
|
74796
|
-
|
74797
|
-
this.questionBase.afterRenderQuestionElement(
|
74954
|
+
var contentElement = this.content || this.control;
|
74955
|
+
if (!!contentElement) {
|
74956
|
+
if (contentElement.getAttribute("data-rendered") !== "r") {
|
74957
|
+
contentElement.setAttribute("data-rendered", "r");
|
74958
|
+
this.questionBase.afterRenderQuestionElement(contentElement);
|
74798
74959
|
}
|
74799
74960
|
}
|
74800
74961
|
};
|
@@ -74852,6 +75013,11 @@ var SurveyQuestionElementBase = /** @class */ (function (_super) {
|
|
74852
75013
|
this.control = element;
|
74853
75014
|
}
|
74854
75015
|
};
|
75016
|
+
SurveyQuestionElementBase.prototype.setContent = function (element) {
|
75017
|
+
if (!!element) {
|
75018
|
+
this.content = element;
|
75019
|
+
}
|
75020
|
+
};
|
74855
75021
|
return SurveyQuestionElementBase;
|
74856
75022
|
}(SurveyElementBase));
|
74857
75023
|
|
@@ -75137,7 +75303,7 @@ var SurveyQuestionFile = /** @class */ (function (_super) {
|
|
75137
75303
|
else {
|
75138
75304
|
fileInput = null;
|
75139
75305
|
}
|
75140
|
-
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.question.fileRootCss },
|
75306
|
+
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.question.fileRootCss, ref: function (el) { return (_this.setContent(el)); } },
|
75141
75307
|
fileInput,
|
75142
75308
|
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 },
|
75143
75309
|
fileDecorator,
|
@@ -78363,6 +78529,7 @@ var settings = {
|
|
78363
78529
|
* const item = new ItemValue("item1");
|
78364
78530
|
* const itemString = item.toJSON(); // Produces { value: "item1", text: "item1" } instead of "item1"
|
78365
78531
|
* ```
|
78532
|
+
* @see [settings.parseNumber](https://surveyjs.io/form-library/documentation/api-reference/settings#parseNumber)
|
78366
78533
|
*/
|
78367
78534
|
serialization: {
|
78368
78535
|
itemValueSerializeAsObject: false,
|
@@ -78929,7 +79096,31 @@ var settings = {
|
|
78929
79096
|
* }
|
78930
79097
|
* ```
|
78931
79098
|
*/
|
78932
|
-
storeUtcDates: false
|
79099
|
+
storeUtcDates: false,
|
79100
|
+
/**
|
79101
|
+
* A function that allows you to define custom parsing rules for numbers represented as string values.
|
79102
|
+
*
|
79103
|
+
* The following code shows a template that you can use to implement the `parseNumber` function:
|
79104
|
+
*
|
79105
|
+
* ```js
|
79106
|
+
* import { settings } from "survey-core";
|
79107
|
+
*
|
79108
|
+
* settings.parseNumber = (stringValue, numericValue) => {
|
79109
|
+
* if (typeof stringValue !== "string" || !stringValue)
|
79110
|
+
* return numericValue;
|
79111
|
+
* let parsedNumber = numericValue;
|
79112
|
+
* // ...
|
79113
|
+
* // Parsing the number according to custom parsing rules
|
79114
|
+
* // ...
|
79115
|
+
* return parsedNumber;
|
79116
|
+
* };
|
79117
|
+
* ```
|
79118
|
+
* @param stringValue A number represented as a string value.
|
79119
|
+
* @param numericValue A number parsed using a default parsing function. `NaN` if the original string is not a number.
|
79120
|
+
* @returns A number that results from parsing the string value.
|
79121
|
+
* @see [settings.serialization](https://surveyjs.io/form-library/documentation/api-reference/settings#serialization)
|
79122
|
+
*/
|
79123
|
+
parseNumber: function (stringValue, numericValue) { return numericValue; }
|
78933
79124
|
};
|
78934
79125
|
|
78935
79126
|
|
@@ -81679,9 +81870,17 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
81679
81870
|
*/
|
81680
81871
|
_this.onGetExpressionDisplayValue = _this.addEvent();
|
81681
81872
|
/**
|
81682
|
-
* An event that is raised after the visibility of a popup is changed.
|
81873
|
+
* An event that is raised after the visibility of a popup is changed.
|
81874
|
+
*
|
81875
|
+
* This event can be raised for [Single-](https://surveyjs.io/form-library/documentation/api-reference/dropdown-menu-model) and [Multi-Select Dropdown](https://surveyjs.io/form-library/documentation/api-reference/dropdown-tag-box-model) questions and [Rating Scale](https://surveyjs.io/form-library/documentation/api-reference/rating-scale-question-model) questions [rendered as drop-down menus](https://surveyjs.io/form-library/documentation/api-reference/rating-scale-question-model#displayMode), and [Multi-Select Matrix](https://surveyjs.io/form-library/documentation/api-reference/matrix-table-with-dropdown-list) questions that contain columns of the `"dropdown"` or `"tagbox"` [`cellType`](https://surveyjs.io/form-library/documentation/api-reference/matrix-table-with-dropdown-list#cellType).
|
81683
81876
|
*/
|
81684
81877
|
_this.onPopupVisibleChanged = _this.addEvent();
|
81878
|
+
/**
|
81879
|
+
* An event that is raised when users open a drop-down menu.
|
81880
|
+
*
|
81881
|
+
* This event can be raised for [Single-](https://surveyjs.io/form-library/documentation/api-reference/dropdown-menu-model) and [Multi-Select Dropdown](https://surveyjs.io/form-library/documentation/api-reference/dropdown-tag-box-model) questions, [Rating Scale](https://surveyjs.io/form-library/documentation/api-reference/rating-scale-question-model) questions [rendered as drop-down menus](https://surveyjs.io/form-library/documentation/api-reference/rating-scale-question-model#displayMode), and [Multi-Select Matrix](https://surveyjs.io/form-library/documentation/api-reference/matrix-table-with-dropdown-list) questions that contain columns of the `"dropdown"` or `"tagbox"` [`cellType`](https://surveyjs.io/form-library/documentation/api-reference/matrix-table-with-dropdown-list#cellType). Handle this event to change the drop-down menu type for specific questions or device types.
|
81882
|
+
*/
|
81883
|
+
_this.onOpenDropdownMenu = _this.addEvent();
|
81685
81884
|
_this.onElementWrapperComponentName = _this.addEvent();
|
81686
81885
|
_this.onElementWrapperComponentData = _this.addEvent();
|
81687
81886
|
/**
|
@@ -81728,8 +81927,8 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
81728
81927
|
_this.isNavigationButtonPressed = false;
|
81729
81928
|
_this.mouseDownPage = null;
|
81730
81929
|
_this.isCalculatingProgressText = false;
|
81731
|
-
_this.isFirstPageRendering = true;
|
81732
81930
|
_this.isCurrentPageRendering = true;
|
81931
|
+
_this.isCurrentPageRendered = undefined;
|
81733
81932
|
_this.isTriggerIsRunning = false;
|
81734
81933
|
_this.triggerValues = null;
|
81735
81934
|
_this.triggerKeys = null;
|
@@ -84272,9 +84471,7 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
84272
84471
|
var _this = this;
|
84273
84472
|
if (this.editingObj == val)
|
84274
84473
|
return;
|
84275
|
-
|
84276
|
-
this.editingObj.onPropertyChanged.remove(this.onEditingObjPropertyChanged);
|
84277
|
-
}
|
84474
|
+
this.unConnectEditingObj();
|
84278
84475
|
this.editingObjValue = val;
|
84279
84476
|
if (this.isDisposed)
|
84280
84477
|
return;
|
@@ -84300,6 +84497,11 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
84300
84497
|
enumerable: false,
|
84301
84498
|
configurable: true
|
84302
84499
|
});
|
84500
|
+
SurveyModel.prototype.unConnectEditingObj = function () {
|
84501
|
+
if (!!this.editingObj && !this.editingObj.isDisposed) {
|
84502
|
+
this.editingObj.onPropertyChanged.remove(this.onEditingObjPropertyChanged);
|
84503
|
+
}
|
84504
|
+
};
|
84303
84505
|
Object.defineProperty(SurveyModel.prototype, "isEditingSurveyElement", {
|
84304
84506
|
get: function () {
|
84305
84507
|
return !!this.editingObj;
|
@@ -84977,6 +85179,9 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
84977
85179
|
oldValue.passed = true;
|
84978
85180
|
}
|
84979
85181
|
}
|
85182
|
+
if (this.isCurrentPageRendered === true) {
|
85183
|
+
this.isCurrentPageRendered = false;
|
85184
|
+
}
|
84980
85185
|
this.onCurrentPageChanged.fire(this, options);
|
84981
85186
|
};
|
84982
85187
|
SurveyModel.prototype.notifyQuestionsOnHidingContent = function (page) {
|
@@ -86433,11 +86638,11 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
86433
86638
|
SurveyModel.prototype.afterRenderPage = function (htmlElement) {
|
86434
86639
|
var _this = this;
|
86435
86640
|
if (!this.isDesignMode && !this.focusingQuestionInfo) {
|
86436
|
-
var doScroll_1 =
|
86641
|
+
var doScroll_1 = this.isCurrentPageRendered === false;
|
86437
86642
|
setTimeout(function () { return _this.scrollToTopOnPageChange(doScroll_1); }, 1);
|
86438
86643
|
}
|
86439
86644
|
this.focusQuestionInfo();
|
86440
|
-
this.
|
86645
|
+
this.isCurrentPageRendered = true;
|
86441
86646
|
if (this.onAfterRenderPage.isEmpty)
|
86442
86647
|
return;
|
86443
86648
|
this.onAfterRenderPage.fire(this, {
|
@@ -86828,7 +87033,7 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
86828
87033
|
*/
|
86829
87034
|
SurveyModel.prototype.downloadFile = function (question, questionName, fileValue, callback) {
|
86830
87035
|
if (this.onDownloadFile.isEmpty) {
|
86831
|
-
!!callback && callback("
|
87036
|
+
!!callback && callback("skipped", fileValue.content || fileValue);
|
86832
87037
|
}
|
86833
87038
|
this.onDownloadFile.fire(this, {
|
86834
87039
|
question: question,
|
@@ -86975,6 +87180,7 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
86975
87180
|
SurveyModel.prototype.findQuestionByName = function (name) {
|
86976
87181
|
return this.getQuestionByName(name);
|
86977
87182
|
};
|
87183
|
+
SurveyModel.prototype.getEditingSurveyElement = function () { return this.editingObjValue; };
|
86978
87184
|
/**
|
86979
87185
|
* Returns a question with a specified [`valueName`](https://surveyjs.io/form-library/documentation/api-reference/question#valueName).
|
86980
87186
|
*
|
@@ -89181,6 +89387,11 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
89181
89387
|
SurveyModel.prototype.processPopupVisiblityChanged = function (question, popup, visible) {
|
89182
89388
|
this.onPopupVisibleChanged.fire(this, { question: question, popup: popup, visible: visible });
|
89183
89389
|
};
|
89390
|
+
SurveyModel.prototype.processOpenDropdownMenu = function (question, options) {
|
89391
|
+
var newOptions = Object.assign({ question: question }, options);
|
89392
|
+
this.onOpenDropdownMenu.fire(this, newOptions);
|
89393
|
+
options.menuType = newOptions.menuType;
|
89394
|
+
};
|
89184
89395
|
/**
|
89185
89396
|
* Applies a specified theme to the survey.
|
89186
89397
|
*
|
@@ -89219,6 +89430,7 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
89219
89430
|
* Call this method to release resources if your application contains multiple survey models or if you re-create a survey model at runtime.
|
89220
89431
|
*/
|
89221
89432
|
SurveyModel.prototype.dispose = function () {
|
89433
|
+
this.unConnectEditingObj();
|
89222
89434
|
this.removeScrollEventListener();
|
89223
89435
|
this.destroyResizeObserver();
|
89224
89436
|
this.rootElement = undefined;
|
@@ -89696,7 +89908,7 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_1__["Serializer"].addClass("survey", [
|
|
89696
89908
|
default: "auto",
|
89697
89909
|
choices: ["auto", "static", "responsive"],
|
89698
89910
|
},
|
89699
|
-
{ name: "gridLayoutEnabled:boolean", default: false
|
89911
|
+
{ name: "gridLayoutEnabled:boolean", default: false },
|
89700
89912
|
{ name: "width", visibleIf: function (obj) { return obj.widthMode === "static"; } },
|
89701
89913
|
{ name: "fitToContainer:boolean", default: true, visible: false },
|
89702
89914
|
{ name: "headerView", default: "basic", choices: ["basic", "advanced"], visible: false },
|
@@ -90237,7 +90449,7 @@ var TOCModel = /** @class */ (function () {
|
|
90237
90449
|
};
|
90238
90450
|
this.listModel = createTOCListModel(survey, function () { _this.popupModel.isVisible = false; });
|
90239
90451
|
this.popupModel = new _popup__WEBPACK_IMPORTED_MODULE_5__["PopupModel"]("sv-list", { model: this.listModel });
|
90240
|
-
this.popupModel.overlayDisplayMode = "
|
90452
|
+
this.popupModel.overlayDisplayMode = "plain";
|
90241
90453
|
this.popupModel.displayMode = new _base__WEBPACK_IMPORTED_MODULE_1__["ComputedUpdater"](function () { return _this.isMobile ? "overlay" : "popup"; });
|
90242
90454
|
if (TOCModel.StickyPosition) {
|
90243
90455
|
survey.onAfterRenderSurvey.add(function (s, o) { return _this.initStickyTOCSubscriptions(o.htmlElement); });
|
@@ -92130,6 +92342,8 @@ function _setIsTouch(val) {
|
|
92130
92342
|
function detectMouseSupport(matchMedia) {
|
92131
92343
|
if (!matchMedia)
|
92132
92344
|
return false;
|
92345
|
+
if (IsMobile)
|
92346
|
+
return false;
|
92133
92347
|
var pointerQuery = matchMedia("(pointer:fine)");
|
92134
92348
|
var hoverQuery = matchMedia("(any-hover:hover)");
|
92135
92349
|
return !!pointerQuery && pointerQuery.matches || !!hoverQuery && hoverQuery.matches;
|
@@ -92739,11 +92953,12 @@ function debounce(func) {
|
|
92739
92953
|
/*!****************************!*\
|
92740
92954
|
!*** ./src/utils/utils.ts ***!
|
92741
92955
|
\****************************/
|
92742
|
-
/*! exports provided: unwrap, getRenderedSize, getRenderedStyleSize, doKey2ClickBlur, doKey2ClickUp, doKey2ClickDown, sanitizeEditableContent, Logger, showConfirmDialog, configConfirmDialog, compareArrays, roundTo2Decimals, 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 */
|
92956
|
+
/*! exports provided: getSafeUrl, unwrap, getRenderedSize, getRenderedStyleSize, doKey2ClickBlur, doKey2ClickUp, doKey2ClickDown, sanitizeEditableContent, Logger, showConfirmDialog, configConfirmDialog, compareArrays, roundTo2Decimals, 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 */
|
92743
92957
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
92744
92958
|
|
92745
92959
|
"use strict";
|
92746
92960
|
__webpack_require__.r(__webpack_exports__);
|
92961
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getSafeUrl", function() { return getSafeUrl; });
|
92747
92962
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "unwrap", function() { return unwrap; });
|
92748
92963
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getRenderedSize", function() { return getRenderedSize; });
|
92749
92964
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getRenderedStyleSize", function() { return getRenderedStyleSize; });
|
@@ -92924,7 +93139,7 @@ function navigateToUrl(url) {
|
|
92924
93139
|
var location = _global_variables_utils__WEBPACK_IMPORTED_MODULE_3__["DomWindowHelper"].getLocation();
|
92925
93140
|
if (!url || !location)
|
92926
93141
|
return;
|
92927
|
-
location.href =
|
93142
|
+
location.href = getSafeUrl(url);
|
92928
93143
|
}
|
92929
93144
|
function wrapUrlForBackgroundImage(url) {
|
92930
93145
|
return !!url ? ["url(", url, ")"].join("") : "";
|
@@ -92960,6 +93175,13 @@ function createSvg(size, width, height, iconName, svgElem, title) {
|
|
92960
93175
|
}
|
92961
93176
|
titleElement.textContent = title;
|
92962
93177
|
}
|
93178
|
+
function getSafeUrl(url) {
|
93179
|
+
if (!url)
|
93180
|
+
return url;
|
93181
|
+
if (url.toLocaleLowerCase().indexOf("javascript:") > -1)
|
93182
|
+
return encodeURIComponent(url);
|
93183
|
+
return url;
|
93184
|
+
}
|
92963
93185
|
function unwrap(value) {
|
92964
93186
|
if (typeof value !== "function") {
|
92965
93187
|
return value;
|