survey-react 1.9.96 → 1.9.97
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 +66 -19
- package/defaultV2.css.map +1 -1
- package/defaultV2.min.css +2 -2
- package/modern.css +41 -15
- package/modern.css.map +1 -1
- package/modern.min.css +2 -2
- package/package.json +1 -1
- package/survey.css +7 -5
- package/survey.css.map +1 -1
- package/survey.min.css +2 -2
- package/survey.react.d.ts +65 -18
- package/survey.react.js +237 -85
- 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.9.
|
2
|
+
* surveyjs - Survey JavaScript library v1.9.97
|
3
3
|
* Copyright (c) 2015-2023 Devsoft Baltic OÜ - http://surveyjs.io/
|
4
4
|
* License: MIT (http://www.opensource.org/licenses/mit-license.php)
|
5
5
|
*/
|
@@ -1291,7 +1291,7 @@ var AdaptiveActionContainer = /** @class */ (function (_super) {
|
|
1291
1291
|
}
|
1292
1292
|
};
|
1293
1293
|
AdaptiveActionContainer.prototype.initResponsivityManager = function (container) {
|
1294
|
-
this.responsivityManager = new _utils_responsivity_manager__WEBPACK_IMPORTED_MODULE_0__["ResponsivityManager"](container, this, "
|
1294
|
+
this.responsivityManager = new _utils_responsivity_manager__WEBPACK_IMPORTED_MODULE_0__["ResponsivityManager"](container, this, ":scope > .sv-action:not(.sv-dots) > .sv-action__content");
|
1295
1295
|
};
|
1296
1296
|
AdaptiveActionContainer.prototype.resetResponsivityManager = function () {
|
1297
1297
|
if (!!this.responsivityManager) {
|
@@ -5102,6 +5102,7 @@ var defaultV2Css = {
|
|
5102
5102
|
root: "sd-root-modern",
|
5103
5103
|
rootMobile: "sd-root-modern--mobile",
|
5104
5104
|
rootReadOnly: "sd-root--readonly",
|
5105
|
+
rootBackgroundImage: "sd-root_background-image",
|
5105
5106
|
container: "sd-container-modern",
|
5106
5107
|
header: "sd-title sd-container-modern__title",
|
5107
5108
|
bodyContainer: "sv-components-row",
|
@@ -5405,7 +5406,7 @@ var defaultV2Css = {
|
|
5405
5406
|
root: "sd-selectbase",
|
5406
5407
|
popup: "sv-dropdown-popup",
|
5407
5408
|
small: "sd-row__question--small",
|
5408
|
-
selectWrapper: "",
|
5409
|
+
selectWrapper: "sv-dropdown_select-wrapper",
|
5409
5410
|
other: "sd-input sd-comment sd-selectbase__other",
|
5410
5411
|
onError: "sd-input--error",
|
5411
5412
|
label: "sd-selectbase__label",
|
@@ -5418,6 +5419,9 @@ var defaultV2Css = {
|
|
5418
5419
|
cleanButton: "sd-dropdown_clean-button",
|
5419
5420
|
cleanButtonSvg: "sd-dropdown_clean-button-svg",
|
5420
5421
|
cleanButtonIconId: "icon-clear",
|
5422
|
+
chevronButton: "sd-dropdown_chevron-button",
|
5423
|
+
chevronButtonSvg: "sd-dropdown_chevron-button-svg",
|
5424
|
+
chevronButtonIconId: "icon-chevron",
|
5421
5425
|
control: "sd-input sd-dropdown",
|
5422
5426
|
controlInputFieldComponent: "sd-dropdown__input-field-component",
|
5423
5427
|
controlValue: "sd-dropdown__value",
|
@@ -5576,10 +5580,14 @@ var defaultV2Css = {
|
|
5576
5580
|
itemFixedSize: "sd-rating__item--fixed-size",
|
5577
5581
|
control: "sd-input sd-dropdown",
|
5578
5582
|
itemSmall: "sd-rating--small",
|
5583
|
+
selectWrapper: "sv-dropdown_select-wrapper",
|
5579
5584
|
controlValue: "sd-dropdown__value",
|
5580
5585
|
controlDisabled: "sd-input--disabled",
|
5581
5586
|
controlEmpty: "sd-dropdown--empty",
|
5582
5587
|
filterStringInput: "sd-dropdown__filter-string-input",
|
5588
|
+
chevronButton: "sd-dropdown_chevron-button",
|
5589
|
+
chevronButtonSvg: "sd-dropdown_chevron-button-svg",
|
5590
|
+
chevronButtonIconId: "icon-chevron",
|
5583
5591
|
popup: "sv-dropdown-popup",
|
5584
5592
|
onError: "sd-input--error",
|
5585
5593
|
},
|
@@ -5674,6 +5682,7 @@ var defaultV2Css = {
|
|
5674
5682
|
itemIndex: "sv-ranking-item__index sd-ranking-item__index",
|
5675
5683
|
itemIndexEmptyMode: "sv-ranking-item__index--empty sd-ranking-item__index--empty",
|
5676
5684
|
// itemText: "sv-ranking-item__text",
|
5685
|
+
itemDisabled: "sv-ranking-item--disabled",
|
5677
5686
|
controlLabel: "sv-ranking-item__text",
|
5678
5687
|
itemGhostNode: "sv-ranking-item__ghost",
|
5679
5688
|
itemIconContainer: "sv-ranking-item__icon-container",
|
@@ -5727,7 +5736,7 @@ var defaultV2Css = {
|
|
5727
5736
|
root: "sd-selectbase",
|
5728
5737
|
popup: "sv-dropdown-popup",
|
5729
5738
|
small: "sd-row__question--small",
|
5730
|
-
selectWrapper: "",
|
5739
|
+
selectWrapper: "sv-dropdown_select-wrapper",
|
5731
5740
|
other: "sd-input sd-comment sd-selectbase__other",
|
5732
5741
|
onError: "sd-input--error",
|
5733
5742
|
label: "sd-selectbase__label",
|
@@ -5744,6 +5753,9 @@ var defaultV2Css = {
|
|
5744
5753
|
cleanItemButton: "sd-tagbox-item_clean-button",
|
5745
5754
|
cleanItemButtonSvg: "sd-tagbox-item_clean-button-svg",
|
5746
5755
|
cleanItemButtonIconId: "icon-clear_16x16",
|
5756
|
+
chevronButton: "sd-dropdown_chevron-button",
|
5757
|
+
chevronButtonSvg: "sd-dropdown_chevron-button-svg",
|
5758
|
+
chevronButtonIconId: "icon-chevron",
|
5747
5759
|
control: "sd-input sd-tagbox sd-dropdown",
|
5748
5760
|
controlValue: "sd-tagbox__value sd-dropdown__value",
|
5749
5761
|
controlValueItems: "sd-tagbox__value-items",
|
@@ -6494,9 +6506,9 @@ var DragDropCore = /** @class */ (function () {
|
|
6494
6506
|
this.parentElement = parentElement;
|
6495
6507
|
var shortcutText = this.getShortcutText(this.draggedElement);
|
6496
6508
|
this.domAdapter.draggedElementShortcut = this.createDraggedElementShortcut(shortcutText, draggedElementNode, event);
|
6497
|
-
this.onStartDrag();
|
6509
|
+
this.onStartDrag(event);
|
6498
6510
|
};
|
6499
|
-
DragDropCore.prototype.onStartDrag = function () {
|
6511
|
+
DragDropCore.prototype.onStartDrag = function (event) {
|
6500
6512
|
};
|
6501
6513
|
DragDropCore.prototype.isDropTargetDoesntChanged = function (newIsBottom) {
|
6502
6514
|
return (this.dropTarget === this.prevDropTarget && newIsBottom === this.isBottom);
|
@@ -7227,6 +7239,13 @@ var DragDropRankingSelectToRank = /** @class */ (function (_super) {
|
|
7227
7239
|
function DragDropRankingSelectToRank() {
|
7228
7240
|
return _super !== null && _super.apply(this, arguments) || this;
|
7229
7241
|
}
|
7242
|
+
DragDropRankingSelectToRank.prototype.onStartDrag = function (event) {
|
7243
|
+
var target = event.target;
|
7244
|
+
var fromContainerNode = target.closest(".sv-ranking__container--from");
|
7245
|
+
if (!!fromContainerNode) {
|
7246
|
+
fromContainerNode.style.minHeight = fromContainerNode.offsetHeight + "px";
|
7247
|
+
}
|
7248
|
+
};
|
7230
7249
|
DragDropRankingSelectToRank.prototype.findDropTargetNodeByDragOverNode = function (dragOverNode) {
|
7231
7250
|
if (dragOverNode.dataset.ranking === "from-container" || dragOverNode.dataset.ranking === "to-container") {
|
7232
7251
|
return dragOverNode;
|
@@ -7284,7 +7303,7 @@ var DragDropRankingSelectToRank = /** @class */ (function (_super) {
|
|
7284
7303
|
var fromIndex = fromChoicesArray.indexOf(this.draggedElement);
|
7285
7304
|
var toIndex = toChoicesArray.indexOf(this.dropTarget);
|
7286
7305
|
if (toIndex === -1)
|
7287
|
-
toIndex =
|
7306
|
+
toIndex = toChoicesArray.length;
|
7288
7307
|
rankFunction(questionModel, fromIndex, toIndex);
|
7289
7308
|
this.doUIEffects(dropTargetNode, fromIndex, toIndex);
|
7290
7309
|
};
|
@@ -8993,7 +9012,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
8993
9012
|
// import "../../main.scss";
|
8994
9013
|
//import "../../modern.scss";
|
8995
9014
|
var Version;
|
8996
|
-
Version = "" + "1.9.
|
9015
|
+
Version = "" + "1.9.97";
|
8997
9016
|
function checkLibraryVersion(ver, libraryName) {
|
8998
9017
|
if (Version != ver) {
|
8999
9018
|
var str = "survey-core has version '" + Version + "' and " + libraryName
|
@@ -15881,8 +15900,14 @@ var Helpers = /** @class */ (function () {
|
|
15881
15900
|
return array;
|
15882
15901
|
};
|
15883
15902
|
Helpers.getUnbindValue = function (value) {
|
15903
|
+
if (Array.isArray(value)) {
|
15904
|
+
var res = [];
|
15905
|
+
for (var i = 0; i < value.length; i++) {
|
15906
|
+
res.push(Helpers.getUnbindValue(value[i]));
|
15907
|
+
}
|
15908
|
+
return res;
|
15909
|
+
}
|
15884
15910
|
if (!!value && value instanceof Object && !(value instanceof Date)) {
|
15885
|
-
//do not return the same object instance!!!
|
15886
15911
|
return JSON.parse(JSON.stringify(value));
|
15887
15912
|
}
|
15888
15913
|
return value;
|
@@ -16170,6 +16195,7 @@ var map = {
|
|
16170
16195
|
"./V2Check.svg": "./src/images/V2Check.svg",
|
16171
16196
|
"./V2Check_24x24.svg": "./src/images/V2Check_24x24.svg",
|
16172
16197
|
"./V2DragElement_16x16.svg": "./src/images/V2DragElement_16x16.svg",
|
16198
|
+
"./chevron.svg": "./src/images/chevron.svg",
|
16173
16199
|
"./clear_16x16.svg": "./src/images/clear_16x16.svg",
|
16174
16200
|
"./collapseDetail.svg": "./src/images/collapseDetail.svg",
|
16175
16201
|
"./expandDetail.svg": "./src/images/expandDetail.svg",
|
@@ -16489,6 +16515,17 @@ module.exports = "<svg viewBox=\"0 0 16 16\" xmlns=\"http://www.w3.org/2000/svg\
|
|
16489
16515
|
|
16490
16516
|
/***/ }),
|
16491
16517
|
|
16518
|
+
/***/ "./src/images/chevron.svg":
|
16519
|
+
/*!********************************!*\
|
16520
|
+
!*** ./src/images/chevron.svg ***!
|
16521
|
+
\********************************/
|
16522
|
+
/*! no static exports found */
|
16523
|
+
/***/ (function(module, exports) {
|
16524
|
+
|
16525
|
+
module.exports = "<svg viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M12 15L17 10H7L12 15Z\"></path></svg>"
|
16526
|
+
|
16527
|
+
/***/ }),
|
16528
|
+
|
16492
16529
|
/***/ "./src/images/clear_16x16.svg":
|
16493
16530
|
/*!************************************!*\
|
16494
16531
|
!*** ./src/images/clear_16x16.svg ***!
|
@@ -18692,7 +18729,9 @@ var JsonMetadata = /** @class */ (function () {
|
|
18692
18729
|
return res;
|
18693
18730
|
};
|
18694
18731
|
JsonMetadata.prototype.getChemeRefName = function (className, isRoot) {
|
18695
|
-
|
18732
|
+
//Fix for #6486, according to https://niem.github.io/json/reference/json-schema/references/#:~:text=In%20a%20JSON%20schema%2C%20a,%2C%20an%20in%2Dschema%20reference
|
18733
|
+
return "#/definitions/" + className;
|
18734
|
+
//return isRoot ? "#/definitions/" + className : className + "#";
|
18696
18735
|
};
|
18697
18736
|
JsonMetadata.prototype.generateChemaClass = function (className, schemaDef, isRoot) {
|
18698
18737
|
if (!!schemaDef[className])
|
@@ -18730,6 +18769,7 @@ var JsonError = /** @class */ (function () {
|
|
18730
18769
|
this.message = message;
|
18731
18770
|
this.description = "";
|
18732
18771
|
this.at = -1;
|
18772
|
+
this.end = -1;
|
18733
18773
|
}
|
18734
18774
|
JsonError.prototype.getFullDescription = function () {
|
18735
18775
|
return this.message + (this.description ? "\n" + this.description : "");
|
@@ -18843,7 +18883,7 @@ var JsonObject = /** @class */ (function () {
|
|
18843
18883
|
this.toObjectCore(jsonObj, obj);
|
18844
18884
|
var error = this.getRequiredError(obj, jsonObj);
|
18845
18885
|
if (!!error) {
|
18846
|
-
this.addNewError(error, jsonObj);
|
18886
|
+
this.addNewError(error, jsonObj, obj);
|
18847
18887
|
}
|
18848
18888
|
};
|
18849
18889
|
JsonObject.prototype.toObjectCore = function (jsonObj, obj) {
|
@@ -18874,7 +18914,7 @@ var JsonObject = /** @class */ (function () {
|
|
18874
18914
|
var property = this.findProperty(properties, key);
|
18875
18915
|
if (!property) {
|
18876
18916
|
if (needAddErrors) {
|
18877
|
-
this.addNewError(new JsonUnknownPropertyError(key.toString(), objType), jsonObj);
|
18917
|
+
this.addNewError(new JsonUnknownPropertyError(key.toString(), objType), jsonObj, obj);
|
18878
18918
|
}
|
18879
18919
|
continue;
|
18880
18920
|
}
|
@@ -19037,7 +19077,7 @@ var JsonObject = /** @class */ (function () {
|
|
19037
19077
|
}
|
19038
19078
|
}
|
19039
19079
|
if (error) {
|
19040
|
-
this.addNewError(error, value);
|
19080
|
+
this.addNewError(error, value, newObj);
|
19041
19081
|
}
|
19042
19082
|
return error;
|
19043
19083
|
};
|
@@ -19058,11 +19098,17 @@ var JsonObject = /** @class */ (function () {
|
|
19058
19098
|
}
|
19059
19099
|
return null;
|
19060
19100
|
};
|
19061
|
-
JsonObject.prototype.addNewError = function (error, jsonObj) {
|
19062
|
-
|
19063
|
-
|
19064
|
-
}
|
19101
|
+
JsonObject.prototype.addNewError = function (error, jsonObj, element) {
|
19102
|
+
error.jsonObj = jsonObj;
|
19103
|
+
error.element = element;
|
19065
19104
|
this.errors.push(error);
|
19105
|
+
if (!jsonObj)
|
19106
|
+
return;
|
19107
|
+
var posObj = jsonObj[JsonObject.positionPropertyName];
|
19108
|
+
if (!posObj)
|
19109
|
+
return;
|
19110
|
+
error.at = posObj.start;
|
19111
|
+
error.end = posObj.end;
|
19066
19112
|
};
|
19067
19113
|
JsonObject.prototype.valueToArray = function (value, obj, key, property) {
|
19068
19114
|
if (obj[key] && !this.isValueArray(obj[key]))
|
@@ -21048,8 +21094,8 @@ var englishStrings = {
|
|
21048
21094
|
noEntriesReadonlyText: "There are no entries.",
|
21049
21095
|
more: "More",
|
21050
21096
|
tagboxDoneButtonCaption: "OK",
|
21051
|
-
|
21052
|
-
|
21097
|
+
selectToRankEmptyRankedAreaText: "All choices are ranked",
|
21098
|
+
selectToRankEmptyUnrankedAreaText: "Drag and drop choices here to rank them",
|
21053
21099
|
};
|
21054
21100
|
// Uncomment the lines below if you create a custom dictionary.
|
21055
21101
|
// Replace "en" with a custom locale code (for example, "fr" or "de"),
|
@@ -29626,7 +29672,7 @@ function setStyles() {
|
|
29626
29672
|
".sv_q_dd_value": "width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; position: relative;",
|
29627
29673
|
".sv_q_dd_root": "position: relative;",
|
29628
29674
|
".sv_q_dd_select_wrapper::after": "content: \"\"; display: block;background-image: url(\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='utf-8'%3F%3E%3C!-- Generator: Adobe Illustrator 21.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --%3E%3Csvg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 10 10' style='enable-background:new 0 0 10 10;' xml:space='preserve'%3E%3Cstyle type='text/css'%3E .st0%7Bfill:%23404040;%7D%0A%3C/style%3E%3Cpolygon class='st0' points='2,2 0,4 5,9 10,4 8,2 5,5 '/%3E%3C/svg%3E%0A\"); background-repeat: no-repeat; background-position: center center; background-size: 10px 12px; width: 34px; height: 100%; position: absolute; inset-inline-end: 0; top: 0;",
|
29629
|
-
".sv_q_dd_filter-string-input": "outline: none; border: none; background-color: transparent; position: absolute; inset-inline-start: 0;",
|
29675
|
+
".sv_q_dd_filter-string-input": "outline: none; border: none; background-color: transparent; position: absolute; inset-inline-start: 0; inset-block-start: 0;",
|
29630
29676
|
".sv_q_dropdown_clean-button": "margin: auto 2em;",
|
29631
29677
|
".sv_q_tagbox__placeholder": "position: absolute; top: 0; inset-inline-start: 1em; max-width: 100%; width: auto; height: 100%; text-align: start; cursor: text; pointer-events: none;",
|
29632
29678
|
".sv_qstn .sv-q-col-1, .sv-question .sv-q-col-1": "width: 100%; display: inline-block; padding-right: 1em; box-sizing: border-box; word-break: break-word;",
|
@@ -29787,7 +29833,7 @@ function setStyles() {
|
|
29787
29833
|
"sv-popup": "display: block; position: absolute; z-index: -1;",
|
29788
29834
|
".sv-popup": "position: fixed; left: 0; top: 0; width: 100vw; height: 100vh; outline: none; z-index: 1500;",
|
29789
29835
|
".sv-popup__container": "box-shadow: 0px 2px 6px rgba(0, 0, 0, 0.1); position: absolute; padding: 0;",
|
29790
|
-
".sv-popup__body-content": "background-color: var(--background, #fff); border-radius: calc(0.5 * var(--base-unit, 8px)); width: 100%; height: 100%; box-sizing: border-box; display: flex; flex-direction: column; max-height: 90vh; max-width:
|
29836
|
+
".sv-popup__body-content": "background-color: var(--background, #fff); border-radius: calc(0.5 * var(--base-unit, 8px)); width: 100%; height: 100%; box-sizing: border-box; display: flex; flex-direction: column; max-height: 90vh; max-width: 100vw;",
|
29791
29837
|
".sv-popup--modal .sv-list__filter": "padding-top: 8px;",
|
29792
29838
|
".sv-popup--modal .sv-list__filter-icon": "top: 20px;",
|
29793
29839
|
".sv-popup--overlay .sv-list__filter": "padding-top: 8px;",
|
@@ -29941,13 +29987,14 @@ var PopupDropdownViewModel = /** @class */ (function (_super) {
|
|
29941
29987
|
this.isTablet = width >= PopupDropdownViewModel.tabletSizeBreakpoint;
|
29942
29988
|
};
|
29943
29989
|
PopupDropdownViewModel.prototype._updatePosition = function () {
|
29944
|
-
var _a;
|
29990
|
+
var _a, _b, _c;
|
29945
29991
|
if (!this.targetElement)
|
29946
29992
|
return;
|
29947
29993
|
var targetElementRect = this.targetElement.getBoundingClientRect();
|
29948
29994
|
var popupContainer = (_a = this.container) === null || _a === void 0 ? void 0 : _a.querySelector(this.containerSelector);
|
29949
29995
|
if (!popupContainer)
|
29950
29996
|
return;
|
29997
|
+
var fixedPopupContainer = (_b = this.container) === null || _b === void 0 ? void 0 : _b.querySelector(this.fixedPopupContainer);
|
29951
29998
|
var scrollContent = popupContainer.querySelector(this.scrollingContentSelector);
|
29952
29999
|
var popupComputedStyle = window.getComputedStyle(popupContainer);
|
29953
30000
|
var marginLeft = (parseFloat(popupComputedStyle.marginLeft) || 0);
|
@@ -29958,7 +30005,8 @@ var PopupDropdownViewModel = /** @class */ (function (_super) {
|
|
29958
30005
|
var verticalPosition = this.model.verticalPosition;
|
29959
30006
|
var actualHorizontalPosition = this.getActualHorizontalPosition();
|
29960
30007
|
if (!!window) {
|
29961
|
-
|
30008
|
+
var heightValues = [height, window.innerHeight * 0.9, (_c = window.visualViewport) === null || _c === void 0 ? void 0 : _c.height];
|
30009
|
+
height = Math.ceil(Math.min.apply(Math, heightValues.filter(function (each) { return typeof each === "number"; })));
|
29962
30010
|
verticalPosition = _utils_popup__WEBPACK_IMPORTED_MODULE_1__["PopupUtils"].updateVerticalPosition(targetElementRect, height, this.model.verticalPosition, this.model.showPointer, window.innerHeight);
|
29963
30011
|
}
|
29964
30012
|
this.popupDirection = _utils_popup__WEBPACK_IMPORTED_MODULE_1__["PopupUtils"].calculatePopupDirection(verticalPosition, actualHorizontalPosition);
|
@@ -29975,6 +30023,11 @@ var PopupDropdownViewModel = /** @class */ (function (_super) {
|
|
29975
30023
|
pos.left = newHorizontalDimensions.left;
|
29976
30024
|
}
|
29977
30025
|
}
|
30026
|
+
if (!!fixedPopupContainer) {
|
30027
|
+
var rect = fixedPopupContainer.getBoundingClientRect();
|
30028
|
+
pos.top -= rect.top;
|
30029
|
+
pos.left -= rect.left;
|
30030
|
+
}
|
29978
30031
|
this.left = pos.left + "px";
|
29979
30032
|
this.top = pos.top + "px";
|
29980
30033
|
if (this.showHeader) {
|
@@ -30594,6 +30647,7 @@ var PopupBaseViewModel = /** @class */ (function (_super) {
|
|
30594
30647
|
function PopupBaseViewModel(model) {
|
30595
30648
|
var _this = _super.call(this) || this;
|
30596
30649
|
_this.popupSelector = ".sv-popup";
|
30650
|
+
_this.fixedPopupContainer = ".sv-popup";
|
30597
30651
|
_this.containerSelector = ".sv-popup__container";
|
30598
30652
|
_this.scrollingContentSelector = ".sv-popup__scrolling-content";
|
30599
30653
|
_this.model = model;
|
@@ -32256,9 +32310,25 @@ var Question = /** @class */ (function (_super) {
|
|
32256
32310
|
* @param onError Pass `true` if you want to focus an input field with the first validation error. Default value: `false` (focuses the first input field). Applies to question types with multiple input fields.
|
32257
32311
|
*/
|
32258
32312
|
Question.prototype.focus = function (onError) {
|
32313
|
+
var _this = this;
|
32259
32314
|
if (onError === void 0) { onError = false; }
|
32260
|
-
if (this.isDesignMode)
|
32315
|
+
if (this.isDesignMode || !this.isVisible || !this.survey)
|
32261
32316
|
return;
|
32317
|
+
var page = this.page;
|
32318
|
+
if (!page && !!this.parentQuestion) {
|
32319
|
+
page = this.parentQuestion.page;
|
32320
|
+
}
|
32321
|
+
var shouldChangePage = !!page && this.survey.currentPage !== page;
|
32322
|
+
if (shouldChangePage) {
|
32323
|
+
this.survey.currentPage = page;
|
32324
|
+
setTimeout(function () { return _this.focuscore(onError); }, 0);
|
32325
|
+
}
|
32326
|
+
else {
|
32327
|
+
this.focuscore(onError);
|
32328
|
+
}
|
32329
|
+
};
|
32330
|
+
Question.prototype.focuscore = function (onError) {
|
32331
|
+
if (onError === void 0) { onError = false; }
|
32262
32332
|
if (!!this.survey) {
|
32263
32333
|
this.expandAllParents(this);
|
32264
32334
|
this.survey.scrollElementToTop(this, this, null, this.id);
|
@@ -34433,7 +34503,7 @@ var QuestionSelectBase = /** @class */ (function (_super) {
|
|
34433
34503
|
return null;
|
34434
34504
|
var itemValue = _itemvalue__WEBPACK_IMPORTED_MODULE_3__["ItemValue"].getItemByValue(this.visibleChoices, this.value);
|
34435
34505
|
this.onGetSingleSelectedItem(itemValue);
|
34436
|
-
if (!itemValue && !selectedItemValues) {
|
34506
|
+
if (!itemValue && (!selectedItemValues || this.value != selectedItemValues.id)) {
|
34437
34507
|
this.updateSelectedItemValues();
|
34438
34508
|
}
|
34439
34509
|
return itemValue || selectedItemValues || (this.isOtherSelected ? this.otherItem : this.getItemIfChoicesNotContainThisValue(this.value));
|
@@ -35453,7 +35523,7 @@ var QuestionSelectBase = /** @class */ (function (_super) {
|
|
35453
35523
|
for (var i = 0; i < this.dependedQuestions.length; i++) {
|
35454
35524
|
var q = this.dependedQuestions[i];
|
35455
35525
|
q.onVisibleChoicesChanged();
|
35456
|
-
q.
|
35526
|
+
q.clearIncorrectValues();
|
35457
35527
|
}
|
35458
35528
|
this.isUpdatingChoicesDependedQuestions = false;
|
35459
35529
|
};
|
@@ -35548,11 +35618,11 @@ var QuestionSelectBase = /** @class */ (function (_super) {
|
|
35548
35618
|
};
|
35549
35619
|
QuestionSelectBase.prototype.clearIncorrectValuesCore = function () {
|
35550
35620
|
var val = this.value;
|
35551
|
-
if (this.
|
35621
|
+
if (this.canClearValueAnUnknown(val)) {
|
35552
35622
|
this.clearValue();
|
35553
35623
|
}
|
35554
35624
|
};
|
35555
|
-
QuestionSelectBase.prototype.
|
35625
|
+
QuestionSelectBase.prototype.canClearValueAnUnknown = function (val) {
|
35556
35626
|
if (!this.getStoreOthersAsComment() && this.isOtherSelected)
|
35557
35627
|
return false;
|
35558
35628
|
return this.hasUnknownValue(val, true, true, true);
|
@@ -37000,7 +37070,7 @@ var QuestionCheckboxModel = /** @class */ (function (_super) {
|
|
37000
37070
|
if (Array.isArray(val)) {
|
37001
37071
|
for (var i = 0; i < val.length; i++) {
|
37002
37072
|
var rVal = this.getRealValue(val[i]);
|
37003
|
-
if (this.
|
37073
|
+
if (this.canClearValueAnUnknown(rVal)) {
|
37004
37074
|
this.addIntoInvisibleOldValues(rVal);
|
37005
37075
|
}
|
37006
37076
|
}
|
@@ -37139,7 +37209,7 @@ var QuestionCheckboxModel = /** @class */ (function (_super) {
|
|
37139
37209
|
var newValue = [];
|
37140
37210
|
for (var i = 0; i < val.length; i++) {
|
37141
37211
|
var rItemVal = this.getRealValue(val[i]);
|
37142
|
-
var isUnkown = this.
|
37212
|
+
var isUnkown = this.canClearValueAnUnknown(rItemVal);
|
37143
37213
|
if ((!clearDisabled && !isUnkown) ||
|
37144
37214
|
(clearDisabled && !this.isValueDisabled(rItemVal))) {
|
37145
37215
|
newValue.push(val[i]);
|
@@ -37639,6 +37709,14 @@ var ComponentQuestionJSON = /** @class */ (function () {
|
|
37639
37709
|
return question.getDisplayValue(keyAsText, value);
|
37640
37710
|
return this.json.getDisplayValue(question);
|
37641
37711
|
};
|
37712
|
+
ComponentQuestionJSON.prototype.setValueToQuestion = function (val) {
|
37713
|
+
var converter = this.json.valueToQuestion || this.json.setValue;
|
37714
|
+
return !!converter ? converter(val) : val;
|
37715
|
+
};
|
37716
|
+
ComponentQuestionJSON.prototype.getValueFromQuestion = function (val) {
|
37717
|
+
var converter = this.json.valueFromQuestion || this.json.getValue;
|
37718
|
+
return !!converter ? converter(val) : val;
|
37719
|
+
};
|
37642
37720
|
Object.defineProperty(ComponentQuestionJSON.prototype, "isComposite", {
|
37643
37721
|
get: function () {
|
37644
37722
|
return !!this.json.elementsJSON || !!this.json.createElements;
|
@@ -38027,7 +38105,7 @@ var QuestionCustomModel = /** @class */ (function (_super) {
|
|
38027
38105
|
if (!this.contentQuestion)
|
38028
38106
|
return;
|
38029
38107
|
if (this.isEmpty() && !this.contentQuestion.isEmpty()) {
|
38030
|
-
this.value = this.
|
38108
|
+
this.value = this.getContentQuestionValue();
|
38031
38109
|
}
|
38032
38110
|
};
|
38033
38111
|
QuestionCustomModel.prototype.runCondition = function (values, properties) {
|
@@ -38046,9 +38124,24 @@ var QuestionCustomModel = /** @class */ (function (_super) {
|
|
38046
38124
|
};
|
38047
38125
|
QuestionCustomModel.prototype.convertDataValue = function (name, newValue) {
|
38048
38126
|
return this.convertDataName(name) == _super.prototype.convertDataName.call(this, name)
|
38049
|
-
? this.
|
38127
|
+
? this.getContentQuestionValue()
|
38050
38128
|
: newValue;
|
38051
38129
|
};
|
38130
|
+
QuestionCustomModel.prototype.getContentQuestionValue = function () {
|
38131
|
+
if (!this.contentQuestion)
|
38132
|
+
return undefined;
|
38133
|
+
var val = this.contentQuestion.value;
|
38134
|
+
if (!!this.customQuestion)
|
38135
|
+
val = this.customQuestion.getValueFromQuestion(val);
|
38136
|
+
return val;
|
38137
|
+
};
|
38138
|
+
QuestionCustomModel.prototype.setContentQuestionValue = function (val) {
|
38139
|
+
if (!this.contentQuestion)
|
38140
|
+
return;
|
38141
|
+
if (!!this.customQuestion)
|
38142
|
+
val = this.customQuestion.setValueToQuestion(val);
|
38143
|
+
this.contentQuestion.value = val;
|
38144
|
+
};
|
38052
38145
|
QuestionCustomModel.prototype.canSetValueToSurvey = function () {
|
38053
38146
|
return false;
|
38054
38147
|
};
|
@@ -38056,8 +38149,8 @@ var QuestionCustomModel = /** @class */ (function (_super) {
|
|
38056
38149
|
if (updateIsAnswered === void 0) { updateIsAnswered = true; }
|
38057
38150
|
_super.prototype.setQuestionValue.call(this, newValue, updateIsAnswered);
|
38058
38151
|
if (!this.isLoadingFromJson && !!this.contentQuestion &&
|
38059
|
-
!this.isTwoValueEquals(this.
|
38060
|
-
this.
|
38152
|
+
!this.isTwoValueEquals(this.getContentQuestionValue(), newValue)) {
|
38153
|
+
this.setContentQuestionValue(this.getUnbindValue(newValue));
|
38061
38154
|
}
|
38062
38155
|
};
|
38063
38156
|
QuestionCustomModel.prototype.onSurveyValueChanged = function (newValue) {
|
@@ -38068,7 +38161,7 @@ var QuestionCustomModel = /** @class */ (function (_super) {
|
|
38068
38161
|
};
|
38069
38162
|
QuestionCustomModel.prototype.getValueCore = function () {
|
38070
38163
|
if (!!this.contentQuestion)
|
38071
|
-
return this.
|
38164
|
+
return this.getContentQuestionValue();
|
38072
38165
|
return _super.prototype.getValueCore.call(this);
|
38073
38166
|
};
|
38074
38167
|
QuestionCustomModel.prototype.initElement = function (el) {
|
@@ -38224,7 +38317,7 @@ var QuestionCompositeModel = /** @class */ (function (_super) {
|
|
38224
38317
|
}
|
38225
38318
|
_super.prototype.onSurveyLoad.call(this);
|
38226
38319
|
if (!!this.contentPanel) {
|
38227
|
-
var val = this.
|
38320
|
+
var val = this.getContentPanelValue();
|
38228
38321
|
if (!_helpers__WEBPACK_IMPORTED_MODULE_3__["Helpers"].isValueEmpty(val)) {
|
38229
38322
|
this.value = val;
|
38230
38323
|
}
|
@@ -38289,12 +38382,20 @@ var QuestionCompositeModel = /** @class */ (function (_super) {
|
|
38289
38382
|
this.settingNewValue = false;
|
38290
38383
|
};
|
38291
38384
|
QuestionCompositeModel.prototype.updateValueCoreWithPanelValue = function () {
|
38292
|
-
var panelValue = this.
|
38385
|
+
var panelValue = this.getContentPanelValue();
|
38293
38386
|
if (this.isTwoValueEquals(this.getValueCore(), panelValue))
|
38294
38387
|
return false;
|
38295
38388
|
this.setValueCore(panelValue);
|
38296
38389
|
return true;
|
38297
38390
|
};
|
38391
|
+
QuestionCompositeModel.prototype.getContentPanelValue = function (val) {
|
38392
|
+
if (!val)
|
38393
|
+
val = this.contentPanel.getValue();
|
38394
|
+
return this.customQuestion.setValueToQuestion(val);
|
38395
|
+
};
|
38396
|
+
QuestionCompositeModel.prototype.getValueForContentPanel = function (val) {
|
38397
|
+
return this.customQuestion.getValueFromQuestion(val);
|
38398
|
+
};
|
38298
38399
|
QuestionCompositeModel.prototype.setNewValueIntoQuestion = function (name, newValue) {
|
38299
38400
|
var q = this.getQuestionByName(name);
|
38300
38401
|
if (!!q && !this.isTwoValueEquals(newValue, q.value)) {
|
@@ -38316,7 +38417,7 @@ var QuestionCompositeModel = /** @class */ (function (_super) {
|
|
38316
38417
|
}
|
38317
38418
|
};
|
38318
38419
|
QuestionCompositeModel.prototype.convertDataValue = function (name, newValue) {
|
38319
|
-
var val = this.value;
|
38420
|
+
var val = this.getValueForContentPanel(this.value);
|
38320
38421
|
if (!val)
|
38321
38422
|
val = {};
|
38322
38423
|
if (this.isValueEmpty(newValue) && !this.isEditingSurveyElement) {
|
@@ -38325,19 +38426,20 @@ var QuestionCompositeModel = /** @class */ (function (_super) {
|
|
38325
38426
|
else {
|
38326
38427
|
val[name] = newValue;
|
38327
38428
|
}
|
38328
|
-
return val;
|
38429
|
+
return this.getContentPanelValue(val);
|
38329
38430
|
};
|
38330
38431
|
QuestionCompositeModel.prototype.setQuestionValue = function (newValue, updateIsAnswered) {
|
38331
38432
|
if (updateIsAnswered === void 0) { updateIsAnswered = true; }
|
38332
38433
|
this.setValuesIntoQuestions(newValue);
|
38333
38434
|
if (!this.isEditingSurveyElement && !!this.contentPanel) {
|
38334
|
-
newValue = this.
|
38435
|
+
newValue = this.getContentPanelValue();
|
38335
38436
|
}
|
38336
38437
|
_super.prototype.setQuestionValue.call(this, newValue, updateIsAnswered);
|
38337
38438
|
};
|
38338
38439
|
QuestionCompositeModel.prototype.setValuesIntoQuestions = function (newValue) {
|
38339
38440
|
if (!this.contentPanel)
|
38340
38441
|
return;
|
38442
|
+
newValue = this.getValueForContentPanel(newValue);
|
38341
38443
|
var oldSettingNewValue = this.settingNewValue;
|
38342
38444
|
this.settingNewValue = true;
|
38343
38445
|
var questions = this.contentPanel.questions;
|
@@ -38435,7 +38537,7 @@ var QuestionDropdownModel = /** @class */ (function (_super) {
|
|
38435
38537
|
_this.registerPropertyChangedHandlers(["choicesMin", "choicesMax", "choicesStep"], function () {
|
38436
38538
|
_this.onVisibleChoicesChanged();
|
38437
38539
|
});
|
38438
|
-
_this.registerPropertyChangedHandlers(["value", "renderAs", "showOtherItem", "otherText", "placeholder", "choices"], function () {
|
38540
|
+
_this.registerPropertyChangedHandlers(["value", "renderAs", "showOtherItem", "otherText", "placeholder", "choices", "visibleChoices"], function () {
|
38439
38541
|
_this.updateReadOnlyText();
|
38440
38542
|
});
|
38441
38543
|
_this.updateReadOnlyText();
|
@@ -39753,6 +39855,13 @@ var QuestionFileModel = /** @class */ (function (_super) {
|
|
39753
39855
|
}
|
39754
39856
|
});
|
39755
39857
|
};
|
39858
|
+
Object.defineProperty(QuestionFileModel.prototype, "renderCapture", {
|
39859
|
+
get: function () {
|
39860
|
+
return this.allowCameraAccess ? "user" : undefined;
|
39861
|
+
},
|
39862
|
+
enumerable: false,
|
39863
|
+
configurable: true
|
39864
|
+
});
|
39756
39865
|
Object.defineProperty(QuestionFileModel.prototype, "multipleRendered", {
|
39757
39866
|
get: function () {
|
39758
39867
|
return this.allowMultiple ? "multiple" : undefined;
|
@@ -40052,6 +40161,9 @@ var QuestionFileModel = /** @class */ (function (_super) {
|
|
40052
40161
|
__decorate([
|
40053
40162
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])({ defaultValue: false })
|
40054
40163
|
], QuestionFileModel.prototype, "containsMultiplyFiles", void 0);
|
40164
|
+
__decorate([
|
40165
|
+
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])()
|
40166
|
+
], QuestionFileModel.prototype, "allowCameraAccess", void 0);
|
40055
40167
|
__decorate([
|
40056
40168
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])({ localizable: { defaultStr: "confirmRemoveFile" } })
|
40057
40169
|
], QuestionFileModel.prototype, "confirmRemoveMessage", void 0);
|
@@ -40097,6 +40209,7 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_1__["Serializer"].addClass("file", [
|
|
40097
40209
|
{ name: "correctAnswer", visible: false },
|
40098
40210
|
{ name: "validators", visible: false },
|
40099
40211
|
{ name: "needConfirmRemoveFile:boolean" },
|
40212
|
+
{ name: "allowCameraAccess:switch", category: "general" }
|
40100
40213
|
], function () {
|
40101
40214
|
return new QuestionFileModel("");
|
40102
40215
|
}, "question");
|
@@ -45164,10 +45277,10 @@ var MatrixDropdownColumn = /** @class */ (function (_super) {
|
|
45164
45277
|
});
|
45165
45278
|
Object.defineProperty(MatrixDropdownColumn.prototype, "width", {
|
45166
45279
|
get: function () {
|
45167
|
-
return this.
|
45280
|
+
return this.templateQuestion.width;
|
45168
45281
|
},
|
45169
45282
|
set: function (val) {
|
45170
|
-
this.
|
45283
|
+
this.templateQuestion.width = val;
|
45171
45284
|
},
|
45172
45285
|
enumerable: false,
|
45173
45286
|
configurable: true
|
@@ -51244,7 +51357,7 @@ var QuestionRankingModel = /** @class */ (function (_super) {
|
|
51244
51357
|
var target = event.target;
|
51245
51358
|
if (!_this.isDragStartNodeValid(target))
|
51246
51359
|
return;
|
51247
|
-
if (_this.allowStartDrag) {
|
51360
|
+
if (_this.allowStartDrag && _this.canStartDragDueMaxSelectedChoices(target)) {
|
51248
51361
|
_this.dragDropRankingChoices.startDrag(event, choice, _this, node);
|
51249
51362
|
}
|
51250
51363
|
};
|
@@ -51518,6 +51631,22 @@ var QuestionRankingModel = /** @class */ (function (_super) {
|
|
51518
51631
|
enumerable: false,
|
51519
51632
|
configurable: true
|
51520
51633
|
});
|
51634
|
+
QuestionRankingModel.prototype.canStartDragDueMaxSelectedChoices = function (target) {
|
51635
|
+
if (!this.selectToRankEnabled)
|
51636
|
+
return true;
|
51637
|
+
var fromContainer = target.closest("[data-ranking='from-container']");
|
51638
|
+
if (fromContainer) {
|
51639
|
+
return this.checkMaxSelectedChoicesUnreached();
|
51640
|
+
}
|
51641
|
+
return true;
|
51642
|
+
};
|
51643
|
+
QuestionRankingModel.prototype.checkMaxSelectedChoicesUnreached = function () {
|
51644
|
+
if (this.maxSelectedChoices < 1)
|
51645
|
+
return true;
|
51646
|
+
var val = this.value;
|
51647
|
+
var len = !Array.isArray(val) ? 0 : val.length;
|
51648
|
+
return len < this.maxSelectedChoices;
|
51649
|
+
};
|
51521
51650
|
//cross framework initialization
|
51522
51651
|
QuestionRankingModel.prototype.afterRenderQuestionElement = function (el) {
|
51523
51652
|
this.domNode = el;
|
@@ -51547,14 +51676,14 @@ var QuestionRankingModel = /** @class */ (function (_super) {
|
|
51547
51676
|
var isMovedElementUnRanked = !isMovedElementRanked;
|
51548
51677
|
var fromIndex;
|
51549
51678
|
var toIndex;
|
51550
|
-
if (key === " " && isMovedElementUnRanked) {
|
51679
|
+
if ((key === " " || key === "Enter") && isMovedElementUnRanked) {
|
51551
51680
|
fromIndex = unRankingChoices.indexOf(movedElement);
|
51552
51681
|
toIndex = 0;
|
51553
51682
|
dnd.selectToRank(this, fromIndex, toIndex);
|
51554
51683
|
this.setValueAfterKeydown(toIndex, "to-container");
|
51555
51684
|
return;
|
51556
51685
|
}
|
51557
|
-
if (key === " " && isMovedElementRanked) {
|
51686
|
+
if ((key === " " || key === "Enter") && isMovedElementRanked) {
|
51558
51687
|
fromIndex = rankingChoices.indexOf(movedElement);
|
51559
51688
|
dnd.unselectFromRank(this, fromIndex);
|
51560
51689
|
toIndex = this.unRankingChoices.indexOf(movedElement); //'this.' leads to actual array after the 'unselectFromRank' method
|
@@ -51646,6 +51775,8 @@ var QuestionRankingModel = /** @class */ (function (_super) {
|
|
51646
51775
|
* @see selectToRankAreasLayout
|
51647
51776
|
*/
|
51648
51777
|
get: function () {
|
51778
|
+
if (_utils_devices__WEBPACK_IMPORTED_MODULE_7__["IsMobile"])
|
51779
|
+
return "vertical";
|
51649
51780
|
return this.getPropertyValue("selectToRankAreasLayout", "horizontal");
|
51650
51781
|
},
|
51651
51782
|
set: function (val) {
|
@@ -51671,11 +51802,11 @@ var QuestionRankingModel = /** @class */ (function (_super) {
|
|
51671
51802
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_3__["property"])({ defaultValue: null })
|
51672
51803
|
], QuestionRankingModel.prototype, "dropTargetNodeMove", void 0);
|
51673
51804
|
__decorate([
|
51674
|
-
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_3__["property"])({ localizable: { defaultStr: "
|
51675
|
-
], QuestionRankingModel.prototype, "
|
51805
|
+
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_3__["property"])({ localizable: { defaultStr: "selectToRankEmptyRankedAreaText" } })
|
51806
|
+
], QuestionRankingModel.prototype, "selectToRankEmptyRankedAreaText", void 0);
|
51676
51807
|
__decorate([
|
51677
|
-
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_3__["property"])({ localizable: { defaultStr: "
|
51678
|
-
], QuestionRankingModel.prototype, "
|
51808
|
+
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_3__["property"])({ localizable: { defaultStr: "selectToRankEmptyUnrankedAreaText" } })
|
51809
|
+
], QuestionRankingModel.prototype, "selectToRankEmptyUnrankedAreaText", void 0);
|
51679
51810
|
return QuestionRankingModel;
|
51680
51811
|
}(_question_checkbox__WEBPACK_IMPORTED_MODULE_5__["QuestionCheckboxModel"]));
|
51681
51812
|
|
@@ -57556,7 +57687,9 @@ var SurveyQuestionDropdownBase = /** @class */ (function (_super) {
|
|
57556
57687
|
this.renderInput(this.question["dropdownListModel"]),
|
57557
57688
|
react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_components_popup_popup__WEBPACK_IMPORTED_MODULE_2__["Popup"], { model: (_b = (_a = this.question) === null || _a === void 0 ? void 0 : _a.dropdownListModel) === null || _b === void 0 ? void 0 : _b.popupModel }));
|
57558
57689
|
}
|
57559
|
-
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: cssClasses.selectWrapper },
|
57690
|
+
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: cssClasses.selectWrapper, onClick: this.click },
|
57691
|
+
selectElement,
|
57692
|
+
this.createChevronButton()));
|
57560
57693
|
};
|
57561
57694
|
SurveyQuestionDropdownBase.prototype.renderValueElement = function (dropdownListModel) {
|
57562
57695
|
if (this.question.showInputFieldComponent) {
|
@@ -57576,7 +57709,7 @@ var SurveyQuestionDropdownBase = /** @class */ (function (_super) {
|
|
57576
57709
|
dropdownListModel.inputStringRendered = e.target.value;
|
57577
57710
|
}
|
57578
57711
|
};
|
57579
|
-
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { id: this.question.inputId, className: this.question.getControlClass(), tabIndex: dropdownListModel.inputReadOnly ? undefined : 0,
|
57712
|
+
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { id: this.question.inputId, className: this.question.getControlClass(), tabIndex: dropdownListModel.inputReadOnly ? undefined : 0,
|
57580
57713
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
57581
57714
|
// @ts-ignore
|
57582
57715
|
disabled: this.question.isInputReadOnly, required: this.question.isRequired, onKeyDown: this.keyhandler, onBlur: this.blur, role: this.question.ariaRole, "aria-required": this.question.ariaRequired, "aria-label": this.question.ariaLabel, "aria-invalid": this.question.ariaInvalid, "aria-describedby": this.question.ariaDescribedBy, "aria-expanded": this.question.ariaExpanded === null ? undefined : this.question.ariaExpanded === "true", "aria-controls": dropdownListModel.listElementId, "aria-activedescendant": dropdownListModel.ariaActivedescendant },
|
@@ -57599,6 +57732,12 @@ var SurveyQuestionDropdownBase = /** @class */ (function (_super) {
|
|
57599
57732
|
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.question.cssClasses.cleanButton, style: style, onClick: this.clear },
|
57600
57733
|
react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_components_svg_icon_svg_icon__WEBPACK_IMPORTED_MODULE_3__["SvgIcon"], { className: this.question.cssClasses.cleanButtonSvg, iconName: this.question.cssClasses.cleanButtonIconId, title: this.question.clearCaption, size: "auto" })));
|
57601
57734
|
};
|
57735
|
+
SurveyQuestionDropdownBase.prototype.createChevronButton = function () {
|
57736
|
+
if (!this.question.cssClasses.chevronButtonIconId)
|
57737
|
+
return null;
|
57738
|
+
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.question.cssClasses.chevronButton },
|
57739
|
+
react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_components_svg_icon_svg_icon__WEBPACK_IMPORTED_MODULE_3__["SvgIcon"], { className: this.question.cssClasses.chevronButtonSvg, iconName: this.question.cssClasses.chevronButtonIconId, size: 24 })));
|
57740
|
+
};
|
57602
57741
|
SurveyQuestionDropdownBase.prototype.renderOther = function (cssClasses) {
|
57603
57742
|
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.question.getCommentAreaCss(true) },
|
57604
57743
|
react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_reactquestion_comment__WEBPACK_IMPORTED_MODULE_5__["SurveyQuestionOtherValueItem"], { question: this.question, otherCss: cssClasses.other, cssClasses: cssClasses, isDisplayMode: this.isDisplayMode, isOther: true })));
|
@@ -57762,7 +57901,9 @@ var SurveyQuestionDropdownSelect = /** @class */ (function (_super) {
|
|
57762
57901
|
(react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("select", { id: this.question.inputId, className: this.question.getControlClass(), ref: function (select) { return (_this.setControl(select)); }, autoComplete: this.question.autocomplete, onChange: this.updateValueOnEvent, onInput: this.updateValueOnEvent, onClick: click, onKeyUp: keyup, "aria-required": this.question.ariaRequired, "aria-label": this.question.ariaLabel, "aria-invalid": this.question.ariaInvalid, "aria-describedby": this.question.ariaDescribedBy, required: this.question.isRequired },
|
57763
57902
|
this.question.allowClear ? (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("option", { value: "" }, this.question.placeholder)) : null,
|
57764
57903
|
this.question.visibleChoices.map(function (item, i) { return react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_dropdown_item__WEBPACK_IMPORTED_MODULE_4__["SurveyQuestionOptionItem"], { key: "item" + i, item: item }); })));
|
57765
|
-
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: cssClasses.selectWrapper },
|
57904
|
+
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: cssClasses.selectWrapper },
|
57905
|
+
selectElement,
|
57906
|
+
this.createChevronButton()));
|
57766
57907
|
};
|
57767
57908
|
return SurveyQuestionDropdownSelect;
|
57768
57909
|
}(_reactquestion_dropdown__WEBPACK_IMPORTED_MODULE_3__["SurveyQuestionDropdown"]));
|
@@ -59011,6 +59152,7 @@ var Survey = /** @class */ (function (_super) {
|
|
59011
59152
|
else {
|
59012
59153
|
renderResult = this.renderSurvey();
|
59013
59154
|
}
|
59155
|
+
var backgroundImage = !!this.survey.renderBackgroundImage ? react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.css.rootBackgroundImage, style: this.survey.backgroundImageStyle }) : null;
|
59014
59156
|
var header = react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_components_survey_header_survey_header__WEBPACK_IMPORTED_MODULE_5__["SurveyHeader"], { survey: this.survey });
|
59015
59157
|
var onSubmit = function (event) {
|
59016
59158
|
event.preventDefault();
|
@@ -59021,11 +59163,9 @@ var Survey = /** @class */ (function (_super) {
|
|
59021
59163
|
}
|
59022
59164
|
var rootCss = this.survey.getRootCss();
|
59023
59165
|
var cssClasses = this.rootNodeClassName ? this.rootNodeClassName + " " + rootCss : rootCss;
|
59024
|
-
var formStyle = {
|
59025
|
-
backgroundColor: this.survey.renderBackgroundOpacity
|
59026
|
-
};
|
59027
59166
|
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { id: this.rootNodeId, ref: this.rootRef, className: cssClasses, style: this.survey.themeVariables },
|
59028
|
-
|
59167
|
+
backgroundImage,
|
59168
|
+
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("form", { onSubmit: onSubmit },
|
59029
59169
|
customHeader,
|
59030
59170
|
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.css.container },
|
59031
59171
|
header,
|
@@ -61216,7 +61356,7 @@ var SurveyQuestionFile = /** @class */ (function (_super) {
|
|
61216
61356
|
fileInput = (this.isDisplayMode ?
|
61217
61357
|
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 })
|
61218
61358
|
:
|
61219
|
-
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 }));
|
61359
|
+
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 }));
|
61220
61360
|
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.question.fileRootCss },
|
61221
61361
|
fileInput,
|
61222
61362
|
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 },
|
@@ -62785,12 +62925,12 @@ var SurveyQuestionRanking = /** @class */ (function (_super) {
|
|
62785
62925
|
this.getItems(this.question.unRankingChoices, unrankedItem),
|
62786
62926
|
this.question.unRankingChoices.length === 0 ? react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.question.cssClasses.containerPlaceholder },
|
62787
62927
|
" ",
|
62788
|
-
this.question.
|
62928
|
+
this.question.selectToRankEmptyRankedAreaText,
|
62789
62929
|
" ") : null),
|
62790
62930
|
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.question.cssClasses.containersDivider }),
|
62791
62931
|
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.question.getContainerClasses("to"), "data-ranking": "to-container" },
|
62792
62932
|
this.getItems(),
|
62793
|
-
this.question.rankingChoices.length === 0 ? react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.question.cssClasses.containerPlaceholder }, this.question.
|
62933
|
+
this.question.rankingChoices.length === 0 ? react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.question.cssClasses.containerPlaceholder }, this.question.selectToRankEmptyUnrankedAreaText) : null)));
|
62794
62934
|
}
|
62795
62935
|
};
|
62796
62936
|
SurveyQuestionRanking.prototype.getItems = function (choices, unrankedItem) {
|
@@ -63074,7 +63214,7 @@ var SurveyQuestionTagbox = /** @class */ (function (_super) {
|
|
63074
63214
|
var _this = this;
|
63075
63215
|
var dropdownMultiSelectListModel = dropdownListModel;
|
63076
63216
|
var items = this.question.selectedChoices.map(function (choice, index) { return _this.renderItem("item" + index, choice); });
|
63077
|
-
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { id: this.question.inputId, className: this.question.getControlClass(), tabIndex: dropdownListModel.inputReadOnly ? undefined : 0,
|
63217
|
+
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { id: this.question.inputId, className: this.question.getControlClass(), tabIndex: dropdownListModel.inputReadOnly ? undefined : 0,
|
63078
63218
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
63079
63219
|
// @ts-ignore
|
63080
63220
|
disabled: this.question.isInputReadOnly, required: this.question.isRequired, onKeyDown: this.keyhandler, onBlur: this.blur, role: this.question.ariaRole, "aria-required": this.question.ariaRequired, "aria-label": this.question.ariaLabel, "aria-invalid": this.question.ariaInvalid, "aria-describedby": this.question.ariaDescribedBy, "aria-expanded": this.question.ariaExpanded === null ? undefined : this.question.ariaExpanded === "true", "aria-controls": dropdownListModel.listElementId, "aria-activedescendant": dropdownListModel.ariaActivedescendant },
|
@@ -68569,10 +68709,7 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
68569
68709
|
});
|
68570
68710
|
Object.defineProperty(SurveyModel.prototype, "themeVariables", {
|
68571
68711
|
get: function () {
|
68572
|
-
|
68573
|
-
result.backgroundImage = this.renderBackgroundImage;
|
68574
|
-
result.backgroundSize = this.backgroundImageFit;
|
68575
|
-
return result;
|
68712
|
+
return Object.assign({}, this.cssVariables);
|
68576
68713
|
},
|
68577
68714
|
enumerable: false,
|
68578
68715
|
configurable: true
|
@@ -68661,14 +68798,14 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
68661
68798
|
enumerable: false,
|
68662
68799
|
configurable: true
|
68663
68800
|
});
|
68664
|
-
Object.defineProperty(SurveyModel.prototype, "
|
68801
|
+
Object.defineProperty(SurveyModel.prototype, "backgroundImageStyle", {
|
68665
68802
|
get: function () {
|
68666
|
-
|
68667
|
-
|
68668
|
-
|
68669
|
-
|
68670
|
-
|
68671
|
-
|
68803
|
+
return {
|
68804
|
+
opacity: this.backgroundOpacity,
|
68805
|
+
backgroundImage: this.renderBackgroundImage,
|
68806
|
+
backgroundSize: this.backgroundImageFit,
|
68807
|
+
backgroundAttachment: this.backgroundImageAttachment
|
68808
|
+
};
|
68672
68809
|
},
|
68673
68810
|
enumerable: false,
|
68674
68811
|
configurable: true
|
@@ -70331,7 +70468,19 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
70331
70468
|
Object.defineProperty(SurveyModel.prototype, "areEmptyElementsHidden", {
|
70332
70469
|
get: function () {
|
70333
70470
|
return (this.isShowingPreview &&
|
70334
|
-
this.showPreviewBeforeComplete == "showAnsweredQuestions");
|
70471
|
+
this.showPreviewBeforeComplete == "showAnsweredQuestions" && this.isAnyQuestionAnswered);
|
70472
|
+
},
|
70473
|
+
enumerable: false,
|
70474
|
+
configurable: true
|
70475
|
+
});
|
70476
|
+
Object.defineProperty(SurveyModel.prototype, "isAnyQuestionAnswered", {
|
70477
|
+
get: function () {
|
70478
|
+
var questions = this.getAllQuestions(true);
|
70479
|
+
for (var i = 0; i < questions.length; i++) {
|
70480
|
+
if (!questions[i].isEmpty())
|
70481
|
+
return true;
|
70482
|
+
}
|
70483
|
+
return false;
|
70335
70484
|
},
|
70336
70485
|
enumerable: false,
|
70337
70486
|
configurable: true
|
@@ -71125,11 +71274,11 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
71125
71274
|
* @returns `false` if survey completion is cancelled within the [`onCompleting`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#onCompleting) event handler; otherwise, `true`.
|
71126
71275
|
* @see surveyPostId
|
71127
71276
|
*/
|
71128
|
-
SurveyModel.prototype.doComplete = function (isCompleteOnTrigger) {
|
71277
|
+
SurveyModel.prototype.doComplete = function (isCompleteOnTrigger, completeTrigger) {
|
71129
71278
|
if (isCompleteOnTrigger === void 0) { isCompleteOnTrigger = false; }
|
71130
71279
|
if (this.isCompleted)
|
71131
71280
|
return;
|
71132
|
-
if (!this.checkOnCompletingEvent(isCompleteOnTrigger)) {
|
71281
|
+
if (!this.checkOnCompletingEvent(isCompleteOnTrigger, completeTrigger)) {
|
71133
71282
|
this.isCompleted = false;
|
71134
71283
|
return false;
|
71135
71284
|
}
|
@@ -71137,11 +71286,11 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
71137
71286
|
this.stopTimer();
|
71138
71287
|
this.isCompleted = true;
|
71139
71288
|
this.clearUnusedValues();
|
71140
|
-
this.saveDataOnComplete(isCompleteOnTrigger);
|
71289
|
+
this.saveDataOnComplete(isCompleteOnTrigger, completeTrigger);
|
71141
71290
|
this.setCookie();
|
71142
71291
|
return true;
|
71143
71292
|
};
|
71144
|
-
SurveyModel.prototype.saveDataOnComplete = function (isCompleteOnTrigger) {
|
71293
|
+
SurveyModel.prototype.saveDataOnComplete = function (isCompleteOnTrigger, completeTrigger) {
|
71145
71294
|
var _this = this;
|
71146
71295
|
if (isCompleteOnTrigger === void 0) { isCompleteOnTrigger = false; }
|
71147
71296
|
var previousCookie = this.hasCookie;
|
@@ -71162,6 +71311,7 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
71162
71311
|
var savingDataStarted = false;
|
71163
71312
|
var onCompleteOptions = {
|
71164
71313
|
isCompleteOnTrigger: isCompleteOnTrigger,
|
71314
|
+
completeTrigger: completeTrigger,
|
71165
71315
|
showSaveInProgress: showSaveInProgress,
|
71166
71316
|
showSaveError: showSaveError,
|
71167
71317
|
showSaveSuccess: showSaveSuccess,
|
@@ -71180,11 +71330,12 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
71180
71330
|
this.navigateTo();
|
71181
71331
|
}
|
71182
71332
|
};
|
71183
|
-
SurveyModel.prototype.checkOnCompletingEvent = function (isCompleteOnTrigger) {
|
71333
|
+
SurveyModel.prototype.checkOnCompletingEvent = function (isCompleteOnTrigger, completeTrigger) {
|
71184
71334
|
var options = {
|
71185
71335
|
allowComplete: true,
|
71186
71336
|
allow: true,
|
71187
71337
|
isCompleteOnTrigger: isCompleteOnTrigger,
|
71338
|
+
completeTrigger: completeTrigger
|
71188
71339
|
};
|
71189
71340
|
this.onCompleting.fire(this, options);
|
71190
71341
|
return options.allowComplete && options.allow;
|
@@ -71329,8 +71480,8 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
71329
71480
|
this.doComplete(true);
|
71330
71481
|
}
|
71331
71482
|
};
|
71332
|
-
SurveyModel.prototype.setCompleted = function () {
|
71333
|
-
this.doComplete(true);
|
71483
|
+
SurveyModel.prototype.setCompleted = function (trigger) {
|
71484
|
+
this.doComplete(true, trigger);
|
71334
71485
|
};
|
71335
71486
|
SurveyModel.prototype.canBeCompleted = function (trigger, isCompleted) {
|
71336
71487
|
if (!_settings__WEBPACK_IMPORTED_MODULE_14__["settings"].triggers.changeNavigationButtonsOnComplete)
|
@@ -73963,7 +74114,7 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
73963
74114
|
}
|
73964
74115
|
}
|
73965
74116
|
}
|
73966
|
-
else if (isStrCiEqual(layoutElement.id, "progress-" + this.progressBarType)) {
|
74117
|
+
else if (this.state === "running" && isStrCiEqual(layoutElement.id, "progress-" + this.progressBarType)) {
|
73967
74118
|
if (container === "header") {
|
73968
74119
|
if (this.isShowProgressBarOnTop && !this.isShowStartingPage) {
|
73969
74120
|
containerLayoutElements.push(layoutElement);
|
@@ -74052,9 +74203,6 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
74052
74203
|
__decorate([
|
74053
74204
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])({ defaultValue: {} })
|
74054
74205
|
], SurveyModel.prototype, "cssVariables", void 0);
|
74055
|
-
__decorate([
|
74056
|
-
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])()
|
74057
|
-
], SurveyModel.prototype, "backgroundImagePosition", void 0);
|
74058
74206
|
__decorate([
|
74059
74207
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])()
|
74060
74208
|
], SurveyModel.prototype, "_isMobile", void 0);
|
@@ -74067,6 +74215,9 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
74067
74215
|
__decorate([
|
74068
74216
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])()
|
74069
74217
|
], SurveyModel.prototype, "backgroundImageFit", void 0);
|
74218
|
+
__decorate([
|
74219
|
+
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])()
|
74220
|
+
], SurveyModel.prototype, "backgroundImageAttachment", void 0);
|
74070
74221
|
__decorate([
|
74071
74222
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])()
|
74072
74223
|
], SurveyModel.prototype, "rootCss", void 0);
|
@@ -74321,6 +74472,7 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_1__["Serializer"].addClass("survey", [
|
|
74321
74472
|
{ name: "width", visibleIf: function (obj) { return obj.widthMode === "static"; } },
|
74322
74473
|
{ name: "backgroundImage", serializationProperty: "locBackgroundImage", visible: false },
|
74323
74474
|
{ name: "backgroundImageFit", default: "cover", choices: ["auto", "contain", "cover"], visible: false },
|
74475
|
+
{ name: "backgroundImageAttachment", default: "scroll", choices: ["scroll", "fixed"], visible: false },
|
74324
74476
|
{ name: "backgroundOpacity:number", minValue: 0, maxValue: 1, default: 1, visible: false },
|
74325
74477
|
{ name: "showBrandInfo:boolean", default: false, visible: false }
|
74326
74478
|
]);
|
@@ -75652,7 +75804,7 @@ var SurveyTriggerComplete = /** @class */ (function (_super) {
|
|
75652
75804
|
if (!this.owner)
|
75653
75805
|
return;
|
75654
75806
|
if (this.isRealExecution()) {
|
75655
|
-
this.owner.setCompleted();
|
75807
|
+
this.owner.setCompleted(this);
|
75656
75808
|
}
|
75657
75809
|
else {
|
75658
75810
|
this.owner.canBeCompleted(this, true);
|