survey-react 1.10.2 → 1.10.3
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 +55 -19
- package/defaultV2.css.map +1 -1
- package/defaultV2.min.css +2 -2
- package/modern.css +13 -1
- package/modern.css.map +1 -1
- package/modern.min.css +2 -2
- package/package.json +1 -1
- package/survey.css +387 -1
- package/survey.css.map +1 -1
- package/survey.min.css +2 -2
- package/survey.react.d.ts +31 -17
- package/survey.react.js +190 -98
- 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.10.
|
2
|
+
* surveyjs - Survey JavaScript library v1.10.3
|
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
|
*/
|
@@ -745,9 +745,9 @@ function createDropdownActionModelAdvanced(actionOptions, listOptions, popupOpti
|
|
745
745
|
}, listOptions.allowSelection, listOptions.selectedItem);
|
746
746
|
listModel.locOwner = locOwner;
|
747
747
|
listModel.setOnFilterStringChangedCallback(listOptions.onFilterStringChangedCallback);
|
748
|
-
var
|
749
|
-
|
750
|
-
});
|
748
|
+
var options = popupOptions || {};
|
749
|
+
options.onDispose = function () { listModel.dispose(); };
|
750
|
+
var innerPopupModel = new _popup__WEBPACK_IMPORTED_MODULE_4__["PopupModel"]("sv-list", { model: listModel }, options);
|
751
751
|
innerPopupModel.displayMode = popupOptions === null || popupOptions === void 0 ? void 0 : popupOptions.displayMode;
|
752
752
|
var newActionOptions = Object.assign({}, actionOptions, {
|
753
753
|
component: "sv-action-bar-item-dropdown",
|
@@ -771,7 +771,6 @@ var BaseAction = /** @class */ (function (_super) {
|
|
771
771
|
function BaseAction() {
|
772
772
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
773
773
|
_this.rendredIdValue = BaseAction.getNextRendredId();
|
774
|
-
_this.iconSize = 24;
|
775
774
|
return _this;
|
776
775
|
}
|
777
776
|
BaseAction.getNextRendredId = function () { return BaseAction.renderedId++; };
|
@@ -974,7 +973,7 @@ var BaseAction = /** @class */ (function (_super) {
|
|
974
973
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])()
|
975
974
|
], BaseAction.prototype, "iconName", void 0);
|
976
975
|
__decorate([
|
977
|
-
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])()
|
976
|
+
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])({ defaultValue: 24 })
|
978
977
|
], BaseAction.prototype, "iconSize", void 0);
|
979
978
|
__decorate([
|
980
979
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])()
|
@@ -1848,6 +1847,8 @@ var Base = /** @class */ (function () {
|
|
1848
1847
|
* A new value for the property.
|
1849
1848
|
* - `options.oldValue`: `any`\
|
1850
1849
|
* An old value of the property. If the property is an array, `oldValue` contains the same array as `newValue` does.
|
1850
|
+
*
|
1851
|
+
* If you need to add and remove property change event handlers dynamically, use the [`registerPropertyChangedHandlers`](#registerPropertyChangedHandlers) and [`unregisterPropertyChangedHandlers`](#unregisterPropertyChangedHandlers) methods instead.
|
1851
1852
|
*/
|
1852
1853
|
this.onPropertyChanged = this.addEvent();
|
1853
1854
|
/**
|
@@ -2418,9 +2419,11 @@ var Base = /** @class */ (function () {
|
|
2418
2419
|
return res;
|
2419
2420
|
};
|
2420
2421
|
/**
|
2421
|
-
* Registers a
|
2422
|
+
* Registers a single value change handler for one or multiple properties.
|
2423
|
+
*
|
2424
|
+
* The `registerPropertyChangedHandlers` and [`unregisterPropertyChangedHandlers`](#unregisterPropertyChangedHandlers) methods allow you to manage property change event handlers dynamically. If you only need to attach an event handler without removing it afterwards, you can use the [`onPropertyChanged`](#onPropertyChanged) event instead.
|
2422
2425
|
* @param propertyNames An array of one or multiple property names.
|
2423
|
-
* @param handler A function to call when one of the listed properties change.
|
2426
|
+
* @param handler A function to call when one of the listed properties change. Accepts a new property value as an argument.
|
2424
2427
|
* @param key *(Optional)* A key that identifies the current registration. If a function for one of the properties is already registered with the same key, the function will be overwritten. You can also use the key to subsequently unregister handlers.
|
2425
2428
|
* @see unregisterPropertyChangedHandlers
|
2426
2429
|
*/
|
@@ -6036,6 +6039,8 @@ var defaultV2Css = {
|
|
6036
6039
|
selectWrapper: "sv-dropdown_select-wrapper",
|
6037
6040
|
controlValue: "sd-dropdown__value",
|
6038
6041
|
controlDisabled: "sd-input--disabled",
|
6042
|
+
controlReadOnly: "sd-input--readonly",
|
6043
|
+
controlPreview: "sd-input--preview",
|
6039
6044
|
controlEmpty: "sd-dropdown--empty",
|
6040
6045
|
filterStringInput: "sd-dropdown__filter-string-input",
|
6041
6046
|
chevronButton: "sd-dropdown_chevron-button",
|
@@ -7365,17 +7370,12 @@ var DragDropDOMAdapter = /** @class */ (function () {
|
|
7365
7370
|
DragDropDOMAdapter.prototype.getShortcutRightCoordinate = function (currentX, shortcutWidth, shortcutXOffset) {
|
7366
7371
|
return currentX + shortcutWidth - shortcutXOffset;
|
7367
7372
|
};
|
7368
|
-
DragDropDOMAdapter.prototype.
|
7373
|
+
DragDropDOMAdapter.prototype.requestAnimationFrame = function (callback) {
|
7374
|
+
return requestAnimationFrame(callback);
|
7375
|
+
};
|
7376
|
+
DragDropDOMAdapter.prototype.scrollByDrag = function (scrollableParentNode, clientY, clientX) {
|
7369
7377
|
var _this = this;
|
7370
|
-
cancelAnimationFrame(this.scrollIntervalId);
|
7371
7378
|
var startScrollBoundary = 100;
|
7372
|
-
var displayProp = this.draggedElementShortcut.style.display;
|
7373
|
-
//this.draggedElementShortcut.hidden = true;
|
7374
|
-
this.draggedElementShortcut.style.display = "none";
|
7375
|
-
var dragOverNode = this.documentOrShadowRoot.elementFromPoint(clientX, clientY);
|
7376
|
-
//this.draggedElementShortcut.hidden = false;
|
7377
|
-
this.draggedElementShortcut.style.display = displayProp || "block";
|
7378
|
-
var scrollableParentNode = Object(_utils_utils__WEBPACK_IMPORTED_MODULE_0__["findScrollableParent"])(dragOverNode);
|
7379
7379
|
var top;
|
7380
7380
|
var bottom;
|
7381
7381
|
var left;
|
@@ -7393,21 +7393,36 @@ var DragDropDOMAdapter = /** @class */ (function () {
|
|
7393
7393
|
right = scrollableParentNode.getBoundingClientRect().right;
|
7394
7394
|
}
|
7395
7395
|
var repeat = function () {
|
7396
|
-
|
7396
|
+
var isTop = clientY - top <= startScrollBoundary;
|
7397
|
+
var isBottom = bottom - clientY <= startScrollBoundary;
|
7398
|
+
var isLeft = clientX - left <= startScrollBoundary;
|
7399
|
+
var isRight = right - clientX <= startScrollBoundary;
|
7400
|
+
if (isTop && !isLeft && !isRight) {
|
7397
7401
|
scrollableParentNode.scrollTop -= 15;
|
7398
7402
|
}
|
7399
|
-
else if (
|
7403
|
+
else if (isBottom && !isLeft && !isRight) {
|
7400
7404
|
scrollableParentNode.scrollTop += 15;
|
7401
7405
|
}
|
7402
|
-
else if (
|
7406
|
+
else if (isRight && !isTop && !isBottom) {
|
7403
7407
|
scrollableParentNode.scrollLeft += 15;
|
7404
7408
|
}
|
7405
|
-
else if (
|
7409
|
+
else if (isLeft && !isTop && !isBottom) {
|
7406
7410
|
scrollableParentNode.scrollLeft -= 15;
|
7407
7411
|
}
|
7408
|
-
_this.scrollIntervalId = requestAnimationFrame(repeat);
|
7412
|
+
_this.scrollIntervalId = _this.requestAnimationFrame(repeat);
|
7409
7413
|
};
|
7410
|
-
this.scrollIntervalId = requestAnimationFrame(repeat);
|
7414
|
+
this.scrollIntervalId = this.requestAnimationFrame(repeat);
|
7415
|
+
};
|
7416
|
+
DragDropDOMAdapter.prototype.doScroll = function (clientY, clientX) {
|
7417
|
+
cancelAnimationFrame(this.scrollIntervalId);
|
7418
|
+
var displayProp = this.draggedElementShortcut.style.display;
|
7419
|
+
//this.draggedElementShortcut.hidden = true;
|
7420
|
+
this.draggedElementShortcut.style.display = "none";
|
7421
|
+
var dragOverNode = this.documentOrShadowRoot.elementFromPoint(clientX, clientY);
|
7422
|
+
//this.draggedElementShortcut.hidden = false;
|
7423
|
+
this.draggedElementShortcut.style.display = displayProp || "block";
|
7424
|
+
var scrollableParentNode = Object(_utils_utils__WEBPACK_IMPORTED_MODULE_0__["findScrollableParent"])(dragOverNode);
|
7425
|
+
this.scrollByDrag(scrollableParentNode, clientY, clientX);
|
7411
7426
|
};
|
7412
7427
|
DragDropDOMAdapter.prototype.doStartDrag = function (event, draggedElement, parentElement, draggedElementNode) {
|
7413
7428
|
if (_utils_devices__WEBPACK_IMPORTED_MODULE_1__["IsTouch"]) {
|
@@ -7701,7 +7716,6 @@ var DragDropRankingChoices = /** @class */ (function (_super) {
|
|
7701
7716
|
if (!draggedElementShortcut)
|
7702
7717
|
return;
|
7703
7718
|
draggedElementShortcut.className = this.shortcutClass + " sv-ranking-shortcut";
|
7704
|
-
draggedElementShortcut.style.cssText = " \n cursor: grabbing;\n position: absolute;\n z-index: 10000;\n border-radius: calc(12.5 * var(--sjs-base-unit, var(--base-unit, 8px)));\n min-width: 100px;\n max-width: 400px;\n box-shadow: var(--sjs-shadow-medium, 0px 2px 6px 0px rgba(0, 0, 0, 0.1)), var(--sjs-shadow-large, 0px 8px 16px 0px rgba(0, 0, 0, 0.1));\n background-color: var(--sjs-general-backcolor, var(--background, #fff));\n font-family: var(--sjs-font-family, var(--font-family, var(--sjs-default-font-family)));\n ";
|
7705
7719
|
var isDeepClone = true;
|
7706
7720
|
var clone = draggedElementNode.cloneNode(isDeepClone);
|
7707
7721
|
draggedElementShortcut.appendChild(clone);
|
@@ -8159,7 +8173,8 @@ var DropdownListModel = /** @class */ (function (_super) {
|
|
8159
8173
|
};
|
8160
8174
|
DropdownListModel.prototype.createPopup = function () {
|
8161
8175
|
var _this = this;
|
8162
|
-
|
8176
|
+
var popupOptions = { verticalPosition: "bottom", horizontalPosition: "center", showPointer: false };
|
8177
|
+
this._popupModel = new _popup__WEBPACK_IMPORTED_MODULE_5__["PopupModel"]("sv-list", { model: this.listModel }, popupOptions);
|
8163
8178
|
this._popupModel.displayMode = _utils_devices__WEBPACK_IMPORTED_MODULE_9__["IsTouch"] ? "overlay" : "popup";
|
8164
8179
|
this._popupModel.positionMode = "fixed";
|
8165
8180
|
this._popupModel.isFocusedContainer = false;
|
@@ -8220,7 +8235,6 @@ var DropdownListModel = /** @class */ (function (_super) {
|
|
8220
8235
|
DropdownListModel.prototype.onHidePopup = function () {
|
8221
8236
|
this.resetFilterString();
|
8222
8237
|
this.question.suggestedItem = null;
|
8223
|
-
this.listModel.refresh();
|
8224
8238
|
};
|
8225
8239
|
DropdownListModel.prototype.getAvailableItems = function () {
|
8226
8240
|
return this.question.visibleChoices;
|
@@ -9806,8 +9820,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
9806
9820
|
|
9807
9821
|
var Version;
|
9808
9822
|
var ReleaseDate;
|
9809
|
-
Version = "" + "1.10.
|
9810
|
-
ReleaseDate = "" + "2024-
|
9823
|
+
Version = "" + "1.10.3";
|
9824
|
+
ReleaseDate = "" + "2024-05-07";
|
9811
9825
|
function checkLibraryVersion(ver, libraryName) {
|
9812
9826
|
if (Version != ver) {
|
9813
9827
|
var str = "survey-core has version '" + Version + "' and " + libraryName
|
@@ -20441,10 +20455,18 @@ var JsonMetadata = /** @class */ (function () {
|
|
20441
20455
|
return metaClass.getAllProperties();
|
20442
20456
|
};
|
20443
20457
|
JsonMetadata.prototype.getPropertiesByObj = function (obj) {
|
20444
|
-
|
20458
|
+
var type = !!obj && !!obj.getType ? obj.getType() : undefined;
|
20459
|
+
if (!type)
|
20445
20460
|
return [];
|
20446
|
-
var props = this.getProperties(
|
20461
|
+
var props = this.getProperties(type);
|
20447
20462
|
var dynamicProps = this.getDynamicPropertiesByObj(obj);
|
20463
|
+
for (var i = dynamicProps.length - 1; i >= 0; i--) {
|
20464
|
+
if (this.findProperty(type, dynamicProps[i].name)) {
|
20465
|
+
dynamicProps.splice(i, 1);
|
20466
|
+
}
|
20467
|
+
}
|
20468
|
+
if (dynamicProps.length === 0)
|
20469
|
+
return props;
|
20448
20470
|
return [].concat(props).concat(dynamicProps);
|
20449
20471
|
};
|
20450
20472
|
JsonMetadata.prototype.addDynamicPropertiesIntoObj = function (dest, src, props) {
|
@@ -21155,7 +21177,7 @@ var JsonObject = /** @class */ (function () {
|
|
21155
21177
|
this.removePosFromObj(value);
|
21156
21178
|
};
|
21157
21179
|
JsonObject.prototype.removePosFromObj = function (obj) {
|
21158
|
-
if (!obj)
|
21180
|
+
if (!obj || typeof obj.getType === "function")
|
21159
21181
|
return;
|
21160
21182
|
if (Array.isArray(obj)) {
|
21161
21183
|
for (var i = 0; i < obj.length; i++) {
|
@@ -23652,7 +23674,7 @@ var englishStrings = {
|
|
23652
23674
|
questionsProgressText: "Answered {0}/{1} questions",
|
23653
23675
|
emptySurvey: "The survey doesn't contain any visible elements.",
|
23654
23676
|
completingSurvey: "Thank you for completing the survey",
|
23655
|
-
completingSurveyBefore: "
|
23677
|
+
completingSurveyBefore: "You have already completed this survey.",
|
23656
23678
|
loadingSurvey: "Loading Survey...",
|
23657
23679
|
placeholder: "Select...",
|
23658
23680
|
ratingOptionsCaption: "Select...",
|
@@ -23702,7 +23724,7 @@ var englishStrings = {
|
|
23702
23724
|
savingData: "The results are being saved on the server...",
|
23703
23725
|
savingDataError: "An error occurred and we could not save the results.",
|
23704
23726
|
savingDataSuccess: "The results were saved successfully!",
|
23705
|
-
savingExceedSize: "Your response exceeds 64KB. Please reduce the size of your file(s) and try again or contact
|
23727
|
+
savingExceedSize: "Your response exceeds 64KB. Please reduce the size of your file(s) and try again or contact the survey owner.",
|
23706
23728
|
saveAgainButton: "Try again",
|
23707
23729
|
timerMin: "min",
|
23708
23730
|
timerSec: "sec",
|
@@ -33475,7 +33497,7 @@ var PanelModelBase = /** @class */ (function (_super) {
|
|
33475
33497
|
if (rec.result !== true)
|
33476
33498
|
rec.result = false;
|
33477
33499
|
this.hasErrorsCore(rec);
|
33478
|
-
if (rec.firstErrorQuestion) {
|
33500
|
+
if (rec.focuseOnFirstError && rec.firstErrorQuestion) {
|
33479
33501
|
rec.firstErrorQuestion.focus(true);
|
33480
33502
|
}
|
33481
33503
|
return !rec.result;
|
@@ -37154,14 +37176,30 @@ __webpack_require__.r(__webpack_exports__);
|
|
37154
37176
|
/* harmony import */ var _popup__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./popup */ "./src/popup.ts");
|
37155
37177
|
/* harmony import */ var _popup_dropdown_view_model__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./popup-dropdown-view-model */ "./src/popup-dropdown-view-model.ts");
|
37156
37178
|
/* harmony import */ var _popup_modal_view_model__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./popup-modal-view-model */ "./src/popup-modal-view-model.ts");
|
37179
|
+
var __assign = (undefined && undefined.__assign) || function () {
|
37180
|
+
__assign = Object.assign || function(t) {
|
37181
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
37182
|
+
s = arguments[i];
|
37183
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
37184
|
+
t[p] = s[p];
|
37185
|
+
}
|
37186
|
+
return t;
|
37187
|
+
};
|
37188
|
+
return __assign.apply(this, arguments);
|
37189
|
+
};
|
37157
37190
|
|
37158
37191
|
|
37159
37192
|
|
37160
37193
|
|
37161
37194
|
function createPopupModalViewModel(options, rootElement) {
|
37162
37195
|
var _a;
|
37163
|
-
var
|
37164
|
-
|
37196
|
+
var popupOptions = __assign({}, options);
|
37197
|
+
popupOptions.verticalPosition = "top";
|
37198
|
+
popupOptions.horizontalPosition = "left";
|
37199
|
+
popupOptions.showPointer = false;
|
37200
|
+
popupOptions.isModal = true;
|
37201
|
+
popupOptions.displayMode = options.displayMode || "popup";
|
37202
|
+
var popupModel = new _popup__WEBPACK_IMPORTED_MODULE_1__["PopupModel"](options.componentName, options.data, popupOptions);
|
37165
37203
|
popupModel.isFocusedContent = (_a = options.isFocusedContent) !== null && _a !== void 0 ? _a : true;
|
37166
37204
|
var popupViewModel = new _popup_modal_view_model__WEBPACK_IMPORTED_MODULE_3__["PopupModalViewModel"](popupModel);
|
37167
37205
|
if (!!rootElement && !!rootElement.appendChild) {
|
@@ -37665,36 +37703,29 @@ var __decorate = (undefined && undefined.__decorate) || function (decorators, ta
|
|
37665
37703
|
|
37666
37704
|
var PopupModel = /** @class */ (function (_super) {
|
37667
37705
|
__extends(PopupModel, _super);
|
37668
|
-
function PopupModel(contentComponentName, contentComponentData,
|
37669
|
-
if (verticalPosition === void 0) { verticalPosition = "bottom"; }
|
37670
|
-
if (horizontalPosition === void 0) { horizontalPosition = "left"; }
|
37671
|
-
if (showPointer === void 0) { showPointer = true; }
|
37672
|
-
if (isModal === void 0) { isModal = false; }
|
37673
|
-
if (onCancel === void 0) { onCancel = function () { }; }
|
37674
|
-
if (onApply === void 0) { onApply = function () { return true; }; }
|
37675
|
-
if (onHide === void 0) { onHide = function () { }; }
|
37676
|
-
if (onShow === void 0) { onShow = function () { }; }
|
37677
|
-
if (cssClass === void 0) { cssClass = ""; }
|
37678
|
-
if (title === void 0) { title = ""; }
|
37679
|
-
if (onDispose === void 0) { onDispose = function () { }; }
|
37706
|
+
function PopupModel(contentComponentName, contentComponentData, option1, option2) {
|
37680
37707
|
var _this = _super.call(this) || this;
|
37681
|
-
_this.onDispose = onDispose;
|
37682
37708
|
_this.focusFirstInputSelector = "";
|
37709
|
+
_this.onCancel = function () { };
|
37710
|
+
_this.onApply = function () { return true; };
|
37711
|
+
_this.onHide = function () { };
|
37712
|
+
_this.onShow = function () { };
|
37713
|
+
_this.onDispose = function () { };
|
37683
37714
|
_this.onVisibilityChanged = _this.addEvent();
|
37684
37715
|
_this.onFooterActionsCreated = _this.addEvent();
|
37685
37716
|
_this.onRecalculatePosition = _this.addEvent();
|
37686
37717
|
_this.contentComponentName = contentComponentName;
|
37687
37718
|
_this.contentComponentData = contentComponentData;
|
37688
|
-
|
37689
|
-
|
37690
|
-
|
37691
|
-
|
37692
|
-
|
37693
|
-
|
37694
|
-
|
37695
|
-
|
37696
|
-
|
37697
|
-
|
37719
|
+
if (!!option1 && typeof option1 === "string") {
|
37720
|
+
_this.verticalPosition = option1;
|
37721
|
+
_this.horizontalPosition = option2;
|
37722
|
+
}
|
37723
|
+
else if (!!option1) {
|
37724
|
+
var popupOptions = option1;
|
37725
|
+
for (var key in popupOptions) {
|
37726
|
+
_this[key] = popupOptions[key];
|
37727
|
+
}
|
37728
|
+
}
|
37698
37729
|
return _this;
|
37699
37730
|
}
|
37700
37731
|
PopupModel.prototype.refreshInnerModel = function () {
|
@@ -37750,7 +37781,7 @@ var PopupModel = /** @class */ (function (_super) {
|
|
37750
37781
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])({ defaultValue: "left" })
|
37751
37782
|
], PopupModel.prototype, "horizontalPosition", void 0);
|
37752
37783
|
__decorate([
|
37753
|
-
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])({ defaultValue:
|
37784
|
+
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])({ defaultValue: true })
|
37754
37785
|
], PopupModel.prototype, "showPointer", void 0);
|
37755
37786
|
__decorate([
|
37756
37787
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])({ defaultValue: false })
|
@@ -37761,18 +37792,6 @@ var PopupModel = /** @class */ (function (_super) {
|
|
37761
37792
|
__decorate([
|
37762
37793
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])({ defaultValue: true })
|
37763
37794
|
], PopupModel.prototype, "isFocusedContainer", void 0);
|
37764
|
-
__decorate([
|
37765
|
-
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])({ defaultValue: function () { } })
|
37766
|
-
], PopupModel.prototype, "onCancel", void 0);
|
37767
|
-
__decorate([
|
37768
|
-
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])({ defaultValue: function () { return true; } })
|
37769
|
-
], PopupModel.prototype, "onApply", void 0);
|
37770
|
-
__decorate([
|
37771
|
-
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])({ defaultValue: function () { } })
|
37772
|
-
], PopupModel.prototype, "onHide", void 0);
|
37773
|
-
__decorate([
|
37774
|
-
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])({ defaultValue: function () { } })
|
37775
|
-
], PopupModel.prototype, "onShow", void 0);
|
37776
37795
|
__decorate([
|
37777
37796
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])({ defaultValue: "" })
|
37778
37797
|
], PopupModel.prototype, "cssClass", void 0);
|
@@ -40931,7 +40950,6 @@ var Question = /** @class */ (function (_super) {
|
|
40931
40950
|
};
|
40932
40951
|
Question.prototype.isDefaultRendering = function () {
|
40933
40952
|
return (!!this.customWidget ||
|
40934
|
-
this.renderAs === "default" ||
|
40935
40953
|
this.getComponentName() === "default");
|
40936
40954
|
};
|
40937
40955
|
//ISurveyErrorOwner
|
@@ -41755,7 +41773,7 @@ var QuestionSelectBase = /** @class */ (function (_super) {
|
|
41755
41773
|
return "itemvalue";
|
41756
41774
|
};
|
41757
41775
|
QuestionSelectBase.prototype.createItemValue = function (value, text) {
|
41758
|
-
var res = _jsonobject__WEBPACK_IMPORTED_MODULE_0__["Serializer"].createClass(this.getItemValueType(), value);
|
41776
|
+
var res = _jsonobject__WEBPACK_IMPORTED_MODULE_0__["Serializer"].createClass(this.getItemValueType(), { value: value });
|
41759
41777
|
res.locOwner = this;
|
41760
41778
|
if (!!text)
|
41761
41779
|
res.text = text;
|
@@ -42209,7 +42227,7 @@ var QuestionSelectBase = /** @class */ (function (_super) {
|
|
42209
42227
|
QuestionSelectBase.prototype.canSurveyChangeItemVisibility = function () {
|
42210
42228
|
return !!this.survey && this.survey.canChangeChoiceItemsVisibility();
|
42211
42229
|
};
|
42212
|
-
QuestionSelectBase.prototype.
|
42230
|
+
QuestionSelectBase.prototype.changeItemVisibility = function () {
|
42213
42231
|
var _this = this;
|
42214
42232
|
return this.canSurveyChangeItemVisibility() ?
|
42215
42233
|
function (item, val) { return _this.survey.getChoiceItemVisibility(_this, item, val); }
|
@@ -42217,7 +42235,7 @@ var QuestionSelectBase = /** @class */ (function (_super) {
|
|
42217
42235
|
};
|
42218
42236
|
QuestionSelectBase.prototype.runConditionsForItems = function (values, properties) {
|
42219
42237
|
this.filteredChoicesValue = [];
|
42220
|
-
var calcVisibility = this.
|
42238
|
+
var calcVisibility = this.changeItemVisibility();
|
42221
42239
|
return _itemvalue__WEBPACK_IMPORTED_MODULE_3__["ItemValue"].runConditionsForItems(this.activeChoices, this.getFilteredChoices(), this.areInvisibleElementsShowing
|
42222
42240
|
? null
|
42223
42241
|
: this.conditionChoicesVisibleIfRunner, values, properties, !this.survey || !this.survey.areInvisibleElementsShowing, function (item, val) {
|
@@ -42875,7 +42893,7 @@ var QuestionSelectBase = /** @class */ (function (_super) {
|
|
42875
42893
|
QuestionSelectBase.prototype.canShowOptionItem = function (item, isAddAll, hasItem) {
|
42876
42894
|
var res = (isAddAll && (!!this.canShowOptionItemCallback ? this.canShowOptionItemCallback(item) : true)) || hasItem;
|
42877
42895
|
if (this.canSurveyChangeItemVisibility()) {
|
42878
|
-
var calc = this.
|
42896
|
+
var calc = this.changeItemVisibility();
|
42879
42897
|
return calc(item, res);
|
42880
42898
|
}
|
42881
42899
|
return res;
|
@@ -43423,8 +43441,8 @@ var QuestionSelectBase = /** @class */ (function (_super) {
|
|
43423
43441
|
var superVal = _super.prototype.isVisibleCore.call(this);
|
43424
43442
|
if (!this.hideIfChoicesEmpty || !superVal)
|
43425
43443
|
return superVal;
|
43426
|
-
var
|
43427
|
-
return !
|
43444
|
+
var choices = this.isUsingCarryForward ? this.visibleChoices : this.getFilteredChoices();
|
43445
|
+
return !choices || choices.length > 0;
|
43428
43446
|
};
|
43429
43447
|
QuestionSelectBase.prototype.sortVisibleChoices = function (array) {
|
43430
43448
|
if (this.isDesignMode)
|
@@ -44144,6 +44162,7 @@ var QuestionBooleanModel = /** @class */ (function (_super) {
|
|
44144
44162
|
this.value = val == true ? this.getValueTrue() : this.getValueFalse();
|
44145
44163
|
this.booleanValueRendered = val;
|
44146
44164
|
}
|
44165
|
+
this.updateThumbMargin();
|
44147
44166
|
};
|
44148
44167
|
Object.defineProperty(QuestionBooleanModel.prototype, "defaultValue", {
|
44149
44168
|
get: function () {
|
@@ -44183,6 +44202,27 @@ var QuestionBooleanModel = /** @class */ (function (_super) {
|
|
44183
44202
|
enumerable: false,
|
44184
44203
|
configurable: true
|
44185
44204
|
});
|
44205
|
+
QuestionBooleanModel.prototype.updateThumbMargin = function () {
|
44206
|
+
var _this = this;
|
44207
|
+
if (!this.isIndeterminate && this.leftAnswerElement) {
|
44208
|
+
if (!this.swapOrder && this.value === this.getValueTrue() || this.swapOrder && this.value === this.getValueFalse()) {
|
44209
|
+
var el_1 = this.leftAnswerElement;
|
44210
|
+
setTimeout(function () {
|
44211
|
+
_this.thumbMargin = el_1.clientWidth + (_this.swapOrder ? 4 : 2) + "px";
|
44212
|
+
}, 50);
|
44213
|
+
}
|
44214
|
+
}
|
44215
|
+
this.thumbMargin = undefined;
|
44216
|
+
};
|
44217
|
+
QuestionBooleanModel.prototype.afterRender = function (el) {
|
44218
|
+
_super.prototype.afterRender.call(this, el);
|
44219
|
+
this.leftAnswerElement = el.querySelectorAll("." + this.cssClasses.sliderGhost)[0];
|
44220
|
+
this.updateThumbMargin();
|
44221
|
+
};
|
44222
|
+
QuestionBooleanModel.prototype.beforeDestroyQuestionElement = function (el) {
|
44223
|
+
_super.prototype.beforeDestroyQuestionElement.call(this, el);
|
44224
|
+
this.leftAnswerElement = undefined;
|
44225
|
+
};
|
44186
44226
|
Object.defineProperty(QuestionBooleanModel.prototype, "isLabelRendered", {
|
44187
44227
|
get: function () {
|
44188
44228
|
return this.titleLocation === "hidden";
|
@@ -44453,6 +44493,12 @@ var QuestionBooleanModel = /** @class */ (function (_super) {
|
|
44453
44493
|
__decorate([
|
44454
44494
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])()
|
44455
44495
|
], QuestionBooleanModel.prototype, "booleanValueRendered", void 0);
|
44496
|
+
__decorate([
|
44497
|
+
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])()
|
44498
|
+
], QuestionBooleanModel.prototype, "leftAnswerElement", void 0);
|
44499
|
+
__decorate([
|
44500
|
+
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])()
|
44501
|
+
], QuestionBooleanModel.prototype, "thumbMargin", void 0);
|
44456
44502
|
__decorate([
|
44457
44503
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])()
|
44458
44504
|
], QuestionBooleanModel.prototype, "showTitle", void 0);
|
@@ -45386,7 +45432,7 @@ var QuestionCheckboxModel = /** @class */ (function (_super) {
|
|
45386
45432
|
QuestionCheckboxModel.prototype.getConditionJson = function (operator, path) {
|
45387
45433
|
if (operator === void 0) { operator = null; }
|
45388
45434
|
if (path === void 0) { path = null; }
|
45389
|
-
var json = _super.prototype.getConditionJson.call(this);
|
45435
|
+
var json = _super.prototype.getConditionJson.call(this, operator, path);
|
45390
45436
|
if (operator == "contains" || operator == "notcontains") {
|
45391
45437
|
json["type"] = "radiogroup";
|
45392
45438
|
}
|
@@ -51145,7 +51191,7 @@ var QuestionMatrixModel = /** @class */ (function (_super) {
|
|
51145
51191
|
if (operator === void 0) { operator = null; }
|
51146
51192
|
if (path === void 0) { path = null; }
|
51147
51193
|
if (!path)
|
51148
|
-
return _super.prototype.getConditionJson.call(this);
|
51194
|
+
return _super.prototype.getConditionJson.call(this, operator);
|
51149
51195
|
var question = new _question_dropdown__WEBPACK_IMPORTED_MODULE_9__["QuestionDropdownModel"](path);
|
51150
51196
|
question.choices = this.columns;
|
51151
51197
|
var json = new _jsonobject__WEBPACK_IMPORTED_MODULE_3__["JsonObject"]().toJsonObject(question);
|
@@ -52982,7 +53028,7 @@ var QuestionMatrixDropdownModelBase = /** @class */ (function (_super) {
|
|
52982
53028
|
if (operator === void 0) { operator = null; }
|
52983
53029
|
if (path === void 0) { path = null; }
|
52984
53030
|
if (!path)
|
52985
|
-
return _super.prototype.getConditionJson.call(this);
|
53031
|
+
return _super.prototype.getConditionJson.call(this, operator);
|
52986
53032
|
var columnName = "";
|
52987
53033
|
for (var i = path.length - 1; i >= 0; i--) {
|
52988
53034
|
if (path[i] == ".")
|
@@ -58407,7 +58453,7 @@ var QuestionMultipleTextModel = /** @class */ (function (_super) {
|
|
58407
58453
|
if (operator === void 0) { operator = null; }
|
58408
58454
|
if (path === void 0) { path = null; }
|
58409
58455
|
if (!path)
|
58410
|
-
return _super.prototype.getConditionJson.call(this);
|
58456
|
+
return _super.prototype.getConditionJson.call(this, operator);
|
58411
58457
|
var item = this.getItemByName(path);
|
58412
58458
|
if (!item)
|
58413
58459
|
return null;
|
@@ -59666,14 +59712,23 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
59666
59712
|
});
|
59667
59713
|
QuestionPanelDynamicModel.prototype.getPanelsAnimationOptions = function () {
|
59668
59714
|
var _this = this;
|
59669
|
-
var
|
59715
|
+
var getDirectionCssClass = function () {
|
59670
59716
|
if (_this.isRenderModeList)
|
59671
59717
|
return "";
|
59718
|
+
var cssClass = new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_10__["CssClassBuilder"]();
|
59719
|
+
var isRemoving = false;
|
59672
59720
|
var leavingPanel = _this.renderedPanels.filter(function (el) { return el !== _this.currentPanel; })[0];
|
59673
59721
|
var leavingPanelIndex = _this.visiblePanels.indexOf(leavingPanel);
|
59674
|
-
if (leavingPanelIndex < 0)
|
59722
|
+
if (leavingPanelIndex < 0) {
|
59723
|
+
isRemoving = true;
|
59675
59724
|
leavingPanelIndex = _this.removedPanelIndex;
|
59676
|
-
|
59725
|
+
}
|
59726
|
+
return cssClass
|
59727
|
+
.append("sv-pd-animation-adding", !!_this.focusNewPanelCallback)
|
59728
|
+
.append("sv-pd-animation-removing", isRemoving)
|
59729
|
+
.append("sv-pd-animation-left", leavingPanelIndex <= _this.currentIndex)
|
59730
|
+
.append("sv-pd-animation-right", leavingPanelIndex > _this.currentIndex)
|
59731
|
+
.toString();
|
59677
59732
|
};
|
59678
59733
|
return {
|
59679
59734
|
getAnimatedElement: function (panel) {
|
@@ -59684,7 +59739,7 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
59684
59739
|
}
|
59685
59740
|
},
|
59686
59741
|
getEnterOptions: function () {
|
59687
|
-
var cssClass =
|
59742
|
+
var cssClass = new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_10__["CssClassBuilder"]().append(_this.cssClasses.panelWrapperFadeIn).append(getDirectionCssClass()).toString();
|
59688
59743
|
return {
|
59689
59744
|
onBeforeRunAnimation: function (el) {
|
59690
59745
|
var _a;
|
@@ -59703,7 +59758,7 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
59703
59758
|
};
|
59704
59759
|
},
|
59705
59760
|
getLeaveOptions: function () {
|
59706
|
-
var cssClass =
|
59761
|
+
var cssClass = new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_10__["CssClassBuilder"]().append(_this.cssClasses.panelWrapperFadeOut).append(getDirectionCssClass()).toString();
|
59707
59762
|
return {
|
59708
59763
|
onBeforeRunAnimation: function (el) {
|
59709
59764
|
var _a;
|
@@ -60883,7 +60938,7 @@ var QuestionPanelDynamicModel = /** @class */ (function (_super) {
|
|
60883
60938
|
if (operator === void 0) { operator = null; }
|
60884
60939
|
if (path === void 0) { path = null; }
|
60885
60940
|
if (!path)
|
60886
|
-
return _super.prototype.getConditionJson.call(this, operator
|
60941
|
+
return _super.prototype.getConditionJson.call(this, operator);
|
60887
60942
|
var questionName = path;
|
60888
60943
|
var pos = path.indexOf(".");
|
60889
60944
|
if (pos > -1) {
|
@@ -61992,6 +62047,13 @@ var QuestionRadiogroupModel = /** @class */ (function (_super) {
|
|
61992
62047
|
QuestionRadiogroupModel.prototype.supportGoNextPageAutomatic = function () {
|
61993
62048
|
return this.isMouseDown === true && !this.isOtherSelected;
|
61994
62049
|
};
|
62050
|
+
QuestionRadiogroupModel.prototype.getConditionJson = function (operator, path) {
|
62051
|
+
if (operator === void 0) { operator = null; }
|
62052
|
+
if (path === void 0) { path = null; }
|
62053
|
+
var json = _super.prototype.getConditionJson.call(this, operator, path);
|
62054
|
+
delete json["showClearButton"];
|
62055
|
+
return json;
|
62056
|
+
};
|
61995
62057
|
QuestionRadiogroupModel.prototype.setNewComment = function (newValue) {
|
61996
62058
|
this.isMouseDown = true;
|
61997
62059
|
_super.prototype.setNewComment.call(this, newValue);
|
@@ -63653,7 +63715,9 @@ var QuestionRatingModel = /** @class */ (function (_super) {
|
|
63653
63715
|
.append(this.cssClasses.control)
|
63654
63716
|
.append(this.cssClasses.controlEmpty, this.isEmpty())
|
63655
63717
|
.append(this.cssClasses.onError, this.hasCssError())
|
63656
|
-
.append(this.cssClasses.controlDisabled, this.
|
63718
|
+
.append(this.cssClasses.controlDisabled, this.isDisabledStyle)
|
63719
|
+
.append(this.cssClasses.controlReadOnly, this.isReadOnlyStyle)
|
63720
|
+
.append(this.cssClasses.controlPreview, this.isPreviewStyle)
|
63657
63721
|
.toString();
|
63658
63722
|
};
|
63659
63723
|
Object.defineProperty(QuestionRatingModel.prototype, "placeholder", {
|
@@ -64628,7 +64692,14 @@ var QuestionTagboxModel = /** @class */ (function (_super) {
|
|
64628
64692
|
};
|
64629
64693
|
QuestionTagboxModel.prototype.onSurveyLoad = function () {
|
64630
64694
|
_super.prototype.onSurveyLoad.call(this);
|
64631
|
-
|
64695
|
+
this.createDropdownListModel();
|
64696
|
+
};
|
64697
|
+
QuestionTagboxModel.prototype.onSetData = function () {
|
64698
|
+
_super.prototype.onSetData.call(this);
|
64699
|
+
this.createDropdownListModel();
|
64700
|
+
};
|
64701
|
+
QuestionTagboxModel.prototype.createDropdownListModel = function () {
|
64702
|
+
if (!this.dropdownListModel && !this.isLoadingFromJson) {
|
64632
64703
|
this.dropdownListModel = new _dropdownMultiSelectListModel__WEBPACK_IMPORTED_MODULE_4__["DropdownMultiSelectListModel"](this);
|
64633
64704
|
}
|
64634
64705
|
};
|
@@ -66553,7 +66624,7 @@ var SurveyQuestionBoolean = /** @class */ (function (_super) {
|
|
66553
66624
|
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: cssClasses.sliderGhost, onClick: function (event) { return _this.handleOnLabelClick(event, _this.question.swapOrder); } },
|
66554
66625
|
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", { className: this.question.getLabelCss(this.question.swapOrder) }, this.renderLocString(this.question.locLabelLeft))),
|
66555
66626
|
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: cssClasses.switch, onClick: this.handleOnSwitchClick },
|
66556
|
-
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", { className: cssClasses.slider }, this.question.isDeterminated && cssClasses.sliderText ?
|
66627
|
+
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", { className: cssClasses.slider, style: { marginLeft: this.question.thumbMargin } }, this.question.isDeterminated && cssClasses.sliderText ?
|
66557
66628
|
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", { className: cssClasses.sliderText }, this.renderLocString(this.question.getCheckedLabel()))
|
66558
66629
|
: null)),
|
66559
66630
|
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: cssClasses.sliderGhost, onClick: function (event) { return _this.handleOnLabelClick(event, !_this.question.swapOrder); } },
|
@@ -76501,20 +76572,34 @@ __webpack_require__.r(__webpack_exports__);
|
|
76501
76572
|
var RendererFactory = /** @class */ (function () {
|
76502
76573
|
function RendererFactory() {
|
76503
76574
|
this.renderersHash = {};
|
76575
|
+
this.defaultHash = {};
|
76504
76576
|
}
|
76505
76577
|
RendererFactory.prototype.unregisterRenderer = function (questionType, rendererAs) {
|
76506
76578
|
delete this.renderersHash[questionType][rendererAs];
|
76579
|
+
if (this.defaultHash[questionType] === rendererAs) {
|
76580
|
+
delete this.defaultHash[questionType];
|
76581
|
+
}
|
76507
76582
|
};
|
76508
|
-
RendererFactory.prototype.registerRenderer = function (questionType, renderAs, renderer) {
|
76583
|
+
RendererFactory.prototype.registerRenderer = function (questionType, renderAs, renderer, useAsDefault) {
|
76584
|
+
if (useAsDefault === void 0) { useAsDefault = false; }
|
76509
76585
|
if (!this.renderersHash[questionType]) {
|
76510
76586
|
this.renderersHash[questionType] = {};
|
76511
76587
|
}
|
76512
76588
|
this.renderersHash[questionType][renderAs] = renderer;
|
76589
|
+
if (useAsDefault) {
|
76590
|
+
this.defaultHash[questionType] = renderAs;
|
76591
|
+
}
|
76513
76592
|
};
|
76514
76593
|
RendererFactory.prototype.getRenderer = function (questionType, renderAs) {
|
76515
|
-
|
76516
|
-
|
76517
|
-
|
76594
|
+
var qHash = this.renderersHash[questionType];
|
76595
|
+
if (!!qHash) {
|
76596
|
+
if (!!renderAs && qHash[renderAs])
|
76597
|
+
return qHash[renderAs];
|
76598
|
+
var dVal = this.defaultHash[questionType];
|
76599
|
+
if (!!dVal && qHash[dVal])
|
76600
|
+
return qHash[dVal];
|
76601
|
+
}
|
76602
|
+
return "default";
|
76518
76603
|
};
|
76519
76604
|
RendererFactory.prototype.getRendererByQuestion = function (question) {
|
76520
76605
|
return this.getRenderer(question.getType(), question.renderAs);
|
@@ -89585,10 +89670,15 @@ var AnimationUtils = /** @class */ (function () {
|
|
89585
89670
|
options.onBeforeRunAnimation && options.onBeforeRunAnimation(element);
|
89586
89671
|
}
|
89587
89672
|
};
|
89673
|
+
AnimationUtils.prototype.getCssClasses = function (options) {
|
89674
|
+
return options.cssClass.replace(/\s+$/, "").split(/\s+/);
|
89675
|
+
};
|
89588
89676
|
AnimationUtils.prototype.runAnimation = function (element, options, callback) {
|
89589
89677
|
if (element && options.cssClass) {
|
89590
89678
|
this.reflow(element);
|
89591
|
-
|
89679
|
+
this.getCssClasses(options).forEach(function (cssClass) {
|
89680
|
+
element.classList.add(cssClass);
|
89681
|
+
});
|
89592
89682
|
this.onAnimationEnd(element, callback, options);
|
89593
89683
|
}
|
89594
89684
|
else {
|
@@ -89597,7 +89687,9 @@ var AnimationUtils = /** @class */ (function () {
|
|
89597
89687
|
};
|
89598
89688
|
AnimationUtils.prototype.clearHtmlElement = function (element, options) {
|
89599
89689
|
if (element && options.cssClass) {
|
89600
|
-
|
89690
|
+
this.getCssClasses(options).forEach(function (cssClass) {
|
89691
|
+
element.classList.remove(cssClass);
|
89692
|
+
});
|
89601
89693
|
}
|
89602
89694
|
};
|
89603
89695
|
AnimationUtils.prototype.onNextRender = function (callback, runEarly, isCancel) {
|