survey-react 1.9.82 → 1.9.84
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 +70 -55
- package/defaultV2.css.map +1 -1
- package/defaultV2.min.css +2 -2
- package/modern.css +21 -21
- package/modern.css.map +1 -1
- package/modern.min.css +2 -2
- package/package.json +1 -1
- package/survey.css +6 -6
- package/survey.css.map +1 -1
- package/survey.min.css +2 -2
- package/survey.react.d.ts +678 -637
- package/survey.react.js +489 -204
- 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.84
|
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
|
*/
|
@@ -1908,7 +1908,11 @@ var ActionContainer = /** @class */ (function (_super) {
|
|
1908
1908
|
};
|
1909
1909
|
ActionContainer.prototype.locStrsChanged = function () {
|
1910
1910
|
_super.prototype.locStrsChanged.call(this);
|
1911
|
-
this.actions.forEach(function (item) {
|
1911
|
+
this.actions.forEach(function (item) {
|
1912
|
+
if (item.locTitle)
|
1913
|
+
item.locTitle.strChanged();
|
1914
|
+
item.locStrsChanged();
|
1915
|
+
});
|
1912
1916
|
};
|
1913
1917
|
ActionContainer.prototype.raiseUpdate = function (isResetInitialized) {
|
1914
1918
|
this.isEmpty = !this.actions.some(function (action) { return action.visible; });
|
@@ -2016,6 +2020,11 @@ var ActionContainer = /** @class */ (function (_super) {
|
|
2016
2020
|
}
|
2017
2021
|
return null;
|
2018
2022
|
};
|
2023
|
+
ActionContainer.prototype.dispose = function () {
|
2024
|
+
_super.prototype.dispose.call(this);
|
2025
|
+
this.actions.forEach(function (action) { return action.dispose(); });
|
2026
|
+
this.actions.length = 0;
|
2027
|
+
};
|
2019
2028
|
__decorate([
|
2020
2029
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["propertyArray"])({
|
2021
2030
|
onSet: function (_, target) {
|
@@ -7415,7 +7424,7 @@ var DragDropMatrixRows = /** @class */ (function (_super) {
|
|
7415
7424
|
_super.prototype.ghostPositionChanged.call(this);
|
7416
7425
|
};
|
7417
7426
|
DragDropMatrixRows.prototype.doClear = function () {
|
7418
|
-
this.parentElement
|
7427
|
+
this.parentElement.clearOnDrop();
|
7419
7428
|
this.fromIndex = null;
|
7420
7429
|
this.toIndex = null;
|
7421
7430
|
};
|
@@ -8524,6 +8533,15 @@ var DropdownListModel = /** @class */ (function (_super) {
|
|
8524
8533
|
this.inputString = null;
|
8525
8534
|
}
|
8526
8535
|
};
|
8536
|
+
DropdownListModel.prototype.dispose = function () {
|
8537
|
+
_super.prototype.dispose.call(this);
|
8538
|
+
if (!!this.listModel) {
|
8539
|
+
this.listModel.dispose();
|
8540
|
+
}
|
8541
|
+
if (!!this.popupModel) {
|
8542
|
+
this.popupModel.dispose();
|
8543
|
+
}
|
8544
|
+
};
|
8527
8545
|
DropdownListModel.prototype.scrollToFocusedItem = function () {
|
8528
8546
|
this.listModel.scrollToFocusedItem();
|
8529
8547
|
};
|
@@ -9532,7 +9550,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
9532
9550
|
// import "../../main.scss";
|
9533
9551
|
//import "../../modern.scss";
|
9534
9552
|
var Version;
|
9535
|
-
Version = "" + "1.9.
|
9553
|
+
Version = "" + "1.9.84";
|
9536
9554
|
function checkLibraryVersion(ver, libraryName) {
|
9537
9555
|
if (Version != ver) {
|
9538
9556
|
var str = "survey-core has version '" + Version + "' and " + libraryName
|
@@ -16564,7 +16582,7 @@ var Helpers = /** @class */ (function () {
|
|
16564
16582
|
};
|
16565
16583
|
Helpers.convertValToQuestionVal = function (val, inputType) {
|
16566
16584
|
if (val instanceof Date) {
|
16567
|
-
if (inputType === "datetime")
|
16585
|
+
if (inputType === "datetime-local")
|
16568
16586
|
return Helpers.convertDateTimeToString(val);
|
16569
16587
|
return Helpers.convertDateToString(val);
|
16570
16588
|
}
|
@@ -17651,6 +17669,9 @@ var ItemValue = /** @class */ (function (_super) {
|
|
17651
17669
|
__decorate([
|
17652
17670
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])()
|
17653
17671
|
], ItemValue.prototype, "selectedValue", void 0);
|
17672
|
+
__decorate([
|
17673
|
+
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])()
|
17674
|
+
], ItemValue.prototype, "icon", void 0);
|
17654
17675
|
return ItemValue;
|
17655
17676
|
}(_actions_action__WEBPACK_IMPORTED_MODULE_6__["BaseAction"]));
|
17656
17677
|
|
@@ -17689,7 +17710,7 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_1__["Serializer"].addClass("itemvalue", [
|
|
17689
17710
|
visibleIf: function (obj) {
|
17690
17711
|
return !obj || obj.ownerPropertyName !== "rateValues";
|
17691
17712
|
},
|
17692
|
-
}
|
17713
|
+
}
|
17693
17714
|
], function (value) { return new ItemValue(value); });
|
17694
17715
|
|
17695
17716
|
|
@@ -19434,6 +19455,9 @@ var JsonObject = /** @class */ (function () {
|
|
19434
19455
|
if (!!value[i].name) {
|
19435
19456
|
newValue.newObj.name = value[i].name;
|
19436
19457
|
}
|
19458
|
+
if (!!value[i].valueName) {
|
19459
|
+
newValue.newObj.valueName = value[i].valueName.toString();
|
19460
|
+
}
|
19437
19461
|
result.push(newValue.newObj);
|
19438
19462
|
this.toObjectCore(value[i], newValue.newObj);
|
19439
19463
|
}
|
@@ -19792,6 +19816,12 @@ var ListModel = /** @class */ (function (_super) {
|
|
19792
19816
|
this.scrollableContainer.removeEventListener("scroll", this.scrollHandler);
|
19793
19817
|
}
|
19794
19818
|
};
|
19819
|
+
ListModel.prototype.dispose = function () {
|
19820
|
+
_super.prototype.dispose.call(this);
|
19821
|
+
if (!!this.loadingIndicatorValue) {
|
19822
|
+
this.loadingIndicatorValue.dispose();
|
19823
|
+
}
|
19824
|
+
};
|
19795
19825
|
ListModel.INDENT = 16;
|
19796
19826
|
ListModel.MINELEMENTCOUNT = 10;
|
19797
19827
|
__decorate([
|
@@ -21291,7 +21321,7 @@ var englishStrings = {
|
|
21291
21321
|
progressText: "Page {0} of {1}",
|
21292
21322
|
indexText: "{0} of {1}",
|
21293
21323
|
panelDynamicProgressText: "{0} of {1}",
|
21294
|
-
panelDynamicTabTextFormat: "Panel {
|
21324
|
+
panelDynamicTabTextFormat: "Panel {panelIndex}",
|
21295
21325
|
questionsProgressText: "Answered {0}/{1} questions",
|
21296
21326
|
emptySurvey: "The survey doesn't contain visible pages or questions.",
|
21297
21327
|
completingSurvey: "Thank you for completing the survey",
|
@@ -26673,7 +26703,7 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_0__["Serializer"].addClass("page", [
|
|
26673
26703
|
{
|
26674
26704
|
name: "navigationTitle",
|
26675
26705
|
visibleIf: function (obj) {
|
26676
|
-
return !!obj.survey && obj.survey.progressBarType === "buttons";
|
26706
|
+
return !!obj.survey && (obj.survey.progressBarType === "buttons" || obj.survey.showTOC);
|
26677
26707
|
},
|
26678
26708
|
serializationProperty: "locNavigationTitle",
|
26679
26709
|
},
|
@@ -31051,8 +31081,9 @@ var PopupBaseViewModel = /** @class */ (function (_super) {
|
|
31051
31081
|
_super.prototype.dispose.call(this);
|
31052
31082
|
this.unmountPopupContainer();
|
31053
31083
|
this.container = undefined;
|
31054
|
-
this.
|
31055
|
-
|
31084
|
+
if (!!this.footerToolbarValue) {
|
31085
|
+
this.footerToolbarValue.dispose();
|
31086
|
+
}
|
31056
31087
|
};
|
31057
31088
|
PopupBaseViewModel.prototype.initializePopupContainer = function () {
|
31058
31089
|
if (!this.createdContainer) {
|
@@ -31380,7 +31411,7 @@ var Question = /** @class */ (function (_super) {
|
|
31380
31411
|
_this.registerPropertyChangedHandlers(["showCommentArea", "showOtherItem"], function () {
|
31381
31412
|
_this.initCommentFromSurvey();
|
31382
31413
|
});
|
31383
|
-
_this.registerFunctionOnPropertiesValueChanged(["no"], function () {
|
31414
|
+
_this.registerFunctionOnPropertiesValueChanged(["no", "readOnly"], function () {
|
31384
31415
|
_this.updateQuestionCss();
|
31385
31416
|
});
|
31386
31417
|
_this.registerPropertyChangedHandlers(["isMobile"], function () { _this.onMobileChanged(); });
|
@@ -31611,11 +31642,16 @@ var Question = /** @class */ (function (_super) {
|
|
31611
31642
|
get: function () {
|
31612
31643
|
if (this.survey && this.survey.areEmptyElementsHidden && this.isEmpty())
|
31613
31644
|
return false;
|
31614
|
-
|
31645
|
+
if (this.areInvisibleElementsShowing)
|
31646
|
+
return true;
|
31647
|
+
return this.isVisibleCore();
|
31615
31648
|
},
|
31616
31649
|
enumerable: false,
|
31617
31650
|
configurable: true
|
31618
31651
|
});
|
31652
|
+
Question.prototype.isVisibleCore = function () {
|
31653
|
+
return this.visible;
|
31654
|
+
};
|
31619
31655
|
Object.defineProperty(Question.prototype, "visibleIndex", {
|
31620
31656
|
/**
|
31621
31657
|
* Returns the visible index of the question in the survey. It can be from 0 to all visible questions count - 1
|
@@ -33537,9 +33573,7 @@ var Question = /** @class */ (function (_super) {
|
|
33537
33573
|
}
|
33538
33574
|
};
|
33539
33575
|
Question.prototype.getValidName = function (name) {
|
33540
|
-
|
33541
|
-
return name;
|
33542
|
-
return name.trim().replace(/[\{\}]+/g, "");
|
33576
|
+
return makeNameValid(name);
|
33543
33577
|
};
|
33544
33578
|
//IQuestion
|
33545
33579
|
Question.prototype.updateValueFromSurvey = function (newValue) {
|
@@ -33774,13 +33808,17 @@ var Question = /** @class */ (function (_super) {
|
|
33774
33808
|
return Question;
|
33775
33809
|
}(_survey_element__WEBPACK_IMPORTED_MODULE_2__["SurveyElement"]));
|
33776
33810
|
|
33777
|
-
function
|
33778
|
-
if (
|
33779
|
-
return str
|
33811
|
+
function makeNameValid(str) {
|
33812
|
+
if (!str)
|
33813
|
+
return str;
|
33814
|
+
str = str.trim().replace(/[\{\}]+/g, "");
|
33815
|
+
while (!!str && str[0] === _settings__WEBPACK_IMPORTED_MODULE_8__["settings"].expressionDisableConversionChar) {
|
33816
|
+
str = str.substring(1);
|
33817
|
+
}
|
33780
33818
|
return str;
|
33781
33819
|
}
|
33782
33820
|
_jsonobject__WEBPACK_IMPORTED_MODULE_1__["Serializer"].addClass("question", [
|
33783
|
-
{ name: "!name", onSettingValue: function (obj, val) { return
|
33821
|
+
{ name: "!name", onSettingValue: function (obj, val) { return makeNameValid(val); } },
|
33784
33822
|
{
|
33785
33823
|
name: "state",
|
33786
33824
|
default: "default",
|
@@ -33855,7 +33893,7 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_1__["Serializer"].addClass("question", [
|
|
33855
33893
|
(!!parent && parent.showQuestionNumbers === "onpanel"));
|
33856
33894
|
},
|
33857
33895
|
},
|
33858
|
-
{ name: "valueName", onSettingValue: function (obj, val) { return
|
33896
|
+
{ name: "valueName", onSettingValue: function (obj, val) { return makeNameValid(val); } },
|
33859
33897
|
"enableIf:condition",
|
33860
33898
|
"defaultValue:value",
|
33861
33899
|
{
|
@@ -34183,7 +34221,7 @@ var QuestionSelectBase = /** @class */ (function (_super) {
|
|
34183
34221
|
_this.onVisibleChoicesChanged();
|
34184
34222
|
});
|
34185
34223
|
_this.registerPropertyChangedHandlers(["hideIfChoicesEmpty"], function () {
|
34186
|
-
_this.
|
34224
|
+
_this.onVisibleChanged();
|
34187
34225
|
});
|
34188
34226
|
_this.createNewArray("visibleChoices");
|
34189
34227
|
_this.setNewRestfulProperty();
|
@@ -34231,8 +34269,11 @@ var QuestionSelectBase = /** @class */ (function (_super) {
|
|
34231
34269
|
QuestionSelectBase.prototype.getItemValueType = function () {
|
34232
34270
|
return "itemvalue";
|
34233
34271
|
};
|
34234
|
-
QuestionSelectBase.prototype.createItemValue = function (value) {
|
34235
|
-
|
34272
|
+
QuestionSelectBase.prototype.createItemValue = function (value, text) {
|
34273
|
+
var res = _jsonobject__WEBPACK_IMPORTED_MODULE_0__["Serializer"].createClass(this.getItemValueType(), value);
|
34274
|
+
if (!!text)
|
34275
|
+
res.text = text;
|
34276
|
+
return res;
|
34236
34277
|
};
|
34237
34278
|
QuestionSelectBase.prototype.supportGoNextPageError = function () {
|
34238
34279
|
return !this.isOtherSelected || !!this.otherValue;
|
@@ -34497,7 +34538,7 @@ var QuestionSelectBase = /** @class */ (function (_super) {
|
|
34497
34538
|
if (!itemValue && !selectedItemValues) {
|
34498
34539
|
this.updateSelectedItemValues();
|
34499
34540
|
}
|
34500
|
-
return itemValue || selectedItemValues || (this.isOtherSelected ? this.otherItem :
|
34541
|
+
return itemValue || selectedItemValues || (this.isOtherSelected ? this.otherItem : this.createItemValue(this.value));
|
34501
34542
|
};
|
34502
34543
|
QuestionSelectBase.prototype.onGetSingleSelectedItem = function (selectedItemByValue) { };
|
34503
34544
|
QuestionSelectBase.prototype.setConditionalChoicesRunner = function () {
|
@@ -34720,10 +34761,10 @@ var QuestionSelectBase = /** @class */ (function (_super) {
|
|
34720
34761
|
if (!displayValues || !displayValues.length)
|
34721
34762
|
return;
|
34722
34763
|
if (IsMultipleValue_1) {
|
34723
|
-
_this.selectedItemValues = displayValues.map(function (displayValue, index) { return
|
34764
|
+
_this.selectedItemValues = displayValues.map(function (displayValue, index) { return _this.createItemValue(_this.value[index], displayValue); });
|
34724
34765
|
}
|
34725
34766
|
else {
|
34726
|
-
_this.selectedItemValues =
|
34767
|
+
_this.selectedItemValues = _this.createItemValue(_this.value, displayValues[0]);
|
34727
34768
|
}
|
34728
34769
|
}
|
34729
34770
|
});
|
@@ -35055,7 +35096,7 @@ var QuestionSelectBase = /** @class */ (function (_super) {
|
|
35055
35096
|
QuestionSelectBase.prototype.addToVisibleChoices = function (items, isAddAll) {
|
35056
35097
|
if (isAddAll) {
|
35057
35098
|
if (!this.newItemValue) {
|
35058
|
-
this.newItemValue =
|
35099
|
+
this.newItemValue = this.createItemValue("newitem"); //TODO
|
35059
35100
|
}
|
35060
35101
|
if (this.canShowOptionItem(this.newItemValue, isAddAll, false)) {
|
35061
35102
|
items.push(this.newItemValue);
|
@@ -35199,12 +35240,14 @@ var QuestionSelectBase = /** @class */ (function (_super) {
|
|
35199
35240
|
}
|
35200
35241
|
}
|
35201
35242
|
if (this.choicesFromQuestionMode === "selected" && question.isOtherSelected && !!question.comment) {
|
35202
|
-
res.push(
|
35243
|
+
res.push(this.createItemValue(question.otherItem.value, question.comment));
|
35203
35244
|
}
|
35204
35245
|
return res;
|
35205
35246
|
};
|
35206
35247
|
QuestionSelectBase.prototype.copyChoiceItem = function (item) {
|
35207
|
-
|
35248
|
+
var res = this.createItemValue(item.value);
|
35249
|
+
res.setData(item);
|
35250
|
+
return res;
|
35208
35251
|
};
|
35209
35252
|
Object.defineProperty(QuestionSelectBase.prototype, "hasActiveChoices", {
|
35210
35253
|
get: function () {
|
@@ -35471,17 +35514,18 @@ var QuestionSelectBase = /** @class */ (function (_super) {
|
|
35471
35514
|
if (this.isLoadingFromJson)
|
35472
35515
|
return;
|
35473
35516
|
this.updateVisibleChoices();
|
35474
|
-
this.
|
35517
|
+
this.onVisibleChanged();
|
35475
35518
|
if (!!this.visibleChoicesChangedCallback) {
|
35476
35519
|
this.visibleChoicesChangedCallback();
|
35477
35520
|
}
|
35478
35521
|
this.updateChoicesDependedQuestions();
|
35479
35522
|
};
|
35480
|
-
QuestionSelectBase.prototype.
|
35481
|
-
|
35482
|
-
|
35483
|
-
|
35484
|
-
|
35523
|
+
QuestionSelectBase.prototype.isVisibleCore = function () {
|
35524
|
+
var superVal = _super.prototype.isVisibleCore.call(this);
|
35525
|
+
if (!this.hideIfChoicesEmpty || !superVal)
|
35526
|
+
return superVal;
|
35527
|
+
var filteredChoices = this.getFilteredChoices();
|
35528
|
+
return !filteredChoices || filteredChoices.length > 0;
|
35485
35529
|
};
|
35486
35530
|
QuestionSelectBase.prototype.sortVisibleChoices = function (array) {
|
35487
35531
|
var order = this.choicesOrder.toLowerCase();
|
@@ -38709,6 +38753,12 @@ var QuestionDropdownModel = /** @class */ (function (_super) {
|
|
38709
38753
|
event.stopPropagation();
|
38710
38754
|
}
|
38711
38755
|
};
|
38756
|
+
QuestionDropdownModel.prototype.dispose = function () {
|
38757
|
+
_super.prototype.dispose.call(this);
|
38758
|
+
if (!!this.dropdownListModelValue) {
|
38759
|
+
this.dropdownListModelValue.dispose();
|
38760
|
+
}
|
38761
|
+
};
|
38712
38762
|
__decorate([
|
38713
38763
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])()
|
38714
38764
|
], QuestionDropdownModel.prototype, "allowClear", void 0);
|
@@ -43170,7 +43220,8 @@ var QuestionMatrixDropdownModelBase = /** @class */ (function (_super) {
|
|
43170
43220
|
this.resetRenderedTable();
|
43171
43221
|
}
|
43172
43222
|
else {
|
43173
|
-
this.
|
43223
|
+
var index = this.visibleRows.length - 1;
|
43224
|
+
this.renderedTable.onAddedRow(this.visibleRows[index], index);
|
43174
43225
|
}
|
43175
43226
|
};
|
43176
43227
|
QuestionMatrixDropdownModelBase.prototype.onEndRowRemoving = function (row) {
|
@@ -43213,6 +43264,13 @@ var QuestionMatrixDropdownModelBase = /** @class */ (function (_super) {
|
|
43213
43264
|
}
|
43214
43265
|
_super.prototype.clearGeneratedRows.call(this);
|
43215
43266
|
};
|
43267
|
+
Object.defineProperty(QuestionMatrixDropdownModelBase.prototype, "isRendredTableCreated", {
|
43268
|
+
get: function () {
|
43269
|
+
return !!this.renderedTableValue;
|
43270
|
+
},
|
43271
|
+
enumerable: false,
|
43272
|
+
configurable: true
|
43273
|
+
});
|
43216
43274
|
Object.defineProperty(QuestionMatrixDropdownModelBase.prototype, "renderedTable", {
|
43217
43275
|
get: function () {
|
43218
43276
|
if (!this.renderedTableValue) {
|
@@ -45766,14 +45824,31 @@ var QuestionMatrixDropdownRenderedTable = /** @class */ (function (_super) {
|
|
45766
45824
|
this.setPropertyValue("showAddRowOnTop", showAddRowOnTop);
|
45767
45825
|
this.setPropertyValue("showAddRowOnBottom", showAddRowOnBottom);
|
45768
45826
|
};
|
45769
|
-
QuestionMatrixDropdownRenderedTable.prototype.onAddedRow = function () {
|
45827
|
+
QuestionMatrixDropdownRenderedTable.prototype.onAddedRow = function (row, index) {
|
45770
45828
|
if (this.getRenderedDataRowCount() >= this.matrix.visibleRows.length)
|
45771
45829
|
return;
|
45772
|
-
var
|
45773
|
-
this.rowsActions.
|
45774
|
-
this.addHorizontalRow(this.rows, row, this.matrix.visibleRows.length == 1 && !this.matrix.showHeader);
|
45830
|
+
var rowIndex = this.getRenderedRowIndexByIndex(index);
|
45831
|
+
this.rowsActions.splice(index, 0, this.buildRowActions(row));
|
45832
|
+
this.addHorizontalRow(this.rows, row, this.matrix.visibleRows.length == 1 && !this.matrix.showHeader, rowIndex);
|
45775
45833
|
this.updateShowTableAndAddRow();
|
45776
45834
|
};
|
45835
|
+
QuestionMatrixDropdownRenderedTable.prototype.getRenderedRowIndexByIndex = function (index) {
|
45836
|
+
var res = 0;
|
45837
|
+
var dataRowIndex = 0;
|
45838
|
+
for (var i = 0; i < this.rows.length; i++) {
|
45839
|
+
if (dataRowIndex === index) {
|
45840
|
+
if (this.rows[i].isDetailRow)
|
45841
|
+
res++;
|
45842
|
+
break;
|
45843
|
+
}
|
45844
|
+
res++;
|
45845
|
+
if (!this.rows[i].isDetailRow)
|
45846
|
+
dataRowIndex++;
|
45847
|
+
}
|
45848
|
+
if (dataRowIndex < index)
|
45849
|
+
return this.rows.length;
|
45850
|
+
return res;
|
45851
|
+
};
|
45777
45852
|
QuestionMatrixDropdownRenderedTable.prototype.getRenderedDataRowCount = function () {
|
45778
45853
|
var res = 0;
|
45779
45854
|
for (var i = 0; i < this.rows.length; i++) {
|
@@ -45937,12 +46012,16 @@ var QuestionMatrixDropdownRenderedTable = /** @class */ (function (_super) {
|
|
45937
46012
|
}
|
45938
46013
|
return renderedRows;
|
45939
46014
|
};
|
45940
|
-
QuestionMatrixDropdownRenderedTable.prototype.addHorizontalRow = function (renderedRows, row, useAsHeader) {
|
46015
|
+
QuestionMatrixDropdownRenderedTable.prototype.addHorizontalRow = function (renderedRows, row, useAsHeader, index) {
|
46016
|
+
if (index === void 0) { index = -1; }
|
45941
46017
|
var renderedRow = this.createHorizontalRow(row, useAsHeader);
|
45942
46018
|
renderedRow.row = row;
|
45943
|
-
|
46019
|
+
if (index < 0) {
|
46020
|
+
index = renderedRows.length;
|
46021
|
+
}
|
46022
|
+
renderedRows.splice(index, 0, renderedRow);
|
45944
46023
|
if (row.isDetailPanelShowing) {
|
45945
|
-
renderedRows.
|
46024
|
+
renderedRows.splice(index + 1, 0, this.createDetailPanelRow(row, renderedRow));
|
45946
46025
|
}
|
45947
46026
|
};
|
45948
46027
|
QuestionMatrixDropdownRenderedTable.prototype.getRowDragCell = function (rowIndex) {
|
@@ -46419,17 +46498,6 @@ var QuestionMatrixDynamicModel = /** @class */ (function (_super) {
|
|
46419
46498
|
_this.startDragMatrixRow = function (event, currentTarget) {
|
46420
46499
|
_this.dragDropMatrixRows.startDrag(event, _this.draggedRow, _this, event.target);
|
46421
46500
|
};
|
46422
|
-
_this.moveRowByIndex = function (fromIndex, toIndex) {
|
46423
|
-
var value = _this.createNewValue();
|
46424
|
-
if (!value)
|
46425
|
-
return;
|
46426
|
-
var movableRow = value[fromIndex];
|
46427
|
-
if (!movableRow)
|
46428
|
-
return;
|
46429
|
-
value.splice(fromIndex, 1);
|
46430
|
-
value.splice(toIndex, 0, movableRow);
|
46431
|
-
_this.value = value;
|
46432
|
-
};
|
46433
46501
|
_this.createLocalizableString("confirmDeleteText", _this, false, "confirmDelete");
|
46434
46502
|
var locAddRowText = _this.createLocalizableString("addRowText", _this);
|
46435
46503
|
locAddRowText.onGetTextCallback = function (text) {
|
@@ -46559,6 +46627,20 @@ var QuestionMatrixDynamicModel = /** @class */ (function (_super) {
|
|
46559
46627
|
}
|
46560
46628
|
this.value = newValue;
|
46561
46629
|
};
|
46630
|
+
QuestionMatrixDynamicModel.prototype.moveRowByIndex = function (fromIndex, toIndex) {
|
46631
|
+
var value = this.createNewValue();
|
46632
|
+
if (!Array.isArray(value) && Math.max(fromIndex, toIndex) >= value.length)
|
46633
|
+
return;
|
46634
|
+
var movableRow = value[fromIndex];
|
46635
|
+
value.splice(fromIndex, 1);
|
46636
|
+
value.splice(toIndex, 0, movableRow);
|
46637
|
+
this.value = value;
|
46638
|
+
};
|
46639
|
+
QuestionMatrixDynamicModel.prototype.clearOnDrop = function () {
|
46640
|
+
if (!this.isEditingSurveyElement) {
|
46641
|
+
this.resetRenderedTable();
|
46642
|
+
}
|
46643
|
+
};
|
46562
46644
|
Object.defineProperty(QuestionMatrixDynamicModel.prototype, "rowCount", {
|
46563
46645
|
/**
|
46564
46646
|
* The number of rows in the matrix.
|
@@ -47202,6 +47284,51 @@ var QuestionMatrixDynamicModel = /** @class */ (function (_super) {
|
|
47202
47284
|
QuestionMatrixDynamicModel.prototype.createMatrixRow = function (value) {
|
47203
47285
|
return new MatrixDynamicRowModel(this.rowCounter++, this, value);
|
47204
47286
|
};
|
47287
|
+
QuestionMatrixDynamicModel.prototype.getInsertedDeletedIndex = function (rows, val) {
|
47288
|
+
var len = Math.min(rows.length, val.length);
|
47289
|
+
for (var i = 0; i < len; i++) {
|
47290
|
+
if (val[i] !== rows[i].editingObj)
|
47291
|
+
return i;
|
47292
|
+
}
|
47293
|
+
return len;
|
47294
|
+
};
|
47295
|
+
QuestionMatrixDynamicModel.prototype.isEditingObjectValueChanged = function () {
|
47296
|
+
var val = this.value;
|
47297
|
+
if (!this.generatedVisibleRows || !this.isValueSurveyElement(val))
|
47298
|
+
return false;
|
47299
|
+
var lastDelRow = this.lastDeletedRow;
|
47300
|
+
this.lastDeletedRow = undefined;
|
47301
|
+
var rows = this.generatedVisibleRows;
|
47302
|
+
if (!Array.isArray(val) || Math.abs(rows.length - val.length) > 1)
|
47303
|
+
return false;
|
47304
|
+
var index = this.getInsertedDeletedIndex(rows, val);
|
47305
|
+
if (rows.length > val.length) {
|
47306
|
+
this.lastDeletedRow = rows[index];
|
47307
|
+
var row = rows[index];
|
47308
|
+
rows.splice(index, 1);
|
47309
|
+
if (this.isRendredTableCreated) {
|
47310
|
+
this.renderedTable.onRemovedRow(row);
|
47311
|
+
}
|
47312
|
+
}
|
47313
|
+
else {
|
47314
|
+
var newRow = undefined;
|
47315
|
+
if (!!lastDelRow && lastDelRow.editingObj === val[index]) {
|
47316
|
+
newRow = lastDelRow;
|
47317
|
+
}
|
47318
|
+
else {
|
47319
|
+
newRow = this.createMatrixRow(val[index]);
|
47320
|
+
}
|
47321
|
+
rows.splice(index, 0, newRow);
|
47322
|
+
if (!lastDelRow) {
|
47323
|
+
this.onMatrixRowCreated(newRow);
|
47324
|
+
}
|
47325
|
+
if (this.isRendredTableCreated) {
|
47326
|
+
this.renderedTable.onAddedRow(newRow, index);
|
47327
|
+
}
|
47328
|
+
}
|
47329
|
+
this.setPropertyValueDirectly("rowCount", val.length);
|
47330
|
+
return true;
|
47331
|
+
};
|
47205
47332
|
QuestionMatrixDynamicModel.prototype.onBeforeValueChanged = function (val) {
|
47206
47333
|
if (!val || !Array.isArray(val))
|
47207
47334
|
return;
|
@@ -47210,6 +47337,8 @@ var QuestionMatrixDynamicModel = /** @class */ (function (_super) {
|
|
47210
47337
|
return;
|
47211
47338
|
if (!this.setRowCountValueFromData && newRowCount < this.initialRowCount)
|
47212
47339
|
return;
|
47340
|
+
if (this.isEditingObjectValueChanged())
|
47341
|
+
return;
|
47213
47342
|
this.setRowCountValueFromData = true;
|
47214
47343
|
this.rowCountValue = newRowCount;
|
47215
47344
|
if (!this.generatedVisibleRows)
|
@@ -48198,17 +48327,18 @@ __webpack_require__.r(__webpack_exports__);
|
|
48198
48327
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "QuestionPanelDynamicModel", function() { return QuestionPanelDynamicModel; });
|
48199
48328
|
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./helpers */ "./src/helpers.ts");
|
48200
48329
|
/* harmony import */ var _survey_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./survey-element */ "./src/survey-element.ts");
|
48201
|
-
/* harmony import */ var
|
48202
|
-
/* harmony import */ var
|
48203
|
-
/* harmony import */ var
|
48204
|
-
/* harmony import */ var
|
48205
|
-
/* harmony import */ var
|
48206
|
-
/* harmony import */ var
|
48207
|
-
/* harmony import */ var
|
48208
|
-
/* harmony import */ var
|
48209
|
-
/* harmony import */ var
|
48210
|
-
/* harmony import */ var
|
48211
|
-
/* harmony import */ var
|
48330
|
+
/* harmony import */ var _localizablestring__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./localizablestring */ "./src/localizablestring.ts");
|
48331
|
+
/* harmony import */ var _textPreProcessor__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./textPreProcessor */ "./src/textPreProcessor.ts");
|
48332
|
+
/* harmony import */ var _question__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./question */ "./src/question.ts");
|
48333
|
+
/* harmony import */ var _jsonobject__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./jsonobject */ "./src/jsonobject.ts");
|
48334
|
+
/* harmony import */ var _questionfactory__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./questionfactory */ "./src/questionfactory.ts");
|
48335
|
+
/* harmony import */ var _error__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./error */ "./src/error.ts");
|
48336
|
+
/* harmony import */ var _settings__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./settings */ "./src/settings.ts");
|
48337
|
+
/* harmony import */ var _utils_utils__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./utils/utils */ "./src/utils/utils.ts");
|
48338
|
+
/* harmony import */ var _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./utils/cssClassBuilder */ "./src/utils/cssClassBuilder.ts");
|
48339
|
+
/* harmony import */ var _actions_action__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./actions/action */ "./src/actions/action.ts");
|
48340
|
+
/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./base */ "./src/base.ts");
|
48341
|
+
/* harmony import */ var _actions_adaptive_container__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./actions/adaptive-container */ "./src/actions/adaptive-container.ts");
|
48212
48342
|
var __extends = (undefined && undefined.__extends) || (function () {
|
48213
48343
|
var extendStatics = function (d, b) {
|
48214
48344
|
extendStatics = Object.setPrototypeOf ||
|
@@ -48248,6 +48378,7 @@ var __spreadArray = (undefined && undefined.__spreadArray) || function (to, from
|
|
48248
48378
|
|
48249
48379
|
|
48250
48380
|
|
48381
|
+
|
48251
48382
|
var QuestionPanelDynamicItemTextProcessor = /** @class */ (function (_super) {
|
48252
48383
|
__extends(QuestionPanelDynamicItemTextProcessor, _super);
|
48253
48384
|
function QuestionPanelDynamicItemTextProcessor(data, panelItem, variableName) {
|
@@ -48323,7 +48454,7 @@ var QuestionPanelDynamicItemTextProcessor = /** @class */ (function (_super) {
|
|
48323
48454
|
return false;
|
48324
48455
|
};
|
48325
48456
|
return QuestionPanelDynamicItemTextProcessor;
|
48326
|
-
}(
|
48457
|
+
}(_textPreProcessor__WEBPACK_IMPORTED_MODULE_3__["QuestionTextProcessor"]));
|
48327
48458
|
var QuestionPanelDynamicItem = /** @class */ (function () {
|
48328
48459
|
function QuestionPanelDynamicItem(data, panel) {
|
48329
48460
|
this.data = data;
|
@@ -48363,11 +48494,11 @@ var QuestionPanelDynamicItem = /** @class */ (function () {
|
|
48363
48494
|
};
|
48364
48495
|
QuestionPanelDynamicItem.prototype.setVariable = function (name, newValue) { };
|
48365
48496
|
QuestionPanelDynamicItem.prototype.getComment = function (name) {
|
48366
|
-
var result = this.getValue(name +
|
48497
|
+
var result = this.getValue(name + _settings__WEBPACK_IMPORTED_MODULE_8__["settings"].commentSuffix);
|
48367
48498
|
return result ? result : "";
|
48368
48499
|
};
|
48369
48500
|
QuestionPanelDynamicItem.prototype.setComment = function (name, newValue, locNotification) {
|
48370
|
-
this.setValue(name +
|
48501
|
+
this.setValue(name + _settings__WEBPACK_IMPORTED_MODULE_8__["settings"].commentSuffix, newValue);
|
48371
48502
|
};
|
48372
48503
|
QuestionPanelDynamicItem.prototype.findQuestionByName = function (name) {
|
48373
48504
|
if (!name)
|
@@ -48392,7 +48523,9 @@ var QuestionPanelDynamicItem = /** @class */ (function () {
|
|
48392
48523
|
}
|
48393
48524
|
values[QuestionPanelDynamicItem.ItemVariableName] = this.getAllValues();
|
48394
48525
|
if (!!this.data) {
|
48395
|
-
|
48526
|
+
var indexStr = QuestionPanelDynamicItem.IndexVariableName;
|
48527
|
+
delete values[indexStr];
|
48528
|
+
values[indexStr.toLowerCase()] = this.data.getItemIndex(this);
|
48396
48529
|
var q = this.data;
|
48397
48530
|
if (!!q && !!q.parentQuestion && !!q.parent) {
|
48398
48531
|
values[QuestionPanelDynamicItem.ParentItemVariableName] = q.parent.getValue();
|
@@ -48439,7 +48572,7 @@ var QuestionPanelDynamicTemplateSurveyImpl = /** @class */ (function () {
|
|
48439
48572
|
/**
|
48440
48573
|
* A class that describes the Dynamic Panel question type.
|
48441
48574
|
*
|
48442
|
-
* Dynamic Panel allows respondents to add panels based on a template
|
48575
|
+
* Dynamic Panel allows respondents to add panels based on a panel template and delete them. Specify the [`templateElements`](https://surveyjs.io/form-library/documentation/questionpaneldynamicmodel#templateElements) property to configure panel template elements.
|
48443
48576
|
*
|
48444
48577
|
* [View Demo](https://surveyjs.io/form-library/examples/questiontype-paneldynamic/ (linkStyle))
|
48445
48578
|
*/
|
@@ -48447,7 +48580,6 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
48447
48580
|
__extends(QuestionPanelDynamicModel, _super);
|
48448
48581
|
function QuestionPanelDynamicModel(name) {
|
48449
48582
|
var _this = _super.call(this, name) || this;
|
48450
|
-
_this.loadingPanelCount = 0;
|
48451
48583
|
_this.isAddingNewPanels = false;
|
48452
48584
|
_this.onReadyChangedCallback = function () {
|
48453
48585
|
_this.recalculateIsReadyValue();
|
@@ -48471,6 +48603,7 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
48471
48603
|
_this.createLocalizableString("panelPrevText", _this, false, "pagePrevText");
|
48472
48604
|
_this.createLocalizableString("panelNextText", _this, false, "pageNextText");
|
48473
48605
|
_this.createLocalizableString("noEntriesText", _this, false, "noEntriesText");
|
48606
|
+
_this.createLocalizableString("templateTabTitle", _this, true, "panelDynamicTabTextFormat");
|
48474
48607
|
_this.registerPropertyChangedHandlers(["panelsState"], function () {
|
48475
48608
|
_this.setPanelsState();
|
48476
48609
|
});
|
@@ -48523,7 +48656,7 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
48523
48656
|
QuestionPanelDynamicModel.prototype.onTemplateElementPropertyChanged = function (element, options) {
|
48524
48657
|
if (this.isLoadingFromJson || this.useTemplatePanel || this.panels.length == 0)
|
48525
48658
|
return;
|
48526
|
-
var property =
|
48659
|
+
var property = _jsonobject__WEBPACK_IMPORTED_MODULE_5__["Serializer"].findProperty(element.getType(), options.name);
|
48527
48660
|
if (!property)
|
48528
48661
|
return;
|
48529
48662
|
var panels = this.panels;
|
@@ -48586,7 +48719,7 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
48586
48719
|
};
|
48587
48720
|
Object.defineProperty(QuestionPanelDynamicModel.prototype, "templateElements", {
|
48588
48721
|
/**
|
48589
|
-
* An array of questions and panels included in
|
48722
|
+
* An array of questions and panels included in a panel template.
|
48590
48723
|
* @see template
|
48591
48724
|
* @see panels
|
48592
48725
|
* @see panelCount
|
@@ -48599,7 +48732,7 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
48599
48732
|
});
|
48600
48733
|
Object.defineProperty(QuestionPanelDynamicModel.prototype, "templateTitle", {
|
48601
48734
|
/**
|
48602
|
-
* A
|
48735
|
+
* A template for panel titles.
|
48603
48736
|
* @see template
|
48604
48737
|
* @see templateDescription
|
48605
48738
|
* @see templateElements
|
@@ -48622,9 +48755,31 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
48622
48755
|
enumerable: false,
|
48623
48756
|
configurable: true
|
48624
48757
|
});
|
48758
|
+
Object.defineProperty(QuestionPanelDynamicModel.prototype, "templateTabTitle", {
|
48759
|
+
/**
|
48760
|
+
* A template for tab titles. Applies when [`renderMode`](https://surveyjs.io/form-library/documentation/api-reference/dynamic-panel-model#renderMode) is `"tab"`.
|
48761
|
+
* @see templateTitle
|
48762
|
+
* @see renderMode
|
48763
|
+
*/
|
48764
|
+
get: function () {
|
48765
|
+
return this.locTemplateTabTitle.text;
|
48766
|
+
},
|
48767
|
+
set: function (newValue) {
|
48768
|
+
this.locTemplateTabTitle.text = newValue;
|
48769
|
+
},
|
48770
|
+
enumerable: false,
|
48771
|
+
configurable: true
|
48772
|
+
});
|
48773
|
+
Object.defineProperty(QuestionPanelDynamicModel.prototype, "locTemplateTabTitle", {
|
48774
|
+
get: function () {
|
48775
|
+
return this.getLocalizableString("templateTabTitle");
|
48776
|
+
},
|
48777
|
+
enumerable: false,
|
48778
|
+
configurable: true
|
48779
|
+
});
|
48625
48780
|
Object.defineProperty(QuestionPanelDynamicModel.prototype, "templateDescription", {
|
48626
48781
|
/**
|
48627
|
-
* A
|
48782
|
+
* A template for panel descriptions.
|
48628
48783
|
* @see template
|
48629
48784
|
* @see templateTitle
|
48630
48785
|
* @see templateElements
|
@@ -48660,7 +48815,7 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
48660
48815
|
});
|
48661
48816
|
Object.defineProperty(QuestionPanelDynamicModel.prototype, "panels", {
|
48662
48817
|
/**
|
48663
|
-
* An array of `PanelModel` objects created based on
|
48818
|
+
* An array of `PanelModel` objects created based on a panel template.
|
48664
48819
|
* @see PanelModel
|
48665
48820
|
* @see template
|
48666
48821
|
* @see panelCount
|
@@ -48986,7 +49141,7 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
48986
49141
|
};
|
48987
49142
|
QuestionPanelDynamicModel.prototype.setIsMobile = function (val) {
|
48988
49143
|
(this.panels || []).forEach(function (panel) { return panel.elements.forEach(function (element) {
|
48989
|
-
if (element instanceof
|
49144
|
+
if (element instanceof _question__WEBPACK_IMPORTED_MODULE_4__["Question"]) {
|
48990
49145
|
element.isMobile = val;
|
48991
49146
|
}
|
48992
49147
|
}); });
|
@@ -48999,14 +49154,14 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
48999
49154
|
*/
|
49000
49155
|
get: function () {
|
49001
49156
|
return this.isLoadingFromJson || this.useTemplatePanel
|
49002
|
-
? this.
|
49157
|
+
? this.getPropertyValue("panelCount")
|
49003
49158
|
: this.panels.length;
|
49004
49159
|
},
|
49005
49160
|
set: function (val) {
|
49006
49161
|
if (val < 0)
|
49007
49162
|
return;
|
49008
49163
|
if (this.isLoadingFromJson || this.useTemplatePanel) {
|
49009
|
-
this.
|
49164
|
+
this.setPropertyValue("panelCount", val);
|
49010
49165
|
return;
|
49011
49166
|
}
|
49012
49167
|
if (val == this.panels.length || this.useTemplatePanel)
|
@@ -49144,8 +49299,8 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
49144
49299
|
set: function (val) {
|
49145
49300
|
if (val <= 0)
|
49146
49301
|
return;
|
49147
|
-
if (val >
|
49148
|
-
val =
|
49302
|
+
if (val > _settings__WEBPACK_IMPORTED_MODULE_8__["settings"].panelMaximumPanelCount)
|
49303
|
+
val = _settings__WEBPACK_IMPORTED_MODULE_8__["settings"].panelMaximumPanelCount;
|
49149
49304
|
if (val == this.maxPanelCount)
|
49150
49305
|
return;
|
49151
49306
|
this.setPropertyValue("maxPanelCount", val);
|
@@ -49193,7 +49348,7 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
49193
49348
|
});
|
49194
49349
|
Object.defineProperty(QuestionPanelDynamicModel.prototype, "templateTitleLocation", {
|
49195
49350
|
/**
|
49196
|
-
* Gets or sets the location of question titles
|
49351
|
+
* Gets or sets the location of question titles relative to their input fields.
|
49197
49352
|
*
|
49198
49353
|
* - `"default"` (default) - Inherits the setting from the Dynamic Panel's `titleLocation` property, which in turn inherits the [`questionTitleLocation`](https://surveyjs.io/form-library/documentation/surveymodel#questionTitleLocation) property value specified for the Dynamic Panel's container (page or survey).
|
49199
49354
|
* - `"top"` - Displays question titles above input fields.
|
@@ -49266,7 +49421,15 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
49266
49421
|
});
|
49267
49422
|
Object.defineProperty(QuestionPanelDynamicModel.prototype, "renderMode", {
|
49268
49423
|
/**
|
49269
|
-
*
|
49424
|
+
* Specifies how to render panels.
|
49425
|
+
*
|
49426
|
+
* Possible values:
|
49427
|
+
*
|
49428
|
+
* - `"list"` - Renders panels one under the other. [View Demo](https://surveyjs.io/form-library/examples/how-to-use-expressions-in-dynamic-panel/)
|
49429
|
+
* - `"progressTop"` - Renders each panel as a card and displays a progress bar at the top. [View Demo](https://surveyjs.io/form-library/examples/questiontype-paneldynamic/)
|
49430
|
+
* - `"progressBottom"` - Renders each panel panel as a card and displays a progress bar at the bottom.
|
49431
|
+
* - `"progressTopBottom"` - Renders each panel as a card and displays a progress bar at the top and bottom.
|
49432
|
+
* - `"tab"` - Renders each panel within a tab. Use the [`templateTabTitle`](https://surveyjs.io/form-library/documentation/api-reference/dynamic-panel-model#templateTabTitle) to specify a template for tab titles.
|
49270
49433
|
*/
|
49271
49434
|
get: function () {
|
49272
49435
|
return this.getPropertyValue("renderMode");
|
@@ -49560,7 +49723,7 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
49560
49723
|
QuestionPanelDynamicModel.prototype.removePanelUI = function (value) {
|
49561
49724
|
if (!this.canRemovePanel)
|
49562
49725
|
return;
|
49563
|
-
if (!this.confirmDelete || Object(
|
49726
|
+
if (!this.confirmDelete || Object(_utils_utils__WEBPACK_IMPORTED_MODULE_9__["confirmAction"])(this.confirmDeleteText)) {
|
49564
49727
|
this.removePanel(value);
|
49565
49728
|
}
|
49566
49729
|
};
|
@@ -49622,12 +49785,22 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
49622
49785
|
}
|
49623
49786
|
return -1;
|
49624
49787
|
};
|
49788
|
+
QuestionPanelDynamicModel.prototype.getPanelIndexById = function (id) {
|
49789
|
+
for (var i = 0; i < this.panels.length; i++) {
|
49790
|
+
if (this.panels[i].id === id)
|
49791
|
+
return i;
|
49792
|
+
}
|
49793
|
+
return -1;
|
49794
|
+
};
|
49625
49795
|
QuestionPanelDynamicModel.prototype.locStrsChanged = function () {
|
49626
49796
|
_super.prototype.locStrsChanged.call(this);
|
49627
49797
|
var panels = this.panels;
|
49628
49798
|
for (var i = 0; i < panels.length; i++) {
|
49629
49799
|
panels[i].locStrsChanged();
|
49630
49800
|
}
|
49801
|
+
if (this.additionalTitleToolbar) {
|
49802
|
+
this.additionalTitleToolbar.locStrsChanged();
|
49803
|
+
}
|
49631
49804
|
};
|
49632
49805
|
QuestionPanelDynamicModel.prototype.clearIncorrectValues = function () {
|
49633
49806
|
for (var i = 0; i < this.panels.length; i++) {
|
@@ -49659,8 +49832,8 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
49659
49832
|
var q = panel.getQuestionByName(key);
|
49660
49833
|
if (!!q)
|
49661
49834
|
continue;
|
49662
|
-
if (this.iscorrectValueWithPostPrefix(panel, key,
|
49663
|
-
this.iscorrectValueWithPostPrefix(panel, key,
|
49835
|
+
if (this.iscorrectValueWithPostPrefix(panel, key, _settings__WEBPACK_IMPORTED_MODULE_8__["settings"].commentSuffix) ||
|
49836
|
+
this.iscorrectValueWithPostPrefix(panel, key, _settings__WEBPACK_IMPORTED_MODULE_8__["settings"].matrixTotalValuePostFix))
|
49664
49837
|
continue;
|
49665
49838
|
delete values[key];
|
49666
49839
|
isChanged = true;
|
@@ -49689,7 +49862,7 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
49689
49862
|
for (var i = 0; i < questions.length; i++) {
|
49690
49863
|
questions[i].addConditionObjectsByContext(panelObjs, context);
|
49691
49864
|
}
|
49692
|
-
for (var index = 0; index <
|
49865
|
+
for (var index = 0; index < _settings__WEBPACK_IMPORTED_MODULE_8__["settings"].panelDynamicMaxPanelCountInCondition; index++) {
|
49693
49866
|
var indexStr = "[" + index + "].";
|
49694
49867
|
var prefixName = this.getValueName() + indexStr;
|
49695
49868
|
var prefixText = this.processedTitle + indexStr;
|
@@ -49754,8 +49927,8 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
49754
49927
|
QuestionPanelDynamicModel.prototype.onSurveyLoad = function () {
|
49755
49928
|
this.template.readOnly = this.isReadOnly;
|
49756
49929
|
this.template.onSurveyLoad();
|
49757
|
-
if (this.
|
49758
|
-
this.panelCount = this.
|
49930
|
+
if (this.getPropertyValue("panelCount") > 0) {
|
49931
|
+
this.panelCount = this.getPropertyValue("panelCount");
|
49759
49932
|
}
|
49760
49933
|
if (this.useTemplatePanel) {
|
49761
49934
|
this.rebuildPanels();
|
@@ -49994,7 +50167,7 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
49994
50167
|
for (var i = 0; i < keyValues.length; i++) {
|
49995
50168
|
if (value == keyValues[i]) {
|
49996
50169
|
if (fireCallback) {
|
49997
|
-
question.addError(new
|
50170
|
+
question.addError(new _error__WEBPACK_IMPORTED_MODULE_7__["KeyDuplicationError"](this.keyDuplicationError, this));
|
49998
50171
|
}
|
49999
50172
|
if (!!rec && !rec.firstErrorQuestion) {
|
50000
50173
|
rec.firstErrorQuestion = question;
|
@@ -50009,10 +50182,10 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
50009
50182
|
var _this = this;
|
50010
50183
|
var actions = panel.footerActions;
|
50011
50184
|
if (this.panelRemoveButtonLocation !== "right") {
|
50012
|
-
actions.push(new
|
50185
|
+
actions.push(new _actions_action__WEBPACK_IMPORTED_MODULE_11__["Action"]({
|
50013
50186
|
id: "remove-panel-" + panel.id,
|
50014
50187
|
component: "sv-paneldynamic-remove-btn",
|
50015
|
-
visible: new
|
50188
|
+
visible: new _base__WEBPACK_IMPORTED_MODULE_12__["ComputedUpdater"](function () { return [_this.canRemovePanel, panel.state !== "collapsed", _this.panelRemoveButtonLocation !== "right"].every(function (val) { return val === true; }); }),
|
50016
50189
|
data: { question: this, panel: panel }
|
50017
50190
|
}));
|
50018
50191
|
}
|
@@ -50025,7 +50198,7 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
50025
50198
|
var _this = this;
|
50026
50199
|
var panel = this.createAndSetupNewPanelObject();
|
50027
50200
|
var json = this.template.toJSON();
|
50028
|
-
new
|
50201
|
+
new _jsonobject__WEBPACK_IMPORTED_MODULE_5__["JsonObject"]().toObject(json, panel);
|
50029
50202
|
panel.renderWidth = "100%";
|
50030
50203
|
panel.updateCustomWidgets();
|
50031
50204
|
new QuestionPanelDynamicItem(this, panel);
|
@@ -50057,15 +50230,15 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
50057
50230
|
: this.getTitleLocationCore();
|
50058
50231
|
};
|
50059
50232
|
QuestionPanelDynamicModel.prototype.createNewPanelObject = function () {
|
50060
|
-
return
|
50233
|
+
return _jsonobject__WEBPACK_IMPORTED_MODULE_5__["Serializer"].createClass("panel");
|
50061
50234
|
};
|
50062
50235
|
QuestionPanelDynamicModel.prototype.setPanelCountBasedOnValue = function () {
|
50063
50236
|
if (this.isValueChangingInternally || this.useTemplatePanel)
|
50064
50237
|
return;
|
50065
50238
|
var val = this.value;
|
50066
50239
|
var newPanelCount = val && Array.isArray(val) ? val.length : 0;
|
50067
|
-
if (newPanelCount == 0 && this.
|
50068
|
-
newPanelCount = this.
|
50240
|
+
if (newPanelCount == 0 && this.getPropertyValue("panelCount") > 0) {
|
50241
|
+
newPanelCount = this.getPropertyValue("panelCount");
|
50069
50242
|
}
|
50070
50243
|
this.panelCount = newPanelCount;
|
50071
50244
|
};
|
@@ -50102,7 +50275,7 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
50102
50275
|
for (var i = 0; i < questions.length; i++) {
|
50103
50276
|
var q = questions[i];
|
50104
50277
|
q.updateValueFromSurvey(values[q.getValueName()]);
|
50105
|
-
q.updateCommentFromSurvey(values[q.getValueName() +
|
50278
|
+
q.updateCommentFromSurvey(values[q.getValueName() + _settings__WEBPACK_IMPORTED_MODULE_8__["settings"].commentSuffix]);
|
50106
50279
|
}
|
50107
50280
|
};
|
50108
50281
|
QuestionPanelDynamicModel.prototype.panelSurveyValueChanged = function (panel) {
|
@@ -50266,12 +50439,12 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
50266
50439
|
configurable: true
|
50267
50440
|
});
|
50268
50441
|
QuestionPanelDynamicModel.prototype.getRootCss = function () {
|
50269
|
-
return new
|
50442
|
+
return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_10__["CssClassBuilder"]().append(_super.prototype.getRootCss.call(this)).append(this.cssClasses.empty, this.getShowNoEntriesPlaceholder()).toString();
|
50270
50443
|
};
|
50271
50444
|
Object.defineProperty(QuestionPanelDynamicModel.prototype, "cssHeader", {
|
50272
50445
|
get: function () {
|
50273
50446
|
var showTab = this.isRenderModeTab && !!this.panelCount;
|
50274
|
-
return new
|
50447
|
+
return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_10__["CssClassBuilder"]()
|
50275
50448
|
.append(this.cssClasses.header)
|
50276
50449
|
.append(this.cssClasses.headerTop, this.hasTitleOnTop || showTab)
|
50277
50450
|
.append(this.cssClasses.headerTab, showTab)
|
@@ -50281,33 +50454,33 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
50281
50454
|
configurable: true
|
50282
50455
|
});
|
50283
50456
|
QuestionPanelDynamicModel.prototype.getPanelWrapperCss = function () {
|
50284
|
-
return new
|
50457
|
+
return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_10__["CssClassBuilder"]()
|
50285
50458
|
.append(this.cssClasses.panelWrapper)
|
50286
50459
|
.append(this.cssClasses.panelWrapperInRow, this.panelRemoveButtonLocation === "right")
|
50287
50460
|
.toString();
|
50288
50461
|
};
|
50289
50462
|
QuestionPanelDynamicModel.prototype.getPanelRemoveButtonCss = function () {
|
50290
|
-
return new
|
50463
|
+
return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_10__["CssClassBuilder"]()
|
50291
50464
|
.append(this.cssClasses.button)
|
50292
50465
|
.append(this.cssClasses.buttonRemove)
|
50293
50466
|
.append(this.cssClasses.buttonRemoveRight, this.panelRemoveButtonLocation === "right")
|
50294
50467
|
.toString();
|
50295
50468
|
};
|
50296
50469
|
QuestionPanelDynamicModel.prototype.getAddButtonCss = function () {
|
50297
|
-
return new
|
50470
|
+
return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_10__["CssClassBuilder"]()
|
50298
50471
|
.append(this.cssClasses.button)
|
50299
50472
|
.append(this.cssClasses.buttonAdd)
|
50300
50473
|
.append(this.cssClasses.buttonAdd + "--list-mode", this.renderMode === "list")
|
50301
50474
|
.toString();
|
50302
50475
|
};
|
50303
50476
|
QuestionPanelDynamicModel.prototype.getPrevButtonCss = function () {
|
50304
|
-
return new
|
50477
|
+
return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_10__["CssClassBuilder"]()
|
50305
50478
|
.append(this.cssClasses.buttonPrev)
|
50306
50479
|
.append(this.cssClasses.buttonPrevDisabled, !this.isPrevButtonVisible)
|
50307
50480
|
.toString();
|
50308
50481
|
};
|
50309
50482
|
QuestionPanelDynamicModel.prototype.getNextButtonCss = function () {
|
50310
|
-
return new
|
50483
|
+
return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_10__["CssClassBuilder"]()
|
50311
50484
|
.append(this.cssClasses.buttonNext)
|
50312
50485
|
.append(this.cssClasses.buttonNextDisabled, !this.isNextButtonVisible)
|
50313
50486
|
.toString();
|
@@ -50345,7 +50518,7 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
50345
50518
|
if (!this.isRenderModeTab)
|
50346
50519
|
return null;
|
50347
50520
|
if (!this.additionalTitleToolbarValue) {
|
50348
|
-
this.additionalTitleToolbarValue = new
|
50521
|
+
this.additionalTitleToolbarValue = new _actions_adaptive_container__WEBPACK_IMPORTED_MODULE_13__["AdaptiveActionContainer"]();
|
50349
50522
|
this.additionalTitleToolbarValue.containerCss = this.getAdditionalTitleToolbarCss();
|
50350
50523
|
this.additionalTitleToolbarValue.cssClasses = {
|
50351
50524
|
item: "sv-tab-item",
|
@@ -50376,37 +50549,37 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
50376
50549
|
var _this = this;
|
50377
50550
|
this.footerToolbarValue = this.createActionContainer();
|
50378
50551
|
var items = [];
|
50379
|
-
var prevTextBtn = new
|
50552
|
+
var prevTextBtn = new _actions_action__WEBPACK_IMPORTED_MODULE_11__["Action"]({
|
50380
50553
|
id: "sv-pd-prev-btn",
|
50381
50554
|
title: this.panelPrevText,
|
50382
50555
|
action: function () {
|
50383
50556
|
_this.goToPrevPanel();
|
50384
50557
|
}
|
50385
50558
|
});
|
50386
|
-
var nextTextBtn = new
|
50559
|
+
var nextTextBtn = new _actions_action__WEBPACK_IMPORTED_MODULE_11__["Action"]({
|
50387
50560
|
id: "sv-pd-next-btn",
|
50388
50561
|
title: this.panelNextText,
|
50389
50562
|
action: function () {
|
50390
50563
|
_this.goToNextPanel();
|
50391
50564
|
}
|
50392
50565
|
});
|
50393
|
-
var addBtn = new
|
50566
|
+
var addBtn = new _actions_action__WEBPACK_IMPORTED_MODULE_11__["Action"]({
|
50394
50567
|
id: "sv-pd-add-btn",
|
50395
50568
|
component: "sv-paneldynamic-add-btn",
|
50396
|
-
visible: new
|
50569
|
+
visible: new _base__WEBPACK_IMPORTED_MODULE_12__["ComputedUpdater"](function () { return _this.canAddPanel; }),
|
50397
50570
|
data: { question: this }
|
50398
50571
|
});
|
50399
|
-
var prevBtnIcon = new
|
50572
|
+
var prevBtnIcon = new _actions_action__WEBPACK_IMPORTED_MODULE_11__["Action"]({
|
50400
50573
|
id: "sv-prev-btn-icon",
|
50401
50574
|
component: "sv-paneldynamic-prev-btn",
|
50402
50575
|
data: { question: this }
|
50403
50576
|
});
|
50404
|
-
var progressText = new
|
50577
|
+
var progressText = new _actions_action__WEBPACK_IMPORTED_MODULE_11__["Action"]({
|
50405
50578
|
id: "sv-pd-progress-text",
|
50406
50579
|
component: "sv-paneldynamic-progress-text",
|
50407
50580
|
data: { question: this }
|
50408
50581
|
});
|
50409
|
-
var nextBtnIcon = new
|
50582
|
+
var nextBtnIcon = new _actions_action__WEBPACK_IMPORTED_MODULE_11__["Action"]({
|
50410
50583
|
id: "sv-pd-next-btn-icon",
|
50411
50584
|
component: "sv-paneldynamic-next-btn",
|
50412
50585
|
data: { question: this }
|
@@ -50435,22 +50608,22 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
50435
50608
|
var _this = this;
|
50436
50609
|
if (!this.isRenderModeTab)
|
50437
50610
|
return;
|
50438
|
-
var
|
50439
|
-
|
50440
|
-
var newItem = new
|
50441
|
-
id:
|
50611
|
+
var locTitle = new _localizablestring__WEBPACK_IMPORTED_MODULE_2__["LocalizableString"](panel, true);
|
50612
|
+
locTitle.sharedData = this.locTemplateTabTitle;
|
50613
|
+
var newItem = new _actions_action__WEBPACK_IMPORTED_MODULE_11__["Action"]({
|
50614
|
+
id: panel.id,
|
50442
50615
|
css: "sv-tab-item__root",
|
50443
|
-
pressed:
|
50444
|
-
|
50616
|
+
pressed: this.getPanelIndexById(panel.id) === this.currentIndex,
|
50617
|
+
locTitle: locTitle,
|
50445
50618
|
action: function () {
|
50446
|
-
_this.currentIndex =
|
50619
|
+
_this.currentIndex = _this.getPanelIndexById(newItem.id);
|
50447
50620
|
_this.updateTabToolbarItemsPressedState();
|
50448
50621
|
}
|
50449
50622
|
});
|
50450
50623
|
return newItem;
|
50451
50624
|
};
|
50452
50625
|
QuestionPanelDynamicModel.prototype.getAdditionalTitleToolbarCss = function () {
|
50453
|
-
return new
|
50626
|
+
return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_10__["CssClassBuilder"]()
|
50454
50627
|
.append("sv-tabs-toolbar")
|
50455
50628
|
.append("sv-tabs-toolbar--left", this.tabAlign === "left")
|
50456
50629
|
.append("sv-tabs-toolbar--right", this.tabAlign === "right")
|
@@ -50458,10 +50631,12 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
50458
50631
|
.toString();
|
50459
50632
|
};
|
50460
50633
|
QuestionPanelDynamicModel.prototype.updateTabToolbarItemsPressedState = function () {
|
50461
|
-
var _this = this;
|
50462
50634
|
if (!this.isRenderModeTab)
|
50463
50635
|
return;
|
50464
|
-
this.
|
50636
|
+
if (this.currentIndex < 0 || this.currentIndex >= this.panels.length)
|
50637
|
+
return;
|
50638
|
+
var panel = this.panels[this.currentIndex];
|
50639
|
+
this.additionalTitleToolbar.renderedActions.forEach(function (action) { return action.pressed = action.id === panel.id; });
|
50465
50640
|
};
|
50466
50641
|
QuestionPanelDynamicModel.prototype.updateTabToolbar = function () {
|
50467
50642
|
var _this = this;
|
@@ -50483,8 +50658,7 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
50483
50658
|
if (!this.isRenderModeTab)
|
50484
50659
|
return;
|
50485
50660
|
panels.forEach(function (panel) {
|
50486
|
-
var
|
50487
|
-
var removedItem = _this.additionalTitleToolbar.getActionById(index.toString());
|
50661
|
+
var removedItem = _this.additionalTitleToolbar.getActionById(panel.id);
|
50488
50662
|
_this.additionalTitleToolbar.actions.splice(_this.additionalTitleToolbar.actions.indexOf(removedItem), 1);
|
50489
50663
|
});
|
50490
50664
|
this.updateTabToolbarItemsPressedState();
|
@@ -50498,12 +50672,12 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
50498
50672
|
});
|
50499
50673
|
QuestionPanelDynamicModel.maxCheckCount = 3;
|
50500
50674
|
__decorate([
|
50501
|
-
Object(
|
50675
|
+
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_5__["property"])({ defaultValue: false, onSet: function (_, target) { target.updateFooterActions(); } })
|
50502
50676
|
], QuestionPanelDynamicModel.prototype, "legacyNavigation", void 0);
|
50503
50677
|
return QuestionPanelDynamicModel;
|
50504
|
-
}(
|
50678
|
+
}(_question__WEBPACK_IMPORTED_MODULE_4__["Question"]));
|
50505
50679
|
|
50506
|
-
|
50680
|
+
_jsonobject__WEBPACK_IMPORTED_MODULE_5__["Serializer"].addClass("paneldynamic", [
|
50507
50681
|
{ name: "showCommentArea:switch", layout: "row", visible: true, category: "general" },
|
50508
50682
|
{
|
50509
50683
|
name: "templateElements",
|
@@ -50513,6 +50687,7 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_4__["Serializer"].addClass("paneldynamic",
|
|
50513
50687
|
isLightSerializable: false
|
50514
50688
|
},
|
50515
50689
|
{ name: "templateTitle:text", serializationProperty: "locTemplateTitle" },
|
50690
|
+
{ name: "templateTabTitle", serializationProperty: "locTemplateTabTitle", visibleIf: function (obj) { return obj.renderMode === "tab"; } },
|
50516
50691
|
{
|
50517
50692
|
name: "templateDescription:text",
|
50518
50693
|
serializationProperty: "locTemplateDescription",
|
@@ -50530,7 +50705,7 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_4__["Serializer"].addClass("paneldynamic",
|
|
50530
50705
|
{ name: "minPanelCount:number", default: 0, minValue: 0 },
|
50531
50706
|
{
|
50532
50707
|
name: "maxPanelCount:number",
|
50533
|
-
default:
|
50708
|
+
default: _settings__WEBPACK_IMPORTED_MODULE_8__["settings"].panelMaximumPanelCount,
|
50534
50709
|
},
|
50535
50710
|
"defaultPanelValue:panelvalue",
|
50536
50711
|
"defaultValueFromLastPanel:boolean",
|
@@ -50566,6 +50741,7 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_4__["Serializer"].addClass("paneldynamic",
|
|
50566
50741
|
},
|
50567
50742
|
{
|
50568
50743
|
name: "tabAlign", default: "center", choices: ["center", "left", "right"],
|
50744
|
+
visibleIf: function (obj) { return obj.renderMode === "tab"; }
|
50569
50745
|
},
|
50570
50746
|
{
|
50571
50747
|
name: "templateTitleLocation",
|
@@ -50580,7 +50756,7 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_4__["Serializer"].addClass("paneldynamic",
|
|
50580
50756
|
], function () {
|
50581
50757
|
return new QuestionPanelDynamicModel("");
|
50582
50758
|
}, "question");
|
50583
|
-
|
50759
|
+
_questionfactory__WEBPACK_IMPORTED_MODULE_6__["QuestionFactory"].Instance.registerQuestion("paneldynamic", function (name) {
|
50584
50760
|
return new QuestionPanelDynamicModel(name);
|
50585
50761
|
});
|
50586
50762
|
|
@@ -50749,13 +50925,14 @@ _questionfactory__WEBPACK_IMPORTED_MODULE_1__["QuestionFactory"].Instance.regist
|
|
50749
50925
|
__webpack_require__.r(__webpack_exports__);
|
50750
50926
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "QuestionRankingModel", function() { return QuestionRankingModel; });
|
50751
50927
|
/* harmony import */ var _dragdrop_ranking_choices__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dragdrop/ranking-choices */ "./src/dragdrop/ranking-choices.ts");
|
50752
|
-
/* harmony import */ var
|
50753
|
-
/* harmony import */ var
|
50754
|
-
/* harmony import */ var
|
50755
|
-
/* harmony import */ var
|
50756
|
-
/* harmony import */ var
|
50757
|
-
/* harmony import */ var
|
50758
|
-
/* harmony import */ var
|
50928
|
+
/* harmony import */ var _itemvalue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./itemvalue */ "./src/itemvalue.ts");
|
50929
|
+
/* harmony import */ var _jsonobject__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./jsonobject */ "./src/jsonobject.ts");
|
50930
|
+
/* harmony import */ var _questionfactory__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./questionfactory */ "./src/questionfactory.ts");
|
50931
|
+
/* harmony import */ var _question_checkbox__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./question_checkbox */ "./src/question_checkbox.ts");
|
50932
|
+
/* harmony import */ var _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils/cssClassBuilder */ "./src/utils/cssClassBuilder.ts");
|
50933
|
+
/* harmony import */ var _utils_devices__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./utils/devices */ "./src/utils/devices.ts");
|
50934
|
+
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./helpers */ "./src/helpers.ts");
|
50935
|
+
/* harmony import */ var _src_settings__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../src/settings */ "./src/settings.ts");
|
50759
50936
|
var __extends = (undefined && undefined.__extends) || (function () {
|
50760
50937
|
var extendStatics = function (d, b) {
|
50761
50938
|
extendStatics = Object.setPrototypeOf ||
|
@@ -50785,6 +50962,7 @@ var __decorate = (undefined && undefined.__decorate) || function (decorators, ta
|
|
50785
50962
|
|
50786
50963
|
|
50787
50964
|
|
50965
|
+
|
50788
50966
|
/**
|
50789
50967
|
* A class that describes the Ranking question type.
|
50790
50968
|
*
|
@@ -50882,13 +51060,13 @@ var QuestionRankingModel = /** @class */ (function (_super) {
|
|
50882
51060
|
};
|
50883
51061
|
Object.defineProperty(QuestionRankingModel.prototype, "rootClass", {
|
50884
51062
|
get: function () {
|
50885
|
-
return new
|
51063
|
+
return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_5__["CssClassBuilder"]()
|
50886
51064
|
.append(this.cssClasses.root)
|
50887
|
-
.append(this.cssClasses.rootMobileMod,
|
51065
|
+
.append(this.cssClasses.rootMobileMod, _utils_devices__WEBPACK_IMPORTED_MODULE_6__["IsMobile"])
|
50888
51066
|
.append(this.cssClasses.rootDisabled, this.isReadOnly)
|
50889
51067
|
.append(this.cssClasses.rootDesignMode, !!this.isDesignMode)
|
50890
51068
|
.append(this.cssClasses.itemOnError, this.errors.length > 0)
|
50891
|
-
.append(this.cssClasses.rootDragHandleAreaIcon,
|
51069
|
+
.append(this.cssClasses.rootDragHandleAreaIcon, _src_settings__WEBPACK_IMPORTED_MODULE_8__["settings"].rankingDragHandleArea === "icon")
|
50892
51070
|
.toString();
|
50893
51071
|
},
|
50894
51072
|
enumerable: false,
|
@@ -50897,7 +51075,7 @@ var QuestionRankingModel = /** @class */ (function (_super) {
|
|
50897
51075
|
QuestionRankingModel.prototype.getItemClassCore = function (item, options) {
|
50898
51076
|
var itemIndex = this.rankingChoices.indexOf(item);
|
50899
51077
|
var dropTargetIndex = this.rankingChoices.indexOf(this.currentDropTarget);
|
50900
|
-
return new
|
51078
|
+
return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_5__["CssClassBuilder"]()
|
50901
51079
|
.append(_super.prototype.getItemClassCore.call(this, item, options))
|
50902
51080
|
.append(this.cssClasses.itemGhostMod, this.currentDropTarget === item)
|
50903
51081
|
.append("sv-dragdrop-movedown", itemIndex === dropTargetIndex + 1 && this.dropTargetNodeMove === "down")
|
@@ -50919,7 +51097,7 @@ var QuestionRankingModel = /** @class */ (function (_super) {
|
|
50919
51097
|
configurable: true
|
50920
51098
|
});
|
50921
51099
|
QuestionRankingModel.prototype.getItemIndexClasses = function () {
|
50922
|
-
return new
|
51100
|
+
return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_5__["CssClassBuilder"]()
|
50923
51101
|
.append(this.cssClasses.itemIndex)
|
50924
51102
|
.append(this.cssClasses.itemIndexEmptyMode, this.isEmpty())
|
50925
51103
|
.toString();
|
@@ -50932,7 +51110,7 @@ var QuestionRankingModel = /** @class */ (function (_super) {
|
|
50932
51110
|
this.updateRankingChoices();
|
50933
51111
|
};
|
50934
51112
|
QuestionRankingModel.prototype.isAnswerCorrect = function () {
|
50935
|
-
return
|
51113
|
+
return _helpers__WEBPACK_IMPORTED_MODULE_7__["Helpers"].isArraysEqual(this.value, this.correctAnswer, false);
|
50936
51114
|
};
|
50937
51115
|
QuestionRankingModel.prototype.onSurveyValueChanged = function (newValue) {
|
50938
51116
|
_super.prototype.onSurveyValueChanged.call(this, newValue);
|
@@ -50950,16 +51128,13 @@ var QuestionRankingModel = /** @class */ (function (_super) {
|
|
50950
51128
|
this.value = newValue;
|
50951
51129
|
};
|
50952
51130
|
QuestionRankingModel.prototype.removeFromValueByVisibleChoices = function () {
|
50953
|
-
var _this = this;
|
50954
51131
|
var newValue = this.value.slice();
|
50955
|
-
|
50956
|
-
|
50957
|
-
|
50958
|
-
|
50959
|
-
|
50960
|
-
|
50961
|
-
isValueItemToRemove && newValue.splice(index, 1);
|
50962
|
-
});
|
51132
|
+
var choices = this.visibleChoices;
|
51133
|
+
for (var i = this.value.length - 1; i >= 0; i--) {
|
51134
|
+
if (!_itemvalue__WEBPACK_IMPORTED_MODULE_1__["ItemValue"].getItemByValue(choices, this.value[i])) {
|
51135
|
+
newValue.splice(i, 1);
|
51136
|
+
}
|
51137
|
+
}
|
50963
51138
|
this.value = newValue;
|
50964
51139
|
};
|
50965
51140
|
Object.defineProperty(QuestionRankingModel.prototype, "rankingChoices", {
|
@@ -50997,7 +51172,7 @@ var QuestionRankingModel = /** @class */ (function (_super) {
|
|
50997
51172
|
this.dragDropRankingChoices = new _dragdrop_ranking_choices__WEBPACK_IMPORTED_MODULE_0__["DragDropRankingChoices"](this.survey, null, this.longTap);
|
50998
51173
|
};
|
50999
51174
|
QuestionRankingModel.prototype.isDragStartNodeValid = function (target) {
|
51000
|
-
if (
|
51175
|
+
if (_src_settings__WEBPACK_IMPORTED_MODULE_8__["settings"].rankingDragHandleArea === "icon") {
|
51001
51176
|
return target.classList.contains(this.cssClasses.itemIconHoverMod);
|
51002
51177
|
}
|
51003
51178
|
return true;
|
@@ -51028,13 +51203,13 @@ var QuestionRankingModel = /** @class */ (function (_super) {
|
|
51028
51203
|
return false;
|
51029
51204
|
};
|
51030
51205
|
QuestionRankingModel.prototype.getIconHoverCss = function () {
|
51031
|
-
return new
|
51206
|
+
return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_5__["CssClassBuilder"]()
|
51032
51207
|
.append(this.cssClasses.itemIcon)
|
51033
51208
|
.append(this.cssClasses.itemIconHoverMod)
|
51034
51209
|
.toString();
|
51035
51210
|
};
|
51036
51211
|
QuestionRankingModel.prototype.getIconFocusCss = function () {
|
51037
|
-
return new
|
51212
|
+
return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_5__["CssClassBuilder"]()
|
51038
51213
|
.append(this.cssClasses.itemIcon)
|
51039
51214
|
.append(this.cssClasses.itemIconFocusMod)
|
51040
51215
|
.toString();
|
@@ -51067,15 +51242,15 @@ var QuestionRankingModel = /** @class */ (function (_super) {
|
|
51067
51242
|
configurable: true
|
51068
51243
|
});
|
51069
51244
|
__decorate([
|
51070
|
-
Object(
|
51245
|
+
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])({ defaultValue: null })
|
51071
51246
|
], QuestionRankingModel.prototype, "currentDropTarget", void 0);
|
51072
51247
|
__decorate([
|
51073
|
-
Object(
|
51248
|
+
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])({ defaultValue: null })
|
51074
51249
|
], QuestionRankingModel.prototype, "dropTargetNodeMove", void 0);
|
51075
51250
|
return QuestionRankingModel;
|
51076
|
-
}(
|
51251
|
+
}(_question_checkbox__WEBPACK_IMPORTED_MODULE_4__["QuestionCheckboxModel"]));
|
51077
51252
|
|
51078
|
-
|
51253
|
+
_jsonobject__WEBPACK_IMPORTED_MODULE_2__["Serializer"].addClass("ranking", [
|
51079
51254
|
{ name: "showOtherItem", visible: false, isSerializable: false },
|
51080
51255
|
{ name: "otherText", visible: false, isSerializable: false },
|
51081
51256
|
{ name: "otherErrorText", visible: false, isSerializable: false },
|
@@ -51097,9 +51272,9 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_1__["Serializer"].addClass("ranking", [
|
|
51097
51272
|
], function () {
|
51098
51273
|
return new QuestionRankingModel("");
|
51099
51274
|
}, "checkbox");
|
51100
|
-
|
51275
|
+
_questionfactory__WEBPACK_IMPORTED_MODULE_3__["QuestionFactory"].Instance.registerQuestion("ranking", function (name) {
|
51101
51276
|
var q = new QuestionRankingModel(name);
|
51102
|
-
q.choices =
|
51277
|
+
q.choices = _questionfactory__WEBPACK_IMPORTED_MODULE_3__["QuestionFactory"].DefaultChoices;
|
51103
51278
|
return q;
|
51104
51279
|
});
|
51105
51280
|
|
@@ -51206,13 +51381,36 @@ var QuestionRatingModel = /** @class */ (function (_super) {
|
|
51206
51381
|
_this.createItemValues("rateValues");
|
51207
51382
|
_this.createRenderedRateItems();
|
51208
51383
|
_this.createLocalizableString("ratingOptionsCaption", _this, false, true);
|
51209
|
-
_this.registerFunctionOnPropertiesValueChanged(["
|
51384
|
+
_this.registerFunctionOnPropertiesValueChanged(["rateMin", "rateMax",
|
51210
51385
|
"minRateDescription", "maxRateDescription", "rateStep", "displayRateDescriptionsAsExtremeItems"], function () { return _this.createRenderedRateItems(); });
|
51386
|
+
_this.registerFunctionOnPropertiesValueChanged(["rateDisplayMode"], function () {
|
51387
|
+
_this.setIconsToRateValues();
|
51388
|
+
_this.createRenderedRateItems();
|
51389
|
+
_this.updateRateCount();
|
51390
|
+
});
|
51391
|
+
_this.registerFunctionOnPropertiesValueChanged(["rateValues"], function () {
|
51392
|
+
_this.autoGenerate = false;
|
51393
|
+
_this.setIconsToRateValues();
|
51394
|
+
_this.createRenderedRateItems();
|
51395
|
+
});
|
51396
|
+
_this.registerFunctionOnPropertiesValueChanged(["autoGenerate"], function () {
|
51397
|
+
if (!_this.autoGenerate && _this.rateValues.length === 0) {
|
51398
|
+
_this.setPropertyValue("rateValues", _this.visibleRateValues);
|
51399
|
+
}
|
51400
|
+
if (_this.autoGenerate)
|
51401
|
+
_this.updateRateMax();
|
51402
|
+
_this.createRenderedRateItems();
|
51403
|
+
});
|
51211
51404
|
_this.createLocalizableString("minRateDescription", _this, true);
|
51212
51405
|
_this.createLocalizableString("maxRateDescription", _this, true);
|
51213
51406
|
_this.initPropertyDependencies();
|
51214
51407
|
return _this;
|
51215
51408
|
}
|
51409
|
+
QuestionRatingModel.prototype.setIconsToRateValues = function () {
|
51410
|
+
var _this = this;
|
51411
|
+
if (this.rateType == "smileys")
|
51412
|
+
this.rateValues.map(function (item) { return item.icon = _this.getItemSmiley(item); });
|
51413
|
+
};
|
51216
51414
|
QuestionRatingModel.prototype.startLoadingFromJson = function (jsonObj) {
|
51217
51415
|
_super.prototype.startLoadingFromJson.call(this, jsonObj);
|
51218
51416
|
this.jsonObj = jsonObj;
|
@@ -51227,7 +51425,10 @@ var QuestionRatingModel = /** @class */ (function (_super) {
|
|
51227
51425
|
if (this.jsonObj.rateMax !== undefined && this.jsonObj.rateCount !== undefined && this.jsonObj.rateMin === undefined) {
|
51228
51426
|
this.updateRateMin();
|
51229
51427
|
}
|
51428
|
+
if (this.jsonObj.autoGenerate === undefined && this.jsonObj.rateValues !== undefined)
|
51429
|
+
this.autoGenerate = !this.jsonObj.rateValues.length;
|
51230
51430
|
this.updateRateCount();
|
51431
|
+
this.setIconsToRateValues();
|
51231
51432
|
this.createRenderedRateItems();
|
51232
51433
|
};
|
51233
51434
|
QuestionRatingModel.prototype.registerSychProperties = function (names, func) {
|
@@ -51240,6 +51441,9 @@ var QuestionRatingModel = /** @class */ (function (_super) {
|
|
51240
51441
|
}
|
51241
51442
|
});
|
51242
51443
|
};
|
51444
|
+
QuestionRatingModel.prototype.useRateValues = function () {
|
51445
|
+
return !!this.rateValues.length && !this.autoGenerate;
|
51446
|
+
};
|
51243
51447
|
QuestionRatingModel.prototype.updateRateMax = function () {
|
51244
51448
|
this.rateMax = this.rateMin + this.rateStep * (this.rateCount - 1);
|
51245
51449
|
};
|
@@ -51247,26 +51451,34 @@ var QuestionRatingModel = /** @class */ (function (_super) {
|
|
51247
51451
|
this.rateMin = this.rateMax - this.rateStep * (this.rateCount - 1);
|
51248
51452
|
};
|
51249
51453
|
QuestionRatingModel.prototype.updateRateCount = function () {
|
51250
|
-
|
51251
|
-
|
51454
|
+
var newCount = 0;
|
51455
|
+
if (this.useRateValues()) {
|
51456
|
+
newCount = this.rateValues.length;
|
51252
51457
|
}
|
51253
51458
|
else {
|
51254
|
-
|
51459
|
+
newCount = Math.trunc((this.rateMax - this.rateMin) / (this.rateStep || 1)) + 1;
|
51460
|
+
}
|
51461
|
+
if (newCount > 10 && this.rateDisplayMode == "smileys") {
|
51462
|
+
newCount = 10;
|
51255
51463
|
}
|
51464
|
+
this.rateCount = newCount;
|
51256
51465
|
};
|
51257
51466
|
QuestionRatingModel.prototype.initPropertyDependencies = function () {
|
51258
51467
|
var _this = this;
|
51259
51468
|
this.registerSychProperties(["rateCount"], function () {
|
51260
|
-
if (_this.
|
51469
|
+
if (!_this.useRateValues()) {
|
51261
51470
|
_this.rateMax = _this.rateMin + _this.rateStep * (_this.rateCount - 1);
|
51262
51471
|
}
|
51263
51472
|
else {
|
51264
51473
|
if (_this.rateCount < _this.rateValues.length) {
|
51474
|
+
if (_this.rateCount >= 10 && _this.rateDisplayMode == "smileys")
|
51475
|
+
return;
|
51265
51476
|
_this.rateValues.splice(_this.rateCount, _this.rateValues.length - _this.rateCount);
|
51266
51477
|
}
|
51267
51478
|
else {
|
51268
|
-
for (var i = _this.rateValues.length; i < _this.rateCount; i++)
|
51269
|
-
_this.rateValues.push(new _itemvalue__WEBPACK_IMPORTED_MODULE_0__["ItemValue"](
|
51479
|
+
for (var i = _this.rateValues.length; i < _this.rateCount; i++) {
|
51480
|
+
_this.rateValues.push(new _itemvalue__WEBPACK_IMPORTED_MODULE_0__["ItemValue"](_surveyStrings__WEBPACK_IMPORTED_MODULE_5__["surveyLocalization"].getString("choices_Item") + (i + 1)));
|
51481
|
+
}
|
51270
51482
|
}
|
51271
51483
|
}
|
51272
51484
|
});
|
@@ -51372,14 +51584,14 @@ var QuestionRatingModel = /** @class */ (function (_super) {
|
|
51372
51584
|
configurable: true
|
51373
51585
|
});
|
51374
51586
|
QuestionRatingModel.prototype.itemValuePropertyChanged = function (item, name, oldValue, newValue) {
|
51375
|
-
if (this.
|
51376
|
-
this.
|
51587
|
+
if (!this.useRateValues() && newValue !== undefined)
|
51588
|
+
this.autoGenerate = false;
|
51377
51589
|
_super.prototype.itemValuePropertyChanged.call(this, item, name, oldValue, newValue);
|
51378
51590
|
};
|
51379
51591
|
QuestionRatingModel.prototype.createRenderedRateItems = function () {
|
51380
51592
|
var _this = this;
|
51381
51593
|
var rateValues = [];
|
51382
|
-
if (this.
|
51594
|
+
if (this.useRateValues()) {
|
51383
51595
|
rateValues = this.rateValues;
|
51384
51596
|
}
|
51385
51597
|
else {
|
@@ -51497,6 +51709,16 @@ var QuestionRatingModel = /** @class */ (function (_super) {
|
|
51497
51709
|
enumerable: false,
|
51498
51710
|
configurable: true
|
51499
51711
|
});
|
51712
|
+
Object.defineProperty(QuestionRatingModel.prototype, "rateType", {
|
51713
|
+
get: function () {
|
51714
|
+
return this.rateDisplayMode;
|
51715
|
+
},
|
51716
|
+
set: function (val) {
|
51717
|
+
this.rateDisplayMode = val;
|
51718
|
+
},
|
51719
|
+
enumerable: false,
|
51720
|
+
configurable: true
|
51721
|
+
});
|
51500
51722
|
Object.defineProperty(QuestionRatingModel.prototype, "isStar", {
|
51501
51723
|
get: function () {
|
51502
51724
|
return this.rateType == "stars";
|
@@ -51523,7 +51745,7 @@ var QuestionRatingModel = /** @class */ (function (_super) {
|
|
51523
51745
|
configurable: true
|
51524
51746
|
});
|
51525
51747
|
QuestionRatingModel.prototype.valueToData = function (val) {
|
51526
|
-
if (this.
|
51748
|
+
if (this.useRateValues()) {
|
51527
51749
|
var item = _itemvalue__WEBPACK_IMPORTED_MODULE_0__["ItemValue"].getItemByValue(this.rateValues, val);
|
51528
51750
|
return !!item ? item.value : val;
|
51529
51751
|
}
|
@@ -51536,9 +51758,12 @@ var QuestionRatingModel = /** @class */ (function (_super) {
|
|
51536
51758
|
else {
|
51537
51759
|
this.value = value;
|
51538
51760
|
}
|
51761
|
+
for (var i = 0; i < this.renderedRateItems.length; i++) {
|
51762
|
+
this.renderedRateItems[i].highlight = "none";
|
51763
|
+
}
|
51539
51764
|
};
|
51540
51765
|
QuestionRatingModel.prototype.onItemMouseIn = function (item) {
|
51541
|
-
if (this.isReadOnly || !item.itemValue.isEnabled)
|
51766
|
+
if (this.isReadOnly || !item.itemValue.isEnabled || this.isDesignMode)
|
51542
51767
|
return;
|
51543
51768
|
var high = true;
|
51544
51769
|
var selected = this.value != null;
|
@@ -51564,10 +51789,10 @@ var QuestionRatingModel = /** @class */ (function (_super) {
|
|
51564
51789
|
QuestionRatingModel.prototype.getItemSmiley = function (item) {
|
51565
51790
|
var icons = ["terrible", "very-poor", "poor", "not-good", "average", "normal", "good", "very-good", "excellent", "perfect"];
|
51566
51791
|
var priority = ["very-good", "not-good", "normal", "good", "average", "excellent", "poor", "perfect", "very-poor", "terrible"];
|
51567
|
-
var count = this.rateValues.length
|
51792
|
+
var count = this.useRateValues() ? this.rateValues.length : this.rateMax - this.rateMin + 1;
|
51568
51793
|
var selectedPriority = priority.slice(0, count);
|
51569
51794
|
var selectedIcons = icons.filter(function (i) { return selectedPriority.indexOf(i) != -1; });
|
51570
|
-
if (this.
|
51795
|
+
if (!this.useRateValues()) {
|
51571
51796
|
return selectedIcons[item.value - this.rateMin];
|
51572
51797
|
}
|
51573
51798
|
else {
|
@@ -51577,12 +51802,15 @@ var QuestionRatingModel = /** @class */ (function (_super) {
|
|
51577
51802
|
QuestionRatingModel.prototype.getItemSmileyIconName = function (item) {
|
51578
51803
|
return "icon-" + this.getItemSmiley(item);
|
51579
51804
|
};
|
51805
|
+
QuestionRatingModel.prototype.getItemClassByText = function (item, text) {
|
51806
|
+
return this.getItemClass(item);
|
51807
|
+
};
|
51580
51808
|
QuestionRatingModel.prototype.getItemClass = function (item, highlight) {
|
51581
51809
|
var _this = this;
|
51582
51810
|
if (highlight === void 0) { highlight = "none"; }
|
51583
51811
|
var isSelected = this.value == item.value;
|
51584
51812
|
if (this.isStar) {
|
51585
|
-
if (this.
|
51813
|
+
if (!this.useRateValues()) {
|
51586
51814
|
isSelected = this.value >= item.value;
|
51587
51815
|
}
|
51588
51816
|
else {
|
@@ -51620,8 +51848,8 @@ var QuestionRatingModel = /** @class */ (function (_super) {
|
|
51620
51848
|
var hasFixedSize = !this.isStar &&
|
51621
51849
|
!this.isSmiley &&
|
51622
51850
|
(!this.displayRateDescriptionsAsExtremeItems ||
|
51623
|
-
this.
|
51624
|
-
this.
|
51851
|
+
this.useRateValues() && item != this.rateValues[0] && item != this.rateValues[this.rateValues.length - 1] ||
|
51852
|
+
!this.useRateValues() && item.value != this.rateMin && item.value != this.rateMax) &&
|
51625
51853
|
item.locText.calculatedText.length <= 2 &&
|
51626
51854
|
Number.isInteger(Number(item.locText.calculatedText));
|
51627
51855
|
return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_6__["CssClassBuilder"]()
|
@@ -51749,6 +51977,15 @@ var QuestionRatingModel = /** @class */ (function (_super) {
|
|
51749
51977
|
}
|
51750
51978
|
return classes;
|
51751
51979
|
};
|
51980
|
+
QuestionRatingModel.prototype.dispose = function () {
|
51981
|
+
_super.prototype.dispose.call(this);
|
51982
|
+
if (!!this.dropdownListModelValue) {
|
51983
|
+
this.dropdownListModelValue.dispose();
|
51984
|
+
}
|
51985
|
+
};
|
51986
|
+
__decorate([
|
51987
|
+
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])({ defaultValue: true })
|
51988
|
+
], QuestionRatingModel.prototype, "autoGenerate", void 0);
|
51752
51989
|
__decorate([
|
51753
51990
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])({ defaultValue: 5 })
|
51754
51991
|
], QuestionRatingModel.prototype, "rateCount", void 0);
|
@@ -51780,8 +52017,8 @@ var QuestionRatingModel = /** @class */ (function (_super) {
|
|
51780
52017
|
})
|
51781
52018
|
], QuestionRatingModel.prototype, "displayMode", void 0);
|
51782
52019
|
__decorate([
|
51783
|
-
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])({ defaultValue: "
|
51784
|
-
], QuestionRatingModel.prototype, "
|
52020
|
+
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])({ defaultValue: "labels" })
|
52021
|
+
], QuestionRatingModel.prototype, "rateDisplayMode", void 0);
|
51785
52022
|
__decorate([
|
51786
52023
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])({ defaultValue: "monochrome" })
|
51787
52024
|
], QuestionRatingModel.prototype, "smileysColorMode", void 0);
|
@@ -51790,27 +52027,66 @@ var QuestionRatingModel = /** @class */ (function (_super) {
|
|
51790
52027
|
|
51791
52028
|
_jsonobject__WEBPACK_IMPORTED_MODULE_2__["Serializer"].addClass("rating", [
|
51792
52029
|
{ name: "showCommentArea:switch", layout: "row", visible: true, category: "general" },
|
52030
|
+
{
|
52031
|
+
name: "rateDisplayMode",
|
52032
|
+
alternativeName: "rateType",
|
52033
|
+
default: "labels",
|
52034
|
+
category: "rateValues",
|
52035
|
+
choices: ["labels", "stars", "smileys"],
|
52036
|
+
visibleIndex: 0
|
52037
|
+
},
|
52038
|
+
{
|
52039
|
+
name: "autoGenerate",
|
52040
|
+
category: "rateValues",
|
52041
|
+
default: true,
|
52042
|
+
choices: [{ value: true, text: "Generate" }, { value: false, text: "Enter manually" }],
|
52043
|
+
visibleIndex: 2
|
52044
|
+
},
|
51793
52045
|
{
|
51794
52046
|
name: "rateCount:number",
|
51795
|
-
default: 5
|
52047
|
+
default: 5,
|
52048
|
+
category: "rateValues",
|
52049
|
+
visibleIndex: 1,
|
52050
|
+
onSettingValue: function (obj, val) {
|
52051
|
+
if (val < 2)
|
52052
|
+
return 2;
|
52053
|
+
if (val > _settings__WEBPACK_IMPORTED_MODULE_4__["settings"].ratingMaximumRateValueCount && val > obj.rateValues.length)
|
52054
|
+
return _settings__WEBPACK_IMPORTED_MODULE_4__["settings"].ratingMaximumRateValueCount;
|
52055
|
+
if (val > 10 && obj.rateDisplayMode == "smileys")
|
52056
|
+
return 10;
|
52057
|
+
return val;
|
52058
|
+
},
|
51796
52059
|
},
|
51797
52060
|
{
|
51798
52061
|
name: "rateValues:itemvalue[]",
|
51799
52062
|
baseValue: function () {
|
51800
52063
|
return _surveyStrings__WEBPACK_IMPORTED_MODULE_5__["surveyLocalization"].getString("choices_Item");
|
51801
52064
|
},
|
52065
|
+
category: "rateValues",
|
52066
|
+
visibleIf: function (obj) {
|
52067
|
+
return !obj.autoGenerate;
|
52068
|
+
},
|
52069
|
+
visibleIndex: 3
|
51802
52070
|
},
|
51803
52071
|
{
|
51804
52072
|
name: "rateMin:number", default: 1,
|
51805
52073
|
onSettingValue: function (obj, val) {
|
51806
52074
|
return val > obj.rateMax - obj.rateStep ? obj.rateMax - obj.rateStep : val;
|
51807
|
-
}
|
52075
|
+
},
|
52076
|
+
visibleIf: function (obj) {
|
52077
|
+
return !!obj.autoGenerate;
|
52078
|
+
},
|
52079
|
+
visibleIndex: 4
|
51808
52080
|
},
|
51809
52081
|
{
|
51810
52082
|
name: "rateMax:number", default: 5,
|
51811
52083
|
onSettingValue: function (obj, val) {
|
51812
52084
|
return val < obj.rateMin + obj.rateStep ? obj.rateMin + obj.rateStep : val;
|
51813
|
-
}
|
52085
|
+
},
|
52086
|
+
visibleIf: function (obj) {
|
52087
|
+
return !!obj.autoGenerate;
|
52088
|
+
},
|
52089
|
+
visibleIndex: 5
|
51814
52090
|
},
|
51815
52091
|
{
|
51816
52092
|
name: "rateStep:number", default: 1, minValue: 0.1,
|
@@ -51820,30 +52096,31 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_2__["Serializer"].addClass("rating", [
|
|
51820
52096
|
if (val > obj.rateMax - obj.rateMin)
|
51821
52097
|
val = obj.rateMax - obj.rateMin;
|
51822
52098
|
return val;
|
51823
|
-
}
|
52099
|
+
},
|
52100
|
+
visibleIf: function (obj) {
|
52101
|
+
return !!obj.autoGenerate;
|
52102
|
+
},
|
52103
|
+
visibleIndex: 6
|
51824
52104
|
},
|
51825
52105
|
{
|
51826
52106
|
name: "minRateDescription",
|
51827
52107
|
alternativeName: "mininumRateDescription",
|
51828
52108
|
serializationProperty: "locMinRateDescription",
|
52109
|
+
visibleIndex: 17
|
51829
52110
|
},
|
51830
52111
|
{
|
51831
52112
|
name: "maxRateDescription",
|
51832
52113
|
alternativeName: "maximumRateDescription",
|
51833
52114
|
serializationProperty: "locMaxRateDescription",
|
52115
|
+
visibleIndex: 18
|
51834
52116
|
},
|
51835
|
-
{ name: "displayRateDescriptionsAsExtremeItems:boolean", default: false },
|
52117
|
+
{ name: "displayRateDescriptionsAsExtremeItems:boolean", default: false, visibleIndex: 19 },
|
51836
52118
|
{
|
51837
52119
|
name: "displayMode",
|
51838
52120
|
default: "auto",
|
51839
52121
|
choices: ["auto", "buttons", "dropdown"],
|
52122
|
+
visibleIndex: 20
|
51840
52123
|
},
|
51841
|
-
{
|
51842
|
-
name: "rateType",
|
51843
|
-
visible: false,
|
51844
|
-
default: "number",
|
51845
|
-
choices: ["numbers", "labels", "stars", "smileys"],
|
51846
|
-
}
|
51847
52124
|
], function () {
|
51848
52125
|
return new QuestionRatingModel("");
|
51849
52126
|
}, "question");
|
@@ -52382,6 +52659,12 @@ var QuestionTagboxModel = /** @class */ (function (_super) {
|
|
52382
52659
|
QuestionTagboxModel.prototype.getInputId = function () {
|
52383
52660
|
return this.inputId + "_0";
|
52384
52661
|
};
|
52662
|
+
QuestionTagboxModel.prototype.dispose = function () {
|
52663
|
+
_super.prototype.dispose.call(this);
|
52664
|
+
if (!!this.dropdownListModelValue) {
|
52665
|
+
this.dropdownListModelValue.dispose();
|
52666
|
+
}
|
52667
|
+
};
|
52385
52668
|
__decorate([
|
52386
52669
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])()
|
52387
52670
|
], QuestionTagboxModel.prototype, "allowClear", void 0);
|
@@ -52572,7 +52855,7 @@ var QuestionTextModel = /** @class */ (function (_super) {
|
|
52572
52855
|
},
|
52573
52856
|
set: function (val) {
|
52574
52857
|
val = val.toLowerCase();
|
52575
|
-
if (val
|
52858
|
+
if (val === "datetime_local" || val === "datetime")
|
52576
52859
|
val = "datetime-local";
|
52577
52860
|
this.setPropertyValue("inputType", val.toLowerCase());
|
52578
52861
|
if (!this.isLoadingFromJson) {
|
@@ -52832,8 +53115,7 @@ var QuestionTextModel = /** @class */ (function (_super) {
|
|
52832
53115
|
return isValid;
|
52833
53116
|
};
|
52834
53117
|
QuestionTextModel.prototype.convertFuncValuetoQuestionValue = function (val) {
|
52835
|
-
|
52836
|
-
return _helpers__WEBPACK_IMPORTED_MODULE_3__["Helpers"].convertValToQuestionVal(val, inpuType);
|
53118
|
+
return _helpers__WEBPACK_IMPORTED_MODULE_3__["Helpers"].convertValToQuestionVal(val, this.inputType);
|
52837
53119
|
};
|
52838
53120
|
QuestionTextModel.prototype.getMinMaxErrorText = function (errorText, value) {
|
52839
53121
|
if (_helpers__WEBPACK_IMPORTED_MODULE_3__["Helpers"].isValueEmpty(value))
|
@@ -52917,10 +53199,10 @@ var QuestionTextModel = /** @class */ (function (_super) {
|
|
52917
53199
|
configurable: true
|
52918
53200
|
});
|
52919
53201
|
QuestionTextModel.prototype.supportGoNextPageAutomatic = function () {
|
52920
|
-
return ["date", "datetime
|
53202
|
+
return ["date", "datetime-local"].indexOf(this.inputType) < 0;
|
52921
53203
|
};
|
52922
53204
|
QuestionTextModel.prototype.supportGoNextPageError = function () {
|
52923
|
-
return ["date", "datetime
|
53205
|
+
return ["date", "datetime-local"].indexOf(this.inputType) < 0;
|
52924
53206
|
};
|
52925
53207
|
Object.defineProperty(QuestionTextModel.prototype, "dataList", {
|
52926
53208
|
/**
|
@@ -52994,7 +53276,6 @@ var minMaxTypes = [
|
|
52994
53276
|
"number",
|
52995
53277
|
"range",
|
52996
53278
|
"date",
|
52997
|
-
"datetime",
|
52998
53279
|
"datetime-local",
|
52999
53280
|
"month",
|
53000
53281
|
"time",
|
@@ -55755,7 +56036,7 @@ var RatingItem = /** @class */ (function (_super) {
|
|
55755
56036
|
};
|
55756
56037
|
RatingItem.prototype.render = function () {
|
55757
56038
|
var itemText = this.renderLocString(this.item.locText);
|
55758
|
-
return (react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", { className: this.question.
|
56039
|
+
return (react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", { className: this.question.getItemClassByText(this.item.itemValue, this.item.text) },
|
55759
56040
|
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", { type: "radio", className: "sv-visuallyhidden", name: this.question.name, id: this.question.getInputId(this.index), value: this.item.value, disabled: this.isDisplayMode, checked: this.question.value == this.item.value, onClick: this.props.handleOnClick, onChange: function () { }, "aria-required": this.question.ariaRequired, "aria-label": this.question.ariaLabel, "aria-invalid": this.question.ariaInvalid, "aria-describedby": this.question.ariaDescribedBy }),
|
55760
56041
|
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", { className: this.question.cssClasses.itemText }, itemText)));
|
55761
56042
|
};
|
@@ -63254,11 +63535,11 @@ var settings = {
|
|
63254
63535
|
imagepicker: ["answercount"],
|
63255
63536
|
},
|
63256
63537
|
/**
|
63257
|
-
* Specifies a minimum date that users can enter into a [Text](https://surveyjs.io/form-library/documentation/api-reference/text-entry-question-model) question with [`inputType`](https://surveyjs.io/form-library/documentation/api-reference/text-entry-question-model#inputType) set to `"date"
|
63538
|
+
* Specifies a minimum date that users can enter into a [Text](https://surveyjs.io/form-library/documentation/api-reference/text-entry-question-model) question with [`inputType`](https://surveyjs.io/form-library/documentation/api-reference/text-entry-question-model#inputType) set to `"date"` or `"datetime-local"`. Set this property to a string with the folllowing format: `"yyyy-mm-dd"`.
|
63258
63539
|
*/
|
63259
63540
|
minDate: "",
|
63260
63541
|
/**
|
63261
|
-
* Specifies a maximum date that users can enter into a [Text](https://surveyjs.io/form-library/documentation/api-reference/text-entry-question-model) question with [`inputType`](https://surveyjs.io/form-library/documentation/api-reference/text-entry-question-model#inputType) set to `"date"
|
63542
|
+
* Specifies a maximum date that users can enter into a [Text](https://surveyjs.io/form-library/documentation/api-reference/text-entry-question-model) question with [`inputType`](https://surveyjs.io/form-library/documentation/api-reference/text-entry-question-model#inputType) set to `"date"` or `"datetime-local"`. Set this property to a string with the folllowing format: `"yyyy-mm-dd"`.
|
63262
63543
|
*/
|
63263
63544
|
maxDate: "",
|
63264
63545
|
showModal: undefined,
|
@@ -63295,7 +63576,6 @@ var settings = {
|
|
63295
63576
|
inputTypes: [
|
63296
63577
|
"color",
|
63297
63578
|
"date",
|
63298
|
-
"datetime",
|
63299
63579
|
"datetime-local",
|
63300
63580
|
"email",
|
63301
63581
|
"month",
|
@@ -67174,7 +67454,8 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
67174
67454
|
});
|
67175
67455
|
Object.defineProperty(SurveyModel.prototype, "backgroundImage", {
|
67176
67456
|
/**
|
67177
|
-
*
|
67457
|
+
* An image to display in the background of the survey or form. Accepts a base64 or URL string value.
|
67458
|
+
* @see backgroundOpacity
|
67178
67459
|
*/
|
67179
67460
|
get: function () {
|
67180
67461
|
return this.getLocalizableStringText("backgroundImage");
|
@@ -67196,6 +67477,10 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
67196
67477
|
this.renderBackgroundImage = ["url(", this.getLocalizableString("backgroundImage").renderedHtml, ")"].join("");
|
67197
67478
|
};
|
67198
67479
|
Object.defineProperty(SurveyModel.prototype, "backgroundOpacity", {
|
67480
|
+
/**
|
67481
|
+
* A value from 0 to 1 that specifies how transparent the survey background should be: 0 makes the background completely transparent, and 1 makes it opaque.
|
67482
|
+
* @see backgroundImage
|
67483
|
+
*/
|
67199
67484
|
get: function () {
|
67200
67485
|
return this.getPropertyValue("backgroundOpacity");
|
67201
67486
|
},
|
@@ -68727,7 +69012,7 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
68727
69012
|
if (!page)
|
68728
69013
|
return "none";
|
68729
69014
|
if (page.navigationButtonsVisibility === "show") {
|
68730
|
-
return "bottom";
|
69015
|
+
return this.showNavigationButtons === "none" ? "bottom" : this.showNavigationButtons;
|
68731
69016
|
}
|
68732
69017
|
if (page.navigationButtonsVisibility === "hide") {
|
68733
69018
|
return "none";
|
@@ -72453,12 +72738,12 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
72453
72738
|
}
|
72454
72739
|
else if (isStrCiEqual(layoutElement.id, "navigationbuttons")) {
|
72455
72740
|
if (container === "contentTop") {
|
72456
|
-
if (["top", "both"].indexOf(this.
|
72741
|
+
if (["top", "both"].indexOf(this.isNavigationButtonsShowing) !== -1) {
|
72457
72742
|
containerLayoutElements.push(layoutElement);
|
72458
72743
|
}
|
72459
72744
|
}
|
72460
72745
|
if (container === "contentBottom") {
|
72461
|
-
if (["bottom", "both"].indexOf(this.
|
72746
|
+
if (["bottom", "both"].indexOf(this.isNavigationButtonsShowing) !== -1) {
|
72462
72747
|
containerLayoutElements.push(layoutElement);
|
72463
72748
|
}
|
72464
72749
|
}
|