survey-react 1.12.3 → 1.12.4
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 +16 -39
- package/defaultV2.css.map +1 -1
- package/defaultV2.min.css +2 -2
- package/modern.css +23 -77
- package/modern.css.map +1 -1
- package/modern.min.css +2 -2
- package/package.json +1 -1
- package/survey.css +11 -17
- package/survey.css.map +1 -1
- package/survey.min.css +2 -2
- package/survey.react.d.ts +58 -20
- package/survey.react.js +426 -163
- 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.4
|
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
|
*/
|
@@ -10223,6 +10223,66 @@ var base_Base = /** @class */ (function () {
|
|
10223
10223
|
return Base;
|
10224
10224
|
}());
|
10225
10225
|
|
10226
|
+
var RenderingCompletedAwaiter = /** @class */ (function () {
|
10227
|
+
function RenderingCompletedAwaiter(_elements, _renderedHandler, waitingTimeout) {
|
10228
|
+
var _this = this;
|
10229
|
+
if (waitingTimeout === void 0) { waitingTimeout = 100; }
|
10230
|
+
this._elements = _elements;
|
10231
|
+
this._renderedHandler = _renderedHandler;
|
10232
|
+
this._elementsToRenderCount = 0;
|
10233
|
+
this._elementsToRenderTimer = undefined;
|
10234
|
+
this._elementRenderedHandler = function (s, o) {
|
10235
|
+
var _a;
|
10236
|
+
(_a = s.onElementRerendered) === null || _a === void 0 ? void 0 : _a.remove(_this._elementRenderedHandler);
|
10237
|
+
_this._elementsToRenderCount--;
|
10238
|
+
if (_this._elementsToRenderCount <= 0) {
|
10239
|
+
_this.visibleElementsRendered();
|
10240
|
+
}
|
10241
|
+
};
|
10242
|
+
this._elements.forEach(function (element) {
|
10243
|
+
if (element.onElementRerendered) {
|
10244
|
+
element.onElementRerendered.add(_this._elementRenderedHandler);
|
10245
|
+
_this._elementsToRenderCount++;
|
10246
|
+
}
|
10247
|
+
});
|
10248
|
+
if (this._elementsToRenderCount > 0) {
|
10249
|
+
this._elementsToRenderTimer = setTimeout(function () {
|
10250
|
+
if (_this._elementsToRenderCount > 0) {
|
10251
|
+
_this.visibleElementsRendered();
|
10252
|
+
}
|
10253
|
+
}, waitingTimeout);
|
10254
|
+
}
|
10255
|
+
else {
|
10256
|
+
this.visibleElementsRendered();
|
10257
|
+
}
|
10258
|
+
}
|
10259
|
+
RenderingCompletedAwaiter.prototype.stopWaitingForElementsRendering = function () {
|
10260
|
+
var _this = this;
|
10261
|
+
if (this._elementsToRenderTimer) {
|
10262
|
+
clearTimeout(this._elementsToRenderTimer);
|
10263
|
+
this._elementsToRenderTimer = undefined;
|
10264
|
+
}
|
10265
|
+
this._elements.forEach(function (element) {
|
10266
|
+
var _a;
|
10267
|
+
(_a = element.onElementRerendered) === null || _a === void 0 ? void 0 : _a.remove(_this._elementRenderedHandler);
|
10268
|
+
});
|
10269
|
+
this._elementsToRenderCount = 0;
|
10270
|
+
};
|
10271
|
+
RenderingCompletedAwaiter.prototype.visibleElementsRendered = function () {
|
10272
|
+
var renderedHandler = this._renderedHandler;
|
10273
|
+
this.dispose();
|
10274
|
+
if (typeof renderedHandler == "function") {
|
10275
|
+
renderedHandler();
|
10276
|
+
}
|
10277
|
+
};
|
10278
|
+
RenderingCompletedAwaiter.prototype.dispose = function () {
|
10279
|
+
this.stopWaitingForElementsRendering();
|
10280
|
+
this._elements = undefined;
|
10281
|
+
this._renderedHandler = undefined;
|
10282
|
+
};
|
10283
|
+
return RenderingCompletedAwaiter;
|
10284
|
+
}());
|
10285
|
+
|
10226
10286
|
var ArrayChanges = /** @class */ (function () {
|
10227
10287
|
function ArrayChanges(index, deleteCount, itemsToAdd, deletedItems) {
|
10228
10288
|
this.index = index;
|
@@ -12991,14 +13051,14 @@ var survey_element_SurveyElement = /** @class */ (function (_super) {
|
|
12991
13051
|
}
|
12992
13052
|
return info;
|
12993
13053
|
};
|
12994
|
-
SurveyElement.ScrollElementToTop = function (elementId, scrollIfVisible, scrollIntoViewOptions) {
|
13054
|
+
SurveyElement.ScrollElementToTop = function (elementId, scrollIfVisible, scrollIntoViewOptions, doneCallback) {
|
12995
13055
|
var root = settings.environment.root;
|
12996
13056
|
if (!elementId || typeof root === "undefined")
|
12997
13057
|
return false;
|
12998
13058
|
var el = root.getElementById(elementId);
|
12999
|
-
return SurveyElement.ScrollElementToViewCore(el, false, scrollIfVisible, scrollIntoViewOptions);
|
13059
|
+
return SurveyElement.ScrollElementToViewCore(el, false, scrollIfVisible, scrollIntoViewOptions, doneCallback);
|
13000
13060
|
};
|
13001
|
-
SurveyElement.ScrollElementToViewCore = function (el, checkLeft, scrollIfVisible, scrollIntoViewOptions) {
|
13061
|
+
SurveyElement.ScrollElementToViewCore = function (el, checkLeft, scrollIfVisible, scrollIntoViewOptions, doneCallback) {
|
13002
13062
|
if (!el || !el.scrollIntoView)
|
13003
13063
|
return false;
|
13004
13064
|
var elTop = scrollIfVisible ? -1 : el.getBoundingClientRect().top;
|
@@ -13018,6 +13078,18 @@ var survey_element_SurveyElement = /** @class */ (function (_super) {
|
|
13018
13078
|
}
|
13019
13079
|
if (needScroll) {
|
13020
13080
|
el.scrollIntoView(scrollIntoViewOptions);
|
13081
|
+
if (typeof doneCallback === "function") {
|
13082
|
+
var currPageXOffset_1 = window.pageXOffset;
|
13083
|
+
var currPageYOffset_1 = window.pageYOffset;
|
13084
|
+
var scrollDone = setInterval(function () {
|
13085
|
+
if (currPageXOffset_1 == window.pageXOffset && currPageYOffset_1 == window.pageYOffset) {
|
13086
|
+
clearInterval(scrollDone);
|
13087
|
+
doneCallback();
|
13088
|
+
}
|
13089
|
+
currPageXOffset_1 = window.pageXOffset;
|
13090
|
+
currPageYOffset_1 = window.pageYOffset;
|
13091
|
+
}, 25);
|
13092
|
+
}
|
13021
13093
|
}
|
13022
13094
|
return needScroll;
|
13023
13095
|
};
|
@@ -13385,6 +13457,17 @@ var survey_element_SurveyElement = /** @class */ (function (_super) {
|
|
13385
13457
|
this.surveyChangedCallback();
|
13386
13458
|
}
|
13387
13459
|
};
|
13460
|
+
Object.defineProperty(SurveyElement.prototype, "skeletonHeight", {
|
13461
|
+
get: function () {
|
13462
|
+
var skeletonHeight = undefined;
|
13463
|
+
if (!!this.survey && this.survey.skeletonHeight) {
|
13464
|
+
skeletonHeight = this.survey.skeletonHeight + "px";
|
13465
|
+
}
|
13466
|
+
return skeletonHeight;
|
13467
|
+
},
|
13468
|
+
enumerable: false,
|
13469
|
+
configurable: true
|
13470
|
+
});
|
13388
13471
|
Object.defineProperty(SurveyElement.prototype, "isInternal", {
|
13389
13472
|
get: function () {
|
13390
13473
|
return this.isContentElement;
|
@@ -14109,7 +14192,8 @@ var survey_element_SurveyElement = /** @class */ (function (_super) {
|
|
14109
14192
|
},
|
14110
14193
|
getLeaveOptions: function () {
|
14111
14194
|
var cssClasses = _this.isPanel ? _this.cssClasses.panel : _this.cssClasses;
|
14112
|
-
return {
|
14195
|
+
return {
|
14196
|
+
cssClass: cssClasses.contentLeave,
|
14113
14197
|
onBeforeRunAnimation: beforeRunAnimation,
|
14114
14198
|
onAfterRunAnimation: afterRunAnimation
|
14115
14199
|
};
|
@@ -14919,7 +15003,7 @@ function findScrollableParent(element) {
|
|
14919
15003
|
}
|
14920
15004
|
return findScrollableParent(element.parentElement);
|
14921
15005
|
}
|
14922
|
-
function
|
15006
|
+
function activateLazyRenderingChecks(id) {
|
14923
15007
|
var environment = settings.environment;
|
14924
15008
|
if (!environment)
|
14925
15009
|
return;
|
@@ -17538,7 +17622,7 @@ var text_area_TextAreaModel = /** @class */ (function () {
|
|
17538
17622
|
};
|
17539
17623
|
TextAreaModel.prototype.getTextValue = function () {
|
17540
17624
|
if (!!this.options.getTextValue)
|
17541
|
-
return this.options.getTextValue();
|
17625
|
+
return this.options.getTextValue() || "";
|
17542
17626
|
return "";
|
17543
17627
|
};
|
17544
17628
|
TextAreaModel.prototype.onTextAreaChange = function (event) {
|
@@ -19415,7 +19499,7 @@ var question_Question = /** @class */ (function (_super) {
|
|
19415
19499
|
});
|
19416
19500
|
Object.defineProperty(Question.prototype, "isDisabledAttr", {
|
19417
19501
|
get: function () {
|
19418
|
-
return this.isDesignModeV2;
|
19502
|
+
return this.isDesignModeV2 || (!!this.readOnlyCallback && this.readOnlyCallback());
|
19419
19503
|
},
|
19420
19504
|
enumerable: false,
|
19421
19505
|
configurable: true
|
@@ -19609,7 +19693,7 @@ var question_Question = /** @class */ (function (_super) {
|
|
19609
19693
|
*
|
19610
19694
|
* | Question type | Value type(s) |
|
19611
19695
|
* | ------------- | ------------- |
|
19612
|
-
* | Checkboxes |
|
19696
|
+
* | Checkboxes | <code>Array<string | number></code> |
|
19613
19697
|
* | Dropdown | `string` \| `number` |
|
19614
19698
|
* | Dynamic Matrix | `Array<object>` |
|
19615
19699
|
* | Dynamic Panel | `Array<object>` |
|
@@ -19617,14 +19701,14 @@ var question_Question = /** @class */ (function (_super) {
|
|
19617
19701
|
* | File Upload | `File` \| `Array<File>` |
|
19618
19702
|
* | HTML | (no value) |
|
19619
19703
|
* | Image | (no value) |
|
19620
|
-
* | Image Picker |
|
19704
|
+
* | Image Picker | <code>Array<string | number></code> |
|
19621
19705
|
* | Long Text | `string` |
|
19622
19706
|
* | Multi-Select Dropdown | `object` |
|
19623
19707
|
* | Multi-Select Matrix | `object` |
|
19624
19708
|
* | Multiple Textboxes | `Array<string>` |
|
19625
19709
|
* | Panel | (no value) |
|
19626
19710
|
* | Radio Button Group | `string` \| `number` |
|
19627
|
-
* | Ranking |
|
19711
|
+
* | Ranking | <code>Array<string | number></code> |
|
19628
19712
|
* | Rating Scale | `number` \| `string` |
|
19629
19713
|
* | Signature | `string` (base64-encoded image) |
|
19630
19714
|
* | Single-Line Input | `string` \| `number` \| `Date` |
|
@@ -20379,11 +20463,12 @@ var question_Question = /** @class */ (function (_super) {
|
|
20379
20463
|
};
|
20380
20464
|
Question.prototype.removeError = function (error) {
|
20381
20465
|
if (!error)
|
20382
|
-
return;
|
20466
|
+
return false;
|
20383
20467
|
var errors = this.errors;
|
20384
20468
|
var index = errors.indexOf(error);
|
20385
20469
|
if (index !== -1)
|
20386
20470
|
errors.splice(index, 1);
|
20471
|
+
return index !== -1;
|
20387
20472
|
};
|
20388
20473
|
Question.prototype.checkForErrors = function (isOnValueChanged, fireCallback) {
|
20389
20474
|
var qErrors = new Array();
|
@@ -29899,9 +29984,11 @@ var question_matrixdropdownbase_QuestionMatrixDropdownModelBase = /** @class */
|
|
29899
29984
|
rec.validationValues = this.getDataFilteredValues();
|
29900
29985
|
rec.isSingleDetailPanel = this.detailPanelMode === "underRowSingle";
|
29901
29986
|
for (var i = 0; i < rows.length; i++) {
|
29902
|
-
|
29903
|
-
|
29904
|
-
|
29987
|
+
if (rows[i].isVisible) {
|
29988
|
+
res = rows[i].hasErrors(fireCallback, rec, function () {
|
29989
|
+
_this.raiseOnCompletedAsyncValidators();
|
29990
|
+
}) || res;
|
29991
|
+
}
|
29905
29992
|
}
|
29906
29993
|
return res;
|
29907
29994
|
};
|
@@ -29988,7 +30075,7 @@ var question_matrixdropdownbase_QuestionMatrixDropdownModelBase = /** @class */
|
|
29988
30075
|
if (duplicatedRows.indexOf(row) < 0) {
|
29989
30076
|
var question = row.getQuestionByName(columnName);
|
29990
30077
|
if (question) {
|
29991
|
-
_this.removeDuplicationError(question);
|
30078
|
+
_this.removeDuplicationError(row, question);
|
29992
30079
|
}
|
29993
30080
|
}
|
29994
30081
|
});
|
@@ -30006,8 +30093,10 @@ var question_matrixdropdownbase_QuestionMatrixDropdownModelBase = /** @class */
|
|
30006
30093
|
question.addError(new KeyDuplicationError(this.keyDuplicationError, this));
|
30007
30094
|
}
|
30008
30095
|
};
|
30009
|
-
QuestionMatrixDropdownModelBase.prototype.removeDuplicationError = function (question) {
|
30010
|
-
question.removeError(this.getDuplicationError(question))
|
30096
|
+
QuestionMatrixDropdownModelBase.prototype.removeDuplicationError = function (row, question) {
|
30097
|
+
if (question.removeError(this.getDuplicationError(question)) && question.errors.length === 0 && !!row.editingObj) {
|
30098
|
+
row.editingObj[question.getValueName()] = question.value;
|
30099
|
+
}
|
30011
30100
|
};
|
30012
30101
|
QuestionMatrixDropdownModelBase.prototype.getFirstQuestionToFocus = function (withError) {
|
30013
30102
|
return this.getFirstCellQuestion(withError);
|
@@ -32464,6 +32553,7 @@ var question_matrixdynamic_QuestionMatrixDynamicModel = /** @class */ (function
|
|
32464
32553
|
newRow = lastDelRow;
|
32465
32554
|
}
|
32466
32555
|
else {
|
32556
|
+
lastDelRow = undefined;
|
32467
32557
|
newRow = this.createMatrixRow(val[index]);
|
32468
32558
|
}
|
32469
32559
|
rows.splice(index, 0, newRow);
|
@@ -34849,6 +34939,13 @@ var panel_QuestionRowModel = /** @class */ (function (_super) {
|
|
34849
34939
|
QuestionRowModel.getRowId = function () {
|
34850
34940
|
return "pr_" + QuestionRowModel.rowCounter++;
|
34851
34941
|
};
|
34942
|
+
Object.defineProperty(QuestionRowModel.prototype, "allowRendering", {
|
34943
|
+
get: function () {
|
34944
|
+
return !this.panel || !this.panel.survey || !this.panel.survey["isLazyRenderingSuspended"];
|
34945
|
+
},
|
34946
|
+
enumerable: false,
|
34947
|
+
configurable: true
|
34948
|
+
});
|
34852
34949
|
QuestionRowModel.prototype.startLazyRendering = function (rowContainerDiv, findScrollableContainer) {
|
34853
34950
|
var _this = this;
|
34854
34951
|
if (findScrollableContainer === void 0) { findScrollableContainer = findScrollableParent; }
|
@@ -34863,6 +34960,9 @@ var panel_QuestionRowModel = /** @class */ (function (_super) {
|
|
34863
34960
|
this.isNeedRender = !hasScroll;
|
34864
34961
|
if (hasScroll) {
|
34865
34962
|
this._updateVisibility = function () {
|
34963
|
+
if (!_this.allowRendering) {
|
34964
|
+
return;
|
34965
|
+
}
|
34866
34966
|
var isRowContainerDivVisible = isElementVisible(rowContainerDiv, 50);
|
34867
34967
|
if (!_this.isNeedRender && isRowContainerDivVisible) {
|
34868
34968
|
_this.isNeedRender = true;
|
@@ -34996,6 +35096,10 @@ var panel_QuestionRowModel = /** @class */ (function (_super) {
|
|
34996
35096
|
if (this.elements[i].isVisible) {
|
34997
35097
|
visElements.push(this.elements[i]);
|
34998
35098
|
}
|
35099
|
+
if (this.elements[i].isPanel || this.elements[i].getType() === "paneldynamic") {
|
35100
|
+
this.setIsLazyRendering(false);
|
35101
|
+
this.stopLazyRendering();
|
35102
|
+
}
|
34999
35103
|
}
|
35000
35104
|
this.visibleElements = visElements;
|
35001
35105
|
return;
|
@@ -36206,11 +36310,21 @@ var panel_PanelModelBase = /** @class */ (function (_super) {
|
|
36206
36310
|
this.onVisibleChanged();
|
36207
36311
|
}
|
36208
36312
|
};
|
36313
|
+
PanelModelBase.prototype.canRenderFirstRows = function () {
|
36314
|
+
return this.isPage;
|
36315
|
+
};
|
36316
|
+
PanelModelBase.prototype.isLazyRenderInRow = function (rowIndex) {
|
36317
|
+
if (!this.survey || !this.survey.isLazyRendering)
|
36318
|
+
return false;
|
36319
|
+
return (rowIndex >= this.survey.lazyRenderingFirstBatchSize ||
|
36320
|
+
!this.canRenderFirstRows());
|
36321
|
+
};
|
36209
36322
|
PanelModelBase.prototype.createRowAndSetLazy = function (index) {
|
36210
36323
|
var row = this.createRow();
|
36211
36324
|
row.setIsLazyRendering(this.isLazyRenderInRow(index));
|
36212
36325
|
return row;
|
36213
36326
|
};
|
36327
|
+
// TODO V2: make all createRow API private (at least protected) after removing DragDropPanelHelperV1
|
36214
36328
|
PanelModelBase.prototype.createRow = function () {
|
36215
36329
|
return new panel_QuestionRowModel(this);
|
36216
36330
|
};
|
@@ -36441,15 +36555,6 @@ var panel_PanelModelBase = /** @class */ (function (_super) {
|
|
36441
36555
|
}
|
36442
36556
|
return result;
|
36443
36557
|
};
|
36444
|
-
PanelModelBase.prototype.isLazyRenderInRow = function (rowIndex) {
|
36445
|
-
if (!this.survey || !this.survey.isLazyRendering)
|
36446
|
-
return false;
|
36447
|
-
return (rowIndex >= this.survey.lazyRenderingFirstBatchSize ||
|
36448
|
-
!this.canRenderFirstRows());
|
36449
|
-
};
|
36450
|
-
PanelModelBase.prototype.canRenderFirstRows = function () {
|
36451
|
-
return this.isPage;
|
36452
|
-
};
|
36453
36558
|
PanelModelBase.prototype.getDragDropInfo = function () {
|
36454
36559
|
var page = this.getPage(this.parent);
|
36455
36560
|
return !!page ? page.getDragDropInfo() : undefined;
|
@@ -36479,27 +36584,74 @@ var panel_PanelModelBase = /** @class */ (function (_super) {
|
|
36479
36584
|
}
|
36480
36585
|
}
|
36481
36586
|
};
|
36482
|
-
PanelModelBase.prototype.
|
36483
|
-
var
|
36484
|
-
var
|
36485
|
-
|
36486
|
-
var
|
36487
|
-
|
36488
|
-
|
36489
|
-
|
36490
|
-
|
36491
|
-
|
36492
|
-
|
36493
|
-
|
36494
|
-
|
36587
|
+
PanelModelBase.prototype.getAllRows = function () {
|
36588
|
+
var _this = this;
|
36589
|
+
var allRows = [];
|
36590
|
+
this.rows.forEach(function (row) {
|
36591
|
+
var nestedRows = [];
|
36592
|
+
row.elements.forEach(function (element) {
|
36593
|
+
if (element.isPanel) {
|
36594
|
+
nestedRows.push.apply(nestedRows, element.getAllRows());
|
36595
|
+
}
|
36596
|
+
else if (element.getType() == "paneldynamic") {
|
36597
|
+
if (_this.isDesignMode) {
|
36598
|
+
nestedRows.push.apply(nestedRows, element.template.getAllRows());
|
36599
|
+
}
|
36600
|
+
else {
|
36601
|
+
element.panels.forEach(function (panel) { return nestedRows.push.apply(nestedRows, panel.getAllRows()); });
|
36602
|
+
}
|
36603
|
+
}
|
36604
|
+
});
|
36605
|
+
allRows.push(row);
|
36606
|
+
allRows.push.apply(allRows, nestedRows);
|
36607
|
+
});
|
36608
|
+
return allRows;
|
36495
36609
|
};
|
36496
|
-
PanelModelBase.prototype.
|
36497
|
-
|
36610
|
+
PanelModelBase.prototype.findRowAndIndexByElement = function (el, rows) {
|
36611
|
+
if (!el) {
|
36612
|
+
return { row: undefined, index: this.rows.length - 1 };
|
36613
|
+
}
|
36614
|
+
rows = rows || this.rows;
|
36498
36615
|
for (var i = 0; i < rows.length; i++) {
|
36499
36616
|
if (rows[i].elements.indexOf(el) > -1)
|
36500
|
-
return rows[i];
|
36617
|
+
return { row: rows[i], index: i };
|
36501
36618
|
}
|
36502
|
-
return null;
|
36619
|
+
return { row: null, index: -1 };
|
36620
|
+
};
|
36621
|
+
PanelModelBase.prototype.forceRenderRow = function (row) {
|
36622
|
+
if (!!row && !row.isNeedRender) {
|
36623
|
+
row.isNeedRender = true;
|
36624
|
+
row.stopLazyRendering();
|
36625
|
+
}
|
36626
|
+
};
|
36627
|
+
PanelModelBase.prototype.forceRenderElement = function (el, elementsRendered, gap) {
|
36628
|
+
if (elementsRendered === void 0) { elementsRendered = function () { }; }
|
36629
|
+
if (gap === void 0) { gap = 0; }
|
36630
|
+
var allRows = this.getAllRows();
|
36631
|
+
var _a = this.findRowAndIndexByElement(el, allRows), row = _a.row, index = _a.index;
|
36632
|
+
if (index >= 0 && index < allRows.length) {
|
36633
|
+
var rowsToRender = [];
|
36634
|
+
rowsToRender.push(row);
|
36635
|
+
for (var i = index - 1; i >= index - gap && i >= 0; i--) {
|
36636
|
+
rowsToRender.push(allRows[i]);
|
36637
|
+
}
|
36638
|
+
this.forceRenderRows(rowsToRender, elementsRendered);
|
36639
|
+
}
|
36640
|
+
};
|
36641
|
+
PanelModelBase.prototype.forceRenderRows = function (rows, elementsRendered) {
|
36642
|
+
var _this = this;
|
36643
|
+
if (elementsRendered === void 0) { elementsRendered = function () { }; }
|
36644
|
+
var rowRenderedHandler = (function (rowsCount) { return function () {
|
36645
|
+
rowsCount--;
|
36646
|
+
if (rowsCount <= 0) {
|
36647
|
+
elementsRendered();
|
36648
|
+
}
|
36649
|
+
}; })(rows.length);
|
36650
|
+
rows.forEach(function (row) { return new RenderingCompletedAwaiter(row.visibleElements, rowRenderedHandler); });
|
36651
|
+
rows.forEach(function (row) { return _this.forceRenderRow(row); });
|
36652
|
+
};
|
36653
|
+
PanelModelBase.prototype.findRowByElement = function (el) {
|
36654
|
+
return this.findRowAndIndexByElement(el).row;
|
36503
36655
|
};
|
36504
36656
|
PanelModelBase.prototype.elementWidthChanged = function (el) {
|
36505
36657
|
if (this.isLoadingFromJson)
|
@@ -37183,7 +37335,7 @@ var panel_PanelModel = /** @class */ (function (_super) {
|
|
37183
37335
|
};
|
37184
37336
|
PanelModel.prototype.beforeSetVisibleIndex = function (index) {
|
37185
37337
|
var visibleIndex = -1;
|
37186
|
-
if (this.showNumber && (this.isDesignMode || !this.locTitle.isEmpty)) {
|
37338
|
+
if (this.showNumber && (this.isDesignMode || !this.locTitle.isEmpty || this.hasParentInQuestionIndex())) {
|
37187
37339
|
visibleIndex = index;
|
37188
37340
|
}
|
37189
37341
|
this.setPropertyValue("visibleIndex", visibleIndex);
|
@@ -37191,14 +37343,21 @@ var panel_PanelModel = /** @class */ (function (_super) {
|
|
37191
37343
|
return visibleIndex < 0 ? 0 : 1;
|
37192
37344
|
};
|
37193
37345
|
PanelModel.prototype.getPanelStartIndex = function (index) {
|
37194
|
-
if (this.showQuestionNumbers
|
37346
|
+
if (this.showQuestionNumbers === "off")
|
37195
37347
|
return -1;
|
37196
|
-
if (this.showQuestionNumbers
|
37348
|
+
if (this.showQuestionNumbers === "onpanel")
|
37197
37349
|
return 0;
|
37198
37350
|
return index;
|
37199
37351
|
};
|
37352
|
+
PanelModel.prototype.hasParentInQuestionIndex = function () {
|
37353
|
+
if (this.showQuestionNumbers !== "onpanel")
|
37354
|
+
return false;
|
37355
|
+
var str = this.questionStartIndex;
|
37356
|
+
var index = str.indexOf(".");
|
37357
|
+
return index > -1 && index < str.length - 1;
|
37358
|
+
};
|
37200
37359
|
PanelModel.prototype.isContinueNumbering = function () {
|
37201
|
-
return
|
37360
|
+
return this.showQuestionNumbers !== "off" && this.showQuestionNumbers !== "onpanel";
|
37202
37361
|
};
|
37203
37362
|
PanelModel.prototype.notifySurveyOnVisibilityChanged = function () {
|
37204
37363
|
if (this.survey != null && !this.isLoadingFromJson) {
|
@@ -37866,6 +38025,13 @@ var page_PageModel = /** @class */ (function (_super) {
|
|
37866
38025
|
this.locNavigationTitle.strChanged();
|
37867
38026
|
this.locNavigationDescription.strChanged();
|
37868
38027
|
};
|
38028
|
+
PageModel.prototype.getMarkdownHtml = function (text, name) {
|
38029
|
+
var result = _super.prototype.getMarkdownHtml.call(this, text, name);
|
38030
|
+
if (name === "navigationTitle" && this.canShowPageNumber() && result) {
|
38031
|
+
return this.num + ". " + result;
|
38032
|
+
}
|
38033
|
+
return result;
|
38034
|
+
};
|
37869
38035
|
Object.defineProperty(PageModel.prototype, "passed", {
|
37870
38036
|
get: function () {
|
37871
38037
|
return this.getPropertyValue("passed", false);
|
@@ -39267,6 +39433,7 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
39267
39433
|
*/
|
39268
39434
|
_this.jsonErrors = null;
|
39269
39435
|
_this.cssValue = null;
|
39436
|
+
_this._isLazyRenderingSuspended = false;
|
39270
39437
|
/**
|
39271
39438
|
* Specifies whether to hide validation errors thrown by the Required validation in the UI.
|
39272
39439
|
*
|
@@ -39303,6 +39470,7 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
39303
39470
|
_this.onResize = new EventBase();
|
39304
39471
|
_this.isCurrentPageRendering = true;
|
39305
39472
|
_this.isCurrentPageRendered = undefined;
|
39473
|
+
_this.skeletonHeight = undefined;
|
39306
39474
|
_this.isTriggerIsRunning = false;
|
39307
39475
|
_this.triggerValues = null;
|
39308
39476
|
_this.triggerKeys = null;
|
@@ -39789,22 +39957,29 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
39789
39957
|
enumerable: false,
|
39790
39958
|
configurable: true
|
39791
39959
|
});
|
39792
|
-
SurveyModel.prototype
|
39793
|
-
|
39794
|
-
|
39795
|
-
|
39796
|
-
|
39797
|
-
|
39798
|
-
|
39799
|
-
|
39800
|
-
|
39960
|
+
Object.defineProperty(SurveyModel.prototype, "isLazyRenderingSuspended", {
|
39961
|
+
get: function () {
|
39962
|
+
return this._isLazyRenderingSuspended;
|
39963
|
+
},
|
39964
|
+
enumerable: false,
|
39965
|
+
configurable: true
|
39966
|
+
});
|
39967
|
+
SurveyModel.prototype.suspendLazyRendering = function () {
|
39968
|
+
if (!this.isLazyRendering)
|
39969
|
+
return;
|
39970
|
+
this._isLazyRenderingSuspended = true;
|
39971
|
+
};
|
39972
|
+
SurveyModel.prototype.releaseLazyRendering = function () {
|
39973
|
+
if (!this.isLazyRendering)
|
39974
|
+
return;
|
39975
|
+
this._isLazyRenderingSuspended = false;
|
39801
39976
|
};
|
39802
39977
|
SurveyModel.prototype.updateLazyRenderingRowsOnRemovingElements = function () {
|
39803
39978
|
if (!this.isLazyRendering)
|
39804
39979
|
return;
|
39805
39980
|
var page = this.currentPage;
|
39806
39981
|
if (!!page) {
|
39807
|
-
|
39982
|
+
activateLazyRenderingChecks(page.id);
|
39808
39983
|
}
|
39809
39984
|
};
|
39810
39985
|
Object.defineProperty(SurveyModel.prototype, "triggers", {
|
@@ -41037,13 +41212,20 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
41037
41212
|
/**
|
41038
41213
|
* Calculates a given [expression](https://surveyjs.io/form-library/documentation/design-survey/conditional-logic#expressions) and returns a result value.
|
41039
41214
|
* @param expression An expression to calculate.
|
41215
|
+
* @param callback A callback function that you can use to access the calculation result if the expression uses asynchronous functions.
|
41040
41216
|
*/
|
41041
|
-
SurveyModel.prototype.runExpression = function (expression) {
|
41217
|
+
SurveyModel.prototype.runExpression = function (expression, callback) {
|
41042
41218
|
if (!expression)
|
41043
41219
|
return null;
|
41044
41220
|
var values = this.getFilteredValues();
|
41045
41221
|
var properties = this.getFilteredProperties();
|
41046
|
-
|
41222
|
+
var exp = new ExpressionRunner(expression);
|
41223
|
+
var onCompleteRes = undefined;
|
41224
|
+
exp.onRunComplete = function (res) {
|
41225
|
+
onCompleteRes = res;
|
41226
|
+
callback && callback(res);
|
41227
|
+
};
|
41228
|
+
return exp.run(values, properties) || onCompleteRes;
|
41047
41229
|
};
|
41048
41230
|
/**
|
41049
41231
|
* Calculates a given [expression](https://surveyjs.io/form-library/documentation/design-survey/conditional-logic#expressions) and returns `true` or `false`.
|
@@ -44331,7 +44513,8 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
44331
44513
|
this.onGetMatrixRowActions.fire(this, options);
|
44332
44514
|
return options.actions;
|
44333
44515
|
};
|
44334
|
-
SurveyModel.prototype.scrollElementToTop = function (element, question, page, id, scrollIfVisible, scrollIntoViewOptions) {
|
44516
|
+
SurveyModel.prototype.scrollElementToTop = function (element, question, page, id, scrollIfVisible, scrollIntoViewOptions, passedRootElement) {
|
44517
|
+
var _this = this;
|
44335
44518
|
var options = {
|
44336
44519
|
element: element,
|
44337
44520
|
question: question,
|
@@ -44341,7 +44524,25 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
44341
44524
|
};
|
44342
44525
|
this.onScrollingElementToTop.fire(this, options);
|
44343
44526
|
if (!options.cancel) {
|
44344
|
-
|
44527
|
+
var elementPage_1 = this.getPageByElement(element);
|
44528
|
+
if (this.isLazyRendering) {
|
44529
|
+
var elementsToRenderBefore = 1;
|
44530
|
+
var rootElement = settings.environment.rootElement;
|
44531
|
+
var surveyRootElement = this.rootElement || passedRootElement || rootElement;
|
44532
|
+
if (!!this.skeletonHeight && !!surveyRootElement && typeof surveyRootElement.getBoundingClientRect === "function") {
|
44533
|
+
elementsToRenderBefore = surveyRootElement.getBoundingClientRect().height / this.skeletonHeight - 1;
|
44534
|
+
}
|
44535
|
+
elementPage_1.forceRenderElement(element, function () {
|
44536
|
+
_this.suspendLazyRendering();
|
44537
|
+
survey_element_SurveyElement.ScrollElementToTop(options.elementId, scrollIfVisible, scrollIntoViewOptions, function () {
|
44538
|
+
_this.releaseLazyRendering();
|
44539
|
+
activateLazyRenderingChecks(elementPage_1.id);
|
44540
|
+
});
|
44541
|
+
}, elementsToRenderBefore);
|
44542
|
+
}
|
44543
|
+
else {
|
44544
|
+
survey_element_SurveyElement.ScrollElementToTop(options.elementId, scrollIfVisible, scrollIntoViewOptions);
|
44545
|
+
}
|
44345
44546
|
}
|
44346
44547
|
};
|
44347
44548
|
/**
|
@@ -52079,11 +52280,16 @@ var question_matrix_MatrixRowModel = /** @class */ (function (_super) {
|
|
52079
52280
|
return MatrixRowModel;
|
52080
52281
|
}(base_Base));
|
52081
52282
|
|
52082
|
-
var question_matrix_MatrixCells = /** @class */ (function () {
|
52283
|
+
var question_matrix_MatrixCells = /** @class */ (function (_super) {
|
52284
|
+
question_matrix_extends(MatrixCells, _super);
|
52083
52285
|
function MatrixCells(cellsOwner) {
|
52084
|
-
|
52085
|
-
|
52286
|
+
var _this = _super.call(this) || this;
|
52287
|
+
_this.cellsOwner = cellsOwner;
|
52288
|
+
_this.values = {};
|
52289
|
+
_this.locs = {};
|
52290
|
+
return _this;
|
52086
52291
|
}
|
52292
|
+
MatrixCells.prototype.getType = function () { return "cells"; };
|
52087
52293
|
Object.defineProperty(MatrixCells.prototype, "isEmpty", {
|
52088
52294
|
get: function () {
|
52089
52295
|
return Object.keys(this.values).length == 0;
|
@@ -52092,78 +52298,97 @@ var question_matrix_MatrixCells = /** @class */ (function () {
|
|
52092
52298
|
configurable: true
|
52093
52299
|
});
|
52094
52300
|
MatrixCells.prototype.valuesChanged = function () {
|
52095
|
-
if (!!this.onValuesChanged) {
|
52301
|
+
if (!this.locNotification && !!this.onValuesChanged) {
|
52096
52302
|
this.onValuesChanged();
|
52097
52303
|
}
|
52098
52304
|
};
|
52099
|
-
MatrixCells.prototype.
|
52305
|
+
MatrixCells.prototype.getDefaultCellLocText = function (column) {
|
52306
|
+
return this.getCellLocCore(this.defaultRowValue, column);
|
52307
|
+
};
|
52308
|
+
MatrixCells.prototype.getCellDisplayLocText = function (row, column) {
|
52309
|
+
return this.getCellLocCore(row, column);
|
52310
|
+
};
|
52311
|
+
MatrixCells.prototype.getCellLocCore = function (row, col) {
|
52312
|
+
var _this = this;
|
52100
52313
|
row = this.getCellRowColumnValue(row, this.rows);
|
52101
|
-
|
52102
|
-
if (
|
52103
|
-
return;
|
52104
|
-
if (
|
52105
|
-
|
52106
|
-
this.values[row] = {};
|
52107
|
-
if (!this.values[row][column])
|
52108
|
-
this.values[row][column] = this.createString();
|
52109
|
-
this.values[row][column].text = val;
|
52314
|
+
col = this.getCellRowColumnValue(col, this.columns);
|
52315
|
+
if (helpers_Helpers.isValueEmpty(row) || helpers_Helpers.isValueEmpty(col))
|
52316
|
+
return null;
|
52317
|
+
if (!this.locs[row]) {
|
52318
|
+
this.locs[row] = {};
|
52110
52319
|
}
|
52111
|
-
|
52112
|
-
|
52113
|
-
|
52114
|
-
|
52115
|
-
|
52116
|
-
|
52117
|
-
|
52118
|
-
|
52320
|
+
var res = this.locs[row][col];
|
52321
|
+
if (!res) {
|
52322
|
+
res = this.createString();
|
52323
|
+
res.setJson(this.getCellLocData(row, col));
|
52324
|
+
res.onGetTextCallback = function (str) {
|
52325
|
+
if (!str) {
|
52326
|
+
var column = itemvalue_ItemValue.getItemByValue(_this.columns, col);
|
52327
|
+
if (column) {
|
52328
|
+
return column.locText.getJson() || column.value;
|
52119
52329
|
}
|
52120
52330
|
}
|
52121
|
-
|
52331
|
+
return str;
|
52332
|
+
};
|
52333
|
+
res.onStrChanged = function (oldValue, newValue) {
|
52334
|
+
_this.updateValues(row, col, newValue);
|
52335
|
+
};
|
52336
|
+
this.locs[row][col] = res;
|
52122
52337
|
}
|
52123
|
-
|
52338
|
+
return res;
|
52124
52339
|
};
|
52125
|
-
MatrixCells.prototype
|
52126
|
-
|
52340
|
+
Object.defineProperty(MatrixCells.prototype, "defaultRowValue", {
|
52341
|
+
get: function () { return settings.matrix.defaultRowName; },
|
52342
|
+
enumerable: false,
|
52343
|
+
configurable: true
|
52344
|
+
});
|
52345
|
+
MatrixCells.prototype.getCellLocData = function (row, col) {
|
52346
|
+
var data = this.getCellLocDataFromValue(row, col);
|
52347
|
+
if (data)
|
52348
|
+
return data;
|
52349
|
+
return this.getCellLocDataFromValue(this.defaultRowValue, col);
|
52127
52350
|
};
|
52128
|
-
MatrixCells.prototype.
|
52129
|
-
row = this.getCellRowColumnValue(row, this.rows);
|
52130
|
-
column = this.getCellRowColumnValue(column, this.columns);
|
52131
|
-
if (!row || !column)
|
52132
|
-
return null;
|
52351
|
+
MatrixCells.prototype.getCellLocDataFromValue = function (row, column) {
|
52133
52352
|
if (!this.values[row])
|
52134
52353
|
return null;
|
52135
52354
|
if (!this.values[row][column])
|
52136
52355
|
return null;
|
52137
52356
|
return this.values[row][column];
|
52138
52357
|
};
|
52139
|
-
MatrixCells.prototype.
|
52140
|
-
|
52358
|
+
MatrixCells.prototype.getCellText = function (row, column) {
|
52359
|
+
var loc = this.getCellLocCore(row, column);
|
52360
|
+
return loc ? loc.calculatedText : null;
|
52141
52361
|
};
|
52142
|
-
MatrixCells.prototype.
|
52143
|
-
var
|
52144
|
-
if (
|
52145
|
-
|
52146
|
-
cellText = this.getCellLocText(settings.matrix.defaultRowName, column);
|
52147
|
-
if (cellText && !cellText.isEmpty)
|
52148
|
-
return cellText;
|
52149
|
-
if (typeof column == "number") {
|
52150
|
-
column =
|
52151
|
-
column >= 0 && column < this.columns.length
|
52152
|
-
? this.columns[column]
|
52153
|
-
: null;
|
52362
|
+
MatrixCells.prototype.setCellText = function (row, column, val) {
|
52363
|
+
var loc = this.getCellLocCore(row, column);
|
52364
|
+
if (loc) {
|
52365
|
+
loc.text = val;
|
52154
52366
|
}
|
52155
|
-
if (column && column.locText)
|
52156
|
-
return column.locText;
|
52157
|
-
return null;
|
52158
52367
|
};
|
52159
|
-
MatrixCells.prototype.
|
52160
|
-
|
52161
|
-
|
52368
|
+
MatrixCells.prototype.updateValues = function (row, column, val) {
|
52369
|
+
if (val) {
|
52370
|
+
if (!this.values[row])
|
52371
|
+
this.values[row] = {};
|
52372
|
+
this.values[row][column] = val;
|
52373
|
+
this.valuesChanged();
|
52374
|
+
}
|
52375
|
+
else {
|
52376
|
+
if (this.values[row] && this.values[row][column]) {
|
52377
|
+
delete this.values[row][column];
|
52378
|
+
if (Object.keys(this.values[row]).length == 0) {
|
52379
|
+
delete this.values[row];
|
52380
|
+
}
|
52381
|
+
this.valuesChanged();
|
52382
|
+
}
|
52383
|
+
}
|
52162
52384
|
};
|
52163
52385
|
MatrixCells.prototype.getDefaultCellText = function (column) {
|
52164
|
-
var loc = this.
|
52386
|
+
var loc = this.getCellLocCore(this.defaultRowValue, column);
|
52165
52387
|
return loc ? loc.calculatedText : null;
|
52166
52388
|
};
|
52389
|
+
MatrixCells.prototype.setDefaultCellText = function (column, val) {
|
52390
|
+
this.setCellText(this.defaultRowValue, column, val);
|
52391
|
+
};
|
52167
52392
|
MatrixCells.prototype.getCellDisplayText = function (row, column) {
|
52168
52393
|
var loc = this.getCellDisplayLocText(row, column);
|
52169
52394
|
return loc ? loc.calculatedText : null;
|
@@ -52197,18 +52422,22 @@ var question_matrix_MatrixCells = /** @class */ (function () {
|
|
52197
52422
|
MatrixCells.prototype.getJson = function () {
|
52198
52423
|
if (this.isEmpty)
|
52199
52424
|
return null;
|
52425
|
+
var defaultRow = this.values[this.defaultRowValue];
|
52200
52426
|
var res = {};
|
52201
52427
|
for (var row in this.values) {
|
52202
52428
|
var resRow = {};
|
52203
52429
|
var rowValues = this.values[row];
|
52204
52430
|
for (var col in rowValues) {
|
52205
|
-
|
52431
|
+
if (row === this.defaultRowValue || !defaultRow || defaultRow[col] !== rowValues[col]) {
|
52432
|
+
resRow[col] = rowValues[col];
|
52433
|
+
}
|
52206
52434
|
}
|
52207
52435
|
res[row] = resRow;
|
52208
52436
|
}
|
52209
52437
|
return res;
|
52210
52438
|
};
|
52211
52439
|
MatrixCells.prototype.setJson = function (value) {
|
52440
|
+
var _this = this;
|
52212
52441
|
this.values = {};
|
52213
52442
|
if (!!value) {
|
52214
52443
|
for (var row in value) {
|
@@ -52219,21 +52448,23 @@ var question_matrix_MatrixCells = /** @class */ (function () {
|
|
52219
52448
|
for (var col in rowValues) {
|
52220
52449
|
if (col == "pos")
|
52221
52450
|
continue;
|
52222
|
-
|
52223
|
-
loc.setJson(rowValues[col]);
|
52224
|
-
this.values[row][col] = loc;
|
52451
|
+
this.values[row][col] = rowValues[col];
|
52225
52452
|
}
|
52226
52453
|
}
|
52227
52454
|
}
|
52455
|
+
this.locNotification = true;
|
52456
|
+
this.runFuncOnLocs(function (row, col, loc) { return loc.setJson(_this.getCellLocData(row, col)); });
|
52457
|
+
this.locNotification = false;
|
52228
52458
|
this.valuesChanged();
|
52229
52459
|
};
|
52230
52460
|
MatrixCells.prototype.locStrsChanged = function () {
|
52231
|
-
|
52232
|
-
|
52233
|
-
|
52234
|
-
|
52461
|
+
this.runFuncOnLocs(function (row, col, loc) { return loc.strChanged(); });
|
52462
|
+
};
|
52463
|
+
MatrixCells.prototype.runFuncOnLocs = function (func) {
|
52464
|
+
for (var row in this.locs) {
|
52465
|
+
var rowValues = this.locs[row];
|
52235
52466
|
for (var col in rowValues) {
|
52236
|
-
rowValues[col]
|
52467
|
+
func(row, col, rowValues[col]);
|
52237
52468
|
}
|
52238
52469
|
}
|
52239
52470
|
};
|
@@ -52241,7 +52472,7 @@ var question_matrix_MatrixCells = /** @class */ (function () {
|
|
52241
52472
|
return new localizablestring_LocalizableString(this.cellsOwner, true);
|
52242
52473
|
};
|
52243
52474
|
return MatrixCells;
|
52244
|
-
}());
|
52475
|
+
}(base_Base));
|
52245
52476
|
|
52246
52477
|
/**
|
52247
52478
|
* A class that describes the Single-Select Matrix question type.
|
@@ -53202,6 +53433,7 @@ var question_text_QuestionTextModel = /** @class */ (function (_super) {
|
|
53202
53433
|
_this.updateRemainingCharacterCounter(event.target.value);
|
53203
53434
|
};
|
53204
53435
|
_this.onKeyUp = function (event) {
|
53436
|
+
_this.updateDateValidationMessage(event);
|
53205
53437
|
if (_this.isInputTextUpdate) {
|
53206
53438
|
if (!_this._isWaitingForEnter || event.keyCode === 13) {
|
53207
53439
|
_this.updateValueOnEvent(event);
|
@@ -53216,7 +53448,6 @@ var question_text_QuestionTextModel = /** @class */ (function (_super) {
|
|
53216
53448
|
_this.updateRemainingCharacterCounter(event.target.value);
|
53217
53449
|
};
|
53218
53450
|
_this.onKeyDown = function (event) {
|
53219
|
-
_this.updateDateValidationMessage(event);
|
53220
53451
|
_this.onKeyDownPreprocess && _this.onKeyDownPreprocess(event);
|
53221
53452
|
if (_this.isInputTextUpdate) {
|
53222
53453
|
_this._isWaitingForEnter = event.keyCode === 229;
|
@@ -57924,6 +58155,11 @@ var question_ranking_QuestionRankingModel = /** @class */ (function (_super) {
|
|
57924
58155
|
this.updateRankingChoices();
|
57925
58156
|
this.releaseAnimations();
|
57926
58157
|
};
|
58158
|
+
QuestionRankingModel.prototype.updateValueFromSurvey = function (newValue, clearData) {
|
58159
|
+
_super.prototype.updateValueFromSurvey.call(this, newValue, clearData);
|
58160
|
+
if (newValue)
|
58161
|
+
this.isValueSetByUser = true;
|
58162
|
+
};
|
57927
58163
|
QuestionRankingModel.prototype.addToValueByVisibleChoices = function () {
|
57928
58164
|
var newValue = this.value.slice();
|
57929
58165
|
this.visibleChoices.forEach(function (choice) {
|
@@ -60634,8 +60870,14 @@ var question_rating_QuestionRatingModel = /** @class */ (function (_super) {
|
|
60634
60870
|
}
|
60635
60871
|
_this.createRenderedRateItems();
|
60636
60872
|
});
|
60637
|
-
_this.createLocalizableString("minRateDescription", _this, true)
|
60638
|
-
|
60873
|
+
_this.createLocalizableString("minRateDescription", _this, true)
|
60874
|
+
.onStringChanged.add(function (sender, options) {
|
60875
|
+
_this.hasMinRateDescription = !sender.isEmpty;
|
60876
|
+
});
|
60877
|
+
_this.createLocalizableString("maxRateDescription", _this, true)
|
60878
|
+
.onStringChanged.add(function (sender, options) {
|
60879
|
+
_this.hasMaxRateDescription = !sender.isEmpty;
|
60880
|
+
});
|
60639
60881
|
_this.initPropertyDependencies();
|
60640
60882
|
return _this;
|
60641
60883
|
}
|
@@ -60647,8 +60889,6 @@ var question_rating_QuestionRatingModel = /** @class */ (function (_super) {
|
|
60647
60889
|
};
|
60648
60890
|
QuestionRatingModel.prototype.endLoadingFromJson = function () {
|
60649
60891
|
_super.prototype.endLoadingFromJson.call(this);
|
60650
|
-
this.hasMinRateDescription = !!this.minRateDescription;
|
60651
|
-
this.hasMaxRateDescription = !!this.maxRateDescription;
|
60652
60892
|
if (this.jsonObj.rateMin !== undefined && this.jsonObj.rateCount !== undefined && this.jsonObj.rateMax === undefined) {
|
60653
60893
|
this.updateRateMax();
|
60654
60894
|
}
|
@@ -60906,6 +61146,7 @@ var question_rating_QuestionRatingModel = /** @class */ (function (_super) {
|
|
60906
61146
|
}
|
60907
61147
|
if (this.rateType == "smileys" && rateValues.length > 10)
|
60908
61148
|
rateValues = rateValues.slice(0, 10);
|
61149
|
+
this.visibleChoicesValue = rateValues.map(function (i, idx) { return _this.getRatingItemValue(i, idx); });
|
60909
61150
|
this.renderedRateItems = rateValues.map(function (v, i) {
|
60910
61151
|
var renderedItem = null;
|
60911
61152
|
if (_this.displayRateDescriptionsAsExtremeItems) {
|
@@ -60925,14 +61166,7 @@ var question_rating_QuestionRatingModel = /** @class */ (function (_super) {
|
|
60925
61166
|
var step = this.rateStep;
|
60926
61167
|
while (value <= this.rateMax &&
|
60927
61168
|
res.length < settings.ratingMaximumRateValueCount) {
|
60928
|
-
var
|
60929
|
-
if (value === this.rateMin) {
|
60930
|
-
description = this.minRateDescription && this.locMinRateDescription;
|
60931
|
-
}
|
60932
|
-
if (value === this.rateMax || res.length === settings.ratingMaximumRateValueCount) {
|
60933
|
-
description = this.maxRateDescription && this.locMaxRateDescription;
|
60934
|
-
}
|
60935
|
-
var item = new RatingItemValue(value, description);
|
61169
|
+
var item = new itemvalue_ItemValue(value);
|
60936
61170
|
item.locOwner = this;
|
60937
61171
|
item.ownerPropertyName = "rateValues";
|
60938
61172
|
res.push(item);
|
@@ -60940,6 +61174,22 @@ var question_rating_QuestionRatingModel = /** @class */ (function (_super) {
|
|
60940
61174
|
}
|
60941
61175
|
return res;
|
60942
61176
|
};
|
61177
|
+
QuestionRatingModel.prototype.getRatingItemValue = function (item, index) {
|
61178
|
+
if (!item)
|
61179
|
+
return null;
|
61180
|
+
var value = item.value;
|
61181
|
+
var description;
|
61182
|
+
if (value === this.rateMin) {
|
61183
|
+
description = this.minRateDescription && this.locMinRateDescription;
|
61184
|
+
}
|
61185
|
+
if (value === this.rateMax || index === settings.ratingMaximumRateValueCount) {
|
61186
|
+
description = this.maxRateDescription && this.locMaxRateDescription;
|
61187
|
+
}
|
61188
|
+
var newItem = new RatingItemValue(value, description);
|
61189
|
+
newItem.locOwner = item.locOwner;
|
61190
|
+
newItem.ownerPropertyName = item.ownerPropertyName;
|
61191
|
+
return newItem;
|
61192
|
+
};
|
60943
61193
|
QuestionRatingModel.prototype.correctValue = function (value, step) {
|
60944
61194
|
if (!value)
|
60945
61195
|
return value;
|
@@ -60994,7 +61244,6 @@ var question_rating_QuestionRatingModel = /** @class */ (function (_super) {
|
|
60994
61244
|
},
|
60995
61245
|
set: function (val) {
|
60996
61246
|
this.setLocalizableStringText("minRateDescription", val);
|
60997
|
-
this.hasMinRateDescription = !!this.minRateDescription;
|
60998
61247
|
},
|
60999
61248
|
enumerable: false,
|
61000
61249
|
configurable: true
|
@@ -61019,7 +61268,6 @@ var question_rating_QuestionRatingModel = /** @class */ (function (_super) {
|
|
61019
61268
|
},
|
61020
61269
|
set: function (val) {
|
61021
61270
|
this.setLocalizableStringText("maxRateDescription", val);
|
61022
|
-
this.hasMaxRateDescription = !!this.maxRateDescription;
|
61023
61271
|
},
|
61024
61272
|
enumerable: false,
|
61025
61273
|
configurable: true
|
@@ -61387,7 +61635,7 @@ var question_rating_QuestionRatingModel = /** @class */ (function (_super) {
|
|
61387
61635
|
};
|
61388
61636
|
Object.defineProperty(QuestionRatingModel.prototype, "visibleChoices", {
|
61389
61637
|
get: function () {
|
61390
|
-
return this.
|
61638
|
+
return this.visibleChoicesValue;
|
61391
61639
|
},
|
61392
61640
|
enumerable: false,
|
61393
61641
|
configurable: true
|
@@ -61439,6 +61687,11 @@ var question_rating_QuestionRatingModel = /** @class */ (function (_super) {
|
|
61439
61687
|
enumerable: false,
|
61440
61688
|
configurable: true
|
61441
61689
|
});
|
61690
|
+
QuestionRatingModel.prototype.onBlurCore = function (event) {
|
61691
|
+
var _a;
|
61692
|
+
(_a = this.dropdownListModel) === null || _a === void 0 ? void 0 : _a.onBlur(event);
|
61693
|
+
_super.prototype.onBlurCore.call(this, event);
|
61694
|
+
};
|
61442
61695
|
QuestionRatingModel.prototype.updateCssClasses = function (res, css) {
|
61443
61696
|
_super.prototype.updateCssClasses.call(this, res, css);
|
61444
61697
|
if (!!this.dropdownListModel) {
|
@@ -64458,6 +64711,8 @@ var question_paneldynamic_QuestionPanelDynamicModel = /** @class */ (function (_
|
|
64458
64711
|
_this.updateFooterActions();
|
64459
64712
|
});
|
64460
64713
|
_this.registerPropertyChangedHandlers(["allowAddPanel"], function () { _this.updateNoEntriesTextDefaultLoc(); });
|
64714
|
+
_this.registerPropertyChangedHandlers(["minPanelCount"], function () { _this.onMinPanelCountChanged(); });
|
64715
|
+
_this.registerPropertyChangedHandlers(["maxPanelCount"], function () { _this.onMaxPanelCountChanged(); });
|
64461
64716
|
return _this;
|
64462
64717
|
}
|
64463
64718
|
Object.defineProperty(QuestionPanelDynamicModel.prototype, "isCompositeQuestion", {
|
@@ -65421,17 +65676,18 @@ var question_paneldynamic_QuestionPanelDynamicModel = /** @class */ (function (_
|
|
65421
65676
|
set: function (val) {
|
65422
65677
|
if (val < 0)
|
65423
65678
|
val = 0;
|
65424
|
-
if (val == this.minPanelCount)
|
65425
|
-
return;
|
65426
65679
|
this.setPropertyValue("minPanelCount", val);
|
65427
|
-
if (val > this.maxPanelCount)
|
65428
|
-
this.maxPanelCount = val;
|
65429
|
-
if (this.panelCount < val)
|
65430
|
-
this.panelCount = val;
|
65431
65680
|
},
|
65432
65681
|
enumerable: false,
|
65433
65682
|
configurable: true
|
65434
65683
|
});
|
65684
|
+
QuestionPanelDynamicModel.prototype.onMinPanelCountChanged = function () {
|
65685
|
+
var val = this.minPanelCount;
|
65686
|
+
if (val > this.maxPanelCount)
|
65687
|
+
this.maxPanelCount = val;
|
65688
|
+
if (this.panelCount < val)
|
65689
|
+
this.panelCount = val;
|
65690
|
+
};
|
65435
65691
|
Object.defineProperty(QuestionPanelDynamicModel.prototype, "maxPanelCount", {
|
65436
65692
|
/**
|
65437
65693
|
* A maximum number of panels in Dynamic Panel. Users cannot add new panels if `panelCount` equals `maxPanelCount`.
|
@@ -65449,17 +65705,20 @@ var question_paneldynamic_QuestionPanelDynamicModel = /** @class */ (function (_
|
|
65449
65705
|
return;
|
65450
65706
|
if (val > settings.panel.maxPanelCount)
|
65451
65707
|
val = settings.panel.maxPanelCount;
|
65452
|
-
if (val == this.maxPanelCount)
|
65453
|
-
return;
|
65454
65708
|
this.setPropertyValue("maxPanelCount", val);
|
65455
|
-
|
65456
|
-
this.minPanelCount = val;
|
65457
|
-
if (this.panelCount > val)
|
65458
|
-
this.panelCount = val;
|
65709
|
+
this.updateFooterActions();
|
65459
65710
|
},
|
65460
65711
|
enumerable: false,
|
65461
65712
|
configurable: true
|
65462
65713
|
});
|
65714
|
+
QuestionPanelDynamicModel.prototype.onMaxPanelCountChanged = function () {
|
65715
|
+
var val = this.maxPanelCount;
|
65716
|
+
if (val < this.minPanelCount)
|
65717
|
+
this.minPanelCount = val;
|
65718
|
+
if (this.panelCount > val)
|
65719
|
+
this.panelCount = val;
|
65720
|
+
this.updateFooterActions();
|
65721
|
+
};
|
65463
65722
|
Object.defineProperty(QuestionPanelDynamicModel.prototype, "allowAddPanel", {
|
65464
65723
|
/**
|
65465
65724
|
* Specifies whether users are allowed to add new panels.
|
@@ -66207,6 +66466,12 @@ var question_paneldynamic_QuestionPanelDynamicModel = /** @class */ (function (_
|
|
66207
66466
|
QuestionPanelDynamicModel.prototype.onSurveyLoad = function () {
|
66208
66467
|
this.template.readOnly = this.isReadOnly;
|
66209
66468
|
this.template.onSurveyLoad();
|
66469
|
+
if (this.panelCount < this.minPanelCount) {
|
66470
|
+
this.panelCount = this.minPanelCount;
|
66471
|
+
}
|
66472
|
+
if (this.panelCount > this.maxPanelCount) {
|
66473
|
+
this.panelCount = this.maxPanelCount;
|
66474
|
+
}
|
66210
66475
|
this.buildPanelsFirstTime();
|
66211
66476
|
_super.prototype.onSurveyLoad.call(this);
|
66212
66477
|
};
|
@@ -70119,8 +70384,8 @@ Serializer.addClass("currencymask", [
|
|
70119
70384
|
|
70120
70385
|
var Version;
|
70121
70386
|
var ReleaseDate;
|
70122
|
-
Version = "" + "1.12.
|
70123
|
-
ReleaseDate = "" + "2024-
|
70387
|
+
Version = "" + "1.12.4";
|
70388
|
+
ReleaseDate = "" + "2024-10-01";
|
70124
70389
|
function checkLibraryVersion(ver, libraryName) {
|
70125
70390
|
if (Version != ver) {
|
70126
70391
|
var str = "survey-core has version '" + Version + "' and " + libraryName
|
@@ -72722,7 +72987,6 @@ function setStyles() {
|
|
72722
72987
|
".sv-popup--modal .sv-popup__body-content": "padding: calc(4 * var(--base-unit, 8px));",
|
72723
72988
|
".sv-popup--overlay": "width: 100%;",
|
72724
72989
|
".sv-popup--overlay .sv-popup__container": "background: rgba(144, 144, 144, 0.5); max-width: 100vw; max-height: calc(100vh - 1 * var(--base-unit, 8px)); height: calc(100vh - 1 * var(--base-unit, 8px)); width: 100%; padding-top: calc(2 * var(--base-unit, 8px)); border: unset;",
|
72725
|
-
".sv-popup__shadow": "width: 100%; height: 100%; border-radius: calc(1 * var(--base-unit, 8px));",
|
72726
72990
|
".sv-popup--overlay .sv-popup__body-content": "border-radius: calc(2 * var(--base-unit, 8px)) calc(2 * var(--base-unit, 8px)) 0px 0px; background: var(--background, #fff); box-shadow: 0px calc(1 * var(--base-unit, 8px)) calc(2 * var(--base-unit, 8px)) rgba(0, 0, 0, 0.1); padding: calc(3 * var(--base-unit, 8px)) calc(2 * var(--base-unit, 8px)) calc(2 * var(--base-unit, 8px)); height: calc(100% - calc(1 * var(--base-unit, 8px))); max-height: 100vh; max-width: 100vw;",
|
72727
72991
|
".sv-popup--overlay .sv-popup__scrolling-content": "height: calc(100% - (10 * var(--base-unit, 8px)));",
|
72728
72992
|
".sv-popup--overlay .sv-popup__body-footer": "margin-top: calc(2 * var(--base-unit, 8px));",
|
@@ -81045,12 +81309,11 @@ var popup_PopupContainer = /** @class */ (function (_super) {
|
|
81045
81309
|
}, onClick: function (ev) {
|
81046
81310
|
_this.clickInside(ev);
|
81047
81311
|
} },
|
81048
|
-
|
81049
|
-
|
81050
|
-
|
81051
|
-
|
81052
|
-
|
81053
|
-
footerContent))));
|
81312
|
+
headerPopup,
|
81313
|
+
external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", { className: "sv-popup__body-content" },
|
81314
|
+
headerContent,
|
81315
|
+
external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", { className: "sv-popup__scrolling-content" }, content),
|
81316
|
+
footerContent)));
|
81054
81317
|
};
|
81055
81318
|
PopupContainer.prototype.renderHeaderContent = function () {
|
81056
81319
|
return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", { className: "sv-popup__body-header" }, this.model.title);
|
@@ -88568,8 +88831,8 @@ var skeleton_Skeleton = /** @class */ (function (_super) {
|
|
88568
88831
|
return _super !== null && _super.apply(this, arguments) || this;
|
88569
88832
|
}
|
88570
88833
|
Skeleton.prototype.render = function () {
|
88571
|
-
var _a;
|
88572
|
-
return (external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", { className: "sv-skeleton-element", id: (_a = this.props.element) === null || _a === void 0 ? void 0 : _a.id }));
|
88834
|
+
var _a, _b;
|
88835
|
+
return (external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", { className: "sv-skeleton-element", id: (_a = this.props.element) === null || _a === void 0 ? void 0 : _a.id, style: { height: (_b = this.props.element) === null || _b === void 0 ? void 0 : _b.skeletonHeight } }));
|
88573
88836
|
};
|
88574
88837
|
return Skeleton;
|
88575
88838
|
}(external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.Component));
|