survey-react 1.12.16 → 1.12.17
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 +1 -1
- package/defaultV2.min.css +1 -1
- package/modern.css +1 -1
- package/modern.min.css +1 -1
- package/package.json +1 -1
- package/survey.css +1 -1
- package/survey.min.css +1 -1
- package/survey.react.d.ts +93 -39
- package/survey.react.js +157 -80
- 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.12.
|
2
|
+
* surveyjs - Survey JavaScript library v1.12.17
|
3
3
|
* Copyright (c) 2015-2024 Devsoft Baltic OÜ - http://surveyjs.io/
|
4
4
|
* License: MIT (http://www.opensource.org/licenses/mit-license.php)
|
5
5
|
*/
|
@@ -11898,13 +11898,13 @@ var list_ListModel = /** @class */ (function (_super) {
|
|
11898
11898
|
var _this = this;
|
11899
11899
|
this.isEmpty = this.renderedActions.filter(function (action) { return _this.isItemVisible(action); }).length === 0;
|
11900
11900
|
};
|
11901
|
-
ListModel.prototype.scrollToItem = function (
|
11901
|
+
ListModel.prototype.scrollToItem = function (classes, ms) {
|
11902
11902
|
var _this = this;
|
11903
11903
|
if (ms === void 0) { ms = 0; }
|
11904
11904
|
setTimeout(function () {
|
11905
11905
|
if (!_this.listContainerHtmlElement)
|
11906
11906
|
return;
|
11907
|
-
var item = _this.listContainerHtmlElement.querySelector(
|
11907
|
+
var item = _this.listContainerHtmlElement.querySelector(classesToSelector(classes));
|
11908
11908
|
if (item) {
|
11909
11909
|
setTimeout(function () {
|
11910
11910
|
item.scrollIntoView({ behavior: "smooth", block: "nearest", inline: "start" });
|
@@ -11972,7 +11972,7 @@ var list_ListModel = /** @class */ (function (_super) {
|
|
11972
11972
|
});
|
11973
11973
|
Object.defineProperty(ListModel.prototype, "scrollableContainer", {
|
11974
11974
|
get: function () {
|
11975
|
-
return this.listContainerHtmlElement.querySelector(
|
11975
|
+
return this.listContainerHtmlElement.querySelector(classesToSelector(this.cssClasses.itemsContainer));
|
11976
11976
|
},
|
11977
11977
|
enumerable: false,
|
11978
11978
|
configurable: true
|
@@ -14978,11 +14978,11 @@ var survey_element_SurveyElement = /** @class */ (function (_super) {
|
|
14978
14978
|
var columns = this.parent.getColumsForElement(this);
|
14979
14979
|
_width = columns.reduce(function (sum, col) { return col.effectiveWidth + sum; }, 0);
|
14980
14980
|
if (!!_width && _width !== 100) {
|
14981
|
-
style["flexGrow"] =
|
14981
|
+
style["flexGrow"] = 1;
|
14982
14982
|
style["flexShrink"] = 0;
|
14983
14983
|
style["flexBasis"] = _width + "%";
|
14984
14984
|
style["minWidth"] = undefined;
|
14985
|
-
style["maxWidth"] =
|
14985
|
+
style["maxWidth"] = this.maxWidth;
|
14986
14986
|
}
|
14987
14987
|
}
|
14988
14988
|
if (Object.keys(style).length == 0) {
|
@@ -16705,8 +16705,8 @@ function cleanHtmlElementAfterAnimation(el) {
|
|
16705
16705
|
delete el["__sv_created_properties"];
|
16706
16706
|
}
|
16707
16707
|
}
|
16708
|
-
function
|
16709
|
-
return Math.
|
16708
|
+
function floorTo2Decimals(number) {
|
16709
|
+
return Math.floor(number * 100) / 100;
|
16710
16710
|
}
|
16711
16711
|
|
16712
16712
|
|
@@ -21233,7 +21233,7 @@ var question_Question = /** @class */ (function (_super) {
|
|
21233
21233
|
/**
|
21234
21234
|
* A correct answer to this question. Specify this property if you want to [create a quiz](https://surveyjs.io/form-library/documentation/design-survey-create-a-quiz).
|
21235
21235
|
* @see SurveyModel.getCorrectAnswerCount
|
21236
|
-
* @see SurveyModel.
|
21236
|
+
* @see SurveyModel.getIncorrectAnswerCount
|
21237
21237
|
*/
|
21238
21238
|
get: function () {
|
21239
21239
|
return this.getPropertyValue("correctAnswer");
|
@@ -21282,7 +21282,14 @@ var question_Question = /** @class */ (function (_super) {
|
|
21282
21282
|
Question.prototype.checkIfAnswerCorrect = function () {
|
21283
21283
|
var isEqual = helpers_Helpers.isTwoValueEquals(this.value, this.correctAnswer, this.getAnswerCorrectIgnoreOrder(), settings.comparator.caseSensitive, true);
|
21284
21284
|
var correct = isEqual ? 1 : 0;
|
21285
|
-
var
|
21285
|
+
var incorrect = this.quizQuestionCount - correct;
|
21286
|
+
var options = {
|
21287
|
+
result: isEqual,
|
21288
|
+
correctAnswers: correct,
|
21289
|
+
correctAnswerCount: correct,
|
21290
|
+
incorrectAnswers: incorrect,
|
21291
|
+
incorrectAnswerCount: incorrect,
|
21292
|
+
};
|
21286
21293
|
if (!!this.survey) {
|
21287
21294
|
this.survey.onCorrectQuestionAnswer(this, options);
|
21288
21295
|
}
|
@@ -34910,6 +34917,7 @@ var defaultV2Css = {
|
|
34910
34917
|
itemBody: "sv-list__item-body sd-list__item-body",
|
34911
34918
|
itemSelected: "sv-list__item--selected sd-list__item--selected",
|
34912
34919
|
itemFocused: "sv-list__item--focused sd-list__item--focused",
|
34920
|
+
itemHovered: "sv-list__item--hovered sd-list__item--hovered",
|
34913
34921
|
},
|
34914
34922
|
actionBar: {
|
34915
34923
|
root: "sd-action-bar",
|
@@ -36563,7 +36571,7 @@ var panel_PanelModelBase = /** @class */ (function (_super) {
|
|
36563
36571
|
_this.isRandomizing = false;
|
36564
36572
|
_this.onColumnPropertyValueChangedCallback = function (name, oldValue, newValue, sender, arrayChanges) {
|
36565
36573
|
if (_this._columnsReady) {
|
36566
|
-
_this.updateColumnWidth(_this.
|
36574
|
+
_this.updateColumnWidth(_this.gridLayoutColumns);
|
36567
36575
|
_this.updateRootStyle();
|
36568
36576
|
}
|
36569
36577
|
};
|
@@ -36607,7 +36615,8 @@ var panel_PanelModelBase = /** @class */ (function (_super) {
|
|
36607
36615
|
isAnimationEnabled: function () { return _this.animationAllowed; },
|
36608
36616
|
getAnimatedElement: function (row) { return row.getRootElement(); },
|
36609
36617
|
getLeaveOptions: function (row, info) {
|
36610
|
-
return {
|
36618
|
+
return {
|
36619
|
+
cssClass: _this.cssClasses.rowLeave,
|
36611
36620
|
onBeforeRunAnimation: prepareElementForVerticalAnimation,
|
36612
36621
|
onAfterRunAnimation: cleanHtmlElementAfterAnimation,
|
36613
36622
|
};
|
@@ -36660,7 +36669,7 @@ var panel_PanelModelBase = /** @class */ (function (_super) {
|
|
36660
36669
|
this.updateDescriptionVisibility(this.description);
|
36661
36670
|
this.markQuestionListDirty();
|
36662
36671
|
this.onRowsChanged();
|
36663
|
-
this.
|
36672
|
+
this.gridLayoutColumns.forEach(function (col) {
|
36664
36673
|
col.onPropertyValueChangedCallback = _this.onColumnPropertyValueChangedCallback;
|
36665
36674
|
});
|
36666
36675
|
};
|
@@ -37488,7 +37497,7 @@ var panel_PanelModelBase = /** @class */ (function (_super) {
|
|
37488
37497
|
}
|
37489
37498
|
});
|
37490
37499
|
if (!!remainingColCount) {
|
37491
|
-
var oneColumnWidth =
|
37500
|
+
var oneColumnWidth = floorTo2Decimals((100 - remainingSpace) / remainingColCount);
|
37492
37501
|
for (var index = 0; index < columns.length; index++) {
|
37493
37502
|
if (!columns[index].width) {
|
37494
37503
|
columns[index].setPropertyValue("effectiveWidth", oneColumnWidth);
|
@@ -37577,12 +37586,12 @@ var panel_PanelModelBase = /** @class */ (function (_super) {
|
|
37577
37586
|
});
|
37578
37587
|
PanelModelBase.prototype.generateColumns = function () {
|
37579
37588
|
var maxRowColSpan = this.calcMaxRowColSpan();
|
37580
|
-
var columns = [].concat(this.
|
37581
|
-
if (maxRowColSpan <= this.
|
37582
|
-
columns = this.
|
37589
|
+
var columns = [].concat(this.gridLayoutColumns);
|
37590
|
+
if (maxRowColSpan <= this.gridLayoutColumns.length) {
|
37591
|
+
columns = this.gridLayoutColumns.slice(0, maxRowColSpan);
|
37583
37592
|
}
|
37584
37593
|
else {
|
37585
|
-
for (var index = this.
|
37594
|
+
for (var index = this.gridLayoutColumns.length; index < maxRowColSpan; index++) {
|
37586
37595
|
var newCol = new panel_layout_column_PanelLayoutColumnModel();
|
37587
37596
|
newCol.onPropertyValueChangedCallback = this.onColumnPropertyValueChangedCallback;
|
37588
37597
|
columns.push(newCol);
|
@@ -37596,7 +37605,13 @@ var panel_PanelModelBase = /** @class */ (function (_super) {
|
|
37596
37605
|
finally {
|
37597
37606
|
this._columnsReady = true;
|
37598
37607
|
}
|
37599
|
-
this.
|
37608
|
+
this.gridLayoutColumns = columns;
|
37609
|
+
};
|
37610
|
+
PanelModelBase.prototype.updateGridColumns = function () {
|
37611
|
+
this.updateColumns();
|
37612
|
+
this.elements.forEach(function (el) {
|
37613
|
+
el.isPanel && el.updateGridColumns();
|
37614
|
+
});
|
37600
37615
|
};
|
37601
37616
|
PanelModelBase.prototype.getColumsForElement = function (el) {
|
37602
37617
|
var row = this.findRowByElement(el);
|
@@ -38452,13 +38467,13 @@ var panel_PanelModelBase = /** @class */ (function (_super) {
|
|
38452
38467
|
};
|
38453
38468
|
PanelModelBase.prototype.getSerializableColumnsValue = function () {
|
38454
38469
|
var tailIndex = -1;
|
38455
|
-
for (var index = this.
|
38456
|
-
if (!this.
|
38470
|
+
for (var index = this.gridLayoutColumns.length - 1; index >= 0; index--) {
|
38471
|
+
if (!this.gridLayoutColumns[index].isEmpty()) {
|
38457
38472
|
tailIndex = index;
|
38458
38473
|
break;
|
38459
38474
|
}
|
38460
38475
|
}
|
38461
|
-
return this.
|
38476
|
+
return this.gridLayoutColumns.slice(0, tailIndex + 1);
|
38462
38477
|
};
|
38463
38478
|
PanelModelBase.prototype.afterRender = function (el) {
|
38464
38479
|
this.afterRenderCore(el);
|
@@ -38482,7 +38497,7 @@ var panel_PanelModelBase = /** @class */ (function (_super) {
|
|
38482
38497
|
PanelModelBase.panelCounter = 100;
|
38483
38498
|
panel_decorate([
|
38484
38499
|
propertyArray()
|
38485
|
-
], PanelModelBase.prototype, "
|
38500
|
+
], PanelModelBase.prototype, "gridLayoutColumns", void 0);
|
38486
38501
|
panel_decorate([
|
38487
38502
|
jsonobject_property({ defaultValue: true })
|
38488
38503
|
], PanelModelBase.prototype, "showTitle", void 0);
|
@@ -38655,13 +38670,18 @@ var panel_PanelModel = /** @class */ (function (_super) {
|
|
38655
38670
|
* @see visibleIf
|
38656
38671
|
*/
|
38657
38672
|
get: function () {
|
38658
|
-
|
38673
|
+
var _this = this;
|
38674
|
+
return this.getPropertyValue("no", undefined, function () { return _this.calcNo(); });
|
38659
38675
|
},
|
38660
38676
|
enumerable: false,
|
38661
38677
|
configurable: true
|
38662
38678
|
});
|
38663
|
-
PanelModel.prototype.
|
38664
|
-
|
38679
|
+
PanelModel.prototype.calcNo = function () {
|
38680
|
+
var no = helpers_Helpers.getNumberByIndex(this.visibleIndex, this.getStartIndex());
|
38681
|
+
if (this.survey) {
|
38682
|
+
no = this.survey.getUpdatedPanelNo(this, no);
|
38683
|
+
}
|
38684
|
+
return no || "";
|
38665
38685
|
};
|
38666
38686
|
PanelModel.prototype.notifyStateChanged = function (prevState) {
|
38667
38687
|
if (!this.isLoadingFromJson) {
|
@@ -38688,7 +38708,7 @@ var panel_PanelModel = /** @class */ (function (_super) {
|
|
38688
38708
|
visibleIndex = index;
|
38689
38709
|
}
|
38690
38710
|
this.setPropertyValue("visibleIndex", visibleIndex);
|
38691
|
-
this.
|
38711
|
+
this.resetPropertyValue("no");
|
38692
38712
|
return visibleIndex < 0 ? 0 : 1;
|
38693
38713
|
};
|
38694
38714
|
PanelModel.prototype.getPanelStartIndex = function (index) {
|
@@ -38976,7 +38996,7 @@ Serializer.addClass("panelbase", [
|
|
38976
38996
|
choices: ["default", "top", "bottom", "left", "hidden"],
|
38977
38997
|
},
|
38978
38998
|
{
|
38979
|
-
name: "
|
38999
|
+
name: "gridLayoutColumns:panellayoutcolumns",
|
38980
39000
|
className: "panellayoutcolumn", isArray: true,
|
38981
39001
|
onSerializeValue: function (obj) { return obj.getSerializableColumnsValue(); },
|
38982
39002
|
visibleIf: function (obj) { return !!obj && !!obj.survey && obj.survey.gridLayoutEnabled; }
|
@@ -40507,9 +40527,16 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
40507
40527
|
*/
|
40508
40528
|
_this.onGetQuestionNumber = _this.addEvent();
|
40509
40529
|
/**
|
40510
|
-
*
|
40530
|
+
* Obsolete. Use the [`onGetQuestionNumber`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#onGetQuestionNumber) event instead.
|
40531
|
+
* @deprecated
|
40511
40532
|
*/
|
40512
40533
|
_this.onGetQuestionNo = _this.onGetQuestionNumber;
|
40534
|
+
/**
|
40535
|
+
* An event that is raised before the survey calculates a panel number. Handle this event to modify panel numbers.
|
40536
|
+
*
|
40537
|
+
* This event is raised only for the panels with a [specified title](https://surveyjs.io/form-library/documentation/api-reference/panel-model#title) and [visible number](https://surveyjs.io/form-library/documentation/api-reference/panel-model#showNumber).
|
40538
|
+
*/
|
40539
|
+
_this.onGetPanelNumber = _this.addEvent();
|
40513
40540
|
/**
|
40514
40541
|
* An event that is raised before the survey calculates a page number. Handle this event to modify page numbers.
|
40515
40542
|
*
|
@@ -40525,7 +40552,12 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
40525
40552
|
* @see showProgressBar
|
40526
40553
|
* @see progressBarType
|
40527
40554
|
*/
|
40528
|
-
_this.
|
40555
|
+
_this.onGetProgressText = _this.addEvent();
|
40556
|
+
/**
|
40557
|
+
* Obsolete. Use the [`onGetProgressText`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#onGetProgressText) event instead.
|
40558
|
+
* @deprecated
|
40559
|
+
*/
|
40560
|
+
_this.onProgressText = _this.onGetProgressText;
|
40529
40561
|
/**
|
40530
40562
|
* An event that is raised to convert Markdown content to HTML.
|
40531
40563
|
*
|
@@ -40727,7 +40759,8 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
40727
40759
|
*/
|
40728
40760
|
_this.onMatrixRowAdding = _this.addEvent();
|
40729
40761
|
/**
|
40730
|
-
*
|
40762
|
+
* Obsolete. Use the [`onMatrixRowAdding`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#onMatrixRowAdding) event instead.
|
40763
|
+
* @deprecated
|
40731
40764
|
*/
|
40732
40765
|
_this.onMatrixBeforeRowAdded = _this.onMatrixRowAdding;
|
40733
40766
|
/**
|
@@ -40747,7 +40780,8 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
40747
40780
|
*/
|
40748
40781
|
_this.onMatrixRenderRemoveButton = _this.addEvent();
|
40749
40782
|
/**
|
40750
|
-
*
|
40783
|
+
* Obsolete. Use the [`onMatrixRenderRemoveButton`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#onMatrixRenderRemoveButton) event instead.
|
40784
|
+
* @deprecated
|
40751
40785
|
*/
|
40752
40786
|
_this.onMatrixAllowRemoveRow = _this.onMatrixRenderRemoveButton;
|
40753
40787
|
/**
|
@@ -40770,7 +40804,8 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
40770
40804
|
*/
|
40771
40805
|
_this.onAfterRenderMatrixCell = _this.addEvent();
|
40772
40806
|
/**
|
40773
|
-
*
|
40807
|
+
* Obsolete. Use the [`onAfterRenderMatrixCell`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#onAfterRenderMatrixCell) event instead.
|
40808
|
+
* @deprecated
|
40774
40809
|
*/
|
40775
40810
|
_this.onMatrixAfterCellRender = _this.onAfterRenderMatrixCell;
|
40776
40811
|
/**
|
@@ -40844,7 +40879,12 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
40844
40879
|
/**
|
40845
40880
|
* An event that is raised to define whether a question answer is correct. Applies only to [quiz surveys](https://surveyjs.io/form-library/documentation/design-survey/create-a-quiz).
|
40846
40881
|
*/
|
40847
|
-
_this.
|
40882
|
+
_this.onCheckAnswerCorrect = _this.addEvent();
|
40883
|
+
/**
|
40884
|
+
* Obsolete. Use the [`onCheckAnswerCorrect`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#onCheckAnswerCorrect) event instead.
|
40885
|
+
* @deprecated
|
40886
|
+
*/
|
40887
|
+
_this.onIsAnswerCorrect = _this.onCheckAnswerCorrect;
|
40848
40888
|
/**
|
40849
40889
|
* An event that is raised when users drag and drop survey elements while designing the survey in [Survey Creator](https://surveyjs.io/survey-creator/documentation/overview). Use this event to control drag and drop operations.
|
40850
40890
|
* @see isDesignMode
|
@@ -40853,7 +40893,12 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
40853
40893
|
/**
|
40854
40894
|
* An event this is raised before a survey element (usually page) is scrolled to the top. Use this event to cancel the scroll operation.
|
40855
40895
|
*/
|
40856
|
-
_this.
|
40896
|
+
_this.onScrollToTop = _this.addEvent();
|
40897
|
+
/**
|
40898
|
+
* Obsolete. Use the [`onScrollToTop`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#onScrollToTop) event instead.
|
40899
|
+
* @deprecated
|
40900
|
+
*/
|
40901
|
+
_this.onScrollingElementToTop = _this.onScrollToTop;
|
40857
40902
|
_this.onLocaleChangedEvent = _this.addEvent();
|
40858
40903
|
/**
|
40859
40904
|
* An event that allows you to add, delete, or modify actions in a question title.
|
@@ -40892,9 +40937,6 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
40892
40937
|
* @see [IAction](https://surveyjs.io/form-library/documentation/api-reference/iaction)
|
40893
40938
|
*/
|
40894
40939
|
_this.onGetMatrixRowActions = _this.addEvent();
|
40895
|
-
/**
|
40896
|
-
* An event that is raised after a survey element is [expanded or collapsed](https://surveyjs.io/form-library/documentation/api-reference/question#state).
|
40897
|
-
*/
|
40898
40940
|
_this.onElementContentVisibilityChanged = _this.addEvent();
|
40899
40941
|
/**
|
40900
40942
|
* An event that is raised before an [Expression](https://surveyjs.io/form-library/documentation/api-reference/expression-model) question displays a value. Use this event to override the display value.
|
@@ -41068,7 +41110,10 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
41068
41110
|
_this.onGetQuestionNumber.onCallbacksChanged = function () {
|
41069
41111
|
_this.resetVisibleIndexes();
|
41070
41112
|
};
|
41071
|
-
_this.
|
41113
|
+
_this.onGetPanelNumber.onCallbacksChanged = function () {
|
41114
|
+
_this.resetVisibleIndexes();
|
41115
|
+
};
|
41116
|
+
_this.onGetProgressText.onCallbacksChanged = function () {
|
41072
41117
|
_this.updateProgressText();
|
41073
41118
|
};
|
41074
41119
|
_this.onTextMarkdown.onCallbacksChanged = function () {
|
@@ -43138,6 +43183,13 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
43138
43183
|
this.onGetQuestionNumber.fire(this, options);
|
43139
43184
|
return options.no === no ? options.number : options.no;
|
43140
43185
|
};
|
43186
|
+
SurveyModel.prototype.getUpdatedPanelNo = function (panel, no) {
|
43187
|
+
if (this.onGetPanelNumber.isEmpty)
|
43188
|
+
return no;
|
43189
|
+
var options = { panel: panel, number: no };
|
43190
|
+
this.onGetPanelNumber.fire(this, options);
|
43191
|
+
return options.number;
|
43192
|
+
};
|
43141
43193
|
SurveyModel.prototype.getUpdatedPageNo = function (page, no) {
|
43142
43194
|
if (this.onGetPageNumber.isEmpty)
|
43143
43195
|
return no;
|
@@ -44525,7 +44577,8 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
44525
44577
|
};
|
44526
44578
|
Object.defineProperty(SurveyModel.prototype, "ignoreValidation", {
|
44527
44579
|
/**
|
44528
|
-
*
|
44580
|
+
* Obsolete. Use the [`validationEnabled`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#validationEnabled) property instead.
|
44581
|
+
* @deprecated
|
44529
44582
|
*/
|
44530
44583
|
get: function () { return !this.validationEnabled; },
|
44531
44584
|
set: function (val) { this.validationEnabled = !val; },
|
@@ -44880,7 +44933,7 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
44880
44933
|
* @see isCurrentPageValid
|
44881
44934
|
* @see nextPage
|
44882
44935
|
*/
|
44883
|
-
SurveyModel.prototype.
|
44936
|
+
SurveyModel.prototype.tryComplete = function () {
|
44884
44937
|
if (this.isValidateOnComplete) {
|
44885
44938
|
this.cancelPreview();
|
44886
44939
|
}
|
@@ -44890,6 +44943,13 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
44890
44943
|
}
|
44891
44944
|
return res;
|
44892
44945
|
};
|
44946
|
+
/**
|
44947
|
+
* Obsolete. Use the [`tryComplete`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#tryComplete) method instead.
|
44948
|
+
* @deprecated
|
44949
|
+
*/
|
44950
|
+
SurveyModel.prototype.completeLastPage = function () {
|
44951
|
+
return this.tryComplete();
|
44952
|
+
};
|
44893
44953
|
SurveyModel.prototype.navigationMouseDown = function () {
|
44894
44954
|
this.isNavigationButtonPressed = true;
|
44895
44955
|
return true;
|
@@ -45661,7 +45721,7 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
45661
45721
|
};
|
45662
45722
|
Object.defineProperty(SurveyModel.prototype, "progressText", {
|
45663
45723
|
/**
|
45664
|
-
* Returns text displayed by the progress bar (for instance, "Page 2 of 3" or "Answered 3/8 questions"). Handle the [`
|
45724
|
+
* Returns text displayed by the progress bar (for instance, "Page 2 of 3" or "Answered 3/8 questions"). Handle the [`onGetProgressText`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#onGetProgressText) event to change this text.
|
45665
45725
|
* @see progressValue
|
45666
45726
|
* @see showProgressBar
|
45667
45727
|
* @see progressBarType
|
@@ -45683,7 +45743,7 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
45683
45743
|
return;
|
45684
45744
|
if (onValueChanged &&
|
45685
45745
|
this.progressBarType == "pages" &&
|
45686
|
-
this.
|
45746
|
+
this.onGetProgressText.isEmpty)
|
45687
45747
|
return;
|
45688
45748
|
this.isCalculatingProgressText = true;
|
45689
45749
|
this.setPropertyValue("progressText", this.getProgressText());
|
@@ -45704,7 +45764,7 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
45704
45764
|
if (type === "questions" ||
|
45705
45765
|
type === "requiredquestions" ||
|
45706
45766
|
type === "correctquestions" ||
|
45707
|
-
!this.
|
45767
|
+
!this.onGetProgressText.isEmpty) {
|
45708
45768
|
var info = this.getProgressInfo();
|
45709
45769
|
options.questionCount = info.questionCount;
|
45710
45770
|
options.answeredQuestionCount = info.answeredQuestionCount;
|
@@ -45713,7 +45773,7 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
45713
45773
|
info.requiredAnsweredQuestionCount;
|
45714
45774
|
}
|
45715
45775
|
options.text = this.getProgressTextCore(options);
|
45716
|
-
this.
|
45776
|
+
this.onGetProgressText.fire(this, options);
|
45717
45777
|
return options.text;
|
45718
45778
|
};
|
45719
45779
|
SurveyModel.prototype.getProgressTextCore = function (info) {
|
@@ -46098,29 +46158,39 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
46098
46158
|
return this.getUpdatedPanelTitleActions(element, titleActions);
|
46099
46159
|
return this.getUpdatedQuestionTitleActions(element, titleActions);
|
46100
46160
|
};
|
46161
|
+
SurveyModel.prototype.getTitleActionsResult = function (titleActions, options) {
|
46162
|
+
if (titleActions != options.actions)
|
46163
|
+
return options.actions;
|
46164
|
+
if (titleActions != options.titleActions)
|
46165
|
+
return options.titleActions;
|
46166
|
+
return titleActions;
|
46167
|
+
};
|
46101
46168
|
SurveyModel.prototype.getUpdatedQuestionTitleActions = function (question, titleActions) {
|
46102
46169
|
var options = {
|
46103
46170
|
question: question,
|
46171
|
+
actions: titleActions,
|
46104
46172
|
titleActions: titleActions,
|
46105
46173
|
};
|
46106
46174
|
this.onGetQuestionTitleActions.fire(this, options);
|
46107
|
-
return
|
46175
|
+
return this.getTitleActionsResult(titleActions, options);
|
46108
46176
|
};
|
46109
46177
|
SurveyModel.prototype.getUpdatedPanelTitleActions = function (panel, titleActions) {
|
46110
46178
|
var options = {
|
46111
46179
|
panel: panel,
|
46180
|
+
actions: titleActions,
|
46112
46181
|
titleActions: titleActions,
|
46113
46182
|
};
|
46114
46183
|
this.onGetPanelTitleActions.fire(this, options);
|
46115
|
-
return
|
46184
|
+
return this.getTitleActionsResult(titleActions, options);
|
46116
46185
|
};
|
46117
46186
|
SurveyModel.prototype.getUpdatedPageTitleActions = function (page, titleActions) {
|
46118
46187
|
var options = {
|
46119
46188
|
page: page,
|
46189
|
+
actions: titleActions,
|
46120
46190
|
titleActions: titleActions,
|
46121
46191
|
};
|
46122
46192
|
this.onGetPageTitleActions.fire(this, options);
|
46123
|
-
return
|
46193
|
+
return this.getTitleActionsResult(titleActions, options);
|
46124
46194
|
};
|
46125
46195
|
SurveyModel.prototype.getUpdatedMatrixRowActions = function (question, row, actions) {
|
46126
46196
|
var options = {
|
@@ -46139,9 +46209,10 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
46139
46209
|
page: page,
|
46140
46210
|
elementId: id,
|
46141
46211
|
cancel: false,
|
46212
|
+
allow: true,
|
46142
46213
|
};
|
46143
|
-
this.
|
46144
|
-
if (!options.cancel) {
|
46214
|
+
this.onScrollToTop.fire(this, options);
|
46215
|
+
if (!options.cancel && options.allow) {
|
46145
46216
|
var elementPage_1 = this.getPageByElement(element);
|
46146
46217
|
if (this.isLazyRendering && !!elementPage_1) {
|
46147
46218
|
var elementsToRenderBefore = 1;
|
@@ -46428,13 +46499,6 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
46428
46499
|
}
|
46429
46500
|
return null;
|
46430
46501
|
};
|
46431
|
-
/**
|
46432
|
-
* Returns an array of questions with specified [names](https://surveyjs.io/form-library/documentation/api-reference/question#name).
|
46433
|
-
* @param names An array of question names.
|
46434
|
-
* @param caseInsensitive *(Optional)* A Boolean value that specifies case sensitivity when searching for the questions. Default value: `false` (uppercase and lowercase letters are treated as distinct).
|
46435
|
-
* @returns An array of questions with specified names
|
46436
|
-
* @see getAllQuestions
|
46437
|
-
*/
|
46438
46502
|
SurveyModel.prototype.getQuestionsByNames = function (names, caseInsensitive) {
|
46439
46503
|
if (caseInsensitive === void 0) { caseInsensitive = false; }
|
46440
46504
|
var result = [];
|
@@ -46479,10 +46543,6 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
46479
46543
|
}
|
46480
46544
|
return null;
|
46481
46545
|
};
|
46482
|
-
/**
|
46483
|
-
* Returns an array of pages with specified names.
|
46484
|
-
* @param names An array of page names.
|
46485
|
-
*/
|
46486
46546
|
SurveyModel.prototype.getPagesByNames = function (names) {
|
46487
46547
|
var result = [];
|
46488
46548
|
if (!names)
|
@@ -47176,7 +47236,7 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
47176
47236
|
mouseDown: function () { return _this.navigationMouseDown(); },
|
47177
47237
|
},
|
47178
47238
|
locTitle: this.locCompleteText,
|
47179
|
-
action: function () { return _this.taskManager.waitAndExecute(function () { return _this.
|
47239
|
+
action: function () { return _this.taskManager.waitAndExecute(function () { return _this.tryComplete(); }); },
|
47180
47240
|
component: defaultComponent
|
47181
47241
|
});
|
47182
47242
|
this.updateNavigationItemCssCallback = function () {
|
@@ -47547,7 +47607,7 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
47547
47607
|
_this.showPreview();
|
47548
47608
|
}
|
47549
47609
|
else {
|
47550
|
-
_this.
|
47610
|
+
_this.tryComplete();
|
47551
47611
|
}
|
47552
47612
|
}
|
47553
47613
|
};
|
@@ -47865,7 +47925,7 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
47865
47925
|
* For more information about quizzes, refer to the following tutorial: [Create a Quiz](https://surveyjs.io/form-library/documentation/design-survey/create-a-quiz).
|
47866
47926
|
* @returns The number of correct answers in a quiz.
|
47867
47927
|
* @see getQuizQuestionCount
|
47868
|
-
* @see
|
47928
|
+
* @see getIncorrectAnswerCount
|
47869
47929
|
*/
|
47870
47930
|
SurveyModel.prototype.getCorrectAnswerCount = function () {
|
47871
47931
|
return this.getCorrectedAnswerCountCore(true);
|
@@ -47888,7 +47948,10 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
47888
47948
|
return res;
|
47889
47949
|
};
|
47890
47950
|
SurveyModel.prototype.getInCorrectedAnswerCount = function () {
|
47891
|
-
return this.
|
47951
|
+
return this.getIncorrectAnswerCount();
|
47952
|
+
};
|
47953
|
+
SurveyModel.prototype.getInCorrectAnswerCount = function () {
|
47954
|
+
return this.getIncorrectAnswerCount();
|
47892
47955
|
};
|
47893
47956
|
/**
|
47894
47957
|
* Returns the number of incorrect answers in a quiz.
|
@@ -47897,7 +47960,7 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
47897
47960
|
* @returns The number of incorrect answers in a quiz.
|
47898
47961
|
* @see getCorrectAnswerCount
|
47899
47962
|
*/
|
47900
|
-
SurveyModel.prototype.
|
47963
|
+
SurveyModel.prototype.getIncorrectAnswerCount = function () {
|
47901
47964
|
return this.getCorrectedAnswerCountCore(false);
|
47902
47965
|
};
|
47903
47966
|
SurveyModel.prototype.onCorrectQuestionAnswer = function (question, options) {
|
@@ -48044,6 +48107,9 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
48044
48107
|
enumerable: false,
|
48045
48108
|
configurable: true
|
48046
48109
|
});
|
48110
|
+
SurveyModel.prototype.updateGridColumns = function () {
|
48111
|
+
this.pages.forEach(function (page) { return page.updateGridColumns(); });
|
48112
|
+
};
|
48047
48113
|
Object.defineProperty(SurveyModel.prototype, "widthMode", {
|
48048
48114
|
/**
|
48049
48115
|
* Specifies how to calculate the survey width.
|
@@ -48389,13 +48455,13 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
48389
48455
|
this.onTimerTick.fire(this, {});
|
48390
48456
|
if (this.timeLimit > 0 && this.timeLimit <= this.timeSpent) {
|
48391
48457
|
this.timeSpent = this.timeLimit;
|
48392
|
-
this.
|
48458
|
+
this.tryComplete();
|
48393
48459
|
}
|
48394
48460
|
if (page) {
|
48395
48461
|
var pageLimit = page.getMaxTimeToFinish();
|
48396
48462
|
if (pageLimit > 0 && pageLimit == page.timeSpent) {
|
48397
48463
|
if (this.isLastPage) {
|
48398
|
-
this.
|
48464
|
+
this.tryComplete();
|
48399
48465
|
}
|
48400
48466
|
else {
|
48401
48467
|
this.nextPage();
|
@@ -48953,7 +49019,11 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
48953
49019
|
jsonobject_property()
|
48954
49020
|
], SurveyModel.prototype, "rootCss", void 0);
|
48955
49021
|
survey_decorate([
|
48956
|
-
jsonobject_property(
|
49022
|
+
jsonobject_property({
|
49023
|
+
onSet: function (newValue, target) {
|
49024
|
+
target.updateGridColumns();
|
49025
|
+
}
|
49026
|
+
})
|
48957
49027
|
], SurveyModel.prototype, "gridLayoutEnabled", void 0);
|
48958
49028
|
survey_decorate([
|
48959
49029
|
jsonobject_property()
|
@@ -64642,10 +64712,17 @@ var question_imagepicker_QuestionImagePickerModel = /** @class */ (function (_su
|
|
64642
64712
|
enumerable: false,
|
64643
64713
|
configurable: true
|
64644
64714
|
});
|
64715
|
+
Object.defineProperty(QuestionImagePickerModel.prototype, "imageScale", {
|
64716
|
+
get: function () {
|
64717
|
+
return this.survey ? this.survey["widthScale"] / 100 : 1;
|
64718
|
+
},
|
64719
|
+
enumerable: false,
|
64720
|
+
configurable: true
|
64721
|
+
});
|
64645
64722
|
Object.defineProperty(QuestionImagePickerModel.prototype, "renderedImageHeight", {
|
64646
64723
|
get: function () {
|
64647
|
-
var height = this.isResponsive ? Math.floor(this.responsiveImageHeight) : this.imageHeight;
|
64648
|
-
return (height ? height : 150);
|
64724
|
+
var height = this.isResponsive ? Math.floor(this.responsiveImageHeight) : this.imageHeight * this.imageScale;
|
64725
|
+
return (height ? height : 150 * this.imageScale);
|
64649
64726
|
},
|
64650
64727
|
enumerable: false,
|
64651
64728
|
configurable: true
|
@@ -64672,8 +64749,8 @@ var question_imagepicker_QuestionImagePickerModel = /** @class */ (function (_su
|
|
64672
64749
|
});
|
64673
64750
|
Object.defineProperty(QuestionImagePickerModel.prototype, "renderedImageWidth", {
|
64674
64751
|
get: function () {
|
64675
|
-
var width = this.isResponsive ? Math.floor(this.responsiveImageWidth) : this.imageWidth;
|
64676
|
-
return (width ? width : 200);
|
64752
|
+
var width = this.isResponsive ? Math.floor(this.responsiveImageWidth) : this.imageWidth * this.imageScale;
|
64753
|
+
return (width ? width : 200 * this.imageScale);
|
64677
64754
|
},
|
64678
64755
|
enumerable: false,
|
64679
64756
|
configurable: true
|
@@ -64781,11 +64858,11 @@ var question_imagepicker_QuestionImagePickerModel = /** @class */ (function (_su
|
|
64781
64858
|
};
|
64782
64859
|
if (this.isResponsive) {
|
64783
64860
|
var itemsCount = this.choices.length + (this.isDesignMode ? 1 : 0);
|
64784
|
-
var gap = this.gapBetweenItems || 0;
|
64785
|
-
var minWidth = this.minImageWidth;
|
64786
|
-
var maxWidth = this.maxImageWidth;
|
64787
|
-
var maxHeight = this.maxImageHeight;
|
64788
|
-
var minHeight = this.minImageHeight;
|
64861
|
+
var gap = (this.gapBetweenItems || 0) * this.imageScale;
|
64862
|
+
var minWidth = this.minImageWidth * this.imageScale;
|
64863
|
+
var maxWidth = this.maxImageWidth * this.imageScale;
|
64864
|
+
var maxHeight = this.maxImageHeight * this.imageScale;
|
64865
|
+
var minHeight = this.minImageHeight * this.imageScale;
|
64789
64866
|
var colCount = this.colCount;
|
64790
64867
|
var width_1;
|
64791
64868
|
if (colCount === 0) {
|
@@ -72400,8 +72477,8 @@ Serializer.addClass("currencymask", [
|
|
72400
72477
|
|
72401
72478
|
var Version;
|
72402
72479
|
var ReleaseDate;
|
72403
|
-
Version = "" + "1.12.
|
72404
|
-
ReleaseDate = "" + "2024-12-
|
72480
|
+
Version = "" + "1.12.17";
|
72481
|
+
ReleaseDate = "" + "2024-12-30";
|
72405
72482
|
function checkLibraryVersion(ver, libraryName) {
|
72406
72483
|
if (Version != ver) {
|
72407
72484
|
var str = "survey-core has version '" + Version + "' and " + libraryName
|