survey-react-ui 1.11.3 → 1.11.5
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/package.json +2 -2
- package/survey-react-ui.js +43 -20
- package/survey-react-ui.js.map +1 -1
- package/survey-react-ui.min.js +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "survey-react-ui",
|
|
3
|
-
"version": "1.11.
|
|
3
|
+
"version": "1.11.5",
|
|
4
4
|
"description": "survey.js is a JavaScript Survey Library. It is a modern way to add a survey to your website. It uses JSON for survey metadata and results.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Survey",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
},
|
|
22
22
|
"typings": "survey-react-ui.d.ts",
|
|
23
23
|
"peerDependencies": {
|
|
24
|
-
"survey-core": "1.11.
|
|
24
|
+
"survey-core": "1.11.5",
|
|
25
25
|
"react": "^16.5.0 || ^17.0.1 || ^18.2.0",
|
|
26
26
|
"react-dom": "^16.5.0 || ^17.0.1 || ^18.2.0"
|
|
27
27
|
}
|
package/survey-react-ui.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* surveyjs - Survey JavaScript library v1.11.
|
|
2
|
+
* surveyjs - Survey JavaScript library v1.11.5
|
|
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
|
*/
|
|
@@ -328,6 +328,13 @@ var BaseAction = /** @class */ (function (_super) {
|
|
|
328
328
|
enumerable: false,
|
|
329
329
|
configurable: true
|
|
330
330
|
});
|
|
331
|
+
Object.defineProperty(BaseAction.prototype, "hasSubItems", {
|
|
332
|
+
get: function () {
|
|
333
|
+
return !!this.items && this.items.length > 0;
|
|
334
|
+
},
|
|
335
|
+
enumerable: false,
|
|
336
|
+
configurable: true
|
|
337
|
+
});
|
|
331
338
|
BaseAction.prototype.getActionBarItemTitleCss = function () {
|
|
332
339
|
return new _utils_cssClassBuilder__WEBPACK_IMPORTED_MODULE_5__["CssClassBuilder"]()
|
|
333
340
|
.append(this.cssClasses.itemTitle)
|
|
@@ -514,11 +521,13 @@ var Action = /** @class */ (function (_super) {
|
|
|
514
521
|
Action.prototype.createLocTitle = function () {
|
|
515
522
|
return this.createLocalizableString("title", this, true);
|
|
516
523
|
};
|
|
517
|
-
Action.prototype.
|
|
524
|
+
Action.prototype.setSubItems = function (options) {
|
|
518
525
|
this.markerIconName = "icon-next_16x16";
|
|
519
526
|
this.component = "sv-list-item-group";
|
|
520
|
-
this.items = __spreadArray([], items);
|
|
521
|
-
var
|
|
527
|
+
this.items = __spreadArray([], options.items);
|
|
528
|
+
var listOptions = Object.assign({}, options);
|
|
529
|
+
listOptions.searchEnabled = false;
|
|
530
|
+
var popupModel = createPopupModelWithListModel(listOptions, { horizontalPosition: "right", showPointer: false, canShrink: false });
|
|
522
531
|
popupModel.cssClass = "sv-popup-inner";
|
|
523
532
|
this.popupModel = popupModel;
|
|
524
533
|
};
|
|
@@ -1069,9 +1078,6 @@ var ActionContainer = /** @class */ (function (_super) {
|
|
|
1069
1078
|
itemValue.showPopupDelayed(_this.subItemsShowDelay);
|
|
1070
1079
|
_this.popupAfterShowCallback(itemValue);
|
|
1071
1080
|
}
|
|
1072
|
-
else if (!!action.popupModel && action.popupModel.isVisible) {
|
|
1073
|
-
action.hidePopupDelayed(_this.subItemsHideDelay);
|
|
1074
|
-
}
|
|
1075
1081
|
});
|
|
1076
1082
|
};
|
|
1077
1083
|
ActionContainer.prototype.initResponsivityManager = function (container, delayedUpdateFunction) {
|
|
@@ -2344,7 +2350,8 @@ var Base = /** @class */ (function () {
|
|
|
2344
2350
|
configurable: true
|
|
2345
2351
|
});
|
|
2346
2352
|
Base.prototype.afterRerender = function () {
|
|
2347
|
-
|
|
2353
|
+
var _a;
|
|
2354
|
+
(_a = this.onElementRerendered) === null || _a === void 0 ? void 0 : _a.fire(this, undefined);
|
|
2348
2355
|
};
|
|
2349
2356
|
Base.currentDependencis = undefined;
|
|
2350
2357
|
return Base;
|
|
@@ -3776,7 +3783,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
3776
3783
|
|
|
3777
3784
|
|
|
3778
3785
|
|
|
3779
|
-
Object(survey_core__WEBPACK_IMPORTED_MODULE_2__["checkLibraryVersion"])("" + "1.11.
|
|
3786
|
+
Object(survey_core__WEBPACK_IMPORTED_MODULE_2__["checkLibraryVersion"])("" + "1.11.5", "survey-react-ui");
|
|
3780
3787
|
|
|
3781
3788
|
|
|
3782
3789
|
/***/ }),
|
|
@@ -8074,6 +8081,11 @@ var DomWindowHelper = /** @class */ (function () {
|
|
|
8074
8081
|
return;
|
|
8075
8082
|
window.removeEventListener(type, listener);
|
|
8076
8083
|
};
|
|
8084
|
+
DomWindowHelper.matchMedia = function (mediaQueryString) {
|
|
8085
|
+
if (!DomWindowHelper.isAvailable() || typeof window.matchMedia === "undefined")
|
|
8086
|
+
return null;
|
|
8087
|
+
return window.matchMedia(mediaQueryString);
|
|
8088
|
+
};
|
|
8077
8089
|
return DomWindowHelper;
|
|
8078
8090
|
}());
|
|
8079
8091
|
|
|
@@ -10711,6 +10723,7 @@ var defaultListCss = {
|
|
|
10711
10723
|
searchClearButtonIcon: "sv-list__filter-clear-button",
|
|
10712
10724
|
loadingIndicator: "sv-list__loading-indicator",
|
|
10713
10725
|
itemSelected: "sv-list__item--selected",
|
|
10726
|
+
itemGroup: "sv-list__item--group",
|
|
10714
10727
|
itemWithIcon: "sv-list__item--with-icon",
|
|
10715
10728
|
itemDisabled: "sv-list__item--disabled",
|
|
10716
10729
|
itemFocused: "sv-list__item--focused",
|
|
@@ -10776,6 +10789,7 @@ var ListModel = /** @class */ (function (_super) {
|
|
|
10776
10789
|
.append(_this.cssClasses.itemDisabled, _this.isItemDisabled(itemValue))
|
|
10777
10790
|
.append(_this.cssClasses.itemFocused, _this.isItemFocused(itemValue))
|
|
10778
10791
|
.append(_this.cssClasses.itemSelected, _this.isItemSelected(itemValue))
|
|
10792
|
+
.append(_this.cssClasses.itemGroup, itemValue.hasSubItems)
|
|
10779
10793
|
.append(_this.cssClasses.itemHovered, itemValue.isHovered)
|
|
10780
10794
|
.append(_this.cssClasses.itemTextWrap, _this.textWrapEnabled)
|
|
10781
10795
|
.append(itemValue.css)
|
|
@@ -12315,7 +12329,7 @@ var SurveyQuestionBoolean = /** @class */ (function (_super) {
|
|
|
12315
12329
|
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: cssClasses.sliderGhost, onClick: function (event) { return _this.handleOnLabelClick(event, _this.question.swapOrder); } },
|
|
12316
12330
|
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", { className: this.question.getLabelCss(this.question.swapOrder) }, this.renderLocString(this.question.locLabelLeft))),
|
|
12317
12331
|
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: cssClasses.switch, onClick: this.handleOnSwitchClick },
|
|
12318
|
-
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", { className: cssClasses.slider
|
|
12332
|
+
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", { className: cssClasses.slider }, this.question.isDeterminated && cssClasses.sliderText ?
|
|
12319
12333
|
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", { className: cssClasses.sliderText }, this.renderLocString(this.question.getCheckedLabel()))
|
|
12320
12334
|
: null)),
|
|
12321
12335
|
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: cssClasses.sliderGhost, onClick: function (event) { return _this.handleOnLabelClick(event, !_this.question.swapOrder); } },
|
|
@@ -12830,7 +12844,7 @@ var ComponentsContainer = /** @class */ (function (_super) {
|
|
|
12830
12844
|
return _element_factory__WEBPACK_IMPORTED_MODULE_1__["ReactElementFactory"].Instance.createElement(component.component, { survey: _this.props.survey, model: component.data, container: _this.props.container, key: component.id });
|
|
12831
12845
|
}));
|
|
12832
12846
|
}
|
|
12833
|
-
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { className: "sv-components-column" }, components.map(function (component) {
|
|
12847
|
+
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { className: "sv-components-column" + " sv-components-container-" + this.props.container }, components.map(function (component) {
|
|
12834
12848
|
return _element_factory__WEBPACK_IMPORTED_MODULE_1__["ReactElementFactory"].Instance.createElement(component.component, { survey: _this.props.survey, model: component.data, container: _this.props.container, key: component.id });
|
|
12835
12849
|
}));
|
|
12836
12850
|
};
|
|
@@ -14810,7 +14824,7 @@ var RatingItem = /** @class */ (function (_super) {
|
|
|
14810
14824
|
var itemText = this.renderLocString(this.item.locText);
|
|
14811
14825
|
return (react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("label", { onMouseDown: this.handleOnMouseDown, className: this.question.getItemClassByText(this.item.itemValue, this.item.text) },
|
|
14812
14826
|
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("input", { type: "radio", className: "sv-visuallyhidden", name: this.question.questionName, id: this.question.getInputId(this.index), value: this.item.value, disabled: this.question.isDisabledAttr, readOnly: this.question.isReadOnlyAttr, 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-errormessage": this.question.ariaErrormessage }),
|
|
14813
|
-
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", { className: this.question.cssClasses.itemText }, itemText)));
|
|
14827
|
+
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("span", { className: this.question.cssClasses.itemText, "data-text": this.item.text }, itemText)));
|
|
14814
14828
|
};
|
|
14815
14829
|
RatingItem.prototype.componentDidMount = function () {
|
|
14816
14830
|
_super.prototype.componentDidMount.call(this);
|
|
@@ -17562,7 +17576,7 @@ var Survey = /** @class */ (function (_super) {
|
|
|
17562
17576
|
}
|
|
17563
17577
|
var rootCss = this.survey.getRootCss();
|
|
17564
17578
|
var cssClasses = this.rootNodeClassName ? this.rootNodeClassName + " " + rootCss : rootCss;
|
|
17565
|
-
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { id: this.rootNodeId, ref: this.rootRef, className: cssClasses, style: this.survey.themeVariables },
|
|
17579
|
+
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { id: this.rootNodeId, ref: this.rootRef, className: cssClasses, style: this.survey.themeVariables, lang: this.survey.locale || "en", dir: this.survey.localeDir },
|
|
17566
17580
|
this.survey.needRenderIcons ? react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_svgbundle__WEBPACK_IMPORTED_MODULE_10__["SvgBundleComponent"], null) : null,
|
|
17567
17581
|
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.survey.wrapperFormCss },
|
|
17568
17582
|
backgroundImage,
|
|
@@ -18599,7 +18613,7 @@ var SurveyQuestionCheckboxItem = /** @class */ (function (_super) {
|
|
|
18599
18613
|
var itemLabel = !this.hideCaption ? react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", { className: this.cssClasses.controlLabel }, this.renderLocString(this.item.locText, this.textStyle)) : null;
|
|
18600
18614
|
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: itemClass, role: "presentation" },
|
|
18601
18615
|
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("label", { className: labelClass },
|
|
18602
|
-
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("input", { className: this.cssClasses.itemControl, type: "checkbox",
|
|
18616
|
+
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("input", { className: this.cssClasses.itemControl, type: "checkbox", name: this.question.name + this.item.id, value: this.item.value, id: id, style: this.inputStyle, disabled: !this.question.getItemEnabled(this.item), readOnly: this.question.isReadOnlyAttr, checked: isChecked, onChange: this.handleOnChange, required: this.question.hasRequiredError() }),
|
|
18603
18617
|
this.cssClasses.materialDecorator ?
|
|
18604
18618
|
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", { className: this.cssClasses.materialDecorator }, this.question.itemSvgIcon ?
|
|
18605
18619
|
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("svg", { className: this.cssClasses.itemDecorator },
|
|
@@ -18749,7 +18763,7 @@ var SurveyQuestionCommentItem = /** @class */ (function (_super) {
|
|
|
18749
18763
|
var comment = this.getComment() || "";
|
|
18750
18764
|
return react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", null, comment);
|
|
18751
18765
|
}
|
|
18752
|
-
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("textarea", { id: this.getId(), className: className, ref: function (textarea) { return (_this.setControl(textarea)); }, disabled: this.isDisplayMode, maxLength: question.getOthersMaxLength(), placeholder: this.getPlaceholder(), onBlur: function (e) { _this.onCommentChange(e); }, onInput: function (e) { return _this.onCommentInput(e); }, "aria-required": question.isRequired || question.a11y_input_ariaRequired, "aria-label": question.ariaLabel || question.a11y_input_ariaLabel, style: { resize: question.resizeStyle } }));
|
|
18766
|
+
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("textarea", { id: this.getId(), className: className, ref: function (textarea) { return (_this.setControl(textarea)); }, disabled: this.isDisplayMode, maxLength: question.getOthersMaxLength(), rows: question.commentAreaRows, placeholder: this.getPlaceholder(), onBlur: function (e) { _this.onCommentChange(e); }, onInput: function (e) { return _this.onCommentInput(e); }, "aria-required": question.isRequired || question.a11y_input_ariaRequired, "aria-label": question.ariaLabel || question.a11y_input_ariaLabel, style: { resize: question.resizeStyle } }));
|
|
18753
18767
|
};
|
|
18754
18768
|
return SurveyQuestionCommentItem;
|
|
18755
18769
|
}(_reactquestion_element__WEBPACK_IMPORTED_MODULE_1__["ReactSurveyElement"]));
|
|
@@ -21350,7 +21364,7 @@ var SurveyQuestionRankingItem = /** @class */ (function (_super) {
|
|
|
21350
21364
|
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("use", { xlinkHref: this.question.dashSvgIcon })));
|
|
21351
21365
|
};
|
|
21352
21366
|
SurveyQuestionRankingItem.prototype.renderElement = function () {
|
|
21353
|
-
var
|
|
21367
|
+
var itemContent = _element_factory__WEBPACK_IMPORTED_MODULE_4__["ReactElementFactory"].Instance.createElement(this.question.itemComponent, { item: this.item, cssClasses: this.cssClasses });
|
|
21354
21368
|
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { tabIndex: this.itemTabIndex, className: this.itemClass, onKeyDown: this.handleKeydown, onPointerDown: this.handlePointerDown, onPointerUp: this.handlePointerUp, "data-sv-drop-target-ranking-item": this.index },
|
|
21355
21369
|
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { tabIndex: -1, style: { outline: "none" } },
|
|
21356
21370
|
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.cssClasses.itemGhostNode }),
|
|
@@ -21361,7 +21375,7 @@ var SurveyQuestionRankingItem = /** @class */ (function (_super) {
|
|
|
21361
21375
|
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("svg", { className: this.question.getIconFocusCss() },
|
|
21362
21376
|
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("use", { xlinkHref: this.question.arrowsSvgIcon }))),
|
|
21363
21377
|
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.question.getItemIndexClasses(this.item) }, (!this.unrankedItem && this.indexText) ? this.indexText : this.renderEmptyIcon()),
|
|
21364
|
-
|
|
21378
|
+
itemContent))));
|
|
21365
21379
|
};
|
|
21366
21380
|
return SurveyQuestionRankingItem;
|
|
21367
21381
|
}(_reactquestion_element__WEBPACK_IMPORTED_MODULE_1__["ReactSurveyElement"]));
|
|
@@ -21391,7 +21405,7 @@ var SurveyQuestionRankingItemContent = /** @class */ (function (_super) {
|
|
|
21391
21405
|
return SurveyQuestionRankingItemContent;
|
|
21392
21406
|
}(_reactquestion_element__WEBPACK_IMPORTED_MODULE_1__["ReactSurveyElement"]));
|
|
21393
21407
|
|
|
21394
|
-
_element_factory__WEBPACK_IMPORTED_MODULE_4__["ReactElementFactory"].Instance.registerElement("sv-ranking-item
|
|
21408
|
+
_element_factory__WEBPACK_IMPORTED_MODULE_4__["ReactElementFactory"].Instance.registerElement("sv-ranking-item", function (props) {
|
|
21395
21409
|
return react__WEBPACK_IMPORTED_MODULE_0__["createElement"](SurveyQuestionRankingItemContent, props);
|
|
21396
21410
|
});
|
|
21397
21411
|
_reactquestion_factory__WEBPACK_IMPORTED_MODULE_2__["ReactQuestionFactory"].Instance.registerQuestion("ranking", function (props) {
|
|
@@ -22916,11 +22930,19 @@ var settings = {
|
|
|
22916
22930
|
*/
|
|
22917
22931
|
ratingMaximumRateValueCount: 20,
|
|
22918
22932
|
/**
|
|
22919
|
-
* Specifies whether to close the drop-down menu of a [
|
|
22933
|
+
* Specifies whether to close the drop-down menu of a [Multi-Select Dropdown (Tag Box)](https://surveyjs.io/form-library/examples/how-to-create-multiselect-tag-box/) question after a user selects a value.
|
|
22920
22934
|
*
|
|
22921
|
-
* This setting applies to all
|
|
22935
|
+
* This setting applies to all Multi-Select Dropdown questions on a web page. You can use the [`closeOnSelect`](https://surveyjs.io/form-library/documentation/api-reference/dropdown-tag-box-model#closeOnSelect) property to specify the same setting for an individual Multi-Select Dropdown question.
|
|
22922
22936
|
*/
|
|
22923
22937
|
tagboxCloseOnSelect: false,
|
|
22938
|
+
/**
|
|
22939
|
+
* A time interval in milliseconds between the last entered character and the beginning of search in [Single-](https://surveyjs.io/form-library/examples/create-dropdown-menu-in-javascript/) and [Multi-Select Dropdown](https://surveyjs.io/form-library/examples/how-to-create-multiselect-tag-box/) questions. Applies only to questions with the [`choicesLazyLoadEnabled`](https://surveyjs.io/form-library/documentation/api-reference/dropdown-menu-model#choicesLazyLoadEnabled) property set to `true`.
|
|
22940
|
+
*
|
|
22941
|
+
* Default value: 500
|
|
22942
|
+
*
|
|
22943
|
+
* [View Demo](https://surveyjs.io/form-library/examples/lazy-loading-dropdown/ (linkStyle))
|
|
22944
|
+
*/
|
|
22945
|
+
dropdownSearchDelay: 500,
|
|
22924
22946
|
/**
|
|
22925
22947
|
* A function that activates a browser confirm dialog.
|
|
22926
22948
|
*
|
|
@@ -24734,6 +24756,7 @@ var surveyLocalization = {
|
|
|
24734
24756
|
defaultLocaleValue: "en",
|
|
24735
24757
|
locales: {},
|
|
24736
24758
|
localeNames: {},
|
|
24759
|
+
localeDirections: {},
|
|
24737
24760
|
supportedLocales: [],
|
|
24738
24761
|
get currentLocale() {
|
|
24739
24762
|
return this.currentLocaleValue === this.defaultLocaleValue ? "" : this.currentLocaleValue;
|