survey-react-ui 1.9.116 → 1.9.118
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/README.md +4 -0
- package/package.json +2 -2
- package/survey-react-ui.js +115 -39
- package/survey-react-ui.js.map +1 -1
- package/survey-react-ui.min.js +2 -2
- package/typings/react/reactquestion_comment.d.ts +4 -0
package/README.md
CHANGED
|
@@ -38,6 +38,10 @@ To get started with SurveyJS React Form Library, refer to the following tutorial
|
|
|
38
38
|
- [Live Examples](https://surveyjs.io/form-library/examples/nps-question/reactjs)
|
|
39
39
|
- [What's New](https://surveyjs.io/WhatsNew)
|
|
40
40
|
|
|
41
|
+
## Build SurveyJS React Form Library from Sources
|
|
42
|
+
|
|
43
|
+
Refer to instructions in the root README file: [Build the SurveyJS Form Library from Sources](https://github.com/surveyjs/survey-library#build-the-surveyjs-form-library-from-sources).
|
|
44
|
+
|
|
41
45
|
## Licensing
|
|
42
46
|
|
|
43
47
|
SurveyJS Form Library is distributed under the [MIT license](https://github.com/surveyjs/survey-library/blob/master/LICENSE).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "survey-react-ui",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.118",
|
|
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
|
"dependencies": {
|
|
24
|
-
"survey-core": "1.9.
|
|
24
|
+
"survey-core": "1.9.118",
|
|
25
25
|
"react": "^16.5.0 || ^17.0.1 || ^18.1.0",
|
|
26
26
|
"react-dom": "^16.5.0 || ^17.0.1 || ^18.1.0"
|
|
27
27
|
}
|
package/survey-react-ui.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* surveyjs - Survey JavaScript library v1.9.
|
|
2
|
+
* surveyjs - Survey JavaScript library v1.9.118
|
|
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
|
*/
|
|
@@ -1932,6 +1932,10 @@ var ConsoleWarnings = /** @class */ (function () {
|
|
|
1932
1932
|
// eslint-disable-next-line no-console
|
|
1933
1933
|
console.warn(text);
|
|
1934
1934
|
};
|
|
1935
|
+
ConsoleWarnings.error = function (text) {
|
|
1936
|
+
// eslint-disable-next-line no-console
|
|
1937
|
+
console.error(text);
|
|
1938
|
+
};
|
|
1935
1939
|
return ConsoleWarnings;
|
|
1936
1940
|
}());
|
|
1937
1941
|
|
|
@@ -2560,7 +2564,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
2560
2564
|
|
|
2561
2565
|
|
|
2562
2566
|
|
|
2563
|
-
Object(survey_core__WEBPACK_IMPORTED_MODULE_2__["checkLibraryVersion"])("" + "1.9.
|
|
2567
|
+
Object(survey_core__WEBPACK_IMPORTED_MODULE_2__["checkLibraryVersion"])("" + "1.9.118", "survey-react-ui");
|
|
2564
2568
|
|
|
2565
2569
|
|
|
2566
2570
|
/***/ }),
|
|
@@ -6253,8 +6257,8 @@ var OperandMaker = /** @class */ (function () {
|
|
|
6253
6257
|
right = OperandMaker.convertValForDateCompare(right, left);
|
|
6254
6258
|
return OperandMaker.isTwoValueEquals(left, right, strictCompare !== true);
|
|
6255
6259
|
},
|
|
6256
|
-
notequal: function (left, right) {
|
|
6257
|
-
return !OperandMaker.binaryFunctions.equal(left, right);
|
|
6260
|
+
notequal: function (left, right, strictCompare) {
|
|
6261
|
+
return !OperandMaker.binaryFunctions.equal(left, right, strictCompare);
|
|
6258
6262
|
},
|
|
6259
6263
|
contains: function (left, right) {
|
|
6260
6264
|
return OperandMaker.binaryFunctions.containsCore(left, right, true);
|
|
@@ -7296,6 +7300,10 @@ function property(options) {
|
|
|
7296
7300
|
if (!options || !options.localizable) {
|
|
7297
7301
|
Object.defineProperty(target, key, {
|
|
7298
7302
|
get: function () {
|
|
7303
|
+
// const serializationProperty = Serializer.getProperty(target.getType(), key);
|
|
7304
|
+
// if(!!serializationProperty && options.defaultValue !== undefined) {
|
|
7305
|
+
// ConsoleWarnings.error("remove defaultValue from @property for class " + target.getType() + " property name is " + key);
|
|
7306
|
+
// }
|
|
7299
7307
|
var defaultVal = null;
|
|
7300
7308
|
if (!!options) {
|
|
7301
7309
|
if (typeof options.getDefaultValue === "function") {
|
|
@@ -7502,6 +7510,11 @@ var JsonObjectProperty = /** @class */ (function () {
|
|
|
7502
7510
|
return ((value === false && (this.type == "boolean" || this.type == "switch")) ||
|
|
7503
7511
|
value === "" || _helpers__WEBPACK_IMPORTED_MODULE_2__["Helpers"].isValueEmpty(value));
|
|
7504
7512
|
};
|
|
7513
|
+
JsonObjectProperty.prototype.getSerializableValue = function (obj) {
|
|
7514
|
+
if (!!this.onSerializeValue)
|
|
7515
|
+
return this.onSerializeValue(obj);
|
|
7516
|
+
return this.getValue(obj);
|
|
7517
|
+
};
|
|
7505
7518
|
JsonObjectProperty.prototype.getValue = function (obj) {
|
|
7506
7519
|
if (this.onGetValue)
|
|
7507
7520
|
return this.onGetValue(obj);
|
|
@@ -8093,6 +8106,9 @@ var JsonMetadataClass = /** @class */ (function () {
|
|
|
8093
8106
|
if (!!propInfo.baseValue) {
|
|
8094
8107
|
prop.setBaseValue(propInfo.baseValue);
|
|
8095
8108
|
}
|
|
8109
|
+
if (propInfo.onSerializeValue) {
|
|
8110
|
+
prop.onSerializeValue = propInfo.onSerializeValue;
|
|
8111
|
+
}
|
|
8096
8112
|
if (propInfo.onGetValue) {
|
|
8097
8113
|
prop.onGetValue = propInfo.onGetValue;
|
|
8098
8114
|
}
|
|
@@ -8887,7 +8903,7 @@ var JsonObject = /** @class */ (function () {
|
|
|
8887
8903
|
if (property.isSerializable === false ||
|
|
8888
8904
|
(property.isLightSerializable === false && this.lightSerializing))
|
|
8889
8905
|
return;
|
|
8890
|
-
var value = property.
|
|
8906
|
+
var value = property.getSerializableValue(obj);
|
|
8891
8907
|
if (!storeDefaults && property.isDefaultValueByObj(obj, value))
|
|
8892
8908
|
return;
|
|
8893
8909
|
if (this.isValueArray(value)) {
|
|
@@ -9297,9 +9313,6 @@ var LocalizableString = /** @class */ (function () {
|
|
|
9297
9313
|
};
|
|
9298
9314
|
LocalizableString.prototype.isLocaleTextEqualsWithDefault = function (loc, val) {
|
|
9299
9315
|
var res = this.getLocaleTextCore(loc);
|
|
9300
|
-
if (!res && this.onGetDefaultTextCallback) {
|
|
9301
|
-
res = this.onGetDefaultTextCallback();
|
|
9302
|
-
}
|
|
9303
9316
|
if (res === val)
|
|
9304
9317
|
return true;
|
|
9305
9318
|
return this.isValueEmpty(res) && this.isValueEmpty(val);
|
|
@@ -9731,8 +9744,8 @@ var englishStrings = {
|
|
|
9731
9744
|
textMaxLength: "Please enter no more than {0} character(s).",
|
|
9732
9745
|
textMinMaxLength: "Please enter at least {0} and no more than {1} characters.",
|
|
9733
9746
|
minRowCountError: "Please fill in at least {0} row(s).",
|
|
9734
|
-
minSelectError: "Please select at least {0}
|
|
9735
|
-
maxSelectError: "Please select no more than {0}
|
|
9747
|
+
minSelectError: "Please select at least {0} option(s).",
|
|
9748
|
+
maxSelectError: "Please select no more than {0} option(s).",
|
|
9736
9749
|
numericMinMax: "The '{0}' should be at least {1} and at most {2}",
|
|
9737
9750
|
numericMin: "The '{0}' should be at least {1}",
|
|
9738
9751
|
numericMax: "The '{0}' should be at most {1}",
|
|
@@ -12580,7 +12593,7 @@ var SvgIcon = /** @class */ (function (_super) {
|
|
|
12580
12593
|
className += " " + this.props.className;
|
|
12581
12594
|
}
|
|
12582
12595
|
return (this.props.iconName ?
|
|
12583
|
-
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("svg", { className: className, style: this.props.style, onClick: this.props.onClick, ref: this.svgIconRef, role: "img"
|
|
12596
|
+
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("svg", { className: className, style: this.props.style, onClick: this.props.onClick, ref: this.svgIconRef, role: "img" },
|
|
12584
12597
|
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("use", null))
|
|
12585
12598
|
: null);
|
|
12586
12599
|
};
|
|
@@ -13049,7 +13062,7 @@ var SurveyQuestionDropdownBase = /** @class */ (function (_super) {
|
|
|
13049
13062
|
dropdownListModel.inputStringRendered = e.target.value;
|
|
13050
13063
|
}
|
|
13051
13064
|
};
|
|
13052
|
-
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { id: this.question.inputId, className: this.question.getControlClass(), tabIndex: dropdownListModel.
|
|
13065
|
+
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { id: this.question.inputId, className: this.question.getControlClass(), tabIndex: dropdownListModel.noTabIndex ? undefined : 0,
|
|
13053
13066
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
13054
13067
|
// @ts-ignore
|
|
13055
13068
|
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, "aria-expanded": this.question.ariaExpanded === null ? undefined : this.question.ariaExpanded === "true", "aria-controls": dropdownListModel.listElementId, "aria-activedescendant": dropdownListModel.ariaActivedescendant },
|
|
@@ -13062,20 +13075,20 @@ var SurveyQuestionDropdownBase = /** @class */ (function (_super) {
|
|
|
13062
13075
|
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", { style: { visibility: "hidden" }, "data-bind": "text: model.filterString" }, dropdownListModel.inputStringRendered),
|
|
13063
13076
|
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", null, dropdownListModel.hintStringSuffix))) : null,
|
|
13064
13077
|
valueElement,
|
|
13065
|
-
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-expanded": this.question.ariaExpanded === null ? undefined : this.question.ariaExpanded === "true", "aria-label": this.question.a11y_input_ariaLabel, "aria-labelledby": this.question.a11y_input_ariaLabelledBy, "aria-controls": dropdownListModel.listElementId, "aria-activedescendant": dropdownListModel.ariaActivedescendant, placeholder: dropdownListModel.placeholderRendered, readOnly:
|
|
13078
|
+
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-expanded": this.question.ariaExpanded === null ? undefined : this.question.ariaExpanded === "true", "aria-label": this.question.a11y_input_ariaLabel, "aria-labelledby": this.question.a11y_input_ariaLabelledBy, "aria-controls": dropdownListModel.listElementId, "aria-activedescendant": dropdownListModel.ariaActivedescendant, placeholder: dropdownListModel.placeholderRendered, readOnly: dropdownListModel.filterReadOnly ? true : undefined, tabIndex: dropdownListModel.noTabIndex ? undefined : -1, disabled: this.question.isInputReadOnly, inputMode: dropdownListModel.inputMode, onChange: function (e) { onInputChange(e); }, onBlur: this.blur, onFocus: this.focus })),
|
|
13066
13079
|
this.createClearButton()));
|
|
13067
13080
|
};
|
|
13068
13081
|
SurveyQuestionDropdownBase.prototype.createClearButton = function () {
|
|
13069
13082
|
if (!this.question.allowClear || !this.question.cssClasses.cleanButtonIconId)
|
|
13070
13083
|
return null;
|
|
13071
13084
|
var style = { display: !this.question.showClearButton ? "none" : "" };
|
|
13072
|
-
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.question.cssClasses.cleanButton, style: style, onClick: this.clear },
|
|
13085
|
+
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.question.cssClasses.cleanButton, style: style, onClick: this.clear, tabIndex: this.question.showClearButton ? 0 : -1 },
|
|
13073
13086
|
react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_components_svg_icon_svg_icon__WEBPACK_IMPORTED_MODULE_3__["SvgIcon"], { className: this.question.cssClasses.cleanButtonSvg, iconName: this.question.cssClasses.cleanButtonIconId, title: this.question.clearCaption, size: "auto" })));
|
|
13074
13087
|
};
|
|
13075
13088
|
SurveyQuestionDropdownBase.prototype.createChevronButton = function () {
|
|
13076
13089
|
if (!this.question.cssClasses.chevronButtonIconId)
|
|
13077
13090
|
return null;
|
|
13078
|
-
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.question.cssClasses.chevronButton, onPointerDown: this.chevronPointerDown },
|
|
13091
|
+
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.question.cssClasses.chevronButton, "aria-hidden": "true", onPointerDown: this.chevronPointerDown },
|
|
13079
13092
|
react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_components_svg_icon_svg_icon__WEBPACK_IMPORTED_MODULE_3__["SvgIcon"], { className: this.question.cssClasses.chevronButtonSvg, iconName: this.question.cssClasses.chevronButtonIconId, size: "auto" })));
|
|
13080
13093
|
};
|
|
13081
13094
|
SurveyQuestionDropdownBase.prototype.renderOther = function (cssClasses) {
|
|
@@ -15994,8 +16007,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
15994
16007
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
15995
16008
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
15996
16009
|
/* harmony import */ var _reactquestion_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./reactquestion_element */ "./src/react/reactquestion_element.tsx");
|
|
15997
|
-
/* harmony import */ var
|
|
15998
|
-
/* harmony import */ var
|
|
16010
|
+
/* harmony import */ var survey_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! survey-core */ "survey-core");
|
|
16011
|
+
/* harmony import */ var survey_core__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(survey_core__WEBPACK_IMPORTED_MODULE_2__);
|
|
16012
|
+
/* harmony import */ var _reactquestion_factory__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./reactquestion_factory */ "./src/react/reactquestion_factory.tsx");
|
|
16013
|
+
/* harmony import */ var _components_character_counter__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./components/character-counter */ "./src/react/components/character-counter.tsx");
|
|
15999
16014
|
var __extends = (undefined && undefined.__extends) || (function () {
|
|
16000
16015
|
var extendStatics = function (d, b) {
|
|
16001
16016
|
extendStatics = Object.setPrototypeOf ||
|
|
@@ -16015,6 +16030,7 @@ var __extends = (undefined && undefined.__extends) || (function () {
|
|
|
16015
16030
|
|
|
16016
16031
|
|
|
16017
16032
|
|
|
16033
|
+
|
|
16018
16034
|
var SurveyQuestionComment = /** @class */ (function (_super) {
|
|
16019
16035
|
__extends(SurveyQuestionComment, _super);
|
|
16020
16036
|
function SurveyQuestionComment(props) {
|
|
@@ -16037,7 +16053,7 @@ var SurveyQuestionComment = /** @class */ (function (_super) {
|
|
|
16037
16053
|
if (this.question.isReadOnlyRenderDiv()) {
|
|
16038
16054
|
return react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", null, this.question.value);
|
|
16039
16055
|
}
|
|
16040
|
-
var counter = !!this.question.getMaxLength() ? (react__WEBPACK_IMPORTED_MODULE_0__["createElement"](
|
|
16056
|
+
var counter = !!this.question.getMaxLength() ? (react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_components_character_counter__WEBPACK_IMPORTED_MODULE_4__["CharacterCounterComponent"], { counter: this.question.characterCounter, remainingCharacterCounter: this.question.cssClasses.remainingCharacterCounter })) : null;
|
|
16041
16057
|
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"](react__WEBPACK_IMPORTED_MODULE_0__["Fragment"], null,
|
|
16042
16058
|
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("textarea", { id: this.question.inputId, className: this.question.className, disabled: this.question.isInputReadOnly, readOnly: this.question.isInputReadOnly, ref: function (textarea) { return (_this.setControl(textarea)); }, maxLength: this.question.getMaxLength(), placeholder: placeholder, onBlur: onBlur, onInput: onInput, onKeyDown: function (event) { _this.question.onKeyDown(event); }, cols: this.question.cols, rows: this.question.rows, "aria-required": this.question.a11y_input_ariaRequired, "aria-label": this.question.a11y_input_ariaLabel, "aria-labelledby": this.question.a11y_input_ariaLabelledBy, "aria-invalid": this.question.a11y_input_ariaInvalid, "aria-describedby": this.question.a11y_input_ariaDescribedBy, style: { resize: this.question.resizeStyle } }),
|
|
16043
16059
|
counter));
|
|
@@ -16047,9 +16063,19 @@ var SurveyQuestionComment = /** @class */ (function (_super) {
|
|
|
16047
16063
|
|
|
16048
16064
|
var SurveyQuestionCommentItem = /** @class */ (function (_super) {
|
|
16049
16065
|
__extends(SurveyQuestionCommentItem, _super);
|
|
16050
|
-
function SurveyQuestionCommentItem() {
|
|
16051
|
-
|
|
16066
|
+
function SurveyQuestionCommentItem(props) {
|
|
16067
|
+
var _this = _super.call(this, props) || this;
|
|
16068
|
+
_this.state = { comment: _this.getComment() || "" };
|
|
16069
|
+
return _this;
|
|
16052
16070
|
}
|
|
16071
|
+
SurveyQuestionCommentItem.prototype.getStateComment = function () {
|
|
16072
|
+
var comment = this.getComment();
|
|
16073
|
+
var stateComment = this.state.comment;
|
|
16074
|
+
if (stateComment !== undefined && stateComment.trim() !== comment) {
|
|
16075
|
+
stateComment = comment;
|
|
16076
|
+
}
|
|
16077
|
+
return stateComment !== undefined ? stateComment : comment || "";
|
|
16078
|
+
};
|
|
16053
16079
|
SurveyQuestionCommentItem.prototype.canRender = function () {
|
|
16054
16080
|
return !!this.props.question;
|
|
16055
16081
|
};
|
|
@@ -16062,6 +16088,9 @@ var SurveyQuestionCommentItem = /** @class */ (function (_super) {
|
|
|
16062
16088
|
SurveyQuestionCommentItem.prototype.getComment = function () {
|
|
16063
16089
|
return this.props.question.comment;
|
|
16064
16090
|
};
|
|
16091
|
+
SurveyQuestionCommentItem.prototype.setComment = function (value) {
|
|
16092
|
+
this.props.question.comment = value;
|
|
16093
|
+
};
|
|
16065
16094
|
SurveyQuestionCommentItem.prototype.getId = function () {
|
|
16066
16095
|
return this.props.question.commentId;
|
|
16067
16096
|
};
|
|
@@ -16074,14 +16103,12 @@ var SurveyQuestionCommentItem = /** @class */ (function (_super) {
|
|
|
16074
16103
|
var className = this.props.otherCss || this.cssClasses.comment;
|
|
16075
16104
|
var handleOnChange = function (event) {
|
|
16076
16105
|
_this.setState({ comment: event.target.value });
|
|
16077
|
-
|
|
16106
|
+
// https://github.com/surveyjs/survey-library/issues/7252
|
|
16107
|
+
if (!survey_core__WEBPACK_IMPORTED_MODULE_2__["Helpers"].isTwoValueEquals(_this.getComment(), event.target.value, false, true, false)) {
|
|
16108
|
+
_this.setComment(event.target.value);
|
|
16109
|
+
}
|
|
16078
16110
|
};
|
|
16079
|
-
var
|
|
16080
|
-
var stateComment = !!this.state ? this.state.comment : undefined;
|
|
16081
|
-
if (stateComment !== undefined && stateComment.trim() !== questionComment) {
|
|
16082
|
-
stateComment = questionComment;
|
|
16083
|
-
}
|
|
16084
|
-
var comment = stateComment !== undefined ? stateComment : questionComment || "";
|
|
16111
|
+
var comment = this.getStateComment();
|
|
16085
16112
|
if (question.isReadOnlyRenderDiv()) {
|
|
16086
16113
|
return react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", null, comment);
|
|
16087
16114
|
}
|
|
@@ -16104,6 +16131,9 @@ var SurveyQuestionOtherValueItem = /** @class */ (function (_super) {
|
|
|
16104
16131
|
SurveyQuestionOtherValueItem.prototype.getComment = function () {
|
|
16105
16132
|
return this.props.question.otherValue;
|
|
16106
16133
|
};
|
|
16134
|
+
SurveyQuestionOtherValueItem.prototype.setComment = function (value) {
|
|
16135
|
+
this.props.question.otherValue = value;
|
|
16136
|
+
};
|
|
16107
16137
|
SurveyQuestionOtherValueItem.prototype.getId = function () {
|
|
16108
16138
|
return this.props.question.otherId;
|
|
16109
16139
|
};
|
|
@@ -16113,7 +16143,7 @@ var SurveyQuestionOtherValueItem = /** @class */ (function (_super) {
|
|
|
16113
16143
|
return SurveyQuestionOtherValueItem;
|
|
16114
16144
|
}(SurveyQuestionCommentItem));
|
|
16115
16145
|
|
|
16116
|
-
|
|
16146
|
+
_reactquestion_factory__WEBPACK_IMPORTED_MODULE_3__["ReactQuestionFactory"].Instance.registerQuestion("comment", function (props) {
|
|
16117
16147
|
return react__WEBPACK_IMPORTED_MODULE_0__["createElement"](SurveyQuestionComment, props);
|
|
16118
16148
|
});
|
|
16119
16149
|
|
|
@@ -17160,7 +17190,7 @@ var SurveyQuestionMatrixRow = /** @class */ (function (_super) {
|
|
|
17160
17190
|
else {
|
|
17161
17191
|
td = (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("td", { key: key, "data-responsive-title": column.locText.renderedHtml, className: this.question.cssClasses.cell },
|
|
17162
17192
|
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("label", { onMouseDown: this.handleOnMouseDown, className: itemClass },
|
|
17163
|
-
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("input", { id: inputId, type: "radio", className: this.cssClasses.itemValue, name: row.fullName, value: column.value, disabled: this.isDisplayMode, checked: isChecked, onChange: this.handleOnChange, "aria-required": this.question.
|
|
17193
|
+
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("input", { id: inputId, type: "radio", className: this.cssClasses.itemValue, name: row.fullName, value: column.value, disabled: this.isDisplayMode, checked: isChecked, onChange: this.handleOnChange, "aria-required": this.question.a11y_input_ariaRequired, "aria-label": this.question.getCellAriaLabel(row.locText.renderedHtml, column.locText.renderedHtml), "aria-invalid": this.question.a11y_input_ariaInvalid, "aria-describedby": this.question.a11y_input_ariaDescribedBy }),
|
|
17164
17194
|
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", { className: this.question.cssClasses.materialDecorator }, this.question.itemSvgIcon ?
|
|
17165
17195
|
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("svg", { className: this.cssClasses.itemDecorator },
|
|
17166
17196
|
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("use", { xlinkHref: this.question.itemSvgIcon })) :
|
|
@@ -18709,7 +18739,7 @@ var SurveyQuestionTagbox = /** @class */ (function (_super) {
|
|
|
18709
18739
|
var _this = this;
|
|
18710
18740
|
var dropdownMultiSelectListModel = dropdownListModel;
|
|
18711
18741
|
var items = this.question.selectedChoices.map(function (choice, index) { return _this.renderItem("item" + index, choice); });
|
|
18712
|
-
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { id: this.question.inputId, className: this.question.getControlClass(), tabIndex: dropdownListModel.
|
|
18742
|
+
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { id: this.question.inputId, className: this.question.getControlClass(), tabIndex: dropdownListModel.noTabIndex ? undefined : 0,
|
|
18713
18743
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
18714
18744
|
// @ts-ignore
|
|
18715
18745
|
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, "aria-expanded": this.question.ariaExpanded === null ? undefined : this.question.ariaExpanded === "true", "aria-controls": dropdownListModel.listElementId, "aria-activedescendant": dropdownListModel.ariaActivedescendant },
|
|
@@ -19504,7 +19534,7 @@ var TagboxFilterString = /** @class */ (function (_super) {
|
|
|
19504
19534
|
(react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.question.cssClasses.hintSuffix },
|
|
19505
19535
|
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", { style: { visibility: "hidden" }, "data-bind": "text: model.filterString" }, this.model.inputStringRendered),
|
|
19506
19536
|
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", null, this.model.hintStringSuffix))) : null,
|
|
19507
|
-
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:
|
|
19537
|
+
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.filterReadOnly ? true : undefined, size: !this.model.inputStringRendered ? 1 : undefined, role: this.model.filterStringEnabled ? this.question.ariaRole : undefined, "aria-expanded": this.question.ariaExpanded === null ? undefined : this.question.ariaExpanded === "true", "aria-label": this.question.a11y_input_ariaLabel, "aria-labelledby": this.question.a11y_input_ariaLabelledBy, "aria-controls": this.model.listElementId, "aria-activedescendant": this.model.ariaActivedescendant, 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); } }))));
|
|
19508
19538
|
};
|
|
19509
19539
|
return TagboxFilterString;
|
|
19510
19540
|
}(_reactquestion_element__WEBPACK_IMPORTED_MODULE_3__["SurveyElementBase"]));
|
|
@@ -20156,6 +20186,32 @@ var settings = {
|
|
|
20156
20186
|
* Default value: `"none"`
|
|
20157
20187
|
*/
|
|
20158
20188
|
noneItemValue: "none",
|
|
20189
|
+
/**
|
|
20190
|
+
* An object whose properties specify the order of the special choice items (None, Other, Select All) in select-based questions.
|
|
20191
|
+
*
|
|
20192
|
+
* Default value: `{ selectAllItem: [-1], noneItem: [1], otherItem: [2] }`
|
|
20193
|
+
*
|
|
20194
|
+
* Use this object to reorder special choices. Each property accepts an array of integer numbers. Negative numbers place a special choice item above regular choice items, positive numbers place it below them. For instance, the code below specifies the following order of choices: None, Select All, regular choices, Other.
|
|
20195
|
+
*
|
|
20196
|
+
* ```js
|
|
20197
|
+
* import { settings } from "survey-core";
|
|
20198
|
+
*
|
|
20199
|
+
* settings.specialChoicesOrder.noneItem = [-2];
|
|
20200
|
+
* settings.specialChoicesOrder.selectAllItem = [-1];
|
|
20201
|
+
* settings.specialChoicesOrder.otherItem = [1];
|
|
20202
|
+
* ```
|
|
20203
|
+
*
|
|
20204
|
+
* If you want to duplicate a special choice item above and below other choices, add two numbers to the corresponding array:
|
|
20205
|
+
*
|
|
20206
|
+
* ```js
|
|
20207
|
+
* settings.specialChoicesOrder.selectAllItem = [-1, 3] // Displays Select All above and below other choices
|
|
20208
|
+
* ```
|
|
20209
|
+
*/
|
|
20210
|
+
specialChoicesOrder: {
|
|
20211
|
+
selectAllItem: [-1],
|
|
20212
|
+
noneItem: [1],
|
|
20213
|
+
otherItem: [2]
|
|
20214
|
+
},
|
|
20159
20215
|
/**
|
|
20160
20216
|
* A list of supported validators by question type.
|
|
20161
20217
|
*/
|
|
@@ -20518,19 +20574,36 @@ var ResponsivityManager = /** @class */ (function () {
|
|
|
20518
20574
|
configurable: true
|
|
20519
20575
|
});
|
|
20520
20576
|
ResponsivityManager.prototype.process = function () {
|
|
20521
|
-
var
|
|
20577
|
+
var _this = this;
|
|
20522
20578
|
if (this.isContainerVisible && !this.model.isResponsivenessDisabled) {
|
|
20523
20579
|
if (!this.isInitialized) {
|
|
20524
20580
|
this.model.setActionsMode("large");
|
|
20525
|
-
|
|
20526
|
-
|
|
20581
|
+
var recalcItemSizes = function () {
|
|
20582
|
+
_this.calcItemsSizes();
|
|
20583
|
+
_this.isInitialized = true;
|
|
20584
|
+
};
|
|
20585
|
+
if (queueMicrotask) {
|
|
20586
|
+
queueMicrotask(recalcItemSizes);
|
|
20587
|
+
}
|
|
20588
|
+
else {
|
|
20589
|
+
recalcItemSizes();
|
|
20590
|
+
}
|
|
20527
20591
|
}
|
|
20528
|
-
var
|
|
20529
|
-
|
|
20530
|
-
var
|
|
20531
|
-
|
|
20592
|
+
var processResponsiveness = function () {
|
|
20593
|
+
var _a;
|
|
20594
|
+
var dotsItemSize = _this.dotsItemSize;
|
|
20595
|
+
if (!_this.dotsItemSize) {
|
|
20596
|
+
var dotsItemElement = (_a = _this.container) === null || _a === void 0 ? void 0 : _a.querySelector(".sv-dots");
|
|
20597
|
+
dotsItemSize = dotsItemElement && _this.calcItemSize(dotsItemElement) || _this.dotsSizeConst;
|
|
20598
|
+
}
|
|
20599
|
+
_this.model.fit(_this.getAvailableSpace(), dotsItemSize);
|
|
20600
|
+
};
|
|
20601
|
+
if (queueMicrotask) {
|
|
20602
|
+
queueMicrotask(processResponsiveness);
|
|
20603
|
+
}
|
|
20604
|
+
else {
|
|
20605
|
+
processResponsiveness();
|
|
20532
20606
|
}
|
|
20533
|
-
this.model.fit(this.getAvailableSpace(), dotsItemSize);
|
|
20534
20607
|
}
|
|
20535
20608
|
};
|
|
20536
20609
|
ResponsivityManager.prototype.dispose = function () {
|
|
@@ -20952,6 +21025,9 @@ function findParentByClassNames(element, classNames) {
|
|
|
20952
21025
|
function sanitizeEditableContent(element) {
|
|
20953
21026
|
if (window.getSelection && document.createRange && element.childNodes.length > 0) {
|
|
20954
21027
|
var selection = document.getSelection();
|
|
21028
|
+
if (selection.rangeCount == 0) {
|
|
21029
|
+
return;
|
|
21030
|
+
}
|
|
20955
21031
|
var range = selection.getRangeAt(0);
|
|
20956
21032
|
range.setStart(range.endContainer, range.endOffset);
|
|
20957
21033
|
range.setEndAfter(element.lastChild);
|