survey-core 1.9.118 → 1.9.120
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 +223 -100
- package/defaultV2.css.map +1 -1
- package/defaultV2.fontless.css +223 -100
- 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 +3 -2
- package/i18n/english.js.map +1 -1
- package/i18n/english.min.js +2 -2
- 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 +2 -2
- package/i18n/hungarian.js.map +1 -1
- package/i18n/hungarian.min.js +2 -2
- package/i18n/icelandic.js +1 -1
- package/i18n/icelandic.min.js +1 -1
- package/i18n/index.js +2 -2
- package/i18n/index.js.map +1 -1
- package/i18n/index.min.js +2 -2
- 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/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 +9 -6
- package/modern.css.map +1 -1
- package/modern.fontless.css +9 -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 +585 -250
- package/survey.core.js.map +1 -1
- package/survey.core.min.js +3 -3
- package/survey.css +1 -1
- package/survey.css.map +1 -1
- package/survey.i18n.js +2 -2
- package/survey.i18n.js.map +1 -1
- package/survey.i18n.min.js +2 -2
- package/survey.min.css +1 -1
- 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 +4 -3
- package/ts3.4/typings/conditionProcessValue.d.ts +1 -0
- package/ts3.4/typings/defaultCss/defaultV2Css.d.ts +9 -3
- package/ts3.4/typings/localization/english.d.ts +1 -0
- package/ts3.4/typings/page.d.ts +1 -0
- package/ts3.4/typings/panel.d.ts +4 -1
- package/ts3.4/typings/question.d.ts +3 -1
- package/ts3.4/typings/question_baseselect.d.ts +1 -1
- package/ts3.4/typings/question_checkbox.d.ts +1 -1
- package/ts3.4/typings/question_expression.d.ts +1 -1
- package/ts3.4/typings/question_file.d.ts +32 -27
- package/ts3.4/typings/question_ranking.d.ts +6 -0
- package/ts3.4/typings/question_rating.d.ts +1 -0
- package/ts3.4/typings/question_signaturepad.d.ts +13 -2
- package/ts3.4/typings/survey-events-api.d.ts +5 -4
- package/ts3.4/typings/survey.d.ts +46 -18
- package/ts3.4/typings/surveyStrings.d.ts +1 -0
- package/ts3.4/typings/surveyTaskManager.d.ts +16 -0
- package/ts3.4/typings/themes.d.ts +2 -2
- package/typings/base-interfaces.d.ts +4 -3
- package/typings/conditionProcessValue.d.ts +1 -0
- package/typings/defaultCss/defaultV2Css.d.ts +9 -3
- package/typings/localization/english.d.ts +1 -0
- package/typings/page.d.ts +1 -0
- package/typings/panel.d.ts +4 -1
- package/typings/question.d.ts +3 -1
- package/typings/question_baseselect.d.ts +1 -1
- package/typings/question_checkbox.d.ts +1 -1
- package/typings/question_expression.d.ts +1 -1
- package/typings/question_file.d.ts +34 -29
- package/typings/question_ranking.d.ts +6 -0
- package/typings/question_rating.d.ts +1 -0
- package/typings/question_signaturepad.d.ts +13 -2
- package/typings/survey-events-api.d.ts +5 -4
- package/typings/survey.d.ts +47 -17
- package/typings/surveyStrings.d.ts +1 -0
- package/typings/surveyTaskManager.d.ts +16 -0
- package/typings/themes.d.ts +2 -2
package/survey.core.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* surveyjs - Survey JavaScript library v1.9.
|
|
2
|
+
* surveyjs - Survey JavaScript library v1.9.120
|
|
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
|
*/
|
|
@@ -2137,7 +2137,7 @@ var Base = /** @class */ (function () {
|
|
|
2137
2137
|
Base.prototype.resetPropertyValue = function (name) {
|
|
2138
2138
|
var locStr = this.localizableStrings ? this.localizableStrings[name] : undefined;
|
|
2139
2139
|
if (locStr) {
|
|
2140
|
-
locStr.
|
|
2140
|
+
locStr.clear();
|
|
2141
2141
|
}
|
|
2142
2142
|
else {
|
|
2143
2143
|
this.setPropertyValue(name, undefined);
|
|
@@ -3969,7 +3969,20 @@ var ProcessValue = /** @class */ (function () {
|
|
|
3969
3969
|
return res;
|
|
3970
3970
|
};
|
|
3971
3971
|
ProcessValue.prototype.getNonNestedObject = function (obj, text, createPath) {
|
|
3972
|
-
var
|
|
3972
|
+
var checkedKeys = new Array();
|
|
3973
|
+
var len = 0;
|
|
3974
|
+
var res = this.getNonNestedObjectCore(obj, text, createPath, checkedKeys);
|
|
3975
|
+
while (!res && len < checkedKeys.length) {
|
|
3976
|
+
len = checkedKeys.length;
|
|
3977
|
+
res = this.getNonNestedObjectCore(obj, text, createPath, checkedKeys);
|
|
3978
|
+
}
|
|
3979
|
+
return res;
|
|
3980
|
+
};
|
|
3981
|
+
ProcessValue.prototype.getNonNestedObjectCore = function (obj, text, createPath, checkedKeys) {
|
|
3982
|
+
var curName = this.getFirstPropertyName(text, obj, createPath, checkedKeys);
|
|
3983
|
+
if (!!curName) {
|
|
3984
|
+
checkedKeys.push(curName);
|
|
3985
|
+
}
|
|
3973
3986
|
var path = !!curName ? [curName] : null;
|
|
3974
3987
|
while (text != curName && !!obj) {
|
|
3975
3988
|
var isArray = text[0] == "[";
|
|
@@ -3992,7 +4005,7 @@ var ProcessValue = /** @class */ (function () {
|
|
|
3992
4005
|
if (!!text && text[0] == ".") {
|
|
3993
4006
|
text = text.substring(1);
|
|
3994
4007
|
}
|
|
3995
|
-
curName = this.getFirstPropertyName(text, obj, createPath);
|
|
4008
|
+
curName = this.getFirstPropertyName(text, obj, createPath, checkedKeys);
|
|
3996
4009
|
if (!!curName) {
|
|
3997
4010
|
path.push(curName);
|
|
3998
4011
|
}
|
|
@@ -4014,8 +4027,9 @@ var ProcessValue = /** @class */ (function () {
|
|
|
4014
4027
|
return null;
|
|
4015
4028
|
return { value: curValue[index], text: text, index: index };
|
|
4016
4029
|
};
|
|
4017
|
-
ProcessValue.prototype.getFirstPropertyName = function (name, obj, createProp) {
|
|
4030
|
+
ProcessValue.prototype.getFirstPropertyName = function (name, obj, createProp, checkedKeys) {
|
|
4018
4031
|
if (createProp === void 0) { createProp = false; }
|
|
4032
|
+
if (checkedKeys === void 0) { checkedKeys = undefined; }
|
|
4019
4033
|
if (!name)
|
|
4020
4034
|
return name;
|
|
4021
4035
|
if (!obj)
|
|
@@ -4026,6 +4040,8 @@ var ProcessValue = /** @class */ (function () {
|
|
|
4026
4040
|
var A = nameInLow[0];
|
|
4027
4041
|
var a = A.toUpperCase();
|
|
4028
4042
|
for (var key in obj) {
|
|
4043
|
+
if (Array.isArray(checkedKeys) && checkedKeys.indexOf(key) > -1)
|
|
4044
|
+
continue;
|
|
4029
4045
|
var first = key[0];
|
|
4030
4046
|
if (first === a || first === A) {
|
|
4031
4047
|
var keyName = key.toLowerCase();
|
|
@@ -4412,7 +4428,7 @@ var modernCss = {
|
|
|
4412
4428
|
header: "sv-title sv-container-modern__title",
|
|
4413
4429
|
headerClose: "sv-container-modern__close",
|
|
4414
4430
|
bodyContainer: "sv-components-row",
|
|
4415
|
-
body: "sv-
|
|
4431
|
+
body: "sv-body",
|
|
4416
4432
|
bodyEmpty: "sv-body sv-body--empty",
|
|
4417
4433
|
footer: "sv-footer sv-body__footer sv-clearfix",
|
|
4418
4434
|
title: "",
|
|
@@ -4867,7 +4883,7 @@ var defaultStandardCss = {
|
|
|
4867
4883
|
container: "sv_container",
|
|
4868
4884
|
header: "sv_header",
|
|
4869
4885
|
bodyContainer: "sv-components-row",
|
|
4870
|
-
body: "
|
|
4886
|
+
body: "sv_body",
|
|
4871
4887
|
bodyEmpty: "sv_body sv_body_empty",
|
|
4872
4888
|
footer: "sv_nav",
|
|
4873
4889
|
title: "",
|
|
@@ -5307,7 +5323,7 @@ var defaultV2Css = {
|
|
|
5307
5323
|
container: "sd-container-modern",
|
|
5308
5324
|
header: "sd-title sd-container-modern__title",
|
|
5309
5325
|
bodyContainer: "sv-components-row",
|
|
5310
|
-
body: "
|
|
5326
|
+
body: "sd-body",
|
|
5311
5327
|
bodyWithTimer: "sd-body--with-timer",
|
|
5312
5328
|
clockTimerRoot: "sd-timer",
|
|
5313
5329
|
clockTimerRootTop: "sd-timer--top",
|
|
@@ -5365,7 +5381,8 @@ var defaultV2Css = {
|
|
|
5365
5381
|
nested: "sd-element--nested sd-element--nested-with-borders",
|
|
5366
5382
|
invisible: "sd-element--invisible",
|
|
5367
5383
|
navigationButton: "",
|
|
5368
|
-
compact: "sd-element--with-frame sd-element--compact"
|
|
5384
|
+
compact: "sd-element--with-frame sd-element--compact",
|
|
5385
|
+
errorsContainer: "sd-panel__errbox sd-element__erbox sd-element__erbox--above-element"
|
|
5369
5386
|
},
|
|
5370
5387
|
paneldynamic: {
|
|
5371
5388
|
mainRoot: "sd-element sd-question sd-question--paneldynamic sd-element--complex sd-question--complex sd-row__question",
|
|
@@ -5431,7 +5448,8 @@ var defaultV2Css = {
|
|
|
5431
5448
|
root: "sd-page sd-body__page",
|
|
5432
5449
|
emptyHeaderRoot: "sd-page__empty-header",
|
|
5433
5450
|
title: "sd-title sd-page__title",
|
|
5434
|
-
description: "sd-description sd-page__description"
|
|
5451
|
+
description: "sd-description sd-page__description",
|
|
5452
|
+
errorsContainer: "sd-page__errbox"
|
|
5435
5453
|
},
|
|
5436
5454
|
pageTitle: "sd-title sd-page__title",
|
|
5437
5455
|
pageDescription: "sd-description sd-page__description",
|
|
@@ -5486,6 +5504,9 @@ var defaultV2Css = {
|
|
|
5486
5504
|
invisible: "sd-element--invisible",
|
|
5487
5505
|
composite: "sd-element--complex",
|
|
5488
5506
|
disabled: "sd-question--disabled",
|
|
5507
|
+
errorsContainer: "sd-element__erbox sd-question__erbox",
|
|
5508
|
+
errorsContainerTop: "sd-element__erbox--above-element sd-question__erbox--above-question",
|
|
5509
|
+
errorsContainerBottom: "sd-question__erbox--below-question"
|
|
5489
5510
|
},
|
|
5490
5511
|
image: {
|
|
5491
5512
|
mainRoot: "sd-question sd-question--image",
|
|
@@ -5502,14 +5523,11 @@ var defaultV2Css = {
|
|
|
5502
5523
|
withFrame: ""
|
|
5503
5524
|
},
|
|
5504
5525
|
error: {
|
|
5505
|
-
root: "sd-
|
|
5526
|
+
root: "sd-error",
|
|
5506
5527
|
icon: "",
|
|
5507
5528
|
item: "",
|
|
5508
|
-
|
|
5509
|
-
|
|
5510
|
-
belowQuestion: "sd-question__erbox--below-question",
|
|
5511
|
-
locationTop: "sd-question__erbox--location--top",
|
|
5512
|
-
locationBottom: "sd-question__erbox--location--bottom"
|
|
5529
|
+
locationTop: "",
|
|
5530
|
+
locationBottom: ""
|
|
5513
5531
|
},
|
|
5514
5532
|
checkbox: {
|
|
5515
5533
|
root: "sd-selectbase",
|
|
@@ -5728,6 +5746,8 @@ var defaultV2Css = {
|
|
|
5728
5746
|
rowHasEndActions: "sd-table__row--has-end-actions",
|
|
5729
5747
|
headerCell: "sd-table__cell sd-table__cell--header",
|
|
5730
5748
|
rowTextCell: "sd-table__cell sd-table__cell--row-text",
|
|
5749
|
+
footerCell: "sd-table__cell sd-table__cell--footer",
|
|
5750
|
+
footerTotalCell: "sd-table__cell sd-table__cell--footer-total",
|
|
5731
5751
|
columnTitleCell: "sd-table__cell--column-title",
|
|
5732
5752
|
cellRequiredText: "sd-question__required-text",
|
|
5733
5753
|
detailButton: "sd-table__cell--detail-button",
|
|
@@ -5763,6 +5783,7 @@ var defaultV2Css = {
|
|
|
5763
5783
|
itemCell: "sd-table__cell--item",
|
|
5764
5784
|
headerCell: "sd-table__cell sd-table__cell--header",
|
|
5765
5785
|
rowTextCell: "sd-table__cell sd-table__cell--row-text",
|
|
5786
|
+
footerCell: "sd-table__cell sd-table__cell--footer",
|
|
5766
5787
|
columnTitleCell: "sd-table__cell--column-title",
|
|
5767
5788
|
cellRequiredText: "sd-question__required-text",
|
|
5768
5789
|
button: "sd-action sd-matrixdynamic__btn",
|
|
@@ -5909,7 +5930,8 @@ var defaultV2Css = {
|
|
|
5909
5930
|
canvas: "sjs_sp_canvas sd-signaturepad__canvas",
|
|
5910
5931
|
backgroundImage: "sjs_sp__background-image sd-signaturepad__background-image",
|
|
5911
5932
|
clearButton: "sjs_sp_clear sd-context-btn sd-context-btn--negative sd-signaturepad__clear",
|
|
5912
|
-
clearButtonIconId: "icon-clear"
|
|
5933
|
+
clearButtonIconId: "icon-clear",
|
|
5934
|
+
loadingIndicator: "sd-signaturepad__loading-indicator"
|
|
5913
5935
|
},
|
|
5914
5936
|
saveData: {
|
|
5915
5937
|
root: "sv-save-data_root",
|
|
@@ -8233,8 +8255,13 @@ var DropdownListModel = /** @class */ (function (_super) {
|
|
|
8233
8255
|
this.popupModel.isVisible = false;
|
|
8234
8256
|
}
|
|
8235
8257
|
else if (!this.popupModel.isVisible && (event.keyCode === 13 || event.keyCode === 32)) {
|
|
8236
|
-
|
|
8237
|
-
|
|
8258
|
+
if (event.keyCode === 32) {
|
|
8259
|
+
this.popupModel.toggleVisibility();
|
|
8260
|
+
this.changeSelectionWithKeyboard(false);
|
|
8261
|
+
}
|
|
8262
|
+
if (event.keyCode === 13) {
|
|
8263
|
+
this.question.survey.questionEditFinishCallback(this.question, event);
|
|
8264
|
+
}
|
|
8238
8265
|
event.preventDefault();
|
|
8239
8266
|
event.stopPropagation();
|
|
8240
8267
|
}
|
|
@@ -8242,12 +8269,10 @@ var DropdownListModel = /** @class */ (function (_super) {
|
|
|
8242
8269
|
if (event.keyCode === 13 && this.question.searchEnabled && !this.inputString && this.question instanceof _question_dropdown__WEBPACK_IMPORTED_MODULE_5__["QuestionDropdownModel"] && !this._markdownMode && this.question.value) {
|
|
8243
8270
|
this._popupModel.isVisible = false;
|
|
8244
8271
|
this.onClear(event);
|
|
8245
|
-
this.question.survey.questionEditFinishCallback(this.question, event);
|
|
8246
8272
|
}
|
|
8247
8273
|
else {
|
|
8248
8274
|
this.listModel.selectFocusedItem();
|
|
8249
8275
|
this.onFocus(event);
|
|
8250
|
-
this.question.survey.questionEditFinishCallback(this.question, event);
|
|
8251
8276
|
}
|
|
8252
8277
|
event.preventDefault();
|
|
8253
8278
|
event.stopPropagation();
|
|
@@ -9287,8 +9312,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
9287
9312
|
//import "../../modern.scss";
|
|
9288
9313
|
var Version;
|
|
9289
9314
|
var ReleaseDate;
|
|
9290
|
-
Version = "" + "1.9.
|
|
9291
|
-
ReleaseDate = "" + "2023-
|
|
9315
|
+
Version = "" + "1.9.120";
|
|
9316
|
+
ReleaseDate = "" + "2023-12-04";
|
|
9292
9317
|
function checkLibraryVersion(ver, libraryName) {
|
|
9293
9318
|
if (Version != ver) {
|
|
9294
9319
|
var str = "survey-core has version '" + Version + "' and " + libraryName
|
|
@@ -15545,7 +15570,7 @@ var Cover = /** @class */ (function (_super) {
|
|
|
15545
15570
|
|
|
15546
15571
|
_jsonobject__WEBPACK_IMPORTED_MODULE_1__["Serializer"].addClass("cover", [
|
|
15547
15572
|
{ name: "height:number", minValue: 0, default: 256 },
|
|
15548
|
-
{ name: "inheritWidthFrom", default: "
|
|
15573
|
+
{ name: "inheritWidthFrom", default: "container" },
|
|
15549
15574
|
{ name: "textAreaWidth:number", minValue: 0, default: 512 },
|
|
15550
15575
|
{ name: "textGlowEnabled:boolean" },
|
|
15551
15576
|
{ name: "overlapEnabled:boolean" },
|
|
@@ -20229,7 +20254,7 @@ var englishStrings = {
|
|
|
20229
20254
|
panelDynamicProgressText: "{0} of {1}",
|
|
20230
20255
|
panelDynamicTabTextFormat: "Panel {panelIndex}",
|
|
20231
20256
|
questionsProgressText: "Answered {0}/{1} questions",
|
|
20232
|
-
emptySurvey: "The survey doesn't contain visible
|
|
20257
|
+
emptySurvey: "The survey doesn't contain any visible elements.",
|
|
20233
20258
|
completingSurvey: "Thank you for completing the survey",
|
|
20234
20259
|
completingSurveyBefore: "Our records show that you have already completed this survey.",
|
|
20235
20260
|
loadingSurvey: "Loading Survey...",
|
|
@@ -20256,6 +20281,7 @@ var englishStrings = {
|
|
|
20256
20281
|
urlRequestError: "The request returned error '{0}'. {1}",
|
|
20257
20282
|
urlGetChoicesError: "The request returned empty data or the 'path' property is incorrect",
|
|
20258
20283
|
exceedMaxSize: "The file size should not exceed {0}.",
|
|
20284
|
+
noUploadFilesHandler: "Files cannot be uploaded. Please add a handler for the 'onUploadFiles' event.",
|
|
20259
20285
|
otherRequiredError: "Response required: enter another value.",
|
|
20260
20286
|
uploadingFile: "Your file is uploading. Please wait several seconds and try again.",
|
|
20261
20287
|
loadingFile: "Loading...",
|
|
@@ -21143,8 +21169,9 @@ var PageModel = /** @class */ (function (_super) {
|
|
|
21143
21169
|
configurable: true
|
|
21144
21170
|
});
|
|
21145
21171
|
PageModel.prototype.calcCssClasses = function (css) {
|
|
21146
|
-
var classes = { page: {}, pageTitle: "", pageDescription: "", row: "", rowMultiple: "", pageRow: "", rowCompact: "" };
|
|
21172
|
+
var classes = { page: {}, error: {}, pageTitle: "", pageDescription: "", row: "", rowMultiple: "", pageRow: "", rowCompact: "" };
|
|
21147
21173
|
this.copyCssClasses(classes.page, css.page);
|
|
21174
|
+
this.copyCssClasses(classes.error, css.error);
|
|
21148
21175
|
if (!!css.pageTitle) {
|
|
21149
21176
|
classes.pageTitle = css.pageTitle;
|
|
21150
21177
|
}
|
|
@@ -21192,6 +21219,11 @@ var PageModel = /** @class */ (function (_super) {
|
|
|
21192
21219
|
enumerable: false,
|
|
21193
21220
|
configurable: true
|
|
21194
21221
|
});
|
|
21222
|
+
PageModel.prototype.getCssError = function (cssClasses) {
|
|
21223
|
+
return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_2__["CssClassBuilder"]()
|
|
21224
|
+
.append(_super.prototype.getCssError.call(this, cssClasses))
|
|
21225
|
+
.append(cssClasses.page.errorsContainer).toString();
|
|
21226
|
+
};
|
|
21195
21227
|
Object.defineProperty(PageModel.prototype, "navigationButtonsVisibility", {
|
|
21196
21228
|
/**
|
|
21197
21229
|
* Set this property to "hide" to make "Prev", "Next" and "Complete" buttons are invisible for this page. Set this property to "show" to make these buttons visible, even if survey showNavigationButtons property is false.
|
|
@@ -21688,7 +21720,7 @@ var PanelModelBase = /** @class */ (function (_super) {
|
|
|
21688
21720
|
Object.defineProperty(PanelModelBase.prototype, "hasTitle", {
|
|
21689
21721
|
get: function () {
|
|
21690
21722
|
return ((this.canShowTitle() && this.locTitle.textOrHtml.length > 0) ||
|
|
21691
|
-
(this.
|
|
21723
|
+
(this.isDesignMode && (this.showTitle && _settings__WEBPACK_IMPORTED_MODULE_7__["settings"].designMode.showEmptyTitles)));
|
|
21692
21724
|
},
|
|
21693
21725
|
enumerable: false,
|
|
21694
21726
|
configurable: true
|
|
@@ -23036,6 +23068,16 @@ var PanelModelBase = /** @class */ (function (_super) {
|
|
|
23036
23068
|
enumerable: false,
|
|
23037
23069
|
configurable: true
|
|
23038
23070
|
});
|
|
23071
|
+
Object.defineProperty(PanelModelBase.prototype, "cssError", {
|
|
23072
|
+
get: function () {
|
|
23073
|
+
return this.getCssError(this.cssClasses);
|
|
23074
|
+
},
|
|
23075
|
+
enumerable: false,
|
|
23076
|
+
configurable: true
|
|
23077
|
+
});
|
|
23078
|
+
PanelModelBase.prototype.getCssError = function (cssClasses) {
|
|
23079
|
+
return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_9__["CssClassBuilder"]().append(cssClasses.error.root).toString();
|
|
23080
|
+
};
|
|
23039
23081
|
PanelModelBase.prototype.dispose = function () {
|
|
23040
23082
|
_super.prototype.dispose.call(this);
|
|
23041
23083
|
if (this.rows) {
|
|
@@ -23234,11 +23276,17 @@ var PanelModel = /** @class */ (function (_super) {
|
|
|
23234
23276
|
PanelModel.prototype.setNo = function (visibleIndex) {
|
|
23235
23277
|
this.setPropertyValue("no", _helpers__WEBPACK_IMPORTED_MODULE_1__["Helpers"].getNumberByIndex(this.visibleIndex, this.getStartIndex()));
|
|
23236
23278
|
};
|
|
23279
|
+
PanelModel.prototype.notifyStateChanged = function () {
|
|
23280
|
+
if (!this.isLoadingFromJson) {
|
|
23281
|
+
this.locTitle.strChanged();
|
|
23282
|
+
}
|
|
23283
|
+
_super.prototype.notifyStateChanged.call(this);
|
|
23284
|
+
};
|
|
23237
23285
|
PanelModel.prototype.createLocTitleProperty = function () {
|
|
23238
23286
|
var _this = this;
|
|
23239
23287
|
var locTitleValue = _super.prototype.createLocTitleProperty.call(this);
|
|
23240
23288
|
locTitleValue.onGetTextCallback = function (text) {
|
|
23241
|
-
if (!text && (_this.
|
|
23289
|
+
if (!text && (_this.state !== "default")) {
|
|
23242
23290
|
text = _this.name;
|
|
23243
23291
|
}
|
|
23244
23292
|
return text;
|
|
@@ -23411,26 +23459,17 @@ var PanelModel = /** @class */ (function (_super) {
|
|
|
23411
23459
|
enumerable: false,
|
|
23412
23460
|
configurable: true
|
|
23413
23461
|
});
|
|
23414
|
-
Object.defineProperty(PanelModel.prototype, "cssError", {
|
|
23415
|
-
get: function () {
|
|
23416
|
-
return this.getCssError(this.cssClasses);
|
|
23417
|
-
},
|
|
23418
|
-
enumerable: false,
|
|
23419
|
-
configurable: true
|
|
23420
|
-
});
|
|
23421
23462
|
Object.defineProperty(PanelModel.prototype, "showErrorsAbovePanel", {
|
|
23422
23463
|
get: function () {
|
|
23423
|
-
return this.isDefaultV2Theme;
|
|
23464
|
+
return this.isDefaultV2Theme && !this.showPanelAsPage;
|
|
23424
23465
|
},
|
|
23425
23466
|
enumerable: false,
|
|
23426
23467
|
configurable: true
|
|
23427
23468
|
});
|
|
23428
23469
|
PanelModel.prototype.getCssError = function (cssClasses) {
|
|
23429
|
-
var isDefaultV2Theme = this.isDefaultV2Theme;
|
|
23430
23470
|
var builder = new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_9__["CssClassBuilder"]()
|
|
23431
|
-
.append(
|
|
23432
|
-
.append(
|
|
23433
|
-
.append(this.cssClasses.error.aboveQuestion, isDefaultV2Theme);
|
|
23471
|
+
.append(_super.prototype.getCssError.call(this, cssClasses))
|
|
23472
|
+
.append(cssClasses.panel.errorsContainer);
|
|
23434
23473
|
return builder.append("panel-error-root", builder.isEmpty()).toString();
|
|
23435
23474
|
};
|
|
23436
23475
|
PanelModel.prototype.onVisibleChanged = function () {
|
|
@@ -23451,16 +23490,23 @@ var PanelModel = /** @class */ (function (_super) {
|
|
|
23451
23490
|
this.survey.whenPanelFocusIn(this);
|
|
23452
23491
|
};
|
|
23453
23492
|
PanelModel.prototype.getHasFrameV2 = function () {
|
|
23454
|
-
return _super.prototype.getHasFrameV2.call(this) &&
|
|
23493
|
+
return _super.prototype.getHasFrameV2.call(this) && !this.showPanelAsPage;
|
|
23455
23494
|
};
|
|
23456
23495
|
PanelModel.prototype.getIsNested = function () {
|
|
23457
23496
|
return _super.prototype.getIsNested.call(this) && this.parent !== undefined;
|
|
23458
23497
|
};
|
|
23498
|
+
Object.defineProperty(PanelModel.prototype, "showPanelAsPage", {
|
|
23499
|
+
get: function () {
|
|
23500
|
+
return !!this.originalPage && !this.survey.isShowingPreview;
|
|
23501
|
+
},
|
|
23502
|
+
enumerable: false,
|
|
23503
|
+
configurable: true
|
|
23504
|
+
});
|
|
23459
23505
|
PanelModel.prototype.getCssRoot = function (cssClasses) {
|
|
23460
23506
|
return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_9__["CssClassBuilder"]()
|
|
23461
23507
|
.append(_super.prototype.getCssRoot.call(this, cssClasses))
|
|
23462
23508
|
.append(cssClasses.container)
|
|
23463
|
-
.append(cssClasses.asPage,
|
|
23509
|
+
.append(cssClasses.asPage, this.showPanelAsPage)
|
|
23464
23510
|
.append(cssClasses.invisible, !this.isDesignMode && this.areInvisibleElementsShowing && !this.visible)
|
|
23465
23511
|
.toString();
|
|
23466
23512
|
};
|
|
@@ -26183,9 +26229,9 @@ var Question = /** @class */ (function (_super) {
|
|
|
26183
26229
|
Question.prototype.getCssError = function (cssClasses) {
|
|
26184
26230
|
return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_10__["CssClassBuilder"]()
|
|
26185
26231
|
.append(cssClasses.error.root)
|
|
26186
|
-
.append(cssClasses.
|
|
26187
|
-
.append(cssClasses.
|
|
26188
|
-
.append(cssClasses.
|
|
26232
|
+
.append(cssClasses.errorsContainer, this.showErrorsBelowQuestion || this.showErrorsAboveQuestion)
|
|
26233
|
+
.append(cssClasses.errorsContainerTop, this.showErrorsAboveQuestion)
|
|
26234
|
+
.append(cssClasses.errorsContainerBottom, this.showErrorsBelowQuestion)
|
|
26189
26235
|
.append(cssClasses.error.locationTop, this.showErrorOnTop)
|
|
26190
26236
|
.append(cssClasses.error.locationBottom, this.showErrorOnBottom)
|
|
26191
26237
|
.toString();
|
|
@@ -26912,6 +26958,8 @@ var Question = /** @class */ (function (_super) {
|
|
|
26912
26958
|
* - `{row.other_question_name}` (to access questions inside the same dynamic matrix or multi-column dropdown)
|
|
26913
26959
|
*
|
|
26914
26960
|
* An expression can also include built-in and custom functions for advanced calculations. For example, if the `defaultValue` should be today's date, set the `defaultValueExpression` to `"today()"`, and the corresponding built-in function will be executed each time the survey is loaded. Refer to the following help topic for more information: [Built-In Functions](https://surveyjs.io/form-library/documentation/design-survey-conditional-logic#built-in-functions).
|
|
26961
|
+
*
|
|
26962
|
+
* [View Demo](https://surveyjs.io/form-library/examples/specify-default-question-value-dynamically (linkStyle))
|
|
26915
26963
|
* @see defaultValue
|
|
26916
26964
|
* @see setValueExpression
|
|
26917
26965
|
*/
|
|
@@ -27602,8 +27650,9 @@ var Question = /** @class */ (function (_super) {
|
|
|
27602
27650
|
return makeNameValid(name);
|
|
27603
27651
|
};
|
|
27604
27652
|
//IQuestion
|
|
27605
|
-
Question.prototype.updateValueFromSurvey = function (newValue) {
|
|
27653
|
+
Question.prototype.updateValueFromSurvey = function (newValue, clearData) {
|
|
27606
27654
|
var _this = this;
|
|
27655
|
+
if (clearData === void 0) { clearData = false; }
|
|
27607
27656
|
newValue = this.getUnbindValue(newValue);
|
|
27608
27657
|
if (!!this.valueFromDataCallback) {
|
|
27609
27658
|
newValue = this.valueFromDataCallback(newValue);
|
|
@@ -27617,7 +27666,10 @@ var Question = /** @class */ (function (_super) {
|
|
|
27617
27666
|
});
|
|
27618
27667
|
}
|
|
27619
27668
|
else {
|
|
27620
|
-
this.updateValueFromSurveyCore(newValue,
|
|
27669
|
+
this.updateValueFromSurveyCore(newValue, this.data !== this.getSurvey());
|
|
27670
|
+
if (clearData && isEmpty) {
|
|
27671
|
+
this.isValueChangedDirectly = false;
|
|
27672
|
+
}
|
|
27621
27673
|
}
|
|
27622
27674
|
this.updateDependedQuestions();
|
|
27623
27675
|
this.updateIsAnswered();
|
|
@@ -29764,7 +29816,7 @@ var QuestionSelectBase = /** @class */ (function (_super) {
|
|
|
29764
29816
|
this.onVisibleChoicesChanged();
|
|
29765
29817
|
}
|
|
29766
29818
|
};
|
|
29767
|
-
QuestionSelectBase.prototype.updateValueFromSurvey = function (newValue) {
|
|
29819
|
+
QuestionSelectBase.prototype.updateValueFromSurvey = function (newValue, clearData) {
|
|
29768
29820
|
var newComment = "";
|
|
29769
29821
|
if (this.hasOther &&
|
|
29770
29822
|
!this.isRunningChoices &&
|
|
@@ -29778,7 +29830,7 @@ var QuestionSelectBase = /** @class */ (function (_super) {
|
|
|
29778
29830
|
newComment = this.data.getComment(this.getValueName());
|
|
29779
29831
|
}
|
|
29780
29832
|
}
|
|
29781
|
-
_super.prototype.updateValueFromSurvey.call(this, newValue);
|
|
29833
|
+
_super.prototype.updateValueFromSurvey.call(this, newValue, clearData);
|
|
29782
29834
|
if ((this.isRunningChoices || this.choicesByUrl.isRunning) && !this.isEmpty()) {
|
|
29783
29835
|
this.cachedValueForUrlRequests = this.value;
|
|
29784
29836
|
}
|
|
@@ -31560,8 +31612,8 @@ var QuestionCheckboxModel = /** @class */ (function (_super) {
|
|
|
31560
31612
|
.append(this.cssClasses.itemSelectAll, options.isSelectAllItem)
|
|
31561
31613
|
.toString();
|
|
31562
31614
|
};
|
|
31563
|
-
QuestionCheckboxModel.prototype.updateValueFromSurvey = function (newValue) {
|
|
31564
|
-
_super.prototype.updateValueFromSurvey.call(this, newValue);
|
|
31615
|
+
QuestionCheckboxModel.prototype.updateValueFromSurvey = function (newValue, clearData) {
|
|
31616
|
+
_super.prototype.updateValueFromSurvey.call(this, newValue, clearData);
|
|
31565
31617
|
this.invisibleOldValues = {};
|
|
31566
31618
|
};
|
|
31567
31619
|
QuestionCheckboxModel.prototype.setDefaultValue = function () {
|
|
@@ -33779,8 +33831,8 @@ var QuestionExpressionModel = /** @class */ (function (_super) {
|
|
|
33779
33831
|
QuestionExpressionModel.prototype.onValueChanged = function () {
|
|
33780
33832
|
this.updateFormatedValue();
|
|
33781
33833
|
};
|
|
33782
|
-
QuestionExpressionModel.prototype.updateValueFromSurvey = function (newValue) {
|
|
33783
|
-
_super.prototype.updateValueFromSurvey.call(this, newValue);
|
|
33834
|
+
QuestionExpressionModel.prototype.updateValueFromSurvey = function (newValue, clearData) {
|
|
33835
|
+
_super.prototype.updateValueFromSurvey.call(this, newValue, clearData);
|
|
33784
33836
|
this.updateFormatedValue();
|
|
33785
33837
|
};
|
|
33786
33838
|
QuestionExpressionModel.prototype.getDisplayValueCore = function (keysAsText, value) {
|
|
@@ -34134,11 +34186,13 @@ _questionfactory__WEBPACK_IMPORTED_MODULE_3__["QuestionFactory"].Instance.regist
|
|
|
34134
34186
|
/*!******************************!*\
|
|
34135
34187
|
!*** ./src/question_file.ts ***!
|
|
34136
34188
|
\******************************/
|
|
34137
|
-
/*! exports provided: QuestionFileModel, FileLoader */
|
|
34189
|
+
/*! exports provided: dataUrl2File, QuestionFileModelBase, QuestionFileModel, FileLoader */
|
|
34138
34190
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
34139
34191
|
|
|
34140
34192
|
"use strict";
|
|
34141
34193
|
__webpack_require__.r(__webpack_exports__);
|
|
34194
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dataUrl2File", function() { return dataUrl2File; });
|
|
34195
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "QuestionFileModelBase", function() { return QuestionFileModelBase; });
|
|
34142
34196
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "QuestionFileModel", function() { return QuestionFileModel; });
|
|
34143
34197
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FileLoader", function() { return FileLoader; });
|
|
34144
34198
|
/* harmony import */ var _question__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./question */ "./src/question.ts");
|
|
@@ -34187,17 +34241,16 @@ var __decorate = (undefined && undefined.__decorate) || function (decorators, ta
|
|
|
34187
34241
|
|
|
34188
34242
|
|
|
34189
34243
|
|
|
34190
|
-
|
|
34191
|
-
|
|
34192
|
-
|
|
34193
|
-
|
|
34194
|
-
|
|
34195
|
-
var
|
|
34196
|
-
__extends(
|
|
34197
|
-
function
|
|
34198
|
-
var _this = _super.
|
|
34244
|
+
function dataUrl2File(dataUrl, fileName, type) {
|
|
34245
|
+
var str = atob(dataUrl.split(",")[1]);
|
|
34246
|
+
var buffer = new Uint8Array(str.split("").map(function (c) { return c.charCodeAt(0); })).buffer;
|
|
34247
|
+
return new File([buffer], fileName, { type: type });
|
|
34248
|
+
}
|
|
34249
|
+
var QuestionFileModelBase = /** @class */ (function (_super) {
|
|
34250
|
+
__extends(QuestionFileModelBase, _super);
|
|
34251
|
+
function QuestionFileModelBase() {
|
|
34252
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
34199
34253
|
_this.isUploading = false;
|
|
34200
|
-
_this.isDragging = false;
|
|
34201
34254
|
/**
|
|
34202
34255
|
* An event that is raised after the upload state has changed.
|
|
34203
34256
|
*
|
|
@@ -34210,6 +34263,124 @@ var QuestionFileModel = /** @class */ (function (_super) {
|
|
|
34210
34263
|
*/
|
|
34211
34264
|
_this.onUploadStateChanged = _this.addEvent();
|
|
34212
34265
|
_this.onStateChanged = _this.addEvent();
|
|
34266
|
+
return _this;
|
|
34267
|
+
}
|
|
34268
|
+
QuestionFileModelBase.prototype.stateChanged = function (state) {
|
|
34269
|
+
if (this.currentState == state) {
|
|
34270
|
+
return;
|
|
34271
|
+
}
|
|
34272
|
+
if (state === "loading") {
|
|
34273
|
+
this.isUploading = true;
|
|
34274
|
+
}
|
|
34275
|
+
if (state === "loaded") {
|
|
34276
|
+
this.isUploading = false;
|
|
34277
|
+
}
|
|
34278
|
+
if (state === "error") {
|
|
34279
|
+
this.isUploading = false;
|
|
34280
|
+
}
|
|
34281
|
+
this.currentState = state;
|
|
34282
|
+
this.onStateChanged.fire(this, { state: state });
|
|
34283
|
+
this.onUploadStateChanged.fire(this, { state: state });
|
|
34284
|
+
};
|
|
34285
|
+
Object.defineProperty(QuestionFileModelBase.prototype, "showLoadingIndicator", {
|
|
34286
|
+
get: function () {
|
|
34287
|
+
return this.isUploading && this.isDefaultV2Theme;
|
|
34288
|
+
},
|
|
34289
|
+
enumerable: false,
|
|
34290
|
+
configurable: true
|
|
34291
|
+
});
|
|
34292
|
+
Object.defineProperty(QuestionFileModelBase.prototype, "storeDataAsText", {
|
|
34293
|
+
/**
|
|
34294
|
+
* Specifies whether to store file or signature content as text in `SurveyModel`'s [`data`](https://surveyjs.io/form-library/documentation/surveymodel#data) property.
|
|
34295
|
+
*
|
|
34296
|
+
* If you disable this property, implement `SurveyModel`'s [`onUploadFiles`](https://surveyjs.io/form-library/documentation/surveymodel#onUploadFiles) event handler to specify how to store file content.
|
|
34297
|
+
*/
|
|
34298
|
+
get: function () {
|
|
34299
|
+
return this.getPropertyValue("storeDataAsText");
|
|
34300
|
+
},
|
|
34301
|
+
set: function (val) {
|
|
34302
|
+
this.setPropertyValue("storeDataAsText", val);
|
|
34303
|
+
},
|
|
34304
|
+
enumerable: false,
|
|
34305
|
+
configurable: true
|
|
34306
|
+
});
|
|
34307
|
+
Object.defineProperty(QuestionFileModelBase.prototype, "waitForUpload", {
|
|
34308
|
+
/**
|
|
34309
|
+
* Enable this property if you want to wait until files are uploaded to complete the survey.
|
|
34310
|
+
*
|
|
34311
|
+
* Default value: `false`
|
|
34312
|
+
*/
|
|
34313
|
+
get: function () {
|
|
34314
|
+
return this.getPropertyValue("waitForUpload");
|
|
34315
|
+
},
|
|
34316
|
+
set: function (val) {
|
|
34317
|
+
this.setPropertyValue("waitForUpload", val);
|
|
34318
|
+
},
|
|
34319
|
+
enumerable: false,
|
|
34320
|
+
configurable: true
|
|
34321
|
+
});
|
|
34322
|
+
QuestionFileModelBase.prototype.clearValue = function () {
|
|
34323
|
+
this.clearOnDeletingContainer();
|
|
34324
|
+
_super.prototype.clearValue.call(this);
|
|
34325
|
+
};
|
|
34326
|
+
QuestionFileModelBase.prototype.clearOnDeletingContainer = function () {
|
|
34327
|
+
if (!this.survey)
|
|
34328
|
+
return;
|
|
34329
|
+
this.survey.clearFiles(this, this.name, this.value, null, function () { });
|
|
34330
|
+
};
|
|
34331
|
+
QuestionFileModelBase.prototype.onCheckForErrors = function (errors, isOnValueChanged) {
|
|
34332
|
+
_super.prototype.onCheckForErrors.call(this, errors, isOnValueChanged);
|
|
34333
|
+
if (this.isUploading && this.waitForUpload) {
|
|
34334
|
+
errors.push(new _error__WEBPACK_IMPORTED_MODULE_4__["UploadingFileError"](this.getLocalizationString("uploadingFile"), this));
|
|
34335
|
+
}
|
|
34336
|
+
};
|
|
34337
|
+
QuestionFileModelBase.prototype.uploadFiles = function (files) {
|
|
34338
|
+
var _this = this;
|
|
34339
|
+
if (this.survey) {
|
|
34340
|
+
this.stateChanged("loading");
|
|
34341
|
+
this.survey.uploadFiles(this, this.name, files, function (arg1, arg2) {
|
|
34342
|
+
if (Array.isArray(arg1)) {
|
|
34343
|
+
_this.setValueFromResult(arg1);
|
|
34344
|
+
if (Array.isArray(arg2)) {
|
|
34345
|
+
arg2.forEach(function (error) { return _this.errors.push(new _error__WEBPACK_IMPORTED_MODULE_4__["UploadingFileError"](error, _this)); });
|
|
34346
|
+
_this.stateChanged("error");
|
|
34347
|
+
}
|
|
34348
|
+
}
|
|
34349
|
+
if (arg1 === "success" && Array.isArray(arg2)) {
|
|
34350
|
+
_this.setValueFromResult(arg2);
|
|
34351
|
+
}
|
|
34352
|
+
if (arg1 === "error") {
|
|
34353
|
+
if (typeof (arg2) === "string") {
|
|
34354
|
+
_this.errors.push(new _error__WEBPACK_IMPORTED_MODULE_4__["UploadingFileError"](arg2, _this));
|
|
34355
|
+
}
|
|
34356
|
+
if (Array.isArray(arg2) && arg2.length > 0) {
|
|
34357
|
+
arg2.forEach(function (error) { return _this.errors.push(new _error__WEBPACK_IMPORTED_MODULE_4__["UploadingFileError"](error, _this)); });
|
|
34358
|
+
}
|
|
34359
|
+
_this.stateChanged("error");
|
|
34360
|
+
}
|
|
34361
|
+
_this.stateChanged("loaded");
|
|
34362
|
+
});
|
|
34363
|
+
}
|
|
34364
|
+
};
|
|
34365
|
+
__decorate([
|
|
34366
|
+
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])()
|
|
34367
|
+
], QuestionFileModelBase.prototype, "isUploading", void 0);
|
|
34368
|
+
__decorate([
|
|
34369
|
+
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])({ defaultValue: "empty" })
|
|
34370
|
+
], QuestionFileModelBase.prototype, "currentState", void 0);
|
|
34371
|
+
return QuestionFileModelBase;
|
|
34372
|
+
}(_question__WEBPACK_IMPORTED_MODULE_0__["Question"]));
|
|
34373
|
+
|
|
34374
|
+
/**
|
|
34375
|
+
* A class that describes the File Upload question type.
|
|
34376
|
+
*
|
|
34377
|
+
* [View Demo](https://surveyjs.io/form-library/examples/file-upload/ (linkStyle))
|
|
34378
|
+
*/
|
|
34379
|
+
var QuestionFileModel = /** @class */ (function (_super) {
|
|
34380
|
+
__extends(QuestionFileModel, _super);
|
|
34381
|
+
function QuestionFileModel(name) {
|
|
34382
|
+
var _this = _super.call(this, name) || this;
|
|
34383
|
+
_this.isDragging = false;
|
|
34213
34384
|
_this.fileNavigator = new _actions_container__WEBPACK_IMPORTED_MODULE_7__["ActionContainer"]();
|
|
34214
34385
|
_this.canFlipCameraValue = undefined;
|
|
34215
34386
|
_this.prevPreviewLength = 0;
|
|
@@ -34514,15 +34685,6 @@ var QuestionFileModel = /** @class */ (function (_super) {
|
|
|
34514
34685
|
QuestionFileModel.prototype.getType = function () {
|
|
34515
34686
|
return "file";
|
|
34516
34687
|
};
|
|
34517
|
-
QuestionFileModel.prototype.clearValue = function () {
|
|
34518
|
-
this.clearOnDeletingContainer();
|
|
34519
|
-
_super.prototype.clearValue.call(this);
|
|
34520
|
-
};
|
|
34521
|
-
QuestionFileModel.prototype.clearOnDeletingContainer = function () {
|
|
34522
|
-
if (!this.survey)
|
|
34523
|
-
return;
|
|
34524
|
-
this.survey.clearFiles(this, this.name, this.value, null, function () { });
|
|
34525
|
-
};
|
|
34526
34688
|
Object.defineProperty(QuestionFileModel.prototype, "showPreview", {
|
|
34527
34689
|
/**
|
|
34528
34690
|
* Disable this property only to implement a custom preview.
|
|
@@ -34593,36 +34755,6 @@ var QuestionFileModel = /** @class */ (function (_super) {
|
|
|
34593
34755
|
enumerable: false,
|
|
34594
34756
|
configurable: true
|
|
34595
34757
|
});
|
|
34596
|
-
Object.defineProperty(QuestionFileModel.prototype, "storeDataAsText", {
|
|
34597
|
-
/**
|
|
34598
|
-
* Specifies whether to store file content as text in `SurveyModel`'s [`data`](https://surveyjs.io/form-library/documentation/surveymodel#data) property.
|
|
34599
|
-
*
|
|
34600
|
-
* If you disable this property, implement `SurveyModel`'s [`onUploadFiles`](https://surveyjs.io/form-library/documentation/surveymodel#onUploadFiles) event handler to specify how to store file content.
|
|
34601
|
-
*/
|
|
34602
|
-
get: function () {
|
|
34603
|
-
return this.getPropertyValue("storeDataAsText");
|
|
34604
|
-
},
|
|
34605
|
-
set: function (val) {
|
|
34606
|
-
this.setPropertyValue("storeDataAsText", val);
|
|
34607
|
-
},
|
|
34608
|
-
enumerable: false,
|
|
34609
|
-
configurable: true
|
|
34610
|
-
});
|
|
34611
|
-
Object.defineProperty(QuestionFileModel.prototype, "waitForUpload", {
|
|
34612
|
-
/**
|
|
34613
|
-
* Enable this property if you want to wait until files are uploaded to complete the survey.
|
|
34614
|
-
*
|
|
34615
|
-
* Default value: `false`
|
|
34616
|
-
*/
|
|
34617
|
-
get: function () {
|
|
34618
|
-
return this.getPropertyValue("waitForUpload");
|
|
34619
|
-
},
|
|
34620
|
-
set: function (val) {
|
|
34621
|
-
this.setPropertyValue("waitForUpload", val);
|
|
34622
|
-
},
|
|
34623
|
-
enumerable: false,
|
|
34624
|
-
configurable: true
|
|
34625
|
-
});
|
|
34626
34758
|
Object.defineProperty(QuestionFileModel.prototype, "allowImagesPreview", {
|
|
34627
34759
|
/**
|
|
34628
34760
|
* Specifies whether to show a preview of image files.
|
|
@@ -34810,13 +34942,6 @@ var QuestionFileModel = /** @class */ (function (_super) {
|
|
|
34810
34942
|
enumerable: false,
|
|
34811
34943
|
configurable: true
|
|
34812
34944
|
});
|
|
34813
|
-
Object.defineProperty(QuestionFileModel.prototype, "showLoadingIndicator", {
|
|
34814
|
-
get: function () {
|
|
34815
|
-
return this.isUploading && this.isDefaultV2Theme;
|
|
34816
|
-
},
|
|
34817
|
-
enumerable: false,
|
|
34818
|
-
configurable: true
|
|
34819
|
-
});
|
|
34820
34945
|
Object.defineProperty(QuestionFileModel.prototype, "allowShowPreview", {
|
|
34821
34946
|
get: function () {
|
|
34822
34947
|
var isShowLoadingIndicator = this.showLoadingIndicator;
|
|
@@ -34885,6 +35010,15 @@ var QuestionFileModel = /** @class */ (function (_super) {
|
|
|
34885
35010
|
}
|
|
34886
35011
|
});
|
|
34887
35012
|
};
|
|
35013
|
+
QuestionFileModel.prototype.setValueFromResult = function (arg) {
|
|
35014
|
+
this.value = (this.value || []).concat(arg.map(function (r) {
|
|
35015
|
+
return {
|
|
35016
|
+
name: r.file.name,
|
|
35017
|
+
type: r.file.type,
|
|
35018
|
+
content: r.content,
|
|
35019
|
+
};
|
|
35020
|
+
}));
|
|
35021
|
+
};
|
|
34888
35022
|
/**
|
|
34889
35023
|
* Loads multiple files into the question.
|
|
34890
35024
|
* @param files An array of [File](https://developer.mozilla.org/en-US/docs/Web/API/File) objects.
|
|
@@ -34916,24 +35050,7 @@ var QuestionFileModel = /** @class */ (function (_super) {
|
|
|
34916
35050
|
});
|
|
34917
35051
|
}
|
|
34918
35052
|
else {
|
|
34919
|
-
|
|
34920
|
-
_this.survey.uploadFiles(_this, _this.name, files, function (status, data) {
|
|
34921
|
-
if (status === "error") {
|
|
34922
|
-
_this.errors.push(new _error__WEBPACK_IMPORTED_MODULE_4__["UploadingFileError"](data, _this));
|
|
34923
|
-
_this.stateChanged("error");
|
|
34924
|
-
_this.stateChanged("loaded");
|
|
34925
|
-
}
|
|
34926
|
-
if (status === "success") {
|
|
34927
|
-
_this.value = (_this.value || []).concat(data.map(function (r) {
|
|
34928
|
-
return {
|
|
34929
|
-
name: r.file.name,
|
|
34930
|
-
type: r.file.type,
|
|
34931
|
-
content: r.content,
|
|
34932
|
-
};
|
|
34933
|
-
}));
|
|
34934
|
-
}
|
|
34935
|
-
});
|
|
34936
|
-
}
|
|
35053
|
+
_this.uploadFiles(files);
|
|
34937
35054
|
}
|
|
34938
35055
|
};
|
|
34939
35056
|
if (this.allowMultiple) {
|
|
@@ -35008,29 +35125,6 @@ var QuestionFileModel = /** @class */ (function (_super) {
|
|
|
35008
35125
|
QuestionFileModel.prototype.getIsQuestionReady = function () {
|
|
35009
35126
|
return _super.prototype.getIsQuestionReady.call(this) && !this.isFileLoading;
|
|
35010
35127
|
};
|
|
35011
|
-
QuestionFileModel.prototype.onCheckForErrors = function (errors, isOnValueChanged) {
|
|
35012
|
-
_super.prototype.onCheckForErrors.call(this, errors, isOnValueChanged);
|
|
35013
|
-
if (this.isUploading && this.waitForUpload) {
|
|
35014
|
-
errors.push(new _error__WEBPACK_IMPORTED_MODULE_4__["UploadingFileError"](this.getLocalizationString("uploadingFile"), this));
|
|
35015
|
-
}
|
|
35016
|
-
};
|
|
35017
|
-
QuestionFileModel.prototype.stateChanged = function (state) {
|
|
35018
|
-
if (this.currentState == state) {
|
|
35019
|
-
return;
|
|
35020
|
-
}
|
|
35021
|
-
if (state === "loading") {
|
|
35022
|
-
this.isUploading = true;
|
|
35023
|
-
}
|
|
35024
|
-
if (state === "loaded") {
|
|
35025
|
-
this.isUploading = false;
|
|
35026
|
-
}
|
|
35027
|
-
if (state === "error") {
|
|
35028
|
-
this.isUploading = false;
|
|
35029
|
-
}
|
|
35030
|
-
this.currentState = state;
|
|
35031
|
-
this.onStateChanged.fire(this, { state: state });
|
|
35032
|
-
this.onUploadStateChanged.fire(this, { state: state });
|
|
35033
|
-
};
|
|
35034
35128
|
QuestionFileModel.prototype.allFilesOk = function (files) {
|
|
35035
35129
|
var _this = this;
|
|
35036
35130
|
var errorLength = this.errors ? this.errors.length : 0;
|
|
@@ -35240,18 +35334,12 @@ var QuestionFileModel = /** @class */ (function (_super) {
|
|
|
35240
35334
|
this.closeVideoStream();
|
|
35241
35335
|
_super.prototype.dispose.call(this);
|
|
35242
35336
|
};
|
|
35243
|
-
__decorate([
|
|
35244
|
-
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])()
|
|
35245
|
-
], QuestionFileModel.prototype, "isUploading", void 0);
|
|
35246
35337
|
__decorate([
|
|
35247
35338
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])()
|
|
35248
35339
|
], QuestionFileModel.prototype, "isDragging", void 0);
|
|
35249
35340
|
__decorate([
|
|
35250
35341
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["propertyArray"])({})
|
|
35251
35342
|
], QuestionFileModel.prototype, "previewValue", void 0);
|
|
35252
|
-
__decorate([
|
|
35253
|
-
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])({ defaultValue: "empty" })
|
|
35254
|
-
], QuestionFileModel.prototype, "currentState", void 0);
|
|
35255
35343
|
__decorate([
|
|
35256
35344
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])({ defaultValue: 0 })
|
|
35257
35345
|
], QuestionFileModel.prototype, "indexToShow", void 0);
|
|
@@ -35316,7 +35404,7 @@ var QuestionFileModel = /** @class */ (function (_super) {
|
|
|
35316
35404
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])()
|
|
35317
35405
|
], QuestionFileModel.prototype, "locRenderedPlaceholderValue", void 0);
|
|
35318
35406
|
return QuestionFileModel;
|
|
35319
|
-
}(
|
|
35407
|
+
}(QuestionFileModelBase));
|
|
35320
35408
|
|
|
35321
35409
|
_jsonobject__WEBPACK_IMPORTED_MODULE_1__["Serializer"].addClass("file", [
|
|
35322
35410
|
{ name: "showCommentArea:switch", layout: "row", visible: true, category: "general" },
|
|
@@ -37843,8 +37931,9 @@ var MatrixDropdownRowModelBase = /** @class */ (function () {
|
|
|
37843
37931
|
if (!_helpers__WEBPACK_IMPORTED_MODULE_2__["Helpers"].isValueEmpty(value)) {
|
|
37844
37932
|
for (var i = 0; i < questions.length; i++) {
|
|
37845
37933
|
var key = questions[i].getValueName();
|
|
37846
|
-
|
|
37847
|
-
|
|
37934
|
+
var val = !!this.editingObj ? _jsonobject__WEBPACK_IMPORTED_MODULE_0__["Serializer"].getObjPropertyValue(this.editingObj, key) : value[key];
|
|
37935
|
+
if (!_helpers__WEBPACK_IMPORTED_MODULE_2__["Helpers"].isValueEmpty(val)) {
|
|
37936
|
+
questions[i].value = val;
|
|
37848
37937
|
}
|
|
37849
37938
|
}
|
|
37850
37939
|
}
|
|
@@ -39375,6 +39464,7 @@ var QuestionMatrixDropdownModelBase = /** @class */ (function (_super) {
|
|
|
39375
39464
|
var questionPlainData = _super.prototype.getPlainData.call(this, options);
|
|
39376
39465
|
if (!!questionPlainData) {
|
|
39377
39466
|
questionPlainData.isNode = true;
|
|
39467
|
+
var prevData = Array.isArray(questionPlainData.data) ? [].concat(questionPlainData.data) : [];
|
|
39378
39468
|
questionPlainData.data = this.visibleRows.map(function (row) {
|
|
39379
39469
|
var rowDataItem = {
|
|
39380
39470
|
name: row.dataName,
|
|
@@ -39396,6 +39486,7 @@ var QuestionMatrixDropdownModelBase = /** @class */ (function (_super) {
|
|
|
39396
39486
|
});
|
|
39397
39487
|
return rowDataItem;
|
|
39398
39488
|
});
|
|
39489
|
+
questionPlainData.data = questionPlainData.data.concat(prevData);
|
|
39399
39490
|
}
|
|
39400
39491
|
return questionPlainData;
|
|
39401
39492
|
};
|
|
@@ -39807,7 +39898,7 @@ var QuestionMatrixDropdownModelBase = /** @class */ (function (_super) {
|
|
|
39807
39898
|
columnValue = newRowValue[columnName];
|
|
39808
39899
|
}
|
|
39809
39900
|
this.isRowChanging = true;
|
|
39810
|
-
|
|
39901
|
+
_jsonobject__WEBPACK_IMPORTED_MODULE_0__["Serializer"].setObjPropertyValue(rowObj, columnName, columnValue);
|
|
39811
39902
|
this.isRowChanging = false;
|
|
39812
39903
|
this.onCellValueChanged(row, columnName, rowObj);
|
|
39813
39904
|
}
|
|
@@ -39938,6 +40029,7 @@ var QuestionMatrixDropdownModelBase = /** @class */ (function (_super) {
|
|
|
39938
40029
|
this.onCreateDetailPanelCallback(row, panel);
|
|
39939
40030
|
}
|
|
39940
40031
|
panel.questions.forEach(function (q) { return q.setParentQuestion(_this); });
|
|
40032
|
+
panel.onSurveyLoad();
|
|
39941
40033
|
return panel;
|
|
39942
40034
|
};
|
|
39943
40035
|
QuestionMatrixDropdownModelBase.prototype.getSharedQuestionByName = function (columnName, row) {
|
|
@@ -41633,7 +41725,10 @@ var QuestionMatrixDropdownRenderedTable = /** @class */ (function (_super) {
|
|
|
41633
41725
|
this.footerRow.cells.push(this.createHeaderCell(null, "action"));
|
|
41634
41726
|
}
|
|
41635
41727
|
if (this.matrix.hasRowText) {
|
|
41636
|
-
this.
|
|
41728
|
+
var cell_1 = this.createTextCell(this.matrix.getFooterText());
|
|
41729
|
+
cell_1.className = new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_5__["CssClassBuilder"]().append(cell_1.className)
|
|
41730
|
+
.append(this.cssClasses.footerTotalCell).toString();
|
|
41731
|
+
this.footerRow.cells.push(cell_1);
|
|
41637
41732
|
}
|
|
41638
41733
|
var cells = this.matrix.visibleTotalRow.cells;
|
|
41639
41734
|
for (var i = 0; i < cells.length; i++) {
|
|
@@ -41648,6 +41743,8 @@ var QuestionMatrixDropdownRenderedTable = /** @class */ (function (_super) {
|
|
|
41648
41743
|
if (cell.column) {
|
|
41649
41744
|
this.setHeaderCellWidth(cell.column, editCell);
|
|
41650
41745
|
}
|
|
41746
|
+
editCell.className = new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_5__["CssClassBuilder"]().append(editCell.className)
|
|
41747
|
+
.append(this.cssClasses.footerCell).toString();
|
|
41651
41748
|
this.footerRow.cells.push(editCell);
|
|
41652
41749
|
}
|
|
41653
41750
|
}
|
|
@@ -46691,6 +46788,7 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
|
46691
46788
|
var questionPlainData = _super.prototype.getPlainData.call(this, options);
|
|
46692
46789
|
if (!!questionPlainData) {
|
|
46693
46790
|
questionPlainData.isNode = true;
|
|
46791
|
+
var prevData = Array.isArray(questionPlainData.data) ? [].concat(questionPlainData.data) : [];
|
|
46694
46792
|
questionPlainData.data = this.panels.map(function (panel, index) {
|
|
46695
46793
|
var panelDataItem = {
|
|
46696
46794
|
name: panel.name || index,
|
|
@@ -46710,6 +46808,7 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
|
46710
46808
|
});
|
|
46711
46809
|
return panelDataItem;
|
|
46712
46810
|
});
|
|
46811
|
+
questionPlainData.data = questionPlainData.data.concat(prevData);
|
|
46713
46812
|
}
|
|
46714
46813
|
return questionPlainData;
|
|
46715
46814
|
};
|
|
@@ -47880,6 +47979,24 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_3__["Serializer"].addClass("ranking", [
|
|
|
47880
47979
|
visible: true,
|
|
47881
47980
|
isSerializable: true,
|
|
47882
47981
|
},
|
|
47982
|
+
{
|
|
47983
|
+
name: "selectToRankEmptyRankedAreaText:text",
|
|
47984
|
+
serializationProperty: "locSelectToRankEmptyRankedAreaText",
|
|
47985
|
+
category: "general",
|
|
47986
|
+
dependsOn: "selectToRankEnabled",
|
|
47987
|
+
visibleIf: function (obj) {
|
|
47988
|
+
return !!obj.selectToRankEnabled;
|
|
47989
|
+
},
|
|
47990
|
+
},
|
|
47991
|
+
{
|
|
47992
|
+
name: "selectToRankEmptyUnrankedAreaText:text",
|
|
47993
|
+
serializationProperty: "locSelectToRankEmptyUnrankedAreaText",
|
|
47994
|
+
category: "general",
|
|
47995
|
+
dependsOn: "selectToRankEnabled",
|
|
47996
|
+
visibleIf: function (obj) {
|
|
47997
|
+
return !!obj.selectToRankEnabled;
|
|
47998
|
+
},
|
|
47999
|
+
},
|
|
47883
48000
|
{
|
|
47884
48001
|
name: "maxSelectedChoices:number",
|
|
47885
48002
|
visible: true,
|
|
@@ -48001,6 +48118,15 @@ var RenderedRatingItem = /** @class */ (function (_super) {
|
|
|
48001
48118
|
return RenderedRatingItem;
|
|
48002
48119
|
}(_base__WEBPACK_IMPORTED_MODULE_7__["Base"]));
|
|
48003
48120
|
|
|
48121
|
+
var RatingItemValue = /** @class */ (function (_super) {
|
|
48122
|
+
__extends(RatingItemValue, _super);
|
|
48123
|
+
function RatingItemValue(value, description) {
|
|
48124
|
+
var _this = _super.call(this, value) || this;
|
|
48125
|
+
_this.description = description;
|
|
48126
|
+
return _this;
|
|
48127
|
+
}
|
|
48128
|
+
return RatingItemValue;
|
|
48129
|
+
}(_itemvalue__WEBPACK_IMPORTED_MODULE_0__["ItemValue"]));
|
|
48004
48130
|
/**
|
|
48005
48131
|
* A class that describes the Rating Scale question type.
|
|
48006
48132
|
*
|
|
@@ -48295,18 +48421,7 @@ var QuestionRatingModel = /** @class */ (function (_super) {
|
|
|
48295
48421
|
rateValues = this.rateValues;
|
|
48296
48422
|
}
|
|
48297
48423
|
else {
|
|
48298
|
-
|
|
48299
|
-
var value = this.rateMin;
|
|
48300
|
-
var step = this.rateStep;
|
|
48301
|
-
while (value <= this.rateMax &&
|
|
48302
|
-
res.length < _settings__WEBPACK_IMPORTED_MODULE_4__["settings"].ratingMaximumRateValueCount) {
|
|
48303
|
-
var item = new _itemvalue__WEBPACK_IMPORTED_MODULE_0__["ItemValue"](value);
|
|
48304
|
-
item.locOwner = this;
|
|
48305
|
-
item.ownerPropertyName = "rateValues";
|
|
48306
|
-
res.push(item);
|
|
48307
|
-
value = this.correctValue(value + step, step);
|
|
48308
|
-
}
|
|
48309
|
-
rateValues = res;
|
|
48424
|
+
rateValues = this.createRateValues();
|
|
48310
48425
|
}
|
|
48311
48426
|
if (this.rateType == "smileys" && rateValues.length > 10)
|
|
48312
48427
|
rateValues = rateValues.slice(0, 10);
|
|
@@ -48323,6 +48438,27 @@ var QuestionRatingModel = /** @class */ (function (_super) {
|
|
|
48323
48438
|
return renderedItem;
|
|
48324
48439
|
});
|
|
48325
48440
|
};
|
|
48441
|
+
QuestionRatingModel.prototype.createRateValues = function () {
|
|
48442
|
+
var res = [];
|
|
48443
|
+
var value = this.rateMin;
|
|
48444
|
+
var step = this.rateStep;
|
|
48445
|
+
while (value <= this.rateMax &&
|
|
48446
|
+
res.length < _settings__WEBPACK_IMPORTED_MODULE_4__["settings"].ratingMaximumRateValueCount) {
|
|
48447
|
+
var description = void 0;
|
|
48448
|
+
if (value === this.rateMin) {
|
|
48449
|
+
description = this.minRateDescription && this.locMinRateDescription;
|
|
48450
|
+
}
|
|
48451
|
+
if (value === this.rateMax || res.length === _settings__WEBPACK_IMPORTED_MODULE_4__["settings"].ratingMaximumRateValueCount) {
|
|
48452
|
+
description = this.maxRateDescription && this.locMaxRateDescription;
|
|
48453
|
+
}
|
|
48454
|
+
var item = new RatingItemValue(value, description);
|
|
48455
|
+
item.locOwner = this;
|
|
48456
|
+
item.ownerPropertyName = "rateValues";
|
|
48457
|
+
res.push(item);
|
|
48458
|
+
value = this.correctValue(value + step, step);
|
|
48459
|
+
}
|
|
48460
|
+
return res;
|
|
48461
|
+
};
|
|
48326
48462
|
QuestionRatingModel.prototype.correctValue = function (value, step) {
|
|
48327
48463
|
if (!value)
|
|
48328
48464
|
return value;
|
|
@@ -48445,7 +48581,7 @@ var QuestionRatingModel = /** @class */ (function (_super) {
|
|
|
48445
48581
|
});
|
|
48446
48582
|
QuestionRatingModel.prototype.getDefaultItemComponent = function () {
|
|
48447
48583
|
if (this.renderAs == "dropdown")
|
|
48448
|
-
return "";
|
|
48584
|
+
return "sv-rating-dropdown-item";
|
|
48449
48585
|
if (this.isStar)
|
|
48450
48586
|
return "sv-rating-item-star";
|
|
48451
48587
|
if (this.isSmiley)
|
|
@@ -49012,10 +49148,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
49012
49148
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "QuestionSignaturePadModel", function() { return QuestionSignaturePadModel; });
|
|
49013
49149
|
/* harmony import */ var _jsonobject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./jsonobject */ "./src/jsonobject.ts");
|
|
49014
49150
|
/* harmony import */ var _questionfactory__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./questionfactory */ "./src/questionfactory.ts");
|
|
49015
|
-
/* harmony import */ var
|
|
49016
|
-
/* harmony import */ var
|
|
49017
|
-
/* harmony import */ var
|
|
49018
|
-
/* harmony import */ var
|
|
49151
|
+
/* harmony import */ var signature_pad__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! signature_pad */ "./node_modules/signature_pad/dist/signature_pad.js");
|
|
49152
|
+
/* harmony import */ var _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/cssClassBuilder */ "./src/utils/cssClassBuilder.ts");
|
|
49153
|
+
/* harmony import */ var _console_warnings__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./console-warnings */ "./src/console-warnings.ts");
|
|
49154
|
+
/* harmony import */ var _question_file__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./question_file */ "./src/question_file.ts");
|
|
49019
49155
|
var __extends = (undefined && undefined.__extends) || (function () {
|
|
49020
49156
|
var extendStatics = function (d, b) {
|
|
49021
49157
|
extendStatics = Object.setPrototypeOf ||
|
|
@@ -49059,6 +49195,16 @@ var QuestionSignaturePadModel = /** @class */ (function (_super) {
|
|
|
49059
49195
|
_this.scaleCanvas(false, true);
|
|
49060
49196
|
_this.refreshCanvas();
|
|
49061
49197
|
};
|
|
49198
|
+
_this.onBlur = function (event) {
|
|
49199
|
+
if (!_this.storeDataAsText) {
|
|
49200
|
+
if (!_this.element.contains(event.relatedTarget)) {
|
|
49201
|
+
if (!_this.valueWasChangedFromLastUpload)
|
|
49202
|
+
return;
|
|
49203
|
+
_this.uploadFiles([Object(_question_file__WEBPACK_IMPORTED_MODULE_5__["dataUrl2File"])(_this.signaturePad.toDataURL(_this.getFormat()), _this.name + "." + correctFormatData(_this.dataFormat), _this.getFormat())]);
|
|
49204
|
+
_this.valueWasChangedFromLastUpload = false;
|
|
49205
|
+
}
|
|
49206
|
+
}
|
|
49207
|
+
};
|
|
49062
49208
|
return _this;
|
|
49063
49209
|
}
|
|
49064
49210
|
QuestionSignaturePadModel.prototype.getPenColorFromTheme = function () {
|
|
@@ -49075,16 +49221,18 @@ var QuestionSignaturePadModel = /** @class */ (function (_super) {
|
|
|
49075
49221
|
signaturePad.backgroundColor = background || backgroundColorFromTheme || backgroundColorProperty.defaultValue || "#ffffff";
|
|
49076
49222
|
};
|
|
49077
49223
|
QuestionSignaturePadModel.prototype.getCssRoot = function (cssClasses) {
|
|
49078
|
-
return new
|
|
49224
|
+
return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_3__["CssClassBuilder"]()
|
|
49079
49225
|
.append(_super.prototype.getCssRoot.call(this, cssClasses))
|
|
49080
49226
|
.append(cssClasses.small, this.signatureWidth.toString() === "300")
|
|
49081
49227
|
.toString();
|
|
49082
49228
|
};
|
|
49229
|
+
QuestionSignaturePadModel.prototype.getFormat = function () {
|
|
49230
|
+
return this.dataFormat === "jpeg" ? "image/jpeg" :
|
|
49231
|
+
(this.dataFormat === "svg" ? "image/svg+xml" : "");
|
|
49232
|
+
};
|
|
49083
49233
|
QuestionSignaturePadModel.prototype.updateValue = function () {
|
|
49084
49234
|
if (this.signaturePad) {
|
|
49085
|
-
var
|
|
49086
|
-
(this.dataFormat === "svg" ? "image/svg+xml" : "");
|
|
49087
|
-
var data = this.signaturePad.toDataURL(format);
|
|
49235
|
+
var data = this.signaturePad.toDataURL(this.getFormat());
|
|
49088
49236
|
this.valueIsUpdatingInternally = true;
|
|
49089
49237
|
this.value = data;
|
|
49090
49238
|
this.valueIsUpdatingInternally = false;
|
|
@@ -49096,6 +49244,7 @@ var QuestionSignaturePadModel = /** @class */ (function (_super) {
|
|
|
49096
49244
|
QuestionSignaturePadModel.prototype.afterRenderQuestionElement = function (el) {
|
|
49097
49245
|
if (!!el) {
|
|
49098
49246
|
this.initSignaturePad(el);
|
|
49247
|
+
this.element = el;
|
|
49099
49248
|
}
|
|
49100
49249
|
_super.prototype.afterRenderQuestionElement.call(this, el);
|
|
49101
49250
|
};
|
|
@@ -49129,15 +49278,34 @@ var QuestionSignaturePadModel = /** @class */ (function (_super) {
|
|
|
49129
49278
|
this.refreshCanvas();
|
|
49130
49279
|
}
|
|
49131
49280
|
};
|
|
49281
|
+
QuestionSignaturePadModel.prototype.fromDataUrl = function (data) {
|
|
49282
|
+
this.signaturePad.fromDataURL(data, { width: this.canvas.width * this.scale, height: this.canvas.height * this.scale });
|
|
49283
|
+
};
|
|
49284
|
+
QuestionSignaturePadModel.prototype.fromUrl = function (url) {
|
|
49285
|
+
var _this = this;
|
|
49286
|
+
var img = document.createElement("img");
|
|
49287
|
+
img.crossOrigin = "anonymous";
|
|
49288
|
+
img.src = url;
|
|
49289
|
+
img.onload = function () {
|
|
49290
|
+
var ctx = _this.canvas.getContext("2d");
|
|
49291
|
+
ctx.drawImage(img, 0, 0);
|
|
49292
|
+
var dataURL = _this.canvas.toDataURL(_this.getFormat());
|
|
49293
|
+
_this.fromDataUrl(dataURL);
|
|
49294
|
+
};
|
|
49295
|
+
};
|
|
49132
49296
|
QuestionSignaturePadModel.prototype.refreshCanvas = function () {
|
|
49133
|
-
|
|
49134
|
-
|
|
49135
|
-
if (!data) {
|
|
49136
|
-
canvas.getContext("2d").clearRect(0, 0, canvas.width * this.scale, canvas.height * this.scale);
|
|
49297
|
+
if (!this.value) {
|
|
49298
|
+
this.canvas.getContext("2d").clearRect(0, 0, this.canvas.width * this.scale, this.canvas.height * this.scale);
|
|
49137
49299
|
this.signaturePad.clear();
|
|
49300
|
+
this.valueWasChangedFromLastUpload = false;
|
|
49138
49301
|
}
|
|
49139
49302
|
else {
|
|
49140
|
-
this.
|
|
49303
|
+
if (this.storeDataAsText) {
|
|
49304
|
+
this.fromDataUrl(this.value);
|
|
49305
|
+
}
|
|
49306
|
+
else {
|
|
49307
|
+
this.fromUrl(this.value);
|
|
49308
|
+
}
|
|
49141
49309
|
}
|
|
49142
49310
|
};
|
|
49143
49311
|
QuestionSignaturePadModel.prototype.initSignaturePad = function (el) {
|
|
@@ -49145,7 +49313,7 @@ var QuestionSignaturePadModel = /** @class */ (function (_super) {
|
|
|
49145
49313
|
var canvas = el.getElementsByTagName("canvas")[0];
|
|
49146
49314
|
this.canvas = canvas;
|
|
49147
49315
|
this.resizeCanvas();
|
|
49148
|
-
var signaturePad = new
|
|
49316
|
+
var signaturePad = new signature_pad__WEBPACK_IMPORTED_MODULE_2__["default"](canvas, { backgroundColor: "#ffffff" });
|
|
49149
49317
|
this.signaturePad = signaturePad;
|
|
49150
49318
|
if (this.isInputReadOnly) {
|
|
49151
49319
|
signaturePad.off();
|
|
@@ -49166,7 +49334,12 @@ var QuestionSignaturePadModel = /** @class */ (function (_super) {
|
|
|
49166
49334
|
}, { once: false });
|
|
49167
49335
|
signaturePad.addEventListener("endStroke", function () {
|
|
49168
49336
|
_this.isDrawingValue = false;
|
|
49169
|
-
_this.
|
|
49337
|
+
if (_this.storeDataAsText) {
|
|
49338
|
+
_this.updateValue();
|
|
49339
|
+
}
|
|
49340
|
+
else {
|
|
49341
|
+
_this.valueWasChangedFromLastUpload = true;
|
|
49342
|
+
}
|
|
49170
49343
|
}, { once: false });
|
|
49171
49344
|
this.updateValueHandler();
|
|
49172
49345
|
this.readOnlyChangedCallback();
|
|
@@ -49281,7 +49454,9 @@ var QuestionSignaturePadModel = /** @class */ (function (_super) {
|
|
|
49281
49454
|
});
|
|
49282
49455
|
Object.defineProperty(QuestionSignaturePadModel.prototype, "canShowClearButton", {
|
|
49283
49456
|
get: function () {
|
|
49284
|
-
|
|
49457
|
+
var hasSignature = !this.nothingIsDrawn();
|
|
49458
|
+
var isUploading = this.isUploading;
|
|
49459
|
+
return !this.isInputReadOnly && this.allowClear && hasSignature && !isUploading;
|
|
49285
49460
|
},
|
|
49286
49461
|
enumerable: false,
|
|
49287
49462
|
configurable: true
|
|
@@ -49350,22 +49525,39 @@ var QuestionSignaturePadModel = /** @class */ (function (_super) {
|
|
|
49350
49525
|
enumerable: false,
|
|
49351
49526
|
configurable: true
|
|
49352
49527
|
});
|
|
49353
|
-
QuestionSignaturePadModel.prototype.
|
|
49354
|
-
var showPlaceholder = this.showPlaceholder;
|
|
49528
|
+
QuestionSignaturePadModel.prototype.nothingIsDrawn = function () {
|
|
49355
49529
|
var isDrawing = this.isDrawingValue;
|
|
49356
49530
|
var isEmpty = this.isEmpty();
|
|
49357
|
-
|
|
49531
|
+
var isUploading = this.isUploading;
|
|
49532
|
+
var valueWasChangedFromLastUpload = this.valueWasChangedFromLastUpload;
|
|
49533
|
+
return !isDrawing && isEmpty && !isUploading && !valueWasChangedFromLastUpload;
|
|
49534
|
+
};
|
|
49535
|
+
QuestionSignaturePadModel.prototype.needShowPlaceholder = function () {
|
|
49536
|
+
return this.showPlaceholder && this.nothingIsDrawn();
|
|
49537
|
+
};
|
|
49538
|
+
QuestionSignaturePadModel.prototype.uploadResultItemToValue = function (r) {
|
|
49539
|
+
return r.content;
|
|
49540
|
+
};
|
|
49541
|
+
QuestionSignaturePadModel.prototype.setValueFromResult = function (arg) {
|
|
49542
|
+
this.valueIsUpdatingInternally = true;
|
|
49543
|
+
this.value = (arg === null || arg === void 0 ? void 0 : arg.length) ? arg.map(function (r) { return r.content; })[0] : undefined;
|
|
49544
|
+
this.valueIsUpdatingInternally = false;
|
|
49545
|
+
};
|
|
49546
|
+
QuestionSignaturePadModel.prototype.clearValue = function () {
|
|
49547
|
+
this.valueWasChangedFromLastUpload = false;
|
|
49548
|
+
_super.prototype.clearValue.call(this);
|
|
49549
|
+
this.refreshCanvas();
|
|
49358
49550
|
};
|
|
49359
49551
|
QuestionSignaturePadModel.prototype.endLoadingFromJson = function () {
|
|
49360
49552
|
_super.prototype.endLoadingFromJson.call(this);
|
|
49361
49553
|
//todo: need to remove this code
|
|
49362
49554
|
if (this.signatureWidth === 300 && !!this.width && typeof this.width === "number" && this.width) {
|
|
49363
|
-
|
|
49555
|
+
_console_warnings__WEBPACK_IMPORTED_MODULE_4__["ConsoleWarnings"].warn("Use signatureWidth property to set width for the signature pad");
|
|
49364
49556
|
this.signatureWidth = this.width;
|
|
49365
49557
|
this.width = undefined;
|
|
49366
49558
|
}
|
|
49367
49559
|
if (this.signatureHeight === 200 && !!this.height) {
|
|
49368
|
-
|
|
49560
|
+
_console_warnings__WEBPACK_IMPORTED_MODULE_4__["ConsoleWarnings"].warn("Use signatureHeight property to set width for the signature pad");
|
|
49369
49561
|
this.signatureHeight = this.height;
|
|
49370
49562
|
this.height = undefined;
|
|
49371
49563
|
}
|
|
@@ -49373,6 +49565,12 @@ var QuestionSignaturePadModel = /** @class */ (function (_super) {
|
|
|
49373
49565
|
__decorate([
|
|
49374
49566
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])({ defaultValue: false })
|
|
49375
49567
|
], QuestionSignaturePadModel.prototype, "isDrawingValue", void 0);
|
|
49568
|
+
__decorate([
|
|
49569
|
+
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])({ defaultValue: false })
|
|
49570
|
+
], QuestionSignaturePadModel.prototype, "isReadyForUpload", void 0);
|
|
49571
|
+
__decorate([
|
|
49572
|
+
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])({ defaultValue: false })
|
|
49573
|
+
], QuestionSignaturePadModel.prototype, "valueWasChangedFromLastUpload", void 0);
|
|
49376
49574
|
__decorate([
|
|
49377
49575
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])()
|
|
49378
49576
|
], QuestionSignaturePadModel.prototype, "signatureAutoScaleEnabled", void 0);
|
|
@@ -49389,7 +49587,7 @@ var QuestionSignaturePadModel = /** @class */ (function (_super) {
|
|
|
49389
49587
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])({ localizable: { defaultStr: "signaturePlaceHolder" } })
|
|
49390
49588
|
], QuestionSignaturePadModel.prototype, "placeholder", void 0);
|
|
49391
49589
|
return QuestionSignaturePadModel;
|
|
49392
|
-
}(
|
|
49590
|
+
}(_question_file__WEBPACK_IMPORTED_MODULE_5__["QuestionFileModelBase"]));
|
|
49393
49591
|
|
|
49394
49592
|
function correctFormatData(val) {
|
|
49395
49593
|
if (!val)
|
|
@@ -49471,6 +49669,8 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_0__["Serializer"].addClass("signaturepad",
|
|
|
49471
49669
|
},
|
|
49472
49670
|
{ name: "defaultValue", visible: false },
|
|
49473
49671
|
{ name: "correctAnswer", visible: false },
|
|
49672
|
+
{ name: "storeDataAsText:boolean", default: true },
|
|
49673
|
+
{ name: "waitForUpload:boolean", default: false },
|
|
49474
49674
|
], function () {
|
|
49475
49675
|
return new QuestionSignaturePadModel("");
|
|
49476
49676
|
}, "question");
|
|
@@ -53601,6 +53801,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
53601
53801
|
/* harmony import */ var _notifier__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./notifier */ "./src/notifier.ts");
|
|
53602
53802
|
/* harmony import */ var _header__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./header */ "./src/header.ts");
|
|
53603
53803
|
/* harmony import */ var _surveytimer__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./surveytimer */ "./src/surveytimer.ts");
|
|
53804
|
+
/* harmony import */ var _surveyTaskManager__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./surveyTaskManager */ "./src/surveyTaskManager.ts");
|
|
53604
53805
|
var __extends = (undefined && undefined.__extends) || (function () {
|
|
53605
53806
|
var extendStatics = function (d, b) {
|
|
53606
53807
|
extendStatics = Object.setPrototypeOf ||
|
|
@@ -53642,6 +53843,7 @@ var __decorate = (undefined && undefined.__decorate) || function (decorators, ta
|
|
|
53642
53843
|
|
|
53643
53844
|
|
|
53644
53845
|
|
|
53846
|
+
|
|
53645
53847
|
|
|
53646
53848
|
|
|
53647
53849
|
/**
|
|
@@ -53918,6 +54120,8 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
|
53918
54120
|
* For information on event handler parameters, refer to descriptions within the interface.
|
|
53919
54121
|
*
|
|
53920
54122
|
* If you want to specify heading levels for all titles, use the [`titleTags`](https://surveyjs.io/form-library/documentation/api-reference/settings#titleTags) object in [global settings](https://surveyjs.io/form-library/documentation/api-reference/settings).
|
|
54123
|
+
*
|
|
54124
|
+
* [View Demo](https://surveyjs.io/form-library/examples/survey-titletagnames/ (linkStyle))
|
|
53921
54125
|
* @see onGetQuestionTitle
|
|
53922
54126
|
* @see onGetQuestionNo
|
|
53923
54127
|
*/
|
|
@@ -53957,7 +54161,7 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
|
53957
54161
|
*/
|
|
53958
54162
|
_this.onGetResult = _this.addEvent();
|
|
53959
54163
|
/**
|
|
53960
|
-
* An event that is raised when a File Upload question starts to upload a file. Applies only if [`storeDataAsText`](https://surveyjs.io/form-library/documentation/api-reference/file-model#storeDataAsText) is `false`. Use this event to upload files to your server.
|
|
54164
|
+
* An event that is raised when a File Upload or Signature Pad question starts to upload a file. Applies only if [`storeDataAsText`](https://surveyjs.io/form-library/documentation/api-reference/file-model#storeDataAsText) is `false`. Use this event to upload files to your server.
|
|
53961
54165
|
*
|
|
53962
54166
|
* For information on event handler parameters, refer to descriptions within the interface.
|
|
53963
54167
|
*
|
|
@@ -53979,7 +54183,7 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
|
53979
54183
|
*/
|
|
53980
54184
|
_this.onDownloadFile = _this.addEvent();
|
|
53981
54185
|
/**
|
|
53982
|
-
* An event that is raised when users clear files in a [File Upload](https://surveyjs.io/form-library/documentation/api-reference/file-model) question. Use this event to delete files from your server.
|
|
54186
|
+
* An event that is raised when users clear files in a [File Upload](https://surveyjs.io/form-library/documentation/api-reference/file-model) question or clear signature in a [Signature Pad](https://surveyjs.io/form-library/documentation/api-reference/signature-pad-model) question. Use this event to delete files from your server.
|
|
53983
54187
|
*
|
|
53984
54188
|
* For information on event handler parameters, refer to descriptions within the interface.
|
|
53985
54189
|
*
|
|
@@ -54301,7 +54505,8 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
|
54301
54505
|
* Specifies whether to hide validation errors thrown by the Required validation in the UI.
|
|
54302
54506
|
*
|
|
54303
54507
|
* [Built-In Client-Side Validators](https://surveyjs.io/form-library/documentation/data-validation#built-in-client-side-validators (linkStyle))
|
|
54304
|
-
* @see
|
|
54508
|
+
* @see validationEnabled
|
|
54509
|
+
* @see validationAllowSwitchPages
|
|
54305
54510
|
*/
|
|
54306
54511
|
_this.hideRequiredErrors = false;
|
|
54307
54512
|
//#endregion
|
|
@@ -54310,15 +54515,27 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
|
54310
54515
|
_this._isCompact = false;
|
|
54311
54516
|
_this._isDesignMode = false;
|
|
54312
54517
|
/**
|
|
54313
|
-
* Specifies whether
|
|
54518
|
+
* Specifies whether data validation is enabled.
|
|
54314
54519
|
*
|
|
54315
|
-
* Default value: `
|
|
54520
|
+
* Default value: `true`
|
|
54521
|
+
* @see checkErrorsMode
|
|
54316
54522
|
* @see hideRequiredErrors
|
|
54317
|
-
* @see nextPage
|
|
54318
|
-
* @see isPrevPage
|
|
54319
|
-
* @see completeLastPage
|
|
54320
54523
|
*/
|
|
54321
|
-
_this.
|
|
54524
|
+
_this.validationEnabled = true;
|
|
54525
|
+
/**
|
|
54526
|
+
* Specifies whether respondents can switch the current page even if it contains validation errors.
|
|
54527
|
+
*
|
|
54528
|
+
* Default value: `false`
|
|
54529
|
+
* @see checkErrorsMode
|
|
54530
|
+
*/
|
|
54531
|
+
_this.validationAllowSwitchPages = false;
|
|
54532
|
+
/**
|
|
54533
|
+
* Specifies whether respondents can end a survey with validation errors.
|
|
54534
|
+
*
|
|
54535
|
+
* Default value: `false`
|
|
54536
|
+
* @see checkErrorsMode
|
|
54537
|
+
*/
|
|
54538
|
+
_this.validationAllowComplete = false;
|
|
54322
54539
|
_this.isNavigationButtonPressed = false;
|
|
54323
54540
|
_this.mouseDownPage = null;
|
|
54324
54541
|
_this.isCalculatingProgressText = false;
|
|
@@ -54342,6 +54559,7 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
|
54342
54559
|
_this.needRenderIcons = true;
|
|
54343
54560
|
_this.skippedPages = [];
|
|
54344
54561
|
_this.skeletonComponentName = "sv-skeleton";
|
|
54562
|
+
_this.taskManager = new _surveyTaskManager__WEBPACK_IMPORTED_MODULE_22__["SurveyTaskManagerModel"]();
|
|
54345
54563
|
if (typeof document !== "undefined") {
|
|
54346
54564
|
SurveyModel.stylesManager = new _stylesmanager__WEBPACK_IMPORTED_MODULE_11__["StylesManager"]();
|
|
54347
54565
|
}
|
|
@@ -54349,6 +54567,7 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
|
54349
54567
|
_this.createHtmlLocString("completedHtml", "completingSurvey", htmlCallBack);
|
|
54350
54568
|
_this.createHtmlLocString("completedBeforeHtml", "completingSurveyBefore", htmlCallBack, "completed-before");
|
|
54351
54569
|
_this.createHtmlLocString("loadingHtml", "loadingSurvey", htmlCallBack, "loading");
|
|
54570
|
+
_this.createLocalizableString("emptySurveyText", _this, true, "emptySurvey");
|
|
54352
54571
|
_this.createLocalizableString("logo", _this, false);
|
|
54353
54572
|
_this.createLocalizableString("startSurveyText", _this, false, true);
|
|
54354
54573
|
_this.createLocalizableString("pagePrevText", _this, false, true);
|
|
@@ -54752,6 +54971,17 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
|
54752
54971
|
enumerable: false,
|
|
54753
54972
|
configurable: true
|
|
54754
54973
|
});
|
|
54974
|
+
SurveyModel.prototype.insertAdvancedHeader = function (advHeader) {
|
|
54975
|
+
advHeader.survey = this;
|
|
54976
|
+
this.layoutElements.push({
|
|
54977
|
+
id: "advanced-header",
|
|
54978
|
+
container: "header",
|
|
54979
|
+
component: "sv-header",
|
|
54980
|
+
index: -100,
|
|
54981
|
+
data: advHeader,
|
|
54982
|
+
processResponsiveness: function (width) { return advHeader.processResponsiveness(width); }
|
|
54983
|
+
});
|
|
54984
|
+
};
|
|
54755
54985
|
SurveyModel.prototype.getNavigationCss = function (main, btn) {
|
|
54756
54986
|
return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_18__["CssClassBuilder"]().append(main)
|
|
54757
54987
|
.append(btn).toString();
|
|
@@ -55286,6 +55516,10 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
|
55286
55516
|
* - `"onComplete"` - Triggers validation when a user clicks the Complete button. If previous pages contain errors, the survey switches to the page with the first error.
|
|
55287
55517
|
*
|
|
55288
55518
|
* Refer to the following help topic for more information: [Data Validation](https://surveyjs.io/form-library/documentation/data-validation).
|
|
55519
|
+
* @see validationEnabled
|
|
55520
|
+
* @see validationAllowSwitchPages
|
|
55521
|
+
* @see validationAllowComplete
|
|
55522
|
+
* @see validate
|
|
55289
55523
|
*/
|
|
55290
55524
|
get: function () {
|
|
55291
55525
|
return this.getPropertyValue("checkErrorsMode");
|
|
@@ -55577,11 +55811,14 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
|
55577
55811
|
};
|
|
55578
55812
|
Object.defineProperty(SurveyModel.prototype, "emptySurveyText", {
|
|
55579
55813
|
/**
|
|
55580
|
-
*
|
|
55814
|
+
* A message that is displayed when a survey does not contain visible pages or questions.
|
|
55581
55815
|
* @see [Localization & Globalization](https://surveyjs.io/form-library/documentation/survey-localization)
|
|
55582
55816
|
*/
|
|
55583
55817
|
get: function () {
|
|
55584
|
-
return this.
|
|
55818
|
+
return this.getLocalizableStringText("emptySurveyText");
|
|
55819
|
+
},
|
|
55820
|
+
set: function (val) {
|
|
55821
|
+
this.setLocalizableStringText("emptySurveyText", val);
|
|
55585
55822
|
},
|
|
55586
55823
|
enumerable: false,
|
|
55587
55824
|
configurable: true
|
|
@@ -56620,7 +56857,7 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
|
56620
56857
|
},
|
|
56621
56858
|
set: function (data) {
|
|
56622
56859
|
this.valuesHash = {};
|
|
56623
|
-
this.setDataCore(data);
|
|
56860
|
+
this.setDataCore(data, !data);
|
|
56624
56861
|
},
|
|
56625
56862
|
enumerable: false,
|
|
56626
56863
|
configurable: true
|
|
@@ -56640,17 +56877,21 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
|
56640
56877
|
this.mergeValues(data, newData);
|
|
56641
56878
|
this.setDataCore(newData);
|
|
56642
56879
|
};
|
|
56643
|
-
SurveyModel.prototype.setDataCore = function (data) {
|
|
56880
|
+
SurveyModel.prototype.setDataCore = function (data, clearData) {
|
|
56881
|
+
if (clearData === void 0) { clearData = false; }
|
|
56882
|
+
if (clearData) {
|
|
56883
|
+
this.valuesHash = {};
|
|
56884
|
+
}
|
|
56644
56885
|
if (data) {
|
|
56645
56886
|
for (var key in data) {
|
|
56646
56887
|
this.setDataValueCore(this.valuesHash, key, data[key]);
|
|
56647
56888
|
}
|
|
56648
56889
|
}
|
|
56649
|
-
this.updateAllQuestionsValue();
|
|
56890
|
+
this.updateAllQuestionsValue(clearData);
|
|
56650
56891
|
this.notifyAllQuestionsOnValueChanged();
|
|
56651
56892
|
this.notifyElementsOnAnyValueOrVariableChanged("");
|
|
56652
56893
|
this.runConditions();
|
|
56653
|
-
this.updateAllQuestionsValue();
|
|
56894
|
+
this.updateAllQuestionsValue(clearData);
|
|
56654
56895
|
};
|
|
56655
56896
|
SurveyModel.prototype.getStructuredData = function (includePages, level) {
|
|
56656
56897
|
if (includePages === void 0) { includePages = true; }
|
|
@@ -57345,8 +57586,7 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
|
57345
57586
|
this.isLoading = false;
|
|
57346
57587
|
this.completedByTriggers = undefined;
|
|
57347
57588
|
if (clearData) {
|
|
57348
|
-
this.
|
|
57349
|
-
this.variablesHash = {};
|
|
57589
|
+
this.setDataCore(null, true);
|
|
57350
57590
|
}
|
|
57351
57591
|
this.timerModel.spent = 0;
|
|
57352
57592
|
for (var i = 0; i < this.pages.length; i++) {
|
|
@@ -57616,6 +57856,15 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
|
57616
57856
|
return;
|
|
57617
57857
|
document.cookie = this.cookieName + "=;";
|
|
57618
57858
|
};
|
|
57859
|
+
Object.defineProperty(SurveyModel.prototype, "ignoreValidation", {
|
|
57860
|
+
/**
|
|
57861
|
+
* This property is obsolete. Use the [`validationEnabled`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#validationEnabled) property instead.
|
|
57862
|
+
*/
|
|
57863
|
+
get: function () { return !this.validationEnabled; },
|
|
57864
|
+
set: function (val) { this.validationEnabled = !val; },
|
|
57865
|
+
enumerable: false,
|
|
57866
|
+
configurable: true
|
|
57867
|
+
});
|
|
57619
57868
|
/**
|
|
57620
57869
|
* Switches the survey to the next page.
|
|
57621
57870
|
*
|
|
@@ -57632,19 +57881,20 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
|
57632
57881
|
};
|
|
57633
57882
|
SurveyModel.prototype.hasErrorsOnNavigate = function (doComplete) {
|
|
57634
57883
|
var _this = this;
|
|
57635
|
-
if (this.
|
|
57884
|
+
if (!this.isEditMode || this.ignoreValidation)
|
|
57636
57885
|
return false;
|
|
57886
|
+
var skipValidation = doComplete && this.validationAllowComplete || !doComplete && this.validationAllowSwitchPages;
|
|
57637
57887
|
var func = function (hasErrors) {
|
|
57638
|
-
if (!hasErrors) {
|
|
57888
|
+
if (!hasErrors || skipValidation) {
|
|
57639
57889
|
_this.doCurrentPageCompleteCore(doComplete);
|
|
57640
57890
|
}
|
|
57641
57891
|
};
|
|
57642
57892
|
if (this.isValidateOnComplete) {
|
|
57643
57893
|
if (!this.isLastPage)
|
|
57644
57894
|
return false;
|
|
57645
|
-
return this.validate(true, true, func) !== true;
|
|
57895
|
+
return this.validate(true, true, func) !== true && !skipValidation;
|
|
57646
57896
|
}
|
|
57647
|
-
return this.validateCurrentPage(func) !== true;
|
|
57897
|
+
return this.validateCurrentPage(func) !== true && !skipValidation;
|
|
57648
57898
|
};
|
|
57649
57899
|
SurveyModel.prototype.checkForAsyncQuestionValidation = function (questions, func) {
|
|
57650
57900
|
var _this = this;
|
|
@@ -59004,7 +59254,7 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
|
59004
59254
|
});
|
|
59005
59255
|
Object.defineProperty(SurveyModel.prototype, "isValidateOnComplete", {
|
|
59006
59256
|
get: function () {
|
|
59007
|
-
return this.checkErrorsMode === "onComplete";
|
|
59257
|
+
return this.checkErrorsMode === "onComplete" || this.validationAllowSwitchPages && !this.validationAllowComplete;
|
|
59008
59258
|
},
|
|
59009
59259
|
enumerable: false,
|
|
59010
59260
|
configurable: true
|
|
@@ -59152,23 +59402,29 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
|
59152
59402
|
* }
|
|
59153
59403
|
* );
|
|
59154
59404
|
* ```
|
|
59155
|
-
* @param question A [File Upload question instance](https://surveyjs.io/form-library/documentation/api-reference/file-model).
|
|
59156
|
-
* @param name The File Upload question's [`name`](https://surveyjs.io/form-library/documentation/api-reference/file-model#name).
|
|
59405
|
+
* @param question A [File Upload question instance](https://surveyjs.io/form-library/documentation/api-reference/file-model) or [Signature Pad question instance](https://surveyjs.io/form-library/documentation/api-reference/signature-pad-model).
|
|
59406
|
+
* @param name The File Upload question's [`name`](https://surveyjs.io/form-library/documentation/api-reference/file-model#name) or Signature Pad question's [`name`](https://surveyjs.io/form-library/documentation/api-reference/signature-pad-model#name).
|
|
59157
59407
|
* @param files An array of JavaScript <a href="https://developer.mozilla.org/en-US/docs/Web/API/File" target="_blank">File</a> objects that represent files to upload.
|
|
59158
|
-
* @param callback A callback function that allows you to
|
|
59408
|
+
* @param callback A callback function that allows you to access successfully uploaded files as the first argument. If any files fail to upload, the second argument contains an array of error messages.
|
|
59159
59409
|
* @see onUploadFiles
|
|
59160
59410
|
* @see downloadFile
|
|
59161
59411
|
*/
|
|
59162
59412
|
SurveyModel.prototype.uploadFiles = function (question, name, files, callback) {
|
|
59413
|
+
var _this = this;
|
|
59163
59414
|
if (this.onUploadFiles.isEmpty) {
|
|
59164
|
-
callback("error",
|
|
59415
|
+
callback("error", this.getLocString("noUploadFilesHandler"));
|
|
59165
59416
|
}
|
|
59166
59417
|
else {
|
|
59167
|
-
this.
|
|
59168
|
-
|
|
59169
|
-
|
|
59170
|
-
|
|
59171
|
-
|
|
59418
|
+
this.taskManager.runTask("file", function (done) {
|
|
59419
|
+
_this.onUploadFiles.fire(_this, {
|
|
59420
|
+
question: question,
|
|
59421
|
+
name: name,
|
|
59422
|
+
files: files || [],
|
|
59423
|
+
callback: function (status, data) {
|
|
59424
|
+
callback(status, data);
|
|
59425
|
+
done();
|
|
59426
|
+
},
|
|
59427
|
+
});
|
|
59172
59428
|
});
|
|
59173
59429
|
}
|
|
59174
59430
|
if (this.surveyPostId) {
|
|
@@ -59587,7 +59843,7 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
|
59587
59843
|
var qValue = questions[i].value;
|
|
59588
59844
|
if ((qValue === newValue && Array.isArray(qValue) && !!this.editingObj) ||
|
|
59589
59845
|
!this.isTwoValueEquals(qValue, newValue)) {
|
|
59590
|
-
questions[i].updateValueFromSurvey(newValue);
|
|
59846
|
+
questions[i].updateValueFromSurvey(newValue, false);
|
|
59591
59847
|
}
|
|
59592
59848
|
}
|
|
59593
59849
|
}
|
|
@@ -59682,12 +59938,12 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
|
59682
59938
|
this.locStrsChanged();
|
|
59683
59939
|
}
|
|
59684
59940
|
};
|
|
59685
|
-
SurveyModel.prototype.updateAllQuestionsValue = function () {
|
|
59941
|
+
SurveyModel.prototype.updateAllQuestionsValue = function (clearData) {
|
|
59686
59942
|
var questions = this.getAllQuestions();
|
|
59687
59943
|
for (var i = 0; i < questions.length; i++) {
|
|
59688
59944
|
var q = questions[i];
|
|
59689
59945
|
var valName = q.getValueName();
|
|
59690
|
-
q.updateValueFromSurvey(this.getValue(valName));
|
|
59946
|
+
q.updateValueFromSurvey(this.getValue(valName), clearData);
|
|
59691
59947
|
if (q.requireUpdateCommentValue) {
|
|
59692
59948
|
q.updateCommentFromSurvey(this.getComment(valName));
|
|
59693
59949
|
}
|
|
@@ -60106,7 +60362,7 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
|
60106
60362
|
mouseDown: function () { return _this.navigationMouseDown(); },
|
|
60107
60363
|
},
|
|
60108
60364
|
locTitle: this.locCompleteText,
|
|
60109
|
-
action: function () { return _this.completeLastPage(); },
|
|
60365
|
+
action: function () { return _this.taskManager.waitAndExecute(function () { return _this.completeLastPage(); }); },
|
|
60110
60366
|
component: defaultComponent
|
|
60111
60367
|
});
|
|
60112
60368
|
this.updateNavigationItemCssCallback = function () {
|
|
@@ -61287,6 +61543,11 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
|
61287
61543
|
SurveyModel.prototype.stopMovingQuestion = function () {
|
|
61288
61544
|
this.isMovingQuestion = false;
|
|
61289
61545
|
};
|
|
61546
|
+
Object.defineProperty(SurveyModel.prototype, "isQuestionDragging", {
|
|
61547
|
+
get: function () { return this.isMovingQuestion; },
|
|
61548
|
+
enumerable: false,
|
|
61549
|
+
configurable: true
|
|
61550
|
+
});
|
|
61290
61551
|
/**
|
|
61291
61552
|
* Focuses a question with a specified name. Switches the current page if needed.
|
|
61292
61553
|
* @param name A question name.
|
|
@@ -61429,7 +61690,7 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
|
61429
61690
|
}
|
|
61430
61691
|
}
|
|
61431
61692
|
else if (this.state === "running" && isStrCiEqual(layoutElement.id, "progress-" + this.progressBarType)) {
|
|
61432
|
-
if (container === "
|
|
61693
|
+
if (container === "center") {
|
|
61433
61694
|
if (this.isShowProgressBarOnTop && !this.isShowStartingPage) {
|
|
61434
61695
|
containerLayoutElements.push(layoutElement);
|
|
61435
61696
|
}
|
|
@@ -61475,6 +61736,7 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
|
61475
61736
|
}
|
|
61476
61737
|
}
|
|
61477
61738
|
}
|
|
61739
|
+
containerLayoutElements.sort(function (a, b) { return (a.index || 0) - (b.index || 0); });
|
|
61478
61740
|
return containerLayoutElements;
|
|
61479
61741
|
};
|
|
61480
61742
|
SurveyModel.prototype.processPopupVisiblityChanged = function (question, popup, visible) {
|
|
@@ -61493,15 +61755,9 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
|
61493
61755
|
Object.keys(theme).forEach(function (key) {
|
|
61494
61756
|
if (key === "header") {
|
|
61495
61757
|
_this.removeLayoutElement("advanced-header");
|
|
61496
|
-
var
|
|
61497
|
-
|
|
61498
|
-
_this.
|
|
61499
|
-
id: "advanced-header",
|
|
61500
|
-
container: "header",
|
|
61501
|
-
component: "sv-header",
|
|
61502
|
-
data: advHeader_1,
|
|
61503
|
-
processResponsiveness: function (width) { return advHeader_1.processResponsiveness(width); }
|
|
61504
|
-
});
|
|
61758
|
+
var advHeader = new _header__WEBPACK_IMPORTED_MODULE_20__["Cover"]();
|
|
61759
|
+
advHeader.fromTheme(theme);
|
|
61760
|
+
_this.insertAdvancedHeader(advHeader);
|
|
61505
61761
|
}
|
|
61506
61762
|
if (key === "isPanelless") {
|
|
61507
61763
|
_this.isCompact = theme[key];
|
|
@@ -61598,14 +61854,7 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
|
61598
61854
|
advHeader.titlePositionY = "middle";
|
|
61599
61855
|
advHeader.descriptionPositionX = target.logoPosition === "right" ? "left" : "right";
|
|
61600
61856
|
advHeader.descriptionPositionY = "middle";
|
|
61601
|
-
advHeader
|
|
61602
|
-
target.layoutElements.unshift({
|
|
61603
|
-
id: "advanced-header",
|
|
61604
|
-
container: "header",
|
|
61605
|
-
component: "sv-header",
|
|
61606
|
-
data: advHeader,
|
|
61607
|
-
processResponsiveness: function (width) { return advHeader.processResponsiveness(width); }
|
|
61608
|
-
});
|
|
61857
|
+
target.insertAdvancedHeader(advHeader);
|
|
61609
61858
|
}
|
|
61610
61859
|
}
|
|
61611
61860
|
else {
|
|
@@ -62117,6 +62366,91 @@ surveyLocalization.locales["en"] = _localization_english__WEBPACK_IMPORTED_MODUL
|
|
|
62117
62366
|
surveyLocalization.localeNames["en"] = "english";
|
|
62118
62367
|
|
|
62119
62368
|
|
|
62369
|
+
/***/ }),
|
|
62370
|
+
|
|
62371
|
+
/***/ "./src/surveyTaskManager.ts":
|
|
62372
|
+
/*!**********************************!*\
|
|
62373
|
+
!*** ./src/surveyTaskManager.ts ***!
|
|
62374
|
+
\**********************************/
|
|
62375
|
+
/*! exports provided: SurveyTaskManagerModel */
|
|
62376
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
62377
|
+
|
|
62378
|
+
"use strict";
|
|
62379
|
+
__webpack_require__.r(__webpack_exports__);
|
|
62380
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SurveyTaskManagerModel", function() { return SurveyTaskManagerModel; });
|
|
62381
|
+
/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./base */ "./src/base.ts");
|
|
62382
|
+
/* harmony import */ var _jsonobject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./jsonobject */ "./src/jsonobject.ts");
|
|
62383
|
+
var __extends = (undefined && undefined.__extends) || (function () {
|
|
62384
|
+
var extendStatics = function (d, b) {
|
|
62385
|
+
extendStatics = Object.setPrototypeOf ||
|
|
62386
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
62387
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
62388
|
+
return extendStatics(d, b);
|
|
62389
|
+
};
|
|
62390
|
+
return function (d, b) {
|
|
62391
|
+
if (typeof b !== "function" && b !== null)
|
|
62392
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
62393
|
+
extendStatics(d, b);
|
|
62394
|
+
function __() { this.constructor = d; }
|
|
62395
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
62396
|
+
};
|
|
62397
|
+
})();
|
|
62398
|
+
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
62399
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
62400
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
62401
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
62402
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
62403
|
+
};
|
|
62404
|
+
|
|
62405
|
+
|
|
62406
|
+
var SurveyTaskModel = /** @class */ (function () {
|
|
62407
|
+
function SurveyTaskModel(type) {
|
|
62408
|
+
this.type = type;
|
|
62409
|
+
this.timestamp = new Date();
|
|
62410
|
+
}
|
|
62411
|
+
return SurveyTaskModel;
|
|
62412
|
+
}());
|
|
62413
|
+
var SurveyTaskManagerModel = /** @class */ (function (_super) {
|
|
62414
|
+
__extends(SurveyTaskManagerModel, _super);
|
|
62415
|
+
function SurveyTaskManagerModel() {
|
|
62416
|
+
var _this = _super.call(this) || this;
|
|
62417
|
+
_this.taskList = [];
|
|
62418
|
+
_this.onAllTasksCompleted = _this.addEvent();
|
|
62419
|
+
return _this;
|
|
62420
|
+
}
|
|
62421
|
+
SurveyTaskManagerModel.prototype.runTask = function (type, func) {
|
|
62422
|
+
var _this = this;
|
|
62423
|
+
var task = new SurveyTaskModel(type);
|
|
62424
|
+
this.taskList.push(task);
|
|
62425
|
+
this.hasActiveTasks = true;
|
|
62426
|
+
func(function () { return _this.taskFinished(task); });
|
|
62427
|
+
return task;
|
|
62428
|
+
};
|
|
62429
|
+
SurveyTaskManagerModel.prototype.waitAndExecute = function (action) {
|
|
62430
|
+
if (!this.hasActiveTasks) {
|
|
62431
|
+
action();
|
|
62432
|
+
return;
|
|
62433
|
+
}
|
|
62434
|
+
this.onAllTasksCompleted.add(function () { action(); });
|
|
62435
|
+
};
|
|
62436
|
+
SurveyTaskManagerModel.prototype.taskFinished = function (task) {
|
|
62437
|
+
var index = this.taskList.indexOf(task);
|
|
62438
|
+
if (index > -1) {
|
|
62439
|
+
this.taskList.splice(index, 1);
|
|
62440
|
+
}
|
|
62441
|
+
if (this.hasActiveTasks && this.taskList.length == 0) {
|
|
62442
|
+
this.hasActiveTasks = false;
|
|
62443
|
+
this.onAllTasksCompleted.fire(this, {});
|
|
62444
|
+
}
|
|
62445
|
+
};
|
|
62446
|
+
__decorate([
|
|
62447
|
+
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])({ defaultValue: false })
|
|
62448
|
+
], SurveyTaskManagerModel.prototype, "hasActiveTasks", void 0);
|
|
62449
|
+
return SurveyTaskManagerModel;
|
|
62450
|
+
}(_base__WEBPACK_IMPORTED_MODULE_0__["Base"]));
|
|
62451
|
+
|
|
62452
|
+
|
|
62453
|
+
|
|
62120
62454
|
/***/ }),
|
|
62121
62455
|
|
|
62122
62456
|
/***/ "./src/surveyTimerModel.ts":
|
|
@@ -62390,6 +62724,7 @@ function createTOCListModel(survey, onAction) {
|
|
|
62390
62724
|
}, true, items.filter(function (i) { return i.id === survey.currentPage.name; })[0] || items.filter(function (i) { return i.id === pagesSource[0].name; })[0]);
|
|
62391
62725
|
listModel.allowSelection = false;
|
|
62392
62726
|
listModel.locOwner = survey;
|
|
62727
|
+
listModel.searchEnabled = false;
|
|
62393
62728
|
survey.onCurrentPageChanged.add(function (s, o) {
|
|
62394
62729
|
listModel.selectedItem = items.filter(function (i) { return i.id === survey.currentPage.name; })[0];
|
|
62395
62730
|
});
|