survey-core 1.9.119 → 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 +112 -62
- package/defaultV2.css.map +1 -1
- package/defaultV2.fontless.css +112 -62
- 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 +2 -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 +406 -190
- 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 +2 -2
- package/ts3.4/typings/defaultCss/defaultV2Css.d.ts +1 -0
- package/ts3.4/typings/question.d.ts +1 -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_signaturepad.d.ts +13 -2
- package/ts3.4/typings/survey-events-api.d.ts +3 -2
- package/ts3.4/typings/survey.d.ts +13 -9
- package/ts3.4/typings/surveyTaskManager.d.ts +16 -0
- package/typings/base-interfaces.d.ts +2 -2
- package/typings/defaultCss/defaultV2Css.d.ts +1 -0
- package/typings/question.d.ts +1 -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_signaturepad.d.ts +13 -2
- package/typings/survey-events-api.d.ts +3 -2
- package/typings/survey.d.ts +13 -8
- package/typings/surveyTaskManager.d.ts +16 -0
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
|
*/
|
|
@@ -4428,7 +4428,7 @@ var modernCss = {
|
|
|
4428
4428
|
header: "sv-title sv-container-modern__title",
|
|
4429
4429
|
headerClose: "sv-container-modern__close",
|
|
4430
4430
|
bodyContainer: "sv-components-row",
|
|
4431
|
-
body: "sv-
|
|
4431
|
+
body: "sv-body",
|
|
4432
4432
|
bodyEmpty: "sv-body sv-body--empty",
|
|
4433
4433
|
footer: "sv-footer sv-body__footer sv-clearfix",
|
|
4434
4434
|
title: "",
|
|
@@ -4883,7 +4883,7 @@ var defaultStandardCss = {
|
|
|
4883
4883
|
container: "sv_container",
|
|
4884
4884
|
header: "sv_header",
|
|
4885
4885
|
bodyContainer: "sv-components-row",
|
|
4886
|
-
body: "
|
|
4886
|
+
body: "sv_body",
|
|
4887
4887
|
bodyEmpty: "sv_body sv_body_empty",
|
|
4888
4888
|
footer: "sv_nav",
|
|
4889
4889
|
title: "",
|
|
@@ -5323,7 +5323,7 @@ var defaultV2Css = {
|
|
|
5323
5323
|
container: "sd-container-modern",
|
|
5324
5324
|
header: "sd-title sd-container-modern__title",
|
|
5325
5325
|
bodyContainer: "sv-components-row",
|
|
5326
|
-
body: "
|
|
5326
|
+
body: "sd-body",
|
|
5327
5327
|
bodyWithTimer: "sd-body--with-timer",
|
|
5328
5328
|
clockTimerRoot: "sd-timer",
|
|
5329
5329
|
clockTimerRootTop: "sd-timer--top",
|
|
@@ -5930,7 +5930,8 @@ var defaultV2Css = {
|
|
|
5930
5930
|
canvas: "sjs_sp_canvas sd-signaturepad__canvas",
|
|
5931
5931
|
backgroundImage: "sjs_sp__background-image sd-signaturepad__background-image",
|
|
5932
5932
|
clearButton: "sjs_sp_clear sd-context-btn sd-context-btn--negative sd-signaturepad__clear",
|
|
5933
|
-
clearButtonIconId: "icon-clear"
|
|
5933
|
+
clearButtonIconId: "icon-clear",
|
|
5934
|
+
loadingIndicator: "sd-signaturepad__loading-indicator"
|
|
5934
5935
|
},
|
|
5935
5936
|
saveData: {
|
|
5936
5937
|
root: "sv-save-data_root",
|
|
@@ -8254,8 +8255,13 @@ var DropdownListModel = /** @class */ (function (_super) {
|
|
|
8254
8255
|
this.popupModel.isVisible = false;
|
|
8255
8256
|
}
|
|
8256
8257
|
else if (!this.popupModel.isVisible && (event.keyCode === 13 || event.keyCode === 32)) {
|
|
8257
|
-
|
|
8258
|
-
|
|
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
|
+
}
|
|
8259
8265
|
event.preventDefault();
|
|
8260
8266
|
event.stopPropagation();
|
|
8261
8267
|
}
|
|
@@ -8263,12 +8269,10 @@ var DropdownListModel = /** @class */ (function (_super) {
|
|
|
8263
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) {
|
|
8264
8270
|
this._popupModel.isVisible = false;
|
|
8265
8271
|
this.onClear(event);
|
|
8266
|
-
this.question.survey.questionEditFinishCallback(this.question, event);
|
|
8267
8272
|
}
|
|
8268
8273
|
else {
|
|
8269
8274
|
this.listModel.selectFocusedItem();
|
|
8270
8275
|
this.onFocus(event);
|
|
8271
|
-
this.question.survey.questionEditFinishCallback(this.question, event);
|
|
8272
8276
|
}
|
|
8273
8277
|
event.preventDefault();
|
|
8274
8278
|
event.stopPropagation();
|
|
@@ -9308,8 +9312,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
9308
9312
|
//import "../../modern.scss";
|
|
9309
9313
|
var Version;
|
|
9310
9314
|
var ReleaseDate;
|
|
9311
|
-
Version = "" + "1.9.
|
|
9312
|
-
ReleaseDate = "" + "2023-
|
|
9315
|
+
Version = "" + "1.9.120";
|
|
9316
|
+
ReleaseDate = "" + "2023-12-04";
|
|
9313
9317
|
function checkLibraryVersion(ver, libraryName) {
|
|
9314
9318
|
if (Version != ver) {
|
|
9315
9319
|
var str = "survey-core has version '" + Version + "' and " + libraryName
|
|
@@ -20250,7 +20254,7 @@ var englishStrings = {
|
|
|
20250
20254
|
panelDynamicProgressText: "{0} of {1}",
|
|
20251
20255
|
panelDynamicTabTextFormat: "Panel {panelIndex}",
|
|
20252
20256
|
questionsProgressText: "Answered {0}/{1} questions",
|
|
20253
|
-
emptySurvey: "The survey doesn't contain visible
|
|
20257
|
+
emptySurvey: "The survey doesn't contain any visible elements.",
|
|
20254
20258
|
completingSurvey: "Thank you for completing the survey",
|
|
20255
20259
|
completingSurveyBefore: "Our records show that you have already completed this survey.",
|
|
20256
20260
|
loadingSurvey: "Loading Survey...",
|
|
@@ -27646,8 +27650,9 @@ var Question = /** @class */ (function (_super) {
|
|
|
27646
27650
|
return makeNameValid(name);
|
|
27647
27651
|
};
|
|
27648
27652
|
//IQuestion
|
|
27649
|
-
Question.prototype.updateValueFromSurvey = function (newValue) {
|
|
27653
|
+
Question.prototype.updateValueFromSurvey = function (newValue, clearData) {
|
|
27650
27654
|
var _this = this;
|
|
27655
|
+
if (clearData === void 0) { clearData = false; }
|
|
27651
27656
|
newValue = this.getUnbindValue(newValue);
|
|
27652
27657
|
if (!!this.valueFromDataCallback) {
|
|
27653
27658
|
newValue = this.valueFromDataCallback(newValue);
|
|
@@ -27662,6 +27667,9 @@ var Question = /** @class */ (function (_super) {
|
|
|
27662
27667
|
}
|
|
27663
27668
|
else {
|
|
27664
27669
|
this.updateValueFromSurveyCore(newValue, this.data !== this.getSurvey());
|
|
27670
|
+
if (clearData && isEmpty) {
|
|
27671
|
+
this.isValueChangedDirectly = false;
|
|
27672
|
+
}
|
|
27665
27673
|
}
|
|
27666
27674
|
this.updateDependedQuestions();
|
|
27667
27675
|
this.updateIsAnswered();
|
|
@@ -29808,7 +29816,7 @@ var QuestionSelectBase = /** @class */ (function (_super) {
|
|
|
29808
29816
|
this.onVisibleChoicesChanged();
|
|
29809
29817
|
}
|
|
29810
29818
|
};
|
|
29811
|
-
QuestionSelectBase.prototype.updateValueFromSurvey = function (newValue) {
|
|
29819
|
+
QuestionSelectBase.prototype.updateValueFromSurvey = function (newValue, clearData) {
|
|
29812
29820
|
var newComment = "";
|
|
29813
29821
|
if (this.hasOther &&
|
|
29814
29822
|
!this.isRunningChoices &&
|
|
@@ -29822,7 +29830,7 @@ var QuestionSelectBase = /** @class */ (function (_super) {
|
|
|
29822
29830
|
newComment = this.data.getComment(this.getValueName());
|
|
29823
29831
|
}
|
|
29824
29832
|
}
|
|
29825
|
-
_super.prototype.updateValueFromSurvey.call(this, newValue);
|
|
29833
|
+
_super.prototype.updateValueFromSurvey.call(this, newValue, clearData);
|
|
29826
29834
|
if ((this.isRunningChoices || this.choicesByUrl.isRunning) && !this.isEmpty()) {
|
|
29827
29835
|
this.cachedValueForUrlRequests = this.value;
|
|
29828
29836
|
}
|
|
@@ -31604,8 +31612,8 @@ var QuestionCheckboxModel = /** @class */ (function (_super) {
|
|
|
31604
31612
|
.append(this.cssClasses.itemSelectAll, options.isSelectAllItem)
|
|
31605
31613
|
.toString();
|
|
31606
31614
|
};
|
|
31607
|
-
QuestionCheckboxModel.prototype.updateValueFromSurvey = function (newValue) {
|
|
31608
|
-
_super.prototype.updateValueFromSurvey.call(this, newValue);
|
|
31615
|
+
QuestionCheckboxModel.prototype.updateValueFromSurvey = function (newValue, clearData) {
|
|
31616
|
+
_super.prototype.updateValueFromSurvey.call(this, newValue, clearData);
|
|
31609
31617
|
this.invisibleOldValues = {};
|
|
31610
31618
|
};
|
|
31611
31619
|
QuestionCheckboxModel.prototype.setDefaultValue = function () {
|
|
@@ -33823,8 +33831,8 @@ var QuestionExpressionModel = /** @class */ (function (_super) {
|
|
|
33823
33831
|
QuestionExpressionModel.prototype.onValueChanged = function () {
|
|
33824
33832
|
this.updateFormatedValue();
|
|
33825
33833
|
};
|
|
33826
|
-
QuestionExpressionModel.prototype.updateValueFromSurvey = function (newValue) {
|
|
33827
|
-
_super.prototype.updateValueFromSurvey.call(this, newValue);
|
|
33834
|
+
QuestionExpressionModel.prototype.updateValueFromSurvey = function (newValue, clearData) {
|
|
33835
|
+
_super.prototype.updateValueFromSurvey.call(this, newValue, clearData);
|
|
33828
33836
|
this.updateFormatedValue();
|
|
33829
33837
|
};
|
|
33830
33838
|
QuestionExpressionModel.prototype.getDisplayValueCore = function (keysAsText, value) {
|
|
@@ -34178,11 +34186,13 @@ _questionfactory__WEBPACK_IMPORTED_MODULE_3__["QuestionFactory"].Instance.regist
|
|
|
34178
34186
|
/*!******************************!*\
|
|
34179
34187
|
!*** ./src/question_file.ts ***!
|
|
34180
34188
|
\******************************/
|
|
34181
|
-
/*! exports provided: QuestionFileModel, FileLoader */
|
|
34189
|
+
/*! exports provided: dataUrl2File, QuestionFileModelBase, QuestionFileModel, FileLoader */
|
|
34182
34190
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
34183
34191
|
|
|
34184
34192
|
"use strict";
|
|
34185
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; });
|
|
34186
34196
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "QuestionFileModel", function() { return QuestionFileModel; });
|
|
34187
34197
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FileLoader", function() { return FileLoader; });
|
|
34188
34198
|
/* harmony import */ var _question__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./question */ "./src/question.ts");
|
|
@@ -34231,17 +34241,16 @@ var __decorate = (undefined && undefined.__decorate) || function (decorators, ta
|
|
|
34231
34241
|
|
|
34232
34242
|
|
|
34233
34243
|
|
|
34234
|
-
|
|
34235
|
-
|
|
34236
|
-
|
|
34237
|
-
|
|
34238
|
-
|
|
34239
|
-
var
|
|
34240
|
-
__extends(
|
|
34241
|
-
function
|
|
34242
|
-
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;
|
|
34243
34253
|
_this.isUploading = false;
|
|
34244
|
-
_this.isDragging = false;
|
|
34245
34254
|
/**
|
|
34246
34255
|
* An event that is raised after the upload state has changed.
|
|
34247
34256
|
*
|
|
@@ -34254,6 +34263,124 @@ var QuestionFileModel = /** @class */ (function (_super) {
|
|
|
34254
34263
|
*/
|
|
34255
34264
|
_this.onUploadStateChanged = _this.addEvent();
|
|
34256
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;
|
|
34257
34384
|
_this.fileNavigator = new _actions_container__WEBPACK_IMPORTED_MODULE_7__["ActionContainer"]();
|
|
34258
34385
|
_this.canFlipCameraValue = undefined;
|
|
34259
34386
|
_this.prevPreviewLength = 0;
|
|
@@ -34558,15 +34685,6 @@ var QuestionFileModel = /** @class */ (function (_super) {
|
|
|
34558
34685
|
QuestionFileModel.prototype.getType = function () {
|
|
34559
34686
|
return "file";
|
|
34560
34687
|
};
|
|
34561
|
-
QuestionFileModel.prototype.clearValue = function () {
|
|
34562
|
-
this.clearOnDeletingContainer();
|
|
34563
|
-
_super.prototype.clearValue.call(this);
|
|
34564
|
-
};
|
|
34565
|
-
QuestionFileModel.prototype.clearOnDeletingContainer = function () {
|
|
34566
|
-
if (!this.survey)
|
|
34567
|
-
return;
|
|
34568
|
-
this.survey.clearFiles(this, this.name, this.value, null, function () { });
|
|
34569
|
-
};
|
|
34570
34688
|
Object.defineProperty(QuestionFileModel.prototype, "showPreview", {
|
|
34571
34689
|
/**
|
|
34572
34690
|
* Disable this property only to implement a custom preview.
|
|
@@ -34637,36 +34755,6 @@ var QuestionFileModel = /** @class */ (function (_super) {
|
|
|
34637
34755
|
enumerable: false,
|
|
34638
34756
|
configurable: true
|
|
34639
34757
|
});
|
|
34640
|
-
Object.defineProperty(QuestionFileModel.prototype, "storeDataAsText", {
|
|
34641
|
-
/**
|
|
34642
|
-
* Specifies whether to store file content as text in `SurveyModel`'s [`data`](https://surveyjs.io/form-library/documentation/surveymodel#data) property.
|
|
34643
|
-
*
|
|
34644
|
-
* 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.
|
|
34645
|
-
*/
|
|
34646
|
-
get: function () {
|
|
34647
|
-
return this.getPropertyValue("storeDataAsText");
|
|
34648
|
-
},
|
|
34649
|
-
set: function (val) {
|
|
34650
|
-
this.setPropertyValue("storeDataAsText", val);
|
|
34651
|
-
},
|
|
34652
|
-
enumerable: false,
|
|
34653
|
-
configurable: true
|
|
34654
|
-
});
|
|
34655
|
-
Object.defineProperty(QuestionFileModel.prototype, "waitForUpload", {
|
|
34656
|
-
/**
|
|
34657
|
-
* Enable this property if you want to wait until files are uploaded to complete the survey.
|
|
34658
|
-
*
|
|
34659
|
-
* Default value: `false`
|
|
34660
|
-
*/
|
|
34661
|
-
get: function () {
|
|
34662
|
-
return this.getPropertyValue("waitForUpload");
|
|
34663
|
-
},
|
|
34664
|
-
set: function (val) {
|
|
34665
|
-
this.setPropertyValue("waitForUpload", val);
|
|
34666
|
-
},
|
|
34667
|
-
enumerable: false,
|
|
34668
|
-
configurable: true
|
|
34669
|
-
});
|
|
34670
34758
|
Object.defineProperty(QuestionFileModel.prototype, "allowImagesPreview", {
|
|
34671
34759
|
/**
|
|
34672
34760
|
* Specifies whether to show a preview of image files.
|
|
@@ -34854,13 +34942,6 @@ var QuestionFileModel = /** @class */ (function (_super) {
|
|
|
34854
34942
|
enumerable: false,
|
|
34855
34943
|
configurable: true
|
|
34856
34944
|
});
|
|
34857
|
-
Object.defineProperty(QuestionFileModel.prototype, "showLoadingIndicator", {
|
|
34858
|
-
get: function () {
|
|
34859
|
-
return this.isUploading && this.isDefaultV2Theme;
|
|
34860
|
-
},
|
|
34861
|
-
enumerable: false,
|
|
34862
|
-
configurable: true
|
|
34863
|
-
});
|
|
34864
34945
|
Object.defineProperty(QuestionFileModel.prototype, "allowShowPreview", {
|
|
34865
34946
|
get: function () {
|
|
34866
34947
|
var isShowLoadingIndicator = this.showLoadingIndicator;
|
|
@@ -34929,6 +35010,15 @@ var QuestionFileModel = /** @class */ (function (_super) {
|
|
|
34929
35010
|
}
|
|
34930
35011
|
});
|
|
34931
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
|
+
};
|
|
34932
35022
|
/**
|
|
34933
35023
|
* Loads multiple files into the question.
|
|
34934
35024
|
* @param files An array of [File](https://developer.mozilla.org/en-US/docs/Web/API/File) objects.
|
|
@@ -34960,42 +35050,7 @@ var QuestionFileModel = /** @class */ (function (_super) {
|
|
|
34960
35050
|
});
|
|
34961
35051
|
}
|
|
34962
35052
|
else {
|
|
34963
|
-
|
|
34964
|
-
_this.survey.uploadFiles(_this, _this.name, files, function (arg1, arg2) {
|
|
34965
|
-
if (Array.isArray(arg1)) {
|
|
34966
|
-
_this.value = (_this.value || []).concat(arg1.map(function (r) {
|
|
34967
|
-
return {
|
|
34968
|
-
name: r.file.name,
|
|
34969
|
-
type: r.file.type,
|
|
34970
|
-
content: r.content,
|
|
34971
|
-
};
|
|
34972
|
-
}));
|
|
34973
|
-
if (Array.isArray(arg2)) {
|
|
34974
|
-
arg2.forEach(function (error) { return _this.errors.push(new _error__WEBPACK_IMPORTED_MODULE_4__["UploadingFileError"](error, _this)); });
|
|
34975
|
-
_this.stateChanged("error");
|
|
34976
|
-
}
|
|
34977
|
-
}
|
|
34978
|
-
if (arg1 === "success" && Array.isArray(arg2)) {
|
|
34979
|
-
_this.value = (_this.value || []).concat(arg2.map(function (r) {
|
|
34980
|
-
return {
|
|
34981
|
-
name: r.file.name,
|
|
34982
|
-
type: r.file.type,
|
|
34983
|
-
content: r.content,
|
|
34984
|
-
};
|
|
34985
|
-
}));
|
|
34986
|
-
}
|
|
34987
|
-
if (arg1 === "error") {
|
|
34988
|
-
if (typeof (arg2) === "string") {
|
|
34989
|
-
_this.errors.push(new _error__WEBPACK_IMPORTED_MODULE_4__["UploadingFileError"](arg2, _this));
|
|
34990
|
-
}
|
|
34991
|
-
if (Array.isArray(arg2) && arg2.length > 0) {
|
|
34992
|
-
arg2.forEach(function (error) { return _this.errors.push(new _error__WEBPACK_IMPORTED_MODULE_4__["UploadingFileError"](error, _this)); });
|
|
34993
|
-
}
|
|
34994
|
-
_this.stateChanged("error");
|
|
34995
|
-
}
|
|
34996
|
-
_this.stateChanged("loaded");
|
|
34997
|
-
});
|
|
34998
|
-
}
|
|
35053
|
+
_this.uploadFiles(files);
|
|
34999
35054
|
}
|
|
35000
35055
|
};
|
|
35001
35056
|
if (this.allowMultiple) {
|
|
@@ -35070,29 +35125,6 @@ var QuestionFileModel = /** @class */ (function (_super) {
|
|
|
35070
35125
|
QuestionFileModel.prototype.getIsQuestionReady = function () {
|
|
35071
35126
|
return _super.prototype.getIsQuestionReady.call(this) && !this.isFileLoading;
|
|
35072
35127
|
};
|
|
35073
|
-
QuestionFileModel.prototype.onCheckForErrors = function (errors, isOnValueChanged) {
|
|
35074
|
-
_super.prototype.onCheckForErrors.call(this, errors, isOnValueChanged);
|
|
35075
|
-
if (this.isUploading && this.waitForUpload) {
|
|
35076
|
-
errors.push(new _error__WEBPACK_IMPORTED_MODULE_4__["UploadingFileError"](this.getLocalizationString("uploadingFile"), this));
|
|
35077
|
-
}
|
|
35078
|
-
};
|
|
35079
|
-
QuestionFileModel.prototype.stateChanged = function (state) {
|
|
35080
|
-
if (this.currentState == state) {
|
|
35081
|
-
return;
|
|
35082
|
-
}
|
|
35083
|
-
if (state === "loading") {
|
|
35084
|
-
this.isUploading = true;
|
|
35085
|
-
}
|
|
35086
|
-
if (state === "loaded") {
|
|
35087
|
-
this.isUploading = false;
|
|
35088
|
-
}
|
|
35089
|
-
if (state === "error") {
|
|
35090
|
-
this.isUploading = false;
|
|
35091
|
-
}
|
|
35092
|
-
this.currentState = state;
|
|
35093
|
-
this.onStateChanged.fire(this, { state: state });
|
|
35094
|
-
this.onUploadStateChanged.fire(this, { state: state });
|
|
35095
|
-
};
|
|
35096
35128
|
QuestionFileModel.prototype.allFilesOk = function (files) {
|
|
35097
35129
|
var _this = this;
|
|
35098
35130
|
var errorLength = this.errors ? this.errors.length : 0;
|
|
@@ -35302,18 +35334,12 @@ var QuestionFileModel = /** @class */ (function (_super) {
|
|
|
35302
35334
|
this.closeVideoStream();
|
|
35303
35335
|
_super.prototype.dispose.call(this);
|
|
35304
35336
|
};
|
|
35305
|
-
__decorate([
|
|
35306
|
-
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])()
|
|
35307
|
-
], QuestionFileModel.prototype, "isUploading", void 0);
|
|
35308
35337
|
__decorate([
|
|
35309
35338
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])()
|
|
35310
35339
|
], QuestionFileModel.prototype, "isDragging", void 0);
|
|
35311
35340
|
__decorate([
|
|
35312
35341
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["propertyArray"])({})
|
|
35313
35342
|
], QuestionFileModel.prototype, "previewValue", void 0);
|
|
35314
|
-
__decorate([
|
|
35315
|
-
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])({ defaultValue: "empty" })
|
|
35316
|
-
], QuestionFileModel.prototype, "currentState", void 0);
|
|
35317
35343
|
__decorate([
|
|
35318
35344
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])({ defaultValue: 0 })
|
|
35319
35345
|
], QuestionFileModel.prototype, "indexToShow", void 0);
|
|
@@ -35378,7 +35404,7 @@ var QuestionFileModel = /** @class */ (function (_super) {
|
|
|
35378
35404
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])()
|
|
35379
35405
|
], QuestionFileModel.prototype, "locRenderedPlaceholderValue", void 0);
|
|
35380
35406
|
return QuestionFileModel;
|
|
35381
|
-
}(
|
|
35407
|
+
}(QuestionFileModelBase));
|
|
35382
35408
|
|
|
35383
35409
|
_jsonobject__WEBPACK_IMPORTED_MODULE_1__["Serializer"].addClass("file", [
|
|
35384
35410
|
{ name: "showCommentArea:switch", layout: "row", visible: true, category: "general" },
|
|
@@ -37905,8 +37931,9 @@ var MatrixDropdownRowModelBase = /** @class */ (function () {
|
|
|
37905
37931
|
if (!_helpers__WEBPACK_IMPORTED_MODULE_2__["Helpers"].isValueEmpty(value)) {
|
|
37906
37932
|
for (var i = 0; i < questions.length; i++) {
|
|
37907
37933
|
var key = questions[i].getValueName();
|
|
37908
|
-
|
|
37909
|
-
|
|
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;
|
|
37910
37937
|
}
|
|
37911
37938
|
}
|
|
37912
37939
|
}
|
|
@@ -39437,6 +39464,7 @@ var QuestionMatrixDropdownModelBase = /** @class */ (function (_super) {
|
|
|
39437
39464
|
var questionPlainData = _super.prototype.getPlainData.call(this, options);
|
|
39438
39465
|
if (!!questionPlainData) {
|
|
39439
39466
|
questionPlainData.isNode = true;
|
|
39467
|
+
var prevData = Array.isArray(questionPlainData.data) ? [].concat(questionPlainData.data) : [];
|
|
39440
39468
|
questionPlainData.data = this.visibleRows.map(function (row) {
|
|
39441
39469
|
var rowDataItem = {
|
|
39442
39470
|
name: row.dataName,
|
|
@@ -39458,6 +39486,7 @@ var QuestionMatrixDropdownModelBase = /** @class */ (function (_super) {
|
|
|
39458
39486
|
});
|
|
39459
39487
|
return rowDataItem;
|
|
39460
39488
|
});
|
|
39489
|
+
questionPlainData.data = questionPlainData.data.concat(prevData);
|
|
39461
39490
|
}
|
|
39462
39491
|
return questionPlainData;
|
|
39463
39492
|
};
|
|
@@ -39869,7 +39898,7 @@ var QuestionMatrixDropdownModelBase = /** @class */ (function (_super) {
|
|
|
39869
39898
|
columnValue = newRowValue[columnName];
|
|
39870
39899
|
}
|
|
39871
39900
|
this.isRowChanging = true;
|
|
39872
|
-
|
|
39901
|
+
_jsonobject__WEBPACK_IMPORTED_MODULE_0__["Serializer"].setObjPropertyValue(rowObj, columnName, columnValue);
|
|
39873
39902
|
this.isRowChanging = false;
|
|
39874
39903
|
this.onCellValueChanged(row, columnName, rowObj);
|
|
39875
39904
|
}
|
|
@@ -46759,6 +46788,7 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
|
46759
46788
|
var questionPlainData = _super.prototype.getPlainData.call(this, options);
|
|
46760
46789
|
if (!!questionPlainData) {
|
|
46761
46790
|
questionPlainData.isNode = true;
|
|
46791
|
+
var prevData = Array.isArray(questionPlainData.data) ? [].concat(questionPlainData.data) : [];
|
|
46762
46792
|
questionPlainData.data = this.panels.map(function (panel, index) {
|
|
46763
46793
|
var panelDataItem = {
|
|
46764
46794
|
name: panel.name || index,
|
|
@@ -46778,6 +46808,7 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
|
46778
46808
|
});
|
|
46779
46809
|
return panelDataItem;
|
|
46780
46810
|
});
|
|
46811
|
+
questionPlainData.data = questionPlainData.data.concat(prevData);
|
|
46781
46812
|
}
|
|
46782
46813
|
return questionPlainData;
|
|
46783
46814
|
};
|
|
@@ -47948,6 +47979,24 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_3__["Serializer"].addClass("ranking", [
|
|
|
47948
47979
|
visible: true,
|
|
47949
47980
|
isSerializable: true,
|
|
47950
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
|
+
},
|
|
47951
48000
|
{
|
|
47952
48001
|
name: "maxSelectedChoices:number",
|
|
47953
48002
|
visible: true,
|
|
@@ -49099,10 +49148,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
49099
49148
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "QuestionSignaturePadModel", function() { return QuestionSignaturePadModel; });
|
|
49100
49149
|
/* harmony import */ var _jsonobject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./jsonobject */ "./src/jsonobject.ts");
|
|
49101
49150
|
/* harmony import */ var _questionfactory__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./questionfactory */ "./src/questionfactory.ts");
|
|
49102
|
-
/* harmony import */ var
|
|
49103
|
-
/* harmony import */ var
|
|
49104
|
-
/* harmony import */ var
|
|
49105
|
-
/* 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");
|
|
49106
49155
|
var __extends = (undefined && undefined.__extends) || (function () {
|
|
49107
49156
|
var extendStatics = function (d, b) {
|
|
49108
49157
|
extendStatics = Object.setPrototypeOf ||
|
|
@@ -49146,6 +49195,16 @@ var QuestionSignaturePadModel = /** @class */ (function (_super) {
|
|
|
49146
49195
|
_this.scaleCanvas(false, true);
|
|
49147
49196
|
_this.refreshCanvas();
|
|
49148
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
|
+
};
|
|
49149
49208
|
return _this;
|
|
49150
49209
|
}
|
|
49151
49210
|
QuestionSignaturePadModel.prototype.getPenColorFromTheme = function () {
|
|
@@ -49162,16 +49221,18 @@ var QuestionSignaturePadModel = /** @class */ (function (_super) {
|
|
|
49162
49221
|
signaturePad.backgroundColor = background || backgroundColorFromTheme || backgroundColorProperty.defaultValue || "#ffffff";
|
|
49163
49222
|
};
|
|
49164
49223
|
QuestionSignaturePadModel.prototype.getCssRoot = function (cssClasses) {
|
|
49165
|
-
return new
|
|
49224
|
+
return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_3__["CssClassBuilder"]()
|
|
49166
49225
|
.append(_super.prototype.getCssRoot.call(this, cssClasses))
|
|
49167
49226
|
.append(cssClasses.small, this.signatureWidth.toString() === "300")
|
|
49168
49227
|
.toString();
|
|
49169
49228
|
};
|
|
49229
|
+
QuestionSignaturePadModel.prototype.getFormat = function () {
|
|
49230
|
+
return this.dataFormat === "jpeg" ? "image/jpeg" :
|
|
49231
|
+
(this.dataFormat === "svg" ? "image/svg+xml" : "");
|
|
49232
|
+
};
|
|
49170
49233
|
QuestionSignaturePadModel.prototype.updateValue = function () {
|
|
49171
49234
|
if (this.signaturePad) {
|
|
49172
|
-
var
|
|
49173
|
-
(this.dataFormat === "svg" ? "image/svg+xml" : "");
|
|
49174
|
-
var data = this.signaturePad.toDataURL(format);
|
|
49235
|
+
var data = this.signaturePad.toDataURL(this.getFormat());
|
|
49175
49236
|
this.valueIsUpdatingInternally = true;
|
|
49176
49237
|
this.value = data;
|
|
49177
49238
|
this.valueIsUpdatingInternally = false;
|
|
@@ -49183,6 +49244,7 @@ var QuestionSignaturePadModel = /** @class */ (function (_super) {
|
|
|
49183
49244
|
QuestionSignaturePadModel.prototype.afterRenderQuestionElement = function (el) {
|
|
49184
49245
|
if (!!el) {
|
|
49185
49246
|
this.initSignaturePad(el);
|
|
49247
|
+
this.element = el;
|
|
49186
49248
|
}
|
|
49187
49249
|
_super.prototype.afterRenderQuestionElement.call(this, el);
|
|
49188
49250
|
};
|
|
@@ -49216,15 +49278,34 @@ var QuestionSignaturePadModel = /** @class */ (function (_super) {
|
|
|
49216
49278
|
this.refreshCanvas();
|
|
49217
49279
|
}
|
|
49218
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
|
+
};
|
|
49219
49296
|
QuestionSignaturePadModel.prototype.refreshCanvas = function () {
|
|
49220
|
-
|
|
49221
|
-
|
|
49222
|
-
if (!data) {
|
|
49223
|
-
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);
|
|
49224
49299
|
this.signaturePad.clear();
|
|
49300
|
+
this.valueWasChangedFromLastUpload = false;
|
|
49225
49301
|
}
|
|
49226
49302
|
else {
|
|
49227
|
-
this.
|
|
49303
|
+
if (this.storeDataAsText) {
|
|
49304
|
+
this.fromDataUrl(this.value);
|
|
49305
|
+
}
|
|
49306
|
+
else {
|
|
49307
|
+
this.fromUrl(this.value);
|
|
49308
|
+
}
|
|
49228
49309
|
}
|
|
49229
49310
|
};
|
|
49230
49311
|
QuestionSignaturePadModel.prototype.initSignaturePad = function (el) {
|
|
@@ -49232,7 +49313,7 @@ var QuestionSignaturePadModel = /** @class */ (function (_super) {
|
|
|
49232
49313
|
var canvas = el.getElementsByTagName("canvas")[0];
|
|
49233
49314
|
this.canvas = canvas;
|
|
49234
49315
|
this.resizeCanvas();
|
|
49235
|
-
var signaturePad = new
|
|
49316
|
+
var signaturePad = new signature_pad__WEBPACK_IMPORTED_MODULE_2__["default"](canvas, { backgroundColor: "#ffffff" });
|
|
49236
49317
|
this.signaturePad = signaturePad;
|
|
49237
49318
|
if (this.isInputReadOnly) {
|
|
49238
49319
|
signaturePad.off();
|
|
@@ -49253,7 +49334,12 @@ var QuestionSignaturePadModel = /** @class */ (function (_super) {
|
|
|
49253
49334
|
}, { once: false });
|
|
49254
49335
|
signaturePad.addEventListener("endStroke", function () {
|
|
49255
49336
|
_this.isDrawingValue = false;
|
|
49256
|
-
_this.
|
|
49337
|
+
if (_this.storeDataAsText) {
|
|
49338
|
+
_this.updateValue();
|
|
49339
|
+
}
|
|
49340
|
+
else {
|
|
49341
|
+
_this.valueWasChangedFromLastUpload = true;
|
|
49342
|
+
}
|
|
49257
49343
|
}, { once: false });
|
|
49258
49344
|
this.updateValueHandler();
|
|
49259
49345
|
this.readOnlyChangedCallback();
|
|
@@ -49368,7 +49454,9 @@ var QuestionSignaturePadModel = /** @class */ (function (_super) {
|
|
|
49368
49454
|
});
|
|
49369
49455
|
Object.defineProperty(QuestionSignaturePadModel.prototype, "canShowClearButton", {
|
|
49370
49456
|
get: function () {
|
|
49371
|
-
|
|
49457
|
+
var hasSignature = !this.nothingIsDrawn();
|
|
49458
|
+
var isUploading = this.isUploading;
|
|
49459
|
+
return !this.isInputReadOnly && this.allowClear && hasSignature && !isUploading;
|
|
49372
49460
|
},
|
|
49373
49461
|
enumerable: false,
|
|
49374
49462
|
configurable: true
|
|
@@ -49437,22 +49525,39 @@ var QuestionSignaturePadModel = /** @class */ (function (_super) {
|
|
|
49437
49525
|
enumerable: false,
|
|
49438
49526
|
configurable: true
|
|
49439
49527
|
});
|
|
49440
|
-
QuestionSignaturePadModel.prototype.
|
|
49441
|
-
var showPlaceholder = this.showPlaceholder;
|
|
49528
|
+
QuestionSignaturePadModel.prototype.nothingIsDrawn = function () {
|
|
49442
49529
|
var isDrawing = this.isDrawingValue;
|
|
49443
49530
|
var isEmpty = this.isEmpty();
|
|
49444
|
-
|
|
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();
|
|
49445
49550
|
};
|
|
49446
49551
|
QuestionSignaturePadModel.prototype.endLoadingFromJson = function () {
|
|
49447
49552
|
_super.prototype.endLoadingFromJson.call(this);
|
|
49448
49553
|
//todo: need to remove this code
|
|
49449
49554
|
if (this.signatureWidth === 300 && !!this.width && typeof this.width === "number" && this.width) {
|
|
49450
|
-
|
|
49555
|
+
_console_warnings__WEBPACK_IMPORTED_MODULE_4__["ConsoleWarnings"].warn("Use signatureWidth property to set width for the signature pad");
|
|
49451
49556
|
this.signatureWidth = this.width;
|
|
49452
49557
|
this.width = undefined;
|
|
49453
49558
|
}
|
|
49454
49559
|
if (this.signatureHeight === 200 && !!this.height) {
|
|
49455
|
-
|
|
49560
|
+
_console_warnings__WEBPACK_IMPORTED_MODULE_4__["ConsoleWarnings"].warn("Use signatureHeight property to set width for the signature pad");
|
|
49456
49561
|
this.signatureHeight = this.height;
|
|
49457
49562
|
this.height = undefined;
|
|
49458
49563
|
}
|
|
@@ -49460,6 +49565,12 @@ var QuestionSignaturePadModel = /** @class */ (function (_super) {
|
|
|
49460
49565
|
__decorate([
|
|
49461
49566
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])({ defaultValue: false })
|
|
49462
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);
|
|
49463
49574
|
__decorate([
|
|
49464
49575
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])()
|
|
49465
49576
|
], QuestionSignaturePadModel.prototype, "signatureAutoScaleEnabled", void 0);
|
|
@@ -49476,7 +49587,7 @@ var QuestionSignaturePadModel = /** @class */ (function (_super) {
|
|
|
49476
49587
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])({ localizable: { defaultStr: "signaturePlaceHolder" } })
|
|
49477
49588
|
], QuestionSignaturePadModel.prototype, "placeholder", void 0);
|
|
49478
49589
|
return QuestionSignaturePadModel;
|
|
49479
|
-
}(
|
|
49590
|
+
}(_question_file__WEBPACK_IMPORTED_MODULE_5__["QuestionFileModelBase"]));
|
|
49480
49591
|
|
|
49481
49592
|
function correctFormatData(val) {
|
|
49482
49593
|
if (!val)
|
|
@@ -49558,6 +49669,8 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_0__["Serializer"].addClass("signaturepad",
|
|
|
49558
49669
|
},
|
|
49559
49670
|
{ name: "defaultValue", visible: false },
|
|
49560
49671
|
{ name: "correctAnswer", visible: false },
|
|
49672
|
+
{ name: "storeDataAsText:boolean", default: true },
|
|
49673
|
+
{ name: "waitForUpload:boolean", default: false },
|
|
49561
49674
|
], function () {
|
|
49562
49675
|
return new QuestionSignaturePadModel("");
|
|
49563
49676
|
}, "question");
|
|
@@ -53688,6 +53801,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
53688
53801
|
/* harmony import */ var _notifier__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./notifier */ "./src/notifier.ts");
|
|
53689
53802
|
/* harmony import */ var _header__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./header */ "./src/header.ts");
|
|
53690
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");
|
|
53691
53805
|
var __extends = (undefined && undefined.__extends) || (function () {
|
|
53692
53806
|
var extendStatics = function (d, b) {
|
|
53693
53807
|
extendStatics = Object.setPrototypeOf ||
|
|
@@ -53729,6 +53843,7 @@ var __decorate = (undefined && undefined.__decorate) || function (decorators, ta
|
|
|
53729
53843
|
|
|
53730
53844
|
|
|
53731
53845
|
|
|
53846
|
+
|
|
53732
53847
|
|
|
53733
53848
|
|
|
53734
53849
|
/**
|
|
@@ -54005,6 +54120,8 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
|
54005
54120
|
* For information on event handler parameters, refer to descriptions within the interface.
|
|
54006
54121
|
*
|
|
54007
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))
|
|
54008
54125
|
* @see onGetQuestionTitle
|
|
54009
54126
|
* @see onGetQuestionNo
|
|
54010
54127
|
*/
|
|
@@ -54044,7 +54161,7 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
|
54044
54161
|
*/
|
|
54045
54162
|
_this.onGetResult = _this.addEvent();
|
|
54046
54163
|
/**
|
|
54047
|
-
* 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.
|
|
54048
54165
|
*
|
|
54049
54166
|
* For information on event handler parameters, refer to descriptions within the interface.
|
|
54050
54167
|
*
|
|
@@ -54066,7 +54183,7 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
|
54066
54183
|
*/
|
|
54067
54184
|
_this.onDownloadFile = _this.addEvent();
|
|
54068
54185
|
/**
|
|
54069
|
-
* 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.
|
|
54070
54187
|
*
|
|
54071
54188
|
* For information on event handler parameters, refer to descriptions within the interface.
|
|
54072
54189
|
*
|
|
@@ -54442,6 +54559,7 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
|
54442
54559
|
_this.needRenderIcons = true;
|
|
54443
54560
|
_this.skippedPages = [];
|
|
54444
54561
|
_this.skeletonComponentName = "sv-skeleton";
|
|
54562
|
+
_this.taskManager = new _surveyTaskManager__WEBPACK_IMPORTED_MODULE_22__["SurveyTaskManagerModel"]();
|
|
54445
54563
|
if (typeof document !== "undefined") {
|
|
54446
54564
|
SurveyModel.stylesManager = new _stylesmanager__WEBPACK_IMPORTED_MODULE_11__["StylesManager"]();
|
|
54447
54565
|
}
|
|
@@ -54449,6 +54567,7 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
|
54449
54567
|
_this.createHtmlLocString("completedHtml", "completingSurvey", htmlCallBack);
|
|
54450
54568
|
_this.createHtmlLocString("completedBeforeHtml", "completingSurveyBefore", htmlCallBack, "completed-before");
|
|
54451
54569
|
_this.createHtmlLocString("loadingHtml", "loadingSurvey", htmlCallBack, "loading");
|
|
54570
|
+
_this.createLocalizableString("emptySurveyText", _this, true, "emptySurvey");
|
|
54452
54571
|
_this.createLocalizableString("logo", _this, false);
|
|
54453
54572
|
_this.createLocalizableString("startSurveyText", _this, false, true);
|
|
54454
54573
|
_this.createLocalizableString("pagePrevText", _this, false, true);
|
|
@@ -55692,11 +55811,14 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
|
55692
55811
|
};
|
|
55693
55812
|
Object.defineProperty(SurveyModel.prototype, "emptySurveyText", {
|
|
55694
55813
|
/**
|
|
55695
|
-
*
|
|
55814
|
+
* A message that is displayed when a survey does not contain visible pages or questions.
|
|
55696
55815
|
* @see [Localization & Globalization](https://surveyjs.io/form-library/documentation/survey-localization)
|
|
55697
55816
|
*/
|
|
55698
55817
|
get: function () {
|
|
55699
|
-
return this.
|
|
55818
|
+
return this.getLocalizableStringText("emptySurveyText");
|
|
55819
|
+
},
|
|
55820
|
+
set: function (val) {
|
|
55821
|
+
this.setLocalizableStringText("emptySurveyText", val);
|
|
55700
55822
|
},
|
|
55701
55823
|
enumerable: false,
|
|
55702
55824
|
configurable: true
|
|
@@ -56735,7 +56857,7 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
|
56735
56857
|
},
|
|
56736
56858
|
set: function (data) {
|
|
56737
56859
|
this.valuesHash = {};
|
|
56738
|
-
this.setDataCore(data);
|
|
56860
|
+
this.setDataCore(data, !data);
|
|
56739
56861
|
},
|
|
56740
56862
|
enumerable: false,
|
|
56741
56863
|
configurable: true
|
|
@@ -56755,17 +56877,21 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
|
56755
56877
|
this.mergeValues(data, newData);
|
|
56756
56878
|
this.setDataCore(newData);
|
|
56757
56879
|
};
|
|
56758
|
-
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
|
+
}
|
|
56759
56885
|
if (data) {
|
|
56760
56886
|
for (var key in data) {
|
|
56761
56887
|
this.setDataValueCore(this.valuesHash, key, data[key]);
|
|
56762
56888
|
}
|
|
56763
56889
|
}
|
|
56764
|
-
this.updateAllQuestionsValue();
|
|
56890
|
+
this.updateAllQuestionsValue(clearData);
|
|
56765
56891
|
this.notifyAllQuestionsOnValueChanged();
|
|
56766
56892
|
this.notifyElementsOnAnyValueOrVariableChanged("");
|
|
56767
56893
|
this.runConditions();
|
|
56768
|
-
this.updateAllQuestionsValue();
|
|
56894
|
+
this.updateAllQuestionsValue(clearData);
|
|
56769
56895
|
};
|
|
56770
56896
|
SurveyModel.prototype.getStructuredData = function (includePages, level) {
|
|
56771
56897
|
if (includePages === void 0) { includePages = true; }
|
|
@@ -57460,8 +57586,7 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
|
57460
57586
|
this.isLoading = false;
|
|
57461
57587
|
this.completedByTriggers = undefined;
|
|
57462
57588
|
if (clearData) {
|
|
57463
|
-
this.
|
|
57464
|
-
this.variablesHash = {};
|
|
57589
|
+
this.setDataCore(null, true);
|
|
57465
57590
|
}
|
|
57466
57591
|
this.timerModel.spent = 0;
|
|
57467
57592
|
for (var i = 0; i < this.pages.length; i++) {
|
|
@@ -59277,23 +59402,29 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
|
59277
59402
|
* }
|
|
59278
59403
|
* );
|
|
59279
59404
|
* ```
|
|
59280
|
-
* @param question A [File Upload question instance](https://surveyjs.io/form-library/documentation/api-reference/file-model).
|
|
59281
|
-
* @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).
|
|
59282
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.
|
|
59283
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.
|
|
59284
59409
|
* @see onUploadFiles
|
|
59285
59410
|
* @see downloadFile
|
|
59286
59411
|
*/
|
|
59287
59412
|
SurveyModel.prototype.uploadFiles = function (question, name, files, callback) {
|
|
59413
|
+
var _this = this;
|
|
59288
59414
|
if (this.onUploadFiles.isEmpty) {
|
|
59289
59415
|
callback("error", this.getLocString("noUploadFilesHandler"));
|
|
59290
59416
|
}
|
|
59291
59417
|
else {
|
|
59292
|
-
this.
|
|
59293
|
-
|
|
59294
|
-
|
|
59295
|
-
|
|
59296
|
-
|
|
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
|
+
});
|
|
59297
59428
|
});
|
|
59298
59429
|
}
|
|
59299
59430
|
if (this.surveyPostId) {
|
|
@@ -59712,7 +59843,7 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
|
59712
59843
|
var qValue = questions[i].value;
|
|
59713
59844
|
if ((qValue === newValue && Array.isArray(qValue) && !!this.editingObj) ||
|
|
59714
59845
|
!this.isTwoValueEquals(qValue, newValue)) {
|
|
59715
|
-
questions[i].updateValueFromSurvey(newValue);
|
|
59846
|
+
questions[i].updateValueFromSurvey(newValue, false);
|
|
59716
59847
|
}
|
|
59717
59848
|
}
|
|
59718
59849
|
}
|
|
@@ -59807,12 +59938,12 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
|
59807
59938
|
this.locStrsChanged();
|
|
59808
59939
|
}
|
|
59809
59940
|
};
|
|
59810
|
-
SurveyModel.prototype.updateAllQuestionsValue = function () {
|
|
59941
|
+
SurveyModel.prototype.updateAllQuestionsValue = function (clearData) {
|
|
59811
59942
|
var questions = this.getAllQuestions();
|
|
59812
59943
|
for (var i = 0; i < questions.length; i++) {
|
|
59813
59944
|
var q = questions[i];
|
|
59814
59945
|
var valName = q.getValueName();
|
|
59815
|
-
q.updateValueFromSurvey(this.getValue(valName));
|
|
59946
|
+
q.updateValueFromSurvey(this.getValue(valName), clearData);
|
|
59816
59947
|
if (q.requireUpdateCommentValue) {
|
|
59817
59948
|
q.updateCommentFromSurvey(this.getComment(valName));
|
|
59818
59949
|
}
|
|
@@ -60231,7 +60362,7 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
|
60231
60362
|
mouseDown: function () { return _this.navigationMouseDown(); },
|
|
60232
60363
|
},
|
|
60233
60364
|
locTitle: this.locCompleteText,
|
|
60234
|
-
action: function () { return _this.completeLastPage(); },
|
|
60365
|
+
action: function () { return _this.taskManager.waitAndExecute(function () { return _this.completeLastPage(); }); },
|
|
60235
60366
|
component: defaultComponent
|
|
60236
60367
|
});
|
|
60237
60368
|
this.updateNavigationItemCssCallback = function () {
|
|
@@ -61559,7 +61690,7 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
|
61559
61690
|
}
|
|
61560
61691
|
}
|
|
61561
61692
|
else if (this.state === "running" && isStrCiEqual(layoutElement.id, "progress-" + this.progressBarType)) {
|
|
61562
|
-
if (container === "
|
|
61693
|
+
if (container === "center") {
|
|
61563
61694
|
if (this.isShowProgressBarOnTop && !this.isShowStartingPage) {
|
|
61564
61695
|
containerLayoutElements.push(layoutElement);
|
|
61565
61696
|
}
|
|
@@ -61627,7 +61758,6 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
|
61627
61758
|
var advHeader = new _header__WEBPACK_IMPORTED_MODULE_20__["Cover"]();
|
|
61628
61759
|
advHeader.fromTheme(theme);
|
|
61629
61760
|
_this.insertAdvancedHeader(advHeader);
|
|
61630
|
-
_this.headerView = "advanced";
|
|
61631
61761
|
}
|
|
61632
61762
|
if (key === "isPanelless") {
|
|
61633
61763
|
_this.isCompact = theme[key];
|
|
@@ -62236,6 +62366,91 @@ surveyLocalization.locales["en"] = _localization_english__WEBPACK_IMPORTED_MODUL
|
|
|
62236
62366
|
surveyLocalization.localeNames["en"] = "english";
|
|
62237
62367
|
|
|
62238
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
|
+
|
|
62239
62454
|
/***/ }),
|
|
62240
62455
|
|
|
62241
62456
|
/***/ "./src/surveyTimerModel.ts":
|
|
@@ -62509,6 +62724,7 @@ function createTOCListModel(survey, onAction) {
|
|
|
62509
62724
|
}, true, items.filter(function (i) { return i.id === survey.currentPage.name; })[0] || items.filter(function (i) { return i.id === pagesSource[0].name; })[0]);
|
|
62510
62725
|
listModel.allowSelection = false;
|
|
62511
62726
|
listModel.locOwner = survey;
|
|
62727
|
+
listModel.searchEnabled = false;
|
|
62512
62728
|
survey.onCurrentPageChanged.add(function (s, o) {
|
|
62513
62729
|
listModel.selectedItem = items.filter(function (i) { return i.id === survey.currentPage.name; })[0];
|
|
62514
62730
|
});
|