survey-react 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.min.css +2 -2
- package/modern.css +9 -6
- package/modern.css.map +1 -1
- package/modern.min.css +2 -2
- package/package.json +1 -1
- package/survey.css +1 -1
- package/survey.css.map +1 -1
- package/survey.min.css +1 -1
- package/survey.react.d.ts +215 -174
- package/survey.react.js +429 -200
- package/survey.react.js.map +1 -1
- package/survey.react.min.js +3 -3
package/survey.react.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
* surveyjs - Survey JavaScript library v1.9.
|
2
|
+
* surveyjs - Survey JavaScript library v1.9.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();
|
@@ -9419,8 +9423,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
9419
9423
|
//import "../../modern.scss";
|
9420
9424
|
var Version;
|
9421
9425
|
var ReleaseDate;
|
9422
|
-
Version = "" + "1.9.
|
9423
|
-
ReleaseDate = "" + "2023-
|
9426
|
+
Version = "" + "1.9.120";
|
9427
|
+
ReleaseDate = "" + "2023-12-04";
|
9424
9428
|
function checkLibraryVersion(ver, libraryName) {
|
9425
9429
|
if (Version != ver) {
|
9426
9430
|
var str = "survey-core has version '" + Version + "' and " + libraryName
|
@@ -22558,7 +22562,7 @@ var englishStrings = {
|
|
22558
22562
|
panelDynamicProgressText: "{0} of {1}",
|
22559
22563
|
panelDynamicTabTextFormat: "Panel {panelIndex}",
|
22560
22564
|
questionsProgressText: "Answered {0}/{1} questions",
|
22561
|
-
emptySurvey: "The survey doesn't contain visible
|
22565
|
+
emptySurvey: "The survey doesn't contain any visible elements.",
|
22562
22566
|
completingSurvey: "Thank you for completing the survey",
|
22563
22567
|
completingSurveyBefore: "Our records show that you have already completed this survey.",
|
22564
22568
|
loadingSurvey: "Loading Survey...",
|
@@ -23785,7 +23789,7 @@ var hungarianSurveyStrings = {
|
|
23785
23789
|
panelDynamicProgressText: "{0} / {1} rekord",
|
23786
23790
|
panelDynamicTabTextFormat: "Panel {panelIndex}",
|
23787
23791
|
questionsProgressText: "Válaszolt kérdések: {0} / {1}",
|
23788
|
-
emptySurvey: "The survey doesn't contain visible
|
23792
|
+
emptySurvey: "The survey doesn't contain any visible elements.",
|
23789
23793
|
completingSurvey: "Köszönjük, hogy kitöltötte felmérésünket!",
|
23790
23794
|
completingSurveyBefore: "Már kitöltötte a felmérést.",
|
23791
23795
|
loadingSurvey: "Felmérés betöltése...",
|
@@ -36757,8 +36761,9 @@ var Question = /** @class */ (function (_super) {
|
|
36757
36761
|
return makeNameValid(name);
|
36758
36762
|
};
|
36759
36763
|
//IQuestion
|
36760
|
-
Question.prototype.updateValueFromSurvey = function (newValue) {
|
36764
|
+
Question.prototype.updateValueFromSurvey = function (newValue, clearData) {
|
36761
36765
|
var _this = this;
|
36766
|
+
if (clearData === void 0) { clearData = false; }
|
36762
36767
|
newValue = this.getUnbindValue(newValue);
|
36763
36768
|
if (!!this.valueFromDataCallback) {
|
36764
36769
|
newValue = this.valueFromDataCallback(newValue);
|
@@ -36773,6 +36778,9 @@ var Question = /** @class */ (function (_super) {
|
|
36773
36778
|
}
|
36774
36779
|
else {
|
36775
36780
|
this.updateValueFromSurveyCore(newValue, this.data !== this.getSurvey());
|
36781
|
+
if (clearData && isEmpty) {
|
36782
|
+
this.isValueChangedDirectly = false;
|
36783
|
+
}
|
36776
36784
|
}
|
36777
36785
|
this.updateDependedQuestions();
|
36778
36786
|
this.updateIsAnswered();
|
@@ -38919,7 +38927,7 @@ var QuestionSelectBase = /** @class */ (function (_super) {
|
|
38919
38927
|
this.onVisibleChoicesChanged();
|
38920
38928
|
}
|
38921
38929
|
};
|
38922
|
-
QuestionSelectBase.prototype.updateValueFromSurvey = function (newValue) {
|
38930
|
+
QuestionSelectBase.prototype.updateValueFromSurvey = function (newValue, clearData) {
|
38923
38931
|
var newComment = "";
|
38924
38932
|
if (this.hasOther &&
|
38925
38933
|
!this.isRunningChoices &&
|
@@ -38933,7 +38941,7 @@ var QuestionSelectBase = /** @class */ (function (_super) {
|
|
38933
38941
|
newComment = this.data.getComment(this.getValueName());
|
38934
38942
|
}
|
38935
38943
|
}
|
38936
|
-
_super.prototype.updateValueFromSurvey.call(this, newValue);
|
38944
|
+
_super.prototype.updateValueFromSurvey.call(this, newValue, clearData);
|
38937
38945
|
if ((this.isRunningChoices || this.choicesByUrl.isRunning) && !this.isEmpty()) {
|
38938
38946
|
this.cachedValueForUrlRequests = this.value;
|
38939
38947
|
}
|
@@ -40715,8 +40723,8 @@ var QuestionCheckboxModel = /** @class */ (function (_super) {
|
|
40715
40723
|
.append(this.cssClasses.itemSelectAll, options.isSelectAllItem)
|
40716
40724
|
.toString();
|
40717
40725
|
};
|
40718
|
-
QuestionCheckboxModel.prototype.updateValueFromSurvey = function (newValue) {
|
40719
|
-
_super.prototype.updateValueFromSurvey.call(this, newValue);
|
40726
|
+
QuestionCheckboxModel.prototype.updateValueFromSurvey = function (newValue, clearData) {
|
40727
|
+
_super.prototype.updateValueFromSurvey.call(this, newValue, clearData);
|
40720
40728
|
this.invisibleOldValues = {};
|
40721
40729
|
};
|
40722
40730
|
QuestionCheckboxModel.prototype.setDefaultValue = function () {
|
@@ -42934,8 +42942,8 @@ var QuestionExpressionModel = /** @class */ (function (_super) {
|
|
42934
42942
|
QuestionExpressionModel.prototype.onValueChanged = function () {
|
42935
42943
|
this.updateFormatedValue();
|
42936
42944
|
};
|
42937
|
-
QuestionExpressionModel.prototype.updateValueFromSurvey = function (newValue) {
|
42938
|
-
_super.prototype.updateValueFromSurvey.call(this, newValue);
|
42945
|
+
QuestionExpressionModel.prototype.updateValueFromSurvey = function (newValue, clearData) {
|
42946
|
+
_super.prototype.updateValueFromSurvey.call(this, newValue, clearData);
|
42939
42947
|
this.updateFormatedValue();
|
42940
42948
|
};
|
42941
42949
|
QuestionExpressionModel.prototype.getDisplayValueCore = function (keysAsText, value) {
|
@@ -43289,11 +43297,13 @@ _questionfactory__WEBPACK_IMPORTED_MODULE_3__["QuestionFactory"].Instance.regist
|
|
43289
43297
|
/*!******************************!*\
|
43290
43298
|
!*** ./src/question_file.ts ***!
|
43291
43299
|
\******************************/
|
43292
|
-
/*! exports provided: QuestionFileModel, FileLoader */
|
43300
|
+
/*! exports provided: dataUrl2File, QuestionFileModelBase, QuestionFileModel, FileLoader */
|
43293
43301
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
43294
43302
|
|
43295
43303
|
"use strict";
|
43296
43304
|
__webpack_require__.r(__webpack_exports__);
|
43305
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "dataUrl2File", function() { return dataUrl2File; });
|
43306
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "QuestionFileModelBase", function() { return QuestionFileModelBase; });
|
43297
43307
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "QuestionFileModel", function() { return QuestionFileModel; });
|
43298
43308
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "FileLoader", function() { return FileLoader; });
|
43299
43309
|
/* harmony import */ var _question__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./question */ "./src/question.ts");
|
@@ -43342,17 +43352,16 @@ var __decorate = (undefined && undefined.__decorate) || function (decorators, ta
|
|
43342
43352
|
|
43343
43353
|
|
43344
43354
|
|
43345
|
-
|
43346
|
-
|
43347
|
-
|
43348
|
-
|
43349
|
-
|
43350
|
-
var
|
43351
|
-
__extends(
|
43352
|
-
function
|
43353
|
-
var _this = _super.
|
43355
|
+
function dataUrl2File(dataUrl, fileName, type) {
|
43356
|
+
var str = atob(dataUrl.split(",")[1]);
|
43357
|
+
var buffer = new Uint8Array(str.split("").map(function (c) { return c.charCodeAt(0); })).buffer;
|
43358
|
+
return new File([buffer], fileName, { type: type });
|
43359
|
+
}
|
43360
|
+
var QuestionFileModelBase = /** @class */ (function (_super) {
|
43361
|
+
__extends(QuestionFileModelBase, _super);
|
43362
|
+
function QuestionFileModelBase() {
|
43363
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
43354
43364
|
_this.isUploading = false;
|
43355
|
-
_this.isDragging = false;
|
43356
43365
|
/**
|
43357
43366
|
* An event that is raised after the upload state has changed.
|
43358
43367
|
*
|
@@ -43365,6 +43374,124 @@ var QuestionFileModel = /** @class */ (function (_super) {
|
|
43365
43374
|
*/
|
43366
43375
|
_this.onUploadStateChanged = _this.addEvent();
|
43367
43376
|
_this.onStateChanged = _this.addEvent();
|
43377
|
+
return _this;
|
43378
|
+
}
|
43379
|
+
QuestionFileModelBase.prototype.stateChanged = function (state) {
|
43380
|
+
if (this.currentState == state) {
|
43381
|
+
return;
|
43382
|
+
}
|
43383
|
+
if (state === "loading") {
|
43384
|
+
this.isUploading = true;
|
43385
|
+
}
|
43386
|
+
if (state === "loaded") {
|
43387
|
+
this.isUploading = false;
|
43388
|
+
}
|
43389
|
+
if (state === "error") {
|
43390
|
+
this.isUploading = false;
|
43391
|
+
}
|
43392
|
+
this.currentState = state;
|
43393
|
+
this.onStateChanged.fire(this, { state: state });
|
43394
|
+
this.onUploadStateChanged.fire(this, { state: state });
|
43395
|
+
};
|
43396
|
+
Object.defineProperty(QuestionFileModelBase.prototype, "showLoadingIndicator", {
|
43397
|
+
get: function () {
|
43398
|
+
return this.isUploading && this.isDefaultV2Theme;
|
43399
|
+
},
|
43400
|
+
enumerable: false,
|
43401
|
+
configurable: true
|
43402
|
+
});
|
43403
|
+
Object.defineProperty(QuestionFileModelBase.prototype, "storeDataAsText", {
|
43404
|
+
/**
|
43405
|
+
* Specifies whether to store file or signature content as text in `SurveyModel`'s [`data`](https://surveyjs.io/form-library/documentation/surveymodel#data) property.
|
43406
|
+
*
|
43407
|
+
* 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.
|
43408
|
+
*/
|
43409
|
+
get: function () {
|
43410
|
+
return this.getPropertyValue("storeDataAsText");
|
43411
|
+
},
|
43412
|
+
set: function (val) {
|
43413
|
+
this.setPropertyValue("storeDataAsText", val);
|
43414
|
+
},
|
43415
|
+
enumerable: false,
|
43416
|
+
configurable: true
|
43417
|
+
});
|
43418
|
+
Object.defineProperty(QuestionFileModelBase.prototype, "waitForUpload", {
|
43419
|
+
/**
|
43420
|
+
* Enable this property if you want to wait until files are uploaded to complete the survey.
|
43421
|
+
*
|
43422
|
+
* Default value: `false`
|
43423
|
+
*/
|
43424
|
+
get: function () {
|
43425
|
+
return this.getPropertyValue("waitForUpload");
|
43426
|
+
},
|
43427
|
+
set: function (val) {
|
43428
|
+
this.setPropertyValue("waitForUpload", val);
|
43429
|
+
},
|
43430
|
+
enumerable: false,
|
43431
|
+
configurable: true
|
43432
|
+
});
|
43433
|
+
QuestionFileModelBase.prototype.clearValue = function () {
|
43434
|
+
this.clearOnDeletingContainer();
|
43435
|
+
_super.prototype.clearValue.call(this);
|
43436
|
+
};
|
43437
|
+
QuestionFileModelBase.prototype.clearOnDeletingContainer = function () {
|
43438
|
+
if (!this.survey)
|
43439
|
+
return;
|
43440
|
+
this.survey.clearFiles(this, this.name, this.value, null, function () { });
|
43441
|
+
};
|
43442
|
+
QuestionFileModelBase.prototype.onCheckForErrors = function (errors, isOnValueChanged) {
|
43443
|
+
_super.prototype.onCheckForErrors.call(this, errors, isOnValueChanged);
|
43444
|
+
if (this.isUploading && this.waitForUpload) {
|
43445
|
+
errors.push(new _error__WEBPACK_IMPORTED_MODULE_4__["UploadingFileError"](this.getLocalizationString("uploadingFile"), this));
|
43446
|
+
}
|
43447
|
+
};
|
43448
|
+
QuestionFileModelBase.prototype.uploadFiles = function (files) {
|
43449
|
+
var _this = this;
|
43450
|
+
if (this.survey) {
|
43451
|
+
this.stateChanged("loading");
|
43452
|
+
this.survey.uploadFiles(this, this.name, files, function (arg1, arg2) {
|
43453
|
+
if (Array.isArray(arg1)) {
|
43454
|
+
_this.setValueFromResult(arg1);
|
43455
|
+
if (Array.isArray(arg2)) {
|
43456
|
+
arg2.forEach(function (error) { return _this.errors.push(new _error__WEBPACK_IMPORTED_MODULE_4__["UploadingFileError"](error, _this)); });
|
43457
|
+
_this.stateChanged("error");
|
43458
|
+
}
|
43459
|
+
}
|
43460
|
+
if (arg1 === "success" && Array.isArray(arg2)) {
|
43461
|
+
_this.setValueFromResult(arg2);
|
43462
|
+
}
|
43463
|
+
if (arg1 === "error") {
|
43464
|
+
if (typeof (arg2) === "string") {
|
43465
|
+
_this.errors.push(new _error__WEBPACK_IMPORTED_MODULE_4__["UploadingFileError"](arg2, _this));
|
43466
|
+
}
|
43467
|
+
if (Array.isArray(arg2) && arg2.length > 0) {
|
43468
|
+
arg2.forEach(function (error) { return _this.errors.push(new _error__WEBPACK_IMPORTED_MODULE_4__["UploadingFileError"](error, _this)); });
|
43469
|
+
}
|
43470
|
+
_this.stateChanged("error");
|
43471
|
+
}
|
43472
|
+
_this.stateChanged("loaded");
|
43473
|
+
});
|
43474
|
+
}
|
43475
|
+
};
|
43476
|
+
__decorate([
|
43477
|
+
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])()
|
43478
|
+
], QuestionFileModelBase.prototype, "isUploading", void 0);
|
43479
|
+
__decorate([
|
43480
|
+
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])({ defaultValue: "empty" })
|
43481
|
+
], QuestionFileModelBase.prototype, "currentState", void 0);
|
43482
|
+
return QuestionFileModelBase;
|
43483
|
+
}(_question__WEBPACK_IMPORTED_MODULE_0__["Question"]));
|
43484
|
+
|
43485
|
+
/**
|
43486
|
+
* A class that describes the File Upload question type.
|
43487
|
+
*
|
43488
|
+
* [View Demo](https://surveyjs.io/form-library/examples/file-upload/ (linkStyle))
|
43489
|
+
*/
|
43490
|
+
var QuestionFileModel = /** @class */ (function (_super) {
|
43491
|
+
__extends(QuestionFileModel, _super);
|
43492
|
+
function QuestionFileModel(name) {
|
43493
|
+
var _this = _super.call(this, name) || this;
|
43494
|
+
_this.isDragging = false;
|
43368
43495
|
_this.fileNavigator = new _actions_container__WEBPACK_IMPORTED_MODULE_7__["ActionContainer"]();
|
43369
43496
|
_this.canFlipCameraValue = undefined;
|
43370
43497
|
_this.prevPreviewLength = 0;
|
@@ -43669,15 +43796,6 @@ var QuestionFileModel = /** @class */ (function (_super) {
|
|
43669
43796
|
QuestionFileModel.prototype.getType = function () {
|
43670
43797
|
return "file";
|
43671
43798
|
};
|
43672
|
-
QuestionFileModel.prototype.clearValue = function () {
|
43673
|
-
this.clearOnDeletingContainer();
|
43674
|
-
_super.prototype.clearValue.call(this);
|
43675
|
-
};
|
43676
|
-
QuestionFileModel.prototype.clearOnDeletingContainer = function () {
|
43677
|
-
if (!this.survey)
|
43678
|
-
return;
|
43679
|
-
this.survey.clearFiles(this, this.name, this.value, null, function () { });
|
43680
|
-
};
|
43681
43799
|
Object.defineProperty(QuestionFileModel.prototype, "showPreview", {
|
43682
43800
|
/**
|
43683
43801
|
* Disable this property only to implement a custom preview.
|
@@ -43748,36 +43866,6 @@ var QuestionFileModel = /** @class */ (function (_super) {
|
|
43748
43866
|
enumerable: false,
|
43749
43867
|
configurable: true
|
43750
43868
|
});
|
43751
|
-
Object.defineProperty(QuestionFileModel.prototype, "storeDataAsText", {
|
43752
|
-
/**
|
43753
|
-
* Specifies whether to store file content as text in `SurveyModel`'s [`data`](https://surveyjs.io/form-library/documentation/surveymodel#data) property.
|
43754
|
-
*
|
43755
|
-
* 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.
|
43756
|
-
*/
|
43757
|
-
get: function () {
|
43758
|
-
return this.getPropertyValue("storeDataAsText");
|
43759
|
-
},
|
43760
|
-
set: function (val) {
|
43761
|
-
this.setPropertyValue("storeDataAsText", val);
|
43762
|
-
},
|
43763
|
-
enumerable: false,
|
43764
|
-
configurable: true
|
43765
|
-
});
|
43766
|
-
Object.defineProperty(QuestionFileModel.prototype, "waitForUpload", {
|
43767
|
-
/**
|
43768
|
-
* Enable this property if you want to wait until files are uploaded to complete the survey.
|
43769
|
-
*
|
43770
|
-
* Default value: `false`
|
43771
|
-
*/
|
43772
|
-
get: function () {
|
43773
|
-
return this.getPropertyValue("waitForUpload");
|
43774
|
-
},
|
43775
|
-
set: function (val) {
|
43776
|
-
this.setPropertyValue("waitForUpload", val);
|
43777
|
-
},
|
43778
|
-
enumerable: false,
|
43779
|
-
configurable: true
|
43780
|
-
});
|
43781
43869
|
Object.defineProperty(QuestionFileModel.prototype, "allowImagesPreview", {
|
43782
43870
|
/**
|
43783
43871
|
* Specifies whether to show a preview of image files.
|
@@ -43965,13 +44053,6 @@ var QuestionFileModel = /** @class */ (function (_super) {
|
|
43965
44053
|
enumerable: false,
|
43966
44054
|
configurable: true
|
43967
44055
|
});
|
43968
|
-
Object.defineProperty(QuestionFileModel.prototype, "showLoadingIndicator", {
|
43969
|
-
get: function () {
|
43970
|
-
return this.isUploading && this.isDefaultV2Theme;
|
43971
|
-
},
|
43972
|
-
enumerable: false,
|
43973
|
-
configurable: true
|
43974
|
-
});
|
43975
44056
|
Object.defineProperty(QuestionFileModel.prototype, "allowShowPreview", {
|
43976
44057
|
get: function () {
|
43977
44058
|
var isShowLoadingIndicator = this.showLoadingIndicator;
|
@@ -44040,6 +44121,15 @@ var QuestionFileModel = /** @class */ (function (_super) {
|
|
44040
44121
|
}
|
44041
44122
|
});
|
44042
44123
|
};
|
44124
|
+
QuestionFileModel.prototype.setValueFromResult = function (arg) {
|
44125
|
+
this.value = (this.value || []).concat(arg.map(function (r) {
|
44126
|
+
return {
|
44127
|
+
name: r.file.name,
|
44128
|
+
type: r.file.type,
|
44129
|
+
content: r.content,
|
44130
|
+
};
|
44131
|
+
}));
|
44132
|
+
};
|
44043
44133
|
/**
|
44044
44134
|
* Loads multiple files into the question.
|
44045
44135
|
* @param files An array of [File](https://developer.mozilla.org/en-US/docs/Web/API/File) objects.
|
@@ -44071,42 +44161,7 @@ var QuestionFileModel = /** @class */ (function (_super) {
|
|
44071
44161
|
});
|
44072
44162
|
}
|
44073
44163
|
else {
|
44074
|
-
|
44075
|
-
_this.survey.uploadFiles(_this, _this.name, files, function (arg1, arg2) {
|
44076
|
-
if (Array.isArray(arg1)) {
|
44077
|
-
_this.value = (_this.value || []).concat(arg1.map(function (r) {
|
44078
|
-
return {
|
44079
|
-
name: r.file.name,
|
44080
|
-
type: r.file.type,
|
44081
|
-
content: r.content,
|
44082
|
-
};
|
44083
|
-
}));
|
44084
|
-
if (Array.isArray(arg2)) {
|
44085
|
-
arg2.forEach(function (error) { return _this.errors.push(new _error__WEBPACK_IMPORTED_MODULE_4__["UploadingFileError"](error, _this)); });
|
44086
|
-
_this.stateChanged("error");
|
44087
|
-
}
|
44088
|
-
}
|
44089
|
-
if (arg1 === "success" && Array.isArray(arg2)) {
|
44090
|
-
_this.value = (_this.value || []).concat(arg2.map(function (r) {
|
44091
|
-
return {
|
44092
|
-
name: r.file.name,
|
44093
|
-
type: r.file.type,
|
44094
|
-
content: r.content,
|
44095
|
-
};
|
44096
|
-
}));
|
44097
|
-
}
|
44098
|
-
if (arg1 === "error") {
|
44099
|
-
if (typeof (arg2) === "string") {
|
44100
|
-
_this.errors.push(new _error__WEBPACK_IMPORTED_MODULE_4__["UploadingFileError"](arg2, _this));
|
44101
|
-
}
|
44102
|
-
if (Array.isArray(arg2) && arg2.length > 0) {
|
44103
|
-
arg2.forEach(function (error) { return _this.errors.push(new _error__WEBPACK_IMPORTED_MODULE_4__["UploadingFileError"](error, _this)); });
|
44104
|
-
}
|
44105
|
-
_this.stateChanged("error");
|
44106
|
-
}
|
44107
|
-
_this.stateChanged("loaded");
|
44108
|
-
});
|
44109
|
-
}
|
44164
|
+
_this.uploadFiles(files);
|
44110
44165
|
}
|
44111
44166
|
};
|
44112
44167
|
if (this.allowMultiple) {
|
@@ -44181,29 +44236,6 @@ var QuestionFileModel = /** @class */ (function (_super) {
|
|
44181
44236
|
QuestionFileModel.prototype.getIsQuestionReady = function () {
|
44182
44237
|
return _super.prototype.getIsQuestionReady.call(this) && !this.isFileLoading;
|
44183
44238
|
};
|
44184
|
-
QuestionFileModel.prototype.onCheckForErrors = function (errors, isOnValueChanged) {
|
44185
|
-
_super.prototype.onCheckForErrors.call(this, errors, isOnValueChanged);
|
44186
|
-
if (this.isUploading && this.waitForUpload) {
|
44187
|
-
errors.push(new _error__WEBPACK_IMPORTED_MODULE_4__["UploadingFileError"](this.getLocalizationString("uploadingFile"), this));
|
44188
|
-
}
|
44189
|
-
};
|
44190
|
-
QuestionFileModel.prototype.stateChanged = function (state) {
|
44191
|
-
if (this.currentState == state) {
|
44192
|
-
return;
|
44193
|
-
}
|
44194
|
-
if (state === "loading") {
|
44195
|
-
this.isUploading = true;
|
44196
|
-
}
|
44197
|
-
if (state === "loaded") {
|
44198
|
-
this.isUploading = false;
|
44199
|
-
}
|
44200
|
-
if (state === "error") {
|
44201
|
-
this.isUploading = false;
|
44202
|
-
}
|
44203
|
-
this.currentState = state;
|
44204
|
-
this.onStateChanged.fire(this, { state: state });
|
44205
|
-
this.onUploadStateChanged.fire(this, { state: state });
|
44206
|
-
};
|
44207
44239
|
QuestionFileModel.prototype.allFilesOk = function (files) {
|
44208
44240
|
var _this = this;
|
44209
44241
|
var errorLength = this.errors ? this.errors.length : 0;
|
@@ -44413,18 +44445,12 @@ var QuestionFileModel = /** @class */ (function (_super) {
|
|
44413
44445
|
this.closeVideoStream();
|
44414
44446
|
_super.prototype.dispose.call(this);
|
44415
44447
|
};
|
44416
|
-
__decorate([
|
44417
|
-
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])()
|
44418
|
-
], QuestionFileModel.prototype, "isUploading", void 0);
|
44419
44448
|
__decorate([
|
44420
44449
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])()
|
44421
44450
|
], QuestionFileModel.prototype, "isDragging", void 0);
|
44422
44451
|
__decorate([
|
44423
44452
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["propertyArray"])({})
|
44424
44453
|
], QuestionFileModel.prototype, "previewValue", void 0);
|
44425
|
-
__decorate([
|
44426
|
-
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])({ defaultValue: "empty" })
|
44427
|
-
], QuestionFileModel.prototype, "currentState", void 0);
|
44428
44454
|
__decorate([
|
44429
44455
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])({ defaultValue: 0 })
|
44430
44456
|
], QuestionFileModel.prototype, "indexToShow", void 0);
|
@@ -44489,7 +44515,7 @@ var QuestionFileModel = /** @class */ (function (_super) {
|
|
44489
44515
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])()
|
44490
44516
|
], QuestionFileModel.prototype, "locRenderedPlaceholderValue", void 0);
|
44491
44517
|
return QuestionFileModel;
|
44492
|
-
}(
|
44518
|
+
}(QuestionFileModelBase));
|
44493
44519
|
|
44494
44520
|
_jsonobject__WEBPACK_IMPORTED_MODULE_1__["Serializer"].addClass("file", [
|
44495
44521
|
{ name: "showCommentArea:switch", layout: "row", visible: true, category: "general" },
|
@@ -47016,8 +47042,9 @@ var MatrixDropdownRowModelBase = /** @class */ (function () {
|
|
47016
47042
|
if (!_helpers__WEBPACK_IMPORTED_MODULE_2__["Helpers"].isValueEmpty(value)) {
|
47017
47043
|
for (var i = 0; i < questions.length; i++) {
|
47018
47044
|
var key = questions[i].getValueName();
|
47019
|
-
|
47020
|
-
|
47045
|
+
var val = !!this.editingObj ? _jsonobject__WEBPACK_IMPORTED_MODULE_0__["Serializer"].getObjPropertyValue(this.editingObj, key) : value[key];
|
47046
|
+
if (!_helpers__WEBPACK_IMPORTED_MODULE_2__["Helpers"].isValueEmpty(val)) {
|
47047
|
+
questions[i].value = val;
|
47021
47048
|
}
|
47022
47049
|
}
|
47023
47050
|
}
|
@@ -48548,6 +48575,7 @@ var QuestionMatrixDropdownModelBase = /** @class */ (function (_super) {
|
|
48548
48575
|
var questionPlainData = _super.prototype.getPlainData.call(this, options);
|
48549
48576
|
if (!!questionPlainData) {
|
48550
48577
|
questionPlainData.isNode = true;
|
48578
|
+
var prevData = Array.isArray(questionPlainData.data) ? [].concat(questionPlainData.data) : [];
|
48551
48579
|
questionPlainData.data = this.visibleRows.map(function (row) {
|
48552
48580
|
var rowDataItem = {
|
48553
48581
|
name: row.dataName,
|
@@ -48569,6 +48597,7 @@ var QuestionMatrixDropdownModelBase = /** @class */ (function (_super) {
|
|
48569
48597
|
});
|
48570
48598
|
return rowDataItem;
|
48571
48599
|
});
|
48600
|
+
questionPlainData.data = questionPlainData.data.concat(prevData);
|
48572
48601
|
}
|
48573
48602
|
return questionPlainData;
|
48574
48603
|
};
|
@@ -48980,7 +49009,7 @@ var QuestionMatrixDropdownModelBase = /** @class */ (function (_super) {
|
|
48980
49009
|
columnValue = newRowValue[columnName];
|
48981
49010
|
}
|
48982
49011
|
this.isRowChanging = true;
|
48983
|
-
|
49012
|
+
_jsonobject__WEBPACK_IMPORTED_MODULE_0__["Serializer"].setObjPropertyValue(rowObj, columnName, columnValue);
|
48984
49013
|
this.isRowChanging = false;
|
48985
49014
|
this.onCellValueChanged(row, columnName, rowObj);
|
48986
49015
|
}
|
@@ -55870,6 +55899,7 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
55870
55899
|
var questionPlainData = _super.prototype.getPlainData.call(this, options);
|
55871
55900
|
if (!!questionPlainData) {
|
55872
55901
|
questionPlainData.isNode = true;
|
55902
|
+
var prevData = Array.isArray(questionPlainData.data) ? [].concat(questionPlainData.data) : [];
|
55873
55903
|
questionPlainData.data = this.panels.map(function (panel, index) {
|
55874
55904
|
var panelDataItem = {
|
55875
55905
|
name: panel.name || index,
|
@@ -55889,6 +55919,7 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
55889
55919
|
});
|
55890
55920
|
return panelDataItem;
|
55891
55921
|
});
|
55922
|
+
questionPlainData.data = questionPlainData.data.concat(prevData);
|
55892
55923
|
}
|
55893
55924
|
return questionPlainData;
|
55894
55925
|
};
|
@@ -57059,6 +57090,24 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_3__["Serializer"].addClass("ranking", [
|
|
57059
57090
|
visible: true,
|
57060
57091
|
isSerializable: true,
|
57061
57092
|
},
|
57093
|
+
{
|
57094
|
+
name: "selectToRankEmptyRankedAreaText:text",
|
57095
|
+
serializationProperty: "locSelectToRankEmptyRankedAreaText",
|
57096
|
+
category: "general",
|
57097
|
+
dependsOn: "selectToRankEnabled",
|
57098
|
+
visibleIf: function (obj) {
|
57099
|
+
return !!obj.selectToRankEnabled;
|
57100
|
+
},
|
57101
|
+
},
|
57102
|
+
{
|
57103
|
+
name: "selectToRankEmptyUnrankedAreaText:text",
|
57104
|
+
serializationProperty: "locSelectToRankEmptyUnrankedAreaText",
|
57105
|
+
category: "general",
|
57106
|
+
dependsOn: "selectToRankEnabled",
|
57107
|
+
visibleIf: function (obj) {
|
57108
|
+
return !!obj.selectToRankEnabled;
|
57109
|
+
},
|
57110
|
+
},
|
57062
57111
|
{
|
57063
57112
|
name: "maxSelectedChoices:number",
|
57064
57113
|
visible: true,
|
@@ -58210,10 +58259,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
58210
58259
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "QuestionSignaturePadModel", function() { return QuestionSignaturePadModel; });
|
58211
58260
|
/* harmony import */ var _jsonobject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./jsonobject */ "./src/jsonobject.ts");
|
58212
58261
|
/* harmony import */ var _questionfactory__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./questionfactory */ "./src/questionfactory.ts");
|
58213
|
-
/* harmony import */ var
|
58214
|
-
/* harmony import */ var
|
58215
|
-
/* harmony import */ var
|
58216
|
-
/* harmony import */ var
|
58262
|
+
/* harmony import */ var signature_pad__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! signature_pad */ "./node_modules/signature_pad/dist/signature_pad.js");
|
58263
|
+
/* harmony import */ var _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/cssClassBuilder */ "./src/utils/cssClassBuilder.ts");
|
58264
|
+
/* harmony import */ var _console_warnings__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./console-warnings */ "./src/console-warnings.ts");
|
58265
|
+
/* harmony import */ var _question_file__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./question_file */ "./src/question_file.ts");
|
58217
58266
|
var __extends = (undefined && undefined.__extends) || (function () {
|
58218
58267
|
var extendStatics = function (d, b) {
|
58219
58268
|
extendStatics = Object.setPrototypeOf ||
|
@@ -58257,6 +58306,16 @@ var QuestionSignaturePadModel = /** @class */ (function (_super) {
|
|
58257
58306
|
_this.scaleCanvas(false, true);
|
58258
58307
|
_this.refreshCanvas();
|
58259
58308
|
};
|
58309
|
+
_this.onBlur = function (event) {
|
58310
|
+
if (!_this.storeDataAsText) {
|
58311
|
+
if (!_this.element.contains(event.relatedTarget)) {
|
58312
|
+
if (!_this.valueWasChangedFromLastUpload)
|
58313
|
+
return;
|
58314
|
+
_this.uploadFiles([Object(_question_file__WEBPACK_IMPORTED_MODULE_5__["dataUrl2File"])(_this.signaturePad.toDataURL(_this.getFormat()), _this.name + "." + correctFormatData(_this.dataFormat), _this.getFormat())]);
|
58315
|
+
_this.valueWasChangedFromLastUpload = false;
|
58316
|
+
}
|
58317
|
+
}
|
58318
|
+
};
|
58260
58319
|
return _this;
|
58261
58320
|
}
|
58262
58321
|
QuestionSignaturePadModel.prototype.getPenColorFromTheme = function () {
|
@@ -58273,16 +58332,18 @@ var QuestionSignaturePadModel = /** @class */ (function (_super) {
|
|
58273
58332
|
signaturePad.backgroundColor = background || backgroundColorFromTheme || backgroundColorProperty.defaultValue || "#ffffff";
|
58274
58333
|
};
|
58275
58334
|
QuestionSignaturePadModel.prototype.getCssRoot = function (cssClasses) {
|
58276
|
-
return new
|
58335
|
+
return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_3__["CssClassBuilder"]()
|
58277
58336
|
.append(_super.prototype.getCssRoot.call(this, cssClasses))
|
58278
58337
|
.append(cssClasses.small, this.signatureWidth.toString() === "300")
|
58279
58338
|
.toString();
|
58280
58339
|
};
|
58340
|
+
QuestionSignaturePadModel.prototype.getFormat = function () {
|
58341
|
+
return this.dataFormat === "jpeg" ? "image/jpeg" :
|
58342
|
+
(this.dataFormat === "svg" ? "image/svg+xml" : "");
|
58343
|
+
};
|
58281
58344
|
QuestionSignaturePadModel.prototype.updateValue = function () {
|
58282
58345
|
if (this.signaturePad) {
|
58283
|
-
var
|
58284
|
-
(this.dataFormat === "svg" ? "image/svg+xml" : "");
|
58285
|
-
var data = this.signaturePad.toDataURL(format);
|
58346
|
+
var data = this.signaturePad.toDataURL(this.getFormat());
|
58286
58347
|
this.valueIsUpdatingInternally = true;
|
58287
58348
|
this.value = data;
|
58288
58349
|
this.valueIsUpdatingInternally = false;
|
@@ -58294,6 +58355,7 @@ var QuestionSignaturePadModel = /** @class */ (function (_super) {
|
|
58294
58355
|
QuestionSignaturePadModel.prototype.afterRenderQuestionElement = function (el) {
|
58295
58356
|
if (!!el) {
|
58296
58357
|
this.initSignaturePad(el);
|
58358
|
+
this.element = el;
|
58297
58359
|
}
|
58298
58360
|
_super.prototype.afterRenderQuestionElement.call(this, el);
|
58299
58361
|
};
|
@@ -58327,15 +58389,34 @@ var QuestionSignaturePadModel = /** @class */ (function (_super) {
|
|
58327
58389
|
this.refreshCanvas();
|
58328
58390
|
}
|
58329
58391
|
};
|
58392
|
+
QuestionSignaturePadModel.prototype.fromDataUrl = function (data) {
|
58393
|
+
this.signaturePad.fromDataURL(data, { width: this.canvas.width * this.scale, height: this.canvas.height * this.scale });
|
58394
|
+
};
|
58395
|
+
QuestionSignaturePadModel.prototype.fromUrl = function (url) {
|
58396
|
+
var _this = this;
|
58397
|
+
var img = document.createElement("img");
|
58398
|
+
img.crossOrigin = "anonymous";
|
58399
|
+
img.src = url;
|
58400
|
+
img.onload = function () {
|
58401
|
+
var ctx = _this.canvas.getContext("2d");
|
58402
|
+
ctx.drawImage(img, 0, 0);
|
58403
|
+
var dataURL = _this.canvas.toDataURL(_this.getFormat());
|
58404
|
+
_this.fromDataUrl(dataURL);
|
58405
|
+
};
|
58406
|
+
};
|
58330
58407
|
QuestionSignaturePadModel.prototype.refreshCanvas = function () {
|
58331
|
-
|
58332
|
-
|
58333
|
-
if (!data) {
|
58334
|
-
canvas.getContext("2d").clearRect(0, 0, canvas.width * this.scale, canvas.height * this.scale);
|
58408
|
+
if (!this.value) {
|
58409
|
+
this.canvas.getContext("2d").clearRect(0, 0, this.canvas.width * this.scale, this.canvas.height * this.scale);
|
58335
58410
|
this.signaturePad.clear();
|
58411
|
+
this.valueWasChangedFromLastUpload = false;
|
58336
58412
|
}
|
58337
58413
|
else {
|
58338
|
-
this.
|
58414
|
+
if (this.storeDataAsText) {
|
58415
|
+
this.fromDataUrl(this.value);
|
58416
|
+
}
|
58417
|
+
else {
|
58418
|
+
this.fromUrl(this.value);
|
58419
|
+
}
|
58339
58420
|
}
|
58340
58421
|
};
|
58341
58422
|
QuestionSignaturePadModel.prototype.initSignaturePad = function (el) {
|
@@ -58343,7 +58424,7 @@ var QuestionSignaturePadModel = /** @class */ (function (_super) {
|
|
58343
58424
|
var canvas = el.getElementsByTagName("canvas")[0];
|
58344
58425
|
this.canvas = canvas;
|
58345
58426
|
this.resizeCanvas();
|
58346
|
-
var signaturePad = new
|
58427
|
+
var signaturePad = new signature_pad__WEBPACK_IMPORTED_MODULE_2__["default"](canvas, { backgroundColor: "#ffffff" });
|
58347
58428
|
this.signaturePad = signaturePad;
|
58348
58429
|
if (this.isInputReadOnly) {
|
58349
58430
|
signaturePad.off();
|
@@ -58364,7 +58445,12 @@ var QuestionSignaturePadModel = /** @class */ (function (_super) {
|
|
58364
58445
|
}, { once: false });
|
58365
58446
|
signaturePad.addEventListener("endStroke", function () {
|
58366
58447
|
_this.isDrawingValue = false;
|
58367
|
-
_this.
|
58448
|
+
if (_this.storeDataAsText) {
|
58449
|
+
_this.updateValue();
|
58450
|
+
}
|
58451
|
+
else {
|
58452
|
+
_this.valueWasChangedFromLastUpload = true;
|
58453
|
+
}
|
58368
58454
|
}, { once: false });
|
58369
58455
|
this.updateValueHandler();
|
58370
58456
|
this.readOnlyChangedCallback();
|
@@ -58479,7 +58565,9 @@ var QuestionSignaturePadModel = /** @class */ (function (_super) {
|
|
58479
58565
|
});
|
58480
58566
|
Object.defineProperty(QuestionSignaturePadModel.prototype, "canShowClearButton", {
|
58481
58567
|
get: function () {
|
58482
|
-
|
58568
|
+
var hasSignature = !this.nothingIsDrawn();
|
58569
|
+
var isUploading = this.isUploading;
|
58570
|
+
return !this.isInputReadOnly && this.allowClear && hasSignature && !isUploading;
|
58483
58571
|
},
|
58484
58572
|
enumerable: false,
|
58485
58573
|
configurable: true
|
@@ -58548,22 +58636,39 @@ var QuestionSignaturePadModel = /** @class */ (function (_super) {
|
|
58548
58636
|
enumerable: false,
|
58549
58637
|
configurable: true
|
58550
58638
|
});
|
58551
|
-
QuestionSignaturePadModel.prototype.
|
58552
|
-
var showPlaceholder = this.showPlaceholder;
|
58639
|
+
QuestionSignaturePadModel.prototype.nothingIsDrawn = function () {
|
58553
58640
|
var isDrawing = this.isDrawingValue;
|
58554
58641
|
var isEmpty = this.isEmpty();
|
58555
|
-
|
58642
|
+
var isUploading = this.isUploading;
|
58643
|
+
var valueWasChangedFromLastUpload = this.valueWasChangedFromLastUpload;
|
58644
|
+
return !isDrawing && isEmpty && !isUploading && !valueWasChangedFromLastUpload;
|
58645
|
+
};
|
58646
|
+
QuestionSignaturePadModel.prototype.needShowPlaceholder = function () {
|
58647
|
+
return this.showPlaceholder && this.nothingIsDrawn();
|
58648
|
+
};
|
58649
|
+
QuestionSignaturePadModel.prototype.uploadResultItemToValue = function (r) {
|
58650
|
+
return r.content;
|
58651
|
+
};
|
58652
|
+
QuestionSignaturePadModel.prototype.setValueFromResult = function (arg) {
|
58653
|
+
this.valueIsUpdatingInternally = true;
|
58654
|
+
this.value = (arg === null || arg === void 0 ? void 0 : arg.length) ? arg.map(function (r) { return r.content; })[0] : undefined;
|
58655
|
+
this.valueIsUpdatingInternally = false;
|
58656
|
+
};
|
58657
|
+
QuestionSignaturePadModel.prototype.clearValue = function () {
|
58658
|
+
this.valueWasChangedFromLastUpload = false;
|
58659
|
+
_super.prototype.clearValue.call(this);
|
58660
|
+
this.refreshCanvas();
|
58556
58661
|
};
|
58557
58662
|
QuestionSignaturePadModel.prototype.endLoadingFromJson = function () {
|
58558
58663
|
_super.prototype.endLoadingFromJson.call(this);
|
58559
58664
|
//todo: need to remove this code
|
58560
58665
|
if (this.signatureWidth === 300 && !!this.width && typeof this.width === "number" && this.width) {
|
58561
|
-
|
58666
|
+
_console_warnings__WEBPACK_IMPORTED_MODULE_4__["ConsoleWarnings"].warn("Use signatureWidth property to set width for the signature pad");
|
58562
58667
|
this.signatureWidth = this.width;
|
58563
58668
|
this.width = undefined;
|
58564
58669
|
}
|
58565
58670
|
if (this.signatureHeight === 200 && !!this.height) {
|
58566
|
-
|
58671
|
+
_console_warnings__WEBPACK_IMPORTED_MODULE_4__["ConsoleWarnings"].warn("Use signatureHeight property to set width for the signature pad");
|
58567
58672
|
this.signatureHeight = this.height;
|
58568
58673
|
this.height = undefined;
|
58569
58674
|
}
|
@@ -58571,6 +58676,12 @@ var QuestionSignaturePadModel = /** @class */ (function (_super) {
|
|
58571
58676
|
__decorate([
|
58572
58677
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])({ defaultValue: false })
|
58573
58678
|
], QuestionSignaturePadModel.prototype, "isDrawingValue", void 0);
|
58679
|
+
__decorate([
|
58680
|
+
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])({ defaultValue: false })
|
58681
|
+
], QuestionSignaturePadModel.prototype, "isReadyForUpload", void 0);
|
58682
|
+
__decorate([
|
58683
|
+
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])({ defaultValue: false })
|
58684
|
+
], QuestionSignaturePadModel.prototype, "valueWasChangedFromLastUpload", void 0);
|
58574
58685
|
__decorate([
|
58575
58686
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])()
|
58576
58687
|
], QuestionSignaturePadModel.prototype, "signatureAutoScaleEnabled", void 0);
|
@@ -58587,7 +58698,7 @@ var QuestionSignaturePadModel = /** @class */ (function (_super) {
|
|
58587
58698
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])({ localizable: { defaultStr: "signaturePlaceHolder" } })
|
58588
58699
|
], QuestionSignaturePadModel.prototype, "placeholder", void 0);
|
58589
58700
|
return QuestionSignaturePadModel;
|
58590
|
-
}(
|
58701
|
+
}(_question_file__WEBPACK_IMPORTED_MODULE_5__["QuestionFileModelBase"]));
|
58591
58702
|
|
58592
58703
|
function correctFormatData(val) {
|
58593
58704
|
if (!val)
|
@@ -58669,6 +58780,8 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_0__["Serializer"].addClass("signaturepad",
|
|
58669
58780
|
},
|
58670
58781
|
{ name: "defaultValue", visible: false },
|
58671
58782
|
{ name: "correctAnswer", visible: false },
|
58783
|
+
{ name: "storeDataAsText:boolean", default: true },
|
58784
|
+
{ name: "waitForUpload:boolean", default: false },
|
58672
58785
|
], function () {
|
58673
58786
|
return new QuestionSignaturePadModel("");
|
58674
58787
|
}, "question");
|
@@ -63545,7 +63658,7 @@ var SurveyQuestionDropdownBase = /** @class */ (function (_super) {
|
|
63545
63658
|
if (!this.question.allowClear || !this.question.cssClasses.cleanButtonIconId)
|
63546
63659
|
return null;
|
63547
63660
|
var style = { display: !this.question.showClearButton ? "none" : "" };
|
63548
|
-
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.question.cssClasses.cleanButton, style: style, onClick: this.clear,
|
63661
|
+
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.question.cssClasses.cleanButton, style: style, onClick: this.clear, "aria-hidden": "true" },
|
63549
63662
|
react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_components_svg_icon_svg_icon__WEBPACK_IMPORTED_MODULE_3__["SvgIcon"], { className: this.question.cssClasses.cleanButtonSvg, iconName: this.question.cssClasses.cleanButtonIconId, title: this.question.clearCaption, size: "auto" })));
|
63550
63663
|
};
|
63551
63664
|
SurveyQuestionDropdownBase.prototype.createChevronButton = function () {
|
@@ -65176,10 +65289,12 @@ var Survey = /** @class */ (function (_super) {
|
|
65176
65289
|
}
|
65177
65290
|
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.survey.bodyContainerCss },
|
65178
65291
|
react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_components_components_container__WEBPACK_IMPORTED_MODULE_10__["ComponentsContainer"], { survey: this.survey, container: "left" }),
|
65179
|
-
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", {
|
65180
|
-
react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_components_components_container__WEBPACK_IMPORTED_MODULE_10__["ComponentsContainer"], { survey: this.survey, container: "
|
65181
|
-
|
65182
|
-
|
65292
|
+
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: "sv-components-column sv-components-column--expandable" },
|
65293
|
+
react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_components_components_container__WEBPACK_IMPORTED_MODULE_10__["ComponentsContainer"], { survey: this.survey, container: "center" }),
|
65294
|
+
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { id: pageId, className: className, style: style },
|
65295
|
+
react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_components_components_container__WEBPACK_IMPORTED_MODULE_10__["ComponentsContainer"], { survey: this.survey, container: "contentTop" }),
|
65296
|
+
activePage,
|
65297
|
+
react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_components_components_container__WEBPACK_IMPORTED_MODULE_10__["ComponentsContainer"], { survey: this.survey, container: "contentBottom" }))),
|
65183
65298
|
react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_components_components_container__WEBPACK_IMPORTED_MODULE_10__["ComponentsContainer"], { survey: this.survey, container: "right" })));
|
65184
65299
|
};
|
65185
65300
|
Survey.prototype.renderPage = function (page) {
|
@@ -68908,12 +69023,15 @@ var SurveyQuestionRanking = /** @class */ (function (_super) {
|
|
68908
69023
|
this.getItems(this.question.unRankingChoices, unrankedItem),
|
68909
69024
|
this.question.unRankingChoices.length === 0 ? react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.question.cssClasses.containerPlaceholder },
|
68910
69025
|
" ",
|
68911
|
-
this.question.
|
69026
|
+
this.renderLocString(this.question.locSelectToRankEmptyRankedAreaText),
|
68912
69027
|
" ") : null),
|
68913
69028
|
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.question.cssClasses.containersDivider }),
|
68914
69029
|
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.question.getContainerClasses("to"), "data-ranking": "to-container" },
|
68915
69030
|
this.getItems(),
|
68916
|
-
this.question.rankingChoices.length === 0 ? react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.question.cssClasses.containerPlaceholder },
|
69031
|
+
this.question.rankingChoices.length === 0 ? react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.question.cssClasses.containerPlaceholder },
|
69032
|
+
" ",
|
69033
|
+
this.renderLocString(this.question.locSelectToRankEmptyUnrankedAreaText),
|
69034
|
+
" ") : null)));
|
68917
69035
|
}
|
68918
69036
|
};
|
68919
69037
|
SurveyQuestionRanking.prototype.getItems = function (choices, unrankedItem) {
|
@@ -69630,6 +69748,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
69630
69748
|
/* harmony import */ var _reactquestion_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./reactquestion_element */ "./src/react/reactquestion_element.tsx");
|
69631
69749
|
/* harmony import */ var _reactquestion_factory__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./reactquestion_factory */ "./src/react/reactquestion_factory.tsx");
|
69632
69750
|
/* harmony import */ var _components_svg_icon_svg_icon__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./components/svg-icon/svg-icon */ "./src/react/components/svg-icon/svg-icon.tsx");
|
69751
|
+
/* harmony import */ var _components_loading_indicator__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./components/loading-indicator */ "./src/react/components/loading-indicator.tsx");
|
69633
69752
|
var __extends = (undefined && undefined.__extends) || (function () {
|
69634
69753
|
var extendStatics = function (d, b) {
|
69635
69754
|
extendStatics = Object.setPrototypeOf ||
|
@@ -69649,6 +69768,7 @@ var __extends = (undefined && undefined.__extends) || (function () {
|
|
69649
69768
|
|
69650
69769
|
|
69651
69770
|
|
69771
|
+
|
69652
69772
|
var SurveyQuestionSignaturePad = /** @class */ (function (_super) {
|
69653
69773
|
__extends(SurveyQuestionSignaturePad, _super);
|
69654
69774
|
function SurveyQuestionSignaturePad(props) {
|
@@ -69666,19 +69786,25 @@ var SurveyQuestionSignaturePad = /** @class */ (function (_super) {
|
|
69666
69786
|
SurveyQuestionSignaturePad.prototype.renderElement = function () {
|
69667
69787
|
var _this = this;
|
69668
69788
|
var cssClasses = this.question.cssClasses;
|
69789
|
+
var loadingIndicator = this.question.showLoadingIndicator ? this.renderLoadingIndicator() : null;
|
69669
69790
|
var clearButton = this.renderCleanButton();
|
69670
69791
|
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: cssClasses.root, ref: function (root) { return (_this.setControl(root)); }, style: { width: this.question.renderedCanvasWidth } },
|
69671
69792
|
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: cssClasses.placeholder, style: { display: this.question.needShowPlaceholder() ? "" : "none" } }, this.renderLocString(this.question.locPlaceholder)),
|
69672
69793
|
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", null,
|
69673
69794
|
this.renderBackgroundImage(),
|
69674
|
-
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("canvas", { tabIndex: 0, className: this.question.cssClasses.canvas })),
|
69675
|
-
clearButton
|
69795
|
+
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("canvas", { tabIndex: 0, className: this.question.cssClasses.canvas, onBlur: this.question.onBlur })),
|
69796
|
+
clearButton,
|
69797
|
+
loadingIndicator));
|
69676
69798
|
};
|
69677
69799
|
SurveyQuestionSignaturePad.prototype.renderBackgroundImage = function () {
|
69678
69800
|
if (!this.question.backgroundImage)
|
69679
69801
|
return null;
|
69680
69802
|
return react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("img", { className: this.question.cssClasses.backgroundImage, src: this.question.backgroundImage, style: { width: this.question.renderedCanvasWidth } });
|
69681
69803
|
};
|
69804
|
+
SurveyQuestionSignaturePad.prototype.renderLoadingIndicator = function () {
|
69805
|
+
return react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.question.cssClasses.loadingIndicator },
|
69806
|
+
react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_components_loading_indicator__WEBPACK_IMPORTED_MODULE_4__["LoadingIndicatorComponent"], null));
|
69807
|
+
};
|
69682
69808
|
SurveyQuestionSignaturePad.prototype.renderCleanButton = function () {
|
69683
69809
|
var _this = this;
|
69684
69810
|
if (!this.question.canShowClearButton)
|
@@ -72653,6 +72779,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
72653
72779
|
/* harmony import */ var _notifier__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./notifier */ "./src/notifier.ts");
|
72654
72780
|
/* harmony import */ var _header__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./header */ "./src/header.ts");
|
72655
72781
|
/* harmony import */ var _surveytimer__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./surveytimer */ "./src/surveytimer.ts");
|
72782
|
+
/* harmony import */ var _surveyTaskManager__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./surveyTaskManager */ "./src/surveyTaskManager.ts");
|
72656
72783
|
var __extends = (undefined && undefined.__extends) || (function () {
|
72657
72784
|
var extendStatics = function (d, b) {
|
72658
72785
|
extendStatics = Object.setPrototypeOf ||
|
@@ -72694,6 +72821,7 @@ var __decorate = (undefined && undefined.__decorate) || function (decorators, ta
|
|
72694
72821
|
|
72695
72822
|
|
72696
72823
|
|
72824
|
+
|
72697
72825
|
|
72698
72826
|
|
72699
72827
|
/**
|
@@ -72970,6 +73098,8 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
72970
73098
|
* For information on event handler parameters, refer to descriptions within the interface.
|
72971
73099
|
*
|
72972
73100
|
* 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).
|
73101
|
+
*
|
73102
|
+
* [View Demo](https://surveyjs.io/form-library/examples/survey-titletagnames/ (linkStyle))
|
72973
73103
|
* @see onGetQuestionTitle
|
72974
73104
|
* @see onGetQuestionNo
|
72975
73105
|
*/
|
@@ -73009,7 +73139,7 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
73009
73139
|
*/
|
73010
73140
|
_this.onGetResult = _this.addEvent();
|
73011
73141
|
/**
|
73012
|
-
* 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.
|
73142
|
+
* 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.
|
73013
73143
|
*
|
73014
73144
|
* For information on event handler parameters, refer to descriptions within the interface.
|
73015
73145
|
*
|
@@ -73031,7 +73161,7 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
73031
73161
|
*/
|
73032
73162
|
_this.onDownloadFile = _this.addEvent();
|
73033
73163
|
/**
|
73034
|
-
* 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.
|
73164
|
+
* 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.
|
73035
73165
|
*
|
73036
73166
|
* For information on event handler parameters, refer to descriptions within the interface.
|
73037
73167
|
*
|
@@ -73407,6 +73537,7 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
73407
73537
|
_this.needRenderIcons = true;
|
73408
73538
|
_this.skippedPages = [];
|
73409
73539
|
_this.skeletonComponentName = "sv-skeleton";
|
73540
|
+
_this.taskManager = new _surveyTaskManager__WEBPACK_IMPORTED_MODULE_22__["SurveyTaskManagerModel"]();
|
73410
73541
|
if (typeof document !== "undefined") {
|
73411
73542
|
SurveyModel.stylesManager = new _stylesmanager__WEBPACK_IMPORTED_MODULE_11__["StylesManager"]();
|
73412
73543
|
}
|
@@ -73414,6 +73545,7 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
73414
73545
|
_this.createHtmlLocString("completedHtml", "completingSurvey", htmlCallBack);
|
73415
73546
|
_this.createHtmlLocString("completedBeforeHtml", "completingSurveyBefore", htmlCallBack, "completed-before");
|
73416
73547
|
_this.createHtmlLocString("loadingHtml", "loadingSurvey", htmlCallBack, "loading");
|
73548
|
+
_this.createLocalizableString("emptySurveyText", _this, true, "emptySurvey");
|
73417
73549
|
_this.createLocalizableString("logo", _this, false);
|
73418
73550
|
_this.createLocalizableString("startSurveyText", _this, false, true);
|
73419
73551
|
_this.createLocalizableString("pagePrevText", _this, false, true);
|
@@ -74657,11 +74789,14 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
74657
74789
|
};
|
74658
74790
|
Object.defineProperty(SurveyModel.prototype, "emptySurveyText", {
|
74659
74791
|
/**
|
74660
|
-
*
|
74792
|
+
* A message that is displayed when a survey does not contain visible pages or questions.
|
74661
74793
|
* @see [Localization & Globalization](https://surveyjs.io/form-library/documentation/survey-localization)
|
74662
74794
|
*/
|
74663
74795
|
get: function () {
|
74664
|
-
return this.
|
74796
|
+
return this.getLocalizableStringText("emptySurveyText");
|
74797
|
+
},
|
74798
|
+
set: function (val) {
|
74799
|
+
this.setLocalizableStringText("emptySurveyText", val);
|
74665
74800
|
},
|
74666
74801
|
enumerable: false,
|
74667
74802
|
configurable: true
|
@@ -75700,7 +75835,7 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
75700
75835
|
},
|
75701
75836
|
set: function (data) {
|
75702
75837
|
this.valuesHash = {};
|
75703
|
-
this.setDataCore(data);
|
75838
|
+
this.setDataCore(data, !data);
|
75704
75839
|
},
|
75705
75840
|
enumerable: false,
|
75706
75841
|
configurable: true
|
@@ -75720,17 +75855,21 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
75720
75855
|
this.mergeValues(data, newData);
|
75721
75856
|
this.setDataCore(newData);
|
75722
75857
|
};
|
75723
|
-
SurveyModel.prototype.setDataCore = function (data) {
|
75858
|
+
SurveyModel.prototype.setDataCore = function (data, clearData) {
|
75859
|
+
if (clearData === void 0) { clearData = false; }
|
75860
|
+
if (clearData) {
|
75861
|
+
this.valuesHash = {};
|
75862
|
+
}
|
75724
75863
|
if (data) {
|
75725
75864
|
for (var key in data) {
|
75726
75865
|
this.setDataValueCore(this.valuesHash, key, data[key]);
|
75727
75866
|
}
|
75728
75867
|
}
|
75729
|
-
this.updateAllQuestionsValue();
|
75868
|
+
this.updateAllQuestionsValue(clearData);
|
75730
75869
|
this.notifyAllQuestionsOnValueChanged();
|
75731
75870
|
this.notifyElementsOnAnyValueOrVariableChanged("");
|
75732
75871
|
this.runConditions();
|
75733
|
-
this.updateAllQuestionsValue();
|
75872
|
+
this.updateAllQuestionsValue(clearData);
|
75734
75873
|
};
|
75735
75874
|
SurveyModel.prototype.getStructuredData = function (includePages, level) {
|
75736
75875
|
if (includePages === void 0) { includePages = true; }
|
@@ -76425,8 +76564,7 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
76425
76564
|
this.isLoading = false;
|
76426
76565
|
this.completedByTriggers = undefined;
|
76427
76566
|
if (clearData) {
|
76428
|
-
this.
|
76429
|
-
this.variablesHash = {};
|
76567
|
+
this.setDataCore(null, true);
|
76430
76568
|
}
|
76431
76569
|
this.timerModel.spent = 0;
|
76432
76570
|
for (var i = 0; i < this.pages.length; i++) {
|
@@ -78242,23 +78380,29 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
78242
78380
|
* }
|
78243
78381
|
* );
|
78244
78382
|
* ```
|
78245
|
-
* @param question A [File Upload question instance](https://surveyjs.io/form-library/documentation/api-reference/file-model).
|
78246
|
-
* @param name The File Upload question's [`name`](https://surveyjs.io/form-library/documentation/api-reference/file-model#name).
|
78383
|
+
* @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).
|
78384
|
+
* @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).
|
78247
78385
|
* @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.
|
78248
78386
|
* @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.
|
78249
78387
|
* @see onUploadFiles
|
78250
78388
|
* @see downloadFile
|
78251
78389
|
*/
|
78252
78390
|
SurveyModel.prototype.uploadFiles = function (question, name, files, callback) {
|
78391
|
+
var _this = this;
|
78253
78392
|
if (this.onUploadFiles.isEmpty) {
|
78254
78393
|
callback("error", this.getLocString("noUploadFilesHandler"));
|
78255
78394
|
}
|
78256
78395
|
else {
|
78257
|
-
this.
|
78258
|
-
|
78259
|
-
|
78260
|
-
|
78261
|
-
|
78396
|
+
this.taskManager.runTask("file", function (done) {
|
78397
|
+
_this.onUploadFiles.fire(_this, {
|
78398
|
+
question: question,
|
78399
|
+
name: name,
|
78400
|
+
files: files || [],
|
78401
|
+
callback: function (status, data) {
|
78402
|
+
callback(status, data);
|
78403
|
+
done();
|
78404
|
+
},
|
78405
|
+
});
|
78262
78406
|
});
|
78263
78407
|
}
|
78264
78408
|
if (this.surveyPostId) {
|
@@ -78677,7 +78821,7 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
78677
78821
|
var qValue = questions[i].value;
|
78678
78822
|
if ((qValue === newValue && Array.isArray(qValue) && !!this.editingObj) ||
|
78679
78823
|
!this.isTwoValueEquals(qValue, newValue)) {
|
78680
|
-
questions[i].updateValueFromSurvey(newValue);
|
78824
|
+
questions[i].updateValueFromSurvey(newValue, false);
|
78681
78825
|
}
|
78682
78826
|
}
|
78683
78827
|
}
|
@@ -78772,12 +78916,12 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
78772
78916
|
this.locStrsChanged();
|
78773
78917
|
}
|
78774
78918
|
};
|
78775
|
-
SurveyModel.prototype.updateAllQuestionsValue = function () {
|
78919
|
+
SurveyModel.prototype.updateAllQuestionsValue = function (clearData) {
|
78776
78920
|
var questions = this.getAllQuestions();
|
78777
78921
|
for (var i = 0; i < questions.length; i++) {
|
78778
78922
|
var q = questions[i];
|
78779
78923
|
var valName = q.getValueName();
|
78780
|
-
q.updateValueFromSurvey(this.getValue(valName));
|
78924
|
+
q.updateValueFromSurvey(this.getValue(valName), clearData);
|
78781
78925
|
if (q.requireUpdateCommentValue) {
|
78782
78926
|
q.updateCommentFromSurvey(this.getComment(valName));
|
78783
78927
|
}
|
@@ -79196,7 +79340,7 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
79196
79340
|
mouseDown: function () { return _this.navigationMouseDown(); },
|
79197
79341
|
},
|
79198
79342
|
locTitle: this.locCompleteText,
|
79199
|
-
action: function () { return _this.completeLastPage(); },
|
79343
|
+
action: function () { return _this.taskManager.waitAndExecute(function () { return _this.completeLastPage(); }); },
|
79200
79344
|
component: defaultComponent
|
79201
79345
|
});
|
79202
79346
|
this.updateNavigationItemCssCallback = function () {
|
@@ -80524,7 +80668,7 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
80524
80668
|
}
|
80525
80669
|
}
|
80526
80670
|
else if (this.state === "running" && isStrCiEqual(layoutElement.id, "progress-" + this.progressBarType)) {
|
80527
|
-
if (container === "
|
80671
|
+
if (container === "center") {
|
80528
80672
|
if (this.isShowProgressBarOnTop && !this.isShowStartingPage) {
|
80529
80673
|
containerLayoutElements.push(layoutElement);
|
80530
80674
|
}
|
@@ -80592,7 +80736,6 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
80592
80736
|
var advHeader = new _header__WEBPACK_IMPORTED_MODULE_20__["Cover"]();
|
80593
80737
|
advHeader.fromTheme(theme);
|
80594
80738
|
_this.insertAdvancedHeader(advHeader);
|
80595
|
-
_this.headerView = "advanced";
|
80596
80739
|
}
|
80597
80740
|
if (key === "isPanelless") {
|
80598
80741
|
_this.isCompact = theme[key];
|
@@ -81201,6 +81344,91 @@ surveyLocalization.locales["en"] = _localization_english__WEBPACK_IMPORTED_MODUL
|
|
81201
81344
|
surveyLocalization.localeNames["en"] = "english";
|
81202
81345
|
|
81203
81346
|
|
81347
|
+
/***/ }),
|
81348
|
+
|
81349
|
+
/***/ "./src/surveyTaskManager.ts":
|
81350
|
+
/*!**********************************!*\
|
81351
|
+
!*** ./src/surveyTaskManager.ts ***!
|
81352
|
+
\**********************************/
|
81353
|
+
/*! exports provided: SurveyTaskManagerModel */
|
81354
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
81355
|
+
|
81356
|
+
"use strict";
|
81357
|
+
__webpack_require__.r(__webpack_exports__);
|
81358
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SurveyTaskManagerModel", function() { return SurveyTaskManagerModel; });
|
81359
|
+
/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./base */ "./src/base.ts");
|
81360
|
+
/* harmony import */ var _jsonobject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./jsonobject */ "./src/jsonobject.ts");
|
81361
|
+
var __extends = (undefined && undefined.__extends) || (function () {
|
81362
|
+
var extendStatics = function (d, b) {
|
81363
|
+
extendStatics = Object.setPrototypeOf ||
|
81364
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
81365
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
81366
|
+
return extendStatics(d, b);
|
81367
|
+
};
|
81368
|
+
return function (d, b) {
|
81369
|
+
if (typeof b !== "function" && b !== null)
|
81370
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
81371
|
+
extendStatics(d, b);
|
81372
|
+
function __() { this.constructor = d; }
|
81373
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
81374
|
+
};
|
81375
|
+
})();
|
81376
|
+
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
81377
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
81378
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
81379
|
+
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;
|
81380
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
81381
|
+
};
|
81382
|
+
|
81383
|
+
|
81384
|
+
var SurveyTaskModel = /** @class */ (function () {
|
81385
|
+
function SurveyTaskModel(type) {
|
81386
|
+
this.type = type;
|
81387
|
+
this.timestamp = new Date();
|
81388
|
+
}
|
81389
|
+
return SurveyTaskModel;
|
81390
|
+
}());
|
81391
|
+
var SurveyTaskManagerModel = /** @class */ (function (_super) {
|
81392
|
+
__extends(SurveyTaskManagerModel, _super);
|
81393
|
+
function SurveyTaskManagerModel() {
|
81394
|
+
var _this = _super.call(this) || this;
|
81395
|
+
_this.taskList = [];
|
81396
|
+
_this.onAllTasksCompleted = _this.addEvent();
|
81397
|
+
return _this;
|
81398
|
+
}
|
81399
|
+
SurveyTaskManagerModel.prototype.runTask = function (type, func) {
|
81400
|
+
var _this = this;
|
81401
|
+
var task = new SurveyTaskModel(type);
|
81402
|
+
this.taskList.push(task);
|
81403
|
+
this.hasActiveTasks = true;
|
81404
|
+
func(function () { return _this.taskFinished(task); });
|
81405
|
+
return task;
|
81406
|
+
};
|
81407
|
+
SurveyTaskManagerModel.prototype.waitAndExecute = function (action) {
|
81408
|
+
if (!this.hasActiveTasks) {
|
81409
|
+
action();
|
81410
|
+
return;
|
81411
|
+
}
|
81412
|
+
this.onAllTasksCompleted.add(function () { action(); });
|
81413
|
+
};
|
81414
|
+
SurveyTaskManagerModel.prototype.taskFinished = function (task) {
|
81415
|
+
var index = this.taskList.indexOf(task);
|
81416
|
+
if (index > -1) {
|
81417
|
+
this.taskList.splice(index, 1);
|
81418
|
+
}
|
81419
|
+
if (this.hasActiveTasks && this.taskList.length == 0) {
|
81420
|
+
this.hasActiveTasks = false;
|
81421
|
+
this.onAllTasksCompleted.fire(this, {});
|
81422
|
+
}
|
81423
|
+
};
|
81424
|
+
__decorate([
|
81425
|
+
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])({ defaultValue: false })
|
81426
|
+
], SurveyTaskManagerModel.prototype, "hasActiveTasks", void 0);
|
81427
|
+
return SurveyTaskManagerModel;
|
81428
|
+
}(_base__WEBPACK_IMPORTED_MODULE_0__["Base"]));
|
81429
|
+
|
81430
|
+
|
81431
|
+
|
81204
81432
|
/***/ }),
|
81205
81433
|
|
81206
81434
|
/***/ "./src/surveyTimerModel.ts":
|
@@ -81474,6 +81702,7 @@ function createTOCListModel(survey, onAction) {
|
|
81474
81702
|
}, true, items.filter(function (i) { return i.id === survey.currentPage.name; })[0] || items.filter(function (i) { return i.id === pagesSource[0].name; })[0]);
|
81475
81703
|
listModel.allowSelection = false;
|
81476
81704
|
listModel.locOwner = survey;
|
81705
|
+
listModel.searchEnabled = false;
|
81477
81706
|
survey.onCurrentPageChanged.add(function (s, o) {
|
81478
81707
|
listModel.selectedItem = items.filter(function (i) { return i.id === survey.currentPage.name; })[0];
|
81479
81708
|
});
|