survey-react 1.12.9 → 1.12.10
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 +45 -5
- package/survey.react.js +234 -89
- 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.10
|
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
|
*/
|
@@ -4728,7 +4728,7 @@ var jsonobject_JsonObject = /** @class */ (function () {
|
|
4728
4728
|
parentProps[key] = true;
|
4729
4729
|
dProps.forEach(function (propKey) {
|
4730
4730
|
if (!parentProps[propKey]) {
|
4731
|
-
_this.setPropertyValueToObj(jsonObj, obj, propKey, properties, processedProps, parentProps, objType,
|
4731
|
+
_this.setPropertyValueToObj(jsonObj, obj, propKey, properties, processedProps, parentProps, objType, false, options);
|
4732
4732
|
}
|
4733
4733
|
});
|
4734
4734
|
}
|
@@ -10018,6 +10018,7 @@ var ComputedUpdater = /** @class */ (function () {
|
|
10018
10018
|
};
|
10019
10019
|
ComputedUpdater.prototype.dispose = function () {
|
10020
10020
|
this.clearDependencies();
|
10021
|
+
this._updater = undefined;
|
10021
10022
|
};
|
10022
10023
|
ComputedUpdater.ComputedUpdaterType = "__dependency_computed";
|
10023
10024
|
return ComputedUpdater;
|
@@ -10160,6 +10161,13 @@ var base_Base = /** @class */ (function () {
|
|
10160
10161
|
this.onPropertyValueChangedCallback = undefined;
|
10161
10162
|
this.isDisposedValue = true;
|
10162
10163
|
Object.keys(this.dependencies).forEach(function (key) { return _this.dependencies[key].dispose(); });
|
10164
|
+
// this.dependencies = {};
|
10165
|
+
Object.keys(this.propertyHash).forEach(function (key) {
|
10166
|
+
var propVal = _this.getPropertyValueCore(_this.propertyHash, key);
|
10167
|
+
if (!!propVal && propVal.type == ComputedUpdater.ComputedUpdaterType) {
|
10168
|
+
propVal.dispose();
|
10169
|
+
}
|
10170
|
+
});
|
10163
10171
|
};
|
10164
10172
|
Object.defineProperty(Base.prototype, "isDisposed", {
|
10165
10173
|
get: function () {
|
@@ -11165,6 +11173,8 @@ var responsivity_manager_ResponsivityManager = /** @class */ (function () {
|
|
11165
11173
|
this.separatorAddConst = 1;
|
11166
11174
|
this.paddingSizeConst = 8;
|
11167
11175
|
this.dotsSizeConst = 48;
|
11176
|
+
this.dotsIconClass = ".sv-dots";
|
11177
|
+
this.iconClass = ".sv-svg-icon";
|
11168
11178
|
this.recalcMinDimensionConst = true;
|
11169
11179
|
this.getComputedStyle = function (elt) {
|
11170
11180
|
return DomDocumentHelper.getComputedStyle(elt);
|
@@ -11199,13 +11209,18 @@ var responsivity_manager_ResponsivityManager = /** @class */ (function () {
|
|
11199
11209
|
return space;
|
11200
11210
|
};
|
11201
11211
|
ResponsivityManager.prototype.calcItemSize = function (item) {
|
11202
|
-
return item.offsetWidth;
|
11212
|
+
return item.offsetWidth || item.getBoundingClientRect().width;
|
11203
11213
|
};
|
11204
|
-
ResponsivityManager.prototype.calcMinDimension = function (currentAction) {
|
11205
|
-
var
|
11206
|
-
if (currentAction.iconSize
|
11207
|
-
|
11214
|
+
ResponsivityManager.prototype.calcMinDimension = function (currentAction, item) {
|
11215
|
+
var iconSize;
|
11216
|
+
if (!!item && (!currentAction.iconSize || currentAction.iconSize === "auto")) {
|
11217
|
+
var iconElement = item.querySelector(this.iconClass);
|
11218
|
+
iconSize = iconElement && this.calcItemSize(iconElement);
|
11208
11219
|
}
|
11220
|
+
else if (currentAction.iconSize && typeof (currentAction.iconSize) === "number" && this.recalcMinDimensionConst) {
|
11221
|
+
iconSize = currentAction.iconSize;
|
11222
|
+
}
|
11223
|
+
var minDimensionConst = !!iconSize ? (iconSize + 2 * this.paddingSizeConst) : this.minDimensionConst;
|
11209
11224
|
return currentAction.canShrink
|
11210
11225
|
? minDimensionConst +
|
11211
11226
|
(currentAction.needSeparator ? this.separatorSize : 0)
|
@@ -11213,7 +11228,7 @@ var responsivity_manager_ResponsivityManager = /** @class */ (function () {
|
|
11213
11228
|
};
|
11214
11229
|
ResponsivityManager.prototype.calcItemsSizes = function () {
|
11215
11230
|
var _this = this;
|
11216
|
-
if (this.isInitialized)
|
11231
|
+
if (!this.container || this.isInitialized)
|
11217
11232
|
return;
|
11218
11233
|
var actions = this.model.actions;
|
11219
11234
|
var _items = this.container.querySelectorAll(this.itemsSelector);
|
@@ -11226,11 +11241,11 @@ var responsivity_manager_ResponsivityManager = /** @class */ (function () {
|
|
11226
11241
|
};
|
11227
11242
|
ResponsivityManager.prototype.calcActionDimensions = function (currentAction, item) {
|
11228
11243
|
currentAction.maxDimension = this.calcItemSize(item);
|
11229
|
-
currentAction.minDimension = this.calcMinDimension(currentAction);
|
11244
|
+
currentAction.minDimension = this.calcMinDimension(currentAction, item);
|
11230
11245
|
};
|
11231
11246
|
Object.defineProperty(ResponsivityManager.prototype, "isContainerVisible", {
|
11232
11247
|
get: function () {
|
11233
|
-
return isContainerVisible(this.container);
|
11248
|
+
return !!this.container && isContainerVisible(this.container);
|
11234
11249
|
},
|
11235
11250
|
enumerable: false,
|
11236
11251
|
configurable: true
|
@@ -11245,13 +11260,16 @@ var responsivity_manager_ResponsivityManager = /** @class */ (function () {
|
|
11245
11260
|
var _a;
|
11246
11261
|
var dotsItemSize = _this.dotsItemSize;
|
11247
11262
|
if (!_this.dotsItemSize) {
|
11248
|
-
var dotsItemElement = (_a = _this.container) === null || _a === void 0 ? void 0 : _a.querySelector(
|
11263
|
+
var dotsItemElement = (_a = _this.container) === null || _a === void 0 ? void 0 : _a.querySelector(_this.dotsIconClass);
|
11249
11264
|
dotsItemSize = dotsItemElement && _this.calcItemSize(dotsItemElement) || _this.dotsSizeConst;
|
11250
11265
|
}
|
11251
11266
|
_this.model.fit(_this.getAvailableSpace(), dotsItemSize);
|
11252
11267
|
};
|
11253
11268
|
if (!this.isInitialized) {
|
11254
11269
|
var callback = function () {
|
11270
|
+
if (!_this.container) {
|
11271
|
+
return;
|
11272
|
+
}
|
11255
11273
|
_this.calcItemsSizes();
|
11256
11274
|
_this.isInitialized = true;
|
11257
11275
|
processResponsiveness_1();
|
@@ -11273,6 +11291,8 @@ var responsivity_manager_ResponsivityManager = /** @class */ (function () {
|
|
11273
11291
|
if (!!this.resizeObserver) {
|
11274
11292
|
this.resizeObserver.disconnect();
|
11275
11293
|
}
|
11294
|
+
this.resizeObserver = undefined;
|
11295
|
+
this.container = undefined;
|
11276
11296
|
};
|
11277
11297
|
return ResponsivityManager;
|
11278
11298
|
}());
|
@@ -11529,6 +11549,7 @@ var container_ActionContainer = /** @class */ (function (_super) {
|
|
11529
11549
|
};
|
11530
11550
|
ActionContainer.prototype.dispose = function () {
|
11531
11551
|
_super.prototype.dispose.call(this);
|
11552
|
+
this.resetResponsivityManager();
|
11532
11553
|
this.actions.forEach(function (action) { return action.dispose(); });
|
11533
11554
|
this.actions.length = 0;
|
11534
11555
|
};
|
@@ -12753,15 +12774,15 @@ var action_Action = /** @class */ (function (_super) {
|
|
12753
12774
|
};
|
12754
12775
|
Action.prototype.dispose = function () {
|
12755
12776
|
this.updateCallback = undefined;
|
12777
|
+
if (!!this.locTitleValue) {
|
12778
|
+
this.locTitleValue.onStringChanged.remove(this.locTitleChanged);
|
12779
|
+
}
|
12780
|
+
this.locTitleChanged = undefined;
|
12756
12781
|
this.action = undefined;
|
12757
12782
|
_super.prototype.dispose.call(this);
|
12758
12783
|
if (this.popupModel) {
|
12759
12784
|
this.popupModel.dispose();
|
12760
12785
|
}
|
12761
|
-
if (!!this.locTitleValue) {
|
12762
|
-
this.locTitleValue.onStringChanged.remove(this.locTitleChanged);
|
12763
|
-
this.locTitleChanged = undefined;
|
12764
|
-
}
|
12765
12786
|
};
|
12766
12787
|
action_decorate([
|
12767
12788
|
jsonobject_property()
|
@@ -12984,6 +13005,12 @@ var adaptive_container_AdaptiveActionContainer = /** @class */ (function (_super
|
|
12984
13005
|
}
|
12985
13006
|
};
|
12986
13007
|
AdaptiveActionContainer.prototype.initResponsivityManager = function (container, delayedUpdateFunction) {
|
13008
|
+
if (!!this.responsivityManager) {
|
13009
|
+
if (this.responsivityManager.container == container) {
|
13010
|
+
return;
|
13011
|
+
}
|
13012
|
+
this.responsivityManager.dispose();
|
13013
|
+
}
|
12987
13014
|
this.responsivityManager = new responsivity_manager_ResponsivityManager(container, this, ":scope > .sv-action:not(.sv-dots) > .sv-action__content", null, delayedUpdateFunction);
|
12988
13015
|
};
|
12989
13016
|
AdaptiveActionContainer.prototype.resetResponsivityManager = function () {
|
@@ -13455,11 +13482,15 @@ var animation_AnimationGroup = /** @class */ (function (_super) {
|
|
13455
13482
|
newValue = [].concat(newValue);
|
13456
13483
|
var oldValue = [].concat(this.getCurrentValue());
|
13457
13484
|
var allowSyncRemovalAddition = (_a = this.animationOptions.allowSyncRemovalAddition) !== null && _a !== void 0 ? _a : true;
|
13458
|
-
var
|
13459
|
-
if (!allowSyncRemovalAddition && (reorderedItems.length > 0 || addedItems.length > 0)) {
|
13460
|
-
deletedItems = [];
|
13461
|
-
mergedItems = newValue;
|
13485
|
+
var compareResult = compareArrays(oldValue, newValue, (_b = this.animationOptions.getKey) !== null && _b !== void 0 ? _b : (function (item) { return item; }));
|
13486
|
+
if (!allowSyncRemovalAddition && (compareResult.reorderedItems.length > 0 || compareResult.addedItems.length > 0)) {
|
13487
|
+
compareResult.deletedItems = [];
|
13488
|
+
compareResult.mergedItems = newValue;
|
13489
|
+
}
|
13490
|
+
if (!!this.animationOptions.onCompareArrays) {
|
13491
|
+
this.animationOptions.onCompareArrays(compareResult);
|
13462
13492
|
}
|
13493
|
+
var addedItems = compareResult.addedItems, reorderedItems = compareResult.reorderedItems, deletedItems = compareResult.deletedItems, mergedItems = compareResult.mergedItems;
|
13463
13494
|
var runAnimationCallback = function () {
|
13464
13495
|
_this.animation.runGroupAnimation(_this.animationOptions, addedItems, deletedItems, reorderedItems, function () {
|
13465
13496
|
if (deletedItems.length > 0) {
|
@@ -15898,6 +15929,12 @@ function navigateToUrl(url) {
|
|
15898
15929
|
function wrapUrlForBackgroundImage(url) {
|
15899
15930
|
return !!url ? ["url(", url, ")"].join("") : "";
|
15900
15931
|
}
|
15932
|
+
function isBase64URL(url) {
|
15933
|
+
if (typeof url == "string") {
|
15934
|
+
return /^data:((?:\w+\/(?:(?!;).)+)?)((?:;[^;]+?)*),(.+)$/.test(url);
|
15935
|
+
}
|
15936
|
+
return null;
|
15937
|
+
}
|
15901
15938
|
// old-name: new-name
|
15902
15939
|
var renamedIcons = {
|
15903
15940
|
"changecamera": "flip-24x24",
|
@@ -15916,6 +15953,7 @@ var renamedIcons = {
|
|
15916
15953
|
"takepicture": "camera-32x32",
|
15917
15954
|
"takepicture_24x24": "camera-24x24",
|
15918
15955
|
"v2check": "check-16x16",
|
15956
|
+
"checked": "check-16x16",
|
15919
15957
|
"v2check_24x24": "check-24x24",
|
15920
15958
|
"back-to-panel_16x16": "restoredown-16x16",
|
15921
15959
|
"clear_16x16": "clear-16x16",
|
@@ -18779,8 +18817,10 @@ var question_Question = /** @class */ (function (_super) {
|
|
18779
18817
|
_this.createLocalizableString("commentText", _this, true, "otherItemText");
|
18780
18818
|
_this.createLocalizableString("requiredErrorText", _this);
|
18781
18819
|
_this.addTriggerInfo("resetValueIf", function () { return !_this.isEmpty(); }, function () {
|
18820
|
+
_this.startSetValueOnExpression();
|
18782
18821
|
_this.clearValue();
|
18783
18822
|
_this.updateValueWithDefaults();
|
18823
|
+
_this.finishSetValueOnExpression();
|
18784
18824
|
});
|
18785
18825
|
var setValueIfInfo = _this.addTriggerInfo("setValueIf", function () { return true; }, function () { return _this.runSetValueExpression(); });
|
18786
18826
|
setValueIfInfo.runSecondCheck = function (keys) { return _this.checkExpressionIf(keys); };
|
@@ -20531,12 +20571,13 @@ var question_Question = /** @class */ (function (_super) {
|
|
20531
20571
|
_super.prototype.onSetData.call(this);
|
20532
20572
|
if (!this.survey)
|
20533
20573
|
return;
|
20534
|
-
this.initDataFromSurvey();
|
20535
|
-
this.onSurveyValueChanged(this.value);
|
20536
|
-
this.updateValueWithDefaults();
|
20537
20574
|
this.onIndentChanged();
|
20538
|
-
this.
|
20539
|
-
|
20575
|
+
if (!this.isDesignMode) {
|
20576
|
+
this.initDataFromSurvey();
|
20577
|
+
this.onSurveyValueChanged(this.value);
|
20578
|
+
this.updateValueWithDefaults();
|
20579
|
+
this.updateIsAnswered();
|
20580
|
+
}
|
20540
20581
|
};
|
20541
20582
|
Question.prototype.initDataFromSurvey = function () {
|
20542
20583
|
if (!!this.data) {
|
@@ -21146,10 +21187,20 @@ var question_Question = /** @class */ (function (_super) {
|
|
21146
21187
|
var _this = this;
|
21147
21188
|
this.runExpressionSetValueCore(val, function (val) {
|
21148
21189
|
if (!_this.isTwoValueEquals(_this.value, val)) {
|
21190
|
+
_this.startSetValueOnExpression();
|
21149
21191
|
_this.value = val;
|
21192
|
+
_this.finishSetValueOnExpression();
|
21150
21193
|
}
|
21151
21194
|
});
|
21152
21195
|
};
|
21196
|
+
Question.prototype.startSetValueOnExpression = function () {
|
21197
|
+
var _a;
|
21198
|
+
(_a = this.survey) === null || _a === void 0 ? void 0 : _a.startSetValueOnExpression();
|
21199
|
+
};
|
21200
|
+
Question.prototype.finishSetValueOnExpression = function () {
|
21201
|
+
var _a;
|
21202
|
+
(_a = this.survey) === null || _a === void 0 ? void 0 : _a.finishSetValueOnExpression();
|
21203
|
+
};
|
21153
21204
|
Question.prototype.runDefaultValueExpression = function (runner, values, properties, setFunc) {
|
21154
21205
|
var _this = this;
|
21155
21206
|
if (values === void 0) { values = null; }
|
@@ -21226,7 +21277,7 @@ var question_Question = /** @class */ (function (_super) {
|
|
21226
21277
|
};
|
21227
21278
|
Object.defineProperty(Question.prototype, "isAnswered", {
|
21228
21279
|
get: function () {
|
21229
|
-
return this.getPropertyValue("isAnswered");
|
21280
|
+
return this.getPropertyValue("isAnswered") || false;
|
21230
21281
|
},
|
21231
21282
|
set: function (val) {
|
21232
21283
|
this.setPropertyValue("isAnswered", val);
|
@@ -38440,7 +38491,7 @@ var panel_PanelModel = /** @class */ (function (_super) {
|
|
38440
38491
|
return this.showQuestionNumbers !== "off" && this.showQuestionNumbers !== "onpanel";
|
38441
38492
|
};
|
38442
38493
|
PanelModel.prototype.notifySurveyOnVisibilityChanged = function () {
|
38443
|
-
if (this.survey != null && !this.isLoadingFromJson) {
|
38494
|
+
if (this.survey != null && !this.isLoadingFromJson && !!this.page) {
|
38444
38495
|
this.survey.panelVisibilityChanged(this, this.isVisible);
|
38445
38496
|
}
|
38446
38497
|
};
|
@@ -39025,6 +39076,7 @@ var page_PageModel = /** @class */ (function (_super) {
|
|
39025
39076
|
* @see timeLimit
|
39026
39077
|
*/
|
39027
39078
|
_this.timeSpent = 0;
|
39079
|
+
_this._isReadyForClean = true;
|
39028
39080
|
_this.createLocalizableString("navigationDescription", _this, true);
|
39029
39081
|
_this.dragDropPageHelper = new drag_drop_page_helper_v1_DragDropPageHelperV1(_this);
|
39030
39082
|
return _this;
|
@@ -39397,6 +39449,28 @@ var page_PageModel = /** @class */ (function (_super) {
|
|
39397
39449
|
_super.prototype.ensureRowsVisibility.call(this);
|
39398
39450
|
this.getPanels().forEach(function (panel) { return panel.ensureRowsVisibility(); });
|
39399
39451
|
};
|
39452
|
+
Object.defineProperty(PageModel.prototype, "isReadyForClean", {
|
39453
|
+
get: function () {
|
39454
|
+
return this._isReadyForClean;
|
39455
|
+
},
|
39456
|
+
set: function (val) {
|
39457
|
+
var oldValue = this._isReadyForClean;
|
39458
|
+
this._isReadyForClean = val;
|
39459
|
+
if (this._isReadyForClean !== oldValue) {
|
39460
|
+
this.isReadyForCleanChangedCallback && this.isReadyForCleanChangedCallback();
|
39461
|
+
}
|
39462
|
+
},
|
39463
|
+
enumerable: false,
|
39464
|
+
configurable: true
|
39465
|
+
});
|
39466
|
+
PageModel.prototype.enableOnElementRerenderedEvent = function () {
|
39467
|
+
_super.prototype.enableOnElementRerenderedEvent.call(this);
|
39468
|
+
this.isReadyForClean = false;
|
39469
|
+
};
|
39470
|
+
PageModel.prototype.disableOnElementRerenderedEvent = function () {
|
39471
|
+
_super.prototype.disableOnElementRerenderedEvent.call(this);
|
39472
|
+
this.isReadyForClean = true;
|
39473
|
+
};
|
39400
39474
|
page_decorate([
|
39401
39475
|
jsonobject_property({ defaultValue: -1, onSet: function (val, target) { return target.onNumChanged(val); } })
|
39402
39476
|
], PageModel.prototype, "num", void 0);
|
@@ -40593,7 +40667,7 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
40593
40667
|
*/
|
40594
40668
|
_this.onGetPageTitleActions = _this.addEvent();
|
40595
40669
|
/**
|
40596
|
-
* An event that allows you to add, delete, or modify actions in the footer of a [Panel](https://surveyjs.io/form-library/documentation/panelmodel).
|
40670
|
+
* An event that allows you to add, delete, or modify actions in the footer of a [Panel](https://surveyjs.io/form-library/documentation/panelmodel). This panel may belong to a [Dynamic Panel](https://surveyjs.io/form-library/documentation/api-reference/dynamic-panel-model) or be a standalone survey element.
|
40597
40671
|
* @see [IAction](https://surveyjs.io/form-library/documentation/api-reference/iaction)
|
40598
40672
|
*/
|
40599
40673
|
_this.onGetPanelFooterActions = _this.addEvent();
|
@@ -40659,6 +40733,7 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
40659
40733
|
_this.cssVariables = {};
|
40660
40734
|
_this._isMobile = false;
|
40661
40735
|
_this._isCompact = false;
|
40736
|
+
_this.setValueOnExpressionCounter = 0;
|
40662
40737
|
_this._isDesignMode = false;
|
40663
40738
|
/**
|
40664
40739
|
* Specifies whether respondents can switch the current page even if it contains validation errors.
|
@@ -40700,6 +40775,7 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
40700
40775
|
valueNames: {},
|
40701
40776
|
valueNamesInsensitive: {},
|
40702
40777
|
};
|
40778
|
+
_this.setValueFromTriggerCounter = 0;
|
40703
40779
|
_this.needRenderIcons = true;
|
40704
40780
|
_this.skippedPages = [];
|
40705
40781
|
_this.skeletonComponentName = "sv-skeleton";
|
@@ -40727,9 +40803,20 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
40727
40803
|
_this.doTimer(page);
|
40728
40804
|
};
|
40729
40805
|
_this.createNewArray("pages", function (value) {
|
40806
|
+
if (value.isReadyForCleanChangedCallback) {
|
40807
|
+
value.isReadyForCleanChangedCallback();
|
40808
|
+
}
|
40730
40809
|
_this.doOnPageAdded(value);
|
40731
40810
|
}, function (value) {
|
40732
|
-
|
40811
|
+
if (!value.isReadyForClean) {
|
40812
|
+
value.isReadyForCleanChangedCallback = function () {
|
40813
|
+
_this.doOnPageRemoved(value);
|
40814
|
+
value.isReadyForCleanChangedCallback = undefined;
|
40815
|
+
};
|
40816
|
+
}
|
40817
|
+
else {
|
40818
|
+
_this.doOnPageRemoved(value);
|
40819
|
+
}
|
40733
40820
|
});
|
40734
40821
|
_this.createNewArray("triggers", function (value) {
|
40735
40822
|
value.setOwner(_this);
|
@@ -42441,6 +42528,17 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
42441
42528
|
};
|
42442
42529
|
return exp.run(values, properties) || onCompleteRes;
|
42443
42530
|
};
|
42531
|
+
Object.defineProperty(SurveyModel.prototype, "isSettingValueOnExpression", {
|
42532
|
+
get: function () { return this.setValueOnExpressionCounter > 0; },
|
42533
|
+
enumerable: false,
|
42534
|
+
configurable: true
|
42535
|
+
});
|
42536
|
+
SurveyModel.prototype.startSetValueOnExpression = function () {
|
42537
|
+
this.setValueOnExpressionCounter++;
|
42538
|
+
};
|
42539
|
+
SurveyModel.prototype.finishSetValueOnExpression = function () {
|
42540
|
+
this.setValueOnExpressionCounter--;
|
42541
|
+
};
|
42444
42542
|
/**
|
42445
42543
|
* Calculates a given [expression](https://surveyjs.io/form-library/documentation/design-survey/conditional-logic#expressions) and returns `true` or `false`.
|
42446
42544
|
* @param expression An expression to calculate.
|
@@ -43376,16 +43474,18 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
43376
43474
|
for (var key in this.variablesHash)
|
43377
43475
|
values[key] = this.variablesHash[key];
|
43378
43476
|
this.addCalculatedValuesIntoFilteredValues(values);
|
43379
|
-
|
43380
|
-
|
43381
|
-
var
|
43382
|
-
|
43383
|
-
|
43384
|
-
this.getAllQuestions().forEach(function (q) {
|
43385
|
-
if (q.hasFilteredValue) {
|
43386
|
-
values[q.getFilteredName()] = q.getFilteredValue();
|
43477
|
+
if (!this.isDesignMode) {
|
43478
|
+
var keys = this.getValuesKeys();
|
43479
|
+
for (var i = 0; i < keys.length; i++) {
|
43480
|
+
var key = keys[i];
|
43481
|
+
values[key] = this.getDataValueCore(this.valuesHash, key);
|
43387
43482
|
}
|
43388
|
-
|
43483
|
+
this.getAllQuestions().forEach(function (q) {
|
43484
|
+
if (q.hasFilteredValue) {
|
43485
|
+
values[q.getFilteredName()] = q.getFilteredValue();
|
43486
|
+
}
|
43487
|
+
});
|
43488
|
+
}
|
43389
43489
|
return values;
|
43390
43490
|
};
|
43391
43491
|
SurveyModel.prototype.addCalculatedValuesIntoFilteredValues = function (values) {
|
@@ -45629,8 +45729,8 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
45629
45729
|
return options.error ? new CustomError(options.error, this) : null;
|
45630
45730
|
};
|
45631
45731
|
SurveyModel.prototype.dynamicPanelAdded = function (question, panelIndex, panel) {
|
45632
|
-
if (!this.isLoadingFromJson) {
|
45633
|
-
this.updateVisibleIndexes();
|
45732
|
+
if (!this.isLoadingFromJson && this.hasQuestionVisibleIndeces(question, true)) {
|
45733
|
+
this.updateVisibleIndexes(question.page);
|
45634
45734
|
}
|
45635
45735
|
if (this.onDynamicPanelAdded.isEmpty)
|
45636
45736
|
return;
|
@@ -45646,13 +45746,26 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
45646
45746
|
for (var i = 0; i < questions.length; i++) {
|
45647
45747
|
questions[i].clearOnDeletingContainer();
|
45648
45748
|
}
|
45649
|
-
this.
|
45749
|
+
if (this.hasQuestionVisibleIndeces(question, false)) {
|
45750
|
+
this.updateVisibleIndexes(question.page);
|
45751
|
+
}
|
45650
45752
|
this.onDynamicPanelRemoved.fire(this, {
|
45651
45753
|
question: question,
|
45652
45754
|
panelIndex: panelIndex,
|
45653
45755
|
panel: panel,
|
45654
45756
|
});
|
45655
45757
|
};
|
45758
|
+
SurveyModel.prototype.hasQuestionVisibleIndeces = function (question, checkIndex) {
|
45759
|
+
if (checkIndex) {
|
45760
|
+
question.setVisibleIndex(this.getStartVisibleIndex());
|
45761
|
+
}
|
45762
|
+
var qList = question.getNestedQuestions(true);
|
45763
|
+
for (var i = 0; i < qList.length; i++) {
|
45764
|
+
if (qList[i].visibleIndex > -1)
|
45765
|
+
return true;
|
45766
|
+
}
|
45767
|
+
return false;
|
45768
|
+
};
|
45656
45769
|
SurveyModel.prototype.dynamicPanelRemoving = function (question, panelIndex, panel) {
|
45657
45770
|
var options = {
|
45658
45771
|
question: question,
|
@@ -46194,6 +46307,11 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
46194
46307
|
page.name = name;
|
46195
46308
|
return page;
|
46196
46309
|
};
|
46310
|
+
SurveyModel.prototype.getValueChangeReason = function () {
|
46311
|
+
if (this.isSettingValueOnExpression)
|
46312
|
+
return "expression";
|
46313
|
+
return this.isSettingValueFromTrigger ? "trigger" : undefined;
|
46314
|
+
};
|
46197
46315
|
SurveyModel.prototype.questionOnValueChanging = function (valueName, newValue, questionValueName) {
|
46198
46316
|
if (!!this.editingObj) {
|
46199
46317
|
var prop = Serializer.findProperty(this.editingObj.getType(), valueName);
|
@@ -46207,6 +46325,7 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
46207
46325
|
question: this.getQuestionByValueName(questionValueName || valueName),
|
46208
46326
|
value: this.getUnbindValue(newValue),
|
46209
46327
|
oldValue: this.getValue(valueName),
|
46328
|
+
reason: this.getValueChangeReason()
|
46210
46329
|
};
|
46211
46330
|
this.onValueChanging.fire(this, options);
|
46212
46331
|
return options.value;
|
@@ -46261,6 +46380,14 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
46261
46380
|
}
|
46262
46381
|
return res;
|
46263
46382
|
};
|
46383
|
+
SurveyModel.prototype.fireOnValueChanged = function (name, value, question) {
|
46384
|
+
this.onValueChanged.fire(this, {
|
46385
|
+
name: name,
|
46386
|
+
question: question,
|
46387
|
+
value: value,
|
46388
|
+
reason: this.getValueChangeReason()
|
46389
|
+
});
|
46390
|
+
};
|
46264
46391
|
SurveyModel.prototype.notifyQuestionOnValueChanged = function (valueName, newValue, questionName) {
|
46265
46392
|
if (this.isLoadingFromJson)
|
46266
46393
|
return;
|
@@ -46270,19 +46397,11 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
46270
46397
|
var question = questions[i];
|
46271
46398
|
this.checkQuestionErrorOnValueChanged(question);
|
46272
46399
|
question.onSurveyValueChanged(newValue);
|
46273
|
-
this.
|
46274
|
-
name: valueName,
|
46275
|
-
question: question,
|
46276
|
-
value: newValue,
|
46277
|
-
});
|
46400
|
+
this.fireOnValueChanged(valueName, newValue, question);
|
46278
46401
|
}
|
46279
46402
|
}
|
46280
46403
|
else {
|
46281
|
-
this.
|
46282
|
-
name: valueName,
|
46283
|
-
question: null,
|
46284
|
-
value: newValue,
|
46285
|
-
});
|
46404
|
+
this.fireOnValueChanged(valueName, newValue, null);
|
46286
46405
|
}
|
46287
46406
|
if (this.isDisposed)
|
46288
46407
|
return;
|
@@ -46607,7 +46726,7 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
46607
46726
|
}
|
46608
46727
|
this.updateVisibleIndexes();
|
46609
46728
|
};
|
46610
|
-
SurveyModel.prototype.updateVisibleIndexes = function () {
|
46729
|
+
SurveyModel.prototype.updateVisibleIndexes = function (page) {
|
46611
46730
|
if (this.isLoadingFromJson || !!this.isEndLoadingFromJson || this.isLockingUpdateOnPageModes)
|
46612
46731
|
return;
|
46613
46732
|
if (this.isRunningConditions &&
|
@@ -46621,22 +46740,28 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
46621
46740
|
this.updateVisibleIndexAfterBindings = true;
|
46622
46741
|
return;
|
46623
46742
|
}
|
46624
|
-
this.updatePageVisibleIndexes(
|
46743
|
+
this.updatePageVisibleIndexes();
|
46744
|
+
this.updatePageElementsVisibleIndexes(page);
|
46745
|
+
this.updateProgressText(true);
|
46746
|
+
};
|
46747
|
+
SurveyModel.prototype.updatePageElementsVisibleIndexes = function (page) {
|
46625
46748
|
if (this.showQuestionNumbers == "onPage") {
|
46626
|
-
var visPages = this.visiblePages;
|
46749
|
+
var visPages = !!page ? [page] : this.visiblePages;
|
46627
46750
|
for (var i = 0; i < visPages.length; i++) {
|
46628
46751
|
visPages[i].setVisibleIndex(0);
|
46629
46752
|
}
|
46630
46753
|
}
|
46631
46754
|
else {
|
46632
|
-
var index = this.
|
46633
|
-
for (var
|
46634
|
-
index += this.pages[
|
46755
|
+
var index = this.getStartVisibleIndex();
|
46756
|
+
for (var i_3 = 0; i_3 < this.pages.length; i_3++) {
|
46757
|
+
index += this.pages[i_3].setVisibleIndex(index);
|
46635
46758
|
}
|
46636
46759
|
}
|
46637
|
-
this.updateProgressText(true);
|
46638
46760
|
};
|
46639
|
-
SurveyModel.prototype.
|
46761
|
+
SurveyModel.prototype.getStartVisibleIndex = function () {
|
46762
|
+
return this.showQuestionNumbers == "on" ? 0 : -1;
|
46763
|
+
};
|
46764
|
+
SurveyModel.prototype.updatePageVisibleIndexes = function () {
|
46640
46765
|
this.updateButtonsVisibility();
|
46641
46766
|
var index = 0;
|
46642
46767
|
for (var i = 0; i < this.pages.length; i++) {
|
@@ -47042,8 +47167,9 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
47042
47167
|
return;
|
47043
47168
|
questionName = questionName || name;
|
47044
47169
|
this.checkTriggersAndRunConditions(name, newValue, oldValue);
|
47045
|
-
if (allowNotifyValueChanged)
|
47170
|
+
if (allowNotifyValueChanged) {
|
47046
47171
|
this.notifyQuestionOnValueChanged(name, newValue, questionName);
|
47172
|
+
}
|
47047
47173
|
if (locNotification !== "text") {
|
47048
47174
|
this.tryGoNextPageAutomatic(name);
|
47049
47175
|
}
|
@@ -47181,11 +47307,7 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
47181
47307
|
}
|
47182
47308
|
var question = this.getQuestionByValueName(name);
|
47183
47309
|
if (question) {
|
47184
|
-
this.
|
47185
|
-
name: commentName,
|
47186
|
-
question: question,
|
47187
|
-
value: newValue,
|
47188
|
-
});
|
47310
|
+
this.fireOnValueChanged(commentName, newValue, question);
|
47189
47311
|
question.comment = newValue;
|
47190
47312
|
if (question.comment != newValue) {
|
47191
47313
|
question.comment = newValue;
|
@@ -47226,7 +47348,7 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
47226
47348
|
};
|
47227
47349
|
SurveyModel.prototype.questionVisibilityChanged = function (question, newValue, resetIndexes) {
|
47228
47350
|
if (resetIndexes) {
|
47229
|
-
this.updateVisibleIndexes();
|
47351
|
+
this.updateVisibleIndexes(question.page);
|
47230
47352
|
}
|
47231
47353
|
this.onQuestionVisibleChanged.fire(this, {
|
47232
47354
|
question: question,
|
@@ -47247,7 +47369,7 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
47247
47369
|
});
|
47248
47370
|
};
|
47249
47371
|
SurveyModel.prototype.panelVisibilityChanged = function (panel, newValue) {
|
47250
|
-
this.updateVisibleIndexes();
|
47372
|
+
this.updateVisibleIndexes(panel.page);
|
47251
47373
|
this.onPanelVisibleChanged.fire(this, {
|
47252
47374
|
panel: panel,
|
47253
47375
|
visible: newValue,
|
@@ -47267,7 +47389,7 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
47267
47389
|
if (!this.currentPage) {
|
47268
47390
|
this.updateCurrentPage();
|
47269
47391
|
}
|
47270
|
-
this.updateVisibleIndexes();
|
47392
|
+
this.updateVisibleIndexes(question.page);
|
47271
47393
|
this.setCalculatedWidthModeUpdater();
|
47272
47394
|
}
|
47273
47395
|
if (this.canFireAddElement()) {
|
@@ -47287,7 +47409,7 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
47287
47409
|
};
|
47288
47410
|
SurveyModel.prototype.questionRemoved = function (question) {
|
47289
47411
|
this.questionHashesRemoved(question, question.name, question.getValueName());
|
47290
|
-
this.updateVisibleIndexes();
|
47412
|
+
this.updateVisibleIndexes(question.page);
|
47291
47413
|
this.onQuestionRemoved.fire(this, {
|
47292
47414
|
question: question,
|
47293
47415
|
name: question.name,
|
@@ -47357,7 +47479,7 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
47357
47479
|
panel.name = this.generateNewName(this.getAllPanels(false, true), "panel");
|
47358
47480
|
}
|
47359
47481
|
this.questionHashesPanelAdded(panel);
|
47360
|
-
this.updateVisibleIndexes();
|
47482
|
+
this.updateVisibleIndexes(panel.page);
|
47361
47483
|
if (this.canFireAddElement()) {
|
47362
47484
|
this.onPanelAdded.fire(this, {
|
47363
47485
|
panel: panel,
|
@@ -47371,7 +47493,7 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
47371
47493
|
}
|
47372
47494
|
};
|
47373
47495
|
SurveyModel.prototype.panelRemoved = function (panel) {
|
47374
|
-
this.updateVisibleIndexes();
|
47496
|
+
this.updateVisibleIndexes(panel.page);
|
47375
47497
|
this.onPanelRemoved.fire(this, { panel: panel, name: panel.name });
|
47376
47498
|
this.updateLazyRenderingRowsOnRemovingElements();
|
47377
47499
|
};
|
@@ -47998,6 +48120,7 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
47998
48120
|
}
|
47999
48121
|
else {
|
48000
48122
|
var question = this.getQuestionByName(name);
|
48123
|
+
this.startSetValueFromTrigger();
|
48001
48124
|
if (!!question) {
|
48002
48125
|
question.value = value;
|
48003
48126
|
}
|
@@ -48015,6 +48138,7 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
48015
48138
|
this.setValue(firstName, data[firstName]);
|
48016
48139
|
}
|
48017
48140
|
}
|
48141
|
+
this.finishSetValueFromTrigger();
|
48018
48142
|
}
|
48019
48143
|
};
|
48020
48144
|
SurveyModel.prototype.copyTriggerValue = function (name, fromName, copyDisplayValue) {
|
@@ -48033,6 +48157,17 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
48033
48157
|
SurveyModel.prototype.triggerExecuted = function (trigger) {
|
48034
48158
|
this.onTriggerExecuted.fire(this, { trigger: trigger });
|
48035
48159
|
};
|
48160
|
+
Object.defineProperty(SurveyModel.prototype, "isSettingValueFromTrigger", {
|
48161
|
+
get: function () { return this.setValueFromTriggerCounter > 0; },
|
48162
|
+
enumerable: false,
|
48163
|
+
configurable: true
|
48164
|
+
});
|
48165
|
+
SurveyModel.prototype.startSetValueFromTrigger = function () {
|
48166
|
+
this.setValueFromTriggerCounter++;
|
48167
|
+
};
|
48168
|
+
SurveyModel.prototype.finishSetValueFromTrigger = function () {
|
48169
|
+
this.setValueFromTriggerCounter--;
|
48170
|
+
};
|
48036
48171
|
SurveyModel.prototype.startMovingQuestion = function () {
|
48037
48172
|
this.isMovingQuestion = true;
|
48038
48173
|
};
|
@@ -52154,6 +52289,7 @@ var popup_dropdown_view_model_PopupDropdownViewModel = /** @class */ (function (
|
|
52154
52289
|
PopupDropdownViewModel.prototype.resetComponentElement = function () {
|
52155
52290
|
_super.prototype.resetComponentElement.call(this);
|
52156
52291
|
this.targetElement = undefined;
|
52292
|
+
this.areaElement = undefined;
|
52157
52293
|
};
|
52158
52294
|
PopupDropdownViewModel.prototype.updateOnShowing = function () {
|
52159
52295
|
var root = settings.environment.root;
|
@@ -65291,6 +65427,7 @@ var question_signaturepad_decorate = (undefined && undefined.__decorate) || func
|
|
65291
65427
|
|
65292
65428
|
|
65293
65429
|
|
65430
|
+
|
65294
65431
|
var defaultWidth = 300;
|
65295
65432
|
var defaultHeight = 200;
|
65296
65433
|
/**
|
@@ -65386,16 +65523,27 @@ var question_signaturepad_QuestionSignaturePadModel = /** @class */ (function (_
|
|
65386
65523
|
QuestionSignaturePadModel.prototype.fromUrl = function (url) {
|
65387
65524
|
var _this = this;
|
65388
65525
|
this.isFileLoading = true;
|
65389
|
-
|
65390
|
-
|
65391
|
-
|
65392
|
-
|
65393
|
-
|
65394
|
-
|
65395
|
-
|
65396
|
-
|
65397
|
-
|
65398
|
-
|
65526
|
+
if (isBase64URL(url)) {
|
65527
|
+
this.fromDataUrl(url);
|
65528
|
+
this.isFileLoading = false;
|
65529
|
+
}
|
65530
|
+
else {
|
65531
|
+
var img_1 = new Image();
|
65532
|
+
img_1.crossOrigin = "anonymous";
|
65533
|
+
img_1.src = url;
|
65534
|
+
img_1.onload = function () {
|
65535
|
+
if (!!_this.canvas) {
|
65536
|
+
var ctx = _this.canvas.getContext("2d");
|
65537
|
+
ctx.drawImage(img_1, 0, 0);
|
65538
|
+
var dataURL = _this.canvas.toDataURL(_this.getFormat());
|
65539
|
+
_this.fromDataUrl(dataURL);
|
65540
|
+
}
|
65541
|
+
_this.isFileLoading = false;
|
65542
|
+
};
|
65543
|
+
img_1.onerror = function () {
|
65544
|
+
_this.isFileLoading = false;
|
65545
|
+
};
|
65546
|
+
}
|
65399
65547
|
};
|
65400
65548
|
QuestionSignaturePadModel.prototype.fromDataUrl = function (data) {
|
65401
65549
|
this._loadedData = data;
|
@@ -65436,11 +65584,11 @@ var question_signaturepad_QuestionSignaturePadModel = /** @class */ (function (_
|
|
65436
65584
|
this._previewLoader = new FileLoader(this, function (status, loaded) {
|
65437
65585
|
if (status === "success" && loaded && loaded.length > 0 && loaded[0].content) {
|
65438
65586
|
_this.fromDataUrl(loaded[0].content);
|
65587
|
+
_this.isFileLoading = false;
|
65439
65588
|
}
|
65440
65589
|
else if (status === "skipped") {
|
65441
65590
|
_this.fromUrl(newValue);
|
65442
65591
|
}
|
65443
|
-
_this.isFileLoading = false;
|
65444
65592
|
_this._previewLoader.dispose();
|
65445
65593
|
_this._previewLoader = undefined;
|
65446
65594
|
});
|
@@ -71843,8 +71991,8 @@ Serializer.addClass("currencymask", [
|
|
71843
71991
|
|
71844
71992
|
var Version;
|
71845
71993
|
var ReleaseDate;
|
71846
|
-
Version = "" + "1.12.
|
71847
|
-
ReleaseDate = "" + "2024-11-
|
71994
|
+
Version = "" + "1.12.10";
|
71995
|
+
ReleaseDate = "" + "2024-11-13";
|
71848
71996
|
function checkLibraryVersion(ver, libraryName) {
|
71849
71997
|
if (Version != ver) {
|
71850
71998
|
var str = "survey-core has version '" + Version + "' and " + libraryName
|
@@ -83007,17 +83155,14 @@ var action_bar_SurveyActionBar = /** @class */ (function (_super) {
|
|
83007
83155
|
};
|
83008
83156
|
SurveyActionBar.prototype.componentWillUnmount = function () {
|
83009
83157
|
_super.prototype.componentWillUnmount.call(this);
|
83010
|
-
|
83011
|
-
this.model.resetResponsivityManager();
|
83012
|
-
}
|
83158
|
+
this.model.resetResponsivityManager();
|
83013
83159
|
};
|
83014
83160
|
SurveyActionBar.prototype.componentDidUpdate = function (prevProps, prevState) {
|
83015
83161
|
_super.prototype.componentDidUpdate.call(this, prevProps, prevState);
|
83016
|
-
if (prevProps.model
|
83017
|
-
|
83162
|
+
if (prevProps.model != this.props.model) {
|
83163
|
+
prevProps.model.resetResponsivityManager();
|
83018
83164
|
}
|
83019
83165
|
if (!!this.model.hasActions) {
|
83020
|
-
this.model.resetResponsivityManager();
|
83021
83166
|
var container = this.rootRef.current;
|
83022
83167
|
if (!!container) {
|
83023
83168
|
this.model.initResponsivityManager(container, function (callback) { setTimeout(callback); });
|