survey-react 1.9.83 → 1.9.85
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 +330 -203
- package/defaultV2.css.map +1 -1
- package/defaultV2.min.css +2 -2
- package/modern.css +33 -19
- package/modern.css.map +1 -1
- package/modern.min.css +2 -2
- package/package.json +1 -1
- package/survey.css +5 -1
- package/survey.css.map +1 -1
- package/survey.min.css +2 -2
- package/survey.react.d.ts +6774 -6690
- package/survey.react.js +696 -189
- 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.85
|
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
|
*/
|
@@ -1278,9 +1278,11 @@ function createDropdownActionModelAdvanced(actionOptions, listOptions, popupOpti
|
|
1278
1278
|
var newActionOptions = Object.assign({}, actionOptions, {
|
1279
1279
|
component: "sv-action-bar-item-dropdown",
|
1280
1280
|
popupModel: innerPopupModel,
|
1281
|
-
action: function () {
|
1281
|
+
action: function (action, isUserAction) {
|
1282
1282
|
!!(actionOptions.action) && actionOptions.action();
|
1283
|
+
innerPopupModel.isFocusedContent = !isUserAction || listModel.showFilter;
|
1283
1284
|
innerPopupModel.toggleVisibility();
|
1285
|
+
listModel.scrollToSelectedItem();
|
1284
1286
|
},
|
1285
1287
|
});
|
1286
1288
|
var newAction = new Action(newActionOptions);
|
@@ -1356,7 +1358,7 @@ var BaseAction = /** @class */ (function (_super) {
|
|
1356
1358
|
});
|
1357
1359
|
Object.defineProperty(BaseAction.prototype, "isVisible", {
|
1358
1360
|
get: function () {
|
1359
|
-
return this.visible && this.mode !== "popup";
|
1361
|
+
return this.visible && this.mode !== "popup" && this.mode !== "removed";
|
1360
1362
|
},
|
1361
1363
|
enumerable: false,
|
1362
1364
|
configurable: true
|
@@ -1411,6 +1413,12 @@ var BaseAction = /** @class */ (function (_super) {
|
|
1411
1413
|
BaseAction.prototype.getTooltip = function () {
|
1412
1414
|
return this.tooltip || this.title;
|
1413
1415
|
};
|
1416
|
+
BaseAction.prototype.getIsTrusted = function (args) {
|
1417
|
+
if (!!args.originalEvent) {
|
1418
|
+
return args.originalEvent.isTrusted;
|
1419
|
+
}
|
1420
|
+
return args.isTrusted;
|
1421
|
+
};
|
1414
1422
|
__decorate([
|
1415
1423
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])()
|
1416
1424
|
], BaseAction.prototype, "tooltip", void 0);
|
@@ -1748,6 +1756,16 @@ var AdaptiveActionContainer = /** @class */ (function (_super) {
|
|
1748
1756
|
items[index].mode = "large";
|
1749
1757
|
}
|
1750
1758
|
}
|
1759
|
+
if (itemsSize > availableSize) {
|
1760
|
+
var hidableItems = this.visibleActions.filter(function (a) { return a.removePriority; });
|
1761
|
+
hidableItems.sort(function (a, b) { return a.removePriority - b.removePriority; });
|
1762
|
+
for (var index = 0; index < hidableItems.length; index++) {
|
1763
|
+
if (itemsSize > availableSize) {
|
1764
|
+
itemsSize -= items[index].disableShrink ? hidableItems[index].maxDimension : hidableItems[index].minDimension;
|
1765
|
+
hidableItems[index].mode = "removed";
|
1766
|
+
}
|
1767
|
+
}
|
1768
|
+
}
|
1751
1769
|
};
|
1752
1770
|
Object.defineProperty(AdaptiveActionContainer.prototype, "hiddenItemsListModel", {
|
1753
1771
|
get: function () {
|
@@ -1908,7 +1926,11 @@ var ActionContainer = /** @class */ (function (_super) {
|
|
1908
1926
|
};
|
1909
1927
|
ActionContainer.prototype.locStrsChanged = function () {
|
1910
1928
|
_super.prototype.locStrsChanged.call(this);
|
1911
|
-
this.actions.forEach(function (item) {
|
1929
|
+
this.actions.forEach(function (item) {
|
1930
|
+
if (item.locTitle)
|
1931
|
+
item.locTitle.strChanged();
|
1932
|
+
item.locStrsChanged();
|
1933
|
+
});
|
1912
1934
|
};
|
1913
1935
|
ActionContainer.prototype.raiseUpdate = function (isResetInitialized) {
|
1914
1936
|
this.isEmpty = !this.actions.some(function (action) { return action.visible; });
|
@@ -2016,6 +2038,11 @@ var ActionContainer = /** @class */ (function (_super) {
|
|
2016
2038
|
}
|
2017
2039
|
return null;
|
2018
2040
|
};
|
2041
|
+
ActionContainer.prototype.dispose = function () {
|
2042
|
+
_super.prototype.dispose.call(this);
|
2043
|
+
this.actions.forEach(function (action) { return action.dispose(); });
|
2044
|
+
this.actions.length = 0;
|
2045
|
+
};
|
2019
2046
|
__decorate([
|
2020
2047
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["propertyArray"])({
|
2021
2048
|
onSet: function (_, target) {
|
@@ -4921,6 +4948,7 @@ var modernCss = {
|
|
4921
4948
|
slider: "sv-boolean__slider",
|
4922
4949
|
label: "sv-boolean__label",
|
4923
4950
|
disabledLabel: "sv-boolean__label--disabled",
|
4951
|
+
sliderGhost: "sv-boolean__thumb-ghost",
|
4924
4952
|
//checkbox
|
4925
4953
|
rootCheckbox: "sv_qbln",
|
4926
4954
|
checkboxItem: "sv-boolean sv-item",
|
@@ -5261,6 +5289,7 @@ var defaultStandardCss = {
|
|
5261
5289
|
slider: "sv-boolean__slider",
|
5262
5290
|
label: "sv-boolean__label ",
|
5263
5291
|
disabledLabel: "sv-boolean__label--disabled",
|
5292
|
+
sliderGhost: "sv-boolean__thumb-ghost",
|
5264
5293
|
//checkbox
|
5265
5294
|
rootCheckbox: "sv_qcbc sv_qbln",
|
5266
5295
|
checkboxItem: "sv-boolean",
|
@@ -5632,6 +5661,7 @@ var defaultV2Css = {
|
|
5632
5661
|
nested: "sd-element--nested",
|
5633
5662
|
invisible: "sd-element--invisible",
|
5634
5663
|
navigationButton: "",
|
5664
|
+
compact: "sd-element--with-frame sd-element--compact"
|
5635
5665
|
},
|
5636
5666
|
paneldynamic: {
|
5637
5667
|
mainRoot: "sd-element sd-question sd-question--paneldynamic sd-element--complex sd-question--complex sd-row__question",
|
@@ -5659,7 +5689,8 @@ var defaultV2Css = {
|
|
5659
5689
|
footerButtonsContainer: "sd-paneldynamic__buttons-container",
|
5660
5690
|
panelWrapperInRow: "sd-paneldynamic__panel-wrapper--in-row",
|
5661
5691
|
progressBtnIcon: "icon-progressbuttonv2",
|
5662
|
-
noEntriesPlaceholder: "sd-paneldynamic__placeholder sd-question__placeholder"
|
5692
|
+
noEntriesPlaceholder: "sd-paneldynamic__placeholder sd-question__placeholder",
|
5693
|
+
compact: "sd-element--with-frame sd-element--compact"
|
5663
5694
|
},
|
5664
5695
|
progress: "sd-progress sd-body__progress",
|
5665
5696
|
progressTop: "sd-body__progress--top",
|
@@ -5689,6 +5720,7 @@ var defaultV2Css = {
|
|
5689
5720
|
pageDescription: "sd-description sd-page__description",
|
5690
5721
|
row: "sd-row sd-clearfix",
|
5691
5722
|
rowMultiple: "sd-row--multiple",
|
5723
|
+
rowCompact: "sd-row--compact",
|
5692
5724
|
pageRow: "sd-page__row",
|
5693
5725
|
question: {
|
5694
5726
|
mainRoot: "sd-element sd-question sd-row__question",
|
@@ -5809,11 +5841,13 @@ var defaultV2Css = {
|
|
5809
5841
|
itemChecked: "sd-boolean--checked",
|
5810
5842
|
itemIndeterminate: "sd-boolean--indeterminate",
|
5811
5843
|
itemDisabled: "sd-boolean--disabled",
|
5844
|
+
itemHover: "sd-boolean--allowhover",
|
5812
5845
|
label: "sd-boolean__label",
|
5813
5846
|
switch: "sd-boolean__switch",
|
5814
5847
|
disabledLabel: "sd-checkbox__label--disabled",
|
5815
5848
|
sliderText: "sd-boolean__thumb-text",
|
5816
5849
|
slider: "sd-boolean__thumb",
|
5850
|
+
sliderGhost: "sd-boolean__thumb-ghost",
|
5817
5851
|
//radio
|
5818
5852
|
radioItem: "sd-item",
|
5819
5853
|
radioItemChecked: "sd-item--checked sd-radio--checked",
|
@@ -5932,7 +5966,8 @@ var defaultV2Css = {
|
|
5932
5966
|
cellText: "sd-matrix__text",
|
5933
5967
|
cellTextSelected: "sd-matrix__text--checked",
|
5934
5968
|
cellTextDisabled: "sd-matrix__text--disabled",
|
5935
|
-
cellResponsiveTitle: "sd-matrix__responsive-title"
|
5969
|
+
cellResponsiveTitle: "sd-matrix__responsive-title",
|
5970
|
+
compact: "sd-element--with-frame sd-element--compact"
|
5936
5971
|
},
|
5937
5972
|
matrixdropdown: {
|
5938
5973
|
mainRoot: "sd-element sd-question sd-row__question sd-element--complex sd-question--complex sd-question--table",
|
@@ -5957,7 +5992,8 @@ var defaultV2Css = {
|
|
5957
5992
|
actionsCell: "sd-table__cell sd-table__cell--actions",
|
5958
5993
|
emptyCell: "sd-table__cell--empty",
|
5959
5994
|
verticalCell: "sd-table__cell--vertical",
|
5960
|
-
cellQuestionWrapper: "sd-table__question-wrapper"
|
5995
|
+
cellQuestionWrapper: "sd-table__question-wrapper",
|
5996
|
+
compact: "sd-element--with-frame sd-element--compact"
|
5961
5997
|
},
|
5962
5998
|
matrixdynamic: {
|
5963
5999
|
mainRoot: "sd-element sd-question sd-row__question sd-element--complex sd-question--complex sd-question--table",
|
@@ -5994,7 +6030,8 @@ var defaultV2Css = {
|
|
5994
6030
|
ghostRow: "sv-matrix-row--drag-drop-ghost-mod",
|
5995
6031
|
emptyCell: "sd-table__cell--empty",
|
5996
6032
|
verticalCell: "sd-table__cell--vertical",
|
5997
|
-
cellQuestionWrapper: "sd-table__question-wrapper"
|
6033
|
+
cellQuestionWrapper: "sd-table__question-wrapper",
|
6034
|
+
compact: "sd-element--with-frame sd-element--compact"
|
5998
6035
|
},
|
5999
6036
|
rating: {
|
6000
6037
|
rootDropdown: "sd-scrollable-container sd-scrollable-container--compact sd-selectbase",
|
@@ -6016,6 +6053,9 @@ var defaultV2Css = {
|
|
6016
6053
|
itemSmileyHover: "sd-rating__item-smiley--allowhover",
|
6017
6054
|
itemSmileySelected: "sd-rating__item-smiley--selected",
|
6018
6055
|
itemSmileyDisabled: "sd-rating__item-smiley--disabled",
|
6056
|
+
itemSmileyHighlighted: "sd-rating__item-star--highlighted",
|
6057
|
+
itemSmileyScaleColored: "sd-rating__item-smiley--scale-colored",
|
6058
|
+
itemSmileyRateColored: "sd-rating__item-smiley--rate-colored",
|
6019
6059
|
minText: "sd-rating__item-text sd-rating__min-text",
|
6020
6060
|
itemText: "sd-rating__item-text",
|
6021
6061
|
maxText: "sd-rating__item-text sd-rating__max-text",
|
@@ -6142,7 +6182,8 @@ var defaultV2Css = {
|
|
6142
6182
|
root: "sv-list__container sd-list",
|
6143
6183
|
item: "sv-list__item sd-list__item",
|
6144
6184
|
itemBody: "sv-list__item-body sd-list__item-body",
|
6145
|
-
itemSelected: "sv-list__item--selected sd-list__item--selected"
|
6185
|
+
itemSelected: "sv-list__item--selected sd-list__item--selected",
|
6186
|
+
itemFocused: "sv-list__item--focused sd-list__item--focused",
|
6146
6187
|
},
|
6147
6188
|
actionBar: {
|
6148
6189
|
root: "sd-action-bar",
|
@@ -7415,7 +7456,7 @@ var DragDropMatrixRows = /** @class */ (function (_super) {
|
|
7415
7456
|
_super.prototype.ghostPositionChanged.call(this);
|
7416
7457
|
};
|
7417
7458
|
DragDropMatrixRows.prototype.doClear = function () {
|
7418
|
-
this.parentElement
|
7459
|
+
this.parentElement.clearOnDrop();
|
7419
7460
|
this.fromIndex = null;
|
7420
7461
|
this.toIndex = null;
|
7421
7462
|
};
|
@@ -8241,6 +8282,11 @@ var DropdownListModel = /** @class */ (function (_super) {
|
|
8241
8282
|
this.filterString = undefined;
|
8242
8283
|
}
|
8243
8284
|
};
|
8285
|
+
DropdownListModel.prototype.clear = function () {
|
8286
|
+
this.inputString = null;
|
8287
|
+
this.hintString = "";
|
8288
|
+
this.resetFilterString();
|
8289
|
+
};
|
8244
8290
|
DropdownListModel.prototype.onSetFilterString = function () {
|
8245
8291
|
var _this = this;
|
8246
8292
|
if (!!this.filterString && !this.popupModel.isVisible) {
|
@@ -8401,9 +8447,6 @@ var DropdownListModel = /** @class */ (function (_super) {
|
|
8401
8447
|
};
|
8402
8448
|
DropdownListModel.prototype.onClear = function (event) {
|
8403
8449
|
this.question.clearValue();
|
8404
|
-
this.inputString = null;
|
8405
|
-
this.hintString = "";
|
8406
|
-
this.resetFilterString();
|
8407
8450
|
if (event) {
|
8408
8451
|
event.preventDefault();
|
8409
8452
|
event.stopPropagation();
|
@@ -8524,6 +8567,15 @@ var DropdownListModel = /** @class */ (function (_super) {
|
|
8524
8567
|
this.inputString = null;
|
8525
8568
|
}
|
8526
8569
|
};
|
8570
|
+
DropdownListModel.prototype.dispose = function () {
|
8571
|
+
_super.prototype.dispose.call(this);
|
8572
|
+
if (!!this.listModel) {
|
8573
|
+
this.listModel.dispose();
|
8574
|
+
}
|
8575
|
+
if (!!this.popupModel) {
|
8576
|
+
this.popupModel.dispose();
|
8577
|
+
}
|
8578
|
+
};
|
8527
8579
|
DropdownListModel.prototype.scrollToFocusedItem = function () {
|
8528
8580
|
this.listModel.scrollToFocusedItem();
|
8529
8581
|
};
|
@@ -8741,6 +8793,10 @@ var DropdownMultiSelectListModel = /** @class */ (function (_super) {
|
|
8741
8793
|
this.question.renderedValue = newValue;
|
8742
8794
|
this.updateListState();
|
8743
8795
|
};
|
8796
|
+
DropdownMultiSelectListModel.prototype.clear = function () {
|
8797
|
+
_super.prototype.clear.call(this);
|
8798
|
+
this.syncFilterStringPlaceholder();
|
8799
|
+
};
|
8744
8800
|
DropdownMultiSelectListModel.prototype.onClear = function (event) {
|
8745
8801
|
_super.prototype.onClear.call(this, event);
|
8746
8802
|
this.updateListState();
|
@@ -9532,7 +9588,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
9532
9588
|
// import "../../main.scss";
|
9533
9589
|
//import "../../modern.scss";
|
9534
9590
|
var Version;
|
9535
|
-
Version = "" + "1.9.
|
9591
|
+
Version = "" + "1.9.85";
|
9536
9592
|
function checkLibraryVersion(ver, libraryName) {
|
9537
9593
|
if (Version != ver) {
|
9538
9594
|
var str = "survey-core has version '" + Version + "' and " + libraryName
|
@@ -16256,6 +16312,37 @@ var Helpers = /** @class */ (function () {
|
|
16256
16312
|
}
|
16257
16313
|
return true;
|
16258
16314
|
};
|
16315
|
+
Helpers.compareStrings = function (x, y) {
|
16316
|
+
if (!!x)
|
16317
|
+
x = x.trim();
|
16318
|
+
if (!!y)
|
16319
|
+
y = y.trim();
|
16320
|
+
if (!x && !y)
|
16321
|
+
return 0;
|
16322
|
+
if (!x)
|
16323
|
+
return -1;
|
16324
|
+
if (!y)
|
16325
|
+
return 1;
|
16326
|
+
if (x === y)
|
16327
|
+
return 0;
|
16328
|
+
var digitIndex = -1;
|
16329
|
+
for (var i = 0; i < x.length && i < y.length; i++) {
|
16330
|
+
if (this.isCharDigit(x[i]) && this.isCharDigit(y[i])) {
|
16331
|
+
digitIndex = i;
|
16332
|
+
break;
|
16333
|
+
}
|
16334
|
+
if (x[i] !== y[i])
|
16335
|
+
break;
|
16336
|
+
}
|
16337
|
+
if (digitIndex > -1) {
|
16338
|
+
var nX = this.getNumberFromStr(x, digitIndex);
|
16339
|
+
var nY = this.getNumberFromStr(y, digitIndex);
|
16340
|
+
if (!Number.isNaN(nX) && !Number.isNaN(nY) && nX !== nY) {
|
16341
|
+
return nX > nY ? 1 : -1;
|
16342
|
+
}
|
16343
|
+
}
|
16344
|
+
return x > y ? 1 : -1;
|
16345
|
+
};
|
16259
16346
|
Helpers.isTwoValueEquals = function (x, y, ignoreOrder, caseSensitive, trimStrings) {
|
16260
16347
|
if (ignoreOrder === void 0) { ignoreOrder = false; }
|
16261
16348
|
if (x === y)
|
@@ -16462,6 +16549,18 @@ var Helpers = /** @class */ (function () {
|
|
16462
16549
|
Helpers.isCharDigit = function (ch) {
|
16463
16550
|
return ch >= "0" && ch <= "9";
|
16464
16551
|
};
|
16552
|
+
Helpers.getNumberFromStr = function (str, index) {
|
16553
|
+
if (!this.isCharDigit(str[index]))
|
16554
|
+
return NaN;
|
16555
|
+
var nStr = "";
|
16556
|
+
while (index < str.length && this.isCharDigit(str[index])) {
|
16557
|
+
nStr += str[index];
|
16558
|
+
index++;
|
16559
|
+
}
|
16560
|
+
if (!nStr)
|
16561
|
+
return NaN;
|
16562
|
+
return this.getNumber(nStr);
|
16563
|
+
};
|
16465
16564
|
Helpers.countDecimals = function (value) {
|
16466
16565
|
if (Helpers.isNumber(value) && Math.floor(value) !== value) {
|
16467
16566
|
var strs = value.toString().split(".");
|
@@ -16564,7 +16663,7 @@ var Helpers = /** @class */ (function () {
|
|
16564
16663
|
};
|
16565
16664
|
Helpers.convertValToQuestionVal = function (val, inputType) {
|
16566
16665
|
if (val instanceof Date) {
|
16567
|
-
if (inputType === "datetime")
|
16666
|
+
if (inputType === "datetime-local")
|
16568
16667
|
return Helpers.convertDateTimeToString(val);
|
16569
16668
|
return Helpers.convertDateToString(val);
|
16570
16669
|
}
|
@@ -17651,6 +17750,9 @@ var ItemValue = /** @class */ (function (_super) {
|
|
17651
17750
|
__decorate([
|
17652
17751
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])()
|
17653
17752
|
], ItemValue.prototype, "selectedValue", void 0);
|
17753
|
+
__decorate([
|
17754
|
+
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])()
|
17755
|
+
], ItemValue.prototype, "icon", void 0);
|
17654
17756
|
return ItemValue;
|
17655
17757
|
}(_actions_action__WEBPACK_IMPORTED_MODULE_6__["BaseAction"]));
|
17656
17758
|
|
@@ -17689,7 +17791,7 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_1__["Serializer"].addClass("itemvalue", [
|
|
17689
17791
|
visibleIf: function (obj) {
|
17690
17792
|
return !obj || obj.ownerPropertyName !== "rateValues";
|
17691
17793
|
},
|
17692
|
-
}
|
17794
|
+
}
|
17693
17795
|
], function (value) { return new ItemValue(value); });
|
17694
17796
|
|
17695
17797
|
|
@@ -19434,6 +19536,9 @@ var JsonObject = /** @class */ (function () {
|
|
19434
19536
|
if (!!value[i].name) {
|
19435
19537
|
newValue.newObj.name = value[i].name;
|
19436
19538
|
}
|
19539
|
+
if (!!value[i].valueName) {
|
19540
|
+
newValue.newObj.valueName = value[i].valueName.toString();
|
19541
|
+
}
|
19437
19542
|
result.push(newValue.newObj);
|
19438
19543
|
this.toObjectCore(value[i], newValue.newObj);
|
19439
19544
|
}
|
@@ -19608,6 +19713,20 @@ var ListModel = /** @class */ (function (_super) {
|
|
19608
19713
|
this.onFilterStringChangedCallback(text);
|
19609
19714
|
}
|
19610
19715
|
};
|
19716
|
+
ListModel.prototype.scrollToItem = function (selector, ms) {
|
19717
|
+
var _this = this;
|
19718
|
+
if (ms === void 0) { ms = 0; }
|
19719
|
+
setTimeout(function () {
|
19720
|
+
if (!_this.listContainerHtmlElement)
|
19721
|
+
return;
|
19722
|
+
var item = _this.listContainerHtmlElement.querySelector("." + selector);
|
19723
|
+
if (item) {
|
19724
|
+
setTimeout(function () {
|
19725
|
+
item.scrollIntoView({ behavior: "smooth", block: "nearest", inline: "start" });
|
19726
|
+
}, ms);
|
19727
|
+
}
|
19728
|
+
}, ms);
|
19729
|
+
};
|
19611
19730
|
ListModel.prototype.setItems = function (items, sortByVisibleIndex) {
|
19612
19731
|
var _this = this;
|
19613
19732
|
if (sortByVisibleIndex === void 0) { sortByVisibleIndex = true; }
|
@@ -19769,15 +19888,10 @@ var ListModel = /** @class */ (function (_super) {
|
|
19769
19888
|
}
|
19770
19889
|
};
|
19771
19890
|
ListModel.prototype.scrollToFocusedItem = function () {
|
19772
|
-
|
19773
|
-
|
19774
|
-
|
19775
|
-
|
19776
|
-
var item = _this.listContainerHtmlElement.querySelector("." + _this.getDefaultCssClasses().itemFocused);
|
19777
|
-
if (item) {
|
19778
|
-
item.scrollIntoView({ behavior: "smooth", block: "nearest", inline: "start" });
|
19779
|
-
}
|
19780
|
-
}, 0);
|
19891
|
+
this.scrollToItem(this.getDefaultCssClasses().itemFocused);
|
19892
|
+
};
|
19893
|
+
ListModel.prototype.scrollToSelectedItem = function () {
|
19894
|
+
this.scrollToItem(this.getDefaultCssClasses().itemSelected, 110);
|
19781
19895
|
};
|
19782
19896
|
ListModel.prototype.addScrollEventListener = function (handler) {
|
19783
19897
|
if (!!handler) {
|
@@ -19792,6 +19906,12 @@ var ListModel = /** @class */ (function (_super) {
|
|
19792
19906
|
this.scrollableContainer.removeEventListener("scroll", this.scrollHandler);
|
19793
19907
|
}
|
19794
19908
|
};
|
19909
|
+
ListModel.prototype.dispose = function () {
|
19910
|
+
_super.prototype.dispose.call(this);
|
19911
|
+
if (!!this.loadingIndicatorValue) {
|
19912
|
+
this.loadingIndicatorValue.dispose();
|
19913
|
+
}
|
19914
|
+
};
|
19795
19915
|
ListModel.INDENT = 16;
|
19796
19916
|
ListModel.MINELEMENTCOUNT = 10;
|
19797
19917
|
__decorate([
|
@@ -21291,7 +21411,7 @@ var englishStrings = {
|
|
21291
21411
|
progressText: "Page {0} of {1}",
|
21292
21412
|
indexText: "{0} of {1}",
|
21293
21413
|
panelDynamicProgressText: "{0} of {1}",
|
21294
|
-
panelDynamicTabTextFormat: "Panel {
|
21414
|
+
panelDynamicTabTextFormat: "Panel {panelIndex}",
|
21295
21415
|
questionsProgressText: "Answered {0}/{1} questions",
|
21296
21416
|
emptySurvey: "The survey doesn't contain visible pages or questions.",
|
21297
21417
|
completingSurvey: "Thank you for completing the survey",
|
@@ -26479,7 +26599,7 @@ var PageModel = /** @class */ (function (_super) {
|
|
26479
26599
|
configurable: true
|
26480
26600
|
});
|
26481
26601
|
PageModel.prototype.calcCssClasses = function (css) {
|
26482
|
-
var classes = { page: {}, pageTitle: "", pageDescription: "", row: "", rowMultiple: "", pageRow: "" };
|
26602
|
+
var classes = { page: {}, pageTitle: "", pageDescription: "", row: "", rowMultiple: "", pageRow: "", rowCompact: "" };
|
26483
26603
|
this.copyCssClasses(classes.page, css.page);
|
26484
26604
|
if (!!css.pageTitle) {
|
26485
26605
|
classes.pageTitle = css.pageTitle;
|
@@ -26496,6 +26616,9 @@ var PageModel = /** @class */ (function (_super) {
|
|
26496
26616
|
if (!!css.rowMultiple) {
|
26497
26617
|
classes.rowMultiple = css.rowMultiple;
|
26498
26618
|
}
|
26619
|
+
if (!!css.rowCompact) {
|
26620
|
+
classes.rowCompact = css.rowCompact;
|
26621
|
+
}
|
26499
26622
|
if (this.survey) {
|
26500
26623
|
this.survey.updatePageCssClasses(this, classes);
|
26501
26624
|
}
|
@@ -26673,7 +26796,7 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_0__["Serializer"].addClass("page", [
|
|
26673
26796
|
{
|
26674
26797
|
name: "navigationTitle",
|
26675
26798
|
visibleIf: function (obj) {
|
26676
|
-
return !!obj.survey && obj.survey.progressBarType === "buttons";
|
26799
|
+
return !!obj.survey && (obj.survey.progressBarType === "buttons" || obj.survey.showTOC);
|
26677
26800
|
},
|
26678
26801
|
serializationProperty: "locNavigationTitle",
|
26679
26802
|
},
|
@@ -26964,6 +27087,7 @@ var QuestionRowModel = /** @class */ (function (_super) {
|
|
26964
27087
|
QuestionRowModel.prototype.getRowCss = function () {
|
26965
27088
|
return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_9__["CssClassBuilder"]()
|
26966
27089
|
.append(this.panel.cssClasses.row)
|
27090
|
+
.append(this.panel.cssClasses.rowCompact, this.panel["isCompact"])
|
26967
27091
|
.append(this.panel.cssClasses.pageRow, this.panel.isPage || (!!this.panel.originalPage && !this.panel.survey.isShowingPreview))
|
26968
27092
|
.append(this.panel.cssClasses.rowMultiple, this.visibleElements.length > 1)
|
26969
27093
|
.toString();
|
@@ -27212,12 +27336,15 @@ var PanelModelBase = /** @class */ (function (_super) {
|
|
27212
27336
|
configurable: true
|
27213
27337
|
});
|
27214
27338
|
PanelModelBase.prototype.calcCssClasses = function (css) {
|
27215
|
-
var classes = { panel: {}, error: {}, row: "", rowMultiple: "", pageRow: "" };
|
27339
|
+
var classes = { panel: {}, error: {}, row: "", rowMultiple: "", pageRow: "", rowCompact: "" };
|
27216
27340
|
this.copyCssClasses(classes.panel, css.panel);
|
27217
27341
|
this.copyCssClasses(classes.error, css.error);
|
27218
27342
|
if (!!css.pageRow) {
|
27219
27343
|
classes.pageRow = css.pageRow;
|
27220
27344
|
}
|
27345
|
+
if (!!css.rowCompact) {
|
27346
|
+
classes.rowCompact = css.rowCompact;
|
27347
|
+
}
|
27221
27348
|
if (!!css.row) {
|
27222
27349
|
classes.row = css.row;
|
27223
27350
|
}
|
@@ -28909,6 +29036,7 @@ var defaultCss = {
|
|
28909
29036
|
slider: "sv-boolean__slider",
|
28910
29037
|
label: "sv-boolean__label ",
|
28911
29038
|
disabledLabel: "sv-boolean__label--disabled",
|
29039
|
+
sliderGhost: "sv-boolean__thumb-ghost",
|
28912
29040
|
materialDecorator: "sv-item__decorator sv-boolean__decorator",
|
28913
29041
|
itemDecorator: "sv-item__svg sv-boolean__svg",
|
28914
29042
|
checkedPath: "sv-boolean__checked-path",
|
@@ -29352,6 +29480,7 @@ var defaultCss = {
|
|
29352
29480
|
slider: "sv-boolean__slider",
|
29353
29481
|
label: "sv-boolean__label ",
|
29354
29482
|
disabledLabel: "sv-boolean__label--disabled",
|
29483
|
+
sliderGhost: "sv-boolean__thumb-ghost",
|
29355
29484
|
materialDecorator: "sv-item__decorator sv-boolean__decorator",
|
29356
29485
|
itemDecorator: "sv-item__svg sv-boolean__svg",
|
29357
29486
|
checkedPath: "sv-boolean__checked-path",
|
@@ -31051,8 +31180,9 @@ var PopupBaseViewModel = /** @class */ (function (_super) {
|
|
31051
31180
|
_super.prototype.dispose.call(this);
|
31052
31181
|
this.unmountPopupContainer();
|
31053
31182
|
this.container = undefined;
|
31054
|
-
this.
|
31055
|
-
|
31183
|
+
if (!!this.footerToolbarValue) {
|
31184
|
+
this.footerToolbarValue.dispose();
|
31185
|
+
}
|
31056
31186
|
};
|
31057
31187
|
PopupBaseViewModel.prototype.initializePopupContainer = function () {
|
31058
31188
|
if (!this.createdContainer) {
|
@@ -31380,7 +31510,7 @@ var Question = /** @class */ (function (_super) {
|
|
31380
31510
|
_this.registerPropertyChangedHandlers(["showCommentArea", "showOtherItem"], function () {
|
31381
31511
|
_this.initCommentFromSurvey();
|
31382
31512
|
});
|
31383
|
-
_this.registerFunctionOnPropertiesValueChanged(["no"], function () {
|
31513
|
+
_this.registerFunctionOnPropertiesValueChanged(["no", "readOnly"], function () {
|
31384
31514
|
_this.updateQuestionCss();
|
31385
31515
|
});
|
31386
31516
|
_this.registerPropertyChangedHandlers(["isMobile"], function () { _this.onMobileChanged(); });
|
@@ -31611,11 +31741,16 @@ var Question = /** @class */ (function (_super) {
|
|
31611
31741
|
get: function () {
|
31612
31742
|
if (this.survey && this.survey.areEmptyElementsHidden && this.isEmpty())
|
31613
31743
|
return false;
|
31614
|
-
|
31744
|
+
if (this.areInvisibleElementsShowing)
|
31745
|
+
return true;
|
31746
|
+
return this.isVisibleCore();
|
31615
31747
|
},
|
31616
31748
|
enumerable: false,
|
31617
31749
|
configurable: true
|
31618
31750
|
});
|
31751
|
+
Question.prototype.isVisibleCore = function () {
|
31752
|
+
return this.visible;
|
31753
|
+
};
|
31619
31754
|
Object.defineProperty(Question.prototype, "visibleIndex", {
|
31620
31755
|
/**
|
31621
31756
|
* Returns the visible index of the question in the survey. It can be from 0 to all visible questions count - 1
|
@@ -33092,9 +33227,15 @@ var Question = /** @class */ (function (_super) {
|
|
33092
33227
|
return 1;
|
33093
33228
|
};
|
33094
33229
|
Question.prototype.getCorrectAnswerCount = function () {
|
33095
|
-
return this.
|
33096
|
-
|
33097
|
-
|
33230
|
+
return this.checkIfAnswerCorrect() ? 1 : 0;
|
33231
|
+
};
|
33232
|
+
Question.prototype.checkIfAnswerCorrect = function () {
|
33233
|
+
var isEqual = this.isTwoValueEquals(this.value, this.correctAnswer, !_settings__WEBPACK_IMPORTED_MODULE_8__["settings"].comparator.caseSensitive, true);
|
33234
|
+
var options = { result: isEqual, correctAnswer: isEqual ? 1 : 0 };
|
33235
|
+
if (!!this.survey) {
|
33236
|
+
this.survey.onCorrectQuestionAnswer(this, options);
|
33237
|
+
}
|
33238
|
+
return options.result;
|
33098
33239
|
};
|
33099
33240
|
/**
|
33100
33241
|
* Returns `true` if a question answer matches the `correctAnswer` property value.
|
@@ -34185,7 +34326,7 @@ var QuestionSelectBase = /** @class */ (function (_super) {
|
|
34185
34326
|
_this.onVisibleChoicesChanged();
|
34186
34327
|
});
|
34187
34328
|
_this.registerPropertyChangedHandlers(["hideIfChoicesEmpty"], function () {
|
34188
|
-
_this.
|
34329
|
+
_this.onVisibleChanged();
|
34189
34330
|
});
|
34190
34331
|
_this.createNewArray("visibleChoices");
|
34191
34332
|
_this.setNewRestfulProperty();
|
@@ -34233,8 +34374,11 @@ var QuestionSelectBase = /** @class */ (function (_super) {
|
|
34233
34374
|
QuestionSelectBase.prototype.getItemValueType = function () {
|
34234
34375
|
return "itemvalue";
|
34235
34376
|
};
|
34236
|
-
QuestionSelectBase.prototype.createItemValue = function (value) {
|
34237
|
-
|
34377
|
+
QuestionSelectBase.prototype.createItemValue = function (value, text) {
|
34378
|
+
var res = _jsonobject__WEBPACK_IMPORTED_MODULE_0__["Serializer"].createClass(this.getItemValueType(), value);
|
34379
|
+
if (!!text)
|
34380
|
+
res.text = text;
|
34381
|
+
return res;
|
34238
34382
|
};
|
34239
34383
|
QuestionSelectBase.prototype.supportGoNextPageError = function () {
|
34240
34384
|
return !this.isOtherSelected || !!this.otherValue;
|
@@ -34499,7 +34643,7 @@ var QuestionSelectBase = /** @class */ (function (_super) {
|
|
34499
34643
|
if (!itemValue && !selectedItemValues) {
|
34500
34644
|
this.updateSelectedItemValues();
|
34501
34645
|
}
|
34502
|
-
return itemValue || selectedItemValues || (this.isOtherSelected ? this.otherItem :
|
34646
|
+
return itemValue || selectedItemValues || (this.isOtherSelected ? this.otherItem : this.createItemValue(this.value));
|
34503
34647
|
};
|
34504
34648
|
QuestionSelectBase.prototype.onGetSingleSelectedItem = function (selectedItemByValue) { };
|
34505
34649
|
QuestionSelectBase.prototype.setConditionalChoicesRunner = function () {
|
@@ -34722,10 +34866,10 @@ var QuestionSelectBase = /** @class */ (function (_super) {
|
|
34722
34866
|
if (!displayValues || !displayValues.length)
|
34723
34867
|
return;
|
34724
34868
|
if (IsMultipleValue_1) {
|
34725
|
-
_this.selectedItemValues = displayValues.map(function (displayValue, index) { return
|
34869
|
+
_this.selectedItemValues = displayValues.map(function (displayValue, index) { return _this.createItemValue(_this.value[index], displayValue); });
|
34726
34870
|
}
|
34727
34871
|
else {
|
34728
|
-
_this.selectedItemValues =
|
34872
|
+
_this.selectedItemValues = _this.createItemValue(_this.value, displayValues[0]);
|
34729
34873
|
}
|
34730
34874
|
}
|
34731
34875
|
});
|
@@ -35057,7 +35201,7 @@ var QuestionSelectBase = /** @class */ (function (_super) {
|
|
35057
35201
|
QuestionSelectBase.prototype.addToVisibleChoices = function (items, isAddAll) {
|
35058
35202
|
if (isAddAll) {
|
35059
35203
|
if (!this.newItemValue) {
|
35060
|
-
this.newItemValue =
|
35204
|
+
this.newItemValue = this.createItemValue("newitem"); //TODO
|
35061
35205
|
}
|
35062
35206
|
if (this.canShowOptionItem(this.newItemValue, isAddAll, false)) {
|
35063
35207
|
items.push(this.newItemValue);
|
@@ -35201,12 +35345,14 @@ var QuestionSelectBase = /** @class */ (function (_super) {
|
|
35201
35345
|
}
|
35202
35346
|
}
|
35203
35347
|
if (this.choicesFromQuestionMode === "selected" && question.isOtherSelected && !!question.comment) {
|
35204
|
-
res.push(
|
35348
|
+
res.push(this.createItemValue(question.otherItem.value, question.comment));
|
35205
35349
|
}
|
35206
35350
|
return res;
|
35207
35351
|
};
|
35208
35352
|
QuestionSelectBase.prototype.copyChoiceItem = function (item) {
|
35209
|
-
|
35353
|
+
var res = this.createItemValue(item.value);
|
35354
|
+
res.setData(item);
|
35355
|
+
return res;
|
35210
35356
|
};
|
35211
35357
|
Object.defineProperty(QuestionSelectBase.prototype, "hasActiveChoices", {
|
35212
35358
|
get: function () {
|
@@ -35473,17 +35619,18 @@ var QuestionSelectBase = /** @class */ (function (_super) {
|
|
35473
35619
|
if (this.isLoadingFromJson)
|
35474
35620
|
return;
|
35475
35621
|
this.updateVisibleChoices();
|
35476
|
-
this.
|
35622
|
+
this.onVisibleChanged();
|
35477
35623
|
if (!!this.visibleChoicesChangedCallback) {
|
35478
35624
|
this.visibleChoicesChangedCallback();
|
35479
35625
|
}
|
35480
35626
|
this.updateChoicesDependedQuestions();
|
35481
35627
|
};
|
35482
|
-
QuestionSelectBase.prototype.
|
35483
|
-
|
35484
|
-
|
35485
|
-
|
35486
|
-
|
35628
|
+
QuestionSelectBase.prototype.isVisibleCore = function () {
|
35629
|
+
var superVal = _super.prototype.isVisibleCore.call(this);
|
35630
|
+
if (!this.hideIfChoicesEmpty || !superVal)
|
35631
|
+
return superVal;
|
35632
|
+
var filteredChoices = this.getFilteredChoices();
|
35633
|
+
return !filteredChoices || filteredChoices.length > 0;
|
35487
35634
|
};
|
35488
35635
|
QuestionSelectBase.prototype.sortVisibleChoices = function (array) {
|
35489
35636
|
var order = this.choicesOrder.toLowerCase();
|
@@ -35497,11 +35644,7 @@ var QuestionSelectBase = /** @class */ (function (_super) {
|
|
35497
35644
|
};
|
35498
35645
|
QuestionSelectBase.prototype.sortArray = function (array, mult) {
|
35499
35646
|
return array.sort(function (a, b) {
|
35500
|
-
|
35501
|
-
return -1 * mult;
|
35502
|
-
if (a.calculatedText > b.calculatedText)
|
35503
|
-
return 1 * mult;
|
35504
|
-
return 0;
|
35647
|
+
return _helpers__WEBPACK_IMPORTED_MODULE_8__["Helpers"].compareStrings(a.calculatedText, b.calculatedText) * mult;
|
35505
35648
|
});
|
35506
35649
|
};
|
35507
35650
|
QuestionSelectBase.prototype.randomizeArray = function (array) {
|
@@ -36302,6 +36445,7 @@ var QuestionBooleanModel = /** @class */ (function (_super) {
|
|
36302
36445
|
.append(css.item)
|
36303
36446
|
.append(css.itemOnError, this.errors.length > 0)
|
36304
36447
|
.append(css.itemDisabled, this.isReadOnly)
|
36448
|
+
.append(css.itemHover, !this.isDesignMode)
|
36305
36449
|
.append(css.itemChecked, !!this.booleanValue)
|
36306
36450
|
.append(css.itemIndeterminate, this.booleanValue === null)
|
36307
36451
|
.toString();
|
@@ -38684,6 +38828,13 @@ var QuestionDropdownModel = /** @class */ (function (_super) {
|
|
38684
38828
|
}
|
38685
38829
|
return _super.prototype.hasUnknownValue.call(this, val, includeOther, isFilteredChoices, checkEmptyValue);
|
38686
38830
|
};
|
38831
|
+
QuestionDropdownModel.prototype.needConvertRenderedOtherToDataValue = function () {
|
38832
|
+
var _a;
|
38833
|
+
var val = (_a = this.otherValue) === null || _a === void 0 ? void 0 : _a.trim();
|
38834
|
+
if (!val)
|
38835
|
+
return false;
|
38836
|
+
return _super.prototype.hasUnknownValue.call(this, val, true, false);
|
38837
|
+
};
|
38687
38838
|
QuestionDropdownModel.prototype.onVisibleChoicesChanged = function () {
|
38688
38839
|
_super.prototype.onVisibleChoicesChanged.call(this);
|
38689
38840
|
if (this.popupModel) {
|
@@ -38697,8 +38848,10 @@ var QuestionDropdownModel = /** @class */ (function (_super) {
|
|
38697
38848
|
return this.inputId + "_0";
|
38698
38849
|
};
|
38699
38850
|
QuestionDropdownModel.prototype.clearValue = function () {
|
38851
|
+
var _a;
|
38700
38852
|
_super.prototype.clearValue.call(this);
|
38701
38853
|
this.lastSelectedItemValue = null;
|
38854
|
+
(_a = this.dropdownListModel) === null || _a === void 0 ? void 0 : _a.clear();
|
38702
38855
|
};
|
38703
38856
|
QuestionDropdownModel.prototype.onClick = function (e) {
|
38704
38857
|
!!this.onOpenedCallBack && this.onOpenedCallBack();
|
@@ -38711,6 +38864,12 @@ var QuestionDropdownModel = /** @class */ (function (_super) {
|
|
38711
38864
|
event.stopPropagation();
|
38712
38865
|
}
|
38713
38866
|
};
|
38867
|
+
QuestionDropdownModel.prototype.dispose = function () {
|
38868
|
+
_super.prototype.dispose.call(this);
|
38869
|
+
if (!!this.dropdownListModelValue) {
|
38870
|
+
this.dropdownListModelValue.dispose();
|
38871
|
+
}
|
38872
|
+
};
|
38714
38873
|
__decorate([
|
38715
38874
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])()
|
38716
38875
|
], QuestionDropdownModel.prototype, "allowClear", void 0);
|
@@ -43172,7 +43331,8 @@ var QuestionMatrixDropdownModelBase = /** @class */ (function (_super) {
|
|
43172
43331
|
this.resetRenderedTable();
|
43173
43332
|
}
|
43174
43333
|
else {
|
43175
|
-
this.
|
43334
|
+
var index = this.visibleRows.length - 1;
|
43335
|
+
this.renderedTable.onAddedRow(this.visibleRows[index], index);
|
43176
43336
|
}
|
43177
43337
|
};
|
43178
43338
|
QuestionMatrixDropdownModelBase.prototype.onEndRowRemoving = function (row) {
|
@@ -43215,6 +43375,13 @@ var QuestionMatrixDropdownModelBase = /** @class */ (function (_super) {
|
|
43215
43375
|
}
|
43216
43376
|
_super.prototype.clearGeneratedRows.call(this);
|
43217
43377
|
};
|
43378
|
+
Object.defineProperty(QuestionMatrixDropdownModelBase.prototype, "isRendredTableCreated", {
|
43379
|
+
get: function () {
|
43380
|
+
return !!this.renderedTableValue;
|
43381
|
+
},
|
43382
|
+
enumerable: false,
|
43383
|
+
configurable: true
|
43384
|
+
});
|
43218
43385
|
Object.defineProperty(QuestionMatrixDropdownModelBase.prototype, "renderedTable", {
|
43219
43386
|
get: function () {
|
43220
43387
|
if (!this.renderedTableValue) {
|
@@ -45571,7 +45738,12 @@ var QuestionMatrixDropdownRenderedCell = /** @class */ (function () {
|
|
45571
45738
|
return this.cell.column.locCellHint.renderedHtml;
|
45572
45739
|
}
|
45573
45740
|
if (this.cell.column.isShowInMultipleColumns) {
|
45574
|
-
|
45741
|
+
if (!!this.item) {
|
45742
|
+
return this.item.locText.renderedHtml;
|
45743
|
+
}
|
45744
|
+
else {
|
45745
|
+
return "";
|
45746
|
+
}
|
45575
45747
|
}
|
45576
45748
|
}
|
45577
45749
|
if (this.question && this.question.isVisible) {
|
@@ -45768,14 +45940,31 @@ var QuestionMatrixDropdownRenderedTable = /** @class */ (function (_super) {
|
|
45768
45940
|
this.setPropertyValue("showAddRowOnTop", showAddRowOnTop);
|
45769
45941
|
this.setPropertyValue("showAddRowOnBottom", showAddRowOnBottom);
|
45770
45942
|
};
|
45771
|
-
QuestionMatrixDropdownRenderedTable.prototype.onAddedRow = function () {
|
45943
|
+
QuestionMatrixDropdownRenderedTable.prototype.onAddedRow = function (row, index) {
|
45772
45944
|
if (this.getRenderedDataRowCount() >= this.matrix.visibleRows.length)
|
45773
45945
|
return;
|
45774
|
-
var
|
45775
|
-
this.rowsActions.
|
45776
|
-
this.addHorizontalRow(this.rows, row, this.matrix.visibleRows.length == 1 && !this.matrix.showHeader);
|
45946
|
+
var rowIndex = this.getRenderedRowIndexByIndex(index);
|
45947
|
+
this.rowsActions.splice(index, 0, this.buildRowActions(row));
|
45948
|
+
this.addHorizontalRow(this.rows, row, this.matrix.visibleRows.length == 1 && !this.matrix.showHeader, rowIndex);
|
45777
45949
|
this.updateShowTableAndAddRow();
|
45778
45950
|
};
|
45951
|
+
QuestionMatrixDropdownRenderedTable.prototype.getRenderedRowIndexByIndex = function (index) {
|
45952
|
+
var res = 0;
|
45953
|
+
var dataRowIndex = 0;
|
45954
|
+
for (var i = 0; i < this.rows.length; i++) {
|
45955
|
+
if (dataRowIndex === index) {
|
45956
|
+
if (this.rows[i].isDetailRow)
|
45957
|
+
res++;
|
45958
|
+
break;
|
45959
|
+
}
|
45960
|
+
res++;
|
45961
|
+
if (!this.rows[i].isDetailRow)
|
45962
|
+
dataRowIndex++;
|
45963
|
+
}
|
45964
|
+
if (dataRowIndex < index)
|
45965
|
+
return this.rows.length;
|
45966
|
+
return res;
|
45967
|
+
};
|
45779
45968
|
QuestionMatrixDropdownRenderedTable.prototype.getRenderedDataRowCount = function () {
|
45780
45969
|
var res = 0;
|
45781
45970
|
for (var i = 0; i < this.rows.length; i++) {
|
@@ -45939,12 +46128,16 @@ var QuestionMatrixDropdownRenderedTable = /** @class */ (function (_super) {
|
|
45939
46128
|
}
|
45940
46129
|
return renderedRows;
|
45941
46130
|
};
|
45942
|
-
QuestionMatrixDropdownRenderedTable.prototype.addHorizontalRow = function (renderedRows, row, useAsHeader) {
|
46131
|
+
QuestionMatrixDropdownRenderedTable.prototype.addHorizontalRow = function (renderedRows, row, useAsHeader, index) {
|
46132
|
+
if (index === void 0) { index = -1; }
|
45943
46133
|
var renderedRow = this.createHorizontalRow(row, useAsHeader);
|
45944
46134
|
renderedRow.row = row;
|
45945
|
-
|
46135
|
+
if (index < 0) {
|
46136
|
+
index = renderedRows.length;
|
46137
|
+
}
|
46138
|
+
renderedRows.splice(index, 0, renderedRow);
|
45946
46139
|
if (row.isDetailPanelShowing) {
|
45947
|
-
renderedRows.
|
46140
|
+
renderedRows.splice(index + 1, 0, this.createDetailPanelRow(row, renderedRow));
|
45948
46141
|
}
|
45949
46142
|
};
|
45950
46143
|
QuestionMatrixDropdownRenderedTable.prototype.getRowDragCell = function (rowIndex) {
|
@@ -46421,17 +46614,6 @@ var QuestionMatrixDynamicModel = /** @class */ (function (_super) {
|
|
46421
46614
|
_this.startDragMatrixRow = function (event, currentTarget) {
|
46422
46615
|
_this.dragDropMatrixRows.startDrag(event, _this.draggedRow, _this, event.target);
|
46423
46616
|
};
|
46424
|
-
_this.moveRowByIndex = function (fromIndex, toIndex) {
|
46425
|
-
var value = _this.createNewValue();
|
46426
|
-
if (!value)
|
46427
|
-
return;
|
46428
|
-
var movableRow = value[fromIndex];
|
46429
|
-
if (!movableRow)
|
46430
|
-
return;
|
46431
|
-
value.splice(fromIndex, 1);
|
46432
|
-
value.splice(toIndex, 0, movableRow);
|
46433
|
-
_this.value = value;
|
46434
|
-
};
|
46435
46617
|
_this.createLocalizableString("confirmDeleteText", _this, false, "confirmDelete");
|
46436
46618
|
var locAddRowText = _this.createLocalizableString("addRowText", _this);
|
46437
46619
|
locAddRowText.onGetTextCallback = function (text) {
|
@@ -46561,6 +46743,20 @@ var QuestionMatrixDynamicModel = /** @class */ (function (_super) {
|
|
46561
46743
|
}
|
46562
46744
|
this.value = newValue;
|
46563
46745
|
};
|
46746
|
+
QuestionMatrixDynamicModel.prototype.moveRowByIndex = function (fromIndex, toIndex) {
|
46747
|
+
var value = this.createNewValue();
|
46748
|
+
if (!Array.isArray(value) && Math.max(fromIndex, toIndex) >= value.length)
|
46749
|
+
return;
|
46750
|
+
var movableRow = value[fromIndex];
|
46751
|
+
value.splice(fromIndex, 1);
|
46752
|
+
value.splice(toIndex, 0, movableRow);
|
46753
|
+
this.value = value;
|
46754
|
+
};
|
46755
|
+
QuestionMatrixDynamicModel.prototype.clearOnDrop = function () {
|
46756
|
+
if (!this.isEditingSurveyElement) {
|
46757
|
+
this.resetRenderedTable();
|
46758
|
+
}
|
46759
|
+
};
|
46564
46760
|
Object.defineProperty(QuestionMatrixDynamicModel.prototype, "rowCount", {
|
46565
46761
|
/**
|
46566
46762
|
* The number of rows in the matrix.
|
@@ -47204,6 +47400,51 @@ var QuestionMatrixDynamicModel = /** @class */ (function (_super) {
|
|
47204
47400
|
QuestionMatrixDynamicModel.prototype.createMatrixRow = function (value) {
|
47205
47401
|
return new MatrixDynamicRowModel(this.rowCounter++, this, value);
|
47206
47402
|
};
|
47403
|
+
QuestionMatrixDynamicModel.prototype.getInsertedDeletedIndex = function (rows, val) {
|
47404
|
+
var len = Math.min(rows.length, val.length);
|
47405
|
+
for (var i = 0; i < len; i++) {
|
47406
|
+
if (val[i] !== rows[i].editingObj)
|
47407
|
+
return i;
|
47408
|
+
}
|
47409
|
+
return len;
|
47410
|
+
};
|
47411
|
+
QuestionMatrixDynamicModel.prototype.isEditingObjectValueChanged = function () {
|
47412
|
+
var val = this.value;
|
47413
|
+
if (!this.generatedVisibleRows || !this.isValueSurveyElement(val))
|
47414
|
+
return false;
|
47415
|
+
var lastDelRow = this.lastDeletedRow;
|
47416
|
+
this.lastDeletedRow = undefined;
|
47417
|
+
var rows = this.generatedVisibleRows;
|
47418
|
+
if (!Array.isArray(val) || Math.abs(rows.length - val.length) > 1)
|
47419
|
+
return false;
|
47420
|
+
var index = this.getInsertedDeletedIndex(rows, val);
|
47421
|
+
if (rows.length > val.length) {
|
47422
|
+
this.lastDeletedRow = rows[index];
|
47423
|
+
var row = rows[index];
|
47424
|
+
rows.splice(index, 1);
|
47425
|
+
if (this.isRendredTableCreated) {
|
47426
|
+
this.renderedTable.onRemovedRow(row);
|
47427
|
+
}
|
47428
|
+
}
|
47429
|
+
else {
|
47430
|
+
var newRow = undefined;
|
47431
|
+
if (!!lastDelRow && lastDelRow.editingObj === val[index]) {
|
47432
|
+
newRow = lastDelRow;
|
47433
|
+
}
|
47434
|
+
else {
|
47435
|
+
newRow = this.createMatrixRow(val[index]);
|
47436
|
+
}
|
47437
|
+
rows.splice(index, 0, newRow);
|
47438
|
+
if (!lastDelRow) {
|
47439
|
+
this.onMatrixRowCreated(newRow);
|
47440
|
+
}
|
47441
|
+
if (this.isRendredTableCreated) {
|
47442
|
+
this.renderedTable.onAddedRow(newRow, index);
|
47443
|
+
}
|
47444
|
+
}
|
47445
|
+
this.setPropertyValueDirectly("rowCount", val.length);
|
47446
|
+
return true;
|
47447
|
+
};
|
47207
47448
|
QuestionMatrixDynamicModel.prototype.onBeforeValueChanged = function (val) {
|
47208
47449
|
if (!val || !Array.isArray(val))
|
47209
47450
|
return;
|
@@ -47212,6 +47453,8 @@ var QuestionMatrixDynamicModel = /** @class */ (function (_super) {
|
|
47212
47453
|
return;
|
47213
47454
|
if (!this.setRowCountValueFromData && newRowCount < this.initialRowCount)
|
47214
47455
|
return;
|
47456
|
+
if (this.isEditingObjectValueChanged())
|
47457
|
+
return;
|
47215
47458
|
this.setRowCountValueFromData = true;
|
47216
47459
|
this.rowCountValue = newRowCount;
|
47217
47460
|
if (!this.generatedVisibleRows)
|
@@ -48200,17 +48443,18 @@ __webpack_require__.r(__webpack_exports__);
|
|
48200
48443
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "QuestionPanelDynamicModel", function() { return QuestionPanelDynamicModel; });
|
48201
48444
|
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./helpers */ "./src/helpers.ts");
|
48202
48445
|
/* harmony import */ var _survey_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./survey-element */ "./src/survey-element.ts");
|
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
|
48212
|
-
/* harmony import */ var
|
48213
|
-
/* harmony import */ var
|
48446
|
+
/* harmony import */ var _localizablestring__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./localizablestring */ "./src/localizablestring.ts");
|
48447
|
+
/* harmony import */ var _textPreProcessor__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./textPreProcessor */ "./src/textPreProcessor.ts");
|
48448
|
+
/* harmony import */ var _question__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./question */ "./src/question.ts");
|
48449
|
+
/* harmony import */ var _jsonobject__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./jsonobject */ "./src/jsonobject.ts");
|
48450
|
+
/* harmony import */ var _questionfactory__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./questionfactory */ "./src/questionfactory.ts");
|
48451
|
+
/* harmony import */ var _error__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./error */ "./src/error.ts");
|
48452
|
+
/* harmony import */ var _settings__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./settings */ "./src/settings.ts");
|
48453
|
+
/* harmony import */ var _utils_utils__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./utils/utils */ "./src/utils/utils.ts");
|
48454
|
+
/* harmony import */ var _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./utils/cssClassBuilder */ "./src/utils/cssClassBuilder.ts");
|
48455
|
+
/* harmony import */ var _actions_action__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./actions/action */ "./src/actions/action.ts");
|
48456
|
+
/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./base */ "./src/base.ts");
|
48457
|
+
/* harmony import */ var _actions_adaptive_container__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./actions/adaptive-container */ "./src/actions/adaptive-container.ts");
|
48214
48458
|
var __extends = (undefined && undefined.__extends) || (function () {
|
48215
48459
|
var extendStatics = function (d, b) {
|
48216
48460
|
extendStatics = Object.setPrototypeOf ||
|
@@ -48250,6 +48494,7 @@ var __spreadArray = (undefined && undefined.__spreadArray) || function (to, from
|
|
48250
48494
|
|
48251
48495
|
|
48252
48496
|
|
48497
|
+
|
48253
48498
|
var QuestionPanelDynamicItemTextProcessor = /** @class */ (function (_super) {
|
48254
48499
|
__extends(QuestionPanelDynamicItemTextProcessor, _super);
|
48255
48500
|
function QuestionPanelDynamicItemTextProcessor(data, panelItem, variableName) {
|
@@ -48325,7 +48570,7 @@ var QuestionPanelDynamicItemTextProcessor = /** @class */ (function (_super) {
|
|
48325
48570
|
return false;
|
48326
48571
|
};
|
48327
48572
|
return QuestionPanelDynamicItemTextProcessor;
|
48328
|
-
}(
|
48573
|
+
}(_textPreProcessor__WEBPACK_IMPORTED_MODULE_3__["QuestionTextProcessor"]));
|
48329
48574
|
var QuestionPanelDynamicItem = /** @class */ (function () {
|
48330
48575
|
function QuestionPanelDynamicItem(data, panel) {
|
48331
48576
|
this.data = data;
|
@@ -48365,11 +48610,11 @@ var QuestionPanelDynamicItem = /** @class */ (function () {
|
|
48365
48610
|
};
|
48366
48611
|
QuestionPanelDynamicItem.prototype.setVariable = function (name, newValue) { };
|
48367
48612
|
QuestionPanelDynamicItem.prototype.getComment = function (name) {
|
48368
|
-
var result = this.getValue(name +
|
48613
|
+
var result = this.getValue(name + _settings__WEBPACK_IMPORTED_MODULE_8__["settings"].commentSuffix);
|
48369
48614
|
return result ? result : "";
|
48370
48615
|
};
|
48371
48616
|
QuestionPanelDynamicItem.prototype.setComment = function (name, newValue, locNotification) {
|
48372
|
-
this.setValue(name +
|
48617
|
+
this.setValue(name + _settings__WEBPACK_IMPORTED_MODULE_8__["settings"].commentSuffix, newValue);
|
48373
48618
|
};
|
48374
48619
|
QuestionPanelDynamicItem.prototype.findQuestionByName = function (name) {
|
48375
48620
|
if (!name)
|
@@ -48394,7 +48639,9 @@ var QuestionPanelDynamicItem = /** @class */ (function () {
|
|
48394
48639
|
}
|
48395
48640
|
values[QuestionPanelDynamicItem.ItemVariableName] = this.getAllValues();
|
48396
48641
|
if (!!this.data) {
|
48397
|
-
|
48642
|
+
var indexStr = QuestionPanelDynamicItem.IndexVariableName;
|
48643
|
+
delete values[indexStr];
|
48644
|
+
values[indexStr.toLowerCase()] = this.data.getItemIndex(this);
|
48398
48645
|
var q = this.data;
|
48399
48646
|
if (!!q && !!q.parentQuestion && !!q.parent) {
|
48400
48647
|
values[QuestionPanelDynamicItem.ParentItemVariableName] = q.parent.getValue();
|
@@ -48441,7 +48688,7 @@ var QuestionPanelDynamicTemplateSurveyImpl = /** @class */ (function () {
|
|
48441
48688
|
/**
|
48442
48689
|
* A class that describes the Dynamic Panel question type.
|
48443
48690
|
*
|
48444
|
-
* Dynamic Panel allows respondents to add panels based on a template
|
48691
|
+
* 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.
|
48445
48692
|
*
|
48446
48693
|
* [View Demo](https://surveyjs.io/form-library/examples/questiontype-paneldynamic/ (linkStyle))
|
48447
48694
|
*/
|
@@ -48449,7 +48696,6 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
48449
48696
|
__extends(QuestionPanelDynamicModel, _super);
|
48450
48697
|
function QuestionPanelDynamicModel(name) {
|
48451
48698
|
var _this = _super.call(this, name) || this;
|
48452
|
-
_this.loadingPanelCount = 0;
|
48453
48699
|
_this.isAddingNewPanels = false;
|
48454
48700
|
_this.onReadyChangedCallback = function () {
|
48455
48701
|
_this.recalculateIsReadyValue();
|
@@ -48473,6 +48719,7 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
48473
48719
|
_this.createLocalizableString("panelPrevText", _this, false, "pagePrevText");
|
48474
48720
|
_this.createLocalizableString("panelNextText", _this, false, "pageNextText");
|
48475
48721
|
_this.createLocalizableString("noEntriesText", _this, false, "noEntriesText");
|
48722
|
+
_this.createLocalizableString("templateTabTitle", _this, true, "panelDynamicTabTextFormat");
|
48476
48723
|
_this.registerPropertyChangedHandlers(["panelsState"], function () {
|
48477
48724
|
_this.setPanelsState();
|
48478
48725
|
});
|
@@ -48525,7 +48772,7 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
48525
48772
|
QuestionPanelDynamicModel.prototype.onTemplateElementPropertyChanged = function (element, options) {
|
48526
48773
|
if (this.isLoadingFromJson || this.useTemplatePanel || this.panels.length == 0)
|
48527
48774
|
return;
|
48528
|
-
var property =
|
48775
|
+
var property = _jsonobject__WEBPACK_IMPORTED_MODULE_5__["Serializer"].findProperty(element.getType(), options.name);
|
48529
48776
|
if (!property)
|
48530
48777
|
return;
|
48531
48778
|
var panels = this.panels;
|
@@ -48588,7 +48835,7 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
48588
48835
|
};
|
48589
48836
|
Object.defineProperty(QuestionPanelDynamicModel.prototype, "templateElements", {
|
48590
48837
|
/**
|
48591
|
-
* An array of questions and panels included in
|
48838
|
+
* An array of questions and panels included in a panel template.
|
48592
48839
|
* @see template
|
48593
48840
|
* @see panels
|
48594
48841
|
* @see panelCount
|
@@ -48601,7 +48848,7 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
48601
48848
|
});
|
48602
48849
|
Object.defineProperty(QuestionPanelDynamicModel.prototype, "templateTitle", {
|
48603
48850
|
/**
|
48604
|
-
* A
|
48851
|
+
* A template for panel titles.
|
48605
48852
|
* @see template
|
48606
48853
|
* @see templateDescription
|
48607
48854
|
* @see templateElements
|
@@ -48624,9 +48871,31 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
48624
48871
|
enumerable: false,
|
48625
48872
|
configurable: true
|
48626
48873
|
});
|
48874
|
+
Object.defineProperty(QuestionPanelDynamicModel.prototype, "templateTabTitle", {
|
48875
|
+
/**
|
48876
|
+
* A template for tab titles. Applies when [`renderMode`](https://surveyjs.io/form-library/documentation/api-reference/dynamic-panel-model#renderMode) is `"tab"`.
|
48877
|
+
* @see templateTitle
|
48878
|
+
* @see renderMode
|
48879
|
+
*/
|
48880
|
+
get: function () {
|
48881
|
+
return this.locTemplateTabTitle.text;
|
48882
|
+
},
|
48883
|
+
set: function (newValue) {
|
48884
|
+
this.locTemplateTabTitle.text = newValue;
|
48885
|
+
},
|
48886
|
+
enumerable: false,
|
48887
|
+
configurable: true
|
48888
|
+
});
|
48889
|
+
Object.defineProperty(QuestionPanelDynamicModel.prototype, "locTemplateTabTitle", {
|
48890
|
+
get: function () {
|
48891
|
+
return this.getLocalizableString("templateTabTitle");
|
48892
|
+
},
|
48893
|
+
enumerable: false,
|
48894
|
+
configurable: true
|
48895
|
+
});
|
48627
48896
|
Object.defineProperty(QuestionPanelDynamicModel.prototype, "templateDescription", {
|
48628
48897
|
/**
|
48629
|
-
* A
|
48898
|
+
* A template for panel descriptions.
|
48630
48899
|
* @see template
|
48631
48900
|
* @see templateTitle
|
48632
48901
|
* @see templateElements
|
@@ -48662,7 +48931,7 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
48662
48931
|
});
|
48663
48932
|
Object.defineProperty(QuestionPanelDynamicModel.prototype, "panels", {
|
48664
48933
|
/**
|
48665
|
-
* An array of `PanelModel` objects created based on
|
48934
|
+
* An array of `PanelModel` objects created based on a panel template.
|
48666
48935
|
* @see PanelModel
|
48667
48936
|
* @see template
|
48668
48937
|
* @see panelCount
|
@@ -48988,7 +49257,7 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
48988
49257
|
};
|
48989
49258
|
QuestionPanelDynamicModel.prototype.setIsMobile = function (val) {
|
48990
49259
|
(this.panels || []).forEach(function (panel) { return panel.elements.forEach(function (element) {
|
48991
|
-
if (element instanceof
|
49260
|
+
if (element instanceof _question__WEBPACK_IMPORTED_MODULE_4__["Question"]) {
|
48992
49261
|
element.isMobile = val;
|
48993
49262
|
}
|
48994
49263
|
}); });
|
@@ -49001,14 +49270,14 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
49001
49270
|
*/
|
49002
49271
|
get: function () {
|
49003
49272
|
return this.isLoadingFromJson || this.useTemplatePanel
|
49004
|
-
? this.
|
49273
|
+
? this.getPropertyValue("panelCount")
|
49005
49274
|
: this.panels.length;
|
49006
49275
|
},
|
49007
49276
|
set: function (val) {
|
49008
49277
|
if (val < 0)
|
49009
49278
|
return;
|
49010
49279
|
if (this.isLoadingFromJson || this.useTemplatePanel) {
|
49011
|
-
this.
|
49280
|
+
this.setPropertyValue("panelCount", val);
|
49012
49281
|
return;
|
49013
49282
|
}
|
49014
49283
|
if (val == this.panels.length || this.useTemplatePanel)
|
@@ -49146,8 +49415,8 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
49146
49415
|
set: function (val) {
|
49147
49416
|
if (val <= 0)
|
49148
49417
|
return;
|
49149
|
-
if (val >
|
49150
|
-
val =
|
49418
|
+
if (val > _settings__WEBPACK_IMPORTED_MODULE_8__["settings"].panelMaximumPanelCount)
|
49419
|
+
val = _settings__WEBPACK_IMPORTED_MODULE_8__["settings"].panelMaximumPanelCount;
|
49151
49420
|
if (val == this.maxPanelCount)
|
49152
49421
|
return;
|
49153
49422
|
this.setPropertyValue("maxPanelCount", val);
|
@@ -49195,7 +49464,7 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
49195
49464
|
});
|
49196
49465
|
Object.defineProperty(QuestionPanelDynamicModel.prototype, "templateTitleLocation", {
|
49197
49466
|
/**
|
49198
|
-
* Gets or sets the location of question titles
|
49467
|
+
* Gets or sets the location of question titles relative to their input fields.
|
49199
49468
|
*
|
49200
49469
|
* - `"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).
|
49201
49470
|
* - `"top"` - Displays question titles above input fields.
|
@@ -49268,7 +49537,15 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
49268
49537
|
});
|
49269
49538
|
Object.defineProperty(QuestionPanelDynamicModel.prototype, "renderMode", {
|
49270
49539
|
/**
|
49271
|
-
*
|
49540
|
+
* Specifies how to render panels.
|
49541
|
+
*
|
49542
|
+
* Possible values:
|
49543
|
+
*
|
49544
|
+
* - `"list"` - Renders panels one under the other. [View Demo](https://surveyjs.io/form-library/examples/how-to-use-expressions-in-dynamic-panel/)
|
49545
|
+
* - `"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/)
|
49546
|
+
* - `"progressBottom"` - Renders each panel panel as a card and displays a progress bar at the bottom.
|
49547
|
+
* - `"progressTopBottom"` - Renders each panel as a card and displays a progress bar at the top and bottom.
|
49548
|
+
* - `"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.
|
49272
49549
|
*/
|
49273
49550
|
get: function () {
|
49274
49551
|
return this.getPropertyValue("renderMode");
|
@@ -49562,7 +49839,7 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
49562
49839
|
QuestionPanelDynamicModel.prototype.removePanelUI = function (value) {
|
49563
49840
|
if (!this.canRemovePanel)
|
49564
49841
|
return;
|
49565
|
-
if (!this.confirmDelete || Object(
|
49842
|
+
if (!this.confirmDelete || Object(_utils_utils__WEBPACK_IMPORTED_MODULE_9__["confirmAction"])(this.confirmDeleteText)) {
|
49566
49843
|
this.removePanel(value);
|
49567
49844
|
}
|
49568
49845
|
};
|
@@ -49624,12 +49901,22 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
49624
49901
|
}
|
49625
49902
|
return -1;
|
49626
49903
|
};
|
49904
|
+
QuestionPanelDynamicModel.prototype.getPanelIndexById = function (id) {
|
49905
|
+
for (var i = 0; i < this.panels.length; i++) {
|
49906
|
+
if (this.panels[i].id === id)
|
49907
|
+
return i;
|
49908
|
+
}
|
49909
|
+
return -1;
|
49910
|
+
};
|
49627
49911
|
QuestionPanelDynamicModel.prototype.locStrsChanged = function () {
|
49628
49912
|
_super.prototype.locStrsChanged.call(this);
|
49629
49913
|
var panels = this.panels;
|
49630
49914
|
for (var i = 0; i < panels.length; i++) {
|
49631
49915
|
panels[i].locStrsChanged();
|
49632
49916
|
}
|
49917
|
+
if (this.additionalTitleToolbar) {
|
49918
|
+
this.additionalTitleToolbar.locStrsChanged();
|
49919
|
+
}
|
49633
49920
|
};
|
49634
49921
|
QuestionPanelDynamicModel.prototype.clearIncorrectValues = function () {
|
49635
49922
|
for (var i = 0; i < this.panels.length; i++) {
|
@@ -49661,8 +49948,8 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
49661
49948
|
var q = panel.getQuestionByName(key);
|
49662
49949
|
if (!!q)
|
49663
49950
|
continue;
|
49664
|
-
if (this.iscorrectValueWithPostPrefix(panel, key,
|
49665
|
-
this.iscorrectValueWithPostPrefix(panel, key,
|
49951
|
+
if (this.iscorrectValueWithPostPrefix(panel, key, _settings__WEBPACK_IMPORTED_MODULE_8__["settings"].commentSuffix) ||
|
49952
|
+
this.iscorrectValueWithPostPrefix(panel, key, _settings__WEBPACK_IMPORTED_MODULE_8__["settings"].matrixTotalValuePostFix))
|
49666
49953
|
continue;
|
49667
49954
|
delete values[key];
|
49668
49955
|
isChanged = true;
|
@@ -49691,7 +49978,7 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
49691
49978
|
for (var i = 0; i < questions.length; i++) {
|
49692
49979
|
questions[i].addConditionObjectsByContext(panelObjs, context);
|
49693
49980
|
}
|
49694
|
-
for (var index = 0; index <
|
49981
|
+
for (var index = 0; index < _settings__WEBPACK_IMPORTED_MODULE_8__["settings"].panelDynamicMaxPanelCountInCondition; index++) {
|
49695
49982
|
var indexStr = "[" + index + "].";
|
49696
49983
|
var prefixName = this.getValueName() + indexStr;
|
49697
49984
|
var prefixText = this.processedTitle + indexStr;
|
@@ -49756,8 +50043,8 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
49756
50043
|
QuestionPanelDynamicModel.prototype.onSurveyLoad = function () {
|
49757
50044
|
this.template.readOnly = this.isReadOnly;
|
49758
50045
|
this.template.onSurveyLoad();
|
49759
|
-
if (this.
|
49760
|
-
this.panelCount = this.
|
50046
|
+
if (this.getPropertyValue("panelCount") > 0) {
|
50047
|
+
this.panelCount = this.getPropertyValue("panelCount");
|
49761
50048
|
}
|
49762
50049
|
if (this.useTemplatePanel) {
|
49763
50050
|
this.rebuildPanels();
|
@@ -49996,7 +50283,7 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
49996
50283
|
for (var i = 0; i < keyValues.length; i++) {
|
49997
50284
|
if (value == keyValues[i]) {
|
49998
50285
|
if (fireCallback) {
|
49999
|
-
question.addError(new
|
50286
|
+
question.addError(new _error__WEBPACK_IMPORTED_MODULE_7__["KeyDuplicationError"](this.keyDuplicationError, this));
|
50000
50287
|
}
|
50001
50288
|
if (!!rec && !rec.firstErrorQuestion) {
|
50002
50289
|
rec.firstErrorQuestion = question;
|
@@ -50011,10 +50298,10 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
50011
50298
|
var _this = this;
|
50012
50299
|
var actions = panel.footerActions;
|
50013
50300
|
if (this.panelRemoveButtonLocation !== "right") {
|
50014
|
-
actions.push(new
|
50301
|
+
actions.push(new _actions_action__WEBPACK_IMPORTED_MODULE_11__["Action"]({
|
50015
50302
|
id: "remove-panel-" + panel.id,
|
50016
50303
|
component: "sv-paneldynamic-remove-btn",
|
50017
|
-
visible: new
|
50304
|
+
visible: new _base__WEBPACK_IMPORTED_MODULE_12__["ComputedUpdater"](function () { return [_this.canRemovePanel, panel.state !== "collapsed", _this.panelRemoveButtonLocation !== "right"].every(function (val) { return val === true; }); }),
|
50018
50305
|
data: { question: this, panel: panel }
|
50019
50306
|
}));
|
50020
50307
|
}
|
@@ -50027,7 +50314,7 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
50027
50314
|
var _this = this;
|
50028
50315
|
var panel = this.createAndSetupNewPanelObject();
|
50029
50316
|
var json = this.template.toJSON();
|
50030
|
-
new
|
50317
|
+
new _jsonobject__WEBPACK_IMPORTED_MODULE_5__["JsonObject"]().toObject(json, panel);
|
50031
50318
|
panel.renderWidth = "100%";
|
50032
50319
|
panel.updateCustomWidgets();
|
50033
50320
|
new QuestionPanelDynamicItem(this, panel);
|
@@ -50059,15 +50346,15 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
50059
50346
|
: this.getTitleLocationCore();
|
50060
50347
|
};
|
50061
50348
|
QuestionPanelDynamicModel.prototype.createNewPanelObject = function () {
|
50062
|
-
return
|
50349
|
+
return _jsonobject__WEBPACK_IMPORTED_MODULE_5__["Serializer"].createClass("panel");
|
50063
50350
|
};
|
50064
50351
|
QuestionPanelDynamicModel.prototype.setPanelCountBasedOnValue = function () {
|
50065
50352
|
if (this.isValueChangingInternally || this.useTemplatePanel)
|
50066
50353
|
return;
|
50067
50354
|
var val = this.value;
|
50068
50355
|
var newPanelCount = val && Array.isArray(val) ? val.length : 0;
|
50069
|
-
if (newPanelCount == 0 && this.
|
50070
|
-
newPanelCount = this.
|
50356
|
+
if (newPanelCount == 0 && this.getPropertyValue("panelCount") > 0) {
|
50357
|
+
newPanelCount = this.getPropertyValue("panelCount");
|
50071
50358
|
}
|
50072
50359
|
this.panelCount = newPanelCount;
|
50073
50360
|
};
|
@@ -50104,7 +50391,7 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
50104
50391
|
for (var i = 0; i < questions.length; i++) {
|
50105
50392
|
var q = questions[i];
|
50106
50393
|
q.updateValueFromSurvey(values[q.getValueName()]);
|
50107
|
-
q.updateCommentFromSurvey(values[q.getValueName() +
|
50394
|
+
q.updateCommentFromSurvey(values[q.getValueName() + _settings__WEBPACK_IMPORTED_MODULE_8__["settings"].commentSuffix]);
|
50108
50395
|
}
|
50109
50396
|
};
|
50110
50397
|
QuestionPanelDynamicModel.prototype.panelSurveyValueChanged = function (panel) {
|
@@ -50268,12 +50555,12 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
50268
50555
|
configurable: true
|
50269
50556
|
});
|
50270
50557
|
QuestionPanelDynamicModel.prototype.getRootCss = function () {
|
50271
|
-
return new
|
50558
|
+
return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_10__["CssClassBuilder"]().append(_super.prototype.getRootCss.call(this)).append(this.cssClasses.empty, this.getShowNoEntriesPlaceholder()).toString();
|
50272
50559
|
};
|
50273
50560
|
Object.defineProperty(QuestionPanelDynamicModel.prototype, "cssHeader", {
|
50274
50561
|
get: function () {
|
50275
50562
|
var showTab = this.isRenderModeTab && !!this.panelCount;
|
50276
|
-
return new
|
50563
|
+
return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_10__["CssClassBuilder"]()
|
50277
50564
|
.append(this.cssClasses.header)
|
50278
50565
|
.append(this.cssClasses.headerTop, this.hasTitleOnTop || showTab)
|
50279
50566
|
.append(this.cssClasses.headerTab, showTab)
|
@@ -50283,33 +50570,33 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
50283
50570
|
configurable: true
|
50284
50571
|
});
|
50285
50572
|
QuestionPanelDynamicModel.prototype.getPanelWrapperCss = function () {
|
50286
|
-
return new
|
50573
|
+
return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_10__["CssClassBuilder"]()
|
50287
50574
|
.append(this.cssClasses.panelWrapper)
|
50288
50575
|
.append(this.cssClasses.panelWrapperInRow, this.panelRemoveButtonLocation === "right")
|
50289
50576
|
.toString();
|
50290
50577
|
};
|
50291
50578
|
QuestionPanelDynamicModel.prototype.getPanelRemoveButtonCss = function () {
|
50292
|
-
return new
|
50579
|
+
return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_10__["CssClassBuilder"]()
|
50293
50580
|
.append(this.cssClasses.button)
|
50294
50581
|
.append(this.cssClasses.buttonRemove)
|
50295
50582
|
.append(this.cssClasses.buttonRemoveRight, this.panelRemoveButtonLocation === "right")
|
50296
50583
|
.toString();
|
50297
50584
|
};
|
50298
50585
|
QuestionPanelDynamicModel.prototype.getAddButtonCss = function () {
|
50299
|
-
return new
|
50586
|
+
return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_10__["CssClassBuilder"]()
|
50300
50587
|
.append(this.cssClasses.button)
|
50301
50588
|
.append(this.cssClasses.buttonAdd)
|
50302
50589
|
.append(this.cssClasses.buttonAdd + "--list-mode", this.renderMode === "list")
|
50303
50590
|
.toString();
|
50304
50591
|
};
|
50305
50592
|
QuestionPanelDynamicModel.prototype.getPrevButtonCss = function () {
|
50306
|
-
return new
|
50593
|
+
return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_10__["CssClassBuilder"]()
|
50307
50594
|
.append(this.cssClasses.buttonPrev)
|
50308
50595
|
.append(this.cssClasses.buttonPrevDisabled, !this.isPrevButtonVisible)
|
50309
50596
|
.toString();
|
50310
50597
|
};
|
50311
50598
|
QuestionPanelDynamicModel.prototype.getNextButtonCss = function () {
|
50312
|
-
return new
|
50599
|
+
return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_10__["CssClassBuilder"]()
|
50313
50600
|
.append(this.cssClasses.buttonNext)
|
50314
50601
|
.append(this.cssClasses.buttonNextDisabled, !this.isNextButtonVisible)
|
50315
50602
|
.toString();
|
@@ -50347,7 +50634,7 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
50347
50634
|
if (!this.isRenderModeTab)
|
50348
50635
|
return null;
|
50349
50636
|
if (!this.additionalTitleToolbarValue) {
|
50350
|
-
this.additionalTitleToolbarValue = new
|
50637
|
+
this.additionalTitleToolbarValue = new _actions_adaptive_container__WEBPACK_IMPORTED_MODULE_13__["AdaptiveActionContainer"]();
|
50351
50638
|
this.additionalTitleToolbarValue.containerCss = this.getAdditionalTitleToolbarCss();
|
50352
50639
|
this.additionalTitleToolbarValue.cssClasses = {
|
50353
50640
|
item: "sv-tab-item",
|
@@ -50378,37 +50665,37 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
50378
50665
|
var _this = this;
|
50379
50666
|
this.footerToolbarValue = this.createActionContainer();
|
50380
50667
|
var items = [];
|
50381
|
-
var prevTextBtn = new
|
50668
|
+
var prevTextBtn = new _actions_action__WEBPACK_IMPORTED_MODULE_11__["Action"]({
|
50382
50669
|
id: "sv-pd-prev-btn",
|
50383
50670
|
title: this.panelPrevText,
|
50384
50671
|
action: function () {
|
50385
50672
|
_this.goToPrevPanel();
|
50386
50673
|
}
|
50387
50674
|
});
|
50388
|
-
var nextTextBtn = new
|
50675
|
+
var nextTextBtn = new _actions_action__WEBPACK_IMPORTED_MODULE_11__["Action"]({
|
50389
50676
|
id: "sv-pd-next-btn",
|
50390
50677
|
title: this.panelNextText,
|
50391
50678
|
action: function () {
|
50392
50679
|
_this.goToNextPanel();
|
50393
50680
|
}
|
50394
50681
|
});
|
50395
|
-
var addBtn = new
|
50682
|
+
var addBtn = new _actions_action__WEBPACK_IMPORTED_MODULE_11__["Action"]({
|
50396
50683
|
id: "sv-pd-add-btn",
|
50397
50684
|
component: "sv-paneldynamic-add-btn",
|
50398
|
-
visible: new
|
50685
|
+
visible: new _base__WEBPACK_IMPORTED_MODULE_12__["ComputedUpdater"](function () { return _this.canAddPanel; }),
|
50399
50686
|
data: { question: this }
|
50400
50687
|
});
|
50401
|
-
var prevBtnIcon = new
|
50688
|
+
var prevBtnIcon = new _actions_action__WEBPACK_IMPORTED_MODULE_11__["Action"]({
|
50402
50689
|
id: "sv-prev-btn-icon",
|
50403
50690
|
component: "sv-paneldynamic-prev-btn",
|
50404
50691
|
data: { question: this }
|
50405
50692
|
});
|
50406
|
-
var progressText = new
|
50693
|
+
var progressText = new _actions_action__WEBPACK_IMPORTED_MODULE_11__["Action"]({
|
50407
50694
|
id: "sv-pd-progress-text",
|
50408
50695
|
component: "sv-paneldynamic-progress-text",
|
50409
50696
|
data: { question: this }
|
50410
50697
|
});
|
50411
|
-
var nextBtnIcon = new
|
50698
|
+
var nextBtnIcon = new _actions_action__WEBPACK_IMPORTED_MODULE_11__["Action"]({
|
50412
50699
|
id: "sv-pd-next-btn-icon",
|
50413
50700
|
component: "sv-paneldynamic-next-btn",
|
50414
50701
|
data: { question: this }
|
@@ -50437,22 +50724,22 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
50437
50724
|
var _this = this;
|
50438
50725
|
if (!this.isRenderModeTab)
|
50439
50726
|
return;
|
50440
|
-
var
|
50441
|
-
|
50442
|
-
var newItem = new
|
50443
|
-
id:
|
50727
|
+
var locTitle = new _localizablestring__WEBPACK_IMPORTED_MODULE_2__["LocalizableString"](panel, true);
|
50728
|
+
locTitle.sharedData = this.locTemplateTabTitle;
|
50729
|
+
var newItem = new _actions_action__WEBPACK_IMPORTED_MODULE_11__["Action"]({
|
50730
|
+
id: panel.id,
|
50444
50731
|
css: "sv-tab-item__root",
|
50445
|
-
pressed:
|
50446
|
-
|
50732
|
+
pressed: this.getPanelIndexById(panel.id) === this.currentIndex,
|
50733
|
+
locTitle: locTitle,
|
50447
50734
|
action: function () {
|
50448
|
-
_this.currentIndex =
|
50735
|
+
_this.currentIndex = _this.getPanelIndexById(newItem.id);
|
50449
50736
|
_this.updateTabToolbarItemsPressedState();
|
50450
50737
|
}
|
50451
50738
|
});
|
50452
50739
|
return newItem;
|
50453
50740
|
};
|
50454
50741
|
QuestionPanelDynamicModel.prototype.getAdditionalTitleToolbarCss = function () {
|
50455
|
-
return new
|
50742
|
+
return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_10__["CssClassBuilder"]()
|
50456
50743
|
.append("sv-tabs-toolbar")
|
50457
50744
|
.append("sv-tabs-toolbar--left", this.tabAlign === "left")
|
50458
50745
|
.append("sv-tabs-toolbar--right", this.tabAlign === "right")
|
@@ -50460,10 +50747,12 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
50460
50747
|
.toString();
|
50461
50748
|
};
|
50462
50749
|
QuestionPanelDynamicModel.prototype.updateTabToolbarItemsPressedState = function () {
|
50463
|
-
var _this = this;
|
50464
50750
|
if (!this.isRenderModeTab)
|
50465
50751
|
return;
|
50466
|
-
this.
|
50752
|
+
if (this.currentIndex < 0 || this.currentIndex >= this.panels.length)
|
50753
|
+
return;
|
50754
|
+
var panel = this.panels[this.currentIndex];
|
50755
|
+
this.additionalTitleToolbar.renderedActions.forEach(function (action) { return action.pressed = action.id === panel.id; });
|
50467
50756
|
};
|
50468
50757
|
QuestionPanelDynamicModel.prototype.updateTabToolbar = function () {
|
50469
50758
|
var _this = this;
|
@@ -50485,8 +50774,7 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
50485
50774
|
if (!this.isRenderModeTab)
|
50486
50775
|
return;
|
50487
50776
|
panels.forEach(function (panel) {
|
50488
|
-
var
|
50489
|
-
var removedItem = _this.additionalTitleToolbar.getActionById(index.toString());
|
50777
|
+
var removedItem = _this.additionalTitleToolbar.getActionById(panel.id);
|
50490
50778
|
_this.additionalTitleToolbar.actions.splice(_this.additionalTitleToolbar.actions.indexOf(removedItem), 1);
|
50491
50779
|
});
|
50492
50780
|
this.updateTabToolbarItemsPressedState();
|
@@ -50500,12 +50788,12 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
50500
50788
|
});
|
50501
50789
|
QuestionPanelDynamicModel.maxCheckCount = 3;
|
50502
50790
|
__decorate([
|
50503
|
-
Object(
|
50791
|
+
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_5__["property"])({ defaultValue: false, onSet: function (_, target) { target.updateFooterActions(); } })
|
50504
50792
|
], QuestionPanelDynamicModel.prototype, "legacyNavigation", void 0);
|
50505
50793
|
return QuestionPanelDynamicModel;
|
50506
|
-
}(
|
50794
|
+
}(_question__WEBPACK_IMPORTED_MODULE_4__["Question"]));
|
50507
50795
|
|
50508
|
-
|
50796
|
+
_jsonobject__WEBPACK_IMPORTED_MODULE_5__["Serializer"].addClass("paneldynamic", [
|
50509
50797
|
{ name: "showCommentArea:switch", layout: "row", visible: true, category: "general" },
|
50510
50798
|
{
|
50511
50799
|
name: "templateElements",
|
@@ -50515,6 +50803,7 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_4__["Serializer"].addClass("paneldynamic",
|
|
50515
50803
|
isLightSerializable: false
|
50516
50804
|
},
|
50517
50805
|
{ name: "templateTitle:text", serializationProperty: "locTemplateTitle" },
|
50806
|
+
{ name: "templateTabTitle", serializationProperty: "locTemplateTabTitle", visibleIf: function (obj) { return obj.renderMode === "tab"; } },
|
50518
50807
|
{
|
50519
50808
|
name: "templateDescription:text",
|
50520
50809
|
serializationProperty: "locTemplateDescription",
|
@@ -50532,7 +50821,7 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_4__["Serializer"].addClass("paneldynamic",
|
|
50532
50821
|
{ name: "minPanelCount:number", default: 0, minValue: 0 },
|
50533
50822
|
{
|
50534
50823
|
name: "maxPanelCount:number",
|
50535
|
-
default:
|
50824
|
+
default: _settings__WEBPACK_IMPORTED_MODULE_8__["settings"].panelMaximumPanelCount,
|
50536
50825
|
},
|
50537
50826
|
"defaultPanelValue:panelvalue",
|
50538
50827
|
"defaultValueFromLastPanel:boolean",
|
@@ -50568,6 +50857,7 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_4__["Serializer"].addClass("paneldynamic",
|
|
50568
50857
|
},
|
50569
50858
|
{
|
50570
50859
|
name: "tabAlign", default: "center", choices: ["center", "left", "right"],
|
50860
|
+
visibleIf: function (obj) { return obj.renderMode === "tab"; }
|
50571
50861
|
},
|
50572
50862
|
{
|
50573
50863
|
name: "templateTitleLocation",
|
@@ -50582,7 +50872,7 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_4__["Serializer"].addClass("paneldynamic",
|
|
50582
50872
|
], function () {
|
50583
50873
|
return new QuestionPanelDynamicModel("");
|
50584
50874
|
}, "question");
|
50585
|
-
|
50875
|
+
_questionfactory__WEBPACK_IMPORTED_MODULE_6__["QuestionFactory"].Instance.registerQuestion("paneldynamic", function (name) {
|
50586
50876
|
return new QuestionPanelDynamicModel(name);
|
50587
50877
|
});
|
50588
50878
|
|
@@ -51191,6 +51481,9 @@ var RenderedRatingItem = /** @class */ (function (_super) {
|
|
51191
51481
|
__decorate([
|
51192
51482
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])({ defaultValue: "" })
|
51193
51483
|
], RenderedRatingItem.prototype, "text", void 0);
|
51484
|
+
__decorate([
|
51485
|
+
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])()
|
51486
|
+
], RenderedRatingItem.prototype, "style", void 0);
|
51194
51487
|
return RenderedRatingItem;
|
51195
51488
|
}(_base__WEBPACK_IMPORTED_MODULE_7__["Base"]));
|
51196
51489
|
|
@@ -51204,21 +51497,33 @@ var QuestionRatingModel = /** @class */ (function (_super) {
|
|
51204
51497
|
function QuestionRatingModel(name) {
|
51205
51498
|
var _this = _super.call(this, name) || this;
|
51206
51499
|
_this._syncPropertiesChanging = false;
|
51500
|
+
_this.initColors();
|
51207
51501
|
_this.createItemValues("rateValues");
|
51208
51502
|
_this.createRenderedRateItems();
|
51209
51503
|
_this.createLocalizableString("ratingOptionsCaption", _this, false, true);
|
51210
|
-
_this.registerFunctionOnPropertiesValueChanged(["rateMin", "rateMax",
|
51504
|
+
_this.registerFunctionOnPropertiesValueChanged(["rateMin", "rateMax",
|
51211
51505
|
"minRateDescription", "maxRateDescription", "rateStep", "displayRateDescriptionsAsExtremeItems"], function () { return _this.createRenderedRateItems(); });
|
51506
|
+
_this.registerFunctionOnPropertiesValueChanged(["rateDisplayMode"], function () {
|
51507
|
+
_this.setIconsToRateValues();
|
51508
|
+
_this.createRenderedRateItems();
|
51509
|
+
_this.updateRateCount();
|
51510
|
+
});
|
51212
51511
|
_this.registerFunctionOnPropertiesValueChanged(["rateValues"], function () {
|
51213
51512
|
_this.autoGenerate = false;
|
51513
|
+
_this.setIconsToRateValues();
|
51214
51514
|
_this.createRenderedRateItems();
|
51215
51515
|
});
|
51516
|
+
_this.registerFunctionOnPropertiesValueChanged(["rateColorMode", "scaleColorMode"], function () {
|
51517
|
+
_this.initColors();
|
51518
|
+
});
|
51216
51519
|
_this.registerFunctionOnPropertiesValueChanged(["autoGenerate"], function () {
|
51217
51520
|
if (!_this.autoGenerate && _this.rateValues.length === 0) {
|
51218
51521
|
_this.setPropertyValue("rateValues", _this.visibleRateValues);
|
51219
51522
|
}
|
51220
|
-
if (_this.autoGenerate)
|
51523
|
+
if (_this.autoGenerate) {
|
51524
|
+
_this.rateValues.length = 0;
|
51221
51525
|
_this.updateRateMax();
|
51526
|
+
}
|
51222
51527
|
_this.createRenderedRateItems();
|
51223
51528
|
});
|
51224
51529
|
_this.createLocalizableString("minRateDescription", _this, true);
|
@@ -51226,12 +51531,19 @@ var QuestionRatingModel = /** @class */ (function (_super) {
|
|
51226
51531
|
_this.initPropertyDependencies();
|
51227
51532
|
return _this;
|
51228
51533
|
}
|
51534
|
+
QuestionRatingModel.prototype.setIconsToRateValues = function () {
|
51535
|
+
var _this = this;
|
51536
|
+
if (this.rateType == "smileys") {
|
51537
|
+
this.rateValues.map(function (item) { return item.icon = _this.getItemSmiley(item); });
|
51538
|
+
}
|
51539
|
+
};
|
51229
51540
|
QuestionRatingModel.prototype.startLoadingFromJson = function (jsonObj) {
|
51230
51541
|
_super.prototype.startLoadingFromJson.call(this, jsonObj);
|
51231
51542
|
this.jsonObj = jsonObj;
|
51232
51543
|
};
|
51233
51544
|
QuestionRatingModel.prototype.endLoadingFromJson = function () {
|
51234
51545
|
_super.prototype.endLoadingFromJson.call(this);
|
51546
|
+
this.initColors();
|
51235
51547
|
this.hasMinRateDescription = !!this.minRateDescription;
|
51236
51548
|
this.hasMaxRateDescription = !!this.maxRateDescription;
|
51237
51549
|
if (this.jsonObj.rateMin !== undefined && this.jsonObj.rateCount !== undefined && this.jsonObj.rateMax === undefined) {
|
@@ -51243,6 +51555,7 @@ var QuestionRatingModel = /** @class */ (function (_super) {
|
|
51243
51555
|
if (this.jsonObj.autoGenerate === undefined && this.jsonObj.rateValues !== undefined)
|
51244
51556
|
this.autoGenerate = !this.jsonObj.rateValues.length;
|
51245
51557
|
this.updateRateCount();
|
51558
|
+
this.setIconsToRateValues();
|
51246
51559
|
this.createRenderedRateItems();
|
51247
51560
|
};
|
51248
51561
|
QuestionRatingModel.prototype.registerSychProperties = function (names, func) {
|
@@ -51265,12 +51578,19 @@ var QuestionRatingModel = /** @class */ (function (_super) {
|
|
51265
51578
|
this.rateMin = this.rateMax - this.rateStep * (this.rateCount - 1);
|
51266
51579
|
};
|
51267
51580
|
QuestionRatingModel.prototype.updateRateCount = function () {
|
51581
|
+
var newCount = 0;
|
51268
51582
|
if (this.useRateValues()) {
|
51269
|
-
|
51583
|
+
newCount = this.rateValues.length;
|
51270
51584
|
}
|
51271
51585
|
else {
|
51272
|
-
|
51586
|
+
newCount = Math.trunc((this.rateMax - this.rateMin) / (this.rateStep || 1)) + 1;
|
51273
51587
|
}
|
51588
|
+
if (newCount > 10 && this.rateDisplayMode == "smileys") {
|
51589
|
+
newCount = 10;
|
51590
|
+
}
|
51591
|
+
this.rateCount = newCount;
|
51592
|
+
if (this.rateValues.length > newCount)
|
51593
|
+
this.rateValues.length = newCount;
|
51274
51594
|
};
|
51275
51595
|
QuestionRatingModel.prototype.initPropertyDependencies = function () {
|
51276
51596
|
var _this = this;
|
@@ -51280,11 +51600,14 @@ var QuestionRatingModel = /** @class */ (function (_super) {
|
|
51280
51600
|
}
|
51281
51601
|
else {
|
51282
51602
|
if (_this.rateCount < _this.rateValues.length) {
|
51603
|
+
if (_this.rateCount >= 10 && _this.rateDisplayMode == "smileys")
|
51604
|
+
return;
|
51283
51605
|
_this.rateValues.splice(_this.rateCount, _this.rateValues.length - _this.rateCount);
|
51284
51606
|
}
|
51285
51607
|
else {
|
51286
|
-
for (var i = _this.rateValues.length; i < _this.rateCount; i++)
|
51287
|
-
_this.rateValues.push(new _itemvalue__WEBPACK_IMPORTED_MODULE_0__["ItemValue"](
|
51608
|
+
for (var i = _this.rateValues.length; i < _this.rateCount; i++) {
|
51609
|
+
_this.rateValues.push(new _itemvalue__WEBPACK_IMPORTED_MODULE_0__["ItemValue"](_surveyStrings__WEBPACK_IMPORTED_MODULE_5__["surveyLocalization"].getString("choices_Item") + (i + 1)));
|
51610
|
+
}
|
51288
51611
|
}
|
51289
51612
|
}
|
51290
51613
|
});
|
@@ -51378,6 +51701,39 @@ var QuestionRatingModel = /** @class */ (function (_super) {
|
|
51378
51701
|
enumerable: false,
|
51379
51702
|
configurable: true
|
51380
51703
|
});
|
51704
|
+
QuestionRatingModel.prototype.initColors = function () {
|
51705
|
+
if (this.colorMode === "monochrome")
|
51706
|
+
return;
|
51707
|
+
if (!document)
|
51708
|
+
return;
|
51709
|
+
if (QuestionRatingModel.badColor && QuestionRatingModel.normalColor && QuestionRatingModel.goodColor)
|
51710
|
+
return;
|
51711
|
+
function getRGBColor(varName) {
|
51712
|
+
var style = getComputedStyle(document.documentElement);
|
51713
|
+
var str = style.getPropertyValue && style.getPropertyValue(varName);
|
51714
|
+
if (!str)
|
51715
|
+
return null;
|
51716
|
+
var ctx = document.createElement("canvas").getContext("2d");
|
51717
|
+
ctx.fillStyle = str;
|
51718
|
+
var newStr = ctx.fillStyle;
|
51719
|
+
if (newStr.startsWith("rgba")) {
|
51720
|
+
return newStr.substring(5, newStr.length - 1).split(",").map(function (c) { return +(c.trim()); });
|
51721
|
+
}
|
51722
|
+
var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(newStr);
|
51723
|
+
return result ? [
|
51724
|
+
parseInt(result[1], 16),
|
51725
|
+
parseInt(result[2], 16),
|
51726
|
+
parseInt(result[3], 16),
|
51727
|
+
1
|
51728
|
+
] : null;
|
51729
|
+
}
|
51730
|
+
QuestionRatingModel.badColor = getRGBColor("--sd-rating-bad-color");
|
51731
|
+
QuestionRatingModel.normalColor = getRGBColor("--sd-rating-normal-color");
|
51732
|
+
QuestionRatingModel.goodColor = getRGBColor("--sd-rating-good-color");
|
51733
|
+
QuestionRatingModel.badColorLight = getRGBColor("--sd-rating-bad-color-light");
|
51734
|
+
QuestionRatingModel.normalColorLight = getRGBColor("--sd-rating-normal-color-light");
|
51735
|
+
QuestionRatingModel.goodColorLight = getRGBColor("--sd-rating-good-color-light");
|
51736
|
+
};
|
51381
51737
|
QuestionRatingModel.prototype.getDisplayValueCore = function (keysAsText, value) {
|
51382
51738
|
var res = _itemvalue__WEBPACK_IMPORTED_MODULE_0__["ItemValue"].getTextOrHtmlByValue(this.visibleRateValues, value);
|
51383
51739
|
return !!res ? res : value;
|
@@ -51417,13 +51773,16 @@ var QuestionRatingModel = /** @class */ (function (_super) {
|
|
51417
51773
|
if (this.rateType == "smileys" && rateValues.length > 10)
|
51418
51774
|
rateValues = rateValues.slice(0, 10);
|
51419
51775
|
this.renderedRateItems = rateValues.map(function (v, i) {
|
51776
|
+
var renderedItem = null;
|
51420
51777
|
if (_this.displayRateDescriptionsAsExtremeItems) {
|
51421
51778
|
if (i == 0)
|
51422
|
-
|
51779
|
+
renderedItem = new RenderedRatingItem(v, _this.minRateDescription && _this.locMinRateDescription || v.locText);
|
51423
51780
|
if (i == rateValues.length - 1)
|
51424
|
-
|
51781
|
+
renderedItem = new RenderedRatingItem(v, _this.maxRateDescription && _this.locMaxRateDescription || v.locText);
|
51425
51782
|
}
|
51426
|
-
|
51783
|
+
if (!renderedItem)
|
51784
|
+
renderedItem = new RenderedRatingItem(v);
|
51785
|
+
return renderedItem;
|
51427
51786
|
});
|
51428
51787
|
};
|
51429
51788
|
QuestionRatingModel.prototype.correctValue = function (value, step) {
|
@@ -51564,12 +51923,19 @@ var QuestionRatingModel = /** @class */ (function (_super) {
|
|
51564
51923
|
else {
|
51565
51924
|
this.value = value;
|
51566
51925
|
}
|
51926
|
+
for (var i = 0; i < this.renderedRateItems.length; i++) {
|
51927
|
+
this.renderedRateItems[i].highlight = "none";
|
51928
|
+
}
|
51567
51929
|
};
|
51568
51930
|
QuestionRatingModel.prototype.onItemMouseIn = function (item) {
|
51569
|
-
if (this.isReadOnly || !item.itemValue.isEnabled)
|
51931
|
+
if (this.isReadOnly || !item.itemValue.isEnabled || this.isDesignMode)
|
51570
51932
|
return;
|
51571
51933
|
var high = true;
|
51572
51934
|
var selected = this.value != null;
|
51935
|
+
if (this.rateType !== "stars") {
|
51936
|
+
item.highlight = "highlighted";
|
51937
|
+
return;
|
51938
|
+
}
|
51573
51939
|
for (var i = 0; i < this.renderedRateItems.length; i++) {
|
51574
51940
|
this.renderedRateItems[i].highlight = high && !selected && "highlighted" || !high && selected && "unhighlighted" || "none";
|
51575
51941
|
if (this.renderedRateItems[i] == item)
|
@@ -51605,6 +51971,49 @@ var QuestionRatingModel = /** @class */ (function (_super) {
|
|
51605
51971
|
QuestionRatingModel.prototype.getItemSmileyIconName = function (item) {
|
51606
51972
|
return "icon-" + this.getItemSmiley(item);
|
51607
51973
|
};
|
51974
|
+
QuestionRatingModel.prototype.getItemClassByText = function (item, text) {
|
51975
|
+
return this.getItemClass(item);
|
51976
|
+
};
|
51977
|
+
QuestionRatingModel.prototype.getRenderedItemColor = function (index, light) {
|
51978
|
+
var startColor = light ? QuestionRatingModel.badColorLight : QuestionRatingModel.badColor;
|
51979
|
+
var endColor = light ? QuestionRatingModel.goodColorLight : QuestionRatingModel.goodColor;
|
51980
|
+
var normalIndex = (this.rateCount - 1) / 2.0;
|
51981
|
+
var middleColor = light ? QuestionRatingModel.normalColorLight : QuestionRatingModel.normalColor;
|
51982
|
+
if (index < normalIndex) {
|
51983
|
+
endColor = middleColor;
|
51984
|
+
}
|
51985
|
+
else {
|
51986
|
+
startColor = middleColor;
|
51987
|
+
index -= normalIndex;
|
51988
|
+
}
|
51989
|
+
if (!startColor || !endColor)
|
51990
|
+
return null;
|
51991
|
+
var curColor = [0, 0, 0, 0];
|
51992
|
+
for (var i = 0; i < 4; i++) {
|
51993
|
+
curColor[i] = startColor[i] + (endColor[i] - startColor[i]) * index / normalIndex;
|
51994
|
+
if (i < 3)
|
51995
|
+
curColor[i] = Math.trunc(curColor[i]);
|
51996
|
+
}
|
51997
|
+
return "rgba(" + curColor[0] + ", " + curColor[1] + ", " + curColor[2] + ", " + curColor[3] + ")";
|
51998
|
+
};
|
51999
|
+
QuestionRatingModel.prototype.getItemStyle = function (item, highlight) {
|
52000
|
+
if (highlight === void 0) { highlight = "none"; }
|
52001
|
+
if (this.scaleColorMode === "monochrome" && this.rateColorMode == "default")
|
52002
|
+
return { borderColor: null, fill: null, backgroundColor: null };
|
52003
|
+
var index = this.visibleRateValues.indexOf(item);
|
52004
|
+
var color = this.getRenderedItemColor(index, false);
|
52005
|
+
if (this.value != this.renderedRateItems[index].value) {
|
52006
|
+
var colorLight = this.getRenderedItemColor(index, true);
|
52007
|
+
if (highlight == "highlighted" && this.scaleColorMode === "colored")
|
52008
|
+
return { borderColor: color, fill: color, backgroundColor: colorLight };
|
52009
|
+
if (this.scaleColorMode === "colored" && this.errors.length == 0)
|
52010
|
+
return { borderColor: color, fill: color, backgroundColor: null };
|
52011
|
+
return { borderColor: null, fill: null, backgroundColor: null };
|
52012
|
+
}
|
52013
|
+
else {
|
52014
|
+
return { borderColor: color, fill: null, backgroundColor: color };
|
52015
|
+
}
|
52016
|
+
};
|
51608
52017
|
QuestionRatingModel.prototype.getItemClass = function (item, highlight) {
|
51609
52018
|
var _this = this;
|
51610
52019
|
if (highlight === void 0) { highlight = "none"; }
|
@@ -51629,6 +52038,8 @@ var QuestionRatingModel = /** @class */ (function (_super) {
|
|
51629
52038
|
var itemitemOnErrorClass = this.cssClasses.itemOnError;
|
51630
52039
|
var itemHighlightedClass = null;
|
51631
52040
|
var itemUnhighlightedClass = null;
|
52041
|
+
var itemScaleColoredClass = null;
|
52042
|
+
var itemRateColoredClass = null;
|
51632
52043
|
if (this.isStar) {
|
51633
52044
|
itemClass = this.cssClasses.itemStar;
|
51634
52045
|
itemSelectedClass = this.cssClasses.itemStarSelected;
|
@@ -51644,6 +52055,9 @@ var QuestionRatingModel = /** @class */ (function (_super) {
|
|
51644
52055
|
itemDisabledClass = this.cssClasses.itemSmileyDisabled;
|
51645
52056
|
itemHoverClass = this.cssClasses.itemSmileyHover;
|
51646
52057
|
itemitemOnErrorClass = this.cssClasses.itemSmileyOnError;
|
52058
|
+
itemHighlightedClass = this.cssClasses.itemSmileyHighlighted;
|
52059
|
+
itemScaleColoredClass = this.cssClasses.itemSmileyScaleColored;
|
52060
|
+
itemRateColoredClass = this.cssClasses.itemSmileyRateColored;
|
51647
52061
|
}
|
51648
52062
|
var hasFixedSize = !this.isStar &&
|
51649
52063
|
!this.isSmiley &&
|
@@ -51658,6 +52072,8 @@ var QuestionRatingModel = /** @class */ (function (_super) {
|
|
51658
52072
|
.append(itemDisabledClass, this.isReadOnly)
|
51659
52073
|
.append(itemHoverClass, allowHover)
|
51660
52074
|
.append(itemHighlightedClass, isHighlighted)
|
52075
|
+
.append(itemScaleColoredClass, this.scaleColorMode == "colored")
|
52076
|
+
.append(itemRateColoredClass, this.rateColorMode == "scale" && isSelected)
|
51661
52077
|
.append(itemUnhighlightedClass, isUnhighlighted)
|
51662
52078
|
.append(itemitemOnErrorClass, this.errors.length > 0)
|
51663
52079
|
.append(this.cssClasses.itemFixedSize, hasFixedSize)
|
@@ -51777,6 +52193,12 @@ var QuestionRatingModel = /** @class */ (function (_super) {
|
|
51777
52193
|
}
|
51778
52194
|
return classes;
|
51779
52195
|
};
|
52196
|
+
QuestionRatingModel.prototype.dispose = function () {
|
52197
|
+
_super.prototype.dispose.call(this);
|
52198
|
+
if (!!this.dropdownListModelValue) {
|
52199
|
+
this.dropdownListModelValue.dispose();
|
52200
|
+
}
|
52201
|
+
};
|
51780
52202
|
__decorate([
|
51781
52203
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])({ defaultValue: true })
|
51782
52204
|
], QuestionRatingModel.prototype, "autoGenerate", void 0);
|
@@ -51815,7 +52237,10 @@ var QuestionRatingModel = /** @class */ (function (_super) {
|
|
51815
52237
|
], QuestionRatingModel.prototype, "rateDisplayMode", void 0);
|
51816
52238
|
__decorate([
|
51817
52239
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])({ defaultValue: "monochrome" })
|
51818
|
-
], QuestionRatingModel.prototype, "
|
52240
|
+
], QuestionRatingModel.prototype, "scaleColorMode", void 0);
|
52241
|
+
__decorate([
|
52242
|
+
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])({ defaultValue: "scale" })
|
52243
|
+
], QuestionRatingModel.prototype, "rateColorMode", void 0);
|
51819
52244
|
return QuestionRatingModel;
|
51820
52245
|
}(_question__WEBPACK_IMPORTED_MODULE_1__["Question"]));
|
51821
52246
|
|
@@ -51829,19 +52254,47 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_2__["Serializer"].addClass("rating", [
|
|
51829
52254
|
choices: ["labels", "stars", "smileys"],
|
51830
52255
|
visibleIndex: 0
|
51831
52256
|
},
|
52257
|
+
{
|
52258
|
+
name: "scaleColorMode",
|
52259
|
+
category: "rateValues",
|
52260
|
+
default: "monochrome",
|
52261
|
+
choices: ["monochrome", "colored"],
|
52262
|
+
visibleIf: function (obj) {
|
52263
|
+
return obj.rateDisplayMode == "smileys";
|
52264
|
+
},
|
52265
|
+
visibleIndex: 1
|
52266
|
+
},
|
52267
|
+
{
|
52268
|
+
name: "rateColorMode",
|
52269
|
+
category: "rateValues",
|
52270
|
+
default: "scale",
|
52271
|
+
choices: ["default", "scale"],
|
52272
|
+
visibleIf: function (obj) {
|
52273
|
+
return obj.rateDisplayMode == "smileys" && obj.scaleColorMode == "monochrome";
|
52274
|
+
},
|
52275
|
+
visibleIndex: 2
|
52276
|
+
},
|
51832
52277
|
{
|
51833
52278
|
name: "autoGenerate",
|
51834
|
-
displayName: "How to specify rate values?",
|
51835
52279
|
category: "rateValues",
|
51836
52280
|
default: true,
|
51837
52281
|
choices: [{ value: true, text: "Generate" }, { value: false, text: "Enter manually" }],
|
51838
|
-
visibleIndex:
|
52282
|
+
visibleIndex: 4
|
51839
52283
|
},
|
51840
52284
|
{
|
51841
52285
|
name: "rateCount:number",
|
51842
52286
|
default: 5,
|
51843
52287
|
category: "rateValues",
|
51844
|
-
visibleIndex:
|
52288
|
+
visibleIndex: 3,
|
52289
|
+
onSettingValue: function (obj, val) {
|
52290
|
+
if (val < 2)
|
52291
|
+
return 2;
|
52292
|
+
if (val > _settings__WEBPACK_IMPORTED_MODULE_4__["settings"].ratingMaximumRateValueCount && val > obj.rateValues.length)
|
52293
|
+
return _settings__WEBPACK_IMPORTED_MODULE_4__["settings"].ratingMaximumRateValueCount;
|
52294
|
+
if (val > 10 && obj.rateDisplayMode == "smileys")
|
52295
|
+
return 10;
|
52296
|
+
return val;
|
52297
|
+
},
|
51845
52298
|
},
|
51846
52299
|
{
|
51847
52300
|
name: "rateValues:itemvalue[]",
|
@@ -51852,7 +52305,7 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_2__["Serializer"].addClass("rating", [
|
|
51852
52305
|
visibleIf: function (obj) {
|
51853
52306
|
return !obj.autoGenerate;
|
51854
52307
|
},
|
51855
|
-
visibleIndex:
|
52308
|
+
visibleIndex: 5
|
51856
52309
|
},
|
51857
52310
|
{
|
51858
52311
|
name: "rateMin:number", default: 1,
|
@@ -51862,7 +52315,7 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_2__["Serializer"].addClass("rating", [
|
|
51862
52315
|
visibleIf: function (obj) {
|
51863
52316
|
return !!obj.autoGenerate;
|
51864
52317
|
},
|
51865
|
-
visibleIndex:
|
52318
|
+
visibleIndex: 6
|
51866
52319
|
},
|
51867
52320
|
{
|
51868
52321
|
name: "rateMax:number", default: 5,
|
@@ -51872,7 +52325,7 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_2__["Serializer"].addClass("rating", [
|
|
51872
52325
|
visibleIf: function (obj) {
|
51873
52326
|
return !!obj.autoGenerate;
|
51874
52327
|
},
|
51875
|
-
visibleIndex:
|
52328
|
+
visibleIndex: 7
|
51876
52329
|
},
|
51877
52330
|
{
|
51878
52331
|
name: "rateStep:number", default: 1, minValue: 0.1,
|
@@ -51886,7 +52339,7 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_2__["Serializer"].addClass("rating", [
|
|
51886
52339
|
visibleIf: function (obj) {
|
51887
52340
|
return !!obj.autoGenerate;
|
51888
52341
|
},
|
51889
|
-
visibleIndex:
|
52342
|
+
visibleIndex: 8
|
51890
52343
|
},
|
51891
52344
|
{
|
51892
52345
|
name: "minRateDescription",
|
@@ -51906,7 +52359,7 @@ _jsonobject__WEBPACK_IMPORTED_MODULE_2__["Serializer"].addClass("rating", [
|
|
51906
52359
|
default: "auto",
|
51907
52360
|
choices: ["auto", "buttons", "dropdown"],
|
51908
52361
|
visibleIndex: 20
|
51909
|
-
}
|
52362
|
+
}
|
51910
52363
|
], function () {
|
51911
52364
|
return new QuestionRatingModel("");
|
51912
52365
|
}, "question");
|
@@ -52408,6 +52861,13 @@ var QuestionTagboxModel = /** @class */ (function (_super) {
|
|
52408
52861
|
}
|
52409
52862
|
return _super.prototype.hasUnknownValue.call(this, val, includeOther, isFilteredChoices, checkEmptyValue);
|
52410
52863
|
};
|
52864
|
+
QuestionTagboxModel.prototype.needConvertRenderedOtherToDataValue = function () {
|
52865
|
+
var _a;
|
52866
|
+
var val = (_a = this.otherValue) === null || _a === void 0 ? void 0 : _a.trim();
|
52867
|
+
if (!val)
|
52868
|
+
return false;
|
52869
|
+
return _super.prototype.hasUnknownValue.call(this, val, true, false);
|
52870
|
+
};
|
52411
52871
|
QuestionTagboxModel.prototype.onVisibleChoicesChanged = function () {
|
52412
52872
|
_super.prototype.onVisibleChoicesChanged.call(this);
|
52413
52873
|
if (this.popupModel) {
|
@@ -52445,6 +52905,16 @@ var QuestionTagboxModel = /** @class */ (function (_super) {
|
|
52445
52905
|
QuestionTagboxModel.prototype.getInputId = function () {
|
52446
52906
|
return this.inputId + "_0";
|
52447
52907
|
};
|
52908
|
+
QuestionTagboxModel.prototype.dispose = function () {
|
52909
|
+
_super.prototype.dispose.call(this);
|
52910
|
+
if (!!this.dropdownListModelValue) {
|
52911
|
+
this.dropdownListModelValue.dispose();
|
52912
|
+
}
|
52913
|
+
};
|
52914
|
+
QuestionTagboxModel.prototype.clearValue = function () {
|
52915
|
+
_super.prototype.clearValue.call(this);
|
52916
|
+
this.dropdownListModel.clear();
|
52917
|
+
};
|
52448
52918
|
__decorate([
|
52449
52919
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_0__["property"])()
|
52450
52920
|
], QuestionTagboxModel.prototype, "allowClear", void 0);
|
@@ -52635,7 +53105,7 @@ var QuestionTextModel = /** @class */ (function (_super) {
|
|
52635
53105
|
},
|
52636
53106
|
set: function (val) {
|
52637
53107
|
val = val.toLowerCase();
|
52638
|
-
if (val
|
53108
|
+
if (val === "datetime_local" || val === "datetime")
|
52639
53109
|
val = "datetime-local";
|
52640
53110
|
this.setPropertyValue("inputType", val.toLowerCase());
|
52641
53111
|
if (!this.isLoadingFromJson) {
|
@@ -52895,8 +53365,7 @@ var QuestionTextModel = /** @class */ (function (_super) {
|
|
52895
53365
|
return isValid;
|
52896
53366
|
};
|
52897
53367
|
QuestionTextModel.prototype.convertFuncValuetoQuestionValue = function (val) {
|
52898
|
-
|
52899
|
-
return _helpers__WEBPACK_IMPORTED_MODULE_3__["Helpers"].convertValToQuestionVal(val, inpuType);
|
53368
|
+
return _helpers__WEBPACK_IMPORTED_MODULE_3__["Helpers"].convertValToQuestionVal(val, this.inputType);
|
52900
53369
|
};
|
52901
53370
|
QuestionTextModel.prototype.getMinMaxErrorText = function (errorText, value) {
|
52902
53371
|
if (_helpers__WEBPACK_IMPORTED_MODULE_3__["Helpers"].isValueEmpty(value))
|
@@ -52980,10 +53449,10 @@ var QuestionTextModel = /** @class */ (function (_super) {
|
|
52980
53449
|
configurable: true
|
52981
53450
|
});
|
52982
53451
|
QuestionTextModel.prototype.supportGoNextPageAutomatic = function () {
|
52983
|
-
return ["date", "datetime
|
53452
|
+
return ["date", "datetime-local"].indexOf(this.inputType) < 0;
|
52984
53453
|
};
|
52985
53454
|
QuestionTextModel.prototype.supportGoNextPageError = function () {
|
52986
|
-
return ["date", "datetime
|
53455
|
+
return ["date", "datetime-local"].indexOf(this.inputType) < 0;
|
52987
53456
|
};
|
52988
53457
|
Object.defineProperty(QuestionTextModel.prototype, "dataList", {
|
52989
53458
|
/**
|
@@ -53057,7 +53526,6 @@ var minMaxTypes = [
|
|
53057
53526
|
"number",
|
53058
53527
|
"range",
|
53059
53528
|
"date",
|
53060
|
-
"datetime",
|
53061
53529
|
"datetime-local",
|
53062
53530
|
"month",
|
53063
53531
|
"time",
|
@@ -53934,12 +54402,14 @@ var SurveyQuestionBoolean = /** @class */ (function (_super) {
|
|
53934
54402
|
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("input", { ref: this.checkRef, type: "checkbox", name: this.question.name, value: this.question.booleanValue === null
|
53935
54403
|
? ""
|
53936
54404
|
: this.question.booleanValue, id: this.question.inputId, className: cssClasses.control, disabled: this.isDisplayMode, checked: this.question.booleanValue || false, onChange: this.handleOnChange, "aria-required": this.question.ariaRequired, "aria-label": this.question.ariaLabel, "aria-invalid": this.question.ariaInvalid, "aria-describedby": this.question.ariaDescribedBy }),
|
53937
|
-
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("
|
54405
|
+
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: cssClasses.sliderGhost, onClick: function (event) { return _this.handleOnLabelClick(event, false); } },
|
54406
|
+
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", { className: this.question.getLabelCss(false) }, this.renderLocString(this.question.locLabelFalse))),
|
53938
54407
|
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: cssClasses.switch, onClick: this.handleOnSwitchClick },
|
53939
54408
|
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", { className: cssClasses.slider }, this.question.isDeterminated && cssClasses.sliderText ?
|
53940
54409
|
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", { className: cssClasses.sliderText }, this.renderLocString(this.question.getCheckedLabel()))
|
53941
54410
|
: null)),
|
53942
|
-
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("
|
54411
|
+
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: cssClasses.sliderGhost, onClick: function (event) { return _this.handleOnLabelClick(event, true); } },
|
54412
|
+
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", { className: this.question.getLabelCss(true) }, this.renderLocString(this.question.locLabelTrue))))));
|
53943
54413
|
};
|
53944
54414
|
return SurveyQuestionBoolean;
|
53945
54415
|
}(_reactquestion_element__WEBPACK_IMPORTED_MODULE_1__["SurveyQuestionElementBase"]));
|
@@ -54120,7 +54590,7 @@ var SurveyActionBarItem = /** @class */ (function (_super) {
|
|
54120
54590
|
var title = this.item.tooltip || this.item.title;
|
54121
54591
|
var buttonContent = this.renderButtonContent();
|
54122
54592
|
var tabIndex = this.item.disableTabStop ? -1 : undefined;
|
54123
|
-
var button = Object(_reactSurvey__WEBPACK_IMPORTED_MODULE_3__["attachKey2click"])(react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("button", { className: className, type: "button", disabled: this.item.disabled, onClick: function () { return _this.item.action(_this.item); }, title: title, tabIndex: tabIndex, "aria-checked": this.item.ariaChecked, "aria-expanded": this.item.ariaExpanded, role: this.item.ariaRole }, buttonContent), null, { processEsc: false });
|
54593
|
+
var button = Object(_reactSurvey__WEBPACK_IMPORTED_MODULE_3__["attachKey2click"])(react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("button", { className: className, type: "button", disabled: this.item.disabled, onClick: function (args) { return _this.item.action(_this.item, _this.item.getIsTrusted(args)); }, title: title, tabIndex: tabIndex, "aria-checked": this.item.ariaChecked, "aria-expanded": this.item.ariaExpanded, role: this.item.ariaRole }, buttonContent), null, { processEsc: false });
|
54124
54594
|
return button;
|
54125
54595
|
};
|
54126
54596
|
return SurveyActionBarItem;
|
@@ -55661,7 +56131,7 @@ var RatingItemSmiley = /** @class */ (function (_super) {
|
|
55661
56131
|
};
|
55662
56132
|
RatingItemSmiley.prototype.render = function () {
|
55663
56133
|
var _this = this;
|
55664
|
-
return (react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", { className: this.question.getItemClass(this.item.itemValue), onMouseOver: function (e) { return _this.question.onItemMouseIn(_this.item); }, onMouseOut: function (e) { return _this.question.onItemMouseOut(_this.item); } },
|
56134
|
+
return (react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", { style: this.question.getItemStyle(this.item.itemValue, this.item.highlight), className: this.question.getItemClass(this.item.itemValue), onMouseOver: function (e) { return _this.question.onItemMouseIn(_this.item); }, onMouseOut: function (e) { return _this.question.onItemMouseOut(_this.item); } },
|
55665
56135
|
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 }),
|
55666
56136
|
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_svg_icon_svg_icon__WEBPACK_IMPORTED_MODULE_3__["SvgIcon"], { size: "auto", iconName: this.question.getItemSmileyIconName(this.item.itemValue), title: this.item.text })));
|
55667
56137
|
};
|
@@ -55818,7 +56288,7 @@ var RatingItem = /** @class */ (function (_super) {
|
|
55818
56288
|
};
|
55819
56289
|
RatingItem.prototype.render = function () {
|
55820
56290
|
var itemText = this.renderLocString(this.item.locText);
|
55821
|
-
return (react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", { className: this.question.
|
56291
|
+
return (react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", { className: this.question.getItemClassByText(this.item.itemValue, this.item.text) },
|
55822
56292
|
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 }),
|
55823
56293
|
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", { className: this.question.cssClasses.itemText }, itemText)));
|
55824
56294
|
};
|
@@ -59691,7 +60161,7 @@ var SurveyElementBase = /** @class */ (function (_super) {
|
|
59691
60161
|
};
|
59692
60162
|
SurveyElementBase.renderQuestionDescription = function (question) {
|
59693
60163
|
var descriptionText = SurveyElementBase.renderLocString(question.locDescription);
|
59694
|
-
return react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: question.cssDescription }, descriptionText);
|
60164
|
+
return react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { style: question.isDescriptionVisible ? undefined : { display: "none" }, className: question.cssDescription }, descriptionText);
|
59695
60165
|
};
|
59696
60166
|
SurveyElementBase.prototype.componentDidMount = function () {
|
59697
60167
|
this.makeBaseElementsReact();
|
@@ -63317,11 +63787,11 @@ var settings = {
|
|
63317
63787
|
imagepicker: ["answercount"],
|
63318
63788
|
},
|
63319
63789
|
/**
|
63320
|
-
* 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"
|
63790
|
+
* 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"`.
|
63321
63791
|
*/
|
63322
63792
|
minDate: "",
|
63323
63793
|
/**
|
63324
|
-
* 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"
|
63794
|
+
* 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"`.
|
63325
63795
|
*/
|
63326
63796
|
maxDate: "",
|
63327
63797
|
showModal: undefined,
|
@@ -63358,7 +63828,6 @@ var settings = {
|
|
63358
63828
|
inputTypes: [
|
63359
63829
|
"color",
|
63360
63830
|
"date",
|
63361
|
-
"datetime",
|
63362
63831
|
"datetime-local",
|
63363
63832
|
"email",
|
63364
63833
|
"month",
|
@@ -64829,6 +65298,13 @@ var SurveyElement = /** @class */ (function (_super) {
|
|
64829
65298
|
SurveyElement.prototype.shouldAddRunnerStyles = function () {
|
64830
65299
|
return !this.isDesignMode && this.isDefaultV2Theme;
|
64831
65300
|
};
|
65301
|
+
Object.defineProperty(SurveyElement.prototype, "isCompact", {
|
65302
|
+
get: function () {
|
65303
|
+
return this.survey && this.survey["isCompact"];
|
65304
|
+
},
|
65305
|
+
enumerable: false,
|
65306
|
+
configurable: true
|
65307
|
+
});
|
64832
65308
|
SurveyElement.prototype.getHasFrameV2 = function () {
|
64833
65309
|
return this.shouldAddRunnerStyles() && (!this.hasParent && this.isSingleInRow);
|
64834
65310
|
};
|
@@ -64837,7 +65313,8 @@ var SurveyElement = /** @class */ (function (_super) {
|
|
64837
65313
|
};
|
64838
65314
|
SurveyElement.prototype.getCssRoot = function (cssClasses) {
|
64839
65315
|
return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_6__["CssClassBuilder"]()
|
64840
|
-
.append(cssClasses.withFrame, this.getHasFrameV2())
|
65316
|
+
.append(cssClasses.withFrame, this.getHasFrameV2() && !this.isCompact)
|
65317
|
+
.append(cssClasses.compact, this.isCompact && this.getHasFrameV2())
|
64841
65318
|
.append(cssClasses.collapsed, !!this.isCollapsed)
|
64842
65319
|
.append(cssClasses.expanded, !!this.isExpanded)
|
64843
65320
|
.append(cssClasses.nested, this.getIsNested())
|
@@ -64970,6 +65447,13 @@ var SurveyElement = /** @class */ (function (_super) {
|
|
64970
65447
|
enumerable: false,
|
64971
65448
|
configurable: true
|
64972
65449
|
});
|
65450
|
+
Object.defineProperty(SurveyElement.prototype, "isDescriptionVisible", {
|
65451
|
+
get: function () {
|
65452
|
+
return (!!this.description || this.isDesignMode);
|
65453
|
+
},
|
65454
|
+
enumerable: false,
|
65455
|
+
configurable: true
|
65456
|
+
});
|
64973
65457
|
Object.defineProperty(SurveyElement.prototype, "rootStyle", {
|
64974
65458
|
get: function () {
|
64975
65459
|
var style = {};
|
@@ -65844,6 +66328,7 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
65844
66328
|
_this.hideRequiredErrors = false;
|
65845
66329
|
//#endregion
|
65846
66330
|
_this._isMobile = false;
|
66331
|
+
_this._isCompact = false;
|
65847
66332
|
_this._isDesignMode = false;
|
65848
66333
|
/**
|
65849
66334
|
* Gets or sets whether the survey must ignore validation like required questions and others, on `nextPage` and `completeLastPage` function calls. The default is `false`.
|
@@ -67217,6 +67702,19 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
67217
67702
|
enumerable: false,
|
67218
67703
|
configurable: true
|
67219
67704
|
});
|
67705
|
+
Object.defineProperty(SurveyModel.prototype, "isCompact", {
|
67706
|
+
get: function () {
|
67707
|
+
return this._isCompact;
|
67708
|
+
},
|
67709
|
+
set: function (newVal) {
|
67710
|
+
if (newVal !== this._isCompact) {
|
67711
|
+
this._isCompact = newVal;
|
67712
|
+
this.updateElementCss();
|
67713
|
+
}
|
67714
|
+
},
|
67715
|
+
enumerable: false,
|
67716
|
+
configurable: true
|
67717
|
+
});
|
67220
67718
|
SurveyModel.prototype.isLogoImageChoosen = function () {
|
67221
67719
|
return this.locLogo.renderedHtml;
|
67222
67720
|
};
|
@@ -68795,7 +69293,7 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
68795
69293
|
if (!page)
|
68796
69294
|
return "none";
|
68797
69295
|
if (page.navigationButtonsVisibility === "show") {
|
68798
|
-
return "bottom";
|
69296
|
+
return this.showNavigationButtons === "none" ? "bottom" : this.showNavigationButtons;
|
68799
69297
|
}
|
68800
69298
|
if (page.navigationButtonsVisibility === "hide") {
|
68801
69299
|
return "none";
|
@@ -71927,6 +72425,12 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
71927
72425
|
SurveyModel.prototype.getInCorrectAnswerCount = function () {
|
71928
72426
|
return this.getCorrectedAnswerCountCore(false);
|
71929
72427
|
};
|
72428
|
+
SurveyModel.prototype.onCorrectQuestionAnswer = function (question, options) {
|
72429
|
+
if (this.onIsAnswerCorrect.isEmpty)
|
72430
|
+
return;
|
72431
|
+
options.question = question;
|
72432
|
+
this.onIsAnswerCorrect.fire(this, options);
|
72433
|
+
};
|
71930
72434
|
SurveyModel.prototype.getCorrectedAnswerCountCore = function (isCorrect) {
|
71931
72435
|
var questions = this.getQuizQuestions();
|
71932
72436
|
var counter = 0;
|
@@ -72521,12 +73025,12 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
72521
73025
|
}
|
72522
73026
|
else if (isStrCiEqual(layoutElement.id, "navigationbuttons")) {
|
72523
73027
|
if (container === "contentTop") {
|
72524
|
-
if (["top", "both"].indexOf(this.
|
73028
|
+
if (["top", "both"].indexOf(this.isNavigationButtonsShowing) !== -1) {
|
72525
73029
|
containerLayoutElements.push(layoutElement);
|
72526
73030
|
}
|
72527
73031
|
}
|
72528
73032
|
if (container === "contentBottom") {
|
72529
|
-
if (["bottom", "both"].indexOf(this.
|
73033
|
+
if (["bottom", "both"].indexOf(this.isNavigationButtonsShowing) !== -1) {
|
72530
73034
|
containerLayoutElements.push(layoutElement);
|
72531
73035
|
}
|
72532
73036
|
}
|
@@ -72585,6 +73089,9 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
72585
73089
|
__decorate([
|
72586
73090
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])()
|
72587
73091
|
], SurveyModel.prototype, "_isMobile", void 0);
|
73092
|
+
__decorate([
|
73093
|
+
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])()
|
73094
|
+
], SurveyModel.prototype, "_isCompact", void 0);
|
72588
73095
|
__decorate([
|
72589
73096
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])()
|
72590
73097
|
], SurveyModel.prototype, "renderBackgroundImage", void 0);
|