survey-react 1.9.78 → 1.9.79
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 +67 -21
- package/defaultV2.css.map +1 -1
- package/defaultV2.min.css +2 -2
- package/modern.css +62 -8
- package/modern.css.map +1 -1
- package/modern.min.css +2 -2
- package/package.json +1 -1
- package/survey.css +44 -6
- package/survey.css.map +1 -1
- package/survey.min.css +2 -2
- package/survey.react.d.ts +63 -5
- package/survey.react.js +356 -95
- 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.9.
|
2
|
+
* surveyjs - Survey JavaScript library v1.9.79
|
3
3
|
* Copyright (c) 2015-2023 Devsoft Baltic OÜ - http://surveyjs.io/
|
4
4
|
* License: MIT (http://www.opensource.org/licenses/mit-license.php)
|
5
5
|
*/
|
@@ -4965,6 +4965,8 @@ var modernCss = {
|
|
4965
4965
|
filterStringInput: "sv-dropdown__filter-string-input",
|
4966
4966
|
controlValue: "sv-dropdown__value",
|
4967
4967
|
controlInputFieldComponent: "sv_dropdown_control__input-field-component",
|
4968
|
+
hintPrefix: "sv-dropdown__hint-prefix",
|
4969
|
+
hintSuffix: "sv-dropdown__hint-suffix"
|
4968
4970
|
},
|
4969
4971
|
tagbox: {
|
4970
4972
|
root: "",
|
@@ -5115,6 +5117,7 @@ var modernCss = {
|
|
5115
5117
|
error: "sv-save-data_error",
|
5116
5118
|
success: "sv-save-data_success",
|
5117
5119
|
button: "sv-save-data_button",
|
5120
|
+
shown: "sv-save-data_root--shown"
|
5118
5121
|
},
|
5119
5122
|
window: {
|
5120
5123
|
root: "sv_window",
|
@@ -5315,7 +5318,9 @@ var defaultStandardCss = {
|
|
5315
5318
|
cleanButtonSvg: "sv_q_dropdown_clean-button-svg",
|
5316
5319
|
cleanButtonIconId: "icon-clear_16x16",
|
5317
5320
|
controlValue: "sv_q_dropdown__value",
|
5318
|
-
filterStringInput: "sv_q_dropdown__filter-string-input"
|
5321
|
+
filterStringInput: "sv_q_dropdown__filter-string-input",
|
5322
|
+
hintPrefix: "sv_q_dropdown__hint-prefix",
|
5323
|
+
hintSuffix: "sv_q_dropdown__hint-suffix"
|
5319
5324
|
},
|
5320
5325
|
html: { root: "" },
|
5321
5326
|
image: {
|
@@ -5484,6 +5489,7 @@ var defaultStandardCss = {
|
|
5484
5489
|
error: "sv-save-data_error",
|
5485
5490
|
success: "sv-save-data_success",
|
5486
5491
|
button: "sv-save-data_button",
|
5492
|
+
shown: "sv-save-data_root--shown"
|
5487
5493
|
},
|
5488
5494
|
window: {
|
5489
5495
|
root: "sv_window",
|
@@ -5594,6 +5600,7 @@ var defaultV2Css = {
|
|
5594
5600
|
number: "sd-element__num",
|
5595
5601
|
title: "sd-title sd-element__title sd-panel__title",
|
5596
5602
|
titleExpandable: "sd-element__title--expandable",
|
5603
|
+
titleNumInline: "sd-element__title--num-inline",
|
5597
5604
|
titleExpanded: "sd-element__title--expanded",
|
5598
5605
|
titleCollapsed: "sd-element__title--collapsed",
|
5599
5606
|
titleDisabled: "sd-element__title--disabled",
|
@@ -5682,6 +5689,7 @@ var defaultV2Css = {
|
|
5682
5689
|
headerBottom: "sd-question__header--location--bottom",
|
5683
5690
|
content: "sd-question__content",
|
5684
5691
|
contentLeft: "sd-question__content--left",
|
5692
|
+
titleNumInline: "sd-element__title--num-inline",
|
5685
5693
|
titleLeftRoot: "sd-question--left",
|
5686
5694
|
titleOnAnswer: "sd-question__title--answer",
|
5687
5695
|
titleOnError: "sd-question__title--error",
|
@@ -5858,7 +5866,9 @@ var defaultV2Css = {
|
|
5858
5866
|
controlEmpty: "sd-dropdown--empty",
|
5859
5867
|
controlLabel: "sd-item__control-label",
|
5860
5868
|
filterStringInput: "sd-dropdown__filter-string-input",
|
5861
|
-
materialDecorator: "sd-item__decorator sd-radio__decorator"
|
5869
|
+
materialDecorator: "sd-item__decorator sd-radio__decorator",
|
5870
|
+
hintPrefix: "sd-dropdown__hint-prefix",
|
5871
|
+
hintSuffix: "sd-dropdown__hint-suffix"
|
5862
5872
|
},
|
5863
5873
|
imagepicker: {
|
5864
5874
|
mainRoot: "sd-element sd-question sd-row__question",
|
@@ -6061,6 +6071,7 @@ var defaultV2Css = {
|
|
6061
6071
|
error: "sv-save-data_error",
|
6062
6072
|
success: "sv-save-data_success",
|
6063
6073
|
button: "sv-save-data_button",
|
6074
|
+
shown: "sv-save-data_root--shown"
|
6064
6075
|
},
|
6065
6076
|
window: {
|
6066
6077
|
root: "sv_window",
|
@@ -6286,10 +6297,6 @@ var DragDropChoices = /** @class */ (function (_super) {
|
|
6286
6297
|
draggedElementShortcut.appendChild(imageNode);
|
6287
6298
|
return draggedElementShortcut;
|
6288
6299
|
};
|
6289
|
-
DragDropChoices.prototype.findDropTargetNodeByDragOverNode = function (dragOverNode) {
|
6290
|
-
var result = dragOverNode.closest(this.dropTargetDataAttributeName);
|
6291
|
-
return result;
|
6292
|
-
};
|
6293
6300
|
DragDropChoices.prototype.getDropTargetByDataAttributeValue = function (dataAttributeValue) {
|
6294
6301
|
var dragOverChoice;
|
6295
6302
|
dragOverChoice = this.parentElement.choices.filter(function (choice) { return "" + choice.value == dataAttributeValue; })[0];
|
@@ -6787,9 +6794,8 @@ var DragDropCore = /** @class */ (function (_super) {
|
|
6787
6794
|
return this.findDropTargetNodeByDragOverNode(dragOverNode);
|
6788
6795
|
};
|
6789
6796
|
DragDropCore.prototype.findDropTargetNodeByDragOverNode = function (dragOverNode) {
|
6790
|
-
var
|
6791
|
-
|
6792
|
-
return result;
|
6797
|
+
var dropTargetNode = dragOverNode.closest(this.dropTargetDataAttributeName);
|
6798
|
+
return dropTargetNode;
|
6793
6799
|
};
|
6794
6800
|
DragDropCore.prototype.doClear = function () { };
|
6795
6801
|
DragDropCore.PreventScrolling = false;
|
@@ -6903,10 +6909,6 @@ var DragDropMatrixRows = /** @class */ (function (_super) {
|
|
6903
6909
|
DragDropMatrixRows.prototype.isDropTargetValid = function (dropTarget) {
|
6904
6910
|
return true;
|
6905
6911
|
};
|
6906
|
-
DragDropMatrixRows.prototype.findDropTargetNodeByDragOverNode = function (dragOverNode) {
|
6907
|
-
var result = dragOverNode.closest(this.dropTargetDataAttributeName);
|
6908
|
-
return result;
|
6909
|
-
};
|
6910
6912
|
DragDropMatrixRows.prototype.calculateIsBottom = function (clientY) {
|
6911
6913
|
var rendreredRows = this.parentElement.renderedTable.rows;
|
6912
6914
|
var rows = rendreredRows.map(function (rendredRow) { return rendredRow.row; });
|
@@ -7062,7 +7064,7 @@ var DragDropRankingChoices = /** @class */ (function (_super) {
|
|
7062
7064
|
};
|
7063
7065
|
DragDropRankingChoices.prototype.findDropTargetNodeByDragOverNode = function (dragOverNode) {
|
7064
7066
|
this.isDragOverRootNode = this.getIsDragOverRootNode(dragOverNode);
|
7065
|
-
return
|
7067
|
+
return _super.prototype.findDropTargetNodeByDragOverNode.call(this, dragOverNode);
|
7066
7068
|
};
|
7067
7069
|
DragDropRankingChoices.prototype.getIsDragOverRootNode = function (dragOverNode) {
|
7068
7070
|
// dragOverNode might be <path></path> for example and the className prop is obj
|
@@ -7553,9 +7555,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
7553
7555
|
/* harmony import */ var _jsonobject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./jsonobject */ "./src/jsonobject.ts");
|
7554
7556
|
/* harmony import */ var _list__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./list */ "./src/list.ts");
|
7555
7557
|
/* harmony import */ var _popup__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./popup */ "./src/popup.ts");
|
7556
|
-
/* harmony import */ var
|
7557
|
-
/* harmony import */ var
|
7558
|
-
/* harmony import */ var
|
7558
|
+
/* harmony import */ var _question_dropdown__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./question_dropdown */ "./src/question_dropdown.ts");
|
7559
|
+
/* harmony import */ var _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils/cssClassBuilder */ "./src/utils/cssClassBuilder.ts");
|
7560
|
+
/* harmony import */ var _utils_devices__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./utils/devices */ "./src/utils/devices.ts");
|
7561
|
+
/* harmony import */ var _utils_utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./utils/utils */ "./src/utils/utils.ts");
|
7559
7562
|
var __extends = (undefined && undefined.__extends) || (function () {
|
7560
7563
|
var extendStatics = function (d, b) {
|
7561
7564
|
extendStatics = Object.setPrototypeOf ||
|
@@ -7584,6 +7587,7 @@ var __decorate = (undefined && undefined.__decorate) || function (decorators, ta
|
|
7584
7587
|
|
7585
7588
|
|
7586
7589
|
|
7590
|
+
|
7587
7591
|
var DropdownListModel = /** @class */ (function (_super) {
|
7588
7592
|
__extends(DropdownListModel, _super);
|
7589
7593
|
function DropdownListModel(question, onSelectionChanged) {
|
@@ -7592,11 +7596,20 @@ var DropdownListModel = /** @class */ (function (_super) {
|
|
7592
7596
|
_this.onSelectionChanged = onSelectionChanged;
|
7593
7597
|
_this.minPageSize = 25;
|
7594
7598
|
_this.loadingItemHeight = 40;
|
7599
|
+
_this._markdownMode = false;
|
7595
7600
|
_this.selectedItemSelector = ".sv-list__item--selected";
|
7596
7601
|
_this.itemSelector = ".sv-list__item";
|
7597
7602
|
_this.itemsSettings = { skip: 0, take: 0, totalCount: 0, items: [] };
|
7598
7603
|
_this.isRunningLoadQuestionChoices = false;
|
7599
7604
|
_this.popupCssClasses = "sv-single-select-list";
|
7605
|
+
question.onPropertyChanged.add(function (sender, options) {
|
7606
|
+
if (options.name == "value") {
|
7607
|
+
_this.showInputFieldComponent = _this.question.showInputFieldComponent;
|
7608
|
+
_this.showSelectedItemLocText = _this.question.showSelectedItemLocText;
|
7609
|
+
}
|
7610
|
+
});
|
7611
|
+
_this.showInputFieldComponent = _this.question.showInputFieldComponent;
|
7612
|
+
_this.showSelectedItemLocText = _this.question.showSelectedItemLocText;
|
7600
7613
|
_this.listModel = _this.createListModel();
|
7601
7614
|
_this.updateAfterListModelCreated(_this.listModel);
|
7602
7615
|
_this.setSearchEnabled(_this.question.searchEnabled);
|
@@ -7612,7 +7625,7 @@ var DropdownListModel = /** @class */ (function (_super) {
|
|
7612
7625
|
configurable: true
|
7613
7626
|
});
|
7614
7627
|
DropdownListModel.prototype.getFocusFirstInputSelector = function () {
|
7615
|
-
if (
|
7628
|
+
if (_utils_devices__WEBPACK_IMPORTED_MODULE_6__["IsTouch"]) {
|
7616
7629
|
return this.isValueEmpty(this.question.value) ? this.itemSelector : this.selectedItemSelector;
|
7617
7630
|
}
|
7618
7631
|
else {
|
@@ -7661,10 +7674,10 @@ var DropdownListModel = /** @class */ (function (_super) {
|
|
7661
7674
|
DropdownListModel.prototype.createPopup = function () {
|
7662
7675
|
var _this = this;
|
7663
7676
|
this._popupModel = new _popup__WEBPACK_IMPORTED_MODULE_3__["PopupModel"]("sv-list", { model: this.listModel }, "bottom", "center", false);
|
7664
|
-
this._popupModel.displayMode =
|
7677
|
+
this._popupModel.displayMode = _utils_devices__WEBPACK_IMPORTED_MODULE_6__["IsTouch"] ? "overlay" : "popup";
|
7665
7678
|
this._popupModel.positionMode = "fixed";
|
7666
|
-
this._popupModel.isFocusedContent =
|
7667
|
-
this._popupModel.setWidthByTarget = !
|
7679
|
+
this._popupModel.isFocusedContent = _utils_devices__WEBPACK_IMPORTED_MODULE_6__["IsTouch"];
|
7680
|
+
this._popupModel.setWidthByTarget = !_utils_devices__WEBPACK_IMPORTED_MODULE_6__["IsTouch"];
|
7668
7681
|
this.updatePopupFocusFirstInputSelector();
|
7669
7682
|
this.listModel.registerPropertyChangedHandlers(["showFilter"], function () {
|
7670
7683
|
_this.updatePopupFocusFirstInputSelector();
|
@@ -7691,7 +7704,13 @@ var DropdownListModel = /** @class */ (function (_super) {
|
|
7691
7704
|
});
|
7692
7705
|
};
|
7693
7706
|
DropdownListModel.prototype.setFilterStringToListModel = function (newValue) {
|
7707
|
+
var _this = this;
|
7694
7708
|
this.listModel.filterString = newValue;
|
7709
|
+
this.listModel.resetFocusedItem();
|
7710
|
+
if (this.question.selectedItem && this.question.selectedItem.text.indexOf(newValue) >= 0) {
|
7711
|
+
this.listModel.focusedItem = this.getAvailableItems().filter(function (item) { return item.id == _this.question.selectedItem.value; })[0];
|
7712
|
+
return;
|
7713
|
+
}
|
7695
7714
|
if (!this.listModel.focusedItem || !this.listModel.isItemVisible(this.listModel.focusedItem)) {
|
7696
7715
|
this.listModel.focusFirstVisibleItem();
|
7697
7716
|
}
|
@@ -7715,7 +7734,9 @@ var DropdownListModel = /** @class */ (function (_super) {
|
|
7715
7734
|
var _onSelectionChanged = this.onSelectionChanged;
|
7716
7735
|
if (!_onSelectionChanged) {
|
7717
7736
|
_onSelectionChanged = function (item) {
|
7718
|
-
_this.question.value = item.
|
7737
|
+
_this.question.value = item.id;
|
7738
|
+
if (_this.question.searchEnabled)
|
7739
|
+
_this.applyInputString(item);
|
7719
7740
|
_this._popupModel.toggleVisibility();
|
7720
7741
|
};
|
7721
7742
|
}
|
@@ -7738,7 +7759,7 @@ var DropdownListModel = /** @class */ (function (_super) {
|
|
7738
7759
|
model.isAllDataLoaded = !this.question.choicesLazyLoadEnabled;
|
7739
7760
|
};
|
7740
7761
|
DropdownListModel.prototype.updateCssClasses = function (popupCssClass, listCssClasses) {
|
7741
|
-
this.popupModel.cssClass = new
|
7762
|
+
this.popupModel.cssClass = new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_5__["CssClassBuilder"]().append(popupCssClass).append(this.popupCssClasses).toString();
|
7742
7763
|
this.listModel.cssClasses = listCssClasses;
|
7743
7764
|
};
|
7744
7765
|
DropdownListModel.prototype.resetFilterString = function () {
|
@@ -7751,7 +7772,6 @@ var DropdownListModel = /** @class */ (function (_super) {
|
|
7751
7772
|
if (!!this.filterString && !this.popupModel.isVisible) {
|
7752
7773
|
this.popupModel.isVisible = true;
|
7753
7774
|
}
|
7754
|
-
this.setInputHasValue(!!this.filterString);
|
7755
7775
|
var updateAfterFilterStringChanged = function () {
|
7756
7776
|
_this.setFilterStringToListModel(_this.filterString);
|
7757
7777
|
_this.popupRecalculatePosition(true);
|
@@ -7764,9 +7784,91 @@ var DropdownListModel = /** @class */ (function (_super) {
|
|
7764
7784
|
updateAfterFilterStringChanged();
|
7765
7785
|
}
|
7766
7786
|
};
|
7767
|
-
DropdownListModel.prototype.
|
7768
|
-
|
7787
|
+
DropdownListModel.prototype.applyInputString = function (item) {
|
7788
|
+
var hasHtml = item === null || item === void 0 ? void 0 : item.locText.hasHtml;
|
7789
|
+
if (hasHtml || this.question.inputFieldComponentName) {
|
7790
|
+
this._markdownMode = true;
|
7791
|
+
this.inputString = "";
|
7792
|
+
}
|
7793
|
+
else {
|
7794
|
+
this.inputString = item === null || item === void 0 ? void 0 : item.title;
|
7795
|
+
}
|
7796
|
+
};
|
7797
|
+
DropdownListModel.prototype.applyHintString = function (item) {
|
7798
|
+
var hasHtml = item === null || item === void 0 ? void 0 : item.locText.hasHtml;
|
7799
|
+
if (hasHtml || this.question.inputFieldComponentName) {
|
7800
|
+
this._markdownMode = true;
|
7801
|
+
this.hintString = "";
|
7802
|
+
}
|
7803
|
+
else {
|
7804
|
+
this.hintString = item === null || item === void 0 ? void 0 : item.title;
|
7805
|
+
}
|
7769
7806
|
};
|
7807
|
+
Object.defineProperty(DropdownListModel.prototype, "inputStringRendered", {
|
7808
|
+
get: function () {
|
7809
|
+
return this.getPropertyValue("inputString") || "";
|
7810
|
+
},
|
7811
|
+
set: function (val) {
|
7812
|
+
this.setPropertyValue("inputString", val);
|
7813
|
+
this.filterString = val;
|
7814
|
+
this.applyHintString(this.listModel.focusedItem);
|
7815
|
+
},
|
7816
|
+
enumerable: false,
|
7817
|
+
configurable: true
|
7818
|
+
});
|
7819
|
+
Object.defineProperty(DropdownListModel.prototype, "placeholderRendered", {
|
7820
|
+
get: function () {
|
7821
|
+
return this.hintString ? "" : this.question.readOnlyText;
|
7822
|
+
},
|
7823
|
+
enumerable: false,
|
7824
|
+
configurable: true
|
7825
|
+
});
|
7826
|
+
Object.defineProperty(DropdownListModel.prototype, "hintStringLC", {
|
7827
|
+
get: function () {
|
7828
|
+
var _a;
|
7829
|
+
return ((_a = this.hintString) === null || _a === void 0 ? void 0 : _a.toLowerCase()) || "";
|
7830
|
+
},
|
7831
|
+
enumerable: false,
|
7832
|
+
configurable: true
|
7833
|
+
});
|
7834
|
+
Object.defineProperty(DropdownListModel.prototype, "inputStringLC", {
|
7835
|
+
get: function () {
|
7836
|
+
var _a;
|
7837
|
+
return ((_a = this.inputString) === null || _a === void 0 ? void 0 : _a.toLowerCase()) || "";
|
7838
|
+
},
|
7839
|
+
enumerable: false,
|
7840
|
+
configurable: true
|
7841
|
+
});
|
7842
|
+
Object.defineProperty(DropdownListModel.prototype, "showHintPrefix", {
|
7843
|
+
get: function () {
|
7844
|
+
return !!this.inputString && this.hintStringLC.indexOf(this.inputStringLC) > 0;
|
7845
|
+
},
|
7846
|
+
enumerable: false,
|
7847
|
+
configurable: true
|
7848
|
+
});
|
7849
|
+
Object.defineProperty(DropdownListModel.prototype, "hintStringPrefix", {
|
7850
|
+
get: function () {
|
7851
|
+
if (!this.inputString)
|
7852
|
+
return null;
|
7853
|
+
return this.hintString.substring(0, this.hintStringLC.indexOf(this.inputStringLC));
|
7854
|
+
},
|
7855
|
+
enumerable: false,
|
7856
|
+
configurable: true
|
7857
|
+
});
|
7858
|
+
Object.defineProperty(DropdownListModel.prototype, "showHintString", {
|
7859
|
+
get: function () {
|
7860
|
+
return this.hintStringLC != this.inputStringLC && this.hintStringLC.indexOf(this.inputStringLC) >= 0;
|
7861
|
+
},
|
7862
|
+
enumerable: false,
|
7863
|
+
configurable: true
|
7864
|
+
});
|
7865
|
+
Object.defineProperty(DropdownListModel.prototype, "hintStringSuffix", {
|
7866
|
+
get: function () {
|
7867
|
+
return this.hintString.substring(this.hintStringLC.indexOf(this.inputStringLC) + this.inputStringLC.length);
|
7868
|
+
},
|
7869
|
+
enumerable: false,
|
7870
|
+
configurable: true
|
7871
|
+
});
|
7770
7872
|
Object.defineProperty(DropdownListModel.prototype, "popupModel", {
|
7771
7873
|
get: function () {
|
7772
7874
|
return this._popupModel;
|
@@ -7790,14 +7892,14 @@ var DropdownListModel = /** @class */ (function (_super) {
|
|
7790
7892
|
});
|
7791
7893
|
Object.defineProperty(DropdownListModel.prototype, "inputMode", {
|
7792
7894
|
get: function () {
|
7793
|
-
return
|
7895
|
+
return _utils_devices__WEBPACK_IMPORTED_MODULE_6__["IsTouch"] ? "none" : "text";
|
7794
7896
|
},
|
7795
7897
|
enumerable: false,
|
7796
7898
|
configurable: true
|
7797
7899
|
});
|
7798
7900
|
DropdownListModel.prototype.setSearchEnabled = function (newValue) {
|
7799
|
-
this.listModel.searchEnabled =
|
7800
|
-
this.listModel.showSearchClearButton =
|
7901
|
+
this.listModel.searchEnabled = _utils_devices__WEBPACK_IMPORTED_MODULE_6__["IsTouch"];
|
7902
|
+
this.listModel.showSearchClearButton = _utils_devices__WEBPACK_IMPORTED_MODULE_6__["IsTouch"];
|
7801
7903
|
this.searchEnabled = newValue;
|
7802
7904
|
};
|
7803
7905
|
DropdownListModel.prototype.updateItems = function () {
|
@@ -7805,7 +7907,6 @@ var DropdownListModel = /** @class */ (function (_super) {
|
|
7805
7907
|
};
|
7806
7908
|
DropdownListModel.prototype.onClick = function (event) {
|
7807
7909
|
this._popupModel.toggleVisibility();
|
7808
|
-
this.listModel.focusNextVisibleItem();
|
7809
7910
|
if (this.searchEnabled && !!event && !!event.target) {
|
7810
7911
|
var input = event.target.querySelector("input");
|
7811
7912
|
if (!!input) {
|
@@ -7815,18 +7916,37 @@ var DropdownListModel = /** @class */ (function (_super) {
|
|
7815
7916
|
};
|
7816
7917
|
DropdownListModel.prototype.onClear = function (event) {
|
7817
7918
|
this.question.clearValue();
|
7919
|
+
this.inputString = null;
|
7920
|
+
this.hintString = "";
|
7818
7921
|
this.resetFilterString();
|
7819
|
-
event
|
7820
|
-
|
7922
|
+
if (event) {
|
7923
|
+
event.preventDefault();
|
7924
|
+
event.stopPropagation();
|
7925
|
+
}
|
7821
7926
|
};
|
7822
7927
|
DropdownListModel.prototype.getSelectedAction = function () {
|
7823
7928
|
return this.question.selectedItem || null;
|
7824
7929
|
};
|
7930
|
+
DropdownListModel.prototype.changeSelectionWithKeyboard = function (reverse) {
|
7931
|
+
if (reverse) {
|
7932
|
+
this.listModel.focusPrevVisibleItem();
|
7933
|
+
}
|
7934
|
+
else {
|
7935
|
+
this.listModel.focusNextVisibleItem();
|
7936
|
+
}
|
7937
|
+
this.scrollToFocusedItem();
|
7938
|
+
if (this.question.value && this.question.searchEnabled && this.question instanceof _question_dropdown__WEBPACK_IMPORTED_MODULE_4__["QuestionDropdownModel"]) {
|
7939
|
+
this.applyInputString(this.listModel.focusedItem);
|
7940
|
+
this.hintString = "";
|
7941
|
+
}
|
7942
|
+
else {
|
7943
|
+
this.applyHintString(this.listModel.focusedItem);
|
7944
|
+
}
|
7945
|
+
};
|
7825
7946
|
DropdownListModel.prototype.keyHandler = function (event) {
|
7826
7947
|
var char = event.which || event.keyCode;
|
7827
7948
|
if (this.popupModel.isVisible && event.keyCode === 38) {
|
7828
|
-
this.
|
7829
|
-
this.scrollToFocusedItem();
|
7949
|
+
this.changeSelectionWithKeyboard(true);
|
7830
7950
|
event.preventDefault();
|
7831
7951
|
event.stopPropagation();
|
7832
7952
|
}
|
@@ -7834,28 +7954,48 @@ var DropdownListModel = /** @class */ (function (_super) {
|
|
7834
7954
|
if (!this.popupModel.isVisible) {
|
7835
7955
|
this.popupModel.toggleVisibility();
|
7836
7956
|
}
|
7837
|
-
this.
|
7838
|
-
this.scrollToFocusedItem();
|
7957
|
+
this.changeSelectionWithKeyboard(false);
|
7839
7958
|
event.preventDefault();
|
7840
7959
|
event.stopPropagation();
|
7841
7960
|
}
|
7842
|
-
else if (this.popupModel.isVisible && (event.keyCode === 13 || event.keyCode === 32)) {
|
7843
|
-
this.
|
7961
|
+
else if (!this.popupModel.isVisible && (event.keyCode === 13 || event.keyCode === 32)) {
|
7962
|
+
this.popupModel.toggleVisibility();
|
7963
|
+
this.changeSelectionWithKeyboard(false);
|
7844
7964
|
event.preventDefault();
|
7845
7965
|
event.stopPropagation();
|
7846
7966
|
}
|
7847
|
-
else if (
|
7848
|
-
this.
|
7967
|
+
else if (this.popupModel.isVisible && (event.keyCode === 13 || event.keyCode === 32 && !this.question.searchEnabled)) {
|
7968
|
+
if (event.keyCode === 13 && this.question.searchEnabled && !this.inputString && this.question instanceof _question_dropdown__WEBPACK_IMPORTED_MODULE_4__["QuestionDropdownModel"] && !this._markdownMode && this.question.value) {
|
7969
|
+
this._popupModel.isVisible = false;
|
7970
|
+
this.onClear(event);
|
7971
|
+
}
|
7972
|
+
else {
|
7973
|
+
this.listModel.selectFocusedItem();
|
7974
|
+
this.onFocus(event);
|
7975
|
+
}
|
7976
|
+
event.preventDefault();
|
7977
|
+
event.stopPropagation();
|
7978
|
+
}
|
7979
|
+
else if (char === 46 || char === 8) {
|
7980
|
+
if (!this.searchEnabled) {
|
7981
|
+
this.onClear(event);
|
7982
|
+
}
|
7849
7983
|
}
|
7850
7984
|
else if (event.keyCode === 27) {
|
7851
|
-
this.
|
7985
|
+
this._popupModel.isVisible = false;
|
7986
|
+
this.hintString = "";
|
7987
|
+
if (this.question.searchEnabled && this.question instanceof _question_dropdown__WEBPACK_IMPORTED_MODULE_4__["QuestionDropdownModel"])
|
7988
|
+
this.applyInputString(this.question.selectedItem);
|
7852
7989
|
}
|
7853
7990
|
else {
|
7854
|
-
if (event.keyCode === 38 || event.keyCode === 40 || event.keyCode === 32) {
|
7991
|
+
if (event.keyCode === 38 || event.keyCode === 40 || event.keyCode === 32 && !this.question.searchEnabled) {
|
7855
7992
|
event.preventDefault();
|
7856
7993
|
event.stopPropagation();
|
7857
7994
|
}
|
7858
|
-
|
7995
|
+
if (event.keyCode === 32 && this.question.searchEnabled) {
|
7996
|
+
return;
|
7997
|
+
}
|
7998
|
+
Object(_utils_utils__WEBPACK_IMPORTED_MODULE_7__["doKey2ClickUp"])(event, { processEsc: false, disableTabStop: this.question.isInputReadOnly });
|
7859
7999
|
}
|
7860
8000
|
};
|
7861
8001
|
DropdownListModel.prototype.onScroll = function (event) {
|
@@ -7865,7 +8005,7 @@ var DropdownListModel = /** @class */ (function (_super) {
|
|
7865
8005
|
}
|
7866
8006
|
};
|
7867
8007
|
DropdownListModel.prototype.onBlur = function (event) {
|
7868
|
-
if (this.popupModel.isVisible &&
|
8008
|
+
if (this.popupModel.isVisible && _utils_devices__WEBPACK_IMPORTED_MODULE_6__["IsTouch"]) {
|
7869
8009
|
this._popupModel.isVisible = true;
|
7870
8010
|
return;
|
7871
8011
|
}
|
@@ -7873,9 +8013,20 @@ var DropdownListModel = /** @class */ (function (_super) {
|
|
7873
8013
|
this.listModel.selectFocusedItem();
|
7874
8014
|
}
|
7875
8015
|
this.resetFilterString();
|
8016
|
+
this.inputString = null;
|
8017
|
+
this.hintString = "";
|
8018
|
+
Object(_utils_utils__WEBPACK_IMPORTED_MODULE_7__["doKey2ClickBlur"])(event);
|
7876
8019
|
this._popupModel.isVisible = false;
|
7877
|
-
|
7878
|
-
|
8020
|
+
};
|
8021
|
+
DropdownListModel.prototype.onFocus = function (event) {
|
8022
|
+
if (this.question.searchEnabled) {
|
8023
|
+
if (this.question instanceof _question_dropdown__WEBPACK_IMPORTED_MODULE_4__["QuestionDropdownModel"]) {
|
8024
|
+
this.applyInputString(this.question.selectedItem);
|
8025
|
+
}
|
8026
|
+
else {
|
8027
|
+
this.inputString = null;
|
8028
|
+
}
|
8029
|
+
}
|
7879
8030
|
};
|
7880
8031
|
DropdownListModel.prototype.scrollToFocusedItem = function () {
|
7881
8032
|
this.listModel.scrollToFocusedItem();
|
@@ -7891,6 +8042,20 @@ var DropdownListModel = /** @class */ (function (_super) {
|
|
7891
8042
|
}
|
7892
8043
|
})
|
7893
8044
|
], DropdownListModel.prototype, "filterString", void 0);
|
8045
|
+
__decorate([
|
8046
|
+
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])({
|
8047
|
+
defaultValue: "",
|
8048
|
+
onSet: function (newValue, target) {
|
8049
|
+
target.question.inputHasValue = !!newValue;
|
8050
|
+
}
|
8051
|
+
})
|
8052
|
+
], DropdownListModel.prototype, "inputString", void 0);
|
8053
|
+
__decorate([
|
8054
|
+
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])({})
|
8055
|
+
], DropdownListModel.prototype, "showSelectedItemLocText", void 0);
|
8056
|
+
__decorate([
|
8057
|
+
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])({})
|
8058
|
+
], DropdownListModel.prototype, "showInputFieldComponent", void 0);
|
7894
8059
|
__decorate([
|
7895
8060
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])({
|
7896
8061
|
defaultValue: false,
|
@@ -7904,6 +8069,9 @@ var DropdownListModel = /** @class */ (function (_super) {
|
|
7904
8069
|
}
|
7905
8070
|
})
|
7906
8071
|
], DropdownListModel.prototype, "hasScroll", void 0);
|
8072
|
+
__decorate([
|
8073
|
+
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_1__["property"])({ defaultValue: "" })
|
8074
|
+
], DropdownListModel.prototype, "hintString", void 0);
|
7907
8075
|
return DropdownListModel;
|
7908
8076
|
}(_base__WEBPACK_IMPORTED_MODULE_0__["Base"]));
|
7909
8077
|
|
@@ -8853,7 +9021,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
8853
9021
|
// import "../../main.scss";
|
8854
9022
|
//import "../../modern.scss";
|
8855
9023
|
var Version;
|
8856
|
-
Version = "" + "1.9.
|
9024
|
+
Version = "" + "1.9.79";
|
8857
9025
|
function checkLibraryVersion(ver, libraryName) {
|
8858
9026
|
if (Version != ver) {
|
8859
9027
|
var str = "survey-core has version '" + Version + "' and " + libraryName
|
@@ -18199,7 +18367,7 @@ var JsonMetadata = /** @class */ (function () {
|
|
18199
18367
|
var props = {};
|
18200
18368
|
this.generateSchemaProperties(classInfo, props, schemaDef);
|
18201
18369
|
if (hasParent) {
|
18202
|
-
res.
|
18370
|
+
res.allOf = [
|
18203
18371
|
{ $ref: "#" + classInfo.parentName },
|
18204
18372
|
{ properties: props },
|
18205
18373
|
];
|
@@ -18789,7 +18957,7 @@ var ListModel = /** @class */ (function (_super) {
|
|
18789
18957
|
});
|
18790
18958
|
Object.defineProperty(ListModel.prototype, "emptyMessage", {
|
18791
18959
|
get: function () {
|
18792
|
-
return this.getLocalizationString("emptyMessage");
|
18960
|
+
return this.isAllDataLoaded ? this.getLocalizationString("emptyMessage") : this.loadingText;
|
18793
18961
|
},
|
18794
18962
|
enumerable: false,
|
18795
18963
|
configurable: true
|
@@ -25261,6 +25429,8 @@ var MultiSelectListModel = /** @class */ (function (_super) {
|
|
25261
25429
|
function MultiSelectListModel(items, onSelectionChanged, allowSelection, selectedItems, onFilterStringChangedCallback) {
|
25262
25430
|
var _this = _super.call(this, items, onSelectionChanged, allowSelection, undefined, onFilterStringChangedCallback) || this;
|
25263
25431
|
_this.onItemClick = function (item) {
|
25432
|
+
if (_this.isItemDisabled(item))
|
25433
|
+
return;
|
25264
25434
|
_this.isExpanded = false;
|
25265
25435
|
if (_this.isItemSelected(item)) {
|
25266
25436
|
_this.selectedItems.splice(_this.selectedItems.indexOf(item), 1)[0];
|
@@ -25365,6 +25535,7 @@ var Notifier = /** @class */ (function (_super) {
|
|
25365
25535
|
_this.actionBar.updateCallback = function (isResetInitialized) {
|
25366
25536
|
_this.actionBar.actions.forEach(function (action) { return action.cssClasses = {}; });
|
25367
25537
|
};
|
25538
|
+
_this.css = _this.cssClasses.root;
|
25368
25539
|
return _this;
|
25369
25540
|
}
|
25370
25541
|
Notifier.prototype.getCssClass = function (type) {
|
@@ -25373,27 +25544,35 @@ var Notifier = /** @class */ (function (_super) {
|
|
25373
25544
|
.append(this.cssClasses.info, type !== "error" && type !== "success")
|
25374
25545
|
.append(this.cssClasses.error, type === "error")
|
25375
25546
|
.append(this.cssClasses.success, type === "success")
|
25547
|
+
.append(this.cssClasses.shown, this.active)
|
25376
25548
|
.toString();
|
25377
25549
|
};
|
25378
25550
|
Notifier.prototype.updateActionsVisibility = function (type) {
|
25379
25551
|
var _this = this;
|
25380
25552
|
this.actionBar.actions.forEach(function (action) { return action.visible = (_this.actionsVisibility[action.id] === type); });
|
25381
25553
|
};
|
25382
|
-
Notifier.prototype.notify = function (message, type) {
|
25554
|
+
Notifier.prototype.notify = function (message, type, waitUserAction) {
|
25383
25555
|
var _this = this;
|
25384
25556
|
if (type === void 0) { type = "info"; }
|
25385
|
-
|
25386
|
-
this.
|
25387
|
-
|
25388
|
-
|
25389
|
-
|
25390
|
-
|
25391
|
-
|
25392
|
-
|
25393
|
-
|
25394
|
-
|
25395
|
-
|
25396
|
-
|
25557
|
+
if (waitUserAction === void 0) { waitUserAction = false; }
|
25558
|
+
this.isDisplayed = true;
|
25559
|
+
setTimeout(function () {
|
25560
|
+
_this.updateActionsVisibility(type);
|
25561
|
+
_this.message = message;
|
25562
|
+
_this.active = true;
|
25563
|
+
_this.css = _this.getCssClass(type);
|
25564
|
+
if (!!_this.timer) {
|
25565
|
+
clearTimeout(_this.timer);
|
25566
|
+
_this.timer = undefined;
|
25567
|
+
}
|
25568
|
+
if (!waitUserAction) {
|
25569
|
+
_this.timer = setTimeout(function () {
|
25570
|
+
_this.timer = undefined;
|
25571
|
+
_this.active = false;
|
25572
|
+
_this.css = _this.getCssClass(type);
|
25573
|
+
}, _this.timeout);
|
25574
|
+
}
|
25575
|
+
}, 1);
|
25397
25576
|
};
|
25398
25577
|
Notifier.prototype.addAction = function (action, notificationType) {
|
25399
25578
|
action.visible = false;
|
@@ -25404,6 +25583,9 @@ var Notifier = /** @class */ (function (_super) {
|
|
25404
25583
|
__decorate([
|
25405
25584
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])({ defaultValue: false })
|
25406
25585
|
], Notifier.prototype, "active", void 0);
|
25586
|
+
__decorate([
|
25587
|
+
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])({ defaultValue: false })
|
25588
|
+
], Notifier.prototype, "isDisplayed", void 0);
|
25407
25589
|
__decorate([
|
25408
25590
|
Object(_jsonobject__WEBPACK_IMPORTED_MODULE_2__["property"])()
|
25409
25591
|
], Notifier.prototype, "message", void 0);
|
@@ -28127,14 +28309,7 @@ var PanelModel = /** @class */ (function (_super) {
|
|
28127
28309
|
};
|
28128
28310
|
Object.defineProperty(PanelModel.prototype, "cssTitle", {
|
28129
28311
|
get: function () {
|
28130
|
-
return
|
28131
|
-
.append(this.cssClasses.panel.title)
|
28132
|
-
.append(this.cssClasses.panel.titleExpandable, this.state !== "default")
|
28133
|
-
.append(this.cssClasses.panel.titleExpanded, this.isExpanded)
|
28134
|
-
.append(this.cssClasses.panel.titleCollapsed, this.isCollapsed)
|
28135
|
-
.append(this.cssClasses.panel.titleDisabled, this.isReadOnly)
|
28136
|
-
.append(this.cssClasses.panel.titleOnError, this.containsErrors)
|
28137
|
-
.toString();
|
28312
|
+
return this.getCssTitle(this.cssClasses.panel);
|
28138
28313
|
},
|
28139
28314
|
enumerable: false,
|
28140
28315
|
configurable: true
|
@@ -28427,6 +28602,8 @@ var defaultCss = {
|
|
28427
28602
|
cleanButtonSvg: "sv_q_dd_clean-button-svg",
|
28428
28603
|
cleanButtonIconId: "icon-clear_16x16",
|
28429
28604
|
filterStringInput: "sv_q_dd_filter-string-input",
|
28605
|
+
hintPrefix: "sv_q_dd_hint-prefix",
|
28606
|
+
hintSuffix: "sv_q_dd_hint-suffix"
|
28430
28607
|
},
|
28431
28608
|
tagbox: {
|
28432
28609
|
root: "sv_q_dd_root",
|
@@ -30833,6 +31010,9 @@ var Question = /** @class */ (function (_super) {
|
|
30833
31010
|
_this.registerPropertyChangedHandlers(["showCommentArea", "showOtherItem"], function () {
|
30834
31011
|
_this.initCommentFromSurvey();
|
30835
31012
|
});
|
31013
|
+
_this.registerFunctionOnPropertiesValueChanged(["no"], function () {
|
31014
|
+
_this.updateQuestionCss();
|
31015
|
+
});
|
30836
31016
|
_this.registerPropertyChangedHandlers(["isMobile"], function () { _this.onMobileChanged(); });
|
30837
31017
|
return _this;
|
30838
31018
|
}
|
@@ -31694,12 +31874,7 @@ var Question = /** @class */ (function (_super) {
|
|
31694
31874
|
};
|
31695
31875
|
Question.prototype.getCssTitle = function (cssClasses) {
|
31696
31876
|
return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_10__["CssClassBuilder"]()
|
31697
|
-
.append(cssClasses
|
31698
|
-
.append(cssClasses.titleExpandable, this.state !== "default")
|
31699
|
-
.append(cssClasses.titleExpanded, this.isExpanded)
|
31700
|
-
.append(cssClasses.titleCollapsed, this.isCollapsed)
|
31701
|
-
.append(cssClasses.titleDisabled, this.isReadOnly)
|
31702
|
-
.append(cssClasses.titleOnError, this.containsErrors)
|
31877
|
+
.append(_super.prototype.getCssTitle.call(this, cssClasses))
|
31703
31878
|
.append(cssClasses.titleOnAnswer, !this.containsErrors && this.isAnswered)
|
31704
31879
|
.toString();
|
31705
31880
|
};
|
@@ -34627,12 +34802,12 @@ var QuestionSelectBase = /** @class */ (function (_super) {
|
|
34627
34802
|
if (this.isBuiltInChoice(choices[i], question))
|
34628
34803
|
continue;
|
34629
34804
|
if (isSelected === undefined) {
|
34630
|
-
res.push(choices[i]);
|
34805
|
+
res.push(this.copyChoiceItem(choices[i]));
|
34631
34806
|
continue;
|
34632
34807
|
}
|
34633
34808
|
var itemsSelected = question.isItemSelected(choices[i]);
|
34634
34809
|
if ((itemsSelected && isSelected) || (!itemsSelected && !isSelected)) {
|
34635
|
-
res.push(choices[i]);
|
34810
|
+
res.push(this.copyChoiceItem(choices[i]));
|
34636
34811
|
}
|
34637
34812
|
}
|
34638
34813
|
if (this.choicesFromQuestionMode === "selected" && question.isOtherSelected && !!question.comment) {
|
@@ -34640,6 +34815,9 @@ var QuestionSelectBase = /** @class */ (function (_super) {
|
|
34640
34815
|
}
|
34641
34816
|
return res;
|
34642
34817
|
};
|
34818
|
+
QuestionSelectBase.prototype.copyChoiceItem = function (item) {
|
34819
|
+
return new _itemvalue__WEBPACK_IMPORTED_MODULE_3__["ItemValue"](item.value, item.text);
|
34820
|
+
};
|
34643
34821
|
Object.defineProperty(QuestionSelectBase.prototype, "hasActiveChoices", {
|
34644
34822
|
get: function () {
|
34645
34823
|
var choices = this.visibleChoices;
|
@@ -37036,6 +37214,11 @@ var ComponentQuestionJSON = /** @class */ (function () {
|
|
37036
37214
|
return;
|
37037
37215
|
this.json.onValueChanged(question, name, newValue);
|
37038
37216
|
};
|
37217
|
+
ComponentQuestionJSON.prototype.onValueChanging = function (question, name, newValue) {
|
37218
|
+
if (!this.json.onValueChanging)
|
37219
|
+
return newValue;
|
37220
|
+
return this.json.onValueChanging(question, name, newValue);
|
37221
|
+
};
|
37039
37222
|
ComponentQuestionJSON.prototype.onItemValuePropertyChanged = function (question, item, propertyName, name, newValue) {
|
37040
37223
|
if (!this.json.onItemValuePropertyChanged)
|
37041
37224
|
return;
|
@@ -37246,6 +37429,23 @@ var QuestionCustomModelBase = /** @class */ (function (_super) {
|
|
37246
37429
|
this.customQuestion.onValueChanged(this, name, newValue);
|
37247
37430
|
}
|
37248
37431
|
};
|
37432
|
+
QuestionCustomModelBase.prototype.getQuestionByName = function (name) {
|
37433
|
+
return undefined;
|
37434
|
+
};
|
37435
|
+
QuestionCustomModelBase.prototype.isValueChanging = function (name, newValue) {
|
37436
|
+
if (!!this.customQuestion) {
|
37437
|
+
var qValue = newValue;
|
37438
|
+
newValue = this.customQuestion.onValueChanging(this, name, newValue);
|
37439
|
+
if (!_helpers__WEBPACK_IMPORTED_MODULE_3__["Helpers"].isTwoValueEquals(newValue, qValue)) {
|
37440
|
+
var q = this.getQuestionByName(name);
|
37441
|
+
if (!!q) {
|
37442
|
+
q.value = newValue;
|
37443
|
+
return true;
|
37444
|
+
}
|
37445
|
+
}
|
37446
|
+
}
|
37447
|
+
return false;
|
37448
|
+
};
|
37249
37449
|
QuestionCustomModelBase.prototype.convertDataName = function (name) {
|
37250
37450
|
return this.getValueName();
|
37251
37451
|
};
|
@@ -37336,6 +37536,14 @@ var QuestionCustomModel = /** @class */ (function (_super) {
|
|
37336
37536
|
this.contentQuestion.onAnyValueChanged(name);
|
37337
37537
|
}
|
37338
37538
|
};
|
37539
|
+
QuestionCustomModel.prototype.getQuestionByName = function (name) {
|
37540
|
+
return this.contentQuestion;
|
37541
|
+
};
|
37542
|
+
QuestionCustomModel.prototype.setValue = function (name, newValue, locNotification, allowNotifyValueChanged) {
|
37543
|
+
if (this.isValueChanging(name, newValue))
|
37544
|
+
return;
|
37545
|
+
_super.prototype.setValue.call(this, name, newValue, locNotification, allowNotifyValueChanged);
|
37546
|
+
};
|
37339
37547
|
QuestionCustomModel.prototype.hasErrors = function (fireCallback, rec) {
|
37340
37548
|
if (fireCallback === void 0) { fireCallback = true; }
|
37341
37549
|
if (rec === void 0) { rec = null; }
|
@@ -37642,9 +37850,14 @@ var QuestionCompositeModel = /** @class */ (function (_super) {
|
|
37642
37850
|
var val = this.value;
|
37643
37851
|
return !!val ? val[name] : null;
|
37644
37852
|
};
|
37853
|
+
QuestionCompositeModel.prototype.getQuestionByName = function (name) {
|
37854
|
+
return !!this.contentPanel ? this.contentPanel.getQuestionByName(name) : undefined;
|
37855
|
+
};
|
37645
37856
|
QuestionCompositeModel.prototype.setValue = function (name, newValue, locNotification, allowNotifyValueChanged) {
|
37646
37857
|
if (this.settingNewValue)
|
37647
37858
|
return;
|
37859
|
+
if (this.isValueChanging(name, newValue))
|
37860
|
+
return;
|
37648
37861
|
this.settingNewValue = true;
|
37649
37862
|
if (!this.isEditingSurveyElement && !!this.contentPanel) {
|
37650
37863
|
var panelValue = this.contentPanel.getValue();
|
@@ -37886,7 +38099,7 @@ var QuestionDropdownModel = /** @class */ (function (_super) {
|
|
37886
38099
|
else if (!selectedItemValues) {
|
37887
38100
|
this.updateSelectedItemValues();
|
37888
38101
|
}
|
37889
|
-
return this.lastSelectedItemValue || selectedItemValues || new _itemvalue__WEBPACK_IMPORTED_MODULE_3__["ItemValue"](this.value);
|
38102
|
+
return this.lastSelectedItemValue || selectedItemValues || (this.isOtherSelected ? this.otherItem : new _itemvalue__WEBPACK_IMPORTED_MODULE_3__["ItemValue"](this.value));
|
37890
38103
|
},
|
37891
38104
|
enumerable: false,
|
37892
38105
|
configurable: true
|
@@ -49888,7 +50101,7 @@ var QuestionRadiogroupModel = /** @class */ (function (_super) {
|
|
49888
50101
|
if (!itemValue && !selectedItemValues) {
|
49889
50102
|
this.updateSelectedItemValues();
|
49890
50103
|
}
|
49891
|
-
return itemValue || selectedItemValues || new _itemvalue__WEBPACK_IMPORTED_MODULE_3__["ItemValue"](this.value);
|
50104
|
+
return itemValue || selectedItemValues || (this.isOtherSelected ? this.otherItem : new _itemvalue__WEBPACK_IMPORTED_MODULE_3__["ItemValue"](this.value));
|
49892
50105
|
},
|
49893
50106
|
enumerable: false,
|
49894
50107
|
configurable: true
|
@@ -50726,8 +50939,17 @@ var QuestionRatingModel = /** @class */ (function (_super) {
|
|
50726
50939
|
configurable: true
|
50727
50940
|
});
|
50728
50941
|
QuestionRatingModel.prototype.getItemClass = function (item, highlight) {
|
50942
|
+
var _this = this;
|
50729
50943
|
if (highlight === void 0) { highlight = "none"; }
|
50730
|
-
var isSelected = this.
|
50944
|
+
var isSelected = this.value == item.value;
|
50945
|
+
if (this.isStar) {
|
50946
|
+
if (this.rateValues.length == 0) {
|
50947
|
+
isSelected = this.value >= item.value;
|
50948
|
+
}
|
50949
|
+
else {
|
50950
|
+
isSelected = this.rateValues.indexOf(this.rateValues.filter(function (i) { return i.value == _this.value; })[0]) >= this.rateValues.indexOf(item);
|
50951
|
+
}
|
50952
|
+
}
|
50731
50953
|
var isDisabled = this.isReadOnly || !item.isEnabled;
|
50732
50954
|
var allowHover = !isDisabled && (this.value != item.value) && !(!!this.survey && this.survey.isDesignMode);
|
50733
50955
|
var renderedItem = this.renderedRateItems.filter(function (i) { return i.itemValue == item; })[0];
|
@@ -54087,7 +54309,9 @@ var NotifierComponent = /** @class */ (function (_super) {
|
|
54087
54309
|
return this.notifier;
|
54088
54310
|
};
|
54089
54311
|
NotifierComponent.prototype.renderElement = function () {
|
54090
|
-
|
54312
|
+
if (!this.notifier.isDisplayed)
|
54313
|
+
return null;
|
54314
|
+
var style = { visibility: this.notifier.active ? "visible" : "hidden" };
|
54091
54315
|
return (react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { className: this.notifier.css, style: style },
|
54092
54316
|
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", null, this.notifier.message),
|
54093
54317
|
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_action_bar_action_bar__WEBPACK_IMPORTED_MODULE_3__["SurveyActionBar"], { model: this.notifier.actionBar })));
|
@@ -54706,8 +54930,8 @@ var RatingItemStar = /** @class */ (function (_super) {
|
|
54706
54930
|
var _this = this;
|
54707
54931
|
return (react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", { className: this.question.getItemClass(this.item.itemValue), onMouseOver: function (e) { return _this.question.onItemMouseIn(_this.item); }, onMouseOut: function (e) { return _this.question.onItemMouseOut(_this.item); } },
|
54708
54932
|
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", { type: "radio", className: "sv-visuallyhidden", name: this.question.name, id: this.question.getInputId(this.index), value: this.item.value, disabled: this.isDisplayMode, checked: this.question.value == this.item.value, onClick: this.props.handleOnClick, onChange: function () { }, "aria-required": this.question.ariaRequired, "aria-label": this.question.ariaLabel, "aria-invalid": this.question.ariaInvalid, "aria-describedby": this.question.ariaDescribedBy }),
|
54709
|
-
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_svg_icon_svg_icon__WEBPACK_IMPORTED_MODULE_3__["SvgIcon"], { className: "sv-star", size:
|
54710
|
-
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_svg_icon_svg_icon__WEBPACK_IMPORTED_MODULE_3__["SvgIcon"], { className: "sv-star-2", size:
|
54933
|
+
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_svg_icon_svg_icon__WEBPACK_IMPORTED_MODULE_3__["SvgIcon"], { className: "sv-star", size: "auto", iconName: "icon-rating-star", title: this.item.text }),
|
54934
|
+
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_svg_icon_svg_icon__WEBPACK_IMPORTED_MODULE_3__["SvgIcon"], { className: "sv-star-2", size: "auto", iconName: "icon-rating-star-2", title: this.item.text })));
|
54711
54935
|
};
|
54712
54936
|
return RatingItemStar;
|
54713
54937
|
}(_reactquestion_element__WEBPACK_IMPORTED_MODULE_2__["SurveyElementBase"]));
|
@@ -55523,8 +55747,15 @@ var SurveyQuestionDropdownBase = /** @class */ (function (_super) {
|
|
55523
55747
|
(_a = _this.question.dropdownListModel) === null || _a === void 0 ? void 0 : _a.onBlur(event);
|
55524
55748
|
_this.updateInputDomElement();
|
55525
55749
|
};
|
55750
|
+
_this.focus = function (event) {
|
55751
|
+
var _a;
|
55752
|
+
(_a = _this.question.dropdownListModel) === null || _a === void 0 ? void 0 : _a.onFocus(event);
|
55753
|
+
};
|
55526
55754
|
return _this;
|
55527
55755
|
}
|
55756
|
+
SurveyQuestionDropdownBase.prototype.getStateElement = function () {
|
55757
|
+
return this.question["dropdownListModel"];
|
55758
|
+
};
|
55528
55759
|
SurveyQuestionDropdownBase.prototype.setValueCore = function (newValue) {
|
55529
55760
|
this.questionBase.renderedValue = newValue;
|
55530
55761
|
};
|
@@ -55566,16 +55797,23 @@ var SurveyQuestionDropdownBase = /** @class */ (function (_super) {
|
|
55566
55797
|
var valueElement = this.renderValueElement(dropdownListModel);
|
55567
55798
|
var onInputChange = function (e) {
|
55568
55799
|
if (e.target === document.activeElement) {
|
55569
|
-
dropdownListModel.
|
55800
|
+
dropdownListModel.inputStringRendered = e.target.value;
|
55570
55801
|
}
|
55571
55802
|
};
|
55572
55803
|
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { id: this.question.inputId, className: this.question.getControlClass(), tabIndex: dropdownListModel.inputReadOnly ? undefined : 0, onClick: this.click,
|
55573
55804
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
55574
55805
|
// @ts-ignore
|
55575
55806
|
disabled: this.question.isInputReadOnly, required: this.question.isRequired, onKeyDown: this.keyhandler, onBlur: this.blur, role: this.question.ariaRole, "aria-required": this.question.ariaRequired, "aria-label": this.question.ariaLabel, "aria-invalid": this.question.ariaInvalid, "aria-describedby": this.question.ariaDescribedBy },
|
55807
|
+
dropdownListModel.showHintPrefix ?
|
55808
|
+
(react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.question.cssClasses.hintPrefix },
|
55809
|
+
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", null, dropdownListModel.hintStringPrefix))) : null,
|
55576
55810
|
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.question.cssClasses.controlValue },
|
55811
|
+
dropdownListModel.showHintString ?
|
55812
|
+
(react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.question.cssClasses.hintSuffix },
|
55813
|
+
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", { style: { visibility: "hidden" }, "data-bind": "text: model.filterString" }, dropdownListModel.inputStringRendered),
|
55814
|
+
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", null, dropdownListModel.hintStringSuffix))) : null,
|
55577
55815
|
valueElement,
|
55578
|
-
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("input", { type: "text", autoComplete: "off", id: this.question.getInputId(), ref: function (element) { return (_this.inputElement = element); }, className: this.question.cssClasses.filterStringInput, role: dropdownListModel.filterStringEnabled ? this.question.ariaRole : undefined, "aria-label": this.question.placeholder, placeholder:
|
55816
|
+
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("input", { type: "text", autoComplete: "off", id: this.question.getInputId(), ref: function (element) { return (_this.inputElement = element); }, className: this.question.cssClasses.filterStringInput, role: dropdownListModel.filterStringEnabled ? this.question.ariaRole : undefined, "aria-label": this.question.placeholder, placeholder: dropdownListModel.placeholderRendered, readOnly: !dropdownListModel.searchEnabled ? true : undefined, tabIndex: dropdownListModel.inputReadOnly ? undefined : -1, disabled: this.question.isInputReadOnly, inputMode: dropdownListModel.inputMode, onChange: function (e) { onInputChange(e); }, onBlur: this.blur, onFocus: this.focus })),
|
55579
55817
|
this.createClearButton()));
|
55580
55818
|
};
|
55581
55819
|
SurveyQuestionDropdownBase.prototype.createClearButton = function () {
|
@@ -55600,9 +55838,9 @@ var SurveyQuestionDropdownBase = /** @class */ (function (_super) {
|
|
55600
55838
|
SurveyQuestionDropdownBase.prototype.updateInputDomElement = function () {
|
55601
55839
|
if (!!this.inputElement) {
|
55602
55840
|
var control = this.inputElement;
|
55603
|
-
var newValue = this.question.dropdownListModel.
|
55841
|
+
var newValue = this.question.dropdownListModel.inputStringRendered;
|
55604
55842
|
if (!survey_core__WEBPACK_IMPORTED_MODULE_1__["Helpers"].isTwoValueEquals(newValue, control.value)) {
|
55605
|
-
control.value = this.question.dropdownListModel.
|
55843
|
+
control.value = this.question.dropdownListModel.inputStringRendered;
|
55606
55844
|
}
|
55607
55845
|
}
|
55608
55846
|
};
|
@@ -58248,6 +58486,8 @@ var SurveyQuestionCheckboxItem = /** @class */ (function (_super) {
|
|
58248
58486
|
SurveyQuestionCheckboxItem.prototype.shouldComponentUpdate = function (nextProps, nextState) {
|
58249
58487
|
if (!_super.prototype.shouldComponentUpdate.call(this, nextProps, nextState))
|
58250
58488
|
return false;
|
58489
|
+
if (!this.question)
|
58490
|
+
return false;
|
58251
58491
|
return (!this.question.customWidget ||
|
58252
58492
|
!!this.question.customWidgetData.isNeedRender ||
|
58253
58493
|
!!this.question.customWidget.widgetJson.isDefaultRender ||
|
@@ -60624,6 +60864,8 @@ var SurveyQuestionRadioItem = /** @class */ (function (_super) {
|
|
60624
60864
|
SurveyQuestionRadioItem.prototype.shouldComponentUpdate = function (nextProps, nextState) {
|
60625
60865
|
if (!_super.prototype.shouldComponentUpdate.call(this, nextProps, nextState))
|
60626
60866
|
return false;
|
60867
|
+
if (!this.question)
|
60868
|
+
return false;
|
60627
60869
|
return (!this.question.customWidget ||
|
60628
60870
|
!!this.question.customWidgetData.isNeedRender ||
|
60629
60871
|
!!this.question.customWidget.widgetJson.isDefaultRender ||
|
@@ -61736,15 +61978,15 @@ var TagboxFilterString = /** @class */ (function (_super) {
|
|
61736
61978
|
TagboxFilterString.prototype.updateDomElement = function () {
|
61737
61979
|
if (!!this.inputElement) {
|
61738
61980
|
var control = this.inputElement;
|
61739
|
-
var newValue = this.model.
|
61981
|
+
var newValue = this.model.inputStringRendered;
|
61740
61982
|
if (!survey_core__WEBPACK_IMPORTED_MODULE_1__["Helpers"].isTwoValueEquals(newValue, control.value)) {
|
61741
|
-
control.value = this.model.
|
61983
|
+
control.value = this.model.inputStringRendered;
|
61742
61984
|
}
|
61743
61985
|
}
|
61744
61986
|
};
|
61745
61987
|
TagboxFilterString.prototype.onChange = function (e) {
|
61746
61988
|
if (e.target === document.activeElement) {
|
61747
|
-
this.model.
|
61989
|
+
this.model.inputStringRendered = e.target.value;
|
61748
61990
|
}
|
61749
61991
|
};
|
61750
61992
|
TagboxFilterString.prototype.keyhandler = function (e) {
|
@@ -61753,12 +61995,15 @@ var TagboxFilterString = /** @class */ (function (_super) {
|
|
61753
61995
|
TagboxFilterString.prototype.onBlur = function (e) {
|
61754
61996
|
this.model.onBlur(e);
|
61755
61997
|
};
|
61998
|
+
TagboxFilterString.prototype.onFocus = function (e) {
|
61999
|
+
this.model.onFocus(e);
|
62000
|
+
};
|
61756
62001
|
TagboxFilterString.prototype.getStateElement = function () {
|
61757
62002
|
return this.model;
|
61758
62003
|
};
|
61759
62004
|
TagboxFilterString.prototype.render = function () {
|
61760
62005
|
var _this = this;
|
61761
|
-
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("input", { type: "text", autoComplete: "off", id: this.question.getInputId(), inputMode: this.model.inputMode, ref: function (element) { return (_this.inputElement = element); }, className: this.question.cssClasses.filterStringInput, disabled: this.question.isInputReadOnly, readOnly: !this.model.searchEnabled ? true : undefined, size: !this.model.
|
62006
|
+
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("input", { type: "text", autoComplete: "off", id: this.question.getInputId(), inputMode: this.model.inputMode, ref: function (element) { return (_this.inputElement = element); }, className: this.question.cssClasses.filterStringInput, disabled: this.question.isInputReadOnly, readOnly: !this.model.searchEnabled ? true : undefined, size: !this.model.inputStringRendered ? 1 : undefined, role: this.model.filterStringEnabled ? this.question.ariaRole : undefined, "aria-label": this.question.placeholder, placeholder: this.model.filterStringPlaceholder, onKeyDown: function (e) { _this.keyhandler(e); }, onChange: function (e) { _this.onChange(e); }, onBlur: function (e) { _this.onBlur(e); }, onFocus: function (e) { _this.onFocus(e); } }));
|
61762
62007
|
};
|
61763
62008
|
return TagboxFilterString;
|
61764
62009
|
}(_reactquestion_element__WEBPACK_IMPORTED_MODULE_3__["SurveyElementBase"]));
|
@@ -62397,6 +62642,7 @@ var modernThemeColors = {
|
|
62397
62642
|
"$clean-button-color": "#1948b3",
|
62398
62643
|
"$body-background-color": "#ffffff",
|
62399
62644
|
"$foreground-light": "#909090",
|
62645
|
+
"$font-family": "Raleway",
|
62400
62646
|
};
|
62401
62647
|
var defaultThemeColors = {
|
62402
62648
|
"$header-background-color": "#e7e7e7",
|
@@ -62746,6 +62992,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
62746
62992
|
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./helpers */ "./src/helpers.ts");
|
62747
62993
|
/* harmony import */ var _settings__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./settings */ "./src/settings.ts");
|
62748
62994
|
/* harmony import */ var _actions_container__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./actions/container */ "./src/actions/container.ts");
|
62995
|
+
/* harmony import */ var _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./utils/cssClassBuilder */ "./src/utils/cssClassBuilder.ts");
|
62749
62996
|
var __extends = (undefined && undefined.__extends) || (function () {
|
62750
62997
|
var extendStatics = function (d, b) {
|
62751
62998
|
extendStatics = Object.setPrototypeOf ||
|
@@ -62773,6 +63020,7 @@ var __decorate = (undefined && undefined.__decorate) || function (decorators, ta
|
|
62773
63020
|
|
62774
63021
|
|
62775
63022
|
|
63023
|
+
|
62776
63024
|
/**
|
62777
63025
|
* A base class for the [`SurveyElement`](https://surveyjs.io/form-library/documentation/surveyelement) and [`SurveyModel`](https://surveyjs.io/form-library/documentation/surveymodel) classes.
|
62778
63026
|
*/
|
@@ -63885,6 +64133,18 @@ var SurveyElement = /** @class */ (function (_super) {
|
|
63885
64133
|
this.toggleState();
|
63886
64134
|
}
|
63887
64135
|
};
|
64136
|
+
SurveyElement.prototype.getCssTitle = function (cssClasses) {
|
64137
|
+
var isExpandable = this.state !== "default";
|
64138
|
+
var numInlineLimit = 4;
|
64139
|
+
return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_6__["CssClassBuilder"]()
|
64140
|
+
.append(cssClasses.title)
|
64141
|
+
.append(cssClasses.titleNumInline, (this.no || "").length > numInlineLimit || isExpandable)
|
64142
|
+
.append(cssClasses.titleExpandable, isExpandable)
|
64143
|
+
.append(cssClasses.titleExpanded, this.isExpanded)
|
64144
|
+
.append(cssClasses.titleCollapsed, this.isCollapsed)
|
64145
|
+
.append(cssClasses.titleDisabled, this.isReadOnly)
|
64146
|
+
.append(cssClasses.titleOnError, this.containsErrors).toString();
|
64147
|
+
};
|
63888
64148
|
SurveyElement.prototype.localeChanged = function () {
|
63889
64149
|
_super.prototype.localeChanged.call(this);
|
63890
64150
|
this.updateDescriptionVisibility(this.description);
|
@@ -67436,7 +67696,7 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
67436
67696
|
}
|
67437
67697
|
};
|
67438
67698
|
SurveyModel.prototype.notify = function (message, type) {
|
67439
|
-
this.notifier.notify(message, type);
|
67699
|
+
this.notifier.notify(message, type, type === "error");
|
67440
67700
|
};
|
67441
67701
|
/**
|
67442
67702
|
* Clears the survey data and state. If the survey has a `completed` state, it will get a `running` state.
|
@@ -71021,11 +71281,12 @@ var SurveyModel = /** @class */ (function (_super) {
|
|
71021
71281
|
};
|
71022
71282
|
Object.defineProperty(SurveyModel.prototype, "timeSpent", {
|
71023
71283
|
/**
|
71024
|
-
*
|
71284
|
+
* Gets or set the time in seconds an end user spends on the survey.
|
71025
71285
|
* @see startTimer
|
71026
71286
|
* @see PageModel.timeSpent
|
71027
71287
|
*/
|
71028
71288
|
get: function () { return this.timerModel.spent; },
|
71289
|
+
set: function (val) { this.timerModel.spent = val; },
|
71029
71290
|
enumerable: false,
|
71030
71291
|
configurable: true
|
71031
71292
|
});
|