survey-core 1.11.6 → 1.11.7
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 +9 -5
- package/defaultV2.css.map +1 -1
- package/defaultV2.fontless.css +9 -5
- package/defaultV2.fontless.css.map +1 -1
- package/defaultV2.fontless.min.css +2 -2
- package/defaultV2.min.css +2 -2
- package/i18n/arabic.js +1 -1
- package/i18n/arabic.min.js +1 -1
- package/i18n/basque.js +1 -1
- package/i18n/basque.min.js +1 -1
- package/i18n/bulgarian.js +1 -1
- package/i18n/bulgarian.min.js +1 -1
- package/i18n/catalan.js +1 -1
- package/i18n/catalan.min.js +1 -1
- package/i18n/croatian.js +1 -1
- package/i18n/croatian.min.js +1 -1
- package/i18n/czech.js +1 -1
- package/i18n/czech.min.js +1 -1
- package/i18n/danish.js +1 -1
- package/i18n/danish.min.js +1 -1
- package/i18n/dutch.js +1 -1
- package/i18n/dutch.min.js +1 -1
- package/i18n/english.js +1 -1
- package/i18n/english.min.js +1 -1
- package/i18n/estonian.js +1 -1
- package/i18n/estonian.min.js +1 -1
- package/i18n/finnish.js +1 -1
- package/i18n/finnish.min.js +1 -1
- package/i18n/french.js +1 -1
- package/i18n/french.min.js +1 -1
- package/i18n/georgian.js +1 -1
- package/i18n/georgian.min.js +1 -1
- package/i18n/german.js +1 -1
- package/i18n/german.min.js +1 -1
- package/i18n/greek.js +1 -1
- package/i18n/greek.min.js +1 -1
- package/i18n/hebrew.js +1 -1
- package/i18n/hebrew.min.js +1 -1
- package/i18n/hindi.js +1 -1
- package/i18n/hindi.min.js +1 -1
- package/i18n/hungarian.js +1 -1
- package/i18n/hungarian.min.js +1 -1
- package/i18n/icelandic.js +1 -1
- package/i18n/icelandic.min.js +1 -1
- package/i18n/index.js +1 -1
- package/i18n/index.min.js +1 -1
- package/i18n/indonesian.js +1 -1
- package/i18n/indonesian.min.js +1 -1
- package/i18n/italian.js +1 -1
- package/i18n/italian.min.js +1 -1
- package/i18n/japanese.js +1 -1
- package/i18n/japanese.min.js +1 -1
- package/i18n/kazakh.js +1 -1
- package/i18n/kazakh.min.js +1 -1
- package/i18n/korean.js +1 -1
- package/i18n/korean.min.js +1 -1
- package/i18n/latvian.js +1 -1
- package/i18n/latvian.min.js +1 -1
- package/i18n/lithuanian.js +1 -1
- package/i18n/lithuanian.min.js +1 -1
- package/i18n/macedonian.js +1 -1
- package/i18n/macedonian.min.js +1 -1
- package/i18n/malay.js +1 -1
- package/i18n/malay.min.js +1 -1
- package/i18n/nl-BE.js +1 -1
- package/i18n/nl-BE.min.js +1 -1
- package/i18n/norwegian.js +1 -1
- package/i18n/norwegian.min.js +1 -1
- package/i18n/persian.js +1 -1
- package/i18n/persian.min.js +1 -1
- package/i18n/philippines.js +1 -1
- package/i18n/philippines.min.js +1 -1
- package/i18n/polish.js +1 -1
- package/i18n/polish.min.js +1 -1
- package/i18n/portuguese-br.js +1 -1
- package/i18n/portuguese-br.min.js +1 -1
- package/i18n/portuguese.js +1 -1
- package/i18n/portuguese.min.js +1 -1
- package/i18n/romanian.js +1 -1
- package/i18n/romanian.min.js +1 -1
- package/i18n/russian.js +1 -1
- package/i18n/russian.min.js +1 -1
- package/i18n/serbian.js +1 -1
- package/i18n/serbian.min.js +1 -1
- package/i18n/simplified-chinese.js +1 -1
- package/i18n/simplified-chinese.min.js +1 -1
- package/i18n/slovak.js +1 -1
- package/i18n/slovak.min.js +1 -1
- package/i18n/spanish.js +1 -1
- package/i18n/spanish.min.js +1 -1
- package/i18n/swahili.js +1 -1
- package/i18n/swahili.min.js +1 -1
- package/i18n/swedish.js +1 -1
- package/i18n/swedish.min.js +1 -1
- package/i18n/tajik.js +1 -1
- package/i18n/tajik.min.js +1 -1
- package/i18n/telugu.js +1 -1
- package/i18n/telugu.min.js +1 -1
- package/i18n/thai.js +1 -1
- package/i18n/thai.min.js +1 -1
- package/i18n/traditional-chinese.js +1 -1
- package/i18n/traditional-chinese.min.js +1 -1
- package/i18n/turkish.js +1 -1
- package/i18n/turkish.min.js +1 -1
- package/i18n/ukrainian.js +1 -1
- package/i18n/ukrainian.min.js +1 -1
- package/i18n/urdu.js +1 -1
- package/i18n/urdu.min.js +1 -1
- package/i18n/vietnamese.js +1 -1
- package/i18n/vietnamese.min.js +1 -1
- package/i18n/welsh.js +1 -1
- package/i18n/welsh.min.js +1 -1
- package/modern.css +6 -6
- package/modern.css.map +1 -1
- package/modern.fontless.css +6 -6
- package/modern.fontless.css.map +1 -1
- package/modern.fontless.min.css +2 -2
- package/modern.min.css +2 -2
- package/package.json +1 -1
- package/plugins/bootstrap-integration.js +1 -1
- package/plugins/bootstrap-integration.min.js +1 -1
- package/plugins/bootstrap-material-integration.js +1 -1
- package/plugins/bootstrap-material-integration.min.js +1 -1
- package/survey.core.js +186 -67
- package/survey.core.js.map +1 -1
- package/survey.core.min.js +3 -3
- package/survey.css +6 -6
- package/survey.css.map +1 -1
- package/survey.i18n.js +1 -1
- package/survey.i18n.min.js +1 -1
- package/survey.min.css +2 -2
- package/themes/borderless-dark-panelless.js +1 -1
- package/themes/borderless-dark-panelless.min.js +1 -1
- package/themes/borderless-dark.js +1 -1
- package/themes/borderless-dark.min.js +1 -1
- package/themes/borderless-light-panelless..js +1 -1
- package/themes/borderless-light-panelless..min.js +1 -1
- package/themes/borderless-light.js +1 -1
- package/themes/borderless-light.min.js +1 -1
- package/themes/contrast-dark-panelless.js +1 -1
- package/themes/contrast-dark-panelless.min.js +1 -1
- package/themes/contrast-dark.js +1 -1
- package/themes/contrast-dark.min.js +1 -1
- package/themes/contrast-light-panelless.js +1 -1
- package/themes/contrast-light-panelless.min.js +1 -1
- package/themes/contrast-light.js +1 -1
- package/themes/contrast-light.min.js +1 -1
- package/themes/default-dark-panelless.js +1 -1
- package/themes/default-dark-panelless.min.js +1 -1
- package/themes/default-dark.js +1 -1
- package/themes/default-dark.min.js +1 -1
- package/themes/default-light-panelless.js +1 -1
- package/themes/default-light-panelless.min.js +1 -1
- package/themes/default-light.js +1 -1
- package/themes/default-light.min.js +1 -1
- package/themes/doubleborder-dark-panelless.js +1 -1
- package/themes/doubleborder-dark-panelless.min.js +1 -1
- package/themes/doubleborder-dark.js +1 -1
- package/themes/doubleborder-dark.min.js +1 -1
- package/themes/doubleborder-light-panelles.js +1 -1
- package/themes/doubleborder-light-panelles.min.js +1 -1
- package/themes/doubleborder-light.js +1 -1
- package/themes/doubleborder-light.min.js +1 -1
- package/themes/flat-dark-panelless.js +1 -1
- package/themes/flat-dark-panelless.min.js +1 -1
- package/themes/flat-dark.js +1 -1
- package/themes/flat-dark.min.js +1 -1
- package/themes/flat-light-panelless.js +1 -1
- package/themes/flat-light-panelless.min.js +1 -1
- package/themes/flat-light.js +1 -1
- package/themes/flat-light.min.js +1 -1
- package/themes/index.js +1 -1
- package/themes/index.min.js +1 -1
- package/themes/layered-dark-panelless.js +1 -1
- package/themes/layered-dark-panelless.min.js +1 -1
- package/themes/layered-dark.js +1 -1
- package/themes/layered-dark.min.js +1 -1
- package/themes/layered-light-panelless.js +1 -1
- package/themes/layered-light-panelless.min.js +1 -1
- package/themes/layered-light.js +1 -1
- package/themes/layered-light.min.js +1 -1
- package/themes/plain-dark-panelless.js +1 -1
- package/themes/plain-dark-panelless.min.js +1 -1
- package/themes/plain-dark.js +1 -1
- package/themes/plain-dark.min.js +1 -1
- package/themes/plain-light-panelless.js +1 -1
- package/themes/plain-light-panelless.min.js +1 -1
- package/themes/plain-light.js +1 -1
- package/themes/plain-light.min.js +1 -1
- package/themes/sharp-dark-panelless.js +1 -1
- package/themes/sharp-dark-panelless.min.js +1 -1
- package/themes/sharp-dark.js +1 -1
- package/themes/sharp-dark.min.js +1 -1
- package/themes/sharp-light-panelless.js +1 -1
- package/themes/sharp-light-panelless.min.js +1 -1
- package/themes/sharp-light.js +1 -1
- package/themes/sharp-light.min.js +1 -1
- package/themes/solid-dark-panelless.js +1 -1
- package/themes/solid-dark-panelless.min.js +1 -1
- package/themes/solid-dark.js +1 -1
- package/themes/solid-dark.min.js +1 -1
- package/themes/solid-light-panelless.js +1 -1
- package/themes/solid-light-panelless.min.js +1 -1
- package/themes/solid-light.js +1 -1
- package/themes/solid-light.min.js +1 -1
- package/themes/three-dimensional-dark-panelless.js +1 -1
- package/themes/three-dimensional-dark-panelless.min.js +1 -1
- package/themes/three-dimensional-dark.js +1 -1
- package/themes/three-dimensional-dark.min.js +1 -1
- package/themes/three-dimensional-light-panelless.js +1 -1
- package/themes/three-dimensional-light-panelless.min.js +1 -1
- package/themes/three-dimensional-light.js +1 -1
- package/themes/three-dimensional-light.min.js +1 -1
- package/ts3.4/typings/base-interfaces.d.ts +2 -0
- package/ts3.4/typings/mask/input_element_adapter.d.ts +1 -0
- package/ts3.4/typings/page.d.ts +1 -0
- package/ts3.4/typings/panel.d.ts +1 -0
- package/ts3.4/typings/question.d.ts +2 -0
- package/ts3.4/typings/question_comment.d.ts +3 -3
- package/ts3.4/typings/question_custom.d.ts +1 -0
- package/ts3.4/typings/question_matrixdropdownbase.d.ts +1 -0
- package/ts3.4/typings/question_multipletext.d.ts +1 -0
- package/ts3.4/typings/question_text.d.ts +4 -0
- package/ts3.4/typings/settings.d.ts +1 -0
- package/ts3.4/typings/survey.d.ts +1 -1
- package/ts3.4/typings/surveytimer.d.ts +9 -4
- package/typings/base-interfaces.d.ts +2 -0
- package/typings/mask/input_element_adapter.d.ts +1 -0
- package/typings/page.d.ts +1 -0
- package/typings/panel.d.ts +1 -0
- package/typings/question.d.ts +2 -0
- package/typings/question_comment.d.ts +5 -5
- package/typings/question_custom.d.ts +1 -0
- package/typings/question_matrixdropdownbase.d.ts +1 -0
- package/typings/question_multipletext.d.ts +1 -0
- package/typings/question_text.d.ts +4 -0
- package/typings/settings.d.ts +1 -0
- package/typings/survey.d.ts +1 -1
- package/typings/surveytimer.d.ts +9 -4
package/package.json
CHANGED
package/survey.core.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* surveyjs - Survey JavaScript library v1.11.
|
|
2
|
+
* surveyjs - Survey JavaScript library v1.11.7
|
|
3
3
|
* Copyright (c) 2015-2024 Devsoft Baltic OÜ - http://surveyjs.io/
|
|
4
4
|
* License: MIT (http://www.opensource.org/licenses/mit-license.php)
|
|
5
5
|
*/
|
|
@@ -2298,6 +2298,8 @@ var Base = /** @class */ (function () {
|
|
|
2298
2298
|
if (!prop || prop.isCustom && this.isCreating)
|
|
2299
2299
|
return undefined;
|
|
2300
2300
|
var dValue = prop.defaultValue;
|
|
2301
|
+
if (!!prop.defaultValueFunc)
|
|
2302
|
+
return dValue;
|
|
2301
2303
|
if (!this.isPropertyEmpty(dValue) && !Array.isArray(dValue))
|
|
2302
2304
|
return dValue;
|
|
2303
2305
|
var locStr = this.localizableStrings ? this.localizableStrings[name] : undefined;
|
|
@@ -9840,8 +9842,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
9840
9842
|
|
|
9841
9843
|
var Version;
|
|
9842
9844
|
var ReleaseDate;
|
|
9843
|
-
Version = "" + "1.11.
|
|
9844
|
-
ReleaseDate = "" + "2024-07-
|
|
9845
|
+
Version = "" + "1.11.7";
|
|
9846
|
+
ReleaseDate = "" + "2024-07-16";
|
|
9845
9847
|
function checkLibraryVersion(ver, libraryName) {
|
|
9846
9848
|
if (Version != ver) {
|
|
9847
9849
|
var str = "survey-core has version '" + Version + "' and " + libraryName
|
|
@@ -18546,7 +18548,7 @@ var JsonObjectProperty = /** @class */ (function () {
|
|
|
18546
18548
|
}
|
|
18547
18549
|
if (this.isLocalizable)
|
|
18548
18550
|
return value === null || value === undefined;
|
|
18549
|
-
return ((value === false && (this.type == "boolean" || this.type == "switch")) ||
|
|
18551
|
+
return ((value === false && (this.type == "boolean" || this.type == "switch") && !this.defaultValueFunc) ||
|
|
18550
18552
|
value === "" || _helpers__WEBPACK_IMPORTED_MODULE_2__["Helpers"].isValueEmpty(value));
|
|
18551
18553
|
};
|
|
18552
18554
|
JsonObjectProperty.prototype.getSerializableValue = function (obj) {
|
|
@@ -21983,6 +21985,10 @@ var InputElementAdapter = /** @class */ (function () {
|
|
|
21983
21985
|
event.preventDefault();
|
|
21984
21986
|
}
|
|
21985
21987
|
};
|
|
21988
|
+
this.changeHandler = function (event) {
|
|
21989
|
+
var result = _this.inputMaskInstance.processInput({ prevValue: "", insertedChars: event.target.value, selectionStart: 0, selectionEnd: 0 });
|
|
21990
|
+
_this.inputElement.value = result.value;
|
|
21991
|
+
};
|
|
21986
21992
|
var _value = value;
|
|
21987
21993
|
if (_value === null || _value === undefined) {
|
|
21988
21994
|
_value = "";
|
|
@@ -22016,6 +22022,7 @@ var InputElementAdapter = /** @class */ (function () {
|
|
|
22016
22022
|
this.inputElement.addEventListener("beforeinput", this.beforeInputHandler);
|
|
22017
22023
|
this.inputElement.addEventListener("click", this.clickHandler);
|
|
22018
22024
|
this.inputElement.addEventListener("focus", this.clickHandler);
|
|
22025
|
+
this.inputElement.addEventListener("change", this.changeHandler);
|
|
22019
22026
|
}
|
|
22020
22027
|
};
|
|
22021
22028
|
InputElementAdapter.prototype.removeInputEventListener = function () {
|
|
@@ -22023,6 +22030,7 @@ var InputElementAdapter = /** @class */ (function () {
|
|
|
22023
22030
|
this.inputElement.removeEventListener("beforeinput", this.beforeInputHandler);
|
|
22024
22031
|
this.inputElement.removeEventListener("click", this.clickHandler);
|
|
22025
22032
|
this.inputElement.removeEventListener("focus", this.clickHandler);
|
|
22033
|
+
this.inputElement.removeEventListener("change", this.changeHandler);
|
|
22026
22034
|
}
|
|
22027
22035
|
};
|
|
22028
22036
|
InputElementAdapter.prototype.dispose = function () {
|
|
@@ -24116,6 +24124,12 @@ var PageModel = /** @class */ (function (_super) {
|
|
|
24116
24124
|
enumerable: false,
|
|
24117
24125
|
configurable: true
|
|
24118
24126
|
});
|
|
24127
|
+
PageModel.prototype.getMaxTimeToFinish = function () {
|
|
24128
|
+
if (this.maxTimeToFinish !== 0)
|
|
24129
|
+
return this.maxTimeToFinish;
|
|
24130
|
+
var res = !!this.survey ? this.survey.maxTimeToFinishPage : 0;
|
|
24131
|
+
return res > 0 ? res : 0;
|
|
24132
|
+
};
|
|
24119
24133
|
PageModel.prototype.onNumChanged = function (value) { };
|
|
24120
24134
|
PageModel.prototype.onVisibleChanged = function () {
|
|
24121
24135
|
if (this.isRandomizing)
|
|
@@ -25201,6 +25215,23 @@ var PanelModelBase = /** @class */ (function (_super) {
|
|
|
25201
25215
|
this.parent.validateContainerOnly();
|
|
25202
25216
|
}
|
|
25203
25217
|
};
|
|
25218
|
+
PanelModelBase.prototype.onQuestionValueChanged = function (el) {
|
|
25219
|
+
var index = this.questions.indexOf(el);
|
|
25220
|
+
if (index < 0)
|
|
25221
|
+
return;
|
|
25222
|
+
var dif = 5;
|
|
25223
|
+
var max = this.questions.length - 1;
|
|
25224
|
+
var start = index - dif > 0 ? index - dif : 0;
|
|
25225
|
+
var end = index + dif < max ? index + dif : max;
|
|
25226
|
+
for (var i = start; i <= end; i++) {
|
|
25227
|
+
if (i === index)
|
|
25228
|
+
continue;
|
|
25229
|
+
var q = this.questions[i];
|
|
25230
|
+
if (q.errors.length > 0 && q.validate(false)) {
|
|
25231
|
+
q.validate(true);
|
|
25232
|
+
}
|
|
25233
|
+
}
|
|
25234
|
+
};
|
|
25204
25235
|
PanelModelBase.prototype.hasErrorsInPanels = function (rec) {
|
|
25205
25236
|
var errors = [];
|
|
25206
25237
|
this.hasRequiredError(rec, errors);
|
|
@@ -29252,8 +29283,12 @@ var Question = /** @class */ (function (_super) {
|
|
|
29252
29283
|
Object.defineProperty(Question.prototype, "titleWidth", {
|
|
29253
29284
|
get: function () {
|
|
29254
29285
|
if (this.getTitleLocation() === "left") {
|
|
29255
|
-
if (!!this.parent)
|
|
29256
|
-
|
|
29286
|
+
if (!!this.parent) {
|
|
29287
|
+
var width = this.parent.getQuestionTitleWidth();
|
|
29288
|
+
if (width && !isNaN(width))
|
|
29289
|
+
width = width + "px";
|
|
29290
|
+
return width;
|
|
29291
|
+
}
|
|
29257
29292
|
}
|
|
29258
29293
|
return undefined;
|
|
29259
29294
|
},
|
|
@@ -30395,14 +30430,23 @@ var Question = /** @class */ (function (_super) {
|
|
|
30395
30430
|
Question.prototype.getFilteredName = function () { return this.getValueName(); };
|
|
30396
30431
|
Object.defineProperty(Question.prototype, "valueForSurvey", {
|
|
30397
30432
|
get: function () {
|
|
30398
|
-
|
|
30399
|
-
return this.valueToDataCallback(this.value);
|
|
30400
|
-
}
|
|
30401
|
-
return this.value;
|
|
30433
|
+
return this.valueForSurveyCore(this.value);
|
|
30402
30434
|
},
|
|
30403
30435
|
enumerable: false,
|
|
30404
30436
|
configurable: true
|
|
30405
30437
|
});
|
|
30438
|
+
Question.prototype.valueForSurveyCore = function (val) {
|
|
30439
|
+
if (!!this.valueToDataCallback) {
|
|
30440
|
+
return this.valueToDataCallback(val);
|
|
30441
|
+
}
|
|
30442
|
+
return val;
|
|
30443
|
+
};
|
|
30444
|
+
Question.prototype.valueFromDataCore = function (val) {
|
|
30445
|
+
if (!!this.valueFromDataCallback) {
|
|
30446
|
+
return this.valueFromDataCallback(val);
|
|
30447
|
+
}
|
|
30448
|
+
return val;
|
|
30449
|
+
};
|
|
30406
30450
|
/**
|
|
30407
30451
|
* Sets the question's `value` and `comment` properties to `undefined`.
|
|
30408
30452
|
* @see value
|
|
@@ -31224,6 +31268,9 @@ var Question = /** @class */ (function (_super) {
|
|
|
31224
31268
|
this.updateQuestionCss();
|
|
31225
31269
|
}
|
|
31226
31270
|
this.isOldAnswered = undefined;
|
|
31271
|
+
if (this.parent) {
|
|
31272
|
+
this.parent.onQuestionValueChanged(this);
|
|
31273
|
+
}
|
|
31227
31274
|
};
|
|
31228
31275
|
Question.prototype.checkIsValueCorrect = function (val) {
|
|
31229
31276
|
var res = this.isValueEmpty(val, !this.allowSpaceAsAnswer) || this.isNewValueCorrect(val);
|
|
@@ -31309,9 +31356,7 @@ var Question = /** @class */ (function (_super) {
|
|
|
31309
31356
|
var _this = this;
|
|
31310
31357
|
if (clearData === void 0) { clearData = false; }
|
|
31311
31358
|
newValue = this.getUnbindValue(newValue);
|
|
31312
|
-
|
|
31313
|
-
newValue = this.valueFromDataCallback(newValue);
|
|
31314
|
-
}
|
|
31359
|
+
newValue = this.valueFromDataCore(newValue);
|
|
31315
31360
|
if (!this.checkIsValueCorrect(newValue))
|
|
31316
31361
|
return;
|
|
31317
31362
|
var isEmpty = this.isValueEmpty(newValue);
|
|
@@ -34498,6 +34543,8 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_0__["Serializer"].addClass("selectbase", [
|
|
|
34498
34543
|
return !obj.choicesFromQuestion;
|
|
34499
34544
|
},
|
|
34500
34545
|
},
|
|
34546
|
+
{ name: "defaultValue:value", visibleIf: function (obj) { return !obj.choicesFromQuestion; }, dependsOn: "choicesFromQuestion" },
|
|
34547
|
+
{ name: "correctAnswer:value", visibleIf: function (obj) { return !obj.choicesFromQuestion; }, dependsOn: "choicesFromQuestion" },
|
|
34501
34548
|
{ name: "separateSpecialChoices:boolean", visible: false },
|
|
34502
34549
|
{ name: "showOtherItem:boolean", alternativeName: "hasOther" },
|
|
34503
34550
|
{ name: "showNoneItem:boolean", alternativeName: "hasNone" },
|
|
@@ -34557,8 +34604,7 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_0__["Serializer"].addClass("selectbase", [
|
|
|
34557
34604
|
default: "default",
|
|
34558
34605
|
choices: ["default", true, false],
|
|
34559
34606
|
visible: false,
|
|
34560
|
-
}
|
|
34561
|
-
// { name: "itemComponent", visible: false }
|
|
34607
|
+
}
|
|
34562
34608
|
], null, "question");
|
|
34563
34609
|
_jsonobject__WEBPACK_IMPORTED_MODULE_0__["Serializer"].addClass("checkboxbase", [
|
|
34564
34610
|
{
|
|
@@ -36215,7 +36261,7 @@ var QuestionCommentModel = /** @class */ (function (_super) {
|
|
|
36215
36261
|
* @see allowResize
|
|
36216
36262
|
*/
|
|
36217
36263
|
get: function () {
|
|
36218
|
-
return this.getPropertyValue("autoGrow")
|
|
36264
|
+
return this.getPropertyValue("autoGrow");
|
|
36219
36265
|
},
|
|
36220
36266
|
set: function (val) {
|
|
36221
36267
|
this.setPropertyValue("autoGrow", val);
|
|
@@ -36223,9 +36269,16 @@ var QuestionCommentModel = /** @class */ (function (_super) {
|
|
|
36223
36269
|
enumerable: false,
|
|
36224
36270
|
configurable: true
|
|
36225
36271
|
});
|
|
36272
|
+
Object.defineProperty(QuestionCommentModel.prototype, "renderedAutoGrow", {
|
|
36273
|
+
get: function () {
|
|
36274
|
+
var autoGrow = this.autoGrow;
|
|
36275
|
+
return autoGrow === undefined && this.survey ? this.survey.autoGrowComment : !!autoGrow;
|
|
36276
|
+
},
|
|
36277
|
+
enumerable: false,
|
|
36278
|
+
configurable: true
|
|
36279
|
+
});
|
|
36226
36280
|
Object.defineProperty(QuestionCommentModel.prototype, "allowResize", {
|
|
36227
36281
|
/**
|
|
36228
|
-
* Specifies whether to display a resize handle for the comment area.
|
|
36229
36282
|
*
|
|
36230
36283
|
* Default value: `true` (inherited from `SurveyModel`'s [`allowResizeComment`](https://surveyjs.io/form-library/documentation/surveymodel#allowResizeComment) property)
|
|
36231
36284
|
* @see autoGrow
|
|
@@ -36241,7 +36294,9 @@ var QuestionCommentModel = /** @class */ (function (_super) {
|
|
|
36241
36294
|
});
|
|
36242
36295
|
Object.defineProperty(QuestionCommentModel.prototype, "renderedAllowResize", {
|
|
36243
36296
|
get: function () {
|
|
36244
|
-
|
|
36297
|
+
var res = this.allowResize;
|
|
36298
|
+
var allowResize = res === undefined && this.survey ? this.survey.allowResizeComment : !!res;
|
|
36299
|
+
return allowResize && !this.isPreviewStyle && !this.isReadOnlyStyle;
|
|
36245
36300
|
},
|
|
36246
36301
|
enumerable: false,
|
|
36247
36302
|
configurable: true
|
|
@@ -36264,7 +36319,7 @@ var QuestionCommentModel = /** @class */ (function (_super) {
|
|
|
36264
36319
|
};
|
|
36265
36320
|
QuestionCommentModel.prototype.updateElement = function () {
|
|
36266
36321
|
var _this = this;
|
|
36267
|
-
if (this.element && this.
|
|
36322
|
+
if (this.element && this.renderedAutoGrow) {
|
|
36268
36323
|
setTimeout(function () { return Object(_utils_utils__WEBPACK_IMPORTED_MODULE_3__["increaseHeightByContent"])(_this.element); }, 1);
|
|
36269
36324
|
}
|
|
36270
36325
|
};
|
|
@@ -36325,8 +36380,8 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_0__["Serializer"].addClass("comment", [
|
|
|
36325
36380
|
default: "default",
|
|
36326
36381
|
choices: ["default", "onBlur", "onTyping"],
|
|
36327
36382
|
},
|
|
36328
|
-
{ name: "autoGrow:boolean" },
|
|
36329
|
-
{ name: "allowResize:boolean",
|
|
36383
|
+
{ name: "autoGrow:boolean", defaultFunc: function () { return undefined; } },
|
|
36384
|
+
{ name: "allowResize:boolean", defaultFunc: function () { return undefined; } },
|
|
36330
36385
|
{ name: "acceptCarriageReturn:boolean", default: true, visible: false }
|
|
36331
36386
|
], function () {
|
|
36332
36387
|
return new QuestionCommentModel("");
|
|
@@ -36854,6 +36909,9 @@ var QuestionCustomModelBase = /** @class */ (function (_super) {
|
|
|
36854
36909
|
QuestionCustomModelBase.prototype.validateContainerOnly = function () {
|
|
36855
36910
|
// do nothing
|
|
36856
36911
|
};
|
|
36912
|
+
QuestionCustomModelBase.prototype.onQuestionValueChanged = function (el) {
|
|
36913
|
+
// do nothing
|
|
36914
|
+
};
|
|
36857
36915
|
QuestionCustomModelBase.prototype.getQuestionErrorLocation = function () {
|
|
36858
36916
|
return this.getErrorLocation();
|
|
36859
36917
|
};
|
|
@@ -43474,6 +43532,9 @@ var QuestionMatrixDropdownModelBase = /** @class */ (function (_super) {
|
|
|
43474
43532
|
enumerable: false,
|
|
43475
43533
|
configurable: true
|
|
43476
43534
|
});
|
|
43535
|
+
QuestionMatrixDropdownModelBase.prototype.isSelectCellType = function () {
|
|
43536
|
+
return _jsonobject__WEBPACK_IMPORTED_MODULE_0__["Serializer"].isDescendantOf(this.cellType, "selectbase");
|
|
43537
|
+
};
|
|
43477
43538
|
QuestionMatrixDropdownModelBase.prototype.updateColumnsCellType = function () {
|
|
43478
43539
|
for (var i = 0; i < this.columns.length; i++) {
|
|
43479
43540
|
this.columns[i].defaultCellTypeChanged();
|
|
@@ -43628,13 +43689,17 @@ var QuestionMatrixDropdownModelBase = /** @class */ (function (_super) {
|
|
|
43628
43689
|
break;
|
|
43629
43690
|
columnName = path[i] + columnName;
|
|
43630
43691
|
}
|
|
43692
|
+
var question = undefined;
|
|
43631
43693
|
var column = this.getColumnByName(columnName);
|
|
43632
|
-
if (
|
|
43633
|
-
|
|
43634
|
-
|
|
43635
|
-
|
|
43636
|
-
|
|
43637
|
-
|
|
43694
|
+
if (!!column) {
|
|
43695
|
+
question = column.createCellQuestion(null);
|
|
43696
|
+
}
|
|
43697
|
+
else {
|
|
43698
|
+
if (this.detailPanelMode !== "none") {
|
|
43699
|
+
question = this.detailPanel.getQuestionByName(columnName);
|
|
43700
|
+
}
|
|
43701
|
+
}
|
|
43702
|
+
return !!question ? question.getConditionJson(operator) : null;
|
|
43638
43703
|
};
|
|
43639
43704
|
QuestionMatrixDropdownModelBase.prototype.clearIncorrectValues = function () {
|
|
43640
43705
|
var rows = this.visibleRows;
|
|
@@ -44113,7 +44178,11 @@ var QuestionMatrixDropdownModelBase = /** @class */ (function (_super) {
|
|
|
44113
44178
|
return questionPlainData;
|
|
44114
44179
|
};
|
|
44115
44180
|
QuestionMatrixDropdownModelBase.prototype.addConditionObjectsByContext = function (objects, context) {
|
|
44116
|
-
var
|
|
44181
|
+
var rowElements = [].concat(this.columns);
|
|
44182
|
+
if (this.detailPanelMode !== "none") {
|
|
44183
|
+
rowElements = rowElements.concat(this.detailPanel.questions);
|
|
44184
|
+
}
|
|
44185
|
+
var hasColumnContext = !!context && rowElements.indexOf(context) > -1;
|
|
44117
44186
|
var hasContext = context === true || hasColumnContext;
|
|
44118
44187
|
var rowsIndeces = this.getConditionObjectsRowIndeces();
|
|
44119
44188
|
if (hasContext) {
|
|
@@ -44129,13 +44198,13 @@ var QuestionMatrixDropdownModelBase = /** @class */ (function (_super) {
|
|
|
44129
44198
|
var dot = hasQuestionPrefix && index === -1 ? "." : "";
|
|
44130
44199
|
var prefixName = (hasQuestionPrefix ? this.getValueName() : "") + dot + rowName + ".";
|
|
44131
44200
|
var prefixTitle = (hasQuestionPrefix ? this.processedTitle : "") + dot + rowText + ".";
|
|
44132
|
-
for (var j = 0; j <
|
|
44133
|
-
var
|
|
44134
|
-
if (index === -1 && context ===
|
|
44201
|
+
for (var j = 0; j < rowElements.length; j++) {
|
|
44202
|
+
var rowElement = rowElements[j];
|
|
44203
|
+
if (index === -1 && context === rowElement)
|
|
44135
44204
|
continue;
|
|
44136
44205
|
var obj = {
|
|
44137
|
-
name: prefixName +
|
|
44138
|
-
text: prefixTitle +
|
|
44206
|
+
name: prefixName + rowElement.name,
|
|
44207
|
+
text: prefixTitle + rowElement.fullTitle,
|
|
44139
44208
|
question: this
|
|
44140
44209
|
};
|
|
44141
44210
|
if (index === -1 && context === true) {
|
|
@@ -44202,9 +44271,11 @@ var QuestionMatrixDropdownModelBase = /** @class */ (function (_super) {
|
|
|
44202
44271
|
var col = this.columns[i];
|
|
44203
44272
|
if (!col.templateQuestion.hasInput)
|
|
44204
44273
|
continue;
|
|
44274
|
+
var hasValue = !_helpers__WEBPACK_IMPORTED_MODULE_2__["Helpers"].isValueEmpty(rowValue[col.name]);
|
|
44275
|
+
if (!hasValue && !!col.templateQuestion.visibleIf)
|
|
44276
|
+
continue;
|
|
44205
44277
|
res.questionCount += 1;
|
|
44206
44278
|
res.requiredQuestionCount += col.isRequired;
|
|
44207
|
-
var hasValue = !_helpers__WEBPACK_IMPORTED_MODULE_2__["Helpers"].isValueEmpty(rowValue[col.name]);
|
|
44208
44279
|
res.answeredQuestionCount += hasValue ? 1 : 0;
|
|
44209
44280
|
res.requiredAnsweredQuestionCount += hasValue && col.isRequired ? 1 : 0;
|
|
44210
44281
|
}
|
|
@@ -44842,6 +44913,7 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_0__["Serializer"].addClass("matrixdropdownb
|
|
|
44842
44913
|
{ name: "horizontalScroll:boolean", visible: false, },
|
|
44843
44914
|
{
|
|
44844
44915
|
name: "choices:itemvalue[]", uniqueProperty: "value",
|
|
44916
|
+
visibleIf: function (obj) { return obj.isSelectCellType(); }
|
|
44845
44917
|
},
|
|
44846
44918
|
{ name: "placeholder", alternativeName: "optionsCaption", serializationProperty: "locPlaceholder" },
|
|
44847
44919
|
{
|
|
@@ -49466,6 +49538,9 @@ var QuestionMultipleTextModel = /** @class */ (function (_super) {
|
|
|
49466
49538
|
QuestionMultipleTextModel.prototype.validateContainerOnly = function () {
|
|
49467
49539
|
// do nothing
|
|
49468
49540
|
};
|
|
49541
|
+
QuestionMultipleTextModel.prototype.onQuestionValueChanged = function (el) {
|
|
49542
|
+
// do nothing
|
|
49543
|
+
};
|
|
49469
49544
|
QuestionMultipleTextModel.prototype.getItemLabelCss = function (item) {
|
|
49470
49545
|
return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_7__["CssClassBuilder"]()
|
|
49471
49546
|
.append(this.cssClasses.itemLabel)
|
|
@@ -52900,7 +52975,7 @@ var QuestionRankingModel = /** @class */ (function (_super) {
|
|
|
52900
52975
|
_this.domNode = null;
|
|
52901
52976
|
_this.onVisibleChoicesChanged = function () {
|
|
52902
52977
|
_super.prototype.onVisibleChoicesChanged.call(_this);
|
|
52903
|
-
if (_this.carryForwardStartUnranked && !_this.isValueSetByUser && !_this.selectToRankEnabled) {
|
|
52978
|
+
if (_this.carryForwardStartUnranked && !_this.isValueSetByUser && !_this.selectToRankEnabled && !_this.defaultValue) {
|
|
52904
52979
|
_this.value = [];
|
|
52905
52980
|
}
|
|
52906
52981
|
// ranking question with only one choice doesn't make sense
|
|
@@ -56205,6 +56280,24 @@ var QuestionTextModel = /** @class */ (function (_super) {
|
|
|
56205
56280
|
this._inputValue = this.maskInstance.getMaskedValue(this.value);
|
|
56206
56281
|
}
|
|
56207
56282
|
};
|
|
56283
|
+
QuestionTextModel.prototype.hasToConvertToUTC = function (val) {
|
|
56284
|
+
return _settings__WEBPACK_IMPORTED_MODULE_6__["settings"].storeUtcDates && this.isDateTimeLocaleType() && !!val;
|
|
56285
|
+
};
|
|
56286
|
+
QuestionTextModel.prototype.valueForSurveyCore = function (val) {
|
|
56287
|
+
if (this.hasToConvertToUTC(val)) {
|
|
56288
|
+
val = new Date(val).toISOString();
|
|
56289
|
+
}
|
|
56290
|
+
return _super.prototype.valueForSurveyCore.call(this, val);
|
|
56291
|
+
};
|
|
56292
|
+
QuestionTextModel.prototype.valueFromDataCore = function (val) {
|
|
56293
|
+
if (this.hasToConvertToUTC(val)) {
|
|
56294
|
+
var d = new Date(val);
|
|
56295
|
+
var locale_d = new Date(d.getTime() - d.getTimezoneOffset() * 60 * 1000);
|
|
56296
|
+
var res = locale_d.toISOString();
|
|
56297
|
+
val = res.substring(0, res.length - 2);
|
|
56298
|
+
}
|
|
56299
|
+
return _super.prototype.valueFromDataCore.call(this, val);
|
|
56300
|
+
};
|
|
56208
56301
|
QuestionTextModel.prototype.onCheckForErrors = function (errors, isOnValueChanged) {
|
|
56209
56302
|
var _this = this;
|
|
56210
56303
|
_super.prototype.onCheckForErrors.call(this, errors, isOnValueChanged);
|
|
@@ -56276,11 +56369,14 @@ var QuestionTextModel = /** @class */ (function (_super) {
|
|
|
56276
56369
|
});
|
|
56277
56370
|
Object.defineProperty(QuestionTextModel.prototype, "isDateInputType", {
|
|
56278
56371
|
get: function () {
|
|
56279
|
-
return this.inputType === "date" || this.
|
|
56372
|
+
return this.inputType === "date" || this.isDateTimeLocaleType();
|
|
56280
56373
|
},
|
|
56281
56374
|
enumerable: false,
|
|
56282
56375
|
configurable: true
|
|
56283
56376
|
});
|
|
56377
|
+
QuestionTextModel.prototype.isDateTimeLocaleType = function () {
|
|
56378
|
+
return this.inputType === "datetime-local";
|
|
56379
|
+
};
|
|
56284
56380
|
QuestionTextModel.prototype.getCalculatedMinMax = function (minMax) {
|
|
56285
56381
|
if (this.isValueEmpty(minMax))
|
|
56286
56382
|
return minMax;
|
|
@@ -56332,11 +56428,10 @@ var QuestionTextModel = /** @class */ (function (_super) {
|
|
|
56332
56428
|
return this.maskTypeIsEmpty ? _super.prototype.getIsInputTextUpdate.call(this) : false;
|
|
56333
56429
|
};
|
|
56334
56430
|
QuestionTextModel.prototype.supportGoNextPageAutomatic = function () {
|
|
56335
|
-
return !this.getIsInputTextUpdate() &&
|
|
56336
|
-
["date", "datetime-local"].indexOf(this.inputType) < 0;
|
|
56431
|
+
return !this.getIsInputTextUpdate() && !this.isDateInputType;
|
|
56337
56432
|
};
|
|
56338
56433
|
QuestionTextModel.prototype.supportGoNextPageError = function () {
|
|
56339
|
-
return
|
|
56434
|
+
return !this.isDateInputType;
|
|
56340
56435
|
};
|
|
56341
56436
|
Object.defineProperty(QuestionTextModel.prototype, "dataList", {
|
|
56342
56437
|
/**
|
|
@@ -56377,9 +56472,13 @@ var QuestionTextModel = /** @class */ (function (_super) {
|
|
|
56377
56472
|
QuestionTextModel.prototype.correctValueType = function (newValue) {
|
|
56378
56473
|
if (!newValue)
|
|
56379
56474
|
return newValue;
|
|
56380
|
-
if (this.inputType
|
|
56475
|
+
if (this.inputType === "number" || this.inputType === "range") {
|
|
56381
56476
|
return _helpers__WEBPACK_IMPORTED_MODULE_3__["Helpers"].isNumber(newValue) ? _helpers__WEBPACK_IMPORTED_MODULE_3__["Helpers"].getNumber(newValue) : "";
|
|
56382
56477
|
}
|
|
56478
|
+
if (this.inputType === "month") {
|
|
56479
|
+
var d = new Date(newValue);
|
|
56480
|
+
return d.getFullYear() + "-" + (d.getMonth() + 1);
|
|
56481
|
+
}
|
|
56383
56482
|
return newValue;
|
|
56384
56483
|
};
|
|
56385
56484
|
QuestionTextModel.prototype.hasPlaceholder = function () {
|
|
@@ -57950,7 +58049,8 @@ var settings = {
|
|
|
57950
58049
|
"a": /[a-zA-Z]/,
|
|
57951
58050
|
"#": /[a-zA-Z0-9]/
|
|
57952
58051
|
}
|
|
57953
|
-
}
|
|
58052
|
+
},
|
|
58053
|
+
storeUtcDates: false
|
|
57954
58054
|
};
|
|
57955
58055
|
|
|
57956
58056
|
|
|
@@ -63672,7 +63772,9 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
|
63672
63772
|
});
|
|
63673
63773
|
SurveyModel.prototype.updateActivePage = function () {
|
|
63674
63774
|
var newPage = this.isShowStartingPage ? this.startedPage : this.currentPage;
|
|
63675
|
-
this.
|
|
63775
|
+
if (newPage !== this.activePage) {
|
|
63776
|
+
this.setPropertyValue("activePage", newPage);
|
|
63777
|
+
}
|
|
63676
63778
|
};
|
|
63677
63779
|
SurveyModel.prototype.onStateAndCurrentPageChanged = function () {
|
|
63678
63780
|
this.updateActivePage();
|
|
@@ -64891,7 +64993,7 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
|
64891
64993
|
if (this.isFirstPage || !this.showPrevButton || this.state !== "running")
|
|
64892
64994
|
return false;
|
|
64893
64995
|
var page = this.visiblePages[this.currentPageNo - 1];
|
|
64894
|
-
return
|
|
64996
|
+
return page && page.getMaxTimeToFinish() <= 0;
|
|
64895
64997
|
};
|
|
64896
64998
|
SurveyModel.prototype.calcIsShowNextButton = function () {
|
|
64897
64999
|
return this.state === "running" && !this.isLastPage && !this.canBeCompletedByTrigger;
|
|
@@ -66545,19 +66647,19 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
|
66545
66647
|
this.onLoadingSurveyFromService();
|
|
66546
66648
|
if (clientId) {
|
|
66547
66649
|
this.createSurveyService().getSurveyJsonAndIsCompleted(this.surveyId, this.clientId, function (success, json, isCompleted, response) {
|
|
66548
|
-
self.isLoading = false;
|
|
66549
66650
|
if (success) {
|
|
66550
66651
|
self.isCompletedBefore = isCompleted == "completed";
|
|
66551
66652
|
self.loadSurveyFromServiceJson(json);
|
|
66552
66653
|
}
|
|
66654
|
+
self.isLoading = false;
|
|
66553
66655
|
});
|
|
66554
66656
|
}
|
|
66555
66657
|
else {
|
|
66556
66658
|
this.createSurveyService().loadSurvey(this.surveyId, function (success, result, response) {
|
|
66557
|
-
self.isLoading = false;
|
|
66558
66659
|
if (success) {
|
|
66559
66660
|
self.loadSurveyFromServiceJson(result);
|
|
66560
66661
|
}
|
|
66662
|
+
self.isLoading = false;
|
|
66561
66663
|
});
|
|
66562
66664
|
}
|
|
66563
66665
|
};
|
|
@@ -67661,7 +67763,7 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
|
67661
67763
|
return { spent: 0, limit: 0 };
|
|
67662
67764
|
var pageSpent = page.timeSpent;
|
|
67663
67765
|
var surveySpent = this.timeSpent;
|
|
67664
|
-
var pageLimitSec =
|
|
67766
|
+
var pageLimitSec = page.getMaxTimeToFinish();
|
|
67665
67767
|
var surveyLimit = this.maxTimeToFinish;
|
|
67666
67768
|
if (this.showTimerPanelMode == "page") {
|
|
67667
67769
|
return { spent: pageSpent, limit: pageLimitSec };
|
|
@@ -67690,7 +67792,7 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
|
67690
67792
|
return "";
|
|
67691
67793
|
var pageSpent = this.getDisplayTime(page.timeSpent);
|
|
67692
67794
|
var surveySpent = this.getDisplayTime(this.timeSpent);
|
|
67693
|
-
var pageLimitSec =
|
|
67795
|
+
var pageLimitSec = page.getMaxTimeToFinish();
|
|
67694
67796
|
var pageLimit = this.getDisplayTime(pageLimitSec);
|
|
67695
67797
|
var surveyLimit = this.getDisplayTime(this.maxTimeToFinish);
|
|
67696
67798
|
if (this.showTimerPanelMode == "page")
|
|
@@ -67711,7 +67813,7 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
|
67711
67813
|
return "";
|
|
67712
67814
|
};
|
|
67713
67815
|
SurveyModel.prototype.getTimerInfoPageText = function (page, pageSpent, pageLimit) {
|
|
67714
|
-
return
|
|
67816
|
+
return !!page && page.getMaxTimeToFinish() > 0
|
|
67715
67817
|
? this.getLocalizationFormatString("timerLimitPage", pageSpent, pageLimit)
|
|
67716
67818
|
: this.getLocalizationFormatString("timerSpentPage", pageSpent, pageLimit);
|
|
67717
67819
|
};
|
|
@@ -67836,20 +67938,14 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
|
67836
67938
|
enumerable: false,
|
|
67837
67939
|
configurable: true
|
|
67838
67940
|
});
|
|
67839
|
-
SurveyModel.prototype.getPageMaxTimeToFinish = function (page) {
|
|
67840
|
-
if (!page || page.maxTimeToFinish < 0)
|
|
67841
|
-
return 0;
|
|
67842
|
-
return page.maxTimeToFinish > 0
|
|
67843
|
-
? page.maxTimeToFinish
|
|
67844
|
-
: this.maxTimeToFinishPage;
|
|
67845
|
-
};
|
|
67846
67941
|
SurveyModel.prototype.doTimer = function (page) {
|
|
67847
67942
|
this.onTimer.fire(this, {});
|
|
67848
|
-
if (this.maxTimeToFinish > 0 && this.maxTimeToFinish
|
|
67943
|
+
if (this.maxTimeToFinish > 0 && this.maxTimeToFinish <= this.timeSpent) {
|
|
67944
|
+
this.timeSpent = this.maxTimeToFinish;
|
|
67849
67945
|
this.completeLastPage();
|
|
67850
67946
|
}
|
|
67851
67947
|
if (page) {
|
|
67852
|
-
var pageLimit =
|
|
67948
|
+
var pageLimit = page.getMaxTimeToFinish();
|
|
67853
67949
|
if (pageLimit > 0 && pageLimit == page.timeSpent) {
|
|
67854
67950
|
if (this.isLastPage) {
|
|
67855
67951
|
this.completeLastPage();
|
|
@@ -68232,10 +68328,21 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
|
68232
68328
|
this.disposeCallback();
|
|
68233
68329
|
}
|
|
68234
68330
|
};
|
|
68331
|
+
// private _lastScrollTop = 0;
|
|
68332
|
+
SurveyModel.prototype._isElementShouldBeSticky = function (selector) {
|
|
68333
|
+
if (!selector)
|
|
68334
|
+
return false;
|
|
68335
|
+
var topStickyContainer = this.rootElement.querySelector(selector);
|
|
68336
|
+
if (!!topStickyContainer) {
|
|
68337
|
+
// const scrollDirection = this.rootElement.scrollTop > this._lastScrollTop ? "down" : "up";
|
|
68338
|
+
// this._lastScrollTop = this.rootElement.scrollTop;
|
|
68339
|
+
return this.rootElement.scrollTop > 0 && topStickyContainer.getBoundingClientRect().y <= this.rootElement.getBoundingClientRect().y;
|
|
68340
|
+
}
|
|
68341
|
+
return false;
|
|
68342
|
+
};
|
|
68235
68343
|
SurveyModel.prototype.onScroll = function () {
|
|
68236
68344
|
if (!!this.rootElement) {
|
|
68237
|
-
|
|
68238
|
-
if (!!topStickyContainer && topStickyContainer.getBoundingClientRect().y <= this.rootElement.getBoundingClientRect().y) {
|
|
68345
|
+
if (this._isElementShouldBeSticky(".sv-components-container-center")) {
|
|
68239
68346
|
this.rootElement.classList && this.rootElement.classList.add("sv-root--sticky-top");
|
|
68240
68347
|
}
|
|
68241
68348
|
else {
|
|
@@ -68978,7 +69085,7 @@ var SurveyTimerModel = /** @class */ (function (_super) {
|
|
|
68978
69085
|
this.survey.onCurrentPageChanged.add(function () {
|
|
68979
69086
|
_this.update();
|
|
68980
69087
|
});
|
|
68981
|
-
this.timerFunc = function () { _this.doTimer(); };
|
|
69088
|
+
this.timerFunc = function (sender, options) { _this.doTimer(options.seconds); };
|
|
68982
69089
|
this.setIsRunning(true);
|
|
68983
69090
|
this.update();
|
|
68984
69091
|
_surveytimer__WEBPACK_IMPORTED_MODULE_1__["SurveyTimer"].instance.start(this.timerFunc);
|
|
@@ -69003,12 +69110,16 @@ var SurveyTimerModel = /** @class */ (function (_super) {
|
|
|
69003
69110
|
this.updateText();
|
|
69004
69111
|
this.updateProgress();
|
|
69005
69112
|
};
|
|
69006
|
-
SurveyTimerModel.prototype.doTimer = function () {
|
|
69113
|
+
SurveyTimerModel.prototype.doTimer = function (seconds) {
|
|
69007
69114
|
var page = this.survey.currentPage;
|
|
69008
69115
|
if (page) {
|
|
69009
|
-
|
|
69116
|
+
var pageMaxTime = page.getMaxTimeToFinish();
|
|
69117
|
+
if (pageMaxTime > 0 && pageMaxTime < page.timeSpent + seconds) {
|
|
69118
|
+
seconds = pageMaxTime - page.timeSpent;
|
|
69119
|
+
}
|
|
69120
|
+
page.timeSpent = page.timeSpent + seconds;
|
|
69010
69121
|
}
|
|
69011
|
-
this.spent = this.spent +
|
|
69122
|
+
this.spent = this.spent + seconds;
|
|
69012
69123
|
this.update();
|
|
69013
69124
|
if (this.onTimer) {
|
|
69014
69125
|
this.onTimer(page);
|
|
@@ -69294,13 +69405,14 @@ var surveyTimerFunctions = {
|
|
|
69294
69405
|
else {
|
|
69295
69406
|
return setTimeout(func, delay);
|
|
69296
69407
|
}
|
|
69297
|
-
}
|
|
69408
|
+
},
|
|
69409
|
+
now: function () { return Date.now(); }
|
|
69298
69410
|
};
|
|
69299
69411
|
var SurveyTimer = /** @class */ (function () {
|
|
69300
69412
|
function SurveyTimer() {
|
|
69301
69413
|
this.listenerCounter = 0;
|
|
69302
69414
|
this.timerId = -1;
|
|
69303
|
-
this.onTimer = new _base__WEBPACK_IMPORTED_MODULE_0__["
|
|
69415
|
+
this.onTimer = new _base__WEBPACK_IMPORTED_MODULE_0__["EventBase"]();
|
|
69304
69416
|
}
|
|
69305
69417
|
Object.defineProperty(SurveyTimer, "instance", {
|
|
69306
69418
|
get: function () {
|
|
@@ -69318,6 +69430,7 @@ var SurveyTimer = /** @class */ (function () {
|
|
|
69318
69430
|
if (func) {
|
|
69319
69431
|
this.onTimer.add(func);
|
|
69320
69432
|
}
|
|
69433
|
+
this.prevTimeInMs = surveyTimerFunctions.now();
|
|
69321
69434
|
if (this.timerId < 0) {
|
|
69322
69435
|
this.timerId = surveyTimerFunctions.setTimeout(function () {
|
|
69323
69436
|
_this.doTimer();
|
|
@@ -69343,8 +69456,14 @@ var SurveyTimer = /** @class */ (function () {
|
|
|
69343
69456
|
}
|
|
69344
69457
|
if (this.timerId < 0)
|
|
69345
69458
|
return;
|
|
69459
|
+
var newTimer = surveyTimerFunctions.now();
|
|
69460
|
+
var seconds = Math.floor((newTimer - this.prevTimeInMs) / 1000);
|
|
69461
|
+
this.prevTimeInMs = newTimer;
|
|
69462
|
+
if (seconds < 0) {
|
|
69463
|
+
seconds = 1;
|
|
69464
|
+
}
|
|
69346
69465
|
var prevItem = this.timerId;
|
|
69347
|
-
this.onTimer.fire(this, {});
|
|
69466
|
+
this.onTimer.fire(this, { seconds: seconds });
|
|
69348
69467
|
//We have to check that we have the same timerId
|
|
69349
69468
|
//It could be changed during events execution and it will lead to double timer events
|
|
69350
69469
|
if (prevItem !== this.timerId)
|
|
@@ -71884,7 +72003,7 @@ function navigateToUrl(url) {
|
|
|
71884
72003
|
var location = _global_variables_utils__WEBPACK_IMPORTED_MODULE_3__["DomWindowHelper"].getLocation();
|
|
71885
72004
|
if (!url || !location)
|
|
71886
72005
|
return;
|
|
71887
|
-
location.href = url;
|
|
72006
|
+
location.href = encodeURIComponent(url);
|
|
71888
72007
|
}
|
|
71889
72008
|
function wrapUrlForBackgroundImage(url) {
|
|
71890
72009
|
return !!url ? ["url(", url, ")"].join("") : "";
|