survey-react 1.9.107 → 1.9.109
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 +99 -57
- package/defaultV2.css.map +1 -1
- package/defaultV2.min.css +2 -2
- package/modern.css +6 -3
- package/modern.css.map +1 -1
- package/modern.min.css +2 -2
- package/package.json +1 -1
- package/survey.css +1 -1
- package/survey.min.css +2 -2
- package/survey.react.d.ts +328 -272
- package/survey.react.js +834 -461
- 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.109
|
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
|
*/
|
@@ -734,6 +734,9 @@ function createDropdownActionModel(actionOptions, dropdownOptions, locOwner) {
|
|
734
734
|
}
|
735
735
|
function createDropdownActionModelAdvanced(actionOptions, listOptions, popupOptions, locOwner) {
|
736
736
|
var listModel = new _list__WEBPACK_IMPORTED_MODULE_3__["ListModel"](listOptions.items, function (item) {
|
737
|
+
if (newAction.hasTitle) {
|
738
|
+
newAction.title = item.title;
|
739
|
+
}
|
737
740
|
listOptions.onSelectionChanged(item);
|
738
741
|
innerPopupModel.toggleVisibility();
|
739
742
|
}, listOptions.allowSelection, listOptions.selectedItem, listOptions.onFilterStringChangedCallback);
|
@@ -968,7 +971,9 @@ var Action = /** @class */ (function (_super) {
|
|
968
971
|
//Object.assign(this, item) to support IE11
|
969
972
|
if (!!innerItem) {
|
970
973
|
for (var key in innerItem) {
|
971
|
-
|
974
|
+
if (key !== "locTitle") {
|
975
|
+
_this[key] = innerItem[key];
|
976
|
+
}
|
972
977
|
}
|
973
978
|
}
|
974
979
|
if (!!_this.locTitleName) {
|
@@ -5403,6 +5408,7 @@ var defaultV2Css = {
|
|
5403
5408
|
},
|
5404
5409
|
checkbox: {
|
5405
5410
|
root: "sd-selectbase",
|
5411
|
+
rootMobile: "sd-selectbase--mobile",
|
5406
5412
|
rootRow: "sd-selectbase--row",
|
5407
5413
|
rootMultiColumn: "sd-selectbase--multi-column",
|
5408
5414
|
item: "sd-item sd-checkbox sd-selectbase__item",
|
@@ -5425,6 +5431,7 @@ var defaultV2Css = {
|
|
5425
5431
|
},
|
5426
5432
|
radiogroup: {
|
5427
5433
|
root: "sd-selectbase",
|
5434
|
+
rootMobile: "sd-selectbase--mobile",
|
5428
5435
|
rootRow: "sd-selectbase--row",
|
5429
5436
|
rootMultiColumn: "sd-selectbase--multi-column",
|
5430
5437
|
item: "sd-item sd-radio sd-selectbase__item",
|
@@ -5480,7 +5487,7 @@ var defaultV2Css = {
|
|
5480
5487
|
checkboxItemIndeterminate: "sd-checkbox--intermediate",
|
5481
5488
|
checkboxItemChecked: "sd-item--checked sd-checkbox--checked",
|
5482
5489
|
checkboxItemDecorator: "sd-item__svg sd-checkbox__svg",
|
5483
|
-
checkboxItemDisabled: "sd-checkbox--disabled",
|
5490
|
+
checkboxItemDisabled: "sd-item--disabled sd-checkbox--disabled",
|
5484
5491
|
controlCheckbox: "sd-visuallyhidden sd-item__control sd-checkbox__control",
|
5485
5492
|
checkboxMaterialDecorator: "sd-item__decorator sd-checkbox__decorator",
|
5486
5493
|
checkboxControlLabel: "sd-item__control-label",
|
@@ -5496,8 +5503,11 @@ var defaultV2Css = {
|
|
5496
5503
|
},
|
5497
5504
|
multipletext: {
|
5498
5505
|
root: "sd-multipletext",
|
5506
|
+
rootMobile: "sd-multipletext--mobile",
|
5499
5507
|
itemLabel: "sd-multipletext__item-container sd-input",
|
5500
5508
|
itemLabelOnError: "sd-multipletext__item-container--error",
|
5509
|
+
itemLabelAllowFocus: "sd-multipletext__item-container--allow-focus",
|
5510
|
+
itemLabelAnswered: "sd-multipletext__item-container--answered",
|
5501
5511
|
item: "sd-multipletext__item",
|
5502
5512
|
itemTitle: "sd-multipletext__item-title",
|
5503
5513
|
content: "sd-multipletext__content sd-question__content",
|
@@ -5721,6 +5731,7 @@ var defaultV2Css = {
|
|
5721
5731
|
expression: "sd-expression",
|
5722
5732
|
file: {
|
5723
5733
|
root: "sd-file",
|
5734
|
+
rootDragging: "sd-file--dragging",
|
5724
5735
|
other: "sd-input sd-comment",
|
5725
5736
|
placeholderInput: "sd-visuallyhidden",
|
5726
5737
|
preview: "sd-file__preview",
|
@@ -6780,9 +6791,7 @@ var DragDropDOMAdapter = /** @class */ (function () {
|
|
6780
6791
|
_this.currentY = pointerMoveEvent.pageY;
|
6781
6792
|
if (_this.isMicroMovement)
|
6782
6793
|
return;
|
6783
|
-
|
6784
|
-
document.body.style.setProperty("user-select", "");
|
6785
|
-
document.body.style.setProperty("-webkit-user-select", "");
|
6794
|
+
_this.returnUserSelectBack();
|
6786
6795
|
_this.stopLongTap();
|
6787
6796
|
};
|
6788
6797
|
this.stopLongTap = function (e) {
|
@@ -6830,9 +6839,7 @@ var DragDropDOMAdapter = /** @class */ (function () {
|
|
6830
6839
|
}
|
6831
6840
|
_this.savedTargetNode = null;
|
6832
6841
|
_this.savedTargetNodeParent = null;
|
6833
|
-
|
6834
|
-
document.body.style.setProperty("user-select", "");
|
6835
|
-
document.body.style.setProperty("-webkit-user-select", "");
|
6842
|
+
_this.returnUserSelectBack();
|
6836
6843
|
};
|
6837
6844
|
this.drop = function () {
|
6838
6845
|
_this.dd.drop();
|
@@ -6869,8 +6876,7 @@ var DragDropDOMAdapter = /** @class */ (function () {
|
|
6869
6876
|
this.startX = event.pageX;
|
6870
6877
|
this.startY = event.pageY;
|
6871
6878
|
document.body.style.setProperty("touch-action", "none", "important");
|
6872
|
-
document.body.style.setProperty("
|
6873
|
-
document.body.style.setProperty("-webkit-user-select", "none", "important");
|
6879
|
+
document.body.style.setProperty("-webkit-touch-callout", "none", "important");
|
6874
6880
|
this.timeoutID = setTimeout(function () {
|
6875
6881
|
_this.doStartDrag(event, draggedElement, parentElement, draggedElementNode);
|
6876
6882
|
if (!preventSaveTargetNode) {
|
@@ -7019,8 +7025,16 @@ var DragDropDOMAdapter = /** @class */ (function () {
|
|
7019
7025
|
this.draggedElementShortcut.addEventListener("contextmenu", this.onContextMenu);
|
7020
7026
|
}
|
7021
7027
|
};
|
7028
|
+
DragDropDOMAdapter.prototype.returnUserSelectBack = function () {
|
7029
|
+
document.body.style.setProperty("touch-action", "auto");
|
7030
|
+
document.body.style.setProperty("user-select", "auto");
|
7031
|
+
document.body.style.setProperty("-webkit-user-select", "auto");
|
7032
|
+
document.body.style.setProperty("-webkit-touch-callout", "default");
|
7033
|
+
};
|
7022
7034
|
DragDropDOMAdapter.prototype.startDrag = function (event, draggedElement, parentElement, draggedElementNode, preventSaveTargetNode) {
|
7023
7035
|
if (preventSaveTargetNode === void 0) { preventSaveTargetNode = false; }
|
7036
|
+
document.body.style.setProperty("user-select", "none", "important");
|
7037
|
+
document.body.style.setProperty("-webkit-user-select", "none", "important");
|
7024
7038
|
if (_utils_devices__WEBPACK_IMPORTED_MODULE_1__["IsTouch"]) {
|
7025
7039
|
this.startLongTapProcessing(event, draggedElement, parentElement, draggedElementNode, preventSaveTargetNode);
|
7026
7040
|
return;
|
@@ -9214,8 +9228,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
9214
9228
|
//import "../../modern.scss";
|
9215
9229
|
var Version;
|
9216
9230
|
var ReleaseDate;
|
9217
|
-
Version = "" + "1.9.
|
9218
|
-
ReleaseDate = "" + "2023-09-
|
9231
|
+
Version = "" + "1.9.109";
|
9232
|
+
ReleaseDate = "" + "2023-09-19";
|
9219
9233
|
function checkLibraryVersion(ver, libraryName) {
|
9220
9234
|
if (Version != ver) {
|
9221
9235
|
var str = "survey-core has version '" + Version + "' and " + libraryName
|
@@ -16058,6 +16072,32 @@ function weekday(params) {
|
|
16058
16072
|
return date.getDay();
|
16059
16073
|
}
|
16060
16074
|
FunctionFactory.Instance.register("weekday", weekday);
|
16075
|
+
function getQuestionValueByContext(context, name) {
|
16076
|
+
if (!context || !name)
|
16077
|
+
return undefined;
|
16078
|
+
var keys = ["row", "panel", "survey"];
|
16079
|
+
for (var i = 0; i < keys.length; i++) {
|
16080
|
+
var ctx = context[keys[i]];
|
16081
|
+
if (ctx && ctx.getQuestionByName) {
|
16082
|
+
var res = ctx.getQuestionByName(name);
|
16083
|
+
if (res)
|
16084
|
+
return res;
|
16085
|
+
}
|
16086
|
+
}
|
16087
|
+
return null;
|
16088
|
+
}
|
16089
|
+
function displayValue(params) {
|
16090
|
+
var q = getQuestionValueByContext(this, params[0]);
|
16091
|
+
return q ? q.displayValue : "";
|
16092
|
+
}
|
16093
|
+
FunctionFactory.Instance.register("displayValue", displayValue);
|
16094
|
+
function propertyValue(params) {
|
16095
|
+
if (params.length !== 2 || !params[0] || !params[1])
|
16096
|
+
return undefined;
|
16097
|
+
var q = getQuestionValueByContext(this, params[0]);
|
16098
|
+
return q ? q[params[1]] : undefined;
|
16099
|
+
}
|
16100
|
+
FunctionFactory.Instance.register("propertyValue", propertyValue);
|
16061
16101
|
|
16062
16102
|
|
16063
16103
|
/***/ }),
|
@@ -27649,6 +27689,13 @@ var PageModel = /** @class */ (function (_super) {
|
|
27649
27689
|
this.locNavigationTitle.strChanged();
|
27650
27690
|
this.locNavigationDescription.strChanged();
|
27651
27691
|
};
|
27692
|
+
Object.defineProperty(PageModel.prototype, "renderedNavigationTitle", {
|
27693
|
+
get: function () {
|
27694
|
+
return this.locNavigationTitle.renderedHtml || this.title || this.name;
|
27695
|
+
},
|
27696
|
+
enumerable: false,
|
27697
|
+
configurable: true
|
27698
|
+
});
|
27652
27699
|
Object.defineProperty(PageModel.prototype, "passed", {
|
27653
27700
|
get: function () {
|
27654
27701
|
return this.getPropertyValue("passed", false);
|
@@ -28287,6 +28334,13 @@ var PanelModelBase = /** @class */ (function (_super) {
|
|
28287
28334
|
this.elements[i].locStrsChanged();
|
28288
28335
|
}
|
28289
28336
|
};
|
28337
|
+
Object.defineProperty(PanelModelBase.prototype, "renderedNavigationTitle", {
|
28338
|
+
get: function () {
|
28339
|
+
return this.title || this.name;
|
28340
|
+
},
|
28341
|
+
enumerable: false,
|
28342
|
+
configurable: true
|
28343
|
+
});
|
28290
28344
|
Object.defineProperty(PanelModelBase.prototype, "requiredText", {
|
28291
28345
|
/**
|
28292
28346
|
* Returns a character or text string that indicates a required panel/page.
|
@@ -29494,10 +29548,10 @@ var PanelModelBase = /** @class */ (function (_super) {
|
|
29494
29548
|
}
|
29495
29549
|
this.runConditionCore(values, properties);
|
29496
29550
|
};
|
29497
|
-
PanelModelBase.prototype.onAnyValueChanged = function (name) {
|
29551
|
+
PanelModelBase.prototype.onAnyValueChanged = function (name, questionName) {
|
29498
29552
|
var els = this.elements;
|
29499
29553
|
for (var i = 0; i < els.length; i++) {
|
29500
|
-
els[i].onAnyValueChanged(name);
|
29554
|
+
els[i].onAnyValueChanged(name, questionName);
|
29501
29555
|
}
|
29502
29556
|
};
|
29503
29557
|
PanelModelBase.prototype.checkBindings = function (valueName, value) {
|
@@ -29905,20 +29959,9 @@ var PanelModel = /** @class */ (function (_super) {
|
|
29905
29959
|
enumerable: false,
|
29906
29960
|
configurable: true
|
29907
29961
|
});
|
29908
|
-
Object.defineProperty(PanelModel.prototype, "footerToolbarCss", {
|
29909
|
-
get: function () {
|
29910
|
-
var _a;
|
29911
|
-
return this.footerToolbarCssValue || ((_a = this.cssClasses.panel) === null || _a === void 0 ? void 0 : _a.footer);
|
29912
|
-
},
|
29913
|
-
set: function (val) {
|
29914
|
-
this.footerToolbarCssValue = val;
|
29915
|
-
},
|
29916
|
-
enumerable: false,
|
29917
|
-
configurable: true
|
29918
|
-
});
|
29919
29962
|
PanelModel.prototype.getFooterToolbar = function () {
|
29920
29963
|
var _this = this;
|
29921
|
-
var _a;
|
29964
|
+
var _a, _b;
|
29922
29965
|
if (!this.footerToolbarValue) {
|
29923
29966
|
var actions = this.footerActions;
|
29924
29967
|
if (this.hasEditButton) {
|
@@ -29936,9 +29979,13 @@ var PanelModel = /** @class */ (function (_super) {
|
|
29936
29979
|
actions = (_a = this.survey) === null || _a === void 0 ? void 0 : _a.getUpdatedPanelFooterActions(this, actions);
|
29937
29980
|
}
|
29938
29981
|
this.footerToolbarValue = this.createActionContainer(this.allowAdaptiveActions);
|
29939
|
-
|
29940
|
-
|
29941
|
-
|
29982
|
+
var footerCss = this.onGetFooterToolbarCssCallback ? this.onGetFooterToolbarCssCallback() : "";
|
29983
|
+
if (!footerCss) {
|
29984
|
+
footerCss = (_b = this.cssClasses.panel) === null || _b === void 0 ? void 0 : _b.footer;
|
29985
|
+
}
|
29986
|
+
if (footerCss) {
|
29987
|
+
this.footerToolbarValue.containerCss = footerCss;
|
29988
|
+
}
|
29942
29989
|
this.footerToolbarValue.setItems(actions);
|
29943
29990
|
}
|
29944
29991
|
return this.footerToolbarValue;
|
@@ -31870,7 +31917,7 @@ var __decorate = (undefined && undefined.__decorate) || function (decorators, ta
|
|
31870
31917
|
|
31871
31918
|
|
31872
31919
|
/**
|
31873
|
-
* A
|
31920
|
+
* A class that renders a survey in a pop-up window.
|
31874
31921
|
*
|
31875
31922
|
* [View Demo](https://surveyjs.io/form-library/examples/popup-survey/ (linkStyle))
|
31876
31923
|
*/
|
@@ -31880,7 +31927,11 @@ var PopupSurveyModel = /** @class */ (function (_super) {
|
|
31880
31927
|
if (initialModel === void 0) { initialModel = null; }
|
31881
31928
|
var _this = _super.call(this) || this;
|
31882
31929
|
/**
|
31883
|
-
*
|
31930
|
+
* Specifies how many seconds the pop-up window should remain open after users complete the survey.
|
31931
|
+
*
|
31932
|
+
* Default value: 0 (the window is closed immediately)
|
31933
|
+
*
|
31934
|
+
* Set this property to a negative value (for instance, -1) to keep the pop-up window open without a time limit.
|
31884
31935
|
*/
|
31885
31936
|
_this.closeOnCompleteTimeout = 0;
|
31886
31937
|
if (initialModel) {
|
@@ -31915,8 +31966,7 @@ var PopupSurveyModel = /** @class */ (function (_super) {
|
|
31915
31966
|
};
|
31916
31967
|
Object.defineProperty(PopupSurveyModel.prototype, "survey", {
|
31917
31968
|
/**
|
31918
|
-
* A survey
|
31919
|
-
* @see SurveyModel
|
31969
|
+
* A [`SurveyModel`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model) instance rendered in the pop-up window.
|
31920
31970
|
*/
|
31921
31971
|
get: function () {
|
31922
31972
|
return this.surveyValue;
|
@@ -31926,9 +31976,9 @@ var PopupSurveyModel = /** @class */ (function (_super) {
|
|
31926
31976
|
});
|
31927
31977
|
Object.defineProperty(PopupSurveyModel.prototype, "isShowing", {
|
31928
31978
|
/**
|
31929
|
-
*
|
31930
|
-
*
|
31931
|
-
*
|
31979
|
+
* Indicates whether the pop-up survey appears on the page, regardless of its [expand state](#isExpanded).
|
31980
|
+
*
|
31981
|
+
* You can set this property to `true` or `false` to control visibility of the pop-up survey. Alternatively, you can use the [`show()`](#show) and [`hide()`](#hide) methods.
|
31932
31982
|
*/
|
31933
31983
|
get: function () {
|
31934
31984
|
return this.getPropertyValue("isShowing", false);
|
@@ -31940,26 +31990,30 @@ var PopupSurveyModel = /** @class */ (function (_super) {
|
|
31940
31990
|
configurable: true
|
31941
31991
|
});
|
31942
31992
|
/**
|
31943
|
-
*
|
31993
|
+
* Shows the pop-up survey. The survey may appear [expanded or collapsed](#isExpanded).
|
31994
|
+
*
|
31995
|
+
* As an alternative to this method, you can set the [`isShowing`](#isShowing) property to `true`.
|
31944
31996
|
* @see hide
|
31945
|
-
* @see isShowing
|
31946
31997
|
*/
|
31947
31998
|
PopupSurveyModel.prototype.show = function () {
|
31948
31999
|
this.isShowing = true;
|
31949
32000
|
};
|
31950
32001
|
/**
|
31951
|
-
*
|
32002
|
+
* Hides the pop-up survey.
|
32003
|
+
*
|
32004
|
+
* As an alternative to this method, you can set the [`isShowing`](#isShowing) property to `false`.
|
31952
32005
|
* @see show
|
31953
|
-
* @see
|
32006
|
+
* @see expand
|
32007
|
+
* @see collapse
|
31954
32008
|
*/
|
31955
32009
|
PopupSurveyModel.prototype.hide = function () {
|
31956
32010
|
this.isShowing = false;
|
31957
32011
|
};
|
31958
32012
|
Object.defineProperty(PopupSurveyModel.prototype, "isExpanded", {
|
31959
32013
|
/**
|
31960
|
-
*
|
31961
|
-
*
|
31962
|
-
*
|
32014
|
+
* Indicates whether the pop-up window is expanded or collapsed.
|
32015
|
+
*
|
32016
|
+
* You can set this property to `true` or `false` to control the expand state of the pop-up survey. Alternatively, you can use the [`expand()`](#expand) and [`collapse()`](#collapse) methods.
|
31963
32017
|
*/
|
31964
32018
|
get: function () {
|
31965
32019
|
return this.getPropertyValue("isExpanded", false);
|
@@ -31978,7 +32032,7 @@ var PopupSurveyModel = /** @class */ (function (_super) {
|
|
31978
32032
|
};
|
31979
32033
|
Object.defineProperty(PopupSurveyModel.prototype, "title", {
|
31980
32034
|
/**
|
31981
|
-
*
|
32035
|
+
* A title for the pop-up window. If this property is undefined, the title is taken from [`SurveyModel`](#survey)'s [`title`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#title) property.
|
31982
32036
|
*/
|
31983
32037
|
get: function () {
|
31984
32038
|
return this.survey.title;
|
@@ -31997,13 +32051,19 @@ var PopupSurveyModel = /** @class */ (function (_super) {
|
|
31997
32051
|
configurable: true
|
31998
32052
|
});
|
31999
32053
|
/**
|
32000
|
-
*
|
32054
|
+
* Expands the pop-up window.
|
32055
|
+
*
|
32056
|
+
* As an alternative to this method, you can set the [`isExpanded`](#isExpanded) property to `true`.
|
32057
|
+
* @see collapse
|
32001
32058
|
*/
|
32002
32059
|
PopupSurveyModel.prototype.expand = function () {
|
32003
32060
|
this.isExpanded = true;
|
32004
32061
|
};
|
32005
32062
|
/**
|
32006
|
-
*
|
32063
|
+
* Collapses the pop-up window, leaving only the survey title visible.
|
32064
|
+
*
|
32065
|
+
* As an alternative to this method, you can set the [`isExpanded`](#isExpanded) property to `false`.
|
32066
|
+
* @see expand
|
32007
32067
|
*/
|
32008
32068
|
PopupSurveyModel.prototype.collapse = function () {
|
32009
32069
|
this.isExpanded = false;
|
@@ -32017,7 +32077,7 @@ var PopupSurveyModel = /** @class */ (function (_super) {
|
|
32017
32077
|
*
|
32018
32078
|
* Default value: `false`
|
32019
32079
|
*
|
32020
|
-
* If you allow users to close the pop-up window, make sure to implement a UI element that opens it. This element should call the [`show()`](
|
32080
|
+
* If you allow users to close the pop-up window, make sure to implement a UI element that opens it. This element should call the [`show()`](#show) method or enable the [`isShowing`](#isShowing) property.
|
32021
32081
|
* @see expand
|
32022
32082
|
* @see collapse
|
32023
32083
|
* @see hide
|
@@ -32897,7 +32957,15 @@ var Question = /** @class */ (function (_super) {
|
|
32897
32957
|
Question.prototype.isReadOnlyRenderDiv = function () {
|
32898
32958
|
return this.isReadOnly && _settings__WEBPACK_IMPORTED_MODULE_8__["settings"].readOnly.commentRenderMode === "div";
|
32899
32959
|
};
|
32900
|
-
Question.prototype.
|
32960
|
+
Question.prototype.allowMobileInDesignMode = function () {
|
32961
|
+
return false;
|
32962
|
+
};
|
32963
|
+
Question.prototype.updateIsMobileFromSurvey = function () {
|
32964
|
+
this.setIsMobile(this.survey._isMobile);
|
32965
|
+
};
|
32966
|
+
Question.prototype.setIsMobile = function (val) {
|
32967
|
+
this.isMobile = val && (this.allowMobileInDesignMode() || !this.isDesignMode);
|
32968
|
+
};
|
32901
32969
|
Question.prototype.createLocTitleProperty = function () {
|
32902
32970
|
var _this = this;
|
32903
32971
|
var locTitleValue = _super.prototype.createLocTitleProperty.call(this);
|
@@ -32974,46 +33042,6 @@ var Question = /** @class */ (function (_super) {
|
|
32974
33042
|
enumerable: false,
|
32975
33043
|
configurable: true
|
32976
33044
|
});
|
32977
|
-
Object.defineProperty(Question.prototype, "ariaRequired", {
|
32978
|
-
get: function () {
|
32979
|
-
return this.isRequired ? "true" : "false";
|
32980
|
-
},
|
32981
|
-
enumerable: false,
|
32982
|
-
configurable: true
|
32983
|
-
});
|
32984
|
-
Object.defineProperty(Question.prototype, "ariaInvalid", {
|
32985
|
-
get: function () {
|
32986
|
-
return this.errors.length > 0 ? "true" : "false";
|
32987
|
-
},
|
32988
|
-
enumerable: false,
|
32989
|
-
configurable: true
|
32990
|
-
});
|
32991
|
-
Object.defineProperty(Question.prototype, "ariaLabelledBy", {
|
32992
|
-
get: function () {
|
32993
|
-
if (this.hasTitle) {
|
32994
|
-
return this.ariaTitleId;
|
32995
|
-
}
|
32996
|
-
else {
|
32997
|
-
return null;
|
32998
|
-
}
|
32999
|
-
},
|
33000
|
-
enumerable: false,
|
33001
|
-
configurable: true
|
33002
|
-
});
|
33003
|
-
Object.defineProperty(Question.prototype, "ariaExpanded", {
|
33004
|
-
get: function () {
|
33005
|
-
return null;
|
33006
|
-
},
|
33007
|
-
enumerable: false,
|
33008
|
-
configurable: true
|
33009
|
-
});
|
33010
|
-
Object.defineProperty(Question.prototype, "ariaDescribedBy", {
|
33011
|
-
get: function () {
|
33012
|
-
return this.errors.length > 0 ? this.id + "_errors" : null;
|
33013
|
-
},
|
33014
|
-
enumerable: false,
|
33015
|
-
configurable: true
|
33016
|
-
});
|
33017
33045
|
Question.prototype.choicesLoaded = function () { };
|
33018
33046
|
Object.defineProperty(Question.prototype, "page", {
|
33019
33047
|
/**
|
@@ -33291,6 +33319,7 @@ var Question = /** @class */ (function (_super) {
|
|
33291
33319
|
if (!this.visible) {
|
33292
33320
|
this.updateIsVisibleProp();
|
33293
33321
|
}
|
33322
|
+
this.updateIsMobileFromSurvey();
|
33294
33323
|
};
|
33295
33324
|
Object.defineProperty(Question.prototype, "parent", {
|
33296
33325
|
/**
|
@@ -33941,6 +33970,12 @@ var Question = /** @class */ (function (_super) {
|
|
33941
33970
|
.append(this.cssClasses.invisible, !this.isDesignMode && this.areInvisibleElementsShowing && !this.visible)
|
33942
33971
|
.toString();
|
33943
33972
|
};
|
33973
|
+
Question.prototype.getQuestionRootCss = function () {
|
33974
|
+
return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_10__["CssClassBuilder"]()
|
33975
|
+
.append(this.cssClasses.root)
|
33976
|
+
.append(this.cssClasses.rootMobile, this.isMobile)
|
33977
|
+
.toString();
|
33978
|
+
};
|
33944
33979
|
Question.prototype.updateElementCss = function (reNew) {
|
33945
33980
|
_super.prototype.updateElementCss.call(this, reNew);
|
33946
33981
|
if (reNew) {
|
@@ -34174,13 +34209,6 @@ var Question = /** @class */ (function (_super) {
|
|
34174
34209
|
enumerable: false,
|
34175
34210
|
configurable: true
|
34176
34211
|
});
|
34177
|
-
Object.defineProperty(Question.prototype, "ariaRole", {
|
34178
|
-
get: function () {
|
34179
|
-
return "textbox";
|
34180
|
-
},
|
34181
|
-
enumerable: false,
|
34182
|
-
configurable: true
|
34183
|
-
});
|
34184
34212
|
Object.defineProperty(Question.prototype, "showOtherItem", {
|
34185
34213
|
/**
|
34186
34214
|
* Specifies whether to display the "Other" choice item. Incompatible with the `showCommentArea` property.
|
@@ -35254,19 +35282,16 @@ var Question = /** @class */ (function (_super) {
|
|
35254
35282
|
this.setQuestionValue(newValue);
|
35255
35283
|
if (this.data != null && this.canSetValueToSurvey()) {
|
35256
35284
|
newValue = this.valueForSurvey;
|
35257
|
-
this.data.setValue(this.getValueName(), newValue, this.getDataLocNotification(), this.allowNotifyValueChanged);
|
35285
|
+
this.data.setValue(this.getValueName(), newValue, this.getDataLocNotification(), this.allowNotifyValueChanged, this.name);
|
35258
35286
|
}
|
35259
35287
|
this.isMouseDown = false;
|
35260
35288
|
};
|
35261
35289
|
Question.prototype.canSetValueToSurvey = function () {
|
35262
35290
|
return true;
|
35263
35291
|
};
|
35264
|
-
Question.prototype.valueFromData = function (val) {
|
35265
|
-
|
35266
|
-
};
|
35267
|
-
Question.prototype.valueToData = function (val) {
|
35268
|
-
return val;
|
35269
|
-
};
|
35292
|
+
Question.prototype.valueFromData = function (val) { return val; };
|
35293
|
+
Question.prototype.valueToData = function (val) { return val; };
|
35294
|
+
Question.prototype.convertToCorrectValue = function (val) { return val; };
|
35270
35295
|
Question.prototype.onValueChanged = function () { };
|
35271
35296
|
Question.prototype.onMouseDown = function () {
|
35272
35297
|
this.isMouseDown = true;
|
@@ -35290,7 +35315,7 @@ var Question = /** @class */ (function (_super) {
|
|
35290
35315
|
}
|
35291
35316
|
if (!this.checkIsValueCorrect(newValue))
|
35292
35317
|
return;
|
35293
|
-
this.isChangingViaDefaultValue =
|
35318
|
+
this.isChangingViaDefaultValue = this.isValueEmpty(newValue);
|
35294
35319
|
this.setQuestionValue(this.valueFromData(newValue));
|
35295
35320
|
this.isChangingViaDefaultValue = false;
|
35296
35321
|
this.updateDependedQuestions();
|
@@ -35305,6 +35330,7 @@ var Question = /** @class */ (function (_super) {
|
|
35305
35330
|
};
|
35306
35331
|
Question.prototype.setQuestionValue = function (newValue, updateIsAnswered) {
|
35307
35332
|
if (updateIsAnswered === void 0) { updateIsAnswered = true; }
|
35333
|
+
newValue = this.convertToCorrectValue(newValue);
|
35308
35334
|
var isEqual = this.isTwoValueEquals(this.questionValue, newValue);
|
35309
35335
|
if (!isEqual && !this.isChangingViaDefaultValue) {
|
35310
35336
|
this.setValueChangedDirectly();
|
@@ -35357,7 +35383,7 @@ var Question = /** @class */ (function (_super) {
|
|
35357
35383
|
this.errors = [];
|
35358
35384
|
};
|
35359
35385
|
Question.prototype.clearUnusedValues = function () { };
|
35360
|
-
Question.prototype.onAnyValueChanged = function (name) { };
|
35386
|
+
Question.prototype.onAnyValueChanged = function (name, questionName) { };
|
35361
35387
|
Question.prototype.checkBindings = function (valueName, value) {
|
35362
35388
|
if (this.bindings.isEmpty() || !this.data)
|
35363
35389
|
return;
|
@@ -35487,8 +35513,10 @@ var Question = /** @class */ (function (_super) {
|
|
35487
35513
|
callback();
|
35488
35514
|
}
|
35489
35515
|
};
|
35490
|
-
this.resizeObserver = new ResizeObserver(function () {
|
35491
|
-
|
35516
|
+
this.resizeObserver = new ResizeObserver(function (entries) {
|
35517
|
+
window.requestAnimationFrame(function () {
|
35518
|
+
_this.triggerResponsiveness(false);
|
35519
|
+
});
|
35492
35520
|
});
|
35493
35521
|
this.onMobileChangedCallback = function () {
|
35494
35522
|
setTimeout(function () {
|
@@ -35538,15 +35566,146 @@ var Question = /** @class */ (function (_super) {
|
|
35538
35566
|
this.dependedQuestions[i].resetDependedQuestion();
|
35539
35567
|
}
|
35540
35568
|
};
|
35569
|
+
Object.defineProperty(Question.prototype, "isNewA11yStructure", {
|
35570
|
+
//a11y
|
35571
|
+
get: function () {
|
35572
|
+
return false;
|
35573
|
+
},
|
35574
|
+
enumerable: false,
|
35575
|
+
configurable: true
|
35576
|
+
});
|
35577
|
+
Object.defineProperty(Question.prototype, "ariaLabel", {
|
35578
|
+
get: function () {
|
35579
|
+
if (this.isNewA11yStructure)
|
35580
|
+
return null;
|
35581
|
+
return this.locTitle.renderedHtml;
|
35582
|
+
},
|
35583
|
+
enumerable: false,
|
35584
|
+
configurable: true
|
35585
|
+
});
|
35586
|
+
Object.defineProperty(Question.prototype, "ariaRole", {
|
35587
|
+
get: function () {
|
35588
|
+
if (this.isNewA11yStructure)
|
35589
|
+
return null;
|
35590
|
+
return "textbox";
|
35591
|
+
},
|
35592
|
+
enumerable: false,
|
35593
|
+
configurable: true
|
35594
|
+
});
|
35595
|
+
Object.defineProperty(Question.prototype, "ariaRequired", {
|
35596
|
+
get: function () {
|
35597
|
+
if (this.isNewA11yStructure)
|
35598
|
+
return null;
|
35599
|
+
return this.isRequired ? "true" : "false";
|
35600
|
+
},
|
35601
|
+
enumerable: false,
|
35602
|
+
configurable: true
|
35603
|
+
});
|
35604
|
+
Object.defineProperty(Question.prototype, "ariaInvalid", {
|
35605
|
+
get: function () {
|
35606
|
+
if (this.isNewA11yStructure)
|
35607
|
+
return null;
|
35608
|
+
return this.errors.length > 0 ? "true" : "false";
|
35609
|
+
},
|
35610
|
+
enumerable: false,
|
35611
|
+
configurable: true
|
35612
|
+
});
|
35613
|
+
Object.defineProperty(Question.prototype, "ariaLabelledBy", {
|
35614
|
+
get: function () {
|
35615
|
+
if (this.isNewA11yStructure)
|
35616
|
+
return null;
|
35617
|
+
if (this.hasTitle) {
|
35618
|
+
return this.ariaTitleId;
|
35619
|
+
}
|
35620
|
+
else {
|
35621
|
+
return null;
|
35622
|
+
}
|
35623
|
+
},
|
35624
|
+
enumerable: false,
|
35625
|
+
configurable: true
|
35626
|
+
});
|
35627
|
+
Object.defineProperty(Question.prototype, "ariaExpanded", {
|
35628
|
+
get: function () {
|
35629
|
+
return null;
|
35630
|
+
},
|
35631
|
+
enumerable: false,
|
35632
|
+
configurable: true
|
35633
|
+
});
|
35634
|
+
Object.defineProperty(Question.prototype, "ariaDescribedBy", {
|
35635
|
+
get: function () {
|
35636
|
+
if (this.isNewA11yStructure)
|
35637
|
+
return null;
|
35638
|
+
return this.errors.length > 0 ? this.id + "_errors" : null;
|
35639
|
+
},
|
35640
|
+
enumerable: false,
|
35641
|
+
configurable: true
|
35642
|
+
});
|
35643
|
+
Object.defineProperty(Question.prototype, "a11y_input_ariaRole", {
|
35644
|
+
//EO a11y
|
35645
|
+
//new a11y
|
35646
|
+
get: function () {
|
35647
|
+
return null;
|
35648
|
+
},
|
35649
|
+
enumerable: false,
|
35650
|
+
configurable: true
|
35651
|
+
});
|
35652
|
+
Object.defineProperty(Question.prototype, "a11y_input_ariaRequired", {
|
35653
|
+
get: function () {
|
35654
|
+
return this.isRequired ? "true" : "false";
|
35655
|
+
},
|
35656
|
+
enumerable: false,
|
35657
|
+
configurable: true
|
35658
|
+
});
|
35659
|
+
Object.defineProperty(Question.prototype, "a11y_input_ariaInvalid", {
|
35660
|
+
get: function () {
|
35661
|
+
return this.errors.length > 0 ? "true" : "false";
|
35662
|
+
},
|
35663
|
+
enumerable: false,
|
35664
|
+
configurable: true
|
35665
|
+
});
|
35666
|
+
Object.defineProperty(Question.prototype, "a11y_input_ariaLabel", {
|
35667
|
+
get: function () {
|
35668
|
+
if (this.hasTitle && !this.parentQuestion) {
|
35669
|
+
return null;
|
35670
|
+
}
|
35671
|
+
else {
|
35672
|
+
return this.locTitle.renderedHtml;
|
35673
|
+
}
|
35674
|
+
},
|
35675
|
+
enumerable: false,
|
35676
|
+
configurable: true
|
35677
|
+
});
|
35678
|
+
Object.defineProperty(Question.prototype, "a11y_input_ariaLabelledBy", {
|
35679
|
+
get: function () {
|
35680
|
+
if (this.hasTitle && !this.parentQuestion) {
|
35681
|
+
return this.ariaTitleId;
|
35682
|
+
}
|
35683
|
+
else {
|
35684
|
+
return null;
|
35685
|
+
}
|
35686
|
+
},
|
35687
|
+
enumerable: false,
|
35688
|
+
configurable: true
|
35689
|
+
});
|
35690
|
+
Object.defineProperty(Question.prototype, "a11y_input_ariaDescribedBy", {
|
35691
|
+
get: function () {
|
35692
|
+
return this.errors.length > 0 ? this.id + "_errors" : null;
|
35693
|
+
},
|
35694
|
+
enumerable: false,
|
35695
|
+
configurable: true
|
35696
|
+
});
|
35541
35697
|
Question.TextPreprocessorValuesMap = {
|
35542
35698
|
title: "processedTitle",
|
35543
35699
|
require: "requiredText",
|
35544
35700
|
};
|
35545
35701
|
Question.questionCounter = 100;
|
35546
35702
|
__decorate([
|
35547
|
-
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])({
|
35548
|
-
|
35549
|
-
|
35703
|
+
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])({
|
35704
|
+
defaultValue: false,
|
35705
|
+
onSet: function (val, target) {
|
35706
|
+
target.renderMinWidth = !val;
|
35707
|
+
}
|
35708
|
+
})
|
35550
35709
|
], Question.prototype, "isMobile", void 0);
|
35551
35710
|
__decorate([
|
35552
35711
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])()
|
@@ -36076,6 +36235,7 @@ var QuestionSelectBase = /** @class */ (function (_super) {
|
|
36076
36235
|
_super.prototype.localeChanged.call(this);
|
36077
36236
|
if (this.choicesOrder !== "none") {
|
36078
36237
|
this.updateVisibleChoices();
|
36238
|
+
this.onVisibleChoicesChanged();
|
36079
36239
|
}
|
36080
36240
|
};
|
36081
36241
|
QuestionSelectBase.prototype.locStrsChanged = function () {
|
@@ -37153,7 +37313,7 @@ var QuestionSelectBase = /** @class */ (function (_super) {
|
|
37153
37313
|
res.push(this.copyChoiceItem(choices[i]));
|
37154
37314
|
}
|
37155
37315
|
}
|
37156
|
-
if (this.choicesFromQuestionMode === "selected" && question.isOtherSelected && !!question.comment) {
|
37316
|
+
if (this.choicesFromQuestionMode === "selected" && !this.showOtherItem && question.isOtherSelected && !!question.comment) {
|
37157
37317
|
res.push(this.createItemValue(question.otherItem.value, question.comment));
|
37158
37318
|
}
|
37159
37319
|
return res;
|
@@ -37242,12 +37402,13 @@ var QuestionSelectBase = /** @class */ (function (_super) {
|
|
37242
37402
|
this.onVisibleChoicesChanged();
|
37243
37403
|
_super.prototype.onSurveyLoad.call(this);
|
37244
37404
|
};
|
37245
|
-
QuestionSelectBase.prototype.onAnyValueChanged = function (name) {
|
37246
|
-
_super.prototype.onAnyValueChanged.call(this, name);
|
37405
|
+
QuestionSelectBase.prototype.onAnyValueChanged = function (name, questionName) {
|
37406
|
+
_super.prototype.onAnyValueChanged.call(this, name, questionName);
|
37247
37407
|
if (name != this.getValueName()) {
|
37248
37408
|
this.runChoicesByUrl();
|
37249
37409
|
}
|
37250
|
-
|
37410
|
+
var chQuestion = this.choicesFromQuestion;
|
37411
|
+
if (!!name && chQuestion && (name === chQuestion || questionName === chQuestion)) {
|
37251
37412
|
this.onVisibleChoicesChanged();
|
37252
37413
|
}
|
37253
37414
|
};
|
@@ -37743,10 +37904,13 @@ var QuestionSelectBase = /** @class */ (function (_super) {
|
|
37743
37904
|
});
|
37744
37905
|
QuestionSelectBase.prototype.getSelectBaseRootCss = function () {
|
37745
37906
|
return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_10__["CssClassBuilder"]()
|
37746
|
-
.append(this.
|
37907
|
+
.append(this.getQuestionRootCss())
|
37747
37908
|
.append(this.cssClasses.rootRow, this.rowLayout)
|
37748
37909
|
.toString();
|
37749
37910
|
};
|
37911
|
+
QuestionSelectBase.prototype.allowMobileInDesignMode = function () {
|
37912
|
+
return true;
|
37913
|
+
};
|
37750
37914
|
QuestionSelectBase.prototype.getAriaItemLabel = function (item) {
|
37751
37915
|
return item.locText.renderedHtml;
|
37752
37916
|
};
|
@@ -38728,13 +38892,6 @@ var QuestionCheckboxModel = /** @class */ (function (_super) {
|
|
38728
38892
|
QuestionCheckboxModel.prototype.getDefaultItemComponent = function () {
|
38729
38893
|
return "survey-checkbox-item";
|
38730
38894
|
};
|
38731
|
-
Object.defineProperty(QuestionCheckboxModel.prototype, "ariaRole", {
|
38732
|
-
get: function () {
|
38733
|
-
return "listbox";
|
38734
|
-
},
|
38735
|
-
enumerable: false,
|
38736
|
-
configurable: true
|
38737
|
-
});
|
38738
38895
|
QuestionCheckboxModel.prototype.getType = function () {
|
38739
38896
|
return "checkbox";
|
38740
38897
|
};
|
@@ -39349,6 +39506,21 @@ var QuestionCheckboxModel = /** @class */ (function (_super) {
|
|
39349
39506
|
enumerable: false,
|
39350
39507
|
configurable: true
|
39351
39508
|
});
|
39509
|
+
Object.defineProperty(QuestionCheckboxModel.prototype, "isNewA11yStructure", {
|
39510
|
+
//a11y
|
39511
|
+
get: function () {
|
39512
|
+
return true;
|
39513
|
+
},
|
39514
|
+
enumerable: false,
|
39515
|
+
configurable: true
|
39516
|
+
});
|
39517
|
+
Object.defineProperty(QuestionCheckboxModel.prototype, "a11y_input_ariaRole", {
|
39518
|
+
get: function () {
|
39519
|
+
return "listbox";
|
39520
|
+
},
|
39521
|
+
enumerable: false,
|
39522
|
+
configurable: true
|
39523
|
+
});
|
39352
39524
|
return QuestionCheckboxModel;
|
39353
39525
|
}(_question_baseselect__WEBPACK_IMPORTED_MODULE_2__["QuestionCheckboxBase"]));
|
39354
39526
|
|
@@ -39550,6 +39722,7 @@ var QuestionCommentModel = /** @class */ (function (_super) {
|
|
39550
39722
|
}
|
39551
39723
|
_super.prototype.setNewValue.call(this, newValue);
|
39552
39724
|
};
|
39725
|
+
QuestionCommentModel.prototype.getValueSeparator = function () { return "\n"; };
|
39553
39726
|
Object.defineProperty(QuestionCommentModel.prototype, "className", {
|
39554
39727
|
get: function () {
|
39555
39728
|
return (this.cssClasses ? this.getControlClass() : "panel-comment-root") || undefined;
|
@@ -40009,10 +40182,10 @@ var QuestionCustomModel = /** @class */ (function (_super) {
|
|
40009
40182
|
QuestionCustomModel.prototype.getElement = function () {
|
40010
40183
|
return this.contentQuestion;
|
40011
40184
|
};
|
40012
|
-
QuestionCustomModel.prototype.onAnyValueChanged = function (name) {
|
40013
|
-
_super.prototype.onAnyValueChanged.call(this, name);
|
40185
|
+
QuestionCustomModel.prototype.onAnyValueChanged = function (name, questionName) {
|
40186
|
+
_super.prototype.onAnyValueChanged.call(this, name, questionName);
|
40014
40187
|
if (!!this.contentQuestion) {
|
40015
|
-
this.contentQuestion.onAnyValueChanged(name);
|
40188
|
+
this.contentQuestion.onAnyValueChanged(name, questionName);
|
40016
40189
|
}
|
40017
40190
|
};
|
40018
40191
|
QuestionCustomModel.prototype.getQuestionByName = function (name) {
|
@@ -40054,6 +40227,12 @@ var QuestionCustomModel = /** @class */ (function (_super) {
|
|
40054
40227
|
_super.prototype.focus.call(this, onError);
|
40055
40228
|
}
|
40056
40229
|
};
|
40230
|
+
QuestionCustomModel.prototype.afterRender = function (el) {
|
40231
|
+
_super.prototype.afterRender.call(this, el);
|
40232
|
+
if (!!this.contentQuestion) {
|
40233
|
+
this.contentQuestion.afterRender(el);
|
40234
|
+
}
|
40235
|
+
};
|
40057
40236
|
Object.defineProperty(QuestionCustomModel.prototype, "contentQuestion", {
|
40058
40237
|
get: function () {
|
40059
40238
|
return this.questionWrapper;
|
@@ -40266,11 +40445,11 @@ var QuestionCompositeModel = /** @class */ (function (_super) {
|
|
40266
40445
|
questions[i].clearValueIfInvisible(reason);
|
40267
40446
|
}
|
40268
40447
|
};
|
40269
|
-
QuestionCompositeModel.prototype.onAnyValueChanged = function (name) {
|
40270
|
-
_super.prototype.onAnyValueChanged.call(this, name);
|
40448
|
+
QuestionCompositeModel.prototype.onAnyValueChanged = function (name, questionName) {
|
40449
|
+
_super.prototype.onAnyValueChanged.call(this, name, questionName);
|
40271
40450
|
var questions = this.contentPanel.questions;
|
40272
40451
|
for (var i = 0; i < questions.length; i++) {
|
40273
|
-
questions[i].onAnyValueChanged(name);
|
40452
|
+
questions[i].onAnyValueChanged(name, questionName);
|
40274
40453
|
}
|
40275
40454
|
};
|
40276
40455
|
Object.defineProperty(QuestionCompositeModel.prototype, "hasSingleInput", {
|
@@ -41305,6 +41484,11 @@ var QuestionExpressionModel = /** @class */ (function (_super) {
|
|
41305
41484
|
}
|
41306
41485
|
return val.toString();
|
41307
41486
|
};
|
41487
|
+
QuestionExpressionModel.prototype.convertToCorrectValue = function (val) {
|
41488
|
+
if (Array.isArray(val))
|
41489
|
+
return val.join(", ");
|
41490
|
+
return val;
|
41491
|
+
};
|
41308
41492
|
return QuestionExpressionModel;
|
41309
41493
|
}(_question__WEBPACK_IMPORTED_MODULE_1__["Question"]));
|
41310
41494
|
|
@@ -41602,7 +41786,14 @@ var QuestionFileModel = /** @class */ (function (_super) {
|
|
41602
41786
|
*/
|
41603
41787
|
_this.onUploadStateChanged = _this.addEvent();
|
41604
41788
|
_this.onStateChanged = _this.addEvent();
|
41605
|
-
_this.
|
41789
|
+
_this.fileNavigator = new _actions_container__WEBPACK_IMPORTED_MODULE_7__["ActionContainer"]();
|
41790
|
+
_this.prevPreviewLength = 0;
|
41791
|
+
_this.calcAvailableItemsCount = function (availableWidth, itemWidth, gap) {
|
41792
|
+
var itemsCount = Math.floor(availableWidth / (itemWidth + gap));
|
41793
|
+
if ((itemsCount + 1) * (itemWidth + gap) - gap <= availableWidth)
|
41794
|
+
itemsCount++;
|
41795
|
+
return itemsCount;
|
41796
|
+
};
|
41606
41797
|
_this.dragCounter = 0;
|
41607
41798
|
_this.onDragEnter = function (event) {
|
41608
41799
|
if (!_this.isInputReadOnly) {
|
@@ -41662,7 +41853,7 @@ var QuestionFileModel = /** @class */ (function (_super) {
|
|
41662
41853
|
id: "prevPage",
|
41663
41854
|
iconSize: 16,
|
41664
41855
|
action: function () {
|
41665
|
-
_this.indexToShow = _this.previewValue.length && ((_this.indexToShow - 1 + _this.
|
41856
|
+
_this.indexToShow = _this.previewValue.length && ((_this.indexToShow - 1 + _this.pagesCount) % _this.pagesCount) || 0;
|
41666
41857
|
_this.fileIndexAction.title = _this.getFileIndexCaption();
|
41667
41858
|
}
|
41668
41859
|
});
|
@@ -41670,16 +41861,26 @@ var QuestionFileModel = /** @class */ (function (_super) {
|
|
41670
41861
|
id: "nextPage",
|
41671
41862
|
iconSize: 16,
|
41672
41863
|
action: function () {
|
41673
|
-
_this.indexToShow = _this.previewValue.length && ((_this.indexToShow + 1) % _this.
|
41864
|
+
_this.indexToShow = _this.previewValue.length && ((_this.indexToShow + 1) % _this.pagesCount) || 0;
|
41674
41865
|
_this.fileIndexAction.title = _this.getFileIndexCaption();
|
41675
41866
|
}
|
41676
41867
|
});
|
41677
|
-
_this.
|
41868
|
+
_this.fileNavigator.actions = [_this.prevFileAction, _this.fileIndexAction, _this.nextFileAction];
|
41678
41869
|
return _this;
|
41679
41870
|
}
|
41680
|
-
Object.defineProperty(QuestionFileModel.prototype, "
|
41871
|
+
Object.defineProperty(QuestionFileModel.prototype, "fileNavigatorVisible", {
|
41872
|
+
get: function () {
|
41873
|
+
var isUploading = this.isUploading;
|
41874
|
+
var containsMultipleFiles = this.containsMultiplyFiles;
|
41875
|
+
var needToShowFileNavigator = this.pageSize < this.previewValue.length;
|
41876
|
+
return !isUploading && containsMultipleFiles && needToShowFileNavigator && this.isDefaultV2Theme;
|
41877
|
+
},
|
41878
|
+
enumerable: false,
|
41879
|
+
configurable: true
|
41880
|
+
});
|
41881
|
+
Object.defineProperty(QuestionFileModel.prototype, "pagesCount", {
|
41681
41882
|
get: function () {
|
41682
|
-
return this.
|
41883
|
+
return Math.ceil(this.previewValue.length / this.pageSize);
|
41683
41884
|
},
|
41684
41885
|
enumerable: false,
|
41685
41886
|
configurable: true
|
@@ -41691,15 +41892,40 @@ var QuestionFileModel = /** @class */ (function (_super) {
|
|
41691
41892
|
//this.mobileFileNavigator.cssClasses = this.survey.getCss().actionBar;
|
41692
41893
|
};
|
41693
41894
|
QuestionFileModel.prototype.getFileIndexCaption = function () {
|
41694
|
-
return this.getLocalizationFormatString("indexText", this.indexToShow + 1, this.
|
41895
|
+
return this.getLocalizationFormatString("indexText", this.indexToShow + 1, this.pagesCount);
|
41896
|
+
};
|
41897
|
+
QuestionFileModel.prototype.updateFileNavigator = function () {
|
41898
|
+
this.indexToShow = this.previewValue.length && ((this.indexToShow + this.pagesCount) % this.pagesCount) || 0;
|
41899
|
+
this.fileIndexAction.title = this.getFileIndexCaption();
|
41695
41900
|
};
|
41696
41901
|
QuestionFileModel.prototype.previewValueChanged = function () {
|
41697
|
-
|
41902
|
+
var _this = this;
|
41903
|
+
if (this.previewValue.length !== this.prevPreviewLength) {
|
41904
|
+
if (this.previewValue.length > 0) {
|
41905
|
+
if (this.prevPreviewLength > this.previewValue.length) {
|
41906
|
+
this.indexToShow = this.indexToShow >= this.pagesCount && this.indexToShow > 0 ? this.pagesCount - 1 : this.indexToShow;
|
41907
|
+
}
|
41908
|
+
else {
|
41909
|
+
this.indexToShow = Math.floor(this.prevPreviewLength / this.pageSize);
|
41910
|
+
}
|
41911
|
+
}
|
41912
|
+
else {
|
41913
|
+
this.indexToShow = 0;
|
41914
|
+
}
|
41915
|
+
}
|
41698
41916
|
this.fileIndexAction.title = this.getFileIndexCaption();
|
41699
41917
|
this.containsMultiplyFiles = this.previewValue.length > 1;
|
41918
|
+
if (this.previewValue.length > 0 && !this.calculatedGapBetweenItems && !this.calculatedItemWidth) {
|
41919
|
+
setTimeout(function () {
|
41920
|
+
_this.processResponsiveness(0, _this._width);
|
41921
|
+
});
|
41922
|
+
}
|
41923
|
+
this.prevPreviewLength = this.previewValue.length;
|
41700
41924
|
};
|
41701
41925
|
QuestionFileModel.prototype.isPreviewVisible = function (index) {
|
41702
|
-
|
41926
|
+
var isFileNavigatorVisible = this.fileNavigatorVisible;
|
41927
|
+
var isPreviewVisible = (this.indexToShow * this.pageSize <= index && index < (this.indexToShow + 1) * this.pageSize);
|
41928
|
+
return !isFileNavigatorVisible || isPreviewVisible;
|
41703
41929
|
};
|
41704
41930
|
QuestionFileModel.prototype.getType = function () {
|
41705
41931
|
return "file";
|
@@ -42176,6 +42402,7 @@ var QuestionFileModel = /** @class */ (function (_super) {
|
|
42176
42402
|
get: function () {
|
42177
42403
|
return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_5__["CssClassBuilder"]()
|
42178
42404
|
.append(this.cssClasses.root)
|
42405
|
+
.append(this.cssClasses.rootDragging, this.isDragging)
|
42179
42406
|
.append(this.cssClasses.single, !this.allowMultiple)
|
42180
42407
|
.append(this.cssClasses.singleImage, !this.allowMultiple && this.isAnswered && this.canPreviewImage(this.value[0]))
|
42181
42408
|
.append(this.cssClasses.mobile, this.isMobile)
|
@@ -42215,6 +42442,47 @@ var QuestionFileModel = /** @class */ (function (_super) {
|
|
42215
42442
|
_super.prototype.endLoadingFromJson.call(this);
|
42216
42443
|
this.loadPreview(this.value);
|
42217
42444
|
};
|
42445
|
+
QuestionFileModel.prototype.needResponsiveness = function () {
|
42446
|
+
return this.supportResponsiveness() && this.isDefaultV2Theme;
|
42447
|
+
};
|
42448
|
+
QuestionFileModel.prototype.supportResponsiveness = function () {
|
42449
|
+
return true;
|
42450
|
+
};
|
42451
|
+
QuestionFileModel.prototype.getObservedElementSelector = function () {
|
42452
|
+
return Object(_utils_utils__WEBPACK_IMPORTED_MODULE_6__["classesToSelector"])(this.cssClasses.dragArea);
|
42453
|
+
};
|
42454
|
+
QuestionFileModel.prototype.getFileListSelector = function () {
|
42455
|
+
return Object(_utils_utils__WEBPACK_IMPORTED_MODULE_6__["classesToSelector"])(this.cssClasses.fileList);
|
42456
|
+
};
|
42457
|
+
QuestionFileModel.prototype.triggerResponsiveness = function (hard) {
|
42458
|
+
if (hard) {
|
42459
|
+
this.calculatedGapBetweenItems = undefined;
|
42460
|
+
this.calculatedItemWidth = undefined;
|
42461
|
+
}
|
42462
|
+
_super.prototype.triggerResponsiveness.call(this);
|
42463
|
+
};
|
42464
|
+
QuestionFileModel.prototype.processResponsiveness = function (_, availableWidth) {
|
42465
|
+
var _this = this;
|
42466
|
+
this._width = availableWidth;
|
42467
|
+
if (this.rootElement) {
|
42468
|
+
if ((!this.calculatedGapBetweenItems || !this.calculatedItemWidth) && this.allowMultiple) {
|
42469
|
+
var fileListSelector = this.getFileListSelector();
|
42470
|
+
var fileListElement = fileListSelector ? this.rootElement.querySelector(this.getFileListSelector()) : undefined;
|
42471
|
+
if (fileListElement) {
|
42472
|
+
this.calculatedGapBetweenItems = Math.ceil(Number.parseFloat(window.getComputedStyle(fileListElement).gap));
|
42473
|
+
var firstVisibleItem = Array.from(fileListElement.children).filter(function (_, index) { return _this.isPreviewVisible(index); })[0];
|
42474
|
+
if (firstVisibleItem) {
|
42475
|
+
this.calculatedItemWidth = Math.ceil(Number.parseFloat(window.getComputedStyle(firstVisibleItem).width));
|
42476
|
+
}
|
42477
|
+
}
|
42478
|
+
}
|
42479
|
+
}
|
42480
|
+
if (this.calculatedGapBetweenItems && this.calculatedItemWidth) {
|
42481
|
+
this.pageSize = this.calcAvailableItemsCount(availableWidth, this.calculatedItemWidth, this.calculatedGapBetweenItems);
|
42482
|
+
return true;
|
42483
|
+
}
|
42484
|
+
return false;
|
42485
|
+
};
|
42218
42486
|
QuestionFileModel.prototype.afterRender = function (el) {
|
42219
42487
|
this.rootElement = el;
|
42220
42488
|
_super.prototype.afterRender.call(this, el);
|
@@ -42252,6 +42520,11 @@ var QuestionFileModel = /** @class */ (function (_super) {
|
|
42252
42520
|
__decorate([
|
42253
42521
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])({ defaultValue: 0 })
|
42254
42522
|
], QuestionFileModel.prototype, "indexToShow", void 0);
|
42523
|
+
__decorate([
|
42524
|
+
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])({ defaultValue: 1, onSet: function (_, target) {
|
42525
|
+
target.updateFileNavigator();
|
42526
|
+
} })
|
42527
|
+
], QuestionFileModel.prototype, "pageSize", void 0);
|
42255
42528
|
__decorate([
|
42256
42529
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])({ defaultValue: false })
|
42257
42530
|
], QuestionFileModel.prototype, "containsMultiplyFiles", void 0);
|
@@ -44809,10 +45082,10 @@ var MatrixDropdownRowModelBase = /** @class */ (function () {
|
|
44809
45082
|
questions[i].clearValue();
|
44810
45083
|
}
|
44811
45084
|
};
|
44812
|
-
MatrixDropdownRowModelBase.prototype.onAnyValueChanged = function (name) {
|
45085
|
+
MatrixDropdownRowModelBase.prototype.onAnyValueChanged = function (name, questionName) {
|
44813
45086
|
var questions = this.questions;
|
44814
45087
|
for (var i = 0; i < questions.length; i++) {
|
44815
|
-
questions[i].onAnyValueChanged(name);
|
45088
|
+
questions[i].onAnyValueChanged(name, questionName);
|
44816
45089
|
}
|
44817
45090
|
};
|
44818
45091
|
MatrixDropdownRowModelBase.prototype.getDataValueCore = function (valuesHash, key) {
|
@@ -44878,7 +45151,7 @@ var MatrixDropdownRowModelBase = /** @class */ (function () {
|
|
44878
45151
|
var isDeleting = newColumnValue == null && !changedQuestion ||
|
44879
45152
|
isComment && !newColumnValue && !!changedQuestion && changedQuestion.autoOtherMode;
|
44880
45153
|
this.data.onRowChanged(this, changedName, newValue, isDeleting);
|
44881
|
-
this.onAnyValueChanged(MatrixDropdownRowModelBase.RowVariableName);
|
45154
|
+
this.onAnyValueChanged(MatrixDropdownRowModelBase.RowVariableName, "");
|
44882
45155
|
};
|
44883
45156
|
MatrixDropdownRowModelBase.prototype.updateQuestionsValue = function (name, newColumnValue, isComment) {
|
44884
45157
|
if (!this.detailPanel)
|
@@ -46614,7 +46887,7 @@ var QuestionMatrixDropdownModelBase = /** @class */ (function (_super) {
|
|
46614
46887
|
? null
|
46615
46888
|
: newValue;
|
46616
46889
|
};
|
46617
|
-
QuestionMatrixDropdownModelBase.prototype.onAnyValueChanged = function (name) {
|
46890
|
+
QuestionMatrixDropdownModelBase.prototype.onAnyValueChanged = function (name, questionName) {
|
46618
46891
|
if (this.isUpdateLocked ||
|
46619
46892
|
this.isDoingonAnyValueChanged ||
|
46620
46893
|
!this.generatedVisibleRows)
|
@@ -46622,11 +46895,11 @@ var QuestionMatrixDropdownModelBase = /** @class */ (function (_super) {
|
|
46622
46895
|
this.isDoingonAnyValueChanged = true;
|
46623
46896
|
var rows = this.visibleRows;
|
46624
46897
|
for (var i = 0; i < rows.length; i++) {
|
46625
|
-
rows[i].onAnyValueChanged(name);
|
46898
|
+
rows[i].onAnyValueChanged(name, questionName);
|
46626
46899
|
}
|
46627
46900
|
var totalRow = this.visibleTotalRow;
|
46628
46901
|
if (!!totalRow) {
|
46629
|
-
totalRow.onAnyValueChanged(name);
|
46902
|
+
totalRow.onAnyValueChanged(name, questionName);
|
46630
46903
|
}
|
46631
46904
|
this.isDoingonAnyValueChanged = false;
|
46632
46905
|
};
|
@@ -46813,6 +47086,7 @@ var QuestionMatrixDropdownModelBase = /** @class */ (function (_super) {
|
|
46813
47086
|
return this.detailPanel;
|
46814
47087
|
var panel = this.createNewDetailPanel();
|
46815
47088
|
panel.readOnly = this.isReadOnly;
|
47089
|
+
panel.setSurveyImpl(row);
|
46816
47090
|
var json = this.detailPanel.toJSON();
|
46817
47091
|
new _jsonobject__WEBPACK_IMPORTED_MODULE_0__["JsonObject"]().toObject(json, panel);
|
46818
47092
|
panel.renderWidth = "100%";
|
@@ -50921,6 +51195,9 @@ var QuestionMultipleTextModel = /** @class */ (function (_super) {
|
|
50921
51195
|
}
|
50922
51196
|
return res;
|
50923
51197
|
};
|
51198
|
+
QuestionMultipleTextModel.prototype.allowMobileInDesignMode = function () {
|
51199
|
+
return true;
|
51200
|
+
};
|
50924
51201
|
//IMultipleTextData
|
50925
51202
|
QuestionMultipleTextModel.prototype.getMultipleTextValue = function (name) {
|
50926
51203
|
if (!this.value)
|
@@ -50984,7 +51261,12 @@ var QuestionMultipleTextModel = /** @class */ (function (_super) {
|
|
50984
51261
|
// do nothing
|
50985
51262
|
};
|
50986
51263
|
QuestionMultipleTextModel.prototype.getItemLabelCss = function (item) {
|
50987
|
-
return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_7__["CssClassBuilder"]()
|
51264
|
+
return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_7__["CssClassBuilder"]()
|
51265
|
+
.append(this.cssClasses.itemLabel)
|
51266
|
+
.append(this.cssClasses.itemLabelAnswered, item.editor.isAnswered)
|
51267
|
+
.append(this.cssClasses.itemLabelAllowFocus, !this.isDesignMode)
|
51268
|
+
.append(this.cssClasses.itemLabelOnError, item.editor.errors.length > 0)
|
51269
|
+
.toString();
|
50988
51270
|
};
|
50989
51271
|
QuestionMultipleTextModel.prototype.getItemCss = function () {
|
50990
51272
|
return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_7__["CssClassBuilder"]().append(this.cssClasses.item).toString();
|
@@ -52041,6 +52323,7 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
52041
52323
|
}
|
52042
52324
|
};
|
52043
52325
|
QuestionPanelDynamicModel.prototype.setIsMobile = function (val) {
|
52326
|
+
_super.prototype.setIsMobile.call(this, val);
|
52044
52327
|
(this.panels || []).forEach(function (panel) { return panel.elements.forEach(function (element) {
|
52045
52328
|
if (element instanceof _question__WEBPACK_IMPORTED_MODULE_4__["Question"]) {
|
52046
52329
|
element.isMobile = val;
|
@@ -52939,11 +53222,11 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
52939
53222
|
}
|
52940
53223
|
this.isValueChangingInternally = false;
|
52941
53224
|
};
|
52942
|
-
QuestionPanelDynamicModel.prototype.onAnyValueChanged = function (name) {
|
52943
|
-
_super.prototype.onAnyValueChanged.call(this, name);
|
53225
|
+
QuestionPanelDynamicModel.prototype.onAnyValueChanged = function (name, questionName) {
|
53226
|
+
_super.prototype.onAnyValueChanged.call(this, name, questionName);
|
52944
53227
|
for (var i = 0; i < this.panels.length; i++) {
|
52945
|
-
this.panels[i].onAnyValueChanged(name);
|
52946
|
-
this.panels[i].onAnyValueChanged(QuestionPanelDynamicItem.ItemVariableName);
|
53228
|
+
this.panels[i].onAnyValueChanged(name, questionName);
|
53229
|
+
this.panels[i].onAnyValueChanged(QuestionPanelDynamicItem.ItemVariableName, "");
|
52947
53230
|
}
|
52948
53231
|
};
|
52949
53232
|
QuestionPanelDynamicModel.prototype.hasKeysDuplicated = function (fireCallback, rec) {
|
@@ -53177,7 +53460,7 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
53177
53460
|
panel.onGetFooterActionsCallback = function () {
|
53178
53461
|
return _this.getPanelActions(panel);
|
53179
53462
|
};
|
53180
|
-
panel.
|
53463
|
+
panel.onGetFooterToolbarCssCallback = function () { return _this.cssClasses.panelFooter; };
|
53181
53464
|
panel.registerPropertyChangedHandlers(["visible"], function () {
|
53182
53465
|
if (panel.visible)
|
53183
53466
|
_this.onPanelAdded(panel);
|
@@ -53844,20 +54127,6 @@ var QuestionRadiogroupModel = /** @class */ (function (_super) {
|
|
53844
54127
|
QuestionRadiogroupModel.prototype.getType = function () {
|
53845
54128
|
return "radiogroup";
|
53846
54129
|
};
|
53847
|
-
Object.defineProperty(QuestionRadiogroupModel.prototype, "ariaRole", {
|
53848
|
-
get: function () {
|
53849
|
-
return "radiogroup";
|
53850
|
-
},
|
53851
|
-
enumerable: false,
|
53852
|
-
configurable: true
|
53853
|
-
});
|
53854
|
-
Object.defineProperty(QuestionRadiogroupModel.prototype, "titleAriaLabel", {
|
53855
|
-
get: function () {
|
53856
|
-
return null;
|
53857
|
-
},
|
53858
|
-
enumerable: false,
|
53859
|
-
configurable: true
|
53860
|
-
});
|
53861
54130
|
QuestionRadiogroupModel.prototype.getFirstInputElementId = function () {
|
53862
54131
|
return this.inputId + "_0";
|
53863
54132
|
};
|
@@ -53931,6 +54200,21 @@ var QuestionRadiogroupModel = /** @class */ (function (_super) {
|
|
53931
54200
|
}
|
53932
54201
|
return actions;
|
53933
54202
|
};
|
54203
|
+
Object.defineProperty(QuestionRadiogroupModel.prototype, "isNewA11yStructure", {
|
54204
|
+
//a11y
|
54205
|
+
get: function () {
|
54206
|
+
return true;
|
54207
|
+
},
|
54208
|
+
enumerable: false,
|
54209
|
+
configurable: true
|
54210
|
+
});
|
54211
|
+
Object.defineProperty(QuestionRadiogroupModel.prototype, "a11y_input_ariaRole", {
|
54212
|
+
get: function () {
|
54213
|
+
return "radiogroup";
|
54214
|
+
},
|
54215
|
+
enumerable: false,
|
54216
|
+
configurable: true
|
54217
|
+
});
|
53934
54218
|
return QuestionRadiogroupModel;
|
53935
54219
|
}(_question_baseselect__WEBPACK_IMPORTED_MODULE_2__["QuestionCheckboxBase"]));
|
53936
54220
|
|
@@ -54491,6 +54775,14 @@ var QuestionRankingModel = /** @class */ (function (_super) {
|
|
54491
54775
|
enumerable: false,
|
54492
54776
|
configurable: true
|
54493
54777
|
});
|
54778
|
+
Object.defineProperty(QuestionRankingModel.prototype, "isNewA11yStructure", {
|
54779
|
+
//a11y
|
54780
|
+
get: function () {
|
54781
|
+
return false;
|
54782
|
+
},
|
54783
|
+
enumerable: false,
|
54784
|
+
configurable: true
|
54785
|
+
});
|
54494
54786
|
__decorate([
|
54495
54787
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_3__["property"])({ defaultValue: null })
|
54496
54788
|
], QuestionRankingModel.prototype, "currentDropTarget", void 0);
|
@@ -56283,6 +56575,14 @@ var QuestionTagboxModel = /** @class */ (function (_super) {
|
|
56283
56575
|
_super.prototype.clearValue.call(this);
|
56284
56576
|
this.dropdownListModel.clear();
|
56285
56577
|
};
|
56578
|
+
Object.defineProperty(QuestionTagboxModel.prototype, "isNewA11yStructure", {
|
56579
|
+
//a11y
|
56580
|
+
get: function () {
|
56581
|
+
return false;
|
56582
|
+
},
|
56583
|
+
enumerable: false,
|
56584
|
+
configurable: true
|
56585
|
+
});
|
56286
56586
|
__decorate([
|
56287
56587
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])({ defaultValue: "" })
|
56288
56588
|
], QuestionTagboxModel.prototype, "readOnlyText", void 0);
|
@@ -57220,7 +57520,7 @@ var QuestionTextBase = /** @class */ (function (_super) {
|
|
57220
57520
|
};
|
57221
57521
|
Object.defineProperty(QuestionTextBase.prototype, "textUpdateMode", {
|
57222
57522
|
/**
|
57223
|
-
*
|
57523
|
+
* Specifies when to update the question value.
|
57224
57524
|
*
|
57225
57525
|
* Possible values:
|
57226
57526
|
*
|
@@ -57293,6 +57593,12 @@ var QuestionTextBase = /** @class */ (function (_super) {
|
|
57293
57593
|
_super.prototype.setQuestionValue.call(this, newValue, updateIsAnswered);
|
57294
57594
|
this.updateRemainingCharacterCounter(newValue);
|
57295
57595
|
};
|
57596
|
+
QuestionTextBase.prototype.convertToCorrectValue = function (val) {
|
57597
|
+
if (Array.isArray(val))
|
57598
|
+
return val.join(this.getValueSeparator());
|
57599
|
+
return val;
|
57600
|
+
};
|
57601
|
+
QuestionTextBase.prototype.getValueSeparator = function () { return ", "; };
|
57296
57602
|
QuestionTextBase.prototype.checkForUndo = function (event) {
|
57297
57603
|
if (this.disableNativeUndoRedo && this.isInputTextUpdate && (event.ctrlKey || event.metaKey)) {
|
57298
57604
|
if ([89, 90].indexOf(event.keyCode) !== -1) {
|
@@ -57307,97 +57613,10 @@ var QuestionTextBase = /** @class */ (function (_super) {
|
|
57307
57613
|
.append(this.cssClasses.controlDisabled, this.isReadOnly)
|
57308
57614
|
.toString();
|
57309
57615
|
};
|
57310
|
-
Object.defineProperty(QuestionTextBase.prototype, "
|
57616
|
+
Object.defineProperty(QuestionTextBase.prototype, "isNewA11yStructure", {
|
57311
57617
|
//a11y
|
57312
57618
|
get: function () {
|
57313
|
-
return
|
57314
|
-
},
|
57315
|
-
enumerable: false,
|
57316
|
-
configurable: true
|
57317
|
-
});
|
57318
|
-
Object.defineProperty(QuestionTextBase.prototype, "ariaRequired", {
|
57319
|
-
get: function () {
|
57320
|
-
return null;
|
57321
|
-
},
|
57322
|
-
enumerable: false,
|
57323
|
-
configurable: true
|
57324
|
-
});
|
57325
|
-
Object.defineProperty(QuestionTextBase.prototype, "ariaInvalid", {
|
57326
|
-
get: function () {
|
57327
|
-
return null;
|
57328
|
-
},
|
57329
|
-
enumerable: false,
|
57330
|
-
configurable: true
|
57331
|
-
});
|
57332
|
-
Object.defineProperty(QuestionTextBase.prototype, "ariaLabel", {
|
57333
|
-
get: function () {
|
57334
|
-
return null;
|
57335
|
-
},
|
57336
|
-
enumerable: false,
|
57337
|
-
configurable: true
|
57338
|
-
});
|
57339
|
-
Object.defineProperty(QuestionTextBase.prototype, "ariaLabelledBy", {
|
57340
|
-
get: function () {
|
57341
|
-
return null;
|
57342
|
-
},
|
57343
|
-
enumerable: false,
|
57344
|
-
configurable: true
|
57345
|
-
});
|
57346
|
-
Object.defineProperty(QuestionTextBase.prototype, "ariaDescribedBy", {
|
57347
|
-
get: function () {
|
57348
|
-
return null;
|
57349
|
-
},
|
57350
|
-
enumerable: false,
|
57351
|
-
configurable: true
|
57352
|
-
});
|
57353
|
-
Object.defineProperty(QuestionTextBase.prototype, "a11y_input_ariaRole", {
|
57354
|
-
get: function () {
|
57355
|
-
return "textbox";
|
57356
|
-
},
|
57357
|
-
enumerable: false,
|
57358
|
-
configurable: true
|
57359
|
-
});
|
57360
|
-
Object.defineProperty(QuestionTextBase.prototype, "a11y_input_ariaRequired", {
|
57361
|
-
get: function () {
|
57362
|
-
return this.isRequired ? "true" : "false";
|
57363
|
-
},
|
57364
|
-
enumerable: false,
|
57365
|
-
configurable: true
|
57366
|
-
});
|
57367
|
-
Object.defineProperty(QuestionTextBase.prototype, "a11y_input_ariaInvalid", {
|
57368
|
-
get: function () {
|
57369
|
-
return this.errors.length > 0 ? "true" : "false";
|
57370
|
-
},
|
57371
|
-
enumerable: false,
|
57372
|
-
configurable: true
|
57373
|
-
});
|
57374
|
-
Object.defineProperty(QuestionTextBase.prototype, "a11y_input_ariaLabel", {
|
57375
|
-
get: function () {
|
57376
|
-
if (this.hasTitle && !this.parentQuestion) {
|
57377
|
-
return null;
|
57378
|
-
}
|
57379
|
-
else {
|
57380
|
-
return this.locTitle.renderedHtml;
|
57381
|
-
}
|
57382
|
-
},
|
57383
|
-
enumerable: false,
|
57384
|
-
configurable: true
|
57385
|
-
});
|
57386
|
-
Object.defineProperty(QuestionTextBase.prototype, "a11y_input_ariaLabelledBy", {
|
57387
|
-
get: function () {
|
57388
|
-
if (this.hasTitle && !this.parentQuestion) {
|
57389
|
-
return this.ariaTitleId;
|
57390
|
-
}
|
57391
|
-
else {
|
57392
|
-
return null;
|
57393
|
-
}
|
57394
|
-
},
|
57395
|
-
enumerable: false,
|
57396
|
-
configurable: true
|
57397
|
-
});
|
57398
|
-
Object.defineProperty(QuestionTextBase.prototype, "a11y_input_ariaDescribedBy", {
|
57399
|
-
get: function () {
|
57400
|
-
return this.errors.length > 0 ? this.id + "_errors" : null;
|
57619
|
+
return true;
|
57401
57620
|
},
|
57402
57621
|
enumerable: false,
|
57403
57622
|
configurable: true
|
@@ -60901,6 +61120,129 @@ var SurveyElementHeader = /** @class */ (function (_super) {
|
|
60901
61120
|
|
60902
61121
|
|
60903
61122
|
|
61123
|
+
/***/ }),
|
61124
|
+
|
61125
|
+
/***/ "./src/react/element.tsx":
|
61126
|
+
/*!*******************************!*\
|
61127
|
+
!*** ./src/react/element.tsx ***!
|
61128
|
+
\*******************************/
|
61129
|
+
/*! exports provided: SurveyRowElement */
|
61130
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
61131
|
+
|
61132
|
+
"use strict";
|
61133
|
+
__webpack_require__.r(__webpack_exports__);
|
61134
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SurveyRowElement", function() { return SurveyRowElement; });
|
61135
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
61136
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
61137
|
+
/* harmony import */ var _reactquestion_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./reactquestion_element */ "./src/react/reactquestion_element.tsx");
|
61138
|
+
/* harmony import */ var _element_factory__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./element-factory */ "./src/react/element-factory.tsx");
|
61139
|
+
var __extends = (undefined && undefined.__extends) || (function () {
|
61140
|
+
var extendStatics = function (d, b) {
|
61141
|
+
extendStatics = Object.setPrototypeOf ||
|
61142
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
61143
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
61144
|
+
return extendStatics(d, b);
|
61145
|
+
};
|
61146
|
+
return function (d, b) {
|
61147
|
+
if (typeof b !== "function" && b !== null)
|
61148
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
61149
|
+
extendStatics(d, b);
|
61150
|
+
function __() { this.constructor = d; }
|
61151
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
61152
|
+
};
|
61153
|
+
})();
|
61154
|
+
|
61155
|
+
|
61156
|
+
|
61157
|
+
var SurveyRowElement = /** @class */ (function (_super) {
|
61158
|
+
__extends(SurveyRowElement, _super);
|
61159
|
+
function SurveyRowElement(props) {
|
61160
|
+
var _this = _super.call(this, props) || this;
|
61161
|
+
_this.element.cssClasses;
|
61162
|
+
return _this;
|
61163
|
+
}
|
61164
|
+
SurveyRowElement.prototype.getStateElement = function () {
|
61165
|
+
return this.element;
|
61166
|
+
};
|
61167
|
+
Object.defineProperty(SurveyRowElement.prototype, "element", {
|
61168
|
+
get: function () {
|
61169
|
+
return this.props.element;
|
61170
|
+
},
|
61171
|
+
enumerable: false,
|
61172
|
+
configurable: true
|
61173
|
+
});
|
61174
|
+
Object.defineProperty(SurveyRowElement.prototype, "index", {
|
61175
|
+
get: function () {
|
61176
|
+
return this.props.index;
|
61177
|
+
},
|
61178
|
+
enumerable: false,
|
61179
|
+
configurable: true
|
61180
|
+
});
|
61181
|
+
Object.defineProperty(SurveyRowElement.prototype, "row", {
|
61182
|
+
get: function () {
|
61183
|
+
return this.props.row;
|
61184
|
+
},
|
61185
|
+
enumerable: false,
|
61186
|
+
configurable: true
|
61187
|
+
});
|
61188
|
+
Object.defineProperty(SurveyRowElement.prototype, "survey", {
|
61189
|
+
get: function () {
|
61190
|
+
return this.props.survey;
|
61191
|
+
},
|
61192
|
+
enumerable: false,
|
61193
|
+
configurable: true
|
61194
|
+
});
|
61195
|
+
Object.defineProperty(SurveyRowElement.prototype, "creator", {
|
61196
|
+
get: function () {
|
61197
|
+
return this.props.creator;
|
61198
|
+
},
|
61199
|
+
enumerable: false,
|
61200
|
+
configurable: true
|
61201
|
+
});
|
61202
|
+
Object.defineProperty(SurveyRowElement.prototype, "css", {
|
61203
|
+
get: function () {
|
61204
|
+
return this.props.css;
|
61205
|
+
},
|
61206
|
+
enumerable: false,
|
61207
|
+
configurable: true
|
61208
|
+
});
|
61209
|
+
SurveyRowElement.prototype.shouldComponentUpdate = function (nextProps, nextState) {
|
61210
|
+
if (!_super.prototype.shouldComponentUpdate.call(this, nextProps, nextState))
|
61211
|
+
return false;
|
61212
|
+
this.element.cssClasses;
|
61213
|
+
return true;
|
61214
|
+
};
|
61215
|
+
SurveyRowElement.prototype.renderElement = function () {
|
61216
|
+
var element = this.element;
|
61217
|
+
var innerElement = this.createElement(element, this.index);
|
61218
|
+
var css = element.cssClassesValue;
|
61219
|
+
var focusIn = function () {
|
61220
|
+
var el = element;
|
61221
|
+
if (el && el.isQuestion) {
|
61222
|
+
el.focusIn();
|
61223
|
+
}
|
61224
|
+
};
|
61225
|
+
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: css.questionWrapper, style: element.rootStyle, "data-key": innerElement.key, key: innerElement.key, onFocus: focusIn }, this.row.isNeedRender ? innerElement : _element_factory__WEBPACK_IMPORTED_MODULE_2__["ReactElementFactory"].Instance.createElement(element.skeletonComponentName, { element: element, css: this.css, })));
|
61226
|
+
};
|
61227
|
+
SurveyRowElement.prototype.createElement = function (element, elementIndex) {
|
61228
|
+
var index = elementIndex ? "-" + elementIndex : 0;
|
61229
|
+
var elementType = element.getType();
|
61230
|
+
if (!_element_factory__WEBPACK_IMPORTED_MODULE_2__["ReactElementFactory"].Instance.isElementRegistered(elementType)) {
|
61231
|
+
elementType = "question";
|
61232
|
+
}
|
61233
|
+
return _element_factory__WEBPACK_IMPORTED_MODULE_2__["ReactElementFactory"].Instance.createElement(elementType, {
|
61234
|
+
key: element.name + index,
|
61235
|
+
element: element,
|
61236
|
+
creator: this.creator,
|
61237
|
+
survey: this.survey,
|
61238
|
+
css: this.css,
|
61239
|
+
});
|
61240
|
+
};
|
61241
|
+
return SurveyRowElement;
|
61242
|
+
}(_reactquestion_element__WEBPACK_IMPORTED_MODULE_1__["SurveyElementBase"]));
|
61243
|
+
|
61244
|
+
|
61245
|
+
|
60904
61246
|
/***/ }),
|
60905
61247
|
|
60906
61248
|
/***/ "./src/react/flow-panel.tsx":
|
@@ -62085,7 +62427,8 @@ var Survey = /** @class */ (function (_super) {
|
|
62085
62427
|
return null;
|
62086
62428
|
var htmlValue = { __html: this.survey.processedCompletedHtml };
|
62087
62429
|
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"](react__WEBPACK_IMPORTED_MODULE_0__["Fragment"], null,
|
62088
|
-
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { dangerouslySetInnerHTML: htmlValue, className: this.survey.completedCss })
|
62430
|
+
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { dangerouslySetInnerHTML: htmlValue, className: this.survey.completedCss }),
|
62431
|
+
react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_components_components_container__WEBPACK_IMPORTED_MODULE_10__["ComponentsContainer"], { survey: this.survey, container: "completePage", needRenderWrapper: false })));
|
62089
62432
|
};
|
62090
62433
|
Survey.prototype.renderCompletedBefore = function () {
|
62091
62434
|
var htmlValue = { __html: this.survey.processedCompletedBeforeHtml };
|
@@ -62468,7 +62811,7 @@ var SurveyProgressButtons = /** @class */ (function (_super) {
|
|
62468
62811
|
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("li", { key: "listelement" + index, className: this.getListElementCss(index), onClick: this.isListElementClickable(index)
|
62469
62812
|
? function () { return _this.clickListElement(index); }
|
62470
62813
|
: undefined },
|
62471
|
-
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.css.progressButtonsPageTitle, title: page.
|
62814
|
+
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.css.progressButtonsPageTitle, title: page.renderedNavigationTitle }, page.renderedNavigationTitle),
|
62472
62815
|
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.css.progressButtonsPageDescription, title: page.navigationDescription }, page.navigationDescription)));
|
62473
62816
|
};
|
62474
62817
|
SurveyProgressButtons.prototype.isListElementClickable = function (index) {
|
@@ -63183,7 +63526,7 @@ var SurveyQuestionCheckbox = /** @class */ (function (_super) {
|
|
63183
63526
|
SurveyQuestionCheckbox.prototype.renderElement = function () {
|
63184
63527
|
var _this = this;
|
63185
63528
|
var cssClasses = this.question.cssClasses;
|
63186
|
-
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("fieldset", {
|
63529
|
+
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("fieldset", { className: this.question.getSelectBaseRootCss(), ref: function (fieldset) { return (_this.setControl(fieldset)); }, role: this.question.a11y_input_ariaRole, "aria-required": this.question.a11y_input_ariaRequired, "aria-label": this.question.a11y_input_ariaLabel, "aria-labelledby": this.question.a11y_input_ariaLabelledBy, "aria-invalid": this.question.a11y_input_ariaInvalid, "aria-describedby": this.question.a11y_input_ariaDescribedBy },
|
63187
63530
|
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("legend", { role: "presentation", className: "sv-hidden" }),
|
63188
63531
|
this.getHeader(),
|
63189
63532
|
this.question.hasColumns
|
@@ -63363,8 +63706,8 @@ var SurveyQuestionCheckboxItem = /** @class */ (function (_super) {
|
|
63363
63706
|
: this.handleOnChange;
|
63364
63707
|
var itemLabel = !this.hideCaption ? react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", { className: this.cssClasses.controlLabel }, this.renderLocString(this.item.locText, this.textStyle)) : null;
|
63365
63708
|
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: itemClass, role: "presentation" },
|
63366
|
-
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("label", { className: labelClass
|
63367
|
-
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("input", { className: this.cssClasses.itemControl,
|
63709
|
+
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("label", { className: labelClass },
|
63710
|
+
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("input", { className: this.cssClasses.itemControl, type: "checkbox", name: this.question.name, value: this.item.value != "selectall" ? this.item.value : undefined, id: id, style: this.inputStyle, disabled: !this.question.getItemEnabled(this.item), checked: isChecked, onChange: onItemChanged }),
|
63368
63711
|
this.cssClasses.materialDecorator ?
|
63369
63712
|
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", { className: this.cssClasses.materialDecorator }, this.question.itemSvgIcon ?
|
63370
63713
|
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("svg", { className: this.cssClasses.itemDecorator },
|
@@ -63493,7 +63836,7 @@ var SurveyQuestionCommentItem = /** @class */ (function (_super) {
|
|
63493
63836
|
if (question.isReadOnlyRenderDiv()) {
|
63494
63837
|
return react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", null, comment);
|
63495
63838
|
}
|
63496
|
-
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("textarea", { id: this.getId(), className: className, value: comment, disabled: this.isDisplayMode, maxLength: question.getOthersMaxLength(), placeholder: this.getPlaceholder(), onChange: handleOnChange, onBlur: function (e) { _this.onCommentChange(e); handleOnChange(e); }, onInput: function (e) { return _this.onCommentInput(e); }, "aria-required": question.isRequired, "aria-label": question.
|
63839
|
+
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("textarea", { id: this.getId(), className: className, value: comment, disabled: this.isDisplayMode, maxLength: question.getOthersMaxLength(), placeholder: this.getPlaceholder(), onChange: handleOnChange, onBlur: function (e) { _this.onCommentChange(e); handleOnChange(e); }, onInput: function (e) { return _this.onCommentInput(e); }, "aria-required": question.isRequired || question.a11y_input_ariaRequired, "aria-label": question.ariaLabel || question.a11y_input_ariaLabel, style: { resize: question.resizeStyle } }));
|
63497
63840
|
};
|
63498
63841
|
return SurveyQuestionCommentItem;
|
63499
63842
|
}(_reactquestion_element__WEBPACK_IMPORTED_MODULE_1__["ReactSurveyElement"]));
|
@@ -64253,7 +64596,7 @@ var SurveyQuestionFile = /** @class */ (function (_super) {
|
|
64253
64596
|
var fileDecorator = this.renderFileDecorator();
|
64254
64597
|
var clearButton = this.question.showRemoveButton ? this.renderClearButton(this.question.cssClasses.removeButton) : null;
|
64255
64598
|
var clearButtonBottom = this.question.showRemoveButtonBottom ? this.renderClearButton(this.question.cssClasses.removeButtonBottom) : null;
|
64256
|
-
var
|
64599
|
+
var fileNavigator = this.question.fileNavigatorVisible ? (react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_components_action_bar_action_bar__WEBPACK_IMPORTED_MODULE_1__["SurveyActionBar"], { model: this.question.fileNavigator })) : null;
|
64257
64600
|
fileInput = (this.isDisplayMode ?
|
64258
64601
|
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 })
|
64259
64602
|
:
|
@@ -64265,7 +64608,7 @@ var SurveyQuestionFile = /** @class */ (function (_super) {
|
|
64265
64608
|
clearButton,
|
64266
64609
|
preview,
|
64267
64610
|
clearButtonBottom,
|
64268
|
-
|
64611
|
+
fileNavigator)));
|
64269
64612
|
};
|
64270
64613
|
SurveyQuestionFile.prototype.renderFileDecorator = function () {
|
64271
64614
|
var loadingIndicator = this.renderLoadingIndicator();
|
@@ -65226,7 +65569,7 @@ var SurveyQuestionMultipleText = /** @class */ (function (_super) {
|
|
65226
65569
|
rows.push(this.renderRow(i, tableRows[i].cells, cssClasses));
|
65227
65570
|
}
|
65228
65571
|
}
|
65229
|
-
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("table", { className:
|
65572
|
+
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("table", { className: this.question.getQuestionRootCss() },
|
65230
65573
|
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("tbody", null, rows)));
|
65231
65574
|
};
|
65232
65575
|
SurveyQuestionMultipleText.prototype.renderCell = function (cell, cssClasses, index) {
|
@@ -65606,7 +65949,7 @@ var SurveyQuestionRadiogroup = /** @class */ (function (_super) {
|
|
65606
65949
|
clearButton = (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", null,
|
65607
65950
|
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("input", { type: "button", className: this.question.cssClasses.clearButton, onClick: function () { return _this.question.clearValue(); }, value: this.question.clearButtonCaption })));
|
65608
65951
|
}
|
65609
|
-
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("fieldset", { className: this.question.getSelectBaseRootCss(),
|
65952
|
+
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("fieldset", { className: this.question.getSelectBaseRootCss(), ref: function (fieldset) { return (_this.setControl(fieldset)); }, role: this.question.a11y_input_ariaRole, "aria-required": this.question.a11y_input_ariaRequired, "aria-label": this.question.a11y_input_ariaLabel, "aria-labelledby": this.question.a11y_input_ariaLabelledBy, "aria-invalid": this.question.a11y_input_ariaInvalid, "aria-describedby": this.question.a11y_input_ariaDescribedBy },
|
65610
65953
|
this.question.hasColumns
|
65611
65954
|
? this.getColumnedBody(cssClasses)
|
65612
65955
|
: this.getBody(cssClasses),
|
@@ -65765,7 +66108,7 @@ var SurveyQuestionRadioItem = /** @class */ (function (_super) {
|
|
65765
66108
|
var controlLabelClass = this.question.getControlLabelClass(this.item);
|
65766
66109
|
var itemLabel = !this.hideCaption ? react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", { className: controlLabelClass }, this.renderLocString(this.item.locText, this.textStyle)) : null;
|
65767
66110
|
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: itemClass, role: "presentation" },
|
65768
|
-
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("label", { onMouseDown: this.handleOnMouseDown, className: labelClass
|
66111
|
+
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("label", { onMouseDown: this.handleOnMouseDown, className: labelClass },
|
65769
66112
|
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("input", { "aria-describedby": this.question.ariaDescribedBy, className: this.cssClasses.itemControl, id: this.question.getItemId(this.item), type: "radio", name: this.question.questionName, checked: this.isChecked, value: this.item.value, disabled: !this.question.getItemEnabled(this.item), onChange: this.handleOnChange }),
|
65770
66113
|
this.cssClasses.materialDecorator ?
|
65771
66114
|
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", { className: this.cssClasses.materialDecorator }, this.question.itemSvgIcon ?
|
@@ -66418,8 +66761,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
66418
66761
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
66419
66762
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
66420
66763
|
/* harmony import */ var _reactquestion_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./reactquestion_element */ "./src/react/reactquestion_element.tsx");
|
66421
|
-
/* harmony import */ var
|
66422
|
-
/* harmony import */ var
|
66764
|
+
/* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./element */ "./src/react/element.tsx");
|
66765
|
+
/* harmony import */ var _element_factory__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./element-factory */ "./src/react/element-factory.tsx");
|
66766
|
+
/* harmony import */ var _reactsurveymodel__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./reactsurveymodel */ "./src/react/reactsurveymodel.tsx");
|
66423
66767
|
var __extends = (undefined && undefined.__extends) || (function () {
|
66424
66768
|
var extendStatics = function (d, b) {
|
66425
66769
|
extendStatics = Object.setPrototypeOf ||
|
@@ -66439,6 +66783,7 @@ var __extends = (undefined && undefined.__extends) || (function () {
|
|
66439
66783
|
|
66440
66784
|
|
66441
66785
|
|
66786
|
+
|
66442
66787
|
var SurveyRow = /** @class */ (function (_super) {
|
66443
66788
|
__extends(SurveyRow, _super);
|
66444
66789
|
function SurveyRow(props) {
|
@@ -66486,23 +66831,17 @@ var SurveyRow = /** @class */ (function (_super) {
|
|
66486
66831
|
};
|
66487
66832
|
SurveyRow.prototype.renderElementContent = function () {
|
66488
66833
|
var _this = this;
|
66489
|
-
var elements = this.row.visibleElements.map(function (element,
|
66490
|
-
var
|
66491
|
-
var
|
66492
|
-
|
66493
|
-
var el = element;
|
66494
|
-
if (el && el.isQuestion) {
|
66495
|
-
el.focusIn();
|
66496
|
-
}
|
66497
|
-
};
|
66498
|
-
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: css.questionWrapper, style: element.rootStyle, "data-key": innerElement.key, key: innerElement.key, onFocus: focusIn }, _this.row.isNeedRender ? innerElement : _element_factory__WEBPACK_IMPORTED_MODULE_2__["ReactElementFactory"].Instance.createElement(element.skeletonComponentName, { element: element, css: _this.css, })));
|
66834
|
+
var elements = this.row.visibleElements.map(function (element, elementIndex) {
|
66835
|
+
var index = elementIndex ? "-" + elementIndex : 0;
|
66836
|
+
var key = element.name + index;
|
66837
|
+
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_element__WEBPACK_IMPORTED_MODULE_2__["SurveyRowElement"], { element: element, index: elementIndex, row: _this.row, survey: _this.survey, creator: _this.creator, css: _this.css, key: key }));
|
66499
66838
|
});
|
66500
66839
|
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { ref: this.rootRef, className: this.row.getRowCss() }, elements));
|
66501
66840
|
};
|
66502
66841
|
SurveyRow.prototype.renderElement = function () {
|
66503
66842
|
var survey = this.survey;
|
66504
66843
|
var content = this.renderElementContent();
|
66505
|
-
var wrapper =
|
66844
|
+
var wrapper = _reactsurveymodel__WEBPACK_IMPORTED_MODULE_4__["ReactSurveyElementsWrapper"].wrapRow(survey, content, this.row);
|
66506
66845
|
return wrapper || content;
|
66507
66846
|
};
|
66508
66847
|
SurveyRow.prototype.componentDidMount = function () {
|
@@ -66537,10 +66876,10 @@ var SurveyRow = /** @class */ (function (_super) {
|
|
66537
66876
|
SurveyRow.prototype.createElement = function (element, elementIndex) {
|
66538
66877
|
var index = elementIndex ? "-" + elementIndex : 0;
|
66539
66878
|
var elementType = element.getType();
|
66540
|
-
if (!
|
66879
|
+
if (!_element_factory__WEBPACK_IMPORTED_MODULE_3__["ReactElementFactory"].Instance.isElementRegistered(elementType)) {
|
66541
66880
|
elementType = "question";
|
66542
66881
|
}
|
66543
|
-
return
|
66882
|
+
return _element_factory__WEBPACK_IMPORTED_MODULE_3__["ReactElementFactory"].Instance.createElement(elementType, {
|
66544
66883
|
key: element.name + index,
|
66545
66884
|
element: element,
|
66546
66885
|
creator: this.creator,
|
@@ -69308,12 +69647,13 @@ var SurveyElement = /** @class */ (function (_super) {
|
|
69308
69647
|
Object.defineProperty(SurveyElement.prototype, "rootStyle", {
|
69309
69648
|
get: function () {
|
69310
69649
|
var style = {};
|
69650
|
+
var minWidth = this.renderMinWidth ? this.minWidth : "min(100%, " + this.minWidth + ")";
|
69311
69651
|
if (this.allowRootStyle && this.renderWidth) {
|
69312
69652
|
// style["width"] = this.renderWidth;
|
69313
69653
|
style["flexGrow"] = 1;
|
69314
69654
|
style["flexShrink"] = 1;
|
69315
69655
|
style["flexBasis"] = this.renderWidth;
|
69316
|
-
style["minWidth"] =
|
69656
|
+
style["minWidth"] = minWidth;
|
69317
69657
|
style["maxWidth"] = this.maxWidth;
|
69318
69658
|
}
|
69319
69659
|
return style;
|
@@ -69398,6 +69738,9 @@ var SurveyElement = /** @class */ (function (_super) {
|
|
69398
69738
|
__decorate([
|
69399
69739
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])({ defaultValue: true })
|
69400
69740
|
], SurveyElement.prototype, "allowRootStyle", void 0);
|
69741
|
+
__decorate([
|
69742
|
+
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])({ defaultValue: true })
|
69743
|
+
], SurveyElement.prototype, "renderMinWidth", void 0);
|
69401
69744
|
return SurveyElement;
|
69402
69745
|
}(SurveyElementCore));
|
69403
69746
|
|
@@ -69783,7 +70126,7 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
69783
70126
|
*/
|
69784
70127
|
_this.onValidateQuestion = _this.addEvent();
|
69785
70128
|
/**
|
69786
|
-
* An event that is raised before errors are assigned to a question.
|
70129
|
+
* An event that is raised before errors are assigned to a question. Use this event to add/remove/modify errors.
|
69787
70130
|
* @see onValidateQuestion
|
69788
70131
|
*/
|
69789
70132
|
_this.onSettingQuestionErrors = _this.addEvent();
|
@@ -69795,6 +70138,7 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
69795
70138
|
* [View Demo](https://surveyjs.io/form-library/examples/javascript-server-side-form-validation/ (linkStyle))
|
69796
70139
|
* @see onValidateQuestion
|
69797
70140
|
* @see onValidatePanel
|
70141
|
+
* @see isValidatingOnServer
|
69798
70142
|
*/
|
69799
70143
|
_this.onServerValidateQuestions = _this.addEvent();
|
69800
70144
|
/**
|
@@ -69808,11 +70152,11 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
69808
70152
|
*/
|
69809
70153
|
_this.onValidatePanel = _this.addEvent();
|
69810
70154
|
/**
|
69811
|
-
*
|
70155
|
+
* An event that is raised to change default error messages.
|
69812
70156
|
*/
|
69813
70157
|
_this.onErrorCustomText = _this.addEvent();
|
69814
70158
|
/**
|
69815
|
-
*
|
70159
|
+
* An event that is raised when the [current page](#currentPage) is being validated. Handle this event to be notified of current page validation.
|
69816
70160
|
*/
|
69817
70161
|
_this.onValidatedErrorsOnCurrentPage = _this.addEvent();
|
69818
70162
|
/**
|
@@ -69862,16 +70206,13 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
69862
70206
|
*/
|
69863
70207
|
_this.onProgressText = _this.addEvent();
|
69864
70208
|
/**
|
69865
|
-
*
|
70209
|
+
* An event that is raised to convert Markdown content to HTML.
|
69866
70210
|
*
|
69867
70211
|
* For information on event handler parameters, refer to descriptions within the interface.
|
69868
70212
|
*
|
69869
70213
|
* [View Demo](https://surveyjs.io/form-library/examples/edit-survey-questions-markdown/ (linkStyle))
|
69870
70214
|
*/
|
69871
70215
|
_this.onTextMarkdown = _this.addEvent();
|
69872
|
-
/**
|
69873
|
-
* Use this event to specity render component name used for text rendering.
|
69874
|
-
*/
|
69875
70216
|
_this.onTextRenderAs = _this.addEvent();
|
69876
70217
|
/**
|
69877
70218
|
* An event that is raised after a request to save survey results on [SurveyJS Service](https://api.surveyjs.io/) has been completed. Use this event to find out if the results have been saved successfully.
|
@@ -69916,21 +70257,18 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
69916
70257
|
*/
|
69917
70258
|
_this.onClearFiles = _this.addEvent();
|
69918
70259
|
/**
|
69919
|
-
* An event that is raised after choices
|
69920
|
-
* You may change the choices, before they are assigned or disable/enabled make visible/invisible question, based on loaded results.
|
70260
|
+
* An event that is raised after choices are loaded from a server but before they are assigned to a choice-based question, such as [Dropdown](https://surveyjs.io/form-library/documentation/api-reference/dropdown-menu-model) or [Checkboxes](https://surveyjs.io/form-library/documentation/api-reference/checkbox-question-model). Handle this event if you need to modify the loaded choices.
|
69921
70261
|
*/
|
69922
70262
|
_this.onLoadChoicesFromServer = _this.addEvent();
|
69923
70263
|
/**
|
69924
|
-
* An event that is raised after survey is loaded from api.surveyjs.io
|
69925
|
-
* You can use this event to perform manipulation with the survey model after it was loaded from the web service.
|
70264
|
+
* An event that is raised after a survey JSON schema is loaded from the [SurveyJS Service](https://api.surveyjs.io). Use this event to modify the loaded schema.
|
69926
70265
|
* @see surveyId
|
70266
|
+
* @see clientId
|
69927
70267
|
* @see loadSurveyFromService
|
69928
70268
|
*/
|
69929
70269
|
_this.onLoadedSurveyFromService = _this.addEvent();
|
69930
70270
|
/**
|
69931
|
-
* An event that is raised
|
69932
|
-
* For example, you may use the text processing in loading choices from the web. If your `choicesByUrl.url` equals to "UrlToServiceToGetAllCities/{country}/{state}",
|
69933
|
-
* you may set on this event `options.value` to "all" or empty string when the "state" value/question is non selected by a user.
|
70271
|
+
* An event that is raised when the survey processes [dynamic texts](https://surveyjs.io/form-library/documentation/design-survey/conditional-logic#dynamic-texts) and any text in curly brackets. Use this event, for instance, to substitute parameters in a RESTful URL with real values when you [load choices by URL](https://surveyjs.io/form-library/documentation/api-reference/checkbox-question-model#choicesByUrl).
|
69934
70272
|
*/
|
69935
70273
|
_this.onProcessTextValue = _this.addEvent();
|
69936
70274
|
/**
|
@@ -70025,7 +70363,7 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
70025
70363
|
*/
|
70026
70364
|
_this.onFocusInPanel = _this.addEvent();
|
70027
70365
|
/**
|
70028
|
-
* Use this event to change the visibility of
|
70366
|
+
* An event that is raised before a [choice item](https://surveyjs.io/form-library/documentation/api-reference/questionselectbase#choices) is displayed. Use this event to change the visibility of individual choice items in [Checkboxes](https://surveyjs.io/form-library/documentation/api-reference/checkbox-question-model), [Dropdown](https://surveyjs.io/form-library/documentation/api-reference/dropdown-menu-model), [Radio Button Group](https://surveyjs.io/form-library/documentation/api-reference/radio-button-question-model), and other similar question types.
|
70029
70367
|
*/
|
70030
70368
|
_this.onShowingChoiceItem = _this.addEvent();
|
70031
70369
|
/**
|
@@ -70154,19 +70492,16 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
70154
70492
|
*/
|
70155
70493
|
_this.onGetDynamicPanelTabTitle = _this.addEvent();
|
70156
70494
|
/**
|
70157
|
-
*
|
70158
|
-
* @see Question.value
|
70159
|
-
* @see Question.correctAnswer
|
70495
|
+
* An event that is raised to define whether a question answer is correct. Applies only to [quiz surveys](https://surveyjs.io/form-library/documentation/design-survey/create-a-quiz).
|
70160
70496
|
*/
|
70161
70497
|
_this.onIsAnswerCorrect = _this.addEvent();
|
70162
70498
|
/**
|
70163
|
-
* Use this event to control drag
|
70164
|
-
* @see setDesignMode
|
70499
|
+
* An event that is raised when users drag and drop survey elements while designing the survey in [Survey Creator](https://surveyjs.io/survey-creator/documentation/overview). Use this event to control drag and drop operations.
|
70165
70500
|
* @see isDesignMode
|
70166
70501
|
*/
|
70167
70502
|
_this.onDragDropAllow = _this.addEvent();
|
70168
70503
|
/**
|
70169
|
-
*
|
70504
|
+
* An event this is raised before a survey element (usually page) is scrolled to the top. Use this event to cancel the scroll operation.
|
70170
70505
|
*/
|
70171
70506
|
_this.onScrollingElementToTop = _this.addEvent();
|
70172
70507
|
_this.onLocaleChangedEvent = _this.addEvent();
|
@@ -70204,12 +70539,11 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
70204
70539
|
*/
|
70205
70540
|
_this.onGetMatrixRowActions = _this.addEvent();
|
70206
70541
|
/**
|
70207
|
-
* An event that is raised after
|
70208
|
-
* @see onElementContentVisibilityChanged
|
70542
|
+
* An event that is raised after a survey element is [expanded or collapsed](https://surveyjs.io/form-library/documentation/api-reference/question#state).
|
70209
70543
|
*/
|
70210
70544
|
_this.onElementContentVisibilityChanged = _this.addEvent();
|
70211
70545
|
/**
|
70212
|
-
* An event that is raised before expression question
|
70546
|
+
* An event that is raised before an [Expression](https://surveyjs.io/form-library/documentation/api-reference/expression-model) question displays a value. Use this event to override the display value.
|
70213
70547
|
*/
|
70214
70548
|
_this.onGetExpressionDisplayValue = _this.addEvent();
|
70215
70549
|
/**
|
@@ -70217,13 +70551,16 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
70217
70551
|
*/
|
70218
70552
|
_this.onPopupVisibleChanged = _this.addEvent();
|
70219
70553
|
/**
|
70220
|
-
*
|
70221
|
-
* @see
|
70554
|
+
* A list of errors in a survey JSON schema.
|
70555
|
+
* @see ensureUniqueNames
|
70222
70556
|
*/
|
70223
70557
|
_this.jsonErrors = null;
|
70224
70558
|
_this.cssValue = null;
|
70225
70559
|
/**
|
70226
|
-
*
|
70560
|
+
* Specifies whether to hide validation errors thrown by the Required validation in the UI.
|
70561
|
+
*
|
70562
|
+
* [Built-In Client-Side Validators](https://surveyjs.io/form-library/documentation/data-validation#built-in-client-side-validators (linkStyle))
|
70563
|
+
* @see ignoreValidation
|
70227
70564
|
*/
|
70228
70565
|
_this.hideRequiredErrors = false;
|
70229
70566
|
//#endregion
|
@@ -70232,10 +70569,13 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
70232
70569
|
_this._isCompact = false;
|
70233
70570
|
_this._isDesignMode = false;
|
70234
70571
|
/**
|
70235
|
-
*
|
70572
|
+
* Specifies whether to skip validation when you switch between pages or complete the survey programmatically or when users do that in the UI.
|
70573
|
+
*
|
70574
|
+
* Default value: `false`
|
70575
|
+
* @see hideRequiredErrors
|
70236
70576
|
* @see nextPage
|
70577
|
+
* @see isPrevPage
|
70237
70578
|
* @see completeLastPage
|
70238
|
-
* @see mode
|
70239
70579
|
*/
|
70240
70580
|
_this.ignoreValidation = false;
|
70241
70581
|
_this.isNavigationButtonPressed = false;
|
@@ -70276,10 +70616,6 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
70276
70616
|
_this.createLocalizableString("previewText", _this, false, true);
|
70277
70617
|
_this.createLocalizableString("editText", _this, false, true);
|
70278
70618
|
_this.createLocalizableString("questionTitleTemplate", _this, true);
|
70279
|
-
_this.textPreProcessor = new _textPreProcessor__WEBPACK_IMPORTED_MODULE_5__["TextPreProcessor"]();
|
70280
|
-
_this.textPreProcessor.onProcess = function (textValue) {
|
70281
|
-
_this.getProcessedTextValue(textValue);
|
70282
|
-
};
|
70283
70619
|
_this.timerModelValue = new _surveyTimerModel__WEBPACK_IMPORTED_MODULE_12__["SurveyTimerModel"](_this);
|
70284
70620
|
_this.timerModelValue.onTimer = function (page) {
|
70285
70621
|
_this.doTimer(page);
|
@@ -70677,11 +71013,15 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
70677
71013
|
};
|
70678
71014
|
Object.defineProperty(SurveyModel.prototype, "lazyRendering", {
|
70679
71015
|
/**
|
70680
|
-
*
|
70681
|
-
*
|
70682
|
-
*
|
71016
|
+
* Specifies whether to enable lazy rendering.
|
71017
|
+
*
|
71018
|
+
* In default mode, a survey renders the entire current page. With lazy rendering, the survey renders the page gradually as a user scrolls it. This helps reduce survey startup time and oprimizes large surveys for low-end devices.
|
71019
|
+
*
|
71020
|
+
* Default value: `false`
|
70683
71021
|
*
|
70684
71022
|
* [View Demo](https://surveyjs.io/form-library/examples/survey-lazy/ (linkStyle))
|
71023
|
+
*
|
71024
|
+
* > This is an experimental feature that may not work properly in certain cases.
|
70685
71025
|
*/
|
70686
71026
|
get: function () {
|
70687
71027
|
return this.lazyRenderingValue === true;
|
@@ -70798,7 +71138,7 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
70798
71138
|
* A cookie name used to save information about survey completion.
|
70799
71139
|
*
|
70800
71140
|
* When this property has a value, the survey creates a cookie with the specified name on completion. This cookie helps ensure that users do not pass the same survey twice. On the second run, they will see the [Completed Before page](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#completedBeforeHtml).
|
70801
|
-
* @see
|
71141
|
+
* @see clientId
|
70802
71142
|
*/
|
70803
71143
|
get: function () {
|
70804
71144
|
return this.getPropertyValue("cookieName", "");
|
@@ -70826,7 +71166,9 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
70826
71166
|
});
|
70827
71167
|
Object.defineProperty(SurveyModel.prototype, "surveyShowDataSaving", {
|
70828
71168
|
/**
|
70829
|
-
*
|
71169
|
+
* Specifies whether to show progress when the survey sends data to [SurveyJS Service](https://api.surveyjs.io).
|
71170
|
+
*
|
71171
|
+
* [View Demo](https://surveyjs.io/form-library/examples/save-survey-results-and-load-surveys-from-surveyjs-service/ (linkStyle))
|
70830
71172
|
* @see surveyPostId
|
70831
71173
|
*/
|
70832
71174
|
get: function () {
|
@@ -71048,10 +71390,11 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
71048
71390
|
};
|
71049
71391
|
Object.defineProperty(SurveyModel.prototype, "requiredText", {
|
71050
71392
|
/**
|
71051
|
-
*
|
71052
|
-
* @see Question.title
|
71393
|
+
* Specifies one or multiple characters that designate required questions.
|
71053
71394
|
*
|
71054
|
-
*
|
71395
|
+
* Default value: `*`
|
71396
|
+
*
|
71397
|
+
* [View Demo](https://surveyjs.io/form-library/examples/modify-question-title/ (linkStyle))
|
71055
71398
|
*/
|
71056
71399
|
get: function () {
|
71057
71400
|
return this.getPropertyValue("requiredText", "*");
|
@@ -71063,16 +71406,16 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
71063
71406
|
configurable: true
|
71064
71407
|
});
|
71065
71408
|
SurveyModel.prototype.beforeSettingQuestionErrors = function (question, errors) {
|
71066
|
-
this.
|
71409
|
+
this.makeRequiredErrorsInvisible(errors);
|
71067
71410
|
this.onSettingQuestionErrors.fire(this, {
|
71068
71411
|
question: question,
|
71069
71412
|
errors: errors,
|
71070
71413
|
});
|
71071
71414
|
};
|
71072
71415
|
SurveyModel.prototype.beforeSettingPanelErrors = function (question, errors) {
|
71073
|
-
this.
|
71416
|
+
this.makeRequiredErrorsInvisible(errors);
|
71074
71417
|
};
|
71075
|
-
SurveyModel.prototype.
|
71418
|
+
SurveyModel.prototype.makeRequiredErrorsInvisible = function (errors) {
|
71076
71419
|
if (!this.hideRequiredErrors)
|
71077
71420
|
return;
|
71078
71421
|
for (var i = 0; i < errors.length; i++) {
|
@@ -71244,14 +71587,16 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
71244
71587
|
});
|
71245
71588
|
Object.defineProperty(SurveyModel.prototype, "textUpdateMode", {
|
71246
71589
|
/**
|
71247
|
-
*
|
71590
|
+
* Specifies when to update the question value in questions with a text input field.
|
71248
71591
|
*
|
71249
|
-
*
|
71592
|
+
* Possible values:
|
71250
71593
|
*
|
71251
|
-
* - `onBlur` (default) - the value
|
71252
|
-
* - `onTyping` -
|
71594
|
+
* - `"onBlur"` (default) - Updates the value after the input field loses focus.
|
71595
|
+
* - `"onTyping"` - Updates the value on every key press.
|
71596
|
+
*
|
71597
|
+
* > Do not use the `"onTyping"` mode if your survey contains many expressions. Expressions are reevaluated each time a question value is changed. In `"onTyping"` mode, the question value changes frequently. This may cause performance degradation.
|
71253
71598
|
*
|
71254
|
-
*
|
71599
|
+
* You can override this setting for individual questions: [`textUpdateMode`](https://surveyjs.io/form-library/documentation/api-reference/text-entry-question-model#textUpdateMode).
|
71255
71600
|
*/
|
71256
71601
|
get: function () {
|
71257
71602
|
return this.getPropertyValue("textUpdateMode");
|
@@ -71732,15 +72077,15 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
71732
72077
|
});
|
71733
72078
|
SurveyModel.prototype.setIsMobile = function (newVal) {
|
71734
72079
|
if (newVal === void 0) { newVal = true; }
|
71735
|
-
if (this.
|
72080
|
+
if (this._isMobile !== newVal) {
|
71736
72081
|
this._isMobile = newVal;
|
71737
72082
|
this.updateCss();
|
71738
|
-
this.getAllQuestions().map(function (q) { return q.
|
72083
|
+
this.getAllQuestions().map(function (q) { return q.setIsMobile(newVal); });
|
71739
72084
|
}
|
71740
72085
|
};
|
71741
72086
|
Object.defineProperty(SurveyModel.prototype, "isMobile", {
|
71742
72087
|
get: function () {
|
71743
|
-
return this._isMobile;
|
72088
|
+
return this._isMobile && !this.isDesignMode;
|
71744
72089
|
},
|
71745
72090
|
enumerable: false,
|
71746
72091
|
configurable: true
|
@@ -71847,8 +72192,8 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
71847
72192
|
configurable: true
|
71848
72193
|
});
|
71849
72194
|
/**
|
71850
|
-
* Calculates a given expression and returns a result value.
|
71851
|
-
* @param expression
|
72195
|
+
* Calculates a given [expression](https://surveyjs.io/form-library/documentation/design-survey/conditional-logic#expressions) and returns a result value.
|
72196
|
+
* @param expression An expression to calculate.
|
71852
72197
|
*/
|
71853
72198
|
SurveyModel.prototype.runExpression = function (expression) {
|
71854
72199
|
if (!expression)
|
@@ -71858,8 +72203,8 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
71858
72203
|
return new _conditions__WEBPACK_IMPORTED_MODULE_13__["ExpressionRunner"](expression).run(values, properties);
|
71859
72204
|
};
|
71860
72205
|
/**
|
71861
|
-
* Calculates a given expression and returns `true` or `false`.
|
71862
|
-
* @param expression
|
72206
|
+
* Calculates a given [expression](https://surveyjs.io/form-library/documentation/design-survey/conditional-logic#expressions) and returns `true` or `false`.
|
72207
|
+
* @param expression An expression to calculate.
|
71863
72208
|
*/
|
71864
72209
|
SurveyModel.prototype.runCondition = function (expression) {
|
71865
72210
|
if (!expression)
|
@@ -71899,9 +72244,7 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
71899
72244
|
};
|
71900
72245
|
Object.defineProperty(SurveyModel.prototype, "completedBeforeHtml", {
|
71901
72246
|
/**
|
71902
|
-
* HTML content displayed to a user who has completed the survey before.
|
71903
|
-
* @see clientId
|
71904
|
-
* @see cookieName
|
72247
|
+
* HTML content displayed to a user who has completed the survey before. To identify such users, the survey uses a [cookie name](#cookieName) or [client ID](#clientId).
|
71905
72248
|
* @see processedCompletedBeforeHtml
|
71906
72249
|
*/
|
71907
72250
|
get: function () {
|
@@ -72301,16 +72644,18 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
72301
72644
|
});
|
72302
72645
|
Object.defineProperty(SurveyModel.prototype, "showProgressBar", {
|
72303
72646
|
/**
|
72304
|
-
*
|
72647
|
+
* Controls the visibility of the progress bar and specifies its position.
|
72305
72648
|
*
|
72306
|
-
*
|
72649
|
+
* Possible values:
|
72307
72650
|
*
|
72308
|
-
* - `off` (default) -
|
72309
|
-
* - `top` -
|
72310
|
-
* - `bottom` -
|
72311
|
-
* - `both` -
|
72651
|
+
* - `"off"` (default) - Hides the progress bar.
|
72652
|
+
* - `"top"` - Displays the progress bar above survey content.
|
72653
|
+
* - `"bottom"` - Displays the progress bar below survey content.
|
72654
|
+
* - `"both"` - Displays the progress bar above and below survey content.
|
72312
72655
|
*
|
72313
72656
|
* [View Demo](https://surveyjs.io/form-library/examples/navigation-default/ (linkStyle))
|
72657
|
+
* @see progressBarType
|
72658
|
+
* @see progressValue
|
72314
72659
|
*/
|
72315
72660
|
get: function () {
|
72316
72661
|
return this.getPropertyValue("showProgressBar");
|
@@ -72323,17 +72668,18 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
72323
72668
|
});
|
72324
72669
|
Object.defineProperty(SurveyModel.prototype, "progressBarType", {
|
72325
72670
|
/**
|
72326
|
-
*
|
72671
|
+
* Specifies the type of information displayed by the progress bar. Applies only when [`showProgressBar`](#showProgressBar) is not `"off"`.
|
72327
72672
|
*
|
72328
|
-
*
|
72673
|
+
* Possible values:
|
72329
72674
|
*
|
72330
|
-
* - `pages` (default)
|
72331
|
-
* - `questions
|
72332
|
-
* - `requiredQuestions
|
72333
|
-
* - `correctQuestions
|
72334
|
-
* - `buttons`
|
72675
|
+
* - `"pages"` (default) - The number of completed pages.
|
72676
|
+
* - `"questions"` - The number of answered questions.
|
72677
|
+
* - `"requiredQuestions"` - The number of answered [required questions](https://surveyjs.io/form-library/documentation/api-reference/question#isRequired).
|
72678
|
+
* - `"correctQuestions"` - The number of correct questions in a [quiz](https://surveyjs.io/form-library/documentation/design-survey/create-a-quiz).
|
72679
|
+
* - `"buttons"` - Adds jump links to the progress bar.
|
72335
72680
|
*
|
72336
72681
|
* [View Demo](https://surveyjs.io/form-library/examples/navigation-buttons/ (linkStyle))
|
72682
|
+
* @see progressValue
|
72337
72683
|
*/
|
72338
72684
|
get: function () {
|
72339
72685
|
return this.getPropertyValue("progressBarType");
|
@@ -72461,12 +72807,12 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
72461
72807
|
});
|
72462
72808
|
Object.defineProperty(SurveyModel.prototype, "mode", {
|
72463
72809
|
/**
|
72464
|
-
*
|
72810
|
+
* Specifies whether users can take the survey or only view it.
|
72465
72811
|
*
|
72466
|
-
*
|
72812
|
+
* Possible values:
|
72467
72813
|
*
|
72468
|
-
* - `edit` (default) -
|
72469
|
-
* - `display` -
|
72814
|
+
* - `"edit"` (default) - Allows users to take the survey.
|
72815
|
+
* - `"display"` - Makes the survey read-only.
|
72470
72816
|
*
|
72471
72817
|
* [View Demo](https://surveyjs.io/form-library/examples/survey-displaymode/ (linkStyle))
|
72472
72818
|
*/
|
@@ -72835,7 +73181,8 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
72835
73181
|
};
|
72836
73182
|
Object.defineProperty(SurveyModel.prototype, "isEmpty", {
|
72837
73183
|
/**
|
72838
|
-
* Returns `true` if the survey contains
|
73184
|
+
* Returns `true` if the survey contains zero pages.
|
73185
|
+
* @see emptySurveyText
|
72839
73186
|
*/
|
72840
73187
|
get: function () {
|
72841
73188
|
return this.pages.length == 0;
|
@@ -73003,9 +73350,6 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
73003
73350
|
configurable: true
|
73004
73351
|
});
|
73005
73352
|
Object.defineProperty(SurveyModel.prototype, "isShowingPage", {
|
73006
|
-
/**
|
73007
|
-
* Survey is showing a page right now. It is in "running", "preview" or starting state.
|
73008
|
-
*/
|
73009
73353
|
get: function () {
|
73010
73354
|
return this.state == "running" || this.state == "preview" || this.isShowStartingPage;
|
73011
73355
|
},
|
@@ -73305,12 +73649,6 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
73305
73649
|
isAfterPreview: this.changeCurrentPageFromPreview === true
|
73306
73650
|
};
|
73307
73651
|
};
|
73308
|
-
/**
|
73309
|
-
* Returns the progress that a user made while going through the survey.
|
73310
|
-
* It depends from progressBarType property
|
73311
|
-
* @see progressBarType
|
73312
|
-
* @see progressValue
|
73313
|
-
*/
|
73314
73652
|
SurveyModel.prototype.getProgress = function () {
|
73315
73653
|
if (this.currentPage == null)
|
73316
73654
|
return 0;
|
@@ -73332,9 +73670,10 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
73332
73670
|
};
|
73333
73671
|
Object.defineProperty(SurveyModel.prototype, "progressValue", {
|
73334
73672
|
/**
|
73335
|
-
* Returns
|
73336
|
-
*
|
73673
|
+
* Returns a percentage value that indicates user progress in the survey.
|
73674
|
+
* @see showProgressBar
|
73337
73675
|
* @see progressBarType
|
73676
|
+
* @see progressText
|
73338
73677
|
*/
|
73339
73678
|
get: function () {
|
73340
73679
|
return this.getPropertyValue("progressValue", 0);
|
@@ -73343,9 +73682,6 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
73343
73682
|
configurable: true
|
73344
73683
|
});
|
73345
73684
|
Object.defineProperty(SurveyModel.prototype, "isNavigationButtonsShowing", {
|
73346
|
-
/**
|
73347
|
-
* Returns the navigation buttons (i.e., 'Prev', 'Next', or 'Complete' and 'Preview') position.
|
73348
|
-
*/
|
73349
73685
|
get: function () {
|
73350
73686
|
if (this.isDesignMode)
|
73351
73687
|
return "none";
|
@@ -73364,9 +73700,6 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
73364
73700
|
configurable: true
|
73365
73701
|
});
|
73366
73702
|
Object.defineProperty(SurveyModel.prototype, "isNavigationButtonsShowingOnTop", {
|
73367
|
-
/**
|
73368
|
-
* Returns true if the navigation buttons (i.e., 'Prev', 'Next', or 'Complete' and 'Preview') are shows on top.
|
73369
|
-
*/
|
73370
73703
|
get: function () {
|
73371
73704
|
return this.getIsNavigationButtonsShowingOn("top");
|
73372
73705
|
},
|
@@ -73374,9 +73707,6 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
73374
73707
|
configurable: true
|
73375
73708
|
});
|
73376
73709
|
Object.defineProperty(SurveyModel.prototype, "isNavigationButtonsShowingOnBottom", {
|
73377
|
-
/**
|
73378
|
-
* Returns true if the navigation buttons (i.e., 'Prev', 'Next', or 'Complete' and 'Preview') are shows on bottom.
|
73379
|
-
*/
|
73380
73710
|
get: function () {
|
73381
73711
|
return this.getIsNavigationButtonsShowingOn("bottom");
|
73382
73712
|
},
|
@@ -73388,10 +73718,6 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
73388
73718
|
return res == "both" || res == buttonPosition;
|
73389
73719
|
};
|
73390
73720
|
Object.defineProperty(SurveyModel.prototype, "isEditMode", {
|
73391
|
-
/**
|
73392
|
-
* Returns `true` if the survey is in edit mode.
|
73393
|
-
* @see mode
|
73394
|
-
*/
|
73395
73721
|
get: function () {
|
73396
73722
|
return this.mode == "edit";
|
73397
73723
|
},
|
@@ -73399,11 +73725,6 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
73399
73725
|
configurable: true
|
73400
73726
|
});
|
73401
73727
|
Object.defineProperty(SurveyModel.prototype, "isDisplayMode", {
|
73402
|
-
/**
|
73403
|
-
* Returns `true` if the survey is in display mode or in preview mode.
|
73404
|
-
* @see mode
|
73405
|
-
* @see showPreviewBeforeComplete
|
73406
|
-
*/
|
73407
73728
|
get: function () {
|
73408
73729
|
return this.mode == "display" || this.state == "preview";
|
73409
73730
|
},
|
@@ -73419,8 +73740,7 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
73419
73740
|
});
|
73420
73741
|
Object.defineProperty(SurveyModel.prototype, "isDesignMode", {
|
73421
73742
|
/**
|
73422
|
-
*
|
73423
|
-
* @see setDesignMode
|
73743
|
+
* Indicates whether the survey is being designed in [Survey Creator](https://surveyjs.io/survey-creator/documentation/overview).
|
73424
73744
|
*/
|
73425
73745
|
get: function () {
|
73426
73746
|
return this._isDesignMode;
|
@@ -73428,10 +73748,6 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
73428
73748
|
enumerable: false,
|
73429
73749
|
configurable: true
|
73430
73750
|
});
|
73431
|
-
/**
|
73432
|
-
* Sets the survey into design mode.
|
73433
|
-
* @param value use true to set the survey into the design mode.
|
73434
|
-
*/
|
73435
73751
|
SurveyModel.prototype.setDesignMode = function (value) {
|
73436
73752
|
if (!!this._isDesignMode != !!value) {
|
73437
73753
|
this._isDesignMode = !!value;
|
@@ -73440,7 +73756,9 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
73440
73756
|
};
|
73441
73757
|
Object.defineProperty(SurveyModel.prototype, "showInvisibleElements", {
|
73442
73758
|
/**
|
73443
|
-
*
|
73759
|
+
* Specifies whether to show all survey elements, regardless of their visibility.
|
73760
|
+
*
|
73761
|
+
* Default value: `false`
|
73444
73762
|
*/
|
73445
73763
|
get: function () {
|
73446
73764
|
return this.getPropertyValue("showInvisibleElements", false);
|
@@ -73532,13 +73850,11 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
73532
73850
|
document.cookie = this.cookieName + "=;";
|
73533
73851
|
};
|
73534
73852
|
/**
|
73535
|
-
*
|
73536
|
-
*
|
73537
|
-
* Returns `false` in the following cases:
|
73853
|
+
* Switches the survey to the next page.
|
73538
73854
|
*
|
73539
|
-
*
|
73540
|
-
*
|
73541
|
-
* @see
|
73855
|
+
* This method returns a Boolean value that indicates whether the page was successfully switched. `false` is returned if the current page is the last page or if it contains validation errors.
|
73856
|
+
* @returns `true` if the page was successfully switched; `false` otherwise.
|
73857
|
+
* @see isLastPage
|
73542
73858
|
* @see prevPage
|
73543
73859
|
* @see completeLastPage
|
73544
73860
|
*/
|
@@ -73722,12 +74038,6 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
73722
74038
|
? undefined
|
73723
74039
|
: true;
|
73724
74040
|
};
|
73725
|
-
/**
|
73726
|
-
* Checks whether survey elements (pages, panels, and questions) have unique question names.
|
73727
|
-
* You can check for unique names for individual page and panel (and all their elements) or a question.
|
73728
|
-
* If the parameter is not specified, then a survey checks that all its elements have unique names.
|
73729
|
-
* @param element page, panel or question, it is `null` by default, that means all survey elements will be checked
|
73730
|
-
*/
|
73731
74041
|
SurveyModel.prototype.ensureUniqueNames = function (element) {
|
73732
74042
|
if (element === void 0) { element = null; }
|
73733
74043
|
if (element == null) {
|
@@ -73834,8 +74144,12 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
73834
74144
|
});
|
73835
74145
|
};
|
73836
74146
|
/**
|
73837
|
-
*
|
74147
|
+
* Switches the survey to the previous page.
|
74148
|
+
*
|
74149
|
+
* This method returns a Boolean value that indicates whether the page was successfully switched. `false` is returned if the current page is the first page.
|
74150
|
+
* @returns `true` if the page was successfully switched; `false` otherwise.
|
73838
74151
|
* @see isFirstPage
|
74152
|
+
* @see nextPage
|
73839
74153
|
*/
|
73840
74154
|
SurveyModel.prototype.prevPage = function () {
|
73841
74155
|
var _this = this;
|
@@ -74161,7 +74475,9 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
74161
74475
|
};
|
74162
74476
|
Object.defineProperty(SurveyModel.prototype, "isFirstPage", {
|
74163
74477
|
/**
|
74164
|
-
*
|
74478
|
+
* Indicates whether the [current page](#currentPage) is the first page.
|
74479
|
+
*
|
74480
|
+
* > If the survey displays the [start page](https://surveyjs.io/form-library/documentation/design-survey/create-a-multi-page-survey#start-page), this property contains `false`. Use the [`isShowStartingPage`](#isShowStartingPage) property to find out whether the start page is currently displayed.
|
74165
74481
|
*/
|
74166
74482
|
get: function () {
|
74167
74483
|
return this.getPropertyValue("isFirstPage");
|
@@ -74171,7 +74487,7 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
74171
74487
|
});
|
74172
74488
|
Object.defineProperty(SurveyModel.prototype, "isLastPage", {
|
74173
74489
|
/**
|
74174
|
-
*
|
74490
|
+
* Indicates whether the [current page](#currentPage) is the last page.
|
74175
74491
|
*/
|
74176
74492
|
get: function () {
|
74177
74493
|
return this.getPropertyValue("isLastPage");
|
@@ -74361,8 +74677,9 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
74361
74677
|
return options.allowComplete && options.allow;
|
74362
74678
|
};
|
74363
74679
|
/**
|
74364
|
-
* Starts the survey.
|
74680
|
+
* Starts the survey. Applies only if the survey has a [start page](https://surveyjs.io/form-library/documentation/design-survey/create-a-multi-page-survey#start-page).
|
74365
74681
|
* @see firstPageIsStarted
|
74682
|
+
* @see completeLastPage
|
74366
74683
|
*/
|
74367
74684
|
SurveyModel.prototype.start = function () {
|
74368
74685
|
if (!this.firstPageIsStarted)
|
@@ -74381,8 +74698,7 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
74381
74698
|
};
|
74382
74699
|
Object.defineProperty(SurveyModel.prototype, "isValidatingOnServer", {
|
74383
74700
|
/**
|
74384
|
-
*
|
74385
|
-
* @see onServerValidateQuestions
|
74701
|
+
* Indicates whether the current page is being [validated on a server](#onServerValidateQuestions).
|
74386
74702
|
*/
|
74387
74703
|
get: function () {
|
74388
74704
|
return this.getPropertyValue("isValidatingOnServer", false);
|
@@ -74505,13 +74821,14 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
74505
74821
|
this.doComplete(true, trigger);
|
74506
74822
|
};
|
74507
74823
|
SurveyModel.prototype.canBeCompleted = function (trigger, isCompleted) {
|
74824
|
+
var _a;
|
74508
74825
|
if (!_settings__WEBPACK_IMPORTED_MODULE_14__["settings"].triggers.changeNavigationButtonsOnComplete)
|
74509
74826
|
return;
|
74510
74827
|
var prevCanBeCompleted = this.canBeCompletedByTrigger;
|
74511
74828
|
if (!this.completedByTriggers)
|
74512
74829
|
this.completedByTriggers = {};
|
74513
74830
|
if (isCompleted) {
|
74514
|
-
this.completedByTriggers[trigger.id] = trigger;
|
74831
|
+
this.completedByTriggers[trigger.id] = { trigger: trigger, pageId: (_a = this.currentPage) === null || _a === void 0 ? void 0 : _a.id };
|
74515
74832
|
}
|
74516
74833
|
else {
|
74517
74834
|
delete this.completedByTriggers[trigger.id];
|
@@ -74522,9 +74839,20 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
74522
74839
|
};
|
74523
74840
|
Object.defineProperty(SurveyModel.prototype, "canBeCompletedByTrigger", {
|
74524
74841
|
get: function () {
|
74842
|
+
var _a;
|
74525
74843
|
if (!this.completedByTriggers)
|
74526
74844
|
return false;
|
74527
|
-
|
74845
|
+
var keys = Object.keys(this.completedByTriggers);
|
74846
|
+
if (keys.length === 0)
|
74847
|
+
return false;
|
74848
|
+
var id = (_a = this.currentPage) === null || _a === void 0 ? void 0 : _a.id;
|
74849
|
+
if (!id)
|
74850
|
+
return true;
|
74851
|
+
for (var i = 0; i < keys.length; i++) {
|
74852
|
+
if (id === this.completedByTriggers[keys[i]].pageId)
|
74853
|
+
return true;
|
74854
|
+
}
|
74855
|
+
return false;
|
74528
74856
|
},
|
74529
74857
|
enumerable: false,
|
74530
74858
|
configurable: true
|
@@ -74534,15 +74862,16 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
74534
74862
|
if (!this.canBeCompletedByTrigger)
|
74535
74863
|
return undefined;
|
74536
74864
|
var key = Object.keys(this.completedByTriggers)[0];
|
74537
|
-
return this.completedByTriggers[key];
|
74865
|
+
return this.completedByTriggers[key].trigger;
|
74538
74866
|
},
|
74539
74867
|
enumerable: false,
|
74540
74868
|
configurable: true
|
74541
74869
|
});
|
74542
74870
|
Object.defineProperty(SurveyModel.prototype, "processedCompletedHtml", {
|
74543
74871
|
/**
|
74544
|
-
* Returns
|
74545
|
-
*
|
74872
|
+
* Returns HTML content displayed on the [complete page](https://surveyjs.io/form-library/documentation/design-survey/create-a-multi-page-survey#complete-page).
|
74873
|
+
*
|
74874
|
+
* To specify HTML content, use the [`completedHtml`](#completedHtml) property.
|
74546
74875
|
*/
|
74547
74876
|
get: function () {
|
74548
74877
|
var html = this.renderedCompletedHtml;
|
@@ -74553,9 +74882,9 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
74553
74882
|
});
|
74554
74883
|
Object.defineProperty(SurveyModel.prototype, "processedCompletedBeforeHtml", {
|
74555
74884
|
/**
|
74556
|
-
* Returns
|
74557
|
-
*
|
74558
|
-
*
|
74885
|
+
* Returns HTML content displayed to a user who has completed the survey before. To identify such users, the survey uses a [cookie name](#cookieName) or [client ID](#clientId).
|
74886
|
+
*
|
74887
|
+
* To specify HTML content, use the [`completedBeforeHtml`](#completedBeforeHtml) property.
|
74559
74888
|
*/
|
74560
74889
|
get: function () {
|
74561
74890
|
return this.locCompletedBeforeHtml.textOrHtml;
|
@@ -74565,7 +74894,9 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
74565
74894
|
});
|
74566
74895
|
Object.defineProperty(SurveyModel.prototype, "processedLoadingHtml", {
|
74567
74896
|
/**
|
74568
|
-
* Returns
|
74897
|
+
* Returns HTML content displayed while a survey JSON schema is being loaded from [SurveyJS Service](https://api.surveyjs.io).
|
74898
|
+
*
|
74899
|
+
* To specify HTML content, use the [`loadingHtml`](#loadingHtml) property.
|
74569
74900
|
*/
|
74570
74901
|
get: function () {
|
74571
74902
|
return this.locLoadingHtml.textOrHtml;
|
@@ -74579,7 +74910,10 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
74579
74910
|
};
|
74580
74911
|
Object.defineProperty(SurveyModel.prototype, "progressText", {
|
74581
74912
|
/**
|
74582
|
-
* Returns the
|
74913
|
+
* Returns text displayed by the progress bar (for instance, "Page 2 of 3" or "Answered 3/8 questions"). Handle the [`onProgressText`](#onProgressText) event to change this text.
|
74914
|
+
* @see progressValue
|
74915
|
+
* @see showProgressBar
|
74916
|
+
* @see progressBarType
|
74583
74917
|
*/
|
74584
74918
|
get: function () {
|
74585
74919
|
var res = this.getPropertyValue("progressText", "");
|
@@ -74668,13 +75002,15 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
74668
75002
|
var mobileWidth_1 = Number.parseFloat(window.getComputedStyle(observedElement).getPropertyValue(cssVariables.mobileWidth));
|
74669
75003
|
if (!!mobileWidth_1) {
|
74670
75004
|
var isProcessed_1 = false;
|
74671
|
-
this.resizeObserver = new ResizeObserver(function () {
|
74672
|
-
|
74673
|
-
isProcessed_1
|
74674
|
-
|
74675
|
-
|
74676
|
-
|
74677
|
-
|
75005
|
+
this.resizeObserver = new ResizeObserver(function (entries) {
|
75006
|
+
window.requestAnimationFrame(function () {
|
75007
|
+
if (isProcessed_1 || !Object(_utils_utils__WEBPACK_IMPORTED_MODULE_15__["isContainerVisible"])(observedElement)) {
|
75008
|
+
isProcessed_1 = false;
|
75009
|
+
}
|
75010
|
+
else {
|
75011
|
+
isProcessed_1 = _this.processResponsiveness(observedElement.offsetWidth, mobileWidth_1);
|
75012
|
+
}
|
75013
|
+
});
|
74678
75014
|
});
|
74679
75015
|
this.resizeObserver.observe(observedElement);
|
74680
75016
|
}
|
@@ -75200,8 +75536,16 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
75200
75536
|
return page;
|
75201
75537
|
};
|
75202
75538
|
/**
|
75203
|
-
* Removes a page from
|
75204
|
-
*
|
75539
|
+
* Removes a page from the survey.
|
75540
|
+
*
|
75541
|
+
* Pass a `PageModel` object to this method. You can get this object in different ways. For example, you can call the [`getPageByName()`](#getPageByName) method to obtain a `PageModel` object with a specific name or use the [`currentPage`](#currentPage) property to access and delete the current page, as shown in the code below.
|
75542
|
+
*
|
75543
|
+
* ```js
|
75544
|
+
* // Delete the current page
|
75545
|
+
* survey.removePage(survey.currentPage);
|
75546
|
+
* ```
|
75547
|
+
* @param page A page to remove.
|
75548
|
+
* @see addNewPage
|
75205
75549
|
*/
|
75206
75550
|
SurveyModel.prototype.removePage = function (page) {
|
75207
75551
|
var index = this.pages.indexOf(page);
|
@@ -75513,7 +75857,7 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
75513
75857
|
}
|
75514
75858
|
return res;
|
75515
75859
|
};
|
75516
|
-
SurveyModel.prototype.notifyQuestionOnValueChanged = function (valueName, newValue) {
|
75860
|
+
SurveyModel.prototype.notifyQuestionOnValueChanged = function (valueName, newValue, questionName) {
|
75517
75861
|
if (this.isLoadingFromJson)
|
75518
75862
|
return;
|
75519
75863
|
var questions = this.getQuestionsByValueName(valueName);
|
@@ -75539,7 +75883,7 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
75539
75883
|
if (this.isDisposed)
|
75540
75884
|
return;
|
75541
75885
|
this.checkElementsBindings(valueName, newValue);
|
75542
|
-
this.notifyElementsOnAnyValueOrVariableChanged(valueName);
|
75886
|
+
this.notifyElementsOnAnyValueOrVariableChanged(valueName, questionName);
|
75543
75887
|
};
|
75544
75888
|
SurveyModel.prototype.checkElementsBindings = function (valueName, newValue) {
|
75545
75889
|
this.isRunningElementsBindings = true;
|
@@ -75552,7 +75896,7 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
75552
75896
|
this.updateVisibleIndexAfterBindings = false;
|
75553
75897
|
}
|
75554
75898
|
};
|
75555
|
-
SurveyModel.prototype.notifyElementsOnAnyValueOrVariableChanged = function (name) {
|
75899
|
+
SurveyModel.prototype.notifyElementsOnAnyValueOrVariableChanged = function (name, questionName) {
|
75556
75900
|
if (this.isEndLoadingFromJson === "processing")
|
75557
75901
|
return;
|
75558
75902
|
if (this.isRunningConditions) {
|
@@ -75560,7 +75904,7 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
75560
75904
|
return;
|
75561
75905
|
}
|
75562
75906
|
for (var i = 0; i < this.pages.length; i++) {
|
75563
|
-
this.pages[i].onAnyValueChanged(name);
|
75907
|
+
this.pages[i].onAnyValueChanged(name, questionName);
|
75564
75908
|
}
|
75565
75909
|
if (!this.isEndLoadingFromJson) {
|
75566
75910
|
this.locStrsChanged();
|
@@ -75789,26 +76133,23 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
75789
76133
|
});
|
75790
76134
|
};
|
75791
76135
|
/**
|
75792
|
-
* Loads
|
75793
|
-
*
|
75794
|
-
* @param
|
75795
|
-
* @param clientId users' indentifier, for example an e-mail or a unique customer id in your web application.
|
75796
|
-
* @see state
|
75797
|
-
* @see onLoadedSurveyFromService
|
76136
|
+
* Loads a survey JSON schema from the [SurveyJS Service](https://api.surveyjs.io). You can handle the [`onLoadedSurveyFromService`](#onLoadedSurveyFromService) event to modify the schema after loading if required.
|
76137
|
+
* @param surveyId The identifier of a survey JSON schema to load. Refer to the following help topic for more information: [Store Survey Results in the SurveyJS Service](https://surveyjs.io/form-library/documentation/handle-survey-results-store#store-survey-results-in-the-surveyjs-service).
|
76138
|
+
* @param clientId A user identifier (e-mail or other unique ID) used to determine whether the user has already taken the survey.
|
75798
76139
|
*/
|
75799
|
-
SurveyModel.prototype.loadSurveyFromService = function (surveyId,
|
76140
|
+
SurveyModel.prototype.loadSurveyFromService = function (surveyId, clientId) {
|
75800
76141
|
if (surveyId === void 0) { surveyId = null; }
|
75801
|
-
if (
|
76142
|
+
if (clientId === void 0) { clientId = null; }
|
75802
76143
|
if (surveyId) {
|
75803
76144
|
this.surveyId = surveyId;
|
75804
76145
|
}
|
75805
|
-
if (
|
75806
|
-
this.clientId =
|
76146
|
+
if (clientId) {
|
76147
|
+
this.clientId = clientId;
|
75807
76148
|
}
|
75808
76149
|
var self = this;
|
75809
76150
|
this.isLoading = true;
|
75810
76151
|
this.onLoadingSurveyFromService();
|
75811
|
-
if (
|
76152
|
+
if (clientId) {
|
75812
76153
|
this.createSurveyService().getSurveyJsonAndIsCompleted(this.surveyId, this.clientId, function (success, json, isCompleted, response) {
|
75813
76154
|
self.isLoading = false;
|
75814
76155
|
if (success) {
|
@@ -76224,7 +76565,7 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
76224
76565
|
* @see data
|
76225
76566
|
* @see getValue
|
76226
76567
|
*/
|
76227
|
-
SurveyModel.prototype.setValue = function (name, newQuestionValue, locNotification, allowNotifyValueChanged) {
|
76568
|
+
SurveyModel.prototype.setValue = function (name, newQuestionValue, locNotification, allowNotifyValueChanged, questionName) {
|
76228
76569
|
if (locNotification === void 0) { locNotification = false; }
|
76229
76570
|
if (allowNotifyValueChanged === void 0) { allowNotifyValueChanged = true; }
|
76230
76571
|
var newValue = newQuestionValue;
|
@@ -76246,7 +76587,7 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
76246
76587
|
newValue = this.getUnbindValue(newValue);
|
76247
76588
|
this.setDataValueCore(this.valuesHash, name, newValue);
|
76248
76589
|
}
|
76249
|
-
this.updateOnSetValue(name, newValue, oldValue, locNotification, allowNotifyValueChanged);
|
76590
|
+
this.updateOnSetValue(name, newValue, oldValue, locNotification, allowNotifyValueChanged, questionName);
|
76250
76591
|
};
|
76251
76592
|
SurveyModel.prototype.isValueEmpyOnSetValue = function (name, val) {
|
76252
76593
|
if (!this.isValueEmpty(val, false))
|
@@ -76255,18 +76596,19 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
76255
76596
|
return true;
|
76256
76597
|
return this.editingObj.getDefaultPropertyValue(name) === val;
|
76257
76598
|
};
|
76258
|
-
SurveyModel.prototype.updateOnSetValue = function (name, newValue, oldValue, locNotification, allowNotifyValueChanged) {
|
76599
|
+
SurveyModel.prototype.updateOnSetValue = function (name, newValue, oldValue, locNotification, allowNotifyValueChanged, questionName) {
|
76259
76600
|
if (locNotification === void 0) { locNotification = false; }
|
76260
76601
|
if (allowNotifyValueChanged === void 0) { allowNotifyValueChanged = true; }
|
76261
76602
|
this.updateQuestionValue(name, newValue);
|
76262
76603
|
if (locNotification === true || this.isDisposed || this.isRunningElementsBindings)
|
76263
76604
|
return;
|
76605
|
+
questionName = questionName || name;
|
76264
76606
|
var triggerKeys = {};
|
76265
76607
|
triggerKeys[name] = { newValue: newValue, oldValue: oldValue };
|
76266
76608
|
this.runConditionOnValueChanged(name, newValue);
|
76267
76609
|
this.checkTriggers(triggerKeys, false, false, name);
|
76268
76610
|
if (allowNotifyValueChanged)
|
76269
|
-
this.notifyQuestionOnValueChanged(name, newValue);
|
76611
|
+
this.notifyQuestionOnValueChanged(name, newValue, questionName);
|
76270
76612
|
if (locNotification !== "text") {
|
76271
76613
|
this.tryGoNextPageAutomatic(name);
|
76272
76614
|
}
|
@@ -76405,8 +76747,8 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
76405
76747
|
}
|
76406
76748
|
};
|
76407
76749
|
/**
|
76408
|
-
*
|
76409
|
-
* @param {string} name
|
76750
|
+
* Deletes an answer from survey results.
|
76751
|
+
* @param {string} name An object property that stores the answer to delete. Pass a question's [`valueName`](https://surveyjs.io/form-library/documentation/api-reference/question#valueName) or [`name`](https://surveyjs.io/form-library/documentation/api-reference/question#name).
|
76410
76752
|
*/
|
76411
76753
|
SurveyModel.prototype.clearValue = function (name) {
|
76412
76754
|
this.setValue(name, null);
|
@@ -76619,6 +76961,20 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
76619
76961
|
res.hasAllValuesOnLastRun = this.textPreProcessor.hasAllValuesOnLastRun;
|
76620
76962
|
return res;
|
76621
76963
|
};
|
76964
|
+
Object.defineProperty(SurveyModel.prototype, "textPreProcessor", {
|
76965
|
+
get: function () {
|
76966
|
+
var _this = this;
|
76967
|
+
if (!this.textPreProcessorValue) {
|
76968
|
+
this.textPreProcessorValue = new _textPreProcessor__WEBPACK_IMPORTED_MODULE_5__["TextPreProcessor"]();
|
76969
|
+
this.textPreProcessorValue.onProcess = function (textValue) {
|
76970
|
+
_this.getProcessedTextValue(textValue);
|
76971
|
+
};
|
76972
|
+
}
|
76973
|
+
return this.textPreProcessorValue;
|
76974
|
+
},
|
76975
|
+
enumerable: false,
|
76976
|
+
configurable: true
|
76977
|
+
});
|
76622
76978
|
SurveyModel.prototype.processTextCore = function (text, returnDisplayValue, doEncoding) {
|
76623
76979
|
if (doEncoding === void 0) { doEncoding = false; }
|
76624
76980
|
if (this.isDesignMode)
|
@@ -76772,13 +77128,13 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
76772
77128
|
});
|
76773
77129
|
Object.defineProperty(SurveyModel.prototype, "widthMode", {
|
76774
77130
|
/**
|
76775
|
-
*
|
77131
|
+
* Specifies how to calculate the survey width.
|
76776
77132
|
*
|
76777
|
-
*
|
77133
|
+
* Possible values:
|
76778
77134
|
*
|
76779
|
-
* - `static` - A survey has a fixed width
|
76780
|
-
* - `responsive` - A survey
|
76781
|
-
* - `auto` -
|
77135
|
+
* - `"static"` - A survey has a [fixed width](#width).
|
77136
|
+
* - `"responsive"` - A survey occupies all available horizontal space and stretches or shrinks horizontally to fit in the screen size.
|
77137
|
+
* - `"auto"` (default) - Survey width depends on a question type and corresponds to the `"static"` or `"responsive"` mode.
|
76782
77138
|
*/
|
76783
77139
|
// `custom/precise` - The survey width is specified by the width property. // in-future
|
76784
77140
|
get: function () {
|
@@ -77352,7 +77708,9 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
77352
77708
|
this.onThemeApplied.fire(this, { theme: theme });
|
77353
77709
|
};
|
77354
77710
|
/**
|
77355
|
-
*
|
77711
|
+
* Disposes of the survey model.
|
77712
|
+
*
|
77713
|
+
* Call this method to release resources if your application contains multiple survey models or if you re-create a survey model at runtime.
|
77356
77714
|
*/
|
77357
77715
|
SurveyModel.prototype.dispose = function () {
|
77358
77716
|
this.removeScrollEventListener();
|
@@ -77584,8 +77942,10 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_1__["Serializer"].addClass("survey", [
|
|
77584
77942
|
name: "showTOC:switch",
|
77585
77943
|
default: false
|
77586
77944
|
},
|
77587
|
-
{
|
77588
|
-
|
77945
|
+
{
|
77946
|
+
name: "tocLocation", default: "left", choices: ["left", "right"],
|
77947
|
+
dependsOn: ["showTOC"],
|
77948
|
+
visibleIf: function (survey) { return !!survey && survey.showTOC; }
|
77589
77949
|
},
|
77590
77950
|
{ name: "mode", default: "edit", choices: ["edit", "display"] },
|
77591
77951
|
{ name: "storeOthersAsComment:boolean", default: true },
|
@@ -78145,9 +78505,11 @@ function createTOCListModel(survey, onAction) {
|
|
78145
78505
|
var _a;
|
78146
78506
|
var pagesSource = survey.questionsOnPageMode === "singlePage" ? (_a = survey.pages[0]) === null || _a === void 0 ? void 0 : _a.elements : survey.pages;
|
78147
78507
|
var items = (pagesSource || []).map(function (page) {
|
78508
|
+
var _a, _b;
|
78148
78509
|
return new _actions_action__WEBPACK_IMPORTED_MODULE_0__["Action"]({
|
78149
78510
|
id: page.name,
|
78150
|
-
|
78511
|
+
locTitle: ((_a = page.locNavigationTitle) === null || _a === void 0 ? void 0 : _a.text) ? page.locNavigationTitle : (((_b = page.locTitle) === null || _b === void 0 ? void 0 : _b.text) ? page.locTitle : undefined),
|
78512
|
+
title: page.renderedNavigationTitle,
|
78151
78513
|
action: function () {
|
78152
78514
|
if (typeof document !== undefined && !!document.activeElement) {
|
78153
78515
|
!!document.activeElement.blur && document.activeElement.blur();
|
@@ -78323,11 +78685,17 @@ var SvgIconRegistry = /** @class */ (function () {
|
|
78323
78685
|
this.icons = {};
|
78324
78686
|
this.iconPrefix = "icon-";
|
78325
78687
|
}
|
78688
|
+
SvgIconRegistry.prototype.processId = function (iconId, iconPrefix) {
|
78689
|
+
if (iconId.indexOf(iconPrefix) == 0)
|
78690
|
+
iconId = iconId.substring(iconPrefix.length);
|
78691
|
+
return iconId;
|
78692
|
+
};
|
78326
78693
|
SvgIconRegistry.prototype.registerIconFromSymbol = function (iconId, iconSymbolSvg) {
|
78327
78694
|
this.icons[iconId] = iconSymbolSvg;
|
78328
78695
|
};
|
78329
78696
|
SvgIconRegistry.prototype.registerIconFromSvgViaElement = function (iconId, iconSvg, iconPrefix) {
|
78330
78697
|
if (iconPrefix === void 0) { iconPrefix = this.iconPrefix; }
|
78698
|
+
iconId = this.processId(iconId, iconPrefix);
|
78331
78699
|
var divSvg = document.createElement("div");
|
78332
78700
|
divSvg.innerHTML = iconSvg;
|
78333
78701
|
var symbol = document.createElement("symbol");
|
@@ -78341,6 +78709,7 @@ var SvgIconRegistry = /** @class */ (function () {
|
|
78341
78709
|
};
|
78342
78710
|
SvgIconRegistry.prototype.registerIconFromSvg = function (iconId, iconSvg, iconPrefix) {
|
78343
78711
|
if (iconPrefix === void 0) { iconPrefix = this.iconPrefix; }
|
78712
|
+
iconId = this.processId(iconId, iconPrefix);
|
78344
78713
|
var startStr = "<svg ";
|
78345
78714
|
var endStr = "</svg>";
|
78346
78715
|
iconSvg = iconSvg.trim();
|
@@ -79644,7 +80013,11 @@ var ResponsivityManager = /** @class */ (function () {
|
|
79644
80013
|
setTimeout(function () { _this.process(); }, 1);
|
79645
80014
|
};
|
79646
80015
|
if (typeof ResizeObserver !== "undefined") {
|
79647
|
-
this.resizeObserver = new ResizeObserver(function (
|
80016
|
+
this.resizeObserver = new ResizeObserver(function (entries) {
|
80017
|
+
window.requestAnimationFrame(function () {
|
80018
|
+
_this.process();
|
80019
|
+
});
|
80020
|
+
});
|
79648
80021
|
this.resizeObserver.observe(this.container.parentElement);
|
79649
80022
|
}
|
79650
80023
|
}
|