survey-react 1.12.5 → 1.12.6
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 +6 -3
- package/defaultV2.css.map +1 -1
- package/defaultV2.min.css +2 -2
- 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 +19 -10
- package/survey.react.js +146 -85
- 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.6
|
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
|
*/
|
@@ -3123,6 +3123,9 @@ var jsonobject_JsonMetadataClass = /** @class */ (function () {
|
|
3123
3123
|
if (propInfo.readOnly === true) {
|
3124
3124
|
prop.readOnly = true;
|
3125
3125
|
}
|
3126
|
+
if (propInfo.availableInMatrixColumn === true) {
|
3127
|
+
prop.availableInMatrixColumn = true;
|
3128
|
+
}
|
3126
3129
|
if (propInfo.choices) {
|
3127
3130
|
var choicesFunc = typeof propInfo.choices === "function" ? propInfo.choices : null;
|
3128
3131
|
var choicesValue = typeof propInfo.choices !== "function" ? propInfo.choices : null;
|
@@ -13036,18 +13039,6 @@ var survey_element_SurveyElement = /** @class */ (function (_super) {
|
|
13036
13039
|
requestAnimationFrame(checkPos_1);
|
13037
13040
|
};
|
13038
13041
|
DomWindowHelper.requestAnimationFrame(checkPos_1);
|
13039
|
-
// let currPageXOffset = window.pageXOffset;
|
13040
|
-
// let currPageYOffset = window.pageYOffset;
|
13041
|
-
// var scrollDone = setInterval(() => {
|
13042
|
-
// DomWindowHelper.requestAnimationFrame(() => {
|
13043
|
-
// if (currPageXOffset == window.pageXOffset && currPageYOffset == window.pageYOffset) {
|
13044
|
-
// clearInterval(scrollDone);
|
13045
|
-
// doneCallback();
|
13046
|
-
// }
|
13047
|
-
// currPageXOffset = window.pageXOffset;
|
13048
|
-
// currPageYOffset = window.pageYOffset;
|
13049
|
-
// });
|
13050
|
-
// }, 25);
|
13051
13042
|
}
|
13052
13043
|
};
|
13053
13044
|
SurveyElement.ScrollElementToTop = function (elementId, scrollIfVisible, scrollIntoViewOptions, doneCallback) {
|
@@ -13058,12 +13049,17 @@ var survey_element_SurveyElement = /** @class */ (function (_super) {
|
|
13058
13049
|
return SurveyElement.ScrollElementToViewCore(el, false, scrollIfVisible, scrollIntoViewOptions, doneCallback);
|
13059
13050
|
};
|
13060
13051
|
SurveyElement.ScrollElementToViewCore = function (el, checkLeft, scrollIfVisible, scrollIntoViewOptions, doneCallback) {
|
13061
|
-
if (!el || !el.scrollIntoView)
|
13052
|
+
if (!el || !el.scrollIntoView) {
|
13053
|
+
doneCallback && doneCallback();
|
13062
13054
|
return false;
|
13055
|
+
}
|
13063
13056
|
var needScroll = SurveyElement.IsNeedScrollIntoView(el, checkLeft, scrollIfVisible);
|
13064
13057
|
if (needScroll) {
|
13065
13058
|
SurveyElement.ScrollIntoView(el, scrollIntoViewOptions, doneCallback);
|
13066
13059
|
}
|
13060
|
+
else {
|
13061
|
+
doneCallback && doneCallback();
|
13062
|
+
}
|
13067
13063
|
return needScroll;
|
13068
13064
|
};
|
13069
13065
|
SurveyElement.GetFirstNonTextElement = function (elements, removeSpaces) {
|
@@ -16787,6 +16783,11 @@ var validator_SurveyValidator = /** @class */ (function (_super) {
|
|
16787
16783
|
_this.createLocalizableString("text", _this, true);
|
16788
16784
|
return _this;
|
16789
16785
|
}
|
16786
|
+
Object.defineProperty(SurveyValidator.prototype, "isValidator", {
|
16787
|
+
get: function () { return true; },
|
16788
|
+
enumerable: false,
|
16789
|
+
configurable: true
|
16790
|
+
});
|
16790
16791
|
SurveyValidator.prototype.getSurvey = function (live) {
|
16791
16792
|
if (live === void 0) { live = false; }
|
16792
16793
|
return !!this.errorOwner && !!this.errorOwner["getSurvey"]
|
@@ -19265,6 +19266,7 @@ var question_Question = /** @class */ (function (_super) {
|
|
19265
19266
|
* @param onError Pass `true` if you want to focus an input field with the first validation error. Default value: `false` (focuses the first input field). Applies to question types with multiple input fields.
|
19266
19267
|
*/
|
19267
19268
|
Question.prototype.focus = function (onError, scrollIfVisible) {
|
19269
|
+
var _this = this;
|
19268
19270
|
if (onError === void 0) { onError = false; }
|
19269
19271
|
if (this.isDesignMode || !this.isVisible || !this.survey)
|
19270
19272
|
return;
|
@@ -19274,16 +19276,17 @@ var question_Question = /** @class */ (function (_super) {
|
|
19274
19276
|
this.survey.focusQuestionByInstance(this, onError);
|
19275
19277
|
}
|
19276
19278
|
else {
|
19277
|
-
this.
|
19278
|
-
|
19279
|
-
|
19280
|
-
|
19281
|
-
|
19282
|
-
|
19283
|
-
|
19284
|
-
|
19279
|
+
if (!!this.survey) {
|
19280
|
+
this.expandAllParents();
|
19281
|
+
var scrollOptions = this.survey["isSmoothScrollEnabled"] ? { behavior: "smooth" } : undefined;
|
19282
|
+
this.survey.scrollElementToTop(this, this, null, this.id, scrollIfVisible, scrollOptions, undefined, function () {
|
19283
|
+
_this.focusInputElement(onError);
|
19284
|
+
});
|
19285
|
+
}
|
19286
|
+
else {
|
19287
|
+
this.focusInputElement(onError);
|
19288
|
+
}
|
19285
19289
|
}
|
19286
|
-
this.focusInputElement(onError);
|
19287
19290
|
};
|
19288
19291
|
Question.prototype.focusInputElement = function (onError) {
|
19289
19292
|
var id = !onError ? this.getFirstInputElementId() : this.getFirstErrorInputElementId();
|
@@ -20810,9 +20813,12 @@ var question_Question = /** @class */ (function (_super) {
|
|
20810
20813
|
if (this.isValueEmpty(value) && helpers_Helpers.isNumber(this[propName])) {
|
20811
20814
|
value = 0;
|
20812
20815
|
}
|
20813
|
-
this
|
20816
|
+
this.updateBindingProp(propName, value);
|
20814
20817
|
}
|
20815
20818
|
};
|
20819
|
+
Question.prototype.updateBindingProp = function (propName, value) {
|
20820
|
+
this[propName] = value;
|
20821
|
+
};
|
20816
20822
|
Question.prototype.getComponentName = function () {
|
20817
20823
|
return RendererFactory.Instance.getRendererByQuestion(this);
|
20818
20824
|
};
|
@@ -27914,7 +27920,7 @@ var MatrixDropdownRowTextProcessor = /** @class */ (function (_super) {
|
|
27914
27920
|
textValue.value = this.row.rowIndex;
|
27915
27921
|
return true;
|
27916
27922
|
}
|
27917
|
-
if (textValue.name
|
27923
|
+
if ([question_matrixdropdownbase_MatrixDropdownRowModelBase.RowValueVariableName, question_matrixdropdownbase_MatrixDropdownRowModelBase.RowNameVariableName].indexOf(textValue.name) > -1) {
|
27918
27924
|
textValue.isExists = true;
|
27919
27925
|
textValue.value = this.row.rowName;
|
27920
27926
|
return true;
|
@@ -28148,11 +28154,12 @@ var question_matrixdropdownbase_MatrixDropdownRowModelBase = /** @class */ (func
|
|
28148
28154
|
MatrixDropdownRowModelBase.prototype.applyRowVariablesToValues = function (res, rowIndex) {
|
28149
28155
|
res[MatrixDropdownRowModelBase.IndexVariableName] = rowIndex;
|
28150
28156
|
res[MatrixDropdownRowModelBase.RowValueVariableName] = this.rowName;
|
28157
|
+
res[MatrixDropdownRowModelBase.RowNameVariableName] = this.rowName;
|
28151
28158
|
};
|
28152
28159
|
MatrixDropdownRowModelBase.prototype.runCondition = function (values, properties, rowsVisibleIf) {
|
28153
|
-
if (
|
28154
|
-
|
28155
|
-
|
28160
|
+
if (!this.data)
|
28161
|
+
return;
|
28162
|
+
values[MatrixDropdownRowModelBase.OwnerVariableName] = this.data.getFilteredData();
|
28156
28163
|
var rowIndex = this.rowIndex;
|
28157
28164
|
this.applyRowVariablesToValues(values, rowIndex);
|
28158
28165
|
var newProps = helpers_Helpers.createCopy(properties);
|
@@ -28563,11 +28570,14 @@ var question_matrixdropdownbase_MatrixDropdownRowModelBase = /** @class */ (func
|
|
28563
28570
|
};
|
28564
28571
|
Object.defineProperty(MatrixDropdownRowModelBase.prototype, "rowIndex", {
|
28565
28572
|
get: function () {
|
28566
|
-
return
|
28573
|
+
return this.getRowIndex();
|
28567
28574
|
},
|
28568
28575
|
enumerable: false,
|
28569
28576
|
configurable: true
|
28570
28577
|
});
|
28578
|
+
MatrixDropdownRowModelBase.prototype.getRowIndex = function () {
|
28579
|
+
return !!this.data ? this.data.getRowIndex(this) + 1 : -1;
|
28580
|
+
};
|
28571
28581
|
Object.defineProperty(MatrixDropdownRowModelBase.prototype, "editingObj", {
|
28572
28582
|
get: function () {
|
28573
28583
|
return this.editingObjValue;
|
@@ -28605,6 +28615,7 @@ var question_matrixdropdownbase_MatrixDropdownRowModelBase = /** @class */ (func
|
|
28605
28615
|
MatrixDropdownRowModelBase.OwnerVariableName = "self";
|
28606
28616
|
MatrixDropdownRowModelBase.IndexVariableName = "rowIndex";
|
28607
28617
|
MatrixDropdownRowModelBase.RowValueVariableName = "rowValue";
|
28618
|
+
MatrixDropdownRowModelBase.RowNameVariableName = "rowName";
|
28608
28619
|
MatrixDropdownRowModelBase.idCounter = 1;
|
28609
28620
|
return MatrixDropdownRowModelBase;
|
28610
28621
|
}());
|
@@ -29268,9 +29279,9 @@ var question_matrixdropdownbase_QuestionMatrixDropdownModelBase = /** @class */
|
|
29268
29279
|
return !!question ? question.getConditionJson(operator) : null;
|
29269
29280
|
};
|
29270
29281
|
QuestionMatrixDropdownModelBase.prototype.clearIncorrectValues = function () {
|
29271
|
-
|
29272
|
-
if (!rows)
|
29282
|
+
if (!Array.isArray(this.visibleRows))
|
29273
29283
|
return;
|
29284
|
+
var rows = this.generatedVisibleRows;
|
29274
29285
|
for (var i = 0; i < rows.length; i++) {
|
29275
29286
|
rows[i].clearIncorrectValues(this.getRowValue(i));
|
29276
29287
|
}
|
@@ -29675,13 +29686,13 @@ var question_matrixdropdownbase_QuestionMatrixDropdownModelBase = /** @class */
|
|
29675
29686
|
* @see setRowValue
|
29676
29687
|
*/
|
29677
29688
|
QuestionMatrixDropdownModelBase.prototype.getRowValue = function (rowIndex) {
|
29678
|
-
if (rowIndex < 0)
|
29689
|
+
if (rowIndex < 0 || !Array.isArray(this.visibleRows))
|
29679
29690
|
return null;
|
29680
|
-
var
|
29681
|
-
if (rowIndex >=
|
29691
|
+
var rows = this.generatedVisibleRows;
|
29692
|
+
if (rowIndex >= rows.length)
|
29682
29693
|
return null;
|
29683
29694
|
var newValue = this.createNewValue();
|
29684
|
-
return this.getRowValueCore(
|
29695
|
+
return this.getRowValueCore(rows[rowIndex], newValue);
|
29685
29696
|
};
|
29686
29697
|
QuestionMatrixDropdownModelBase.prototype.checkIfValueInRowDuplicated = function (checkedRow, cellQuestion) {
|
29687
29698
|
if (!this.generatedVisibleRows)
|
@@ -30333,9 +30344,9 @@ var question_matrixdropdownbase_QuestionMatrixDropdownModelBase = /** @class */
|
|
30333
30344
|
return { value: newValue, rowValue: rowValue };
|
30334
30345
|
};
|
30335
30346
|
QuestionMatrixDropdownModelBase.prototype.getRowIndex = function (row) {
|
30336
|
-
if (!this.generatedVisibleRows)
|
30347
|
+
if (!Array.isArray(this.generatedVisibleRows))
|
30337
30348
|
return -1;
|
30338
|
-
return this.
|
30349
|
+
return this.generatedVisibleRows.indexOf(row);
|
30339
30350
|
};
|
30340
30351
|
QuestionMatrixDropdownModelBase.prototype.getElementsInDesign = function (includeHidden) {
|
30341
30352
|
if (includeHidden === void 0) { includeHidden = false; }
|
@@ -30733,17 +30744,17 @@ var question_matrixdropdown_QuestionMatrixDropdownModel = /** @class */ (functio
|
|
30733
30744
|
if (!rows)
|
30734
30745
|
return res;
|
30735
30746
|
for (var i = 0; i < rows.length; i++) {
|
30736
|
-
var
|
30737
|
-
var val = value[
|
30747
|
+
var rowName = rows[i].rowName;
|
30748
|
+
var val = value[rowName];
|
30738
30749
|
if (!val)
|
30739
30750
|
continue;
|
30740
30751
|
if (keysAsText) {
|
30741
|
-
var displayRowValue = itemvalue_ItemValue.getTextOrHtmlByValue(this.rows,
|
30752
|
+
var displayRowValue = itemvalue_ItemValue.getTextOrHtmlByValue(this.rows, rowName);
|
30742
30753
|
if (!!displayRowValue) {
|
30743
|
-
|
30754
|
+
rowName = displayRowValue;
|
30744
30755
|
}
|
30745
30756
|
}
|
30746
|
-
res[
|
30757
|
+
res[rowName] = this.getRowDisplayValue(keysAsText, rows[i], val);
|
30747
30758
|
}
|
30748
30759
|
return res;
|
30749
30760
|
};
|
@@ -30798,11 +30809,11 @@ var question_matrixdropdown_QuestionMatrixDropdownModel = /** @class */ (functio
|
|
30798
30809
|
}
|
30799
30810
|
_super.prototype.clearGeneratedRows.call(this);
|
30800
30811
|
};
|
30801
|
-
QuestionMatrixDropdownModel.prototype.getRowValueForCreation = function (val,
|
30802
|
-
var res = val[
|
30812
|
+
QuestionMatrixDropdownModel.prototype.getRowValueForCreation = function (val, rowName) {
|
30813
|
+
var res = val[rowName];
|
30803
30814
|
if (!res)
|
30804
30815
|
return res;
|
30805
|
-
var names = this.defaultValuesInRows[
|
30816
|
+
var names = this.defaultValuesInRows[rowName];
|
30806
30817
|
if (!Array.isArray(names) || names.length === 0)
|
30807
30818
|
return res;
|
30808
30819
|
names.forEach(function (name) {
|
@@ -30849,8 +30860,8 @@ var question_matrixdropdown_QuestionMatrixDropdownModel = /** @class */ (functio
|
|
30849
30860
|
val = {};
|
30850
30861
|
for (var i = 0; i < this.rows.length; i++) {
|
30851
30862
|
var row = this.rows[i];
|
30852
|
-
var
|
30853
|
-
this.updateProgressInfoByRow(res, !!
|
30863
|
+
var rowName = val[row.value];
|
30864
|
+
this.updateProgressInfoByRow(res, !!rowName ? rowName : {});
|
30854
30865
|
}
|
30855
30866
|
};
|
30856
30867
|
return QuestionMatrixDropdownModel;
|
@@ -31684,6 +31695,10 @@ var MatrixDynamicRowModel = /** @class */ (function (_super) {
|
|
31684
31695
|
_this.buildCells(value);
|
31685
31696
|
return _this;
|
31686
31697
|
}
|
31698
|
+
MatrixDynamicRowModel.prototype.getRowIndex = function () {
|
31699
|
+
var res = _super.prototype.getRowIndex.call(this);
|
31700
|
+
return res > 0 ? res : this.index + 1;
|
31701
|
+
};
|
31687
31702
|
Object.defineProperty(MatrixDynamicRowModel.prototype, "rowName", {
|
31688
31703
|
get: function () {
|
31689
31704
|
return this.id;
|
@@ -31913,6 +31928,7 @@ var question_matrixdynamic_QuestionMatrixDynamicModel = /** @class */ (function
|
|
31913
31928
|
return this.rowCountValue;
|
31914
31929
|
},
|
31915
31930
|
set: function (val) {
|
31931
|
+
val = helpers_Helpers.getNumber(val);
|
31916
31932
|
if (val < 0 || val > settings.matrix.maxRowCount)
|
31917
31933
|
return;
|
31918
31934
|
this.setRowCountValueFromData = false;
|
@@ -31945,6 +31961,23 @@ var question_matrixdynamic_QuestionMatrixDynamicModel = /** @class */ (function
|
|
31945
31961
|
enumerable: false,
|
31946
31962
|
configurable: true
|
31947
31963
|
});
|
31964
|
+
QuestionMatrixDynamicModel.prototype.updateBindingProp = function (propName, value) {
|
31965
|
+
_super.prototype.updateBindingProp.call(this, propName, value);
|
31966
|
+
var rows = this.generatedVisibleRows;
|
31967
|
+
if (propName !== "rowCount" || !Array.isArray(rows))
|
31968
|
+
return;
|
31969
|
+
var val = this.getUnbindValue(this.value) || [];
|
31970
|
+
if (val.length < rows.length) {
|
31971
|
+
var hasValue = false;
|
31972
|
+
for (var i = val.length; i < rows.length; i++) {
|
31973
|
+
hasValue || (hasValue = !rows[i].isEmpty);
|
31974
|
+
val.push(rows[i].value || {});
|
31975
|
+
}
|
31976
|
+
if (hasValue) {
|
31977
|
+
this.value = val;
|
31978
|
+
}
|
31979
|
+
}
|
31980
|
+
};
|
31948
31981
|
QuestionMatrixDynamicModel.prototype.updateProgressInfoByValues = function (res) {
|
31949
31982
|
var val = this.value;
|
31950
31983
|
if (!Array.isArray(val))
|
@@ -34417,7 +34450,7 @@ var header_Cover = /** @class */ (function (_super) {
|
|
34417
34450
|
return this.height ? Math.max(this.height, this.actualHeight + 40) + "px" : undefined;
|
34418
34451
|
}
|
34419
34452
|
if (this.survey && this.survey.isMobile) {
|
34420
|
-
return this.mobileHeight ? Math.max(this.mobileHeight, this.actualHeight
|
34453
|
+
return this.mobileHeight ? Math.max(this.mobileHeight, this.actualHeight) + "px" : undefined;
|
34421
34454
|
}
|
34422
34455
|
return undefined;
|
34423
34456
|
},
|
@@ -34498,13 +34531,19 @@ var header_Cover = /** @class */ (function (_super) {
|
|
34498
34531
|
};
|
34499
34532
|
Cover.prototype.processResponsiveness = function (width) {
|
34500
34533
|
if (this.survey && this.survey.rootElement) {
|
34501
|
-
|
34502
|
-
|
34503
|
-
|
34504
|
-
|
34505
|
-
|
34506
|
-
|
34507
|
-
|
34534
|
+
if (!this.survey.isMobile) {
|
34535
|
+
var logoEl = this.survey.rootElement.querySelectorAll(".sv-header__logo")[0];
|
34536
|
+
var titleEl = this.survey.rootElement.querySelectorAll(".sv-header__title")[0];
|
34537
|
+
var descriptionEl = this.survey.rootElement.querySelectorAll(".sv-header__description")[0];
|
34538
|
+
var logoHeight = logoEl ? logoEl.getBoundingClientRect().height : 0;
|
34539
|
+
var titleHeight = titleEl ? titleEl.getBoundingClientRect().height : 0;
|
34540
|
+
var descriptionHeight = descriptionEl ? descriptionEl.getBoundingClientRect().height : 0;
|
34541
|
+
this.actualHeight = this.calculateActualHeight(logoHeight, titleHeight, descriptionHeight);
|
34542
|
+
}
|
34543
|
+
else {
|
34544
|
+
var headerContainer = this.survey.rootElement.querySelectorAll(".sv-header > div")[0];
|
34545
|
+
this.actualHeight = headerContainer ? headerContainer.getBoundingClientRect().height : 0;
|
34546
|
+
}
|
34508
34547
|
}
|
34509
34548
|
};
|
34510
34549
|
Object.defineProperty(Cover.prototype, "hasBackground", {
|
@@ -39565,6 +39604,7 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
39565
39604
|
_this.isNavigationButtonPressed = false;
|
39566
39605
|
_this.mouseDownPage = null;
|
39567
39606
|
_this.isCalculatingProgressText = false;
|
39607
|
+
_this.isSmoothScrollEnabled = false;
|
39568
39608
|
/**
|
39569
39609
|
* An event that is raised when the survey's width or height is changed.
|
39570
39610
|
*/
|
@@ -44614,7 +44654,7 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
44614
44654
|
this.onGetMatrixRowActions.fire(this, options);
|
44615
44655
|
return options.actions;
|
44616
44656
|
};
|
44617
|
-
SurveyModel.prototype.scrollElementToTop = function (element, question, page, id, scrollIfVisible, scrollIntoViewOptions, passedRootElement) {
|
44657
|
+
SurveyModel.prototype.scrollElementToTop = function (element, question, page, id, scrollIfVisible, scrollIntoViewOptions, passedRootElement, onScolledCallback) {
|
44618
44658
|
var _this = this;
|
44619
44659
|
var options = {
|
44620
44660
|
element: element,
|
@@ -44638,11 +44678,12 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
44638
44678
|
survey_element_SurveyElement.ScrollElementToTop(options.elementId, scrollIfVisible, scrollIntoViewOptions, function () {
|
44639
44679
|
_this.releaseLazyRendering();
|
44640
44680
|
activateLazyRenderingChecks(elementPage_1.id);
|
44681
|
+
onScolledCallback && onScolledCallback();
|
44641
44682
|
});
|
44642
44683
|
}, elementsToRenderBefore);
|
44643
44684
|
}
|
44644
44685
|
else {
|
44645
|
-
survey_element_SurveyElement.ScrollElementToTop(options.elementId, scrollIfVisible, scrollIntoViewOptions);
|
44686
|
+
survey_element_SurveyElement.ScrollElementToTop(options.elementId, scrollIfVisible, scrollIntoViewOptions, onScolledCallback);
|
44646
44687
|
}
|
44647
44688
|
}
|
44648
44689
|
};
|
@@ -53719,7 +53760,7 @@ var question_text_QuestionTextModel = /** @class */ (function (_super) {
|
|
53719
53760
|
return inputMask;
|
53720
53761
|
};
|
53721
53762
|
QuestionTextModel.prototype.isTextValue = function () {
|
53722
|
-
return ["text", "number", "password"].indexOf(this.inputType) > -1;
|
53763
|
+
return this.isDateInputType || ["text", "number", "password"].indexOf(this.inputType) > -1;
|
53723
53764
|
};
|
53724
53765
|
QuestionTextModel.prototype.getType = function () {
|
53725
53766
|
return "text";
|
@@ -54063,7 +54104,7 @@ var question_text_QuestionTextModel = /** @class */ (function (_super) {
|
|
54063
54104
|
if (!this.isMinMaxType)
|
54064
54105
|
return true;
|
54065
54106
|
var isValid = !this.isValueLessMin && !this.isValueGreaterMax;
|
54066
|
-
if (this.
|
54107
|
+
if ((!isValid || this.errors.length > 0) && !!this.survey &&
|
54067
54108
|
(this.survey.isValidateOnValueChanging || this.survey.isValidateOnValueChanged)) {
|
54068
54109
|
this.hasErrors();
|
54069
54110
|
}
|
@@ -54193,11 +54234,6 @@ var question_text_QuestionTextModel = /** @class */ (function (_super) {
|
|
54193
54234
|
enumerable: false,
|
54194
54235
|
configurable: true
|
54195
54236
|
});
|
54196
|
-
QuestionTextModel.prototype.canRunValidators = function (isOnValueChanged) {
|
54197
|
-
return (this.errors.length > 0 ||
|
54198
|
-
!isOnValueChanged ||
|
54199
|
-
this.supportGoNextPageError());
|
54200
|
-
};
|
54201
54237
|
QuestionTextModel.prototype.setNewValue = function (newValue) {
|
54202
54238
|
newValue = this.correctValueType(newValue);
|
54203
54239
|
if (!!newValue) {
|
@@ -59004,8 +59040,12 @@ var question_comment_QuestionCommentModel = /** @class */ (function (_super) {
|
|
59004
59040
|
Object.defineProperty(QuestionCommentModel.prototype, "renderedAllowResize", {
|
59005
59041
|
get: function () {
|
59006
59042
|
var res = this.allowResize;
|
59007
|
-
|
59008
|
-
|
59043
|
+
if (res === undefined && this.survey) {
|
59044
|
+
return this.survey.allowResizeComment;
|
59045
|
+
}
|
59046
|
+
else {
|
59047
|
+
return !!res;
|
59048
|
+
}
|
59009
59049
|
},
|
59010
59050
|
enumerable: false,
|
59011
59051
|
configurable: true
|
@@ -59463,11 +59503,6 @@ var question_file_QuestionFileModelBase = /** @class */ (function (_super) {
|
|
59463
59503
|
return QuestionFileModelBase;
|
59464
59504
|
}(question_Question));
|
59465
59505
|
|
59466
|
-
/**
|
59467
|
-
* A class that describes the File Upload question type.
|
59468
|
-
*
|
59469
|
-
* [View Demo](https://surveyjs.io/form-library/examples/file-upload/ (linkStyle))
|
59470
|
-
*/
|
59471
59506
|
var question_file_QuestionFilePage = /** @class */ (function (_super) {
|
59472
59507
|
question_file_extends(QuestionFilePage, _super);
|
59473
59508
|
function QuestionFilePage(question, index) {
|
@@ -59494,6 +59529,11 @@ var question_file_QuestionFilePage = /** @class */ (function (_super) {
|
|
59494
59529
|
return QuestionFilePage;
|
59495
59530
|
}(base_Base));
|
59496
59531
|
|
59532
|
+
/**
|
59533
|
+
* A class that describes the File Upload question type.
|
59534
|
+
*
|
59535
|
+
* [View Demo](https://surveyjs.io/form-library/examples/file-upload/ (linkStyle))
|
59536
|
+
*/
|
59497
59537
|
var question_file_QuestionFileModel = /** @class */ (function (_super) {
|
59498
59538
|
question_file_extends(QuestionFileModel, _super);
|
59499
59539
|
function QuestionFileModel(name) {
|
@@ -66640,9 +66680,8 @@ var question_paneldynamic_QuestionPanelDynamicModel = /** @class */ (function (_
|
|
66640
66680
|
: null;
|
66641
66681
|
};
|
66642
66682
|
QuestionPanelDynamicModel.prototype.addConditionObjectsByContext = function (objects, context) {
|
66643
|
-
var
|
66644
|
-
|
66645
|
-
: false;
|
66683
|
+
var contextQ = !!(context === null || context === void 0 ? void 0 : context.isValidator) ? context.errorOwner : context;
|
66684
|
+
var hasContext = !!context && (context === true || this.template.questions.indexOf(contextQ) > -1);
|
66646
66685
|
var panelObjs = new Array();
|
66647
66686
|
var questions = this.template.questions;
|
66648
66687
|
for (var i = 0; i < questions.length; i++) {
|
@@ -70643,8 +70682,8 @@ Serializer.addClass("currencymask", [
|
|
70643
70682
|
|
70644
70683
|
var Version;
|
70645
70684
|
var ReleaseDate;
|
70646
|
-
Version = "" + "1.12.
|
70647
|
-
ReleaseDate = "" + "2024-10-
|
70685
|
+
Version = "" + "1.12.6";
|
70686
|
+
ReleaseDate = "" + "2024-10-15";
|
70648
70687
|
function checkLibraryVersion(ver, libraryName) {
|
70649
70688
|
if (Version != ver) {
|
70650
70689
|
var str = "survey-core has version '" + Version + "' and " + libraryName
|
@@ -81600,6 +81639,12 @@ var popup_PopupContainer = /** @class */ (function (_super) {
|
|
81600
81639
|
_this.model.clickOutside(e);
|
81601
81640
|
}, onKeyDown: this.handleKeydown }, container));
|
81602
81641
|
};
|
81642
|
+
PopupContainer.prototype.componentDidMount = function () {
|
81643
|
+
_super.prototype.componentDidMount.call(this);
|
81644
|
+
if (this.model.isVisible) {
|
81645
|
+
this.model.updateOnShowing();
|
81646
|
+
}
|
81647
|
+
};
|
81603
81648
|
return PopupContainer;
|
81604
81649
|
}(reactquestion_element_SurveyElementBase));
|
81605
81650
|
|
@@ -81630,12 +81675,26 @@ function showDialog(dialogOptions, rootElement) {
|
|
81630
81675
|
var popupViewModel = createPopupModalViewModel(dialogOptions, rootElement);
|
81631
81676
|
var onVisibilityChangedCallback = function (_, options) {
|
81632
81677
|
if (!options.isVisible) {
|
81633
|
-
external_root_ReactDOM_commonjs2_react_dom_commonjs_react_dom_amd_react_dom_default.a.
|
81678
|
+
if (typeof external_root_ReactDOM_commonjs2_react_dom_commonjs_react_dom_amd_react_dom_default.a.createRoot == "function") {
|
81679
|
+
if (!!root) {
|
81680
|
+
root.unmount();
|
81681
|
+
}
|
81682
|
+
}
|
81683
|
+
else {
|
81684
|
+
external_root_ReactDOM_commonjs2_react_dom_commonjs_react_dom_amd_react_dom_default.a.unmountComponentAtNode(popupViewModel.container);
|
81685
|
+
}
|
81634
81686
|
popupViewModel.dispose();
|
81635
81687
|
}
|
81636
81688
|
};
|
81637
81689
|
popupViewModel.onVisibilityChanged.add(onVisibilityChangedCallback);
|
81638
|
-
|
81690
|
+
var root;
|
81691
|
+
if (typeof external_root_ReactDOM_commonjs2_react_dom_commonjs_react_dom_amd_react_dom_default.a.createRoot == "function") {
|
81692
|
+
root = external_root_ReactDOM_commonjs2_react_dom_commonjs_react_dom_amd_react_dom_default.a.createRoot(popupViewModel.container);
|
81693
|
+
root.render(external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(popup_PopupContainer, { model: popupViewModel }));
|
81694
|
+
}
|
81695
|
+
else {
|
81696
|
+
external_root_ReactDOM_commonjs2_react_dom_commonjs_react_dom_amd_react_dom_default.a.render(external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(popup_PopupContainer, { model: popupViewModel }), popupViewModel.container);
|
81697
|
+
}
|
81639
81698
|
popupViewModel.model.isVisible = true;
|
81640
81699
|
return popupViewModel;
|
81641
81700
|
}
|
@@ -81666,9 +81725,7 @@ var action_bar_item_dropdown_extends = (undefined && undefined.__extends) || (fu
|
|
81666
81725
|
var action_bar_item_dropdown_SurveyActionBarItemDropdown = /** @class */ (function (_super) {
|
81667
81726
|
action_bar_item_dropdown_extends(SurveyActionBarItemDropdown, _super);
|
81668
81727
|
function SurveyActionBarItemDropdown(props) {
|
81669
|
-
|
81670
|
-
_this.viewModel = new ActionDropdownViewModel(_this.item);
|
81671
|
-
return _this;
|
81728
|
+
return _super.call(this, props) || this;
|
81672
81729
|
}
|
81673
81730
|
SurveyActionBarItemDropdown.prototype.renderInnerButton = function () {
|
81674
81731
|
var button = _super.prototype.renderInnerButton.call(this);
|
@@ -81676,6 +81733,9 @@ var action_bar_item_dropdown_SurveyActionBarItemDropdown = /** @class */ (functi
|
|
81676
81733
|
button,
|
81677
81734
|
external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(popup_Popup, { model: this.item.popupModel, getTarget: getActionDropdownButtonTarget })));
|
81678
81735
|
};
|
81736
|
+
SurveyActionBarItemDropdown.prototype.componentDidMount = function () {
|
81737
|
+
this.viewModel = new ActionDropdownViewModel(this.item);
|
81738
|
+
};
|
81679
81739
|
SurveyActionBarItemDropdown.prototype.componentWillUnmount = function () {
|
81680
81740
|
_super.prototype.componentWillUnmount.call(this);
|
81681
81741
|
this.viewModel.dispose();
|
@@ -82066,9 +82126,6 @@ var text_area_TextAreaComponent = /** @class */ (function (_super) {
|
|
82066
82126
|
var _this = this;
|
82067
82127
|
return (external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("textarea", { id: this.viewModel.id, className: this.viewModel.className, ref: function (textarea) { return (_this.viewModel.setElement(textarea)); }, disabled: this.viewModel.isDisabledAttr, readOnly: this.viewModel.isReadOnlyAttr, rows: this.viewModel.rows, cols: this.viewModel.cols, placeholder: this.viewModel.placeholder, maxLength: this.viewModel.maxLength, defaultValue: this.initialValue, onChange: function (event) { _this.viewModel.onTextAreaInput(event); }, onFocus: function (event) { _this.viewModel.onTextAreaFocus(event); }, onBlur: function (event) { _this.viewModel.onTextAreaBlur(event); }, onKeyDown: function (event) { _this.viewModel.onTextAreaKeyDown(event); }, "aria-required": this.viewModel.ariaRequired, "aria-label": this.viewModel.ariaLabel, "aria-labelledby": this.viewModel.ariaLabelledBy, "aria-describedby": this.viewModel.ariaDescribedBy, "aria-invalid": this.viewModel.ariaInvalid, "aria-errormessage": this.viewModel.ariaErrormessage, style: { resize: this.viewModel.question.resizeStyle } }));
|
82068
82128
|
};
|
82069
|
-
TextAreaComponent.prototype.componentWillUnmount = function () {
|
82070
|
-
this.viewModel.dispose();
|
82071
|
-
};
|
82072
82129
|
return TextAreaComponent;
|
82073
82130
|
}(reactquestion_element_SurveyElementBase));
|
82074
82131
|
|
@@ -83083,6 +83140,7 @@ var reactSurvey_Survey = /** @class */ (function (_super) {
|
|
83083
83140
|
if (!!el)
|
83084
83141
|
this.survey.afterRenderSurvey(el);
|
83085
83142
|
this.survey.startTimerFromUI();
|
83143
|
+
this.setSurveyEvents();
|
83086
83144
|
}
|
83087
83145
|
};
|
83088
83146
|
Survey.prototype.shouldComponentUpdate = function (nextProps, nextState) {
|
@@ -83239,7 +83297,6 @@ var reactSurvey_Survey = /** @class */ (function (_super) {
|
|
83239
83297
|
if (!!newProps.css) {
|
83240
83298
|
this.survey.css = this.css;
|
83241
83299
|
}
|
83242
|
-
this.setSurveyEvents();
|
83243
83300
|
};
|
83244
83301
|
Survey.prototype.isModelJSONChanged = function (newProps) {
|
83245
83302
|
if (!!newProps["model"]) {
|
@@ -84543,6 +84600,10 @@ var dropdown_item_SurveyQuestionOptionItem = /** @class */ (function (_super) {
|
|
84543
84600
|
_super.prototype.componentDidUpdate.call(this, prevProps, prevState);
|
84544
84601
|
this.setupModel();
|
84545
84602
|
};
|
84603
|
+
SurveyQuestionOptionItem.prototype.componentDidMount = function () {
|
84604
|
+
_super.prototype.componentDidMount.call(this);
|
84605
|
+
this.setupModel();
|
84606
|
+
};
|
84546
84607
|
SurveyQuestionOptionItem.prototype.componentWillUnmount = function () {
|
84547
84608
|
_super.prototype.componentWillUnmount.call(this);
|
84548
84609
|
if (!!this.item) {
|