survey-react-ui 1.9.105 → 1.9.106
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 +116 -143
- package/survey-react-ui.js.map +1 -1
- package/survey-react-ui.min.js +2 -2
- package/typings/react/components/list/list.d.ts +1 -0
- package/typings/react/components/popup/popup.d.ts +1 -0
- package/typings/react/reactquestion.d.ts +10 -5
- package/typings/react/reactquestion_matrixdropdownbase.d.ts +1 -11
- package/typings/react/reactquestion_multipletext.d.ts +3 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "survey-react-ui",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.106",
|
|
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.106",
|
|
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.106
|
|
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
|
*/
|
|
@@ -690,7 +690,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
690
690
|
|
|
691
691
|
|
|
692
692
|
|
|
693
|
-
Object(survey_core__WEBPACK_IMPORTED_MODULE_2__["checkLibraryVersion"])("" + "1.9.
|
|
693
|
+
Object(survey_core__WEBPACK_IMPORTED_MODULE_2__["checkLibraryVersion"])("" + "1.9.106", "survey-react-ui");
|
|
694
694
|
|
|
695
695
|
|
|
696
696
|
/***/ }),
|
|
@@ -1441,11 +1441,11 @@ var ComponentsContainer = /** @class */ (function (_super) {
|
|
|
1441
1441
|
}
|
|
1442
1442
|
if (!needRenderWrapper) {
|
|
1443
1443
|
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_0___default.a.Fragment, null, components.map(function (component) {
|
|
1444
|
-
return _element_factory__WEBPACK_IMPORTED_MODULE_1__["ReactElementFactory"].Instance.createElement(component.component, { survey: _this.props.survey, model: component.data, key: component.id });
|
|
1444
|
+
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 });
|
|
1445
1445
|
}));
|
|
1446
1446
|
}
|
|
1447
1447
|
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { className: "sv-components-column" }, components.map(function (component) {
|
|
1448
|
-
return _element_factory__WEBPACK_IMPORTED_MODULE_1__["ReactElementFactory"].Instance.createElement(component.component, { survey: _this.props.survey, model: component.data, key: component.id });
|
|
1448
|
+
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 });
|
|
1449
1449
|
}));
|
|
1450
1450
|
};
|
|
1451
1451
|
return ComponentsContainer;
|
|
@@ -1644,6 +1644,12 @@ var List = /** @class */ (function (_super) {
|
|
|
1644
1644
|
this.model.initListContainerHtmlElement(this.listContainerRef.current);
|
|
1645
1645
|
}
|
|
1646
1646
|
};
|
|
1647
|
+
List.prototype.componentWillUnmount = function () {
|
|
1648
|
+
_super.prototype.componentWillUnmount.call(this);
|
|
1649
|
+
if (!!this.model) {
|
|
1650
|
+
this.model.initListContainerHtmlElement(undefined);
|
|
1651
|
+
}
|
|
1652
|
+
};
|
|
1647
1653
|
List.prototype.renderElement = function () {
|
|
1648
1654
|
return (react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", { className: this.model.cssClasses.root, ref: this.listContainerRef },
|
|
1649
1655
|
this.searchElementContent(),
|
|
@@ -2450,6 +2456,10 @@ var Popup = /** @class */ (function (_super) {
|
|
|
2450
2456
|
_super.prototype.componentDidUpdate.call(this, prevProps, prevState);
|
|
2451
2457
|
this.setTargetElement();
|
|
2452
2458
|
};
|
|
2459
|
+
Popup.prototype.componentWillUnmount = function () {
|
|
2460
|
+
_super.prototype.componentWillUnmount.call(this);
|
|
2461
|
+
this.popup.resetComponentElement();
|
|
2462
|
+
};
|
|
2453
2463
|
Popup.prototype.shouldComponentUpdate = function (nextProps, nextState) {
|
|
2454
2464
|
var _a;
|
|
2455
2465
|
if (!_super.prototype.shouldComponentUpdate.call(this, nextProps, nextState))
|
|
@@ -5018,6 +5028,8 @@ var Survey = /** @class */ (function (_super) {
|
|
|
5018
5028
|
};
|
|
5019
5029
|
Survey.prototype.destroySurvey = function () {
|
|
5020
5030
|
if (this.survey) {
|
|
5031
|
+
this.survey.renderCallback = undefined;
|
|
5032
|
+
this.survey.onPartialSend.clear();
|
|
5021
5033
|
this.survey.stopTimer();
|
|
5022
5034
|
this.survey.destroyResizeObserver();
|
|
5023
5035
|
}
|
|
@@ -5040,6 +5052,9 @@ var Survey = /** @class */ (function (_super) {
|
|
|
5040
5052
|
else if (this.survey.state == "loading") {
|
|
5041
5053
|
renderResult = this.renderLoading();
|
|
5042
5054
|
}
|
|
5055
|
+
else if (this.survey.state == "empty") {
|
|
5056
|
+
renderResult = this.renderEmptySurvey();
|
|
5057
|
+
}
|
|
5043
5058
|
else {
|
|
5044
5059
|
renderResult = this.renderSurvey();
|
|
5045
5060
|
}
|
|
@@ -5088,11 +5103,11 @@ var Survey = /** @class */ (function (_super) {
|
|
|
5088
5103
|
};
|
|
5089
5104
|
Survey.prototype.renderCompletedBefore = function () {
|
|
5090
5105
|
var htmlValue = { __html: this.survey.processedCompletedBeforeHtml };
|
|
5091
|
-
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { dangerouslySetInnerHTML: htmlValue, className: this.
|
|
5106
|
+
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { dangerouslySetInnerHTML: htmlValue, className: this.survey.completedBeforeCss }));
|
|
5092
5107
|
};
|
|
5093
5108
|
Survey.prototype.renderLoading = function () {
|
|
5094
5109
|
var htmlValue = { __html: this.survey.processedLoadingHtml };
|
|
5095
|
-
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { dangerouslySetInnerHTML: htmlValue, className: this.
|
|
5110
|
+
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { dangerouslySetInnerHTML: htmlValue, className: this.survey.loadingBodyCss }));
|
|
5096
5111
|
};
|
|
5097
5112
|
Survey.prototype.renderSurvey = function () {
|
|
5098
5113
|
var activePage = this.survey.activePage
|
|
@@ -5101,10 +5116,6 @@ var Survey = /** @class */ (function (_super) {
|
|
|
5101
5116
|
var isStaring = this.survey.isShowStartingPage;
|
|
5102
5117
|
var pageId = this.survey.activePage ? this.survey.activePage.id : "";
|
|
5103
5118
|
var className = this.survey.bodyCss;
|
|
5104
|
-
if (!activePage) {
|
|
5105
|
-
className = this.css.bodyEmpty;
|
|
5106
|
-
activePage = this.renderEmptySurvey();
|
|
5107
|
-
}
|
|
5108
5119
|
var style = {};
|
|
5109
5120
|
if (!!this.survey.renderedWidth) {
|
|
5110
5121
|
style.maxWidth = this.survey.renderedWidth;
|
|
@@ -5121,7 +5132,7 @@ var Survey = /** @class */ (function (_super) {
|
|
|
5121
5132
|
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_page__WEBPACK_IMPORTED_MODULE_2__["SurveyPage"], { survey: this.survey, page: page, css: this.css, creator: this }));
|
|
5122
5133
|
};
|
|
5123
5134
|
Survey.prototype.renderEmptySurvey = function () {
|
|
5124
|
-
return react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("
|
|
5135
|
+
return react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.css.bodyEmpty }, this.survey.emptySurveyText);
|
|
5125
5136
|
};
|
|
5126
5137
|
Survey.prototype.createSurvey = function (newProps) {
|
|
5127
5138
|
if (!newProps)
|
|
@@ -5379,7 +5390,7 @@ var SurveyProgress = /** @class */ (function (_super) {
|
|
|
5379
5390
|
var progressStyle = {
|
|
5380
5391
|
width: this.progress + "%",
|
|
5381
5392
|
};
|
|
5382
|
-
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.survey.getProgressCssClasses() },
|
|
5393
|
+
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.survey.getProgressCssClasses(this.props.container) },
|
|
5383
5394
|
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { style: progressStyle, className: this.css.progressBar, role: "progressbar", "aria-valuemin": 0, "aria-valuemax": 100 },
|
|
5384
5395
|
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", { className: survey_core__WEBPACK_IMPORTED_MODULE_1__["SurveyProgressModel"].getProgressTextInBarCss(this.css) }, this.progressText)),
|
|
5385
5396
|
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", { className: survey_core__WEBPACK_IMPORTED_MODULE_1__["SurveyProgressModel"].getProgressTextUnderBarCss(this.css) }, this.progressText)));
|
|
@@ -5590,7 +5601,7 @@ _element_factory__WEBPACK_IMPORTED_MODULE_3__["ReactElementFactory"].Instance.re
|
|
|
5590
5601
|
/*!*************************************!*\
|
|
5591
5602
|
!*** ./src/react/reactquestion.tsx ***!
|
|
5592
5603
|
\*************************************/
|
|
5593
|
-
/*! exports provided: SurveyQuestion, SurveyElementErrors, SurveyQuestionAndErrorsWrapped, SurveyQuestionAndErrorsCell */
|
|
5604
|
+
/*! exports provided: SurveyQuestion, SurveyElementErrors, SurveyQuestionAndErrorsWrapped, SurveyQuestionAndErrorsCell, SurveyQuestionErrorCell */
|
|
5594
5605
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
5595
5606
|
|
|
5596
5607
|
"use strict";
|
|
@@ -5599,16 +5610,15 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
5599
5610
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SurveyElementErrors", function() { return SurveyElementErrors; });
|
|
5600
5611
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SurveyQuestionAndErrorsWrapped", function() { return SurveyQuestionAndErrorsWrapped; });
|
|
5601
5612
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SurveyQuestionAndErrorsCell", function() { return SurveyQuestionAndErrorsCell; });
|
|
5613
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SurveyQuestionErrorCell", function() { return SurveyQuestionErrorCell; });
|
|
5602
5614
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
5603
5615
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
5604
|
-
/* harmony import */ var
|
|
5605
|
-
/* harmony import */ var
|
|
5606
|
-
/* harmony import */ var
|
|
5607
|
-
/* harmony import */ var
|
|
5608
|
-
/* harmony import */ var
|
|
5609
|
-
/* harmony import */ var
|
|
5610
|
-
/* harmony import */ var _custom_widget__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./custom-widget */ "./src/react/custom-widget.tsx");
|
|
5611
|
-
/* harmony import */ var _element_header__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./element-header */ "./src/react/element-header.tsx");
|
|
5616
|
+
/* harmony import */ var _reactsurveymodel__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./reactsurveymodel */ "./src/react/reactsurveymodel.tsx");
|
|
5617
|
+
/* harmony import */ var _element_factory__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./element-factory */ "./src/react/element-factory.tsx");
|
|
5618
|
+
/* harmony import */ var _reactquestion_element__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./reactquestion_element */ "./src/react/reactquestion_element.tsx");
|
|
5619
|
+
/* harmony import */ var _reactquestion_comment__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./reactquestion_comment */ "./src/react/reactquestion_comment.tsx");
|
|
5620
|
+
/* harmony import */ var _custom_widget__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./custom-widget */ "./src/react/custom-widget.tsx");
|
|
5621
|
+
/* harmony import */ var _element_header__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./element-header */ "./src/react/element-header.tsx");
|
|
5612
5622
|
var __extends = (undefined && undefined.__extends) || (function () {
|
|
5613
5623
|
var extendStatics = function (d, b) {
|
|
5614
5624
|
extendStatics = Object.setPrototypeOf ||
|
|
@@ -5631,7 +5641,6 @@ var __extends = (undefined && undefined.__extends) || (function () {
|
|
|
5631
5641
|
|
|
5632
5642
|
|
|
5633
5643
|
|
|
5634
|
-
|
|
5635
5644
|
var SurveyQuestion = /** @class */ (function (_super) {
|
|
5636
5645
|
__extends(SurveyQuestion, _super);
|
|
5637
5646
|
function SurveyQuestion(props) {
|
|
@@ -5647,7 +5656,7 @@ var SurveyQuestion = /** @class */ (function (_super) {
|
|
|
5647
5656
|
if (!customWidget) {
|
|
5648
5657
|
return creator.createQuestionElement(question);
|
|
5649
5658
|
}
|
|
5650
|
-
return react__WEBPACK_IMPORTED_MODULE_0__["createElement"](
|
|
5659
|
+
return react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_custom_widget__WEBPACK_IMPORTED_MODULE_5__["SurveyCustomWidget"], { creator: creator, question: question });
|
|
5651
5660
|
};
|
|
5652
5661
|
SurveyQuestion.prototype.getStateElement = function () {
|
|
5653
5662
|
return this.question;
|
|
@@ -5725,9 +5734,6 @@ var SurveyQuestion = /** @class */ (function (_super) {
|
|
|
5725
5734
|
? this.renderErrors(cssClasses, "bottom")
|
|
5726
5735
|
: null;
|
|
5727
5736
|
var comment = question && question.hasComment ? this.renderComment(cssClasses) : null;
|
|
5728
|
-
var errorsTooltip = this.question.isErrorsModeTooltip
|
|
5729
|
-
? this.renderErrors(cssClasses, "tooltip")
|
|
5730
|
-
: null;
|
|
5731
5737
|
var descriptionUnderInput = question.hasDescriptionUnderInput
|
|
5732
5738
|
? this.renderDescription()
|
|
5733
5739
|
: null;
|
|
@@ -5736,7 +5742,6 @@ var SurveyQuestion = /** @class */ (function (_super) {
|
|
|
5736
5742
|
questionRender,
|
|
5737
5743
|
comment,
|
|
5738
5744
|
errorsBottom,
|
|
5739
|
-
errorsTooltip,
|
|
5740
5745
|
descriptionUnderInput));
|
|
5741
5746
|
};
|
|
5742
5747
|
SurveyQuestion.prototype.renderElement = function () {
|
|
@@ -5765,7 +5770,7 @@ var SurveyQuestion = /** @class */ (function (_super) {
|
|
|
5765
5770
|
var survey = this.question.survey;
|
|
5766
5771
|
var wrapper = null;
|
|
5767
5772
|
if (survey) {
|
|
5768
|
-
wrapper =
|
|
5773
|
+
wrapper = _reactsurveymodel__WEBPACK_IMPORTED_MODULE_1__["ReactSurveyElementsWrapper"].wrapElement(survey, element, this.question);
|
|
5769
5774
|
}
|
|
5770
5775
|
return wrapper !== null && wrapper !== void 0 ? wrapper : element;
|
|
5771
5776
|
};
|
|
@@ -5773,7 +5778,7 @@ var SurveyQuestion = /** @class */ (function (_super) {
|
|
|
5773
5778
|
var survey = this.question.survey;
|
|
5774
5779
|
var wrapper = null;
|
|
5775
5780
|
if (survey) {
|
|
5776
|
-
wrapper =
|
|
5781
|
+
wrapper = _reactsurveymodel__WEBPACK_IMPORTED_MODULE_1__["ReactSurveyElementsWrapper"].wrapQuestionContent(survey, element, this.question);
|
|
5777
5782
|
}
|
|
5778
5783
|
return wrapper !== null && wrapper !== void 0 ? wrapper : element;
|
|
5779
5784
|
};
|
|
@@ -5781,24 +5786,24 @@ var SurveyQuestion = /** @class */ (function (_super) {
|
|
|
5781
5786
|
return SurveyQuestion.renderQuestionBody(this.creator, this.question);
|
|
5782
5787
|
};
|
|
5783
5788
|
SurveyQuestion.prototype.renderDescription = function () {
|
|
5784
|
-
return
|
|
5789
|
+
return _reactquestion_element__WEBPACK_IMPORTED_MODULE_3__["SurveyElementBase"].renderQuestionDescription(this.question);
|
|
5785
5790
|
};
|
|
5786
5791
|
SurveyQuestion.prototype.renderComment = function (cssClasses) {
|
|
5787
|
-
var commentText =
|
|
5792
|
+
var commentText = _reactquestion_element__WEBPACK_IMPORTED_MODULE_3__["SurveyElementBase"].renderLocString(this.question.locCommentText);
|
|
5788
5793
|
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { className: this.question.getCommentAreaCss() },
|
|
5789
5794
|
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", null, commentText),
|
|
5790
|
-
react__WEBPACK_IMPORTED_MODULE_0__["createElement"](
|
|
5795
|
+
react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_reactquestion_comment__WEBPACK_IMPORTED_MODULE_4__["SurveyQuestionCommentItem"], { question: this.question, cssClasses: cssClasses, otherCss: cssClasses.other, isDisplayMode: this.question.isInputReadOnly })));
|
|
5791
5796
|
};
|
|
5792
5797
|
SurveyQuestion.prototype.renderHeader = function (question) {
|
|
5793
|
-
return react__WEBPACK_IMPORTED_MODULE_0__["createElement"](
|
|
5798
|
+
return react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_element_header__WEBPACK_IMPORTED_MODULE_6__["SurveyElementHeader"], { element: question });
|
|
5794
5799
|
};
|
|
5795
5800
|
SurveyQuestion.prototype.renderErrors = function (cssClasses, location) {
|
|
5796
5801
|
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"](SurveyElementErrors, { element: this.question, cssClasses: cssClasses, creator: this.creator, location: location, id: this.question.id + "_errors" }));
|
|
5797
5802
|
};
|
|
5798
5803
|
return SurveyQuestion;
|
|
5799
|
-
}(
|
|
5804
|
+
}(_reactquestion_element__WEBPACK_IMPORTED_MODULE_3__["SurveyElementBase"]));
|
|
5800
5805
|
|
|
5801
|
-
|
|
5806
|
+
_element_factory__WEBPACK_IMPORTED_MODULE_2__["ReactElementFactory"].Instance.registerElement("question", function (props) {
|
|
5802
5807
|
return react__WEBPACK_IMPORTED_MODULE_0__["createElement"](SurveyQuestion, props);
|
|
5803
5808
|
});
|
|
5804
5809
|
var SurveyElementErrors = /** @class */ (function (_super) {
|
|
@@ -5806,7 +5811,6 @@ var SurveyElementErrors = /** @class */ (function (_super) {
|
|
|
5806
5811
|
function SurveyElementErrors(props) {
|
|
5807
5812
|
var _this = _super.call(this, props) || this;
|
|
5808
5813
|
_this.state = _this.getState();
|
|
5809
|
-
_this.tooltipRef = react__WEBPACK_IMPORTED_MODULE_0__["createRef"]();
|
|
5810
5814
|
return _this;
|
|
5811
5815
|
}
|
|
5812
5816
|
Object.defineProperty(SurveyElementErrors.prototype, "id", {
|
|
@@ -5844,26 +5848,7 @@ var SurveyElementErrors = /** @class */ (function (_super) {
|
|
|
5844
5848
|
SurveyElementErrors.prototype.canRender = function () {
|
|
5845
5849
|
return !!this.element && this.element.hasVisibleErrors;
|
|
5846
5850
|
};
|
|
5847
|
-
SurveyElementErrors.prototype.componentDidUpdate = function (prevProps, prevState) {
|
|
5848
|
-
_super.prototype.componentDidUpdate.call(this, prevProps, prevState);
|
|
5849
|
-
if (this.props.location == "tooltip") {
|
|
5850
|
-
if (this.tooltipRef.current && !this.tooltipManager) {
|
|
5851
|
-
this.tooltipManager = new survey_core__WEBPACK_IMPORTED_MODULE_1__["TooltipManager"](this.tooltipRef.current);
|
|
5852
|
-
}
|
|
5853
|
-
if (!!this.tooltipManager && !this.tooltipRef.current) {
|
|
5854
|
-
this.disposeTooltipManager();
|
|
5855
|
-
}
|
|
5856
|
-
}
|
|
5857
|
-
};
|
|
5858
5851
|
SurveyElementErrors.prototype.componentWillUnmount = function () {
|
|
5859
|
-
if (!!this.tooltipManager) {
|
|
5860
|
-
this.disposeTooltipManager();
|
|
5861
|
-
}
|
|
5862
|
-
};
|
|
5863
|
-
SurveyElementErrors.prototype.disposeTooltipManager = function () {
|
|
5864
|
-
var _a;
|
|
5865
|
-
(_a = this.tooltipManager) === null || _a === void 0 ? void 0 : _a.dispose();
|
|
5866
|
-
this.tooltipManager = undefined;
|
|
5867
5852
|
};
|
|
5868
5853
|
SurveyElementErrors.prototype.renderElement = function () {
|
|
5869
5854
|
var errors = [];
|
|
@@ -5871,10 +5856,10 @@ var SurveyElementErrors = /** @class */ (function (_super) {
|
|
|
5871
5856
|
var key = "error" + i;
|
|
5872
5857
|
errors.push(this.creator.renderError(key, this.element.errors[i], this.cssClasses));
|
|
5873
5858
|
}
|
|
5874
|
-
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { role: "alert", "aria-live": "polite", className: this.element.cssError, id: this.id
|
|
5859
|
+
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("div", { role: "alert", "aria-live": "polite", className: this.element.cssError, id: this.id }, errors));
|
|
5875
5860
|
};
|
|
5876
5861
|
return SurveyElementErrors;
|
|
5877
|
-
}(
|
|
5862
|
+
}(_reactquestion_element__WEBPACK_IMPORTED_MODULE_3__["ReactSurveyElement"]));
|
|
5878
5863
|
|
|
5879
5864
|
var SurveyQuestionAndErrorsWrapped = /** @class */ (function (_super) {
|
|
5880
5865
|
__extends(SurveyQuestionAndErrorsWrapped, _super);
|
|
@@ -5920,23 +5905,9 @@ var SurveyQuestionAndErrorsWrapped = /** @class */ (function (_super) {
|
|
|
5920
5905
|
SurveyQuestionAndErrorsWrapped.prototype.canRender = function () {
|
|
5921
5906
|
return !!this.question;
|
|
5922
5907
|
};
|
|
5923
|
-
SurveyQuestionAndErrorsWrapped.prototype.renderErrors = function (errorsLocation) {
|
|
5924
|
-
return this.getShowErrors() ? (react__WEBPACK_IMPORTED_MODULE_0__["createElement"](SurveyElementErrors, { element: this.question, cssClasses: this.cssClasses, creator: this.creator, location: errorsLocation })) : null;
|
|
5925
|
-
};
|
|
5926
5908
|
SurveyQuestionAndErrorsWrapped.prototype.renderContent = function () {
|
|
5927
|
-
var errorsLocation = this.creator.questionErrorLocation();
|
|
5928
|
-
var errors = this.renderErrors(errorsLocation);
|
|
5929
|
-
var errorsTop = this.question.showErrorOnTop
|
|
5930
|
-
? errors
|
|
5931
|
-
: null;
|
|
5932
|
-
var errorsBottom = this.question.showErrorOnBottom
|
|
5933
|
-
? errors
|
|
5934
|
-
: null;
|
|
5935
5909
|
var renderedQuestion = this.renderQuestion();
|
|
5936
|
-
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"](react__WEBPACK_IMPORTED_MODULE_0__["Fragment"], null,
|
|
5937
|
-
errorsTop,
|
|
5938
|
-
renderedQuestion,
|
|
5939
|
-
errorsBottom));
|
|
5910
|
+
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"](react__WEBPACK_IMPORTED_MODULE_0__["Fragment"], null, renderedQuestion));
|
|
5940
5911
|
};
|
|
5941
5912
|
SurveyQuestionAndErrorsWrapped.prototype.getShowErrors = function () {
|
|
5942
5913
|
return this.question.isVisible;
|
|
@@ -5945,7 +5916,7 @@ var SurveyQuestionAndErrorsWrapped = /** @class */ (function (_super) {
|
|
|
5945
5916
|
return SurveyQuestion.renderQuestionBody(this.creator, this.question);
|
|
5946
5917
|
};
|
|
5947
5918
|
return SurveyQuestionAndErrorsWrapped;
|
|
5948
|
-
}(
|
|
5919
|
+
}(_reactquestion_element__WEBPACK_IMPORTED_MODULE_3__["ReactSurveyElement"]));
|
|
5949
5920
|
|
|
5950
5921
|
var SurveyQuestionAndErrorsCell = /** @class */ (function (_super) {
|
|
5951
5922
|
__extends(SurveyQuestionAndErrorsCell, _super);
|
|
@@ -5982,13 +5953,63 @@ var SurveyQuestionAndErrorsCell = /** @class */ (function (_super) {
|
|
|
5982
5953
|
var survey = this.question.survey;
|
|
5983
5954
|
var wrapper = null;
|
|
5984
5955
|
if (survey) {
|
|
5985
|
-
wrapper =
|
|
5956
|
+
wrapper = _reactsurveymodel__WEBPACK_IMPORTED_MODULE_1__["ReactSurveyElementsWrapper"].wrapMatrixCell(survey, element, cell, this.props.reason);
|
|
5986
5957
|
}
|
|
5987
5958
|
return wrapper !== null && wrapper !== void 0 ? wrapper : element;
|
|
5988
5959
|
};
|
|
5989
5960
|
return SurveyQuestionAndErrorsCell;
|
|
5990
5961
|
}(SurveyQuestionAndErrorsWrapped));
|
|
5991
5962
|
|
|
5963
|
+
var SurveyQuestionErrorCell = /** @class */ (function (_super) {
|
|
5964
|
+
__extends(SurveyQuestionErrorCell, _super);
|
|
5965
|
+
function SurveyQuestionErrorCell(props) {
|
|
5966
|
+
var _this = _super.call(this, props) || this;
|
|
5967
|
+
_this.state = {
|
|
5968
|
+
changed: 0
|
|
5969
|
+
};
|
|
5970
|
+
if (_this.question) {
|
|
5971
|
+
_this.registerCallback(_this.question);
|
|
5972
|
+
}
|
|
5973
|
+
return _this;
|
|
5974
|
+
}
|
|
5975
|
+
Object.defineProperty(SurveyQuestionErrorCell.prototype, "question", {
|
|
5976
|
+
get: function () {
|
|
5977
|
+
return this.props.question;
|
|
5978
|
+
},
|
|
5979
|
+
enumerable: false,
|
|
5980
|
+
configurable: true
|
|
5981
|
+
});
|
|
5982
|
+
SurveyQuestionErrorCell.prototype.update = function () {
|
|
5983
|
+
this.setState({ changed: this.state.changed + 1 });
|
|
5984
|
+
};
|
|
5985
|
+
SurveyQuestionErrorCell.prototype.registerCallback = function (question) {
|
|
5986
|
+
var _this = this;
|
|
5987
|
+
question.registerFunctionOnPropertyValueChanged("errors", function () {
|
|
5988
|
+
_this.update();
|
|
5989
|
+
}, "__reactSubscription");
|
|
5990
|
+
};
|
|
5991
|
+
SurveyQuestionErrorCell.prototype.unRegisterCallback = function (question) {
|
|
5992
|
+
question.unRegisterFunctionOnPropertyValueChanged("errors", "__reactSubscription");
|
|
5993
|
+
};
|
|
5994
|
+
SurveyQuestionErrorCell.prototype.componentDidUpdate = function (prevProps) {
|
|
5995
|
+
if (prevProps.question && prevProps.question !== this.question) {
|
|
5996
|
+
this.unRegisterCallback(prevProps.cell);
|
|
5997
|
+
}
|
|
5998
|
+
if (this.question) {
|
|
5999
|
+
this.registerCallback(this.question);
|
|
6000
|
+
}
|
|
6001
|
+
};
|
|
6002
|
+
SurveyQuestionErrorCell.prototype.componentWillUnmount = function () {
|
|
6003
|
+
if (this.question) {
|
|
6004
|
+
this.unRegisterCallback(this.question);
|
|
6005
|
+
}
|
|
6006
|
+
};
|
|
6007
|
+
SurveyQuestionErrorCell.prototype.render = function () {
|
|
6008
|
+
return react__WEBPACK_IMPORTED_MODULE_0__["createElement"](SurveyElementErrors, { element: this.question, creator: this.props.creator, cssClasses: this.question.cssClasses });
|
|
6009
|
+
};
|
|
6010
|
+
return SurveyQuestionErrorCell;
|
|
6011
|
+
}(react__WEBPACK_IMPORTED_MODULE_0__["Component"]));
|
|
6012
|
+
|
|
5992
6013
|
|
|
5993
6014
|
|
|
5994
6015
|
/***/ }),
|
|
@@ -7651,14 +7672,13 @@ _reactquestion_factory__WEBPACK_IMPORTED_MODULE_2__["ReactQuestionFactory"].Inst
|
|
|
7651
7672
|
/*!********************************************************!*\
|
|
7652
7673
|
!*** ./src/react/reactquestion_matrixdropdownbase.tsx ***!
|
|
7653
7674
|
\********************************************************/
|
|
7654
|
-
/*! exports provided: SurveyQuestionMatrixDropdownBase, SurveyQuestionMatrixDropdownCell
|
|
7675
|
+
/*! exports provided: SurveyQuestionMatrixDropdownBase, SurveyQuestionMatrixDropdownCell */
|
|
7655
7676
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
7656
7677
|
|
|
7657
7678
|
"use strict";
|
|
7658
7679
|
__webpack_require__.r(__webpack_exports__);
|
|
7659
7680
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SurveyQuestionMatrixDropdownBase", function() { return SurveyQuestionMatrixDropdownBase; });
|
|
7660
7681
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SurveyQuestionMatrixDropdownCell", function() { return SurveyQuestionMatrixDropdownCell; });
|
|
7661
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SurveyQuestionMatrixDropdownErrorCell", function() { return SurveyQuestionMatrixDropdownErrorCell; });
|
|
7662
7682
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
7663
7683
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
7664
7684
|
/* harmony import */ var _reactquestion_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./reactquestion_element */ "./src/react/reactquestion_element.tsx");
|
|
@@ -7869,7 +7889,7 @@ var SurveyQuestionMatrixDropdownBase = /** @class */ (function (_super) {
|
|
|
7869
7889
|
}
|
|
7870
7890
|
if (cell.isErrorsCell) {
|
|
7871
7891
|
if (cell.isErrorsCell) {
|
|
7872
|
-
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"](
|
|
7892
|
+
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_reactquestion__WEBPACK_IMPORTED_MODULE_2__["SurveyQuestionErrorCell"], { question: cell.question, creator: this.creator }));
|
|
7873
7893
|
}
|
|
7874
7894
|
}
|
|
7875
7895
|
if (!cellContent)
|
|
@@ -8018,56 +8038,6 @@ var SurveyQuestionMatrixDropdownCell = /** @class */ (function (_super) {
|
|
|
8018
8038
|
return SurveyQuestionMatrixDropdownCell;
|
|
8019
8039
|
}(_reactquestion__WEBPACK_IMPORTED_MODULE_2__["SurveyQuestionAndErrorsCell"]));
|
|
8020
8040
|
|
|
8021
|
-
var SurveyQuestionMatrixDropdownErrorCell = /** @class */ (function (_super) {
|
|
8022
|
-
__extends(SurveyQuestionMatrixDropdownErrorCell, _super);
|
|
8023
|
-
function SurveyQuestionMatrixDropdownErrorCell(props) {
|
|
8024
|
-
var _this = _super.call(this, props) || this;
|
|
8025
|
-
_this.state = {
|
|
8026
|
-
changed: 0
|
|
8027
|
-
};
|
|
8028
|
-
if (_this.cell) {
|
|
8029
|
-
_this.registerCallback(_this.cell);
|
|
8030
|
-
}
|
|
8031
|
-
return _this;
|
|
8032
|
-
}
|
|
8033
|
-
Object.defineProperty(SurveyQuestionMatrixDropdownErrorCell.prototype, "cell", {
|
|
8034
|
-
get: function () {
|
|
8035
|
-
return this.props.cell;
|
|
8036
|
-
},
|
|
8037
|
-
enumerable: false,
|
|
8038
|
-
configurable: true
|
|
8039
|
-
});
|
|
8040
|
-
SurveyQuestionMatrixDropdownErrorCell.prototype.update = function () {
|
|
8041
|
-
this.setState({ changed: this.state.changed + 1 });
|
|
8042
|
-
};
|
|
8043
|
-
SurveyQuestionMatrixDropdownErrorCell.prototype.registerCallback = function (cell) {
|
|
8044
|
-
var _this = this;
|
|
8045
|
-
cell.question.registerFunctionOnPropertyValueChanged("errors", function () {
|
|
8046
|
-
_this.update();
|
|
8047
|
-
}, "__reactSubscription");
|
|
8048
|
-
};
|
|
8049
|
-
SurveyQuestionMatrixDropdownErrorCell.prototype.unRegisterCallback = function (cell) {
|
|
8050
|
-
cell.question.unRegisterFunctionOnPropertyValueChanged("errors", "__reactSubscription");
|
|
8051
|
-
};
|
|
8052
|
-
SurveyQuestionMatrixDropdownErrorCell.prototype.componentDidUpdate = function (prevProps) {
|
|
8053
|
-
if (prevProps.cell && prevProps.cell !== this.cell) {
|
|
8054
|
-
this.unRegisterCallback(prevProps.cell);
|
|
8055
|
-
}
|
|
8056
|
-
if (this.cell) {
|
|
8057
|
-
this.registerCallback(this.cell);
|
|
8058
|
-
}
|
|
8059
|
-
};
|
|
8060
|
-
SurveyQuestionMatrixDropdownErrorCell.prototype.componentWillUnmount = function () {
|
|
8061
|
-
if (this.cell) {
|
|
8062
|
-
this.unRegisterCallback(this.cell);
|
|
8063
|
-
}
|
|
8064
|
-
};
|
|
8065
|
-
SurveyQuestionMatrixDropdownErrorCell.prototype.render = function () {
|
|
8066
|
-
return react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_reactquestion__WEBPACK_IMPORTED_MODULE_2__["SurveyElementErrors"], { element: this.cell.question, creator: this.props.creator, cssClasses: this.cell.question.cssClasses });
|
|
8067
|
-
};
|
|
8068
|
-
return SurveyQuestionMatrixDropdownErrorCell;
|
|
8069
|
-
}(react__WEBPACK_IMPORTED_MODULE_0__["Component"]));
|
|
8070
|
-
|
|
8071
8041
|
|
|
8072
8042
|
|
|
8073
8043
|
/***/ }),
|
|
@@ -8258,23 +8228,30 @@ var SurveyQuestionMultipleText = /** @class */ (function (_super) {
|
|
|
8258
8228
|
var tableRows = this.question.getRows();
|
|
8259
8229
|
var rows = [];
|
|
8260
8230
|
for (var i = 0; i < tableRows.length; i++) {
|
|
8261
|
-
|
|
8231
|
+
if (tableRows[i].isVisible) {
|
|
8232
|
+
rows.push(this.renderRow(i, tableRows[i].cells, cssClasses));
|
|
8233
|
+
}
|
|
8262
8234
|
}
|
|
8263
8235
|
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("table", { className: cssClasses.root },
|
|
8264
8236
|
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("tbody", null, rows)));
|
|
8265
8237
|
};
|
|
8266
|
-
SurveyQuestionMultipleText.prototype.
|
|
8238
|
+
SurveyQuestionMultipleText.prototype.renderCell = function (cell, cssClasses, index) {
|
|
8239
|
+
var cellContent;
|
|
8240
|
+
var focusIn = function () { cell.item.focusIn(); };
|
|
8241
|
+
if (cell.isErrorsCell) {
|
|
8242
|
+
cellContent = react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_reactquestion__WEBPACK_IMPORTED_MODULE_2__["SurveyQuestionErrorCell"], { question: cell.item.editor, creator: this.creator });
|
|
8243
|
+
}
|
|
8244
|
+
else {
|
|
8245
|
+
cellContent = react__WEBPACK_IMPORTED_MODULE_0__["createElement"](SurveyMultipleTextItem, { question: this.question, item: cell.item, creator: this.creator, cssClasses: cssClasses });
|
|
8246
|
+
}
|
|
8247
|
+
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("td", { key: "item" + index, className: cell.className, onFocus: focusIn }, cellContent));
|
|
8248
|
+
};
|
|
8249
|
+
SurveyQuestionMultipleText.prototype.renderRow = function (rowIndex, cells, cssClasses) {
|
|
8267
8250
|
var key = "item" + rowIndex;
|
|
8268
8251
|
var tds = [];
|
|
8269
|
-
var
|
|
8270
|
-
var
|
|
8271
|
-
|
|
8272
|
-
tds.push(react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("td", { key: "item" + i, className: this_1.question.cssClasses.cell, onFocus: focusIn },
|
|
8273
|
-
react__WEBPACK_IMPORTED_MODULE_0__["createElement"](SurveyMultipleTextItem, { question: this_1.question, item: item, creator: this_1.creator, cssClasses: cssClasses })));
|
|
8274
|
-
};
|
|
8275
|
-
var this_1 = this;
|
|
8276
|
-
for (var i = 0; i < items.length; i++) {
|
|
8277
|
-
_loop_1(i);
|
|
8252
|
+
for (var i = 0; i < cells.length; i++) {
|
|
8253
|
+
var cell = cells[i];
|
|
8254
|
+
tds.push(this.renderCell(cell, cssClasses, i));
|
|
8278
8255
|
}
|
|
8279
8256
|
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("tr", { key: key, className: cssClasses.row }, tds));
|
|
8280
8257
|
};
|
|
@@ -8316,11 +8293,7 @@ var SurveyMultipleTextItem = /** @class */ (function (_super) {
|
|
|
8316
8293
|
return (react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("label", { className: this.question.getItemLabelCss(item) },
|
|
8317
8294
|
react__WEBPACK_IMPORTED_MODULE_0__["createElement"]("span", { className: cssClasses.itemTitle },
|
|
8318
8295
|
react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_components_title_title_content__WEBPACK_IMPORTED_MODULE_4__["TitleContent"], { element: item.editor, cssClasses: item.editor.cssClasses })),
|
|
8319
|
-
react__WEBPACK_IMPORTED_MODULE_0__["createElement"](SurveyMultipleTextItemEditor, { cssClasses: cssClasses, itemCss: this.question.getItemCss(), question: item.editor, creator: this.creator })
|
|
8320
|
-
this.renderItemTooltipError(item, cssClasses)));
|
|
8321
|
-
};
|
|
8322
|
-
SurveyMultipleTextItem.prototype.renderItemTooltipError = function (item, cssClasses) {
|
|
8323
|
-
return this.item.editor.isErrorsModeTooltip ? (react__WEBPACK_IMPORTED_MODULE_0__["createElement"](_reactquestion__WEBPACK_IMPORTED_MODULE_2__["SurveyElementErrors"], { element: item.editor, cssClasses: cssClasses, creator: this.creator, location: "tooltip" })) : null;
|
|
8296
|
+
react__WEBPACK_IMPORTED_MODULE_0__["createElement"](SurveyMultipleTextItemEditor, { cssClasses: cssClasses, itemCss: this.question.getItemCss(), question: item.editor, creator: this.creator })));
|
|
8324
8297
|
};
|
|
8325
8298
|
return SurveyMultipleTextItem;
|
|
8326
8299
|
}(_reactquestion_element__WEBPACK_IMPORTED_MODULE_1__["ReactSurveyElement"]));
|