survey-react 1.11.14 → 1.12.1
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 +157 -134
- package/defaultV2.css.map +1 -1
- package/defaultV2.min.css +2 -2
- package/modern.css +27 -41
- package/modern.css.map +1 -1
- package/modern.min.css +2 -2
- package/package.json +1 -1
- package/survey.css +1 -1
- package/survey.min.css +1 -1
- package/survey.react.d.ts +92 -33
- package/survey.react.js +493 -228
- 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.
|
2
|
+
* surveyjs - Survey JavaScript library v1.12.1
|
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
|
*/
|
@@ -1914,6 +1914,18 @@ var helpers_Helpers = /** @class */ (function () {
|
|
1914
1914
|
}
|
1915
1915
|
return len1 === len2 ? 0 : (len1 < len2 ? -1 : 1);
|
1916
1916
|
};
|
1917
|
+
Helpers.isUrlYoutubeVideo = function (url) {
|
1918
|
+
if (!url)
|
1919
|
+
return false;
|
1920
|
+
var youtubeDomains = ["www.youtube.com", "m.youtube.com", "youtube.com", "youtu.be"];
|
1921
|
+
url = url.toLowerCase();
|
1922
|
+
url = url.replace(/^https?:\/\//, "");
|
1923
|
+
for (var i = 0; i < youtubeDomains.length; i++) {
|
1924
|
+
if (url.indexOf(youtubeDomains[i] + "/") === 0)
|
1925
|
+
return true;
|
1926
|
+
}
|
1927
|
+
return false;
|
1928
|
+
};
|
1917
1929
|
return Helpers;
|
1918
1930
|
}());
|
1919
1931
|
|
@@ -9665,6 +9677,8 @@ var base_Base = /** @class */ (function () {
|
|
9665
9677
|
name: name,
|
9666
9678
|
oldValue: oldValue,
|
9667
9679
|
newValue: newValue,
|
9680
|
+
arrayChanges: arrayChanges,
|
9681
|
+
target: target
|
9668
9682
|
});
|
9669
9683
|
this.doPropertyValueChangedCallback(name, oldValue, newValue, arrayChanges, this);
|
9670
9684
|
this.checkConditionPropertyChanged(name);
|
@@ -10180,6 +10194,8 @@ var base_Base = /** @class */ (function () {
|
|
10180
10194
|
this.onElementRenderedEventEnabled = true;
|
10181
10195
|
};
|
10182
10196
|
Base.prototype.disableOnElementRenderedEvent = function () {
|
10197
|
+
var _a;
|
10198
|
+
(_a = this.onElementRerendered) === null || _a === void 0 ? void 0 : _a.fire(this, { isCancel: true });
|
10183
10199
|
this.onElementRenderedEventEnabled = false;
|
10184
10200
|
};
|
10185
10201
|
Object.defineProperty(Base.prototype, "onElementRerendered", {
|
@@ -10191,7 +10207,7 @@ var base_Base = /** @class */ (function () {
|
|
10191
10207
|
});
|
10192
10208
|
Base.prototype.afterRerender = function () {
|
10193
10209
|
var _a;
|
10194
|
-
(_a = this.onElementRerendered) === null || _a === void 0 ? void 0 : _a.fire(this,
|
10210
|
+
(_a = this.onElementRerendered) === null || _a === void 0 ? void 0 : _a.fire(this, { isCancel: false });
|
10195
10211
|
};
|
10196
10212
|
Base.currentDependencis = undefined;
|
10197
10213
|
return Base;
|
@@ -10306,6 +10322,10 @@ var responsivity_manager_ResponsivityManager = /** @class */ (function () {
|
|
10306
10322
|
function ResponsivityManager(container, model, itemsSelector, dotsItemSize, delayedUpdateFunction) {
|
10307
10323
|
var _this = this;
|
10308
10324
|
if (dotsItemSize === void 0) { dotsItemSize = null; }
|
10325
|
+
if (delayedUpdateFunction === void 0) { delayedUpdateFunction = function (callback) { if (queueMicrotask)
|
10326
|
+
queueMicrotask(callback);
|
10327
|
+
else
|
10328
|
+
callback(); }; }
|
10309
10329
|
this.container = container;
|
10310
10330
|
this.model = model;
|
10311
10331
|
this.itemsSelector = itemsSelector;
|
@@ -10323,8 +10343,9 @@ var responsivity_manager_ResponsivityManager = /** @class */ (function () {
|
|
10323
10343
|
return DomDocumentHelper.getComputedStyle(elt);
|
10324
10344
|
};
|
10325
10345
|
this.model.updateCallback = function (isResetInitialized) {
|
10326
|
-
if (isResetInitialized)
|
10346
|
+
if (isResetInitialized) {
|
10327
10347
|
_this.isInitialized = false;
|
10348
|
+
}
|
10328
10349
|
setTimeout(function () { _this.process(); }, 1);
|
10329
10350
|
};
|
10330
10351
|
if (typeof ResizeObserver !== "undefined") {
|
@@ -10363,16 +10384,6 @@ var responsivity_manager_ResponsivityManager = /** @class */ (function () {
|
|
10363
10384
|
(currentAction.needSeparator ? this.separatorSize : 0)
|
10364
10385
|
: currentAction.maxDimension;
|
10365
10386
|
};
|
10366
|
-
ResponsivityManager.prototype.getRenderedVisibleActionsCount = function () {
|
10367
|
-
var _this = this;
|
10368
|
-
var count = 0;
|
10369
|
-
this.container.querySelectorAll(this.itemsSelector).forEach(function (item) {
|
10370
|
-
if (_this.calcItemSize(item) > 0) {
|
10371
|
-
count++;
|
10372
|
-
}
|
10373
|
-
});
|
10374
|
-
return count;
|
10375
|
-
};
|
10376
10387
|
ResponsivityManager.prototype.calcItemsSizes = function () {
|
10377
10388
|
var _this = this;
|
10378
10389
|
if (this.isInitialized)
|
@@ -10416,16 +10427,8 @@ var responsivity_manager_ResponsivityManager = /** @class */ (function () {
|
|
10416
10427
|
_this.isInitialized = true;
|
10417
10428
|
processResponsiveness_1();
|
10418
10429
|
};
|
10419
|
-
if (this.
|
10420
|
-
|
10421
|
-
this.delayedUpdateFunction(callback);
|
10422
|
-
}
|
10423
|
-
else if (queueMicrotask) {
|
10424
|
-
queueMicrotask(callback);
|
10425
|
-
}
|
10426
|
-
else {
|
10427
|
-
callback();
|
10428
|
-
}
|
10430
|
+
if (this.delayedUpdateFunction) {
|
10431
|
+
this.delayedUpdateFunction(callback);
|
10429
10432
|
}
|
10430
10433
|
else {
|
10431
10434
|
callback();
|
@@ -12337,7 +12340,6 @@ var animation_AnimationUtils = /** @class */ (function () {
|
|
12337
12340
|
var animationsCount = this.getAnimationsCount(element);
|
12338
12341
|
var onEndCallback = function (isCancel) {
|
12339
12342
|
if (isCancel === void 0) { isCancel = true; }
|
12340
|
-
_this.afterAnimationRun(element, options);
|
12341
12343
|
callback(isCancel);
|
12342
12344
|
clearTimeout(cancelTimeout);
|
12343
12345
|
_this.removeCancelCallback(onEndCallback);
|
@@ -12356,7 +12358,6 @@ var animation_AnimationUtils = /** @class */ (function () {
|
|
12356
12358
|
}, this.getAnimationDuration(element) + 10);
|
12357
12359
|
}
|
12358
12360
|
else {
|
12359
|
-
this.afterAnimationRun(element, options);
|
12360
12361
|
callback(true);
|
12361
12362
|
}
|
12362
12363
|
};
|
@@ -12391,6 +12392,7 @@ var animation_AnimationUtils = /** @class */ (function () {
|
|
12391
12392
|
element.classList.remove(cssClass);
|
12392
12393
|
});
|
12393
12394
|
}
|
12395
|
+
this.afterAnimationRun(element, options);
|
12394
12396
|
};
|
12395
12397
|
AnimationUtils.prototype.onNextRender = function (callback, isCancel) {
|
12396
12398
|
var _this = this;
|
@@ -12513,7 +12515,7 @@ var animation_AnimationProperty = /** @class */ (function () {
|
|
12513
12515
|
this.update = update;
|
12514
12516
|
this.getCurrentValue = getCurrentValue;
|
12515
12517
|
this._debouncedSync = debounce(function (newValue) {
|
12516
|
-
_this.
|
12518
|
+
_this.cancelAnimations();
|
12517
12519
|
try {
|
12518
12520
|
_this._sync(newValue);
|
12519
12521
|
}
|
@@ -12546,8 +12548,13 @@ var animation_AnimationProperty = /** @class */ (function () {
|
|
12546
12548
|
rerenderEvent.remove(nextRenderCallback_1);
|
12547
12549
|
_this.cancelCallback = undefined;
|
12548
12550
|
};
|
12549
|
-
var nextRenderCallback_1 = function () {
|
12550
|
-
|
12551
|
+
var nextRenderCallback_1 = function (_, options) {
|
12552
|
+
if (options.isCancel) {
|
12553
|
+
onCancel && onCancel();
|
12554
|
+
}
|
12555
|
+
else {
|
12556
|
+
callback();
|
12557
|
+
}
|
12551
12558
|
clear_1();
|
12552
12559
|
};
|
12553
12560
|
this.cancelCallback = function () {
|
@@ -12568,6 +12575,9 @@ var animation_AnimationProperty = /** @class */ (function () {
|
|
12568
12575
|
};
|
12569
12576
|
AnimationProperty.prototype.cancel = function () {
|
12570
12577
|
this._debouncedSync.cancel();
|
12578
|
+
this.cancelAnimations();
|
12579
|
+
};
|
12580
|
+
AnimationProperty.prototype.cancelAnimations = function () {
|
12571
12581
|
this.cancelCallback && this.cancelCallback();
|
12572
12582
|
this.animation.cancel();
|
12573
12583
|
};
|
@@ -12613,7 +12623,8 @@ var animation_AnimationGroup = /** @class */ (function (_super) {
|
|
12613
12623
|
AnimationGroup.prototype._sync = function (newValue) {
|
12614
12624
|
var _this = this;
|
12615
12625
|
var _a, _b;
|
12616
|
-
|
12626
|
+
newValue = [].concat(newValue);
|
12627
|
+
var oldValue = [].concat(this.getCurrentValue());
|
12617
12628
|
var allowSyncRemovalAddition = (_a = this.animationOptions.allowSyncRemovalAddition) !== null && _a !== void 0 ? _a : true;
|
12618
12629
|
var _c = compareArrays(oldValue, newValue, (_b = this.animationOptions.getKey) !== null && _b !== void 0 ? _b : (function (item) { return item; })), addedItems = _c.addedItems, deletedItems = _c.deletedItems, reorderedItems = _c.reorderedItems, mergedItems = _c.mergedItems;
|
12619
12630
|
if (!allowSyncRemovalAddition && (reorderedItems.length > 0 || addedItems.length > 0)) {
|
@@ -12887,7 +12898,7 @@ var survey_element_SurveyElementCore = /** @class */ (function (_super) {
|
|
12887
12898
|
});
|
12888
12899
|
SurveyElementCore.prototype.getIsTitleRenderedAsString = function () { return !this.isTitleOwner; };
|
12889
12900
|
survey_element_decorate([
|
12890
|
-
jsonobject_property()
|
12901
|
+
jsonobject_property({})
|
12891
12902
|
], SurveyElementCore.prototype, "hasDescription", void 0);
|
12892
12903
|
survey_element_decorate([
|
12893
12904
|
jsonobject_property({
|
@@ -14056,17 +14067,18 @@ var survey_element_SurveyElement = /** @class */ (function (_super) {
|
|
14056
14067
|
var _this = this;
|
14057
14068
|
var beforeRunAnimation = function (el) {
|
14058
14069
|
_this.isAnimatingCollapseExpand = true;
|
14059
|
-
|
14070
|
+
prepareElementForVerticalAnimation(el);
|
14060
14071
|
};
|
14061
14072
|
var afterRunAnimation = function (el) {
|
14062
14073
|
_this.isAnimatingCollapseExpand = false;
|
14074
|
+
cleanHtmlElementAfterAnimation(el);
|
14063
14075
|
};
|
14064
14076
|
return {
|
14065
14077
|
getRerenderEvent: function () { return _this.onElementRerendered; },
|
14066
14078
|
getEnterOptions: function () {
|
14067
14079
|
var cssClasses = _this.isPanel ? _this.cssClasses.panel : _this.cssClasses;
|
14068
14080
|
return {
|
14069
|
-
cssClass: cssClasses.
|
14081
|
+
cssClass: cssClasses.contentEnter,
|
14070
14082
|
onBeforeRunAnimation: beforeRunAnimation,
|
14071
14083
|
onAfterRunAnimation: function (el) {
|
14072
14084
|
afterRunAnimation(el);
|
@@ -14076,8 +14088,7 @@ var survey_element_SurveyElement = /** @class */ (function (_super) {
|
|
14076
14088
|
},
|
14077
14089
|
getLeaveOptions: function () {
|
14078
14090
|
var cssClasses = _this.isPanel ? _this.cssClasses.panel : _this.cssClasses;
|
14079
|
-
return {
|
14080
|
-
cssClass: cssClasses.contentFadeOut,
|
14091
|
+
return { cssClass: cssClasses.contentLeave,
|
14081
14092
|
onBeforeRunAnimation: beforeRunAnimation,
|
14082
14093
|
onAfterRunAnimation: afterRunAnimation
|
14083
14094
|
};
|
@@ -14909,10 +14920,20 @@ function navigateToUrl(url) {
|
|
14909
14920
|
function wrapUrlForBackgroundImage(url) {
|
14910
14921
|
return !!url ? ["url(", url, ")"].join("") : "";
|
14911
14922
|
}
|
14923
|
+
//new-name: old-name
|
14924
|
+
var renamedIcons = {
|
14925
|
+
"folder": "chooseFile"
|
14926
|
+
};
|
14912
14927
|
function getIconNameFromProxy(iconName) {
|
14913
14928
|
if (!iconName)
|
14914
14929
|
return iconName;
|
14915
14930
|
var proxyName = settings.customIcons[iconName];
|
14931
|
+
if (!proxyName) {
|
14932
|
+
var oldName = renamedIcons[iconName];
|
14933
|
+
if (!!oldName) {
|
14934
|
+
proxyName = settings.customIcons[oldName];
|
14935
|
+
}
|
14936
|
+
}
|
14916
14937
|
return !!proxyName ? proxyName : iconName;
|
14917
14938
|
}
|
14918
14939
|
function createSvg(size, width, height, iconName, svgElem, title) {
|
@@ -15307,6 +15328,53 @@ function compareArrays(oldValue, newValue, getKey) {
|
|
15307
15328
|
});
|
15308
15329
|
return { reorderedItems: reorderedItems, deletedItems: deletedItems, addedItems: addedItems, mergedItems: mergedItems };
|
15309
15330
|
}
|
15331
|
+
function getVerticalDimensions(el) {
|
15332
|
+
if (DomDocumentHelper.isAvailable()) {
|
15333
|
+
var _a = DomDocumentHelper.getComputedStyle(el), paddingTop = _a.paddingTop, paddingBottom = _a.paddingBottom, borderTopWidth = _a.borderTopWidth, borderBottomWidth = _a.borderBottomWidth, marginTop = _a.marginTop, marginBottom = _a.marginBottom, boxSizing = _a.boxSizing;
|
15334
|
+
var heightTo = el.offsetHeight + "px";
|
15335
|
+
if (boxSizing == "content-box") {
|
15336
|
+
var heightPx_1 = el.offsetHeight;
|
15337
|
+
[borderBottomWidth, borderTopWidth, paddingBottom, paddingTop].forEach(function (style) {
|
15338
|
+
heightPx_1 -= parseFloat(style);
|
15339
|
+
});
|
15340
|
+
heightTo = heightPx_1 + "px";
|
15341
|
+
}
|
15342
|
+
return {
|
15343
|
+
paddingTop: paddingTop,
|
15344
|
+
paddingBottom: paddingBottom,
|
15345
|
+
borderTopWidth: borderTopWidth,
|
15346
|
+
borderBottomWidth: borderBottomWidth,
|
15347
|
+
marginTop: marginTop,
|
15348
|
+
marginBottom: marginBottom,
|
15349
|
+
heightFrom: "0px",
|
15350
|
+
heightTo: heightTo
|
15351
|
+
};
|
15352
|
+
}
|
15353
|
+
else {
|
15354
|
+
return undefined;
|
15355
|
+
}
|
15356
|
+
}
|
15357
|
+
function setPropertiesOnElementForAnimation(el, styles, prefix) {
|
15358
|
+
var _a;
|
15359
|
+
if (prefix === void 0) { prefix = "--animation-"; }
|
15360
|
+
el["__sv_created_properties"] = (_a = el["__sv_created_properties"]) !== null && _a !== void 0 ? _a : [];
|
15361
|
+
Object.keys(styles).forEach(function (key) {
|
15362
|
+
var propertyName = "" + prefix + key.split(/\.?(?=[A-Z])/).join("-").toLowerCase();
|
15363
|
+
el.style.setProperty(propertyName, styles[key]);
|
15364
|
+
el["__sv_created_properties"].push(propertyName);
|
15365
|
+
});
|
15366
|
+
}
|
15367
|
+
function prepareElementForVerticalAnimation(el) {
|
15368
|
+
setPropertiesOnElementForAnimation(el, getVerticalDimensions(el));
|
15369
|
+
}
|
15370
|
+
function cleanHtmlElementAfterAnimation(el) {
|
15371
|
+
if (Array.isArray(el["__sv_created_properties"])) {
|
15372
|
+
el["__sv_created_properties"].forEach(function (propertyName) {
|
15373
|
+
el.style.removeProperty(propertyName);
|
15374
|
+
});
|
15375
|
+
delete el["__sv_created_properties"];
|
15376
|
+
}
|
15377
|
+
}
|
15310
15378
|
function roundTo2Decimals(number) {
|
15311
15379
|
return Math.round(number * 100) / 100;
|
15312
15380
|
}
|
@@ -19834,7 +19902,7 @@ var question_Question = /** @class */ (function (_super) {
|
|
19834
19902
|
Question.prototype.hasErrors = function (fireCallback, rec) {
|
19835
19903
|
if (fireCallback === void 0) { fireCallback = true; }
|
19836
19904
|
if (rec === void 0) { rec = null; }
|
19837
|
-
var errors = this.checkForErrors(!!rec && rec.isOnValueChanged === true);
|
19905
|
+
var errors = this.checkForErrors(!!rec && rec.isOnValueChanged === true, fireCallback);
|
19838
19906
|
if (fireCallback) {
|
19839
19907
|
if (!!this.survey) {
|
19840
19908
|
this.survey.beforeSettingQuestionErrors(this, errors);
|
@@ -19909,18 +19977,18 @@ var question_Question = /** @class */ (function (_super) {
|
|
19909
19977
|
if (index !== -1)
|
19910
19978
|
errors.splice(index, 1);
|
19911
19979
|
};
|
19912
|
-
Question.prototype.checkForErrors = function (isOnValueChanged) {
|
19980
|
+
Question.prototype.checkForErrors = function (isOnValueChanged, fireCallback) {
|
19913
19981
|
var qErrors = new Array();
|
19914
19982
|
if (this.isVisible && this.canCollectErrors()) {
|
19915
|
-
this.collectErrors(qErrors, isOnValueChanged);
|
19983
|
+
this.collectErrors(qErrors, isOnValueChanged, fireCallback);
|
19916
19984
|
}
|
19917
19985
|
return qErrors;
|
19918
19986
|
};
|
19919
19987
|
Question.prototype.canCollectErrors = function () {
|
19920
19988
|
return !this.isReadOnly || settings.readOnly.enableValidation;
|
19921
19989
|
};
|
19922
|
-
Question.prototype.collectErrors = function (qErrors, isOnValueChanged) {
|
19923
|
-
this.onCheckForErrors(qErrors, isOnValueChanged);
|
19990
|
+
Question.prototype.collectErrors = function (qErrors, isOnValueChanged, fireCallback) {
|
19991
|
+
this.onCheckForErrors(qErrors, isOnValueChanged, fireCallback);
|
19924
19992
|
if (qErrors.length > 0 || !this.canRunValidators(isOnValueChanged))
|
19925
19993
|
return;
|
19926
19994
|
var errors = this.runValidators();
|
@@ -19946,7 +20014,7 @@ var question_Question = /** @class */ (function (_super) {
|
|
19946
20014
|
return this.validateValueCallback();
|
19947
20015
|
return this.survey ? this.survey.validateQuestion(this) : null;
|
19948
20016
|
};
|
19949
|
-
Question.prototype.onCheckForErrors = function (errors, isOnValueChanged) {
|
20017
|
+
Question.prototype.onCheckForErrors = function (errors, isOnValueChanged, fireCallback) {
|
19950
20018
|
var _this = this;
|
19951
20019
|
if ((!isOnValueChanged || this.isOldAnswered) && this.hasRequiredError()) {
|
19952
20020
|
var err = new AnswerRequiredError(this.requiredErrorText, this);
|
@@ -21172,6 +21240,12 @@ var itemvalue_ItemValue = /** @class */ (function (_super) {
|
|
21172
21240
|
ItemValue.prototype.setComponent = function (val) {
|
21173
21241
|
this.componentValue = val;
|
21174
21242
|
};
|
21243
|
+
ItemValue.prototype.setRootElement = function (val) {
|
21244
|
+
this._htmlElement = val;
|
21245
|
+
};
|
21246
|
+
ItemValue.prototype.getRootElement = function () {
|
21247
|
+
return this._htmlElement;
|
21248
|
+
};
|
21175
21249
|
ItemValue.prototype.getEnabled = function () {
|
21176
21250
|
return this.isEnabled;
|
21177
21251
|
};
|
@@ -21943,52 +22017,32 @@ var choicesRestful_ChoicesRestful = /** @class */ (function (_super) {
|
|
21943
22017
|
}
|
21944
22018
|
return res;
|
21945
22019
|
};
|
22020
|
+
ChoicesRestful.prototype.getAllPropertiesNames = function () {
|
22021
|
+
var res = new Array();
|
22022
|
+
Serializer.getPropertiesByObj(this).forEach(function (prop) { return res.push(prop.name); });
|
22023
|
+
this.getCustomPropertiesNames().forEach(function (prop) { return res.push(prop); });
|
22024
|
+
return res;
|
22025
|
+
};
|
21946
22026
|
ChoicesRestful.prototype.setData = function (json) {
|
21947
|
-
this
|
21948
|
-
if (json
|
21949
|
-
|
21950
|
-
|
21951
|
-
|
21952
|
-
|
21953
|
-
this.valueName = json.valueName;
|
21954
|
-
if (json.titleName)
|
21955
|
-
this.titleName = json.titleName;
|
21956
|
-
if (json.imageLinkName)
|
21957
|
-
this.imageLinkName = json.imageLinkName;
|
21958
|
-
if (json.allowEmptyResponse !== undefined)
|
21959
|
-
this.allowEmptyResponse = json.allowEmptyResponse;
|
21960
|
-
if (json.attachOriginalItems !== undefined)
|
21961
|
-
this.attachOriginalItems = json.attachOriginalItems;
|
21962
|
-
var properties = this.getCustomPropertiesNames();
|
21963
|
-
for (var i = 0; i < properties.length; i++) {
|
21964
|
-
if (json[properties[i]])
|
21965
|
-
this[properties[i]] = json[properties[i]];
|
21966
|
-
}
|
22027
|
+
var _this = this;
|
22028
|
+
if (!json)
|
22029
|
+
json = {};
|
22030
|
+
this.getAllPropertiesNames().forEach(function (name) {
|
22031
|
+
_this[name] = json[name];
|
22032
|
+
});
|
21967
22033
|
};
|
21968
22034
|
ChoicesRestful.prototype.getData = function () {
|
21969
|
-
|
21970
|
-
return null;
|
22035
|
+
var _this = this;
|
21971
22036
|
var res = {};
|
21972
|
-
|
21973
|
-
|
21974
|
-
|
21975
|
-
|
21976
|
-
|
21977
|
-
|
21978
|
-
|
21979
|
-
|
21980
|
-
|
21981
|
-
res["imageLinkName"] = this.imageLinkName;
|
21982
|
-
if (this.allowEmptyResponse)
|
21983
|
-
res["allowEmptyResponse"] = this.allowEmptyResponse;
|
21984
|
-
if (this.attachOriginalItems)
|
21985
|
-
res["attachOriginalItems"] = this.attachOriginalItems;
|
21986
|
-
var properties = this.getCustomPropertiesNames();
|
21987
|
-
for (var i = 0; i < properties.length; i++) {
|
21988
|
-
if (this[properties[i]])
|
21989
|
-
res[properties[i]] = this[properties[i]];
|
21990
|
-
}
|
21991
|
-
return res;
|
22037
|
+
var hasValue = false;
|
22038
|
+
this.getAllPropertiesNames().forEach(function (name) {
|
22039
|
+
var val = _this[name];
|
22040
|
+
if (!_this.isValueEmpty(val) && val !== _this.getDefaultPropertyValue(name)) {
|
22041
|
+
res[name] = val;
|
22042
|
+
hasValue = true;
|
22043
|
+
}
|
22044
|
+
});
|
22045
|
+
return hasValue ? res : null;
|
21992
22046
|
};
|
21993
22047
|
Object.defineProperty(ChoicesRestful.prototype, "url", {
|
21994
22048
|
/**
|
@@ -22145,16 +22199,7 @@ var choicesRestful_ChoicesRestful = /** @class */ (function (_super) {
|
|
22145
22199
|
configurable: true
|
22146
22200
|
});
|
22147
22201
|
ChoicesRestful.prototype.clear = function () {
|
22148
|
-
this.
|
22149
|
-
this.path = undefined;
|
22150
|
-
this.valueName = undefined;
|
22151
|
-
this.titleName = undefined;
|
22152
|
-
this.imageLinkName = undefined;
|
22153
|
-
var properties = this.getCustomPropertiesNames();
|
22154
|
-
for (var i = 0; i < properties.length; i++) {
|
22155
|
-
if (this[properties[i]])
|
22156
|
-
this[properties[i]] = "";
|
22157
|
-
}
|
22202
|
+
this.setData(undefined);
|
22158
22203
|
};
|
22159
22204
|
ChoicesRestful.prototype.beforeSendRequest = function () {
|
22160
22205
|
this.isRunningValue = true;
|
@@ -23402,8 +23447,8 @@ var question_custom_QuestionCustomModelBase = /** @class */ (function (_super) {
|
|
23402
23447
|
_super.prototype.setNewValue.call(this, newValue);
|
23403
23448
|
this.updateElementCss();
|
23404
23449
|
};
|
23405
|
-
QuestionCustomModelBase.prototype.onCheckForErrors = function (errors, isOnValueChanged) {
|
23406
|
-
_super.prototype.onCheckForErrors.call(this, errors, isOnValueChanged);
|
23450
|
+
QuestionCustomModelBase.prototype.onCheckForErrors = function (errors, isOnValueChanged, fireCallback) {
|
23451
|
+
_super.prototype.onCheckForErrors.call(this, errors, isOnValueChanged, fireCallback);
|
23407
23452
|
if (!!this.customQuestion) {
|
23408
23453
|
var text = this.customQuestion.onGetErrorText(this);
|
23409
23454
|
if (!!text) {
|
@@ -25738,7 +25783,7 @@ var question_matrixdropdowncolumn_MatrixDropdownColumn = /** @class */ (function
|
|
25738
25783
|
this.templateQuestion.locOwner = this;
|
25739
25784
|
this.addProperties(curCellType);
|
25740
25785
|
this.templateQuestion.onPropertyChanged.add(function (sender, options) {
|
25741
|
-
_this.propertyValueChanged(options.name, options.oldValue, options.newValue);
|
25786
|
+
_this.propertyValueChanged(options.name, options.oldValue, options.newValue, options.arrayChanges, options.target);
|
25742
25787
|
});
|
25743
25788
|
this.templateQuestion.onItemValuePropertyChanged.add(function (sender, options) {
|
25744
25789
|
_this.doItemValuePropertyChanged(options.propertyName, options.obj, options.name, options.newValue, options.oldValue);
|
@@ -25781,7 +25826,7 @@ var question_matrixdropdowncolumn_MatrixDropdownColumn = /** @class */ (function
|
|
25781
25826
|
delete json["choices"];
|
25782
25827
|
}
|
25783
25828
|
delete json["itemComponent"];
|
25784
|
-
if (this.jsonObj) {
|
25829
|
+
if (this.jsonObj && json.type === "rating") {
|
25785
25830
|
Object.keys(this.jsonObj).forEach(function (prop) {
|
25786
25831
|
json[prop] = _this.jsonObj[prop];
|
25787
25832
|
});
|
@@ -25808,8 +25853,8 @@ var question_matrixdropdowncolumn_MatrixDropdownColumn = /** @class */ (function
|
|
25808
25853
|
};
|
25809
25854
|
}
|
25810
25855
|
};
|
25811
|
-
MatrixDropdownColumn.prototype.propertyValueChanged = function (name, oldValue, newValue) {
|
25812
|
-
_super.prototype.propertyValueChanged.call(this, name, oldValue, newValue);
|
25856
|
+
MatrixDropdownColumn.prototype.propertyValueChanged = function (name, oldValue, newValue, arrayChanges, target) {
|
25857
|
+
_super.prototype.propertyValueChanged.call(this, name, oldValue, newValue, arrayChanges, target);
|
25813
25858
|
if (name === "isRequired") {
|
25814
25859
|
this.updateIsRenderedRequired(newValue);
|
25815
25860
|
}
|
@@ -25993,6 +26038,7 @@ var question_matrixdropdownrendered_spreadArray = (undefined && undefined.__spre
|
|
25993
26038
|
|
25994
26039
|
|
25995
26040
|
|
26041
|
+
|
25996
26042
|
var question_matrixdropdownrendered_QuestionMatrixDropdownRenderedCell = /** @class */ (function () {
|
25997
26043
|
function QuestionMatrixDropdownRenderedCell() {
|
25998
26044
|
this.minWidth = "";
|
@@ -26323,9 +26369,14 @@ var question_matrixdropdownrendered_QuestionMatrixDropdownRenderedTable = /** @c
|
|
26323
26369
|
};
|
26324
26370
|
QuestionMatrixDropdownRenderedTable.prototype.getRenderedRowsAnimationOptions = function () {
|
26325
26371
|
var _this = this;
|
26326
|
-
var
|
26372
|
+
var onBeforeRunAnimation = function (el) {
|
26373
|
+
el.querySelectorAll(":scope > td > *").forEach(function (el) {
|
26374
|
+
prepareElementForVerticalAnimation(el);
|
26375
|
+
});
|
26376
|
+
};
|
26377
|
+
var onAfterRunAnimation = function (el) {
|
26327
26378
|
el.querySelectorAll(":scope > td > *").forEach(function (el) {
|
26328
|
-
|
26379
|
+
cleanHtmlElementAfterAnimation(el);
|
26329
26380
|
});
|
26330
26381
|
};
|
26331
26382
|
return {
|
@@ -26337,10 +26388,10 @@ var question_matrixdropdownrendered_QuestionMatrixDropdownRenderedTable = /** @c
|
|
26337
26388
|
return el.getRootElement();
|
26338
26389
|
},
|
26339
26390
|
getLeaveOptions: function () {
|
26340
|
-
return { cssClass: _this.cssClasses.
|
26391
|
+
return { cssClass: _this.cssClasses.rowLeave, onBeforeRunAnimation: onBeforeRunAnimation, onAfterRunAnimation: onAfterRunAnimation };
|
26341
26392
|
},
|
26342
|
-
getEnterOptions: function () {
|
26343
|
-
return { cssClass: _this.cssClasses.
|
26393
|
+
getEnterOptions: function (_, info) {
|
26394
|
+
return { cssClass: _this.cssClasses.rowEnter, onBeforeRunAnimation: onBeforeRunAnimation, onAfterRunAnimation: onAfterRunAnimation };
|
26344
26395
|
}
|
26345
26396
|
};
|
26346
26397
|
};
|
@@ -30683,13 +30734,17 @@ var core_DragDropCore = /** @class */ (function () {
|
|
30683
30734
|
DragDropCore.prototype.afterDragOver = function (dropTargetNode) { };
|
30684
30735
|
DragDropCore.prototype.findDropTargetNodeFromPoint = function (clientX, clientY) {
|
30685
30736
|
var displayProp = this.domAdapter.draggedElementShortcut.style.display;
|
30686
|
-
//this.domAdapter.draggedElementShortcut.hidden = true;
|
30687
30737
|
this.domAdapter.draggedElementShortcut.style.display = "none";
|
30688
30738
|
if (!DomDocumentHelper.isAvailable())
|
30689
30739
|
return null;
|
30690
|
-
var
|
30691
|
-
// this.domAdapter.draggedElementShortcut.hidden = false;
|
30740
|
+
var dragOverNodes = this.domAdapter.documentOrShadowRoot.elementsFromPoint(clientX, clientY);
|
30692
30741
|
this.domAdapter.draggedElementShortcut.style.display = displayProp || "block";
|
30742
|
+
var index = 0;
|
30743
|
+
var dragOverNode = dragOverNodes[index];
|
30744
|
+
while (dragOverNode && dragOverNode.className && typeof dragOverNode.className.indexOf == "function" && dragOverNode.className.indexOf("sv-drag-target-skipped") != -1) {
|
30745
|
+
index++;
|
30746
|
+
dragOverNode = dragOverNodes[index];
|
30747
|
+
}
|
30693
30748
|
if (!dragOverNode)
|
30694
30749
|
return null;
|
30695
30750
|
return this.findDropTargetNodeByDragOverNode(dragOverNode);
|
@@ -31865,8 +31920,8 @@ var question_matrixdynamic_QuestionMatrixDynamicModel = /** @class */ (function
|
|
31865
31920
|
enumerable: false,
|
31866
31921
|
configurable: true
|
31867
31922
|
});
|
31868
|
-
QuestionMatrixDynamicModel.prototype.onCheckForErrors = function (errors, isOnValueChanged) {
|
31869
|
-
_super.prototype.onCheckForErrors.call(this, errors, isOnValueChanged);
|
31923
|
+
QuestionMatrixDynamicModel.prototype.onCheckForErrors = function (errors, isOnValueChanged, fireCallback) {
|
31924
|
+
_super.prototype.onCheckForErrors.call(this, errors, isOnValueChanged, fireCallback);
|
31870
31925
|
if (!isOnValueChanged && this.hasErrorInMinRows()) {
|
31871
31926
|
errors.push(new error_MinRowCountError(this.minRowCount, this));
|
31872
31927
|
}
|
@@ -32173,10 +32228,10 @@ var defaultV2Css = {
|
|
32173
32228
|
edit: "sd-btn sd-btn--small",
|
32174
32229
|
},
|
32175
32230
|
panel: {
|
32176
|
-
|
32177
|
-
|
32178
|
-
|
32179
|
-
|
32231
|
+
contentEnter: "sd-element__content--enter",
|
32232
|
+
contentLeave: "sd-element__content--leave",
|
32233
|
+
enter: "sd-element-wrapper--enter",
|
32234
|
+
leave: "sd-element-wrapper--leave",
|
32180
32235
|
asPage: "sd-panel--as-page",
|
32181
32236
|
number: "sd-element__num",
|
32182
32237
|
title: "sd-title sd-element__title sd-panel__title",
|
@@ -32237,8 +32292,8 @@ var defaultV2Css = {
|
|
32237
32292
|
footerButtonsContainer: "sd-paneldynamic__buttons-container",
|
32238
32293
|
panelsContainer: "sd-paneldynamic__panels-container",
|
32239
32294
|
panelWrapperInRow: "sd-paneldynamic__panel-wrapper--in-row",
|
32240
|
-
|
32241
|
-
|
32295
|
+
panelWrapperEnter: "sd-paneldynamic__panel-wrapper--enter",
|
32296
|
+
panelWrapperLeave: "sd-paneldynamic__panel-wrapper--leave",
|
32242
32297
|
panelWrapperList: "sd-paneldynamic__panel-wrapper--list",
|
32243
32298
|
progressBtnIcon: "icon-progressbuttonv2",
|
32244
32299
|
noEntriesPlaceholder: "sd-paneldynamic__placeholder sd-question__placeholder",
|
@@ -32294,16 +32349,17 @@ var defaultV2Css = {
|
|
32294
32349
|
row: "sd-row sd-clearfix",
|
32295
32350
|
rowMultiple: "sd-row--multiple",
|
32296
32351
|
rowCompact: "sd-row--compact",
|
32297
|
-
|
32298
|
-
|
32299
|
-
|
32352
|
+
rowEnter: "sd-row--enter",
|
32353
|
+
rowDelayedEnter: "sd-row--delayed-enter",
|
32354
|
+
rowLeave: "sd-row--leave",
|
32355
|
+
rowReplace: "sd-row--replace",
|
32300
32356
|
pageRow: "sd-page__row",
|
32301
32357
|
question: {
|
32302
|
-
|
32303
|
-
|
32358
|
+
contentEnter: "sd-element__content--enter",
|
32359
|
+
contentLeave: "sd-element__content--leave",
|
32360
|
+
enter: "sd-element-wrapper--enter",
|
32361
|
+
leave: "sd-element-wrapper--leave",
|
32304
32362
|
mobile: "sd-question--mobile",
|
32305
|
-
fadeIn: "sd-element-wrapper--fade-in",
|
32306
|
-
fadeOut: "sd-element-wrapper--fade-out",
|
32307
32363
|
mainRoot: "sd-element sd-question sd-row__question",
|
32308
32364
|
flowRoot: "sd-element sd-question sd-row__question sd-row__question--flow",
|
32309
32365
|
withFrame: "sd-element--with-frame",
|
@@ -32389,6 +32445,8 @@ var defaultV2Css = {
|
|
32389
32445
|
rootRow: "sd-selectbase--row",
|
32390
32446
|
rootMultiColumn: "sd-selectbase--multi-column",
|
32391
32447
|
item: "sd-item sd-checkbox sd-selectbase__item",
|
32448
|
+
itemEnter: "sd-item--enter",
|
32449
|
+
itemLeave: "sd-item--leave",
|
32392
32450
|
itemOnError: "sd-item--error",
|
32393
32451
|
itemSelectAll: "sd-checkbox--selectall",
|
32394
32452
|
itemNone: "sd-checkbox--none",
|
@@ -32419,6 +32477,8 @@ var defaultV2Css = {
|
|
32419
32477
|
itemInline: "sd-selectbase__item--inline",
|
32420
32478
|
label: "sd-selectbase__label",
|
32421
32479
|
labelChecked: "",
|
32480
|
+
itemEnter: "sd-item--enter",
|
32481
|
+
itemLeave: "sd-item--leave",
|
32422
32482
|
itemDisabled: "sd-item--disabled sd-radio--disabled",
|
32423
32483
|
itemReadOnly: "sd-item--readonly sd-radio--readonly",
|
32424
32484
|
itemPreview: "sd-item--preview sd-radio--preview",
|
@@ -32527,6 +32587,8 @@ var defaultV2Css = {
|
|
32527
32587
|
other: "sd-input sd-comment sd-selectbase__other",
|
32528
32588
|
onError: "sd-input--error",
|
32529
32589
|
label: "sd-selectbase__label",
|
32590
|
+
itemEnter: "sd-item--enter",
|
32591
|
+
itemLeave: "sd-item--leave",
|
32530
32592
|
item: "sd-item sd-radio sd-selectbase__item",
|
32531
32593
|
itemDisabled: "sd-item--disabled sd-radio--disabled",
|
32532
32594
|
itemChecked: "sd-item--checked sd-radio--checked",
|
@@ -32630,8 +32692,9 @@ var defaultV2Css = {
|
|
32630
32692
|
errorsCellBottom: "sd-table__cell--error-bottom",
|
32631
32693
|
itemCell: "sd-table__cell--item",
|
32632
32694
|
row: "sd-table__row",
|
32633
|
-
|
32634
|
-
|
32695
|
+
rowDelayedEnter: "sd-table__row--delayed-enter",
|
32696
|
+
rowEnter: "sd-table__row--enter",
|
32697
|
+
rowLeave: "sd-table__row--leave",
|
32635
32698
|
expandedRow: "sd-table__row--expanded",
|
32636
32699
|
rowHasPanel: "sd-table__row--has-panel",
|
32637
32700
|
rowHasEndActions: "sd-table__row--has-end-actions",
|
@@ -32671,8 +32734,9 @@ var defaultV2Css = {
|
|
32671
32734
|
cell: "sd-table__cell",
|
32672
32735
|
cellResponsiveTitle: "sd-table__responsive-title",
|
32673
32736
|
row: "sd-table__row",
|
32674
|
-
|
32675
|
-
|
32737
|
+
rowDelayedEnter: "sd-table__row--delayed-enter",
|
32738
|
+
rowEnter: "sd-table__row--enter",
|
32739
|
+
rowLeave: "sd-table__row--leave",
|
32676
32740
|
rowHasPanel: "sd-table__row--has-panel",
|
32677
32741
|
rowHasEndActions: "sd-table__row--has-end-actions",
|
32678
32742
|
expandedRow: "sd-table__row--expanded",
|
@@ -32958,6 +33022,8 @@ var defaultV2Css = {
|
|
32958
33022
|
itemHover: "sd-item--allowhover sd-checkbox--allowhover",
|
32959
33023
|
itemControl: "sd-visuallyhidden sd-item__control sd-checkbox__control",
|
32960
33024
|
itemDecorator: "sd-item__svg sd-checkbox__svg",
|
33025
|
+
itemEnter: "sd-item--enter",
|
33026
|
+
itemLeave: "sd-item--leave",
|
32961
33027
|
cleanButton: "sd-tagbox_clean-button sd-dropdown_clean-button",
|
32962
33028
|
cleanButtonSvg: "sd-tagbox_clean-button-svg sd-dropdown_clean-button-svg",
|
32963
33029
|
cleanButtonIconId: "icon-clear",
|
@@ -33746,7 +33812,7 @@ var header_Cover = /** @class */ (function (_super) {
|
|
33746
33812
|
enumerable: false,
|
33747
33813
|
configurable: true
|
33748
33814
|
});
|
33749
|
-
Cover.prototype.propertyValueChanged = function (name, oldValue, newValue) {
|
33815
|
+
Cover.prototype.propertyValueChanged = function (name, oldValue, newValue, arrayChanges, target) {
|
33750
33816
|
_super.prototype.propertyValueChanged.call(this, name, oldValue, newValue);
|
33751
33817
|
if (name === "backgroundColor" || name === "backgroundImage" || name === "overlapEnabled") {
|
33752
33818
|
this.updateHeaderClasses();
|
@@ -34357,8 +34423,8 @@ var panel_QuestionRowModel = /** @class */ (function (_super) {
|
|
34357
34423
|
QuestionRowModel.prototype.getVisibleElementsAnimationOptions = function () {
|
34358
34424
|
var _this = this;
|
34359
34425
|
var beforeRunAnimation = function (el) {
|
34360
|
-
|
34361
|
-
el
|
34426
|
+
prepareElementForVerticalAnimation(el);
|
34427
|
+
setPropertiesOnElementForAnimation(el, { width: getElementWidth(el) + "px" });
|
34362
34428
|
};
|
34363
34429
|
return {
|
34364
34430
|
getRerenderEvent: function () { return _this.onElementRerendered; },
|
@@ -34369,16 +34435,18 @@ var panel_QuestionRowModel = /** @class */ (function (_super) {
|
|
34369
34435
|
var surveyElement = element;
|
34370
34436
|
var cssClasses = element.isPanel ? surveyElement.cssClasses.panel : surveyElement.cssClasses;
|
34371
34437
|
return {
|
34372
|
-
cssClass: cssClasses.
|
34373
|
-
onBeforeRunAnimation: beforeRunAnimation
|
34438
|
+
cssClass: cssClasses.leave,
|
34439
|
+
onBeforeRunAnimation: beforeRunAnimation,
|
34440
|
+
onAfterRunAnimation: cleanHtmlElementAfterAnimation
|
34374
34441
|
};
|
34375
34442
|
},
|
34376
34443
|
getEnterOptions: function (element) {
|
34377
34444
|
var surveyElement = element;
|
34378
34445
|
var cssClasses = element.isPanel ? surveyElement.cssClasses.panel : surveyElement.cssClasses;
|
34379
34446
|
return {
|
34380
|
-
cssClass: cssClasses.
|
34381
|
-
onBeforeRunAnimation: beforeRunAnimation
|
34447
|
+
cssClass: cssClasses.enter,
|
34448
|
+
onBeforeRunAnimation: beforeRunAnimation,
|
34449
|
+
onAfterRunAnimation: cleanHtmlElementAfterAnimation
|
34382
34450
|
};
|
34383
34451
|
}
|
34384
34452
|
};
|
@@ -34583,24 +34651,22 @@ var panel_PanelModelBase = /** @class */ (function (_super) {
|
|
34583
34651
|
};
|
34584
34652
|
PanelModelBase.prototype.getRowsAnimationOptions = function () {
|
34585
34653
|
var _this = this;
|
34586
|
-
var beforeRunAnimation = function (el) {
|
34587
|
-
el.style.setProperty("--animation-height", el.offsetHeight + "px");
|
34588
|
-
};
|
34589
34654
|
return {
|
34590
34655
|
getRerenderEvent: function () { return _this.onElementRerendered; },
|
34591
34656
|
isAnimationEnabled: function () { return _this.animationAllowed; },
|
34592
34657
|
getAnimatedElement: function (row) { return row.getRootElement(); },
|
34593
|
-
getLeaveOptions: function (
|
34594
|
-
return {
|
34595
|
-
|
34596
|
-
|
34658
|
+
getLeaveOptions: function (row, info) {
|
34659
|
+
return { cssClass: _this.cssClasses.rowLeave,
|
34660
|
+
onBeforeRunAnimation: prepareElementForVerticalAnimation,
|
34661
|
+
onAfterRunAnimation: cleanHtmlElementAfterAnimation,
|
34597
34662
|
};
|
34598
34663
|
},
|
34599
34664
|
getEnterOptions: function (_, animationInfo) {
|
34600
34665
|
var cssClasses = _this.cssClasses;
|
34601
34666
|
return {
|
34602
|
-
cssClass: new CssClassBuilder().append(cssClasses.
|
34603
|
-
onBeforeRunAnimation:
|
34667
|
+
cssClass: new CssClassBuilder().append(cssClasses.rowEnter).append(cssClasses.rowDelayedEnter, animationInfo.isDeletingRunning).toString(),
|
34668
|
+
onBeforeRunAnimation: prepareElementForVerticalAnimation,
|
34669
|
+
onAfterRunAnimation: cleanHtmlElementAfterAnimation
|
34604
34670
|
};
|
34605
34671
|
}
|
34606
34672
|
};
|
@@ -34878,7 +34944,7 @@ var panel_PanelModelBase = /** @class */ (function (_super) {
|
|
34878
34944
|
configurable: true
|
34879
34945
|
});
|
34880
34946
|
PanelModelBase.prototype.calcCssClasses = function (css) {
|
34881
|
-
var classes = { panel: {}, error: {}, row: "",
|
34947
|
+
var classes = { panel: {}, error: {}, row: "", rowEnter: "", rowLeave: "", rowDelayedEnter: "", rowMultiple: "", pageRow: "", rowCompact: "" };
|
34882
34948
|
this.copyCssClasses(classes.panel, css.panel);
|
34883
34949
|
this.copyCssClasses(classes.error, css.error);
|
34884
34950
|
if (!!css.pageRow) {
|
@@ -34890,14 +34956,14 @@ var panel_PanelModelBase = /** @class */ (function (_super) {
|
|
34890
34956
|
if (!!css.row) {
|
34891
34957
|
classes.row = css.row;
|
34892
34958
|
}
|
34893
|
-
if (!!css.
|
34894
|
-
classes.
|
34959
|
+
if (!!css.rowEnter) {
|
34960
|
+
classes.rowEnter = css.rowEnter;
|
34895
34961
|
}
|
34896
|
-
if (!!css.
|
34897
|
-
classes.
|
34962
|
+
if (!!css.rowLeave) {
|
34963
|
+
classes.rowLeave = css.rowLeave;
|
34898
34964
|
}
|
34899
|
-
if (!!css.
|
34900
|
-
classes.
|
34965
|
+
if (!!css.rowDelayedEnter) {
|
34966
|
+
classes.rowDelayedEnter = css.rowDelayedEnter;
|
34901
34967
|
}
|
34902
34968
|
if (!!css.rowMultiple) {
|
34903
34969
|
classes.rowMultiple = css.rowMultiple;
|
@@ -35905,6 +35971,20 @@ var panel_PanelModelBase = /** @class */ (function (_super) {
|
|
35905
35971
|
}
|
35906
35972
|
}
|
35907
35973
|
};
|
35974
|
+
PanelModelBase.prototype.disableLazyRenderingBeforeElement = function (el) {
|
35975
|
+
var row = el ? this.findRowByElement(el) : undefined;
|
35976
|
+
var index = el ? this.rows.indexOf(row) : this.rows.length - 1;
|
35977
|
+
for (var i = index; i >= 0; i--) {
|
35978
|
+
var currentRow = this.rows[i];
|
35979
|
+
if (currentRow.isNeedRender) {
|
35980
|
+
break;
|
35981
|
+
}
|
35982
|
+
else {
|
35983
|
+
currentRow.isNeedRender = true;
|
35984
|
+
currentRow.stopLazyRendering();
|
35985
|
+
}
|
35986
|
+
}
|
35987
|
+
};
|
35908
35988
|
PanelModelBase.prototype.findRowByElement = function (el) {
|
35909
35989
|
var rows = this.rows;
|
35910
35990
|
for (var i = 0; i < rows.length; i++) {
|
@@ -36393,6 +36473,7 @@ var panel_PanelModel = /** @class */ (function (_super) {
|
|
36393
36473
|
function PanelModel(name) {
|
36394
36474
|
if (name === void 0) { name = ""; }
|
36395
36475
|
var _this = _super.call(this, name) || this;
|
36476
|
+
_this.forcusFirstQuestionOnExpand = true;
|
36396
36477
|
_this.createNewArray("footerActions");
|
36397
36478
|
_this.registerPropertyChangedHandlers(["width"], function () {
|
36398
36479
|
if (!!_this.parent) {
|
@@ -36810,8 +36891,16 @@ var panel_PanelModel = /** @class */ (function (_super) {
|
|
36810
36891
|
enumerable: false,
|
36811
36892
|
configurable: true
|
36812
36893
|
});
|
36894
|
+
PanelModel.prototype.expand = function (focusFirstQuestion) {
|
36895
|
+
if (focusFirstQuestion === void 0) { focusFirstQuestion = true; }
|
36896
|
+
this.forcusFirstQuestionOnExpand = focusFirstQuestion;
|
36897
|
+
_super.prototype.expand.call(this);
|
36898
|
+
};
|
36813
36899
|
PanelModel.prototype.onElementExpanded = function (elementIsRendered) {
|
36814
36900
|
var _this = this;
|
36901
|
+
if (!this.forcusFirstQuestionOnExpand) {
|
36902
|
+
return;
|
36903
|
+
}
|
36815
36904
|
if (this.survey != null && !this.isLoadingFromJson) {
|
36816
36905
|
var q_1 = this.getFirstQuestionToFocus(false);
|
36817
36906
|
if (!!q_1) {
|
@@ -37316,7 +37405,7 @@ var page_PageModel = /** @class */ (function (_super) {
|
|
37316
37405
|
configurable: true
|
37317
37406
|
});
|
37318
37407
|
PageModel.prototype.calcCssClasses = function (css) {
|
37319
|
-
var classes = { page: {}, error: {}, pageTitle: "", pageDescription: "", row: "", rowMultiple: "", pageRow: "", rowCompact: "",
|
37408
|
+
var classes = { page: {}, error: {}, pageTitle: "", pageDescription: "", row: "", rowMultiple: "", pageRow: "", rowCompact: "", rowEnter: "", rowLeave: "", rowDelayedEnter: "", rowReplace: "" };
|
37320
37409
|
this.copyCssClasses(classes.page, css.page);
|
37321
37410
|
this.copyCssClasses(classes.error, css.error);
|
37322
37411
|
if (!!css.pageTitle) {
|
@@ -37337,14 +37426,17 @@ var page_PageModel = /** @class */ (function (_super) {
|
|
37337
37426
|
if (!!css.rowCompact) {
|
37338
37427
|
classes.rowCompact = css.rowCompact;
|
37339
37428
|
}
|
37340
|
-
if (!!css.
|
37341
|
-
classes.
|
37429
|
+
if (!!css.rowEnter) {
|
37430
|
+
classes.rowEnter = css.rowEnter;
|
37342
37431
|
}
|
37343
|
-
if (!!css.
|
37344
|
-
classes.
|
37432
|
+
if (!!css.rowDelayedEnter) {
|
37433
|
+
classes.rowDelayedEnter = css.rowDelayedEnter;
|
37345
37434
|
}
|
37346
|
-
if (!!css.
|
37347
|
-
classes.
|
37435
|
+
if (!!css.rowLeave) {
|
37436
|
+
classes.rowLeave = css.rowLeave;
|
37437
|
+
}
|
37438
|
+
if (!!css.rowReplace) {
|
37439
|
+
classes.rowReplace = css.rowReplace;
|
37348
37440
|
}
|
37349
37441
|
if (this.survey) {
|
37350
37442
|
this.survey.updatePageCssClasses(this, classes);
|
@@ -39170,6 +39262,16 @@ var survey_SurveyModel = /** @class */ (function (_super) {
|
|
39170
39262
|
enumerable: false,
|
39171
39263
|
configurable: true
|
39172
39264
|
});
|
39265
|
+
SurveyModel.prototype.disableLazyRenderingBeforeElement = function (el) {
|
39266
|
+
if (this.isDesignMode) {
|
39267
|
+
var page = this.getPageByElement(el);
|
39268
|
+
var index = this.pages.indexOf(page);
|
39269
|
+
for (var i = index; i >= 0; i--) {
|
39270
|
+
var currentPage = this.pages[i];
|
39271
|
+
currentPage.disableLazyRenderingBeforeElement(currentPage == page ? el : undefined);
|
39272
|
+
}
|
39273
|
+
}
|
39274
|
+
};
|
39173
39275
|
SurveyModel.prototype.updateLazyRenderingRowsOnRemovingElements = function () {
|
39174
39276
|
if (!this.isLazyRendering)
|
39175
39277
|
return;
|
@@ -46710,6 +46812,7 @@ var question_baseselect_decorate = (undefined && undefined.__decorate) || functi
|
|
46710
46812
|
|
46711
46813
|
|
46712
46814
|
|
46815
|
+
|
46713
46816
|
/**
|
46714
46817
|
* A base class for multiple-choice question types ([Checkboxes](https://surveyjs.io/form-library/documentation/questioncheckboxmodel), [Dropdown](https://surveyjs.io/form-library/documentation/questiondropdownmodel), [Radio Button Group](https://surveyjs.io/form-library/documentation/questionradiogroupmodel), etc.).
|
46715
46818
|
*/
|
@@ -46723,6 +46826,11 @@ var question_baseselect_QuestionSelectBase = /** @class */ (function (_super) {
|
|
46723
46826
|
_this.isRunningChoices = false;
|
46724
46827
|
_this.isFirstLoadChoicesFromUrl = true;
|
46725
46828
|
_this.isUpdatingChoicesDependedQuestions = false;
|
46829
|
+
_this._renderedChoices = [];
|
46830
|
+
_this.renderedChoicesAnimation = new animation_AnimationGroup(_this.getRenderedChoicesAnimationOptions(), function (val) {
|
46831
|
+
_this._renderedChoices = val;
|
46832
|
+
_this.renderedChoicesChangedCallback && _this.renderedChoicesChangedCallback();
|
46833
|
+
}, function () { return _this._renderedChoices; });
|
46726
46834
|
_this.headItemsCount = 0;
|
46727
46835
|
_this.footItemsCount = 0;
|
46728
46836
|
_this.prevIsOtherSelected = false;
|
@@ -46742,7 +46850,7 @@ var question_baseselect_QuestionSelectBase = /** @class */ (function (_super) {
|
|
46742
46850
|
_this.registerPropertyChangedHandlers(["hideIfChoicesEmpty"], function () {
|
46743
46851
|
_this.onVisibleChanged();
|
46744
46852
|
});
|
46745
|
-
_this.createNewArray("visibleChoices");
|
46853
|
+
_this.createNewArray("visibleChoices", function () { return _this.updateRenderedChoices(); }, function () { return _this.updateRenderedChoices(); });
|
46746
46854
|
_this.setNewRestfulProperty();
|
46747
46855
|
var locOtherText = _this.createLocalizableString("otherText", _this.otherItemValue, true, "otherItemText");
|
46748
46856
|
_this.createLocalizableString("otherErrorText", _this, true, "otherRequiredError");
|
@@ -47549,6 +47657,10 @@ var question_baseselect_QuestionSelectBase = /** @class */ (function (_super) {
|
|
47549
47657
|
var itemValue = itemvalue_ItemValue.getItemByValue(this.getFilteredChoices(), val);
|
47550
47658
|
return !!itemValue && !itemValue.isEnabled;
|
47551
47659
|
};
|
47660
|
+
QuestionSelectBase.prototype.endLoadingFromJson = function () {
|
47661
|
+
_super.prototype.endLoadingFromJson.call(this);
|
47662
|
+
this.updateVisibleChoices();
|
47663
|
+
};
|
47552
47664
|
Object.defineProperty(QuestionSelectBase.prototype, "choicesByUrl", {
|
47553
47665
|
/**
|
47554
47666
|
* Configures access to a RESTful service that returns choice items. Refer to the [`ChoicesRestful`](https://surveyjs.io/form-library/documentation/choicesrestful) class description for more information. You can also specify additional application-wide settings using the [`settings.web`](https://surveyjs.io/form-library/documentation/api-reference/settings#web) object.
|
@@ -47852,6 +47964,7 @@ var question_baseselect_QuestionSelectBase = /** @class */ (function (_super) {
|
|
47852
47964
|
var oldValue = this.visibleChoices;
|
47853
47965
|
if (!this.isTwoValueEquals(oldValue, newValue) || this.choicesLazyLoadEnabled) {
|
47854
47966
|
this.setArrayPropertyDirectly("visibleChoices", newValue);
|
47967
|
+
this.updateRenderedChoices();
|
47855
47968
|
}
|
47856
47969
|
};
|
47857
47970
|
QuestionSelectBase.prototype.calcVisibleChoices = function () {
|
@@ -48233,9 +48346,9 @@ var question_baseselect_QuestionSelectBase = /** @class */ (function (_super) {
|
|
48233
48346
|
return (!this.isDesignMode ||
|
48234
48347
|
this.getPropertyByName(propName).visible);
|
48235
48348
|
};
|
48236
|
-
QuestionSelectBase.prototype.onCheckForErrors = function (errors, isOnValueChanged) {
|
48349
|
+
QuestionSelectBase.prototype.onCheckForErrors = function (errors, isOnValueChanged, fireCallback) {
|
48237
48350
|
var _this = this;
|
48238
|
-
_super.prototype.onCheckForErrors.call(this, errors, isOnValueChanged);
|
48351
|
+
_super.prototype.onCheckForErrors.call(this, errors, isOnValueChanged, fireCallback);
|
48239
48352
|
if (!this.hasOther || !this.isOtherSelected || this.otherValue
|
48240
48353
|
|| isOnValueChanged && !this.prevOtherErrorValue)
|
48241
48354
|
return;
|
@@ -48658,12 +48771,76 @@ var question_baseselect_QuestionSelectBase = /** @class */ (function (_super) {
|
|
48658
48771
|
.append(this.cssClasses.controlLabelChecked, this.isItemSelected(item))
|
48659
48772
|
.toString() || undefined;
|
48660
48773
|
};
|
48774
|
+
QuestionSelectBase.prototype.updateRenderedChoices = function () {
|
48775
|
+
this.renderedChoices = this.onGetRenderedChoicesCallback ? this.onGetRenderedChoicesCallback(this.visibleChoices) : this.visibleChoices;
|
48776
|
+
};
|
48777
|
+
QuestionSelectBase.prototype.getRenderedChoicesAnimationOptions = function () {
|
48778
|
+
var _this = this;
|
48779
|
+
return {
|
48780
|
+
isAnimationEnabled: function () {
|
48781
|
+
return _this.animationAllowed;
|
48782
|
+
},
|
48783
|
+
getRerenderEvent: function () {
|
48784
|
+
return _this.onElementRerendered;
|
48785
|
+
},
|
48786
|
+
getKey: function (item) { return item != _this.newItemValue ? item.value : _this.newItemValue; },
|
48787
|
+
getLeaveOptions: function (item) {
|
48788
|
+
var cssClass = _this.cssClasses.itemLeave;
|
48789
|
+
if (_this.hasColumns) {
|
48790
|
+
var index = _this.bodyItems.indexOf(item);
|
48791
|
+
if (index !== -1 && index !== _this.bodyItems.length - 1) {
|
48792
|
+
cssClass = "";
|
48793
|
+
}
|
48794
|
+
}
|
48795
|
+
return {
|
48796
|
+
cssClass: cssClass,
|
48797
|
+
onBeforeRunAnimation: prepareElementForVerticalAnimation,
|
48798
|
+
onAfterRunAnimation: cleanHtmlElementAfterAnimation
|
48799
|
+
};
|
48800
|
+
},
|
48801
|
+
getAnimatedElement: function (item) {
|
48802
|
+
return item.getRootElement();
|
48803
|
+
},
|
48804
|
+
getEnterOptions: function (item) {
|
48805
|
+
var cssClass = _this.cssClasses.itemEnter;
|
48806
|
+
if (_this.hasColumns) {
|
48807
|
+
var index = _this.bodyItems.indexOf(item);
|
48808
|
+
if (index !== -1 && index !== _this.bodyItems.length - 1) {
|
48809
|
+
cssClass = "";
|
48810
|
+
}
|
48811
|
+
}
|
48812
|
+
return {
|
48813
|
+
cssClass: cssClass,
|
48814
|
+
onBeforeRunAnimation: function (el) {
|
48815
|
+
if (_this.getCurrentColCount() == 0 && _this.bodyItems.indexOf(item) >= 0) {
|
48816
|
+
var leftPosition = el.parentElement.firstElementChild.offsetLeft;
|
48817
|
+
if (el.offsetLeft > leftPosition) {
|
48818
|
+
setPropertiesOnElementForAnimation(el, { moveAnimationDuration: "0s", fadeAnimationDelay: "0s" }, "--");
|
48819
|
+
}
|
48820
|
+
}
|
48821
|
+
prepareElementForVerticalAnimation(el);
|
48822
|
+
},
|
48823
|
+
onAfterRunAnimation: cleanHtmlElementAfterAnimation
|
48824
|
+
};
|
48825
|
+
}
|
48826
|
+
};
|
48827
|
+
};
|
48828
|
+
Object.defineProperty(QuestionSelectBase.prototype, "renderedChoices", {
|
48829
|
+
get: function () {
|
48830
|
+
return this._renderedChoices;
|
48831
|
+
},
|
48832
|
+
set: function (val) {
|
48833
|
+
this.renderedChoicesAnimation.sync(val);
|
48834
|
+
},
|
48835
|
+
enumerable: false,
|
48836
|
+
configurable: true
|
48837
|
+
});
|
48661
48838
|
Object.defineProperty(QuestionSelectBase.prototype, "headItems", {
|
48662
48839
|
get: function () {
|
48663
48840
|
var count = (this.separateSpecialChoices || this.isDesignMode) ? this.headItemsCount : 0;
|
48664
48841
|
var res = [];
|
48665
48842
|
for (var i = 0; i < count; i++)
|
48666
|
-
res.push(this.
|
48843
|
+
this.renderedChoices[i] && res.push(this.renderedChoices[i]);
|
48667
48844
|
return res;
|
48668
48845
|
},
|
48669
48846
|
enumerable: false,
|
@@ -48673,9 +48850,9 @@ var question_baseselect_QuestionSelectBase = /** @class */ (function (_super) {
|
|
48673
48850
|
get: function () {
|
48674
48851
|
var count = (this.separateSpecialChoices || this.isDesignMode) ? this.footItemsCount : 0;
|
48675
48852
|
var res = [];
|
48676
|
-
var items = this.
|
48853
|
+
var items = this.renderedChoices;
|
48677
48854
|
for (var i = 0; i < count; i++)
|
48678
|
-
res.push(
|
48855
|
+
this.renderedChoices[items.length - count + i] && res.push(this.renderedChoices[items.length - count + i]);
|
48679
48856
|
return res;
|
48680
48857
|
},
|
48681
48858
|
enumerable: false,
|
@@ -48684,14 +48861,14 @@ var question_baseselect_QuestionSelectBase = /** @class */ (function (_super) {
|
|
48684
48861
|
Object.defineProperty(QuestionSelectBase.prototype, "dataChoices", {
|
48685
48862
|
get: function () {
|
48686
48863
|
var _this = this;
|
48687
|
-
return this.
|
48864
|
+
return this.renderedChoices.filter(function (item) { return !_this.isBuiltInChoice(item); });
|
48688
48865
|
},
|
48689
48866
|
enumerable: false,
|
48690
48867
|
configurable: true
|
48691
48868
|
});
|
48692
48869
|
Object.defineProperty(QuestionSelectBase.prototype, "bodyItems", {
|
48693
48870
|
get: function () {
|
48694
|
-
return (this.hasHeadItems || this.hasFootItems) ? this.dataChoices : this.
|
48871
|
+
return (this.hasHeadItems || this.hasFootItems) ? this.dataChoices : this.renderedChoices;
|
48695
48872
|
},
|
48696
48873
|
enumerable: false,
|
48697
48874
|
configurable: true
|
@@ -48714,9 +48891,9 @@ var question_baseselect_QuestionSelectBase = /** @class */ (function (_super) {
|
|
48714
48891
|
get: function () {
|
48715
48892
|
var columns = [];
|
48716
48893
|
var colCount = this.getCurrentColCount();
|
48717
|
-
if (this.hasColumns && this.
|
48894
|
+
if (this.hasColumns && this.renderedChoices.length > 0) {
|
48718
48895
|
var choicesToBuildColumns = (!this.separateSpecialChoices && !this.isDesignMode) ?
|
48719
|
-
this.
|
48896
|
+
this.renderedChoices : this.dataChoices;
|
48720
48897
|
if (settings.showItemsInOrder == "column") {
|
48721
48898
|
var prevIndex = 0;
|
48722
48899
|
var leftElementsCount = choicesToBuildColumns.length % colCount;
|
@@ -48912,6 +49089,9 @@ var question_baseselect_QuestionSelectBase = /** @class */ (function (_super) {
|
|
48912
49089
|
question_baseselect_decorate([
|
48913
49090
|
jsonobject_property({ localizable: true })
|
48914
49091
|
], QuestionSelectBase.prototype, "otherPlaceholder", void 0);
|
49092
|
+
question_baseselect_decorate([
|
49093
|
+
propertyArray()
|
49094
|
+
], QuestionSelectBase.prototype, "_renderedChoices", void 0);
|
48915
49095
|
return QuestionSelectBase;
|
48916
49096
|
}(question_Question));
|
48917
49097
|
|
@@ -49375,14 +49555,14 @@ var popup_view_model_PopupBaseViewModel = /** @class */ (function (_super) {
|
|
49375
49555
|
this.model.onHiding();
|
49376
49556
|
};
|
49377
49557
|
PopupBaseViewModel.prototype.getLeaveOptions = function () {
|
49378
|
-
return { cssClass: "sv-popup--
|
49558
|
+
return { cssClass: "sv-popup--leave", onBeforeRunAnimation: function (el) {
|
49379
49559
|
el.setAttribute("inert", "");
|
49380
49560
|
},
|
49381
49561
|
onAfterRunAnimation: function (el) { return el.removeAttribute("inert"); }
|
49382
49562
|
};
|
49383
49563
|
};
|
49384
49564
|
PopupBaseViewModel.prototype.getEnterOptions = function () {
|
49385
|
-
return { cssClass: "sv-popup--
|
49565
|
+
return { cssClass: "sv-popup--enter" };
|
49386
49566
|
};
|
49387
49567
|
PopupBaseViewModel.prototype.getAnimatedElement = function () {
|
49388
49568
|
return this.getAnimationContainer();
|
@@ -49625,7 +49805,7 @@ var popup_view_model_PopupBaseViewModel = /** @class */ (function (_super) {
|
|
49625
49805
|
};
|
49626
49806
|
PopupBaseViewModel.prototype.updateOnHiding = function () {
|
49627
49807
|
if (this.isFocusedContent && this.prevActiveElement) {
|
49628
|
-
this.prevActiveElement.focus();
|
49808
|
+
this.prevActiveElement.focus({ preventScroll: true });
|
49629
49809
|
}
|
49630
49810
|
};
|
49631
49811
|
PopupBaseViewModel.prototype.focusContainer = function () {
|
@@ -51792,11 +51972,11 @@ var question_matrix_QuestionMatrixModel = /** @class */ (function (_super) {
|
|
51792
51972
|
QuestionMatrixModel.prototype.supportGoNextPageAutomatic = function () {
|
51793
51973
|
return this.isMouseDown === true && this.hasValuesInAllRows();
|
51794
51974
|
};
|
51795
|
-
QuestionMatrixModel.prototype.onCheckForErrors = function (errors, isOnValueChanged) {
|
51796
|
-
_super.prototype.onCheckForErrors.call(this, errors, isOnValueChanged);
|
51975
|
+
QuestionMatrixModel.prototype.onCheckForErrors = function (errors, isOnValueChanged, fireCallback) {
|
51976
|
+
_super.prototype.onCheckForErrors.call(this, errors, isOnValueChanged, fireCallback);
|
51797
51977
|
if (!isOnValueChanged || this.hasCssError()) {
|
51798
51978
|
var rowsErrors = { noValue: false, isNotUnique: false };
|
51799
|
-
this.checkErrorsAllRows(
|
51979
|
+
this.checkErrorsAllRows(fireCallback, rowsErrors);
|
51800
51980
|
if (rowsErrors.noValue) {
|
51801
51981
|
errors.push(new RequiredInAllRowsError(null, this));
|
51802
51982
|
}
|
@@ -52849,9 +53029,9 @@ var question_text_QuestionTextModel = /** @class */ (function (_super) {
|
|
52849
53029
|
}
|
52850
53030
|
return _super.prototype.valueFromDataCore.call(this, val);
|
52851
53031
|
};
|
52852
|
-
QuestionTextModel.prototype.onCheckForErrors = function (errors, isOnValueChanged) {
|
53032
|
+
QuestionTextModel.prototype.onCheckForErrors = function (errors, isOnValueChanged, fireCallback) {
|
52853
53033
|
var _this = this;
|
52854
|
-
_super.prototype.onCheckForErrors.call(this, errors, isOnValueChanged);
|
53034
|
+
_super.prototype.onCheckForErrors.call(this, errors, isOnValueChanged, fireCallback);
|
52855
53035
|
if (isOnValueChanged)
|
52856
53036
|
return;
|
52857
53037
|
if (this.isValueLessMin) {
|
@@ -52892,7 +53072,8 @@ var question_text_QuestionTextModel = /** @class */ (function (_super) {
|
|
52892
53072
|
return isValid;
|
52893
53073
|
};
|
52894
53074
|
QuestionTextModel.prototype.convertFuncValuetoQuestionValue = function (val) {
|
52895
|
-
|
53075
|
+
var type = this.maskTypeIsEmpty ? this.inputType : this.maskSettings.getTypeForExpressions();
|
53076
|
+
return helpers_Helpers.convertValToQuestionVal(val, type);
|
52896
53077
|
};
|
52897
53078
|
QuestionTextModel.prototype.getMinMaxErrorText = function (errorText, value) {
|
52898
53079
|
if (helpers_Helpers.isValueEmpty(value))
|
@@ -55257,8 +55438,8 @@ var question_checkbox_QuestionCheckboxModel = /** @class */ (function (_super) {
|
|
55257
55438
|
return val.map(function (item) { return _this.createItemValue(item); });
|
55258
55439
|
};
|
55259
55440
|
QuestionCheckboxModel.prototype.getAnswerCorrectIgnoreOrder = function () { return true; };
|
55260
|
-
QuestionCheckboxModel.prototype.onCheckForErrors = function (errors, isOnValueChanged) {
|
55261
|
-
_super.prototype.onCheckForErrors.call(this, errors, isOnValueChanged);
|
55441
|
+
QuestionCheckboxModel.prototype.onCheckForErrors = function (errors, isOnValueChanged, fireCallback) {
|
55442
|
+
_super.prototype.onCheckForErrors.call(this, errors, isOnValueChanged, fireCallback);
|
55262
55443
|
if (isOnValueChanged)
|
55263
55444
|
return;
|
55264
55445
|
if (this.minSelectedChoices > 0 && this.checkMinSelectedChoicesUnreached()) {
|
@@ -58178,8 +58359,8 @@ var question_file_QuestionFileModelBase = /** @class */ (function (_super) {
|
|
58178
58359
|
return;
|
58179
58360
|
this.survey.clearFiles(this, this.name, this.value, null, function () { });
|
58180
58361
|
};
|
58181
|
-
QuestionFileModelBase.prototype.onCheckForErrors = function (errors, isOnValueChanged) {
|
58182
|
-
_super.prototype.onCheckForErrors.call(this, errors, isOnValueChanged);
|
58362
|
+
QuestionFileModelBase.prototype.onCheckForErrors = function (errors, isOnValueChanged, fireCallback) {
|
58363
|
+
_super.prototype.onCheckForErrors.call(this, errors, isOnValueChanged, fireCallback);
|
58183
58364
|
if (this.isUploading && this.waitForUpload) {
|
58184
58365
|
errors.push(new UploadingFileError(this.getLocalizationString("uploadingFile"), this));
|
58185
58366
|
}
|
@@ -61888,21 +62069,10 @@ var question_image_decorate = (undefined && undefined.__decorate) || function (d
|
|
61888
62069
|
|
61889
62070
|
|
61890
62071
|
|
61891
|
-
|
62072
|
+
|
61892
62073
|
var videoSuffics = [".mp4", ".mov", ".wmv", ".flv", ".avi", ".mkv"];
|
61893
62074
|
var youtubeUrl = "https://www.youtube.com/";
|
61894
62075
|
var youtubeEmbed = "embed";
|
61895
|
-
function isUrlYoutubeVideo(url) {
|
61896
|
-
if (!url)
|
61897
|
-
return false;
|
61898
|
-
url = url.toLowerCase();
|
61899
|
-
url = url.replace(/^https?:\/\//, "");
|
61900
|
-
for (var i = 0; i < youtubeDomains.length; i++) {
|
61901
|
-
if (url.indexOf(youtubeDomains[i] + "/") === 0)
|
61902
|
-
return true;
|
61903
|
-
}
|
61904
|
-
return false;
|
61905
|
-
}
|
61906
62076
|
/**
|
61907
62077
|
* A class that describes the Image question type. Unlike other question types, Image cannot have a title or value.
|
61908
62078
|
*
|
@@ -62127,7 +62297,7 @@ var question_image_QuestionImageModel = /** @class */ (function (_super) {
|
|
62127
62297
|
}
|
62128
62298
|
};
|
62129
62299
|
QuestionImageModel.prototype.isYoutubeVideo = function () {
|
62130
|
-
return isUrlYoutubeVideo(this.imageLink);
|
62300
|
+
return helpers_Helpers.isUrlYoutubeVideo(this.imageLink);
|
62131
62301
|
};
|
62132
62302
|
QuestionImageModel.prototype.isVideo = function () {
|
62133
62303
|
var link = this.imageLink;
|
@@ -62147,9 +62317,8 @@ var question_image_QuestionImageModel = /** @class */ (function (_super) {
|
|
62147
62317
|
}(QuestionNonValue));
|
62148
62318
|
|
62149
62319
|
function getCorrectImageLink(val, isYouTube) {
|
62150
|
-
if (!val || !isUrlYoutubeVideo(val))
|
62320
|
+
if (!val || !helpers_Helpers.isUrlYoutubeVideo(val))
|
62151
62321
|
return isYouTube ? "" : val;
|
62152
|
-
//if(!val || !isUrlYoutubeVideo(val)) return val;
|
62153
62322
|
var res = val.toLocaleLowerCase();
|
62154
62323
|
if (res.indexOf(youtubeEmbed) > -1)
|
62155
62324
|
return val;
|
@@ -63642,8 +63811,15 @@ var question_paneldynamic_QuestionPanelDynamicModel = /** @class */ (function (_
|
|
63642
63811
|
if (!!res)
|
63643
63812
|
return res;
|
63644
63813
|
}
|
63814
|
+
if (this.showAddPanelButton && (!withError || this.currentErrorCount > 0))
|
63815
|
+
return this;
|
63645
63816
|
return null;
|
63646
63817
|
};
|
63818
|
+
QuestionPanelDynamicModel.prototype.getFirstInputElementId = function () {
|
63819
|
+
if (this.showAddPanelButton)
|
63820
|
+
return this.addButtonId;
|
63821
|
+
return _super.prototype.getFirstInputElementId.call(this);
|
63822
|
+
};
|
63647
63823
|
QuestionPanelDynamicModel.prototype.setSurveyImpl = function (value, isLight) {
|
63648
63824
|
_super.prototype.setSurveyImpl.call(this, value, isLight);
|
63649
63825
|
this.setTemplatePanelSurveyImpl();
|
@@ -64093,34 +64269,44 @@ var question_paneldynamic_QuestionPanelDynamicModel = /** @class */ (function (_
|
|
64093
64269
|
}
|
64094
64270
|
},
|
64095
64271
|
getEnterOptions: function () {
|
64096
|
-
var cssClass = new CssClassBuilder().append(_this.cssClasses.
|
64272
|
+
var cssClass = new CssClassBuilder().append(_this.cssClasses.panelWrapperEnter).append(getDirectionCssClass()).toString();
|
64097
64273
|
return {
|
64098
64274
|
onBeforeRunAnimation: function (el) {
|
64099
|
-
var _a;
|
64100
64275
|
if (_this.focusNewPanelCallback) {
|
64101
64276
|
var scolledElement = _this.isRenderModeList ? el : el.parentElement;
|
64102
64277
|
survey_element_SurveyElement.ScrollElementToViewCore(scolledElement, false, false, { behavior: "smooth" });
|
64103
64278
|
}
|
64104
|
-
if (!_this.isRenderModeList) {
|
64105
|
-
(
|
64279
|
+
if (!_this.isRenderModeList && el.parentElement) {
|
64280
|
+
setPropertiesOnElementForAnimation(el.parentElement, { heightTo: el.offsetHeight + "px" });
|
64106
64281
|
}
|
64107
64282
|
else {
|
64108
|
-
|
64283
|
+
prepareElementForVerticalAnimation(el);
|
64284
|
+
}
|
64285
|
+
},
|
64286
|
+
onAfterRunAnimation: function (el) {
|
64287
|
+
cleanHtmlElementAfterAnimation(el);
|
64288
|
+
if (el.parentElement) {
|
64289
|
+
cleanHtmlElementAfterAnimation(el.parentElement);
|
64109
64290
|
}
|
64110
64291
|
},
|
64111
64292
|
cssClass: cssClass
|
64112
64293
|
};
|
64113
64294
|
},
|
64114
64295
|
getLeaveOptions: function () {
|
64115
|
-
var cssClass = new CssClassBuilder().append(_this.cssClasses.
|
64296
|
+
var cssClass = new CssClassBuilder().append(_this.cssClasses.panelWrapperLeave).append(getDirectionCssClass()).toString();
|
64116
64297
|
return {
|
64117
64298
|
onBeforeRunAnimation: function (el) {
|
64118
|
-
|
64119
|
-
|
64120
|
-
(_a = el.parentElement) === null || _a === void 0 ? void 0 : _a.style.setProperty("--animation-height-from", el.offsetHeight + "px");
|
64299
|
+
if (!_this.isRenderModeList && el.parentElement) {
|
64300
|
+
setPropertiesOnElementForAnimation(el.parentElement, { heightFrom: el.offsetHeight + "px" });
|
64121
64301
|
}
|
64122
64302
|
else {
|
64123
|
-
|
64303
|
+
prepareElementForVerticalAnimation(el);
|
64304
|
+
}
|
64305
|
+
},
|
64306
|
+
onAfterRunAnimation: function (el) {
|
64307
|
+
cleanHtmlElementAfterAnimation(el);
|
64308
|
+
if (el.parentElement) {
|
64309
|
+
cleanHtmlElementAfterAnimation(el.parentElement);
|
64124
64310
|
}
|
64125
64311
|
},
|
64126
64312
|
cssClass: cssClass
|
@@ -64620,6 +64806,13 @@ var question_paneldynamic_QuestionPanelDynamicModel = /** @class */ (function (_
|
|
64620
64806
|
enumerable: false,
|
64621
64807
|
configurable: true
|
64622
64808
|
});
|
64809
|
+
Object.defineProperty(QuestionPanelDynamicModel.prototype, "addButtonId", {
|
64810
|
+
get: function () {
|
64811
|
+
return this.id + "addPanel";
|
64812
|
+
},
|
64813
|
+
enumerable: false,
|
64814
|
+
configurable: true
|
64815
|
+
});
|
64623
64816
|
Object.defineProperty(QuestionPanelDynamicModel.prototype, "newPanelPosition", {
|
64624
64817
|
/**
|
64625
64818
|
* Specifies the position of newly added panels.
|
@@ -64841,8 +65034,9 @@ var question_paneldynamic_QuestionPanelDynamicModel = /** @class */ (function (_
|
|
64841
65034
|
return 0;
|
64842
65035
|
var onSurveyNumbering = this.showQuestionNumbers === "onSurvey";
|
64843
65036
|
var startIndex = onSurveyNumbering ? value : 0;
|
64844
|
-
|
64845
|
-
|
65037
|
+
var panels = this.isDesignMode ? [this.template] : this.visiblePanelsCore;
|
65038
|
+
for (var i = 0; i < panels.length; i++) {
|
65039
|
+
var counter = this.setPanelVisibleIndex(panels[i], startIndex, this.showQuestionNumbers != "off");
|
64846
65040
|
if (onSurveyNumbering) {
|
64847
65041
|
startIndex += counter;
|
64848
65042
|
}
|
@@ -65367,13 +65561,18 @@ var question_paneldynamic_QuestionPanelDynamicModel = /** @class */ (function (_
|
|
65367
65561
|
}
|
65368
65562
|
}
|
65369
65563
|
this.updateIsReady();
|
65370
|
-
if (
|
65564
|
+
if (!this.showAddPanelButton) {
|
65371
65565
|
this.updateNoEntriesTextDefaultLoc();
|
65372
65566
|
}
|
65373
65567
|
this.updateFooterActions();
|
65374
65568
|
this.isBuildingPanelsFirstTime = false;
|
65375
65569
|
this.releaseAnimations();
|
65376
65570
|
};
|
65571
|
+
Object.defineProperty(QuestionPanelDynamicModel.prototype, "showAddPanelButton", {
|
65572
|
+
get: function () { return this.allowAddPanel && !this.isReadOnly; },
|
65573
|
+
enumerable: false,
|
65574
|
+
configurable: true
|
65575
|
+
});
|
65377
65576
|
Object.defineProperty(QuestionPanelDynamicModel.prototype, "wasNotRenderedInSurvey", {
|
65378
65577
|
get: function () {
|
65379
65578
|
return !this.hasPanelBuildFirstTime && !this.wasRendered && !!this.survey;
|
@@ -67876,6 +68075,9 @@ var mask_base_InputMaskBase = /** @class */ (function (_super) {
|
|
67876
68075
|
InputMaskBase.prototype.getUnmaskedValue = function (src) { return src; };
|
67877
68076
|
InputMaskBase.prototype.getMaskedValue = function (src) { return src; };
|
67878
68077
|
InputMaskBase.prototype.getTextAlignment = function () { return "auto"; };
|
68078
|
+
InputMaskBase.prototype.getTypeForExpressions = function () {
|
68079
|
+
return "text";
|
68080
|
+
};
|
67879
68081
|
mask_base_decorate([
|
67880
68082
|
jsonobject_property()
|
67881
68083
|
], InputMaskBase.prototype, "saveMaskedValue", void 0);
|
@@ -68599,6 +68801,9 @@ var mask_datetime_InputMaskDateTime = /** @class */ (function (_super) {
|
|
68599
68801
|
InputMaskDateTime.prototype.getType = function () {
|
68600
68802
|
return "datetimemask";
|
68601
68803
|
};
|
68804
|
+
InputMaskDateTime.prototype.getTypeForExpressions = function () {
|
68805
|
+
return this.hasTimePart ? "datetime-local" : "datetime";
|
68806
|
+
};
|
68602
68807
|
InputMaskDateTime.prototype.updateLiterals = function () {
|
68603
68808
|
this.lexems = getDateTimeLexems(this.pattern || "");
|
68604
68809
|
};
|
@@ -69241,8 +69446,8 @@ Serializer.addClass("currencymask", [
|
|
69241
69446
|
|
69242
69447
|
var Version;
|
69243
69448
|
var ReleaseDate;
|
69244
|
-
Version = "" + "1.
|
69245
|
-
ReleaseDate = "" + "2024-09-
|
69449
|
+
Version = "" + "1.12.1";
|
69450
|
+
ReleaseDate = "" + "2024-09-10";
|
69246
69451
|
function checkLibraryVersion(ver, libraryName) {
|
69247
69452
|
if (Version != ver) {
|
69248
69453
|
var str = "survey-core has version '" + Version + "' and " + libraryName
|
@@ -79116,6 +79321,7 @@ var reactquestion_element_SurveyElementBase = /** @class */ (function (_super) {
|
|
79116
79321
|
function SurveyElementBase(props) {
|
79117
79322
|
var _this = _super.call(this, props) || this;
|
79118
79323
|
_this._allowComponentUpdate = true;
|
79324
|
+
_this.prevStateElements = [];
|
79119
79325
|
return _this;
|
79120
79326
|
}
|
79121
79327
|
SurveyElementBase.renderLocString = function (locStr, style, key) {
|
@@ -79135,9 +79341,14 @@ var reactquestion_element_SurveyElementBase = /** @class */ (function (_super) {
|
|
79135
79341
|
};
|
79136
79342
|
SurveyElementBase.prototype.componentWillUnmount = function () {
|
79137
79343
|
this.unMakeBaseElementsReact();
|
79344
|
+
this.disableStateElementsRerenderEvent(this.getStateElements());
|
79138
79345
|
};
|
79139
79346
|
SurveyElementBase.prototype.componentDidUpdate = function (prevProps, prevState) {
|
79347
|
+
var _a;
|
79140
79348
|
this.makeBaseElementsReact();
|
79349
|
+
var stateElements = this.getStateElements();
|
79350
|
+
this.disableStateElementsRerenderEvent(((_a = this.prevStateElements) !== null && _a !== void 0 ? _a : []).filter(function (el) { return !stateElements.includes(el); }));
|
79351
|
+
this.prevStateElements = [];
|
79141
79352
|
this.getStateElements().forEach(function (el) {
|
79142
79353
|
el.afterRerender();
|
79143
79354
|
});
|
@@ -79152,6 +79363,7 @@ var reactquestion_element_SurveyElementBase = /** @class */ (function (_super) {
|
|
79152
79363
|
SurveyElementBase.prototype.shouldComponentUpdate = function (nextProps, nextState) {
|
79153
79364
|
if (this._allowComponentUpdate) {
|
79154
79365
|
this.unMakeBaseElementsReact();
|
79366
|
+
this.prevStateElements = this.getStateElements();
|
79155
79367
|
}
|
79156
79368
|
return this._allowComponentUpdate;
|
79157
79369
|
};
|
@@ -79219,10 +79431,14 @@ var reactquestion_element_SurveyElementBase = /** @class */ (function (_super) {
|
|
79219
79431
|
SurveyElementBase.prototype.unMakeBaseElementsReact = function () {
|
79220
79432
|
var els = this.getStateElements();
|
79221
79433
|
for (var i = 0; i < els.length; i++) {
|
79222
|
-
els[i].disableOnElementRenderedEvent();
|
79223
79434
|
this.unMakeBaseElementReact(els[i]);
|
79224
79435
|
}
|
79225
79436
|
};
|
79437
|
+
SurveyElementBase.prototype.disableStateElementsRerenderEvent = function (els) {
|
79438
|
+
els.forEach(function (el) {
|
79439
|
+
el.disableOnElementRenderedEvent();
|
79440
|
+
});
|
79441
|
+
};
|
79226
79442
|
SurveyElementBase.prototype.getStateElements = function () {
|
79227
79443
|
var el = this.getStateElement();
|
79228
79444
|
return !!el ? [el] : [];
|
@@ -82367,7 +82583,7 @@ var reactquestion_checkbox_SurveyQuestionCheckbox = /** @class */ (function (_su
|
|
82367
82583
|
var _this = this;
|
82368
82584
|
if (this.question.hasHeadItems) {
|
82369
82585
|
return this.question.headItems.map(function (item, ii) {
|
82370
|
-
return _this.renderItem(
|
82586
|
+
return _this.renderItem(item, false, _this.question.cssClasses);
|
82371
82587
|
});
|
82372
82588
|
}
|
82373
82589
|
};
|
@@ -82375,7 +82591,7 @@ var reactquestion_checkbox_SurveyQuestionCheckbox = /** @class */ (function (_su
|
|
82375
82591
|
var _this = this;
|
82376
82592
|
if (this.question.hasFootItems) {
|
82377
82593
|
return this.question.footItems.map(function (item, ii) {
|
82378
|
-
return _this.renderItem(
|
82594
|
+
return _this.renderItem(item, false, _this.question.cssClasses);
|
82379
82595
|
});
|
82380
82596
|
}
|
82381
82597
|
};
|
@@ -82386,7 +82602,7 @@ var reactquestion_checkbox_SurveyQuestionCheckbox = /** @class */ (function (_su
|
|
82386
82602
|
var _this = this;
|
82387
82603
|
return this.question.columns.map(function (column, ci) {
|
82388
82604
|
var items = column.map(function (item, ii) {
|
82389
|
-
return _this.renderItem(
|
82605
|
+
return _this.renderItem(item, ci === 0 && ii === 0, cssClasses, "" + ci + ii);
|
82390
82606
|
});
|
82391
82607
|
return (external_root_React_commonjs2_react_commonjs_react_amd_react_["createElement"]("div", { key: "column" + ci + _this.question.getItemsColumnKey(column), className: _this.question.getColumnClass(), role: "presentation" }, items));
|
82392
82608
|
});
|
@@ -82402,8 +82618,8 @@ var reactquestion_checkbox_SurveyQuestionCheckbox = /** @class */ (function (_su
|
|
82402
82618
|
var renderedItems = [];
|
82403
82619
|
for (var i = 0; i < choices.length; i++) {
|
82404
82620
|
var item = choices[i];
|
82405
|
-
var key = "item" +
|
82406
|
-
var renderedItem = this.renderItem(
|
82621
|
+
var key = "item" + item.value;
|
82622
|
+
var renderedItem = this.renderItem(item, i == 0, cssClasses, "" + i);
|
82407
82623
|
if (!!renderedItem) {
|
82408
82624
|
renderedItems.push(renderedItem);
|
82409
82625
|
}
|
@@ -82422,9 +82638,9 @@ var reactquestion_checkbox_SurveyQuestionCheckbox = /** @class */ (function (_su
|
|
82422
82638
|
return (external_root_React_commonjs2_react_commonjs_react_amd_react_["createElement"]("div", { className: this.question.getCommentAreaCss(true) },
|
82423
82639
|
external_root_React_commonjs2_react_commonjs_react_amd_react_["createElement"](SurveyQuestionOtherValueItem, { question: this.question, otherCss: cssClasses.other, cssClasses: cssClasses, isDisplayMode: this.isDisplayMode })));
|
82424
82640
|
};
|
82425
|
-
SurveyQuestionCheckbox.prototype.renderItem = function (
|
82641
|
+
SurveyQuestionCheckbox.prototype.renderItem = function (item, isFirst, cssClasses, index) {
|
82426
82642
|
var renderedItem = ReactElementFactory.Instance.createElement(this.question.itemComponent, {
|
82427
|
-
key:
|
82643
|
+
key: item.value,
|
82428
82644
|
question: this.question,
|
82429
82645
|
cssClasses: cssClasses,
|
82430
82646
|
isDisplayMode: this.isDisplayMode,
|
@@ -82450,6 +82666,7 @@ var reactquestion_checkbox_SurveyQuestionCheckboxItem = /** @class */ (function
|
|
82450
82666
|
_this.handleOnChange = function (event) {
|
82451
82667
|
_this.question.clickItemHandler(_this.item, event.target.checked);
|
82452
82668
|
};
|
82669
|
+
_this.rootRef = external_root_React_commonjs2_react_commonjs_react_amd_react_["createRef"]();
|
82453
82670
|
return _this;
|
82454
82671
|
}
|
82455
82672
|
SurveyQuestionCheckboxItem.prototype.getStateElement = function () {
|
@@ -82497,11 +82714,20 @@ var reactquestion_checkbox_SurveyQuestionCheckboxItem = /** @class */ (function
|
|
82497
82714
|
enumerable: false,
|
82498
82715
|
configurable: true
|
82499
82716
|
});
|
82717
|
+
SurveyQuestionCheckboxItem.prototype.componentDidUpdate = function (prevProps, prevState) {
|
82718
|
+
_super.prototype.componentDidUpdate.call(this, prevProps, prevState);
|
82719
|
+
if (prevProps.item !== this.props.item && !this.question.isDesignMode) {
|
82720
|
+
if (this.props.item) {
|
82721
|
+
this.props.item.setRootElement(this.rootRef.current);
|
82722
|
+
}
|
82723
|
+
if (prevProps.item) {
|
82724
|
+
prevProps.item.setRootElement(undefined);
|
82725
|
+
}
|
82726
|
+
}
|
82727
|
+
};
|
82500
82728
|
SurveyQuestionCheckboxItem.prototype.shouldComponentUpdate = function (nextProps, nextState) {
|
82501
82729
|
if (!_super.prototype.shouldComponentUpdate.call(this, nextProps, nextState))
|
82502
82730
|
return false;
|
82503
|
-
if (!this.question)
|
82504
|
-
return false;
|
82505
82731
|
return (!this.question.customWidget ||
|
82506
82732
|
!!this.question.customWidgetData.isNeedRender ||
|
82507
82733
|
!!this.question.customWidget.widgetJson.isDefaultRender ||
|
@@ -82526,7 +82752,7 @@ var reactquestion_checkbox_SurveyQuestionCheckboxItem = /** @class */ (function
|
|
82526
82752
|
var itemClass = this.question.getItemClass(this.item);
|
82527
82753
|
var labelClass = this.question.getLabelClass(this.item);
|
82528
82754
|
var itemLabel = !this.hideCaption ? external_root_React_commonjs2_react_commonjs_react_amd_react_["createElement"]("span", { className: this.cssClasses.controlLabel }, this.renderLocString(this.item.locText, this.textStyle)) : null;
|
82529
|
-
return (external_root_React_commonjs2_react_commonjs_react_amd_react_["createElement"]("div", { className: itemClass, role: "presentation" },
|
82755
|
+
return (external_root_React_commonjs2_react_commonjs_react_amd_react_["createElement"]("div", { className: itemClass, role: "presentation", ref: this.rootRef },
|
82530
82756
|
external_root_React_commonjs2_react_commonjs_react_amd_react_["createElement"]("label", { className: labelClass },
|
82531
82757
|
external_root_React_commonjs2_react_commonjs_react_amd_react_["createElement"]("input", { className: this.cssClasses.itemControl, type: "checkbox", name: this.question.name + this.item.id, value: this.item.value, id: id, style: this.inputStyle, disabled: !this.question.getItemEnabled(this.item), readOnly: this.question.isReadOnlyAttr, checked: isChecked, onChange: this.handleOnChange, required: this.question.hasRequiredError() }),
|
82532
82758
|
this.cssClasses.materialDecorator ?
|
@@ -82538,6 +82764,18 @@ var reactquestion_checkbox_SurveyQuestionCheckboxItem = /** @class */ (function
|
|
82538
82764
|
itemLabel),
|
82539
82765
|
otherItem));
|
82540
82766
|
};
|
82767
|
+
SurveyQuestionCheckboxItem.prototype.componentDidMount = function () {
|
82768
|
+
_super.prototype.componentDidMount.call(this);
|
82769
|
+
if (!this.question.isDesignMode) {
|
82770
|
+
this.item.setRootElement(this.rootRef.current);
|
82771
|
+
}
|
82772
|
+
};
|
82773
|
+
SurveyQuestionCheckboxItem.prototype.componentWillUnmount = function () {
|
82774
|
+
_super.prototype.componentWillUnmount.call(this);
|
82775
|
+
if (!this.question.isDesignMode) {
|
82776
|
+
this.item.setRootElement(undefined);
|
82777
|
+
}
|
82778
|
+
};
|
82541
82779
|
return SurveyQuestionCheckboxItem;
|
82542
82780
|
}(ReactSurveyElement));
|
82543
82781
|
|
@@ -83062,10 +83300,10 @@ var tagbox_filter_TagboxFilterString = /** @class */ (function (_super) {
|
|
83062
83300
|
this.model.inputKeyHandler(e);
|
83063
83301
|
};
|
83064
83302
|
TagboxFilterString.prototype.onBlur = function (e) {
|
83065
|
-
this.
|
83303
|
+
this.question.onBlur(e);
|
83066
83304
|
};
|
83067
83305
|
TagboxFilterString.prototype.onFocus = function (e) {
|
83068
|
-
this.
|
83306
|
+
this.question.onFocus(e);
|
83069
83307
|
};
|
83070
83308
|
TagboxFilterString.prototype.getStateElement = function () {
|
83071
83309
|
return this.model;
|
@@ -84280,7 +84518,7 @@ var reactquestion_radiogroup_SurveyQuestionRadiogroup = /** @class */ (function
|
|
84280
84518
|
var _this = this;
|
84281
84519
|
if (this.question.hasFootItems) {
|
84282
84520
|
return this.question.footItems.map(function (item, ii) {
|
84283
|
-
return _this.renderItem(
|
84521
|
+
return _this.renderItem(item, false, _this.question.cssClasses);
|
84284
84522
|
});
|
84285
84523
|
}
|
84286
84524
|
};
|
@@ -84292,7 +84530,7 @@ var reactquestion_radiogroup_SurveyQuestionRadiogroup = /** @class */ (function
|
|
84292
84530
|
var value = this.getStateValue();
|
84293
84531
|
return this.question.columns.map(function (column, ci) {
|
84294
84532
|
var items = column.map(function (item, ii) {
|
84295
|
-
return _this.renderItem(
|
84533
|
+
return _this.renderItem(item, value, cssClasses, "" + ci + ii);
|
84296
84534
|
});
|
84297
84535
|
return (external_root_React_commonjs2_react_commonjs_react_amd_react_["createElement"]("div", { key: "column" + ci + _this.question.getItemsColumnKey(column), className: _this.question.getColumnClass(), role: "presentation" }, items));
|
84298
84536
|
});
|
@@ -84309,7 +84547,7 @@ var reactquestion_radiogroup_SurveyQuestionRadiogroup = /** @class */ (function
|
|
84309
84547
|
var value = this.getStateValue();
|
84310
84548
|
for (var i = 0; i < choices.length; i++) {
|
84311
84549
|
var item = choices[i];
|
84312
|
-
var renderedItem = this.renderItem(
|
84550
|
+
var renderedItem = this.renderItem(item, value, cssClasses, "" + i);
|
84313
84551
|
items.push(renderedItem);
|
84314
84552
|
}
|
84315
84553
|
return items;
|
@@ -84325,9 +84563,9 @@ var reactquestion_radiogroup_SurveyQuestionRadiogroup = /** @class */ (function
|
|
84325
84563
|
return (external_root_React_commonjs2_react_commonjs_react_amd_react_["createElement"]("div", { className: this.question.getCommentAreaCss(true) },
|
84326
84564
|
external_root_React_commonjs2_react_commonjs_react_amd_react_["createElement"](SurveyQuestionOtherValueItem, { question: this.question, otherCss: cssClasses.other, cssClasses: cssClasses, isDisplayMode: this.isDisplayMode })));
|
84327
84565
|
};
|
84328
|
-
SurveyQuestionRadiogroup.prototype.renderItem = function (
|
84566
|
+
SurveyQuestionRadiogroup.prototype.renderItem = function (item, value, cssClasses, index) {
|
84329
84567
|
var renderedItem = ReactElementFactory.Instance.createElement(this.question.itemComponent, {
|
84330
|
-
key:
|
84568
|
+
key: item.value,
|
84331
84569
|
question: this.question,
|
84332
84570
|
cssClasses: cssClasses,
|
84333
84571
|
isDisplayMode: this.isDisplayMode,
|
@@ -84353,6 +84591,7 @@ var reactquestion_radiogroup_SurveyQuestionRadioItem = /** @class */ (function (
|
|
84353
84591
|
reactquestion_radiogroup_extends(SurveyQuestionRadioItem, _super);
|
84354
84592
|
function SurveyQuestionRadioItem(props) {
|
84355
84593
|
var _this = _super.call(this, props) || this;
|
84594
|
+
_this.rootRef = external_root_React_commonjs2_react_commonjs_react_amd_react_["createRef"]();
|
84356
84595
|
_this.handleOnChange = _this.handleOnChange.bind(_this);
|
84357
84596
|
_this.handleOnMouseDown = _this.handleOnMouseDown.bind(_this);
|
84358
84597
|
return _this;
|
@@ -84421,12 +84660,23 @@ var reactquestion_radiogroup_SurveyQuestionRadioItem = /** @class */ (function (
|
|
84421
84660
|
SurveyQuestionRadioItem.prototype.canRender = function () {
|
84422
84661
|
return !!this.question && !!this.item;
|
84423
84662
|
};
|
84663
|
+
SurveyQuestionRadioItem.prototype.componentDidUpdate = function (prevProps, prevState) {
|
84664
|
+
_super.prototype.componentDidUpdate.call(this, prevProps, prevState);
|
84665
|
+
if (prevProps.item !== this.props.item && !this.question.isDesignMode) {
|
84666
|
+
if (this.props.item) {
|
84667
|
+
this.props.item.setRootElement(this.rootRef.current);
|
84668
|
+
}
|
84669
|
+
if (prevProps.item) {
|
84670
|
+
prevProps.item.setRootElement(undefined);
|
84671
|
+
}
|
84672
|
+
}
|
84673
|
+
};
|
84424
84674
|
SurveyQuestionRadioItem.prototype.renderElement = function () {
|
84425
84675
|
var itemClass = this.question.getItemClass(this.item);
|
84426
84676
|
var labelClass = this.question.getLabelClass(this.item);
|
84427
84677
|
var controlLabelClass = this.question.getControlLabelClass(this.item);
|
84428
84678
|
var itemLabel = !this.hideCaption ? external_root_React_commonjs2_react_commonjs_react_amd_react_["createElement"]("span", { className: controlLabelClass }, this.renderLocString(this.item.locText, this.textStyle)) : null;
|
84429
|
-
return (external_root_React_commonjs2_react_commonjs_react_amd_react_["createElement"]("div", { className: itemClass, role: "presentation" },
|
84679
|
+
return (external_root_React_commonjs2_react_commonjs_react_amd_react_["createElement"]("div", { className: itemClass, role: "presentation", ref: this.rootRef },
|
84430
84680
|
external_root_React_commonjs2_react_commonjs_react_amd_react_["createElement"]("label", { onMouseDown: this.handleOnMouseDown, className: labelClass },
|
84431
84681
|
external_root_React_commonjs2_react_commonjs_react_amd_react_["createElement"]("input", { "aria-errormessage": this.question.ariaErrormessage, className: this.cssClasses.itemControl, id: this.question.getItemId(this.item), type: "radio", name: this.question.questionName, checked: this.isChecked, value: this.item.value, disabled: !this.question.getItemEnabled(this.item), readOnly: this.question.isReadOnlyAttr, onChange: this.handleOnChange }),
|
84432
84682
|
this.cssClasses.materialDecorator ?
|
@@ -84437,6 +84687,18 @@ var reactquestion_radiogroup_SurveyQuestionRadioItem = /** @class */ (function (
|
|
84437
84687
|
null,
|
84438
84688
|
itemLabel)));
|
84439
84689
|
};
|
84690
|
+
SurveyQuestionRadioItem.prototype.componentDidMount = function () {
|
84691
|
+
_super.prototype.componentDidMount.call(this);
|
84692
|
+
if (!this.question.isDesignMode) {
|
84693
|
+
this.item.setRootElement(this.rootRef.current);
|
84694
|
+
}
|
84695
|
+
};
|
84696
|
+
SurveyQuestionRadioItem.prototype.componentWillUnmount = function () {
|
84697
|
+
_super.prototype.componentWillUnmount.call(this);
|
84698
|
+
if (!this.question.isDesignMode) {
|
84699
|
+
this.item.setRootElement(undefined);
|
84700
|
+
}
|
84701
|
+
};
|
84440
84702
|
return SurveyQuestionRadioItem;
|
84441
84703
|
}(ReactSurveyElement));
|
84442
84704
|
|
@@ -84894,6 +85156,9 @@ var drag_drop_icon_SurveyQuestionMatrixDynamicDragDropIcon = /** @class */ (func
|
|
84894
85156
|
configurable: true
|
84895
85157
|
});
|
84896
85158
|
SurveyQuestionMatrixDynamicDragDropIcon.prototype.renderElement = function () {
|
85159
|
+
return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", null, this.renderIcon());
|
85160
|
+
};
|
85161
|
+
SurveyQuestionMatrixDynamicDragDropIcon.prototype.renderIcon = function () {
|
84897
85162
|
if (this.question.iconDragElement) {
|
84898
85163
|
return (external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("svg", { className: this.question.cssClasses.dragElementDecorator },
|
84899
85164
|
external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("use", { xlinkHref: this.question.iconDragElement })));
|
@@ -85524,7 +85789,7 @@ var paneldynamic_add_btn_SurveyQuestionPanelDynamicAddButton = /** @class */ (fu
|
|
85524
85789
|
if (!this.question.canAddPanel)
|
85525
85790
|
return null;
|
85526
85791
|
var btnText = this.renderLocString(this.question.locPanelAddText);
|
85527
|
-
return (external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("button", { type: "button", className: this.question.getAddButtonCss(), onClick: this.handleClick },
|
85792
|
+
return (external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("button", { type: "button", id: this.question.addButtonId, className: this.question.getAddButtonCss(), onClick: this.handleClick },
|
85528
85793
|
external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("span", { className: this.question.cssClasses.buttonAddText }, btnText)));
|
85529
85794
|
};
|
85530
85795
|
return SurveyQuestionPanelDynamicAddButton;
|