survey-js-ui 1.11.14 → 1.12.2
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-js-ui.js +158 -113
- package/survey-js-ui.js.map +1 -1
- package/survey-js-ui.min.js +2 -2
- package/typings/packages/survey-react-ui/src/components/matrix-actions/drag-drop-icon/drag-drop-icon.d.ts +2 -1
- package/typings/packages/survey-react-ui/src/components/text-area.d.ts +15 -0
- package/typings/packages/survey-react-ui/src/reactquestion_checkbox.d.ts +5 -1
- package/typings/packages/survey-react-ui/src/reactquestion_comment.d.ts +5 -18
- package/typings/packages/survey-react-ui/src/reactquestion_element.d.ts +2 -0
- package/typings/packages/survey-react-ui/src/reactquestion_radiogroup.d.ts +4 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "survey-js-ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.12.2",
|
|
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",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"typings": "./typings/src/entries/js-ui.d.ts",
|
|
24
24
|
"dependencies": {},
|
|
25
25
|
"peerDependencies": {
|
|
26
|
-
"survey-core": "1.
|
|
26
|
+
"survey-core": "1.12.2",
|
|
27
27
|
"@types/react-dom": "*",
|
|
28
28
|
"@types/react": "*"
|
|
29
29
|
}
|
package/survey-js-ui.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* surveyjs - Survey JavaScript library v1.
|
|
2
|
+
* surveyjs - Survey JavaScript library v1.12.2
|
|
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
|
*/
|
|
@@ -102,9 +102,9 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
102
102
|
/******/ ({
|
|
103
103
|
|
|
104
104
|
/***/ "./src/entries/js-ui.ts":
|
|
105
|
-
|
|
106
|
-
!*** ./src/entries/js-ui.ts +
|
|
107
|
-
|
|
105
|
+
/*!********************************************!*\
|
|
106
|
+
!*** ./src/entries/js-ui.ts + 100 modules ***!
|
|
107
|
+
\********************************************/
|
|
108
108
|
/*! exports provided: useState, useId, useReducer, useEffect, useLayoutEffect, useInsertionEffect, useTransition, useDeferredValue, useSyncExternalStore, startTransition, useRef, useImperativeHandle, useMemo, useCallback, useContext, useDebugValue, version, Children, render, hydrate, unmountComponentAtNode, createPortal, createElement, createContext, createFactory, cloneElement, createRef, Fragment, isValidElement, isFragment, isMemo, findDOMNode, Component, PureComponent, memo, forwardRef, flushSync, unstable_batchedUpdates, StrictMode, Suspense, SuspenseList, lazy, renderSurvey, renderPopupSurvey, preact, Survey, attachKey2click, ReactSurveyElementsWrapper, SurveyNavigationBase, SurveyTimerPanel, SurveyPage, SurveyRow, SurveyPanel, SurveyFlowPanel, SurveyQuestion, SurveyElementErrors, SurveyQuestionAndErrorsCell, ReactSurveyElement, SurveyElementBase, SurveyQuestionElementBase, SurveyQuestionCommentItem, SurveyQuestionComment, SurveyQuestionCheckbox, SurveyQuestionCheckboxItem, SurveyQuestionRanking, SurveyQuestionRankingItem, SurveyQuestionRankingItemContent, RatingItem, RatingItemStar, RatingItemSmiley, RatingDropdownItem, TagboxFilterString, SurveyQuestionOptionItem, SurveyQuestionDropdownBase, SurveyQuestionDropdown, SurveyQuestionTagboxItem, SurveyQuestionTagbox, SurveyQuestionDropdownSelect, SurveyQuestionMatrix, SurveyQuestionMatrixRow, SurveyQuestionMatrixCell, SurveyQuestionHtml, SurveyQuestionFile, SurveyFileChooseButton, SurveyFilePreview, SurveyQuestionMultipleText, SurveyQuestionRadiogroup, SurveyQuestionRadioItem, SurveyQuestionText, SurveyQuestionBoolean, SurveyQuestionBooleanCheckbox, SurveyQuestionBooleanRadio, SurveyQuestionEmpty, SurveyQuestionMatrixDropdownCell, SurveyQuestionMatrixDropdownBase, SurveyQuestionMatrixDropdown, SurveyQuestionMatrixDynamic, SurveyQuestionMatrixDynamicAddButton, SurveyQuestionPanelDynamic, SurveyProgress, SurveyProgressButtons, SurveyProgressToc, SurveyQuestionRating, SurveyQuestionRatingDropdown, SurveyQuestionExpression, PopupSurvey, SurveyWindow, ReactQuestionFactory, ReactElementFactory, SurveyQuestionImagePicker, SurveyQuestionImage, SurveyQuestionSignaturePad, SurveyQuestionButtonGroup, SurveyQuestionCustom, SurveyQuestionComposite, Popup, ListItemContent, ListItemGroup, List, TitleActions, TitleElement, SurveyActionBar, LogoImage, SurveyHeader, SvgIcon, SurveyQuestionMatrixDynamicRemoveButton, SurveyQuestionMatrixDetailButton, SurveyQuestionMatrixDynamicDragDropIcon, SurveyQuestionPanelDynamicAddButton, SurveyQuestionPanelDynamicRemoveButton, SurveyQuestionPanelDynamicPrevButton, SurveyQuestionPanelDynamicNextButton, SurveyQuestionPanelDynamicProgressText, SurveyNavigationButton, QuestionErrorComponent, MatrixRow, Skeleton, NotifierComponent, ComponentsContainer, CharacterCounterComponent, HeaderMobile, HeaderCell, Header, SurveyLocStringViewer, SurveyLocStringEditor, LoadingIndicatorComponent, SvgBundleComponent, SurveyModel, SurveyWindowModel, settings, surveyLocalization, surveyStrings, Model */
|
|
109
109
|
/*! ModuleConcatenation bailout: Cannot concat with external {"root":"Survey","commonjs2":"survey-core","commonjs":"survey-core","amd":"survey-core"} (<- Module is not an ECMAScript module) */
|
|
110
110
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
@@ -446,6 +446,7 @@ var reactquestion_element_SurveyElementBase = /** @class */ (function (_super) {
|
|
|
446
446
|
function SurveyElementBase(props) {
|
|
447
447
|
var _this = _super.call(this, props) || this;
|
|
448
448
|
_this._allowComponentUpdate = true;
|
|
449
|
+
_this.prevStateElements = [];
|
|
449
450
|
return _this;
|
|
450
451
|
}
|
|
451
452
|
SurveyElementBase.renderLocString = function (locStr, style, key) {
|
|
@@ -465,9 +466,14 @@ var reactquestion_element_SurveyElementBase = /** @class */ (function (_super) {
|
|
|
465
466
|
};
|
|
466
467
|
SurveyElementBase.prototype.componentWillUnmount = function () {
|
|
467
468
|
this.unMakeBaseElementsReact();
|
|
469
|
+
this.disableStateElementsRerenderEvent(this.getStateElements());
|
|
468
470
|
};
|
|
469
471
|
SurveyElementBase.prototype.componentDidUpdate = function (prevProps, prevState) {
|
|
472
|
+
var _a;
|
|
470
473
|
this.makeBaseElementsReact();
|
|
474
|
+
var stateElements = this.getStateElements();
|
|
475
|
+
this.disableStateElementsRerenderEvent(((_a = this.prevStateElements) !== null && _a !== void 0 ? _a : []).filter(function (el) { return !stateElements.includes(el); }));
|
|
476
|
+
this.prevStateElements = [];
|
|
471
477
|
this.getStateElements().forEach(function (el) {
|
|
472
478
|
el.afterRerender();
|
|
473
479
|
});
|
|
@@ -482,6 +488,7 @@ var reactquestion_element_SurveyElementBase = /** @class */ (function (_super) {
|
|
|
482
488
|
SurveyElementBase.prototype.shouldComponentUpdate = function (nextProps, nextState) {
|
|
483
489
|
if (this._allowComponentUpdate) {
|
|
484
490
|
this.unMakeBaseElementsReact();
|
|
491
|
+
this.prevStateElements = this.getStateElements();
|
|
485
492
|
}
|
|
486
493
|
return this._allowComponentUpdate;
|
|
487
494
|
};
|
|
@@ -549,10 +556,14 @@ var reactquestion_element_SurveyElementBase = /** @class */ (function (_super) {
|
|
|
549
556
|
SurveyElementBase.prototype.unMakeBaseElementsReact = function () {
|
|
550
557
|
var els = this.getStateElements();
|
|
551
558
|
for (var i = 0; i < els.length; i++) {
|
|
552
|
-
els[i].disableOnElementRenderedEvent();
|
|
553
559
|
this.unMakeBaseElementReact(els[i]);
|
|
554
560
|
}
|
|
555
561
|
};
|
|
562
|
+
SurveyElementBase.prototype.disableStateElementsRerenderEvent = function (els) {
|
|
563
|
+
els.forEach(function (el) {
|
|
564
|
+
el.disableOnElementRenderedEvent();
|
|
565
|
+
});
|
|
566
|
+
};
|
|
556
567
|
SurveyElementBase.prototype.getStateElements = function () {
|
|
557
568
|
var el = this.getStateElement();
|
|
558
569
|
return !!el ? [el] : [];
|
|
@@ -1740,28 +1751,27 @@ var title_content_TitleContent = /** @class */ (function (_super) {
|
|
|
1740
1751
|
};
|
|
1741
1752
|
var spans = [];
|
|
1742
1753
|
if (element.isRequireTextOnStart) {
|
|
1743
|
-
spans.push(this.renderRequireText(element
|
|
1754
|
+
spans.push(this.renderRequireText(element));
|
|
1744
1755
|
spans.push(getSpaceSpan("req-sp"));
|
|
1745
1756
|
}
|
|
1746
1757
|
var questionNumber = element.no;
|
|
1747
1758
|
if (questionNumber) {
|
|
1748
|
-
|
|
1749
|
-
spans.push(Rn.createElement("span", { "data-key": "q_num", key: "q_num", className: cssClasses.number || panelNumber, style: { position: "static" }, "aria-hidden": true }, questionNumber));
|
|
1759
|
+
spans.push(Rn.createElement("span", { "data-key": "q_num", key: "q_num", className: element.cssTitleNumber, style: { position: "static" }, "aria-hidden": true }, questionNumber));
|
|
1750
1760
|
spans.push(getSpaceSpan("num-sp"));
|
|
1751
1761
|
}
|
|
1752
1762
|
if (element.isRequireTextBeforeTitle) {
|
|
1753
|
-
spans.push(this.renderRequireText(element
|
|
1763
|
+
spans.push(this.renderRequireText(element));
|
|
1754
1764
|
spans.push(getSpaceSpan("req-sp"));
|
|
1755
1765
|
}
|
|
1756
1766
|
spans.push(reactquestion_element_SurveyElementBase.renderLocString(element.locTitle, null, "q_title"));
|
|
1757
1767
|
if (element.isRequireTextAfterTitle) {
|
|
1758
1768
|
spans.push(getSpaceSpan("req-sp"));
|
|
1759
|
-
spans.push(this.renderRequireText(element
|
|
1769
|
+
spans.push(this.renderRequireText(element));
|
|
1760
1770
|
}
|
|
1761
1771
|
return spans;
|
|
1762
1772
|
};
|
|
1763
|
-
TitleContent.prototype.renderRequireText = function (element
|
|
1764
|
-
return (Rn.createElement("span", { "data-key": "req-text", key: "req-text", className:
|
|
1773
|
+
TitleContent.prototype.renderRequireText = function (element) {
|
|
1774
|
+
return (Rn.createElement("span", { "data-key": "req-text", key: "req-text", className: element.cssRequiredText, "aria-hidden": true }, element.requiredText));
|
|
1765
1775
|
};
|
|
1766
1776
|
return TitleContent;
|
|
1767
1777
|
}(Rn.Component));
|
|
@@ -1937,6 +1947,56 @@ ReactElementFactory.Instance.registerElement("sv-character-counter", function (p
|
|
|
1937
1947
|
return Rn.createElement(character_counter_CharacterCounterComponent, props);
|
|
1938
1948
|
});
|
|
1939
1949
|
|
|
1950
|
+
// CONCATENATED MODULE: ./packages/survey-react-ui/src/components/text-area.tsx
|
|
1951
|
+
var text_area_extends = (undefined && undefined.__extends) || (function () {
|
|
1952
|
+
var extendStatics = function (d, b) {
|
|
1953
|
+
extendStatics = Object.setPrototypeOf ||
|
|
1954
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
1955
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
1956
|
+
return extendStatics(d, b);
|
|
1957
|
+
};
|
|
1958
|
+
return function (d, b) {
|
|
1959
|
+
if (typeof b !== "function" && b !== null)
|
|
1960
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
1961
|
+
extendStatics(d, b);
|
|
1962
|
+
function __() { this.constructor = d; }
|
|
1963
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
1964
|
+
};
|
|
1965
|
+
})();
|
|
1966
|
+
|
|
1967
|
+
|
|
1968
|
+
|
|
1969
|
+
var text_area_TextAreaComponent = /** @class */ (function (_super) {
|
|
1970
|
+
text_area_extends(TextAreaComponent, _super);
|
|
1971
|
+
function TextAreaComponent(props) {
|
|
1972
|
+
var _this = _super.call(this, props) || this;
|
|
1973
|
+
_this.initialValue = _this.viewModel.getTextValue() || "";
|
|
1974
|
+
return _this;
|
|
1975
|
+
}
|
|
1976
|
+
Object.defineProperty(TextAreaComponent.prototype, "viewModel", {
|
|
1977
|
+
get: function () {
|
|
1978
|
+
return this.props.viewModel;
|
|
1979
|
+
},
|
|
1980
|
+
enumerable: false,
|
|
1981
|
+
configurable: true
|
|
1982
|
+
});
|
|
1983
|
+
TextAreaComponent.prototype.canRender = function () {
|
|
1984
|
+
return !!this.viewModel.question;
|
|
1985
|
+
};
|
|
1986
|
+
TextAreaComponent.prototype.renderElement = function () {
|
|
1987
|
+
var _this = this;
|
|
1988
|
+
return (Rn.createElement("textarea", { id: this.viewModel.id, className: this.viewModel.className, ref: function (textarea) { return (_this.viewModel.setElement(textarea)); }, disabled: this.viewModel.isDisabledAttr, readOnly: this.viewModel.isReadOnlyAttr, rows: this.viewModel.rows, cols: this.viewModel.cols, placeholder: this.viewModel.placeholder, maxLength: this.viewModel.maxLength, defaultValue: this.initialValue, onChange: function (event) { _this.viewModel.onTextAreaInput(event); }, onFocus: function (event) { _this.viewModel.onTextAreaFocus(event); }, onBlur: function (event) { _this.viewModel.onTextAreaBlur(event); }, onKeyDown: function (event) { _this.viewModel.onTextAreaKeyDown(event); }, "aria-required": this.viewModel.ariaRequired, "aria-label": this.viewModel.ariaLabel, "aria-labelledby": this.viewModel.ariaLabelledBy, "aria-describedby": this.viewModel.ariaDescribedBy, "aria-invalid": this.viewModel.ariaInvalid, "aria-errormessage": this.viewModel.ariaErrormessage, style: { resize: this.viewModel.question.resizeStyle } }));
|
|
1989
|
+
};
|
|
1990
|
+
TextAreaComponent.prototype.componentWillUnmount = function () {
|
|
1991
|
+
this.viewModel.dispose();
|
|
1992
|
+
};
|
|
1993
|
+
return TextAreaComponent;
|
|
1994
|
+
}(reactquestion_element_SurveyElementBase));
|
|
1995
|
+
|
|
1996
|
+
ReactElementFactory.Instance.registerElement("sv-text-area", function (props) {
|
|
1997
|
+
return Rn.createElement(text_area_TextAreaComponent, props);
|
|
1998
|
+
});
|
|
1999
|
+
|
|
1940
2000
|
// CONCATENATED MODULE: ./packages/survey-react-ui/src/reactquestion_comment.tsx
|
|
1941
2001
|
var reactquestion_comment_extends = (undefined && undefined.__extends) || (function () {
|
|
1942
2002
|
var extendStatics = function (d, b) {
|
|
@@ -1963,31 +2023,21 @@ var reactquestion_comment_SurveyQuestionComment = /** @class */ (function (_supe
|
|
|
1963
2023
|
function SurveyQuestionComment(props) {
|
|
1964
2024
|
return _super.call(this, props) || this;
|
|
1965
2025
|
}
|
|
2026
|
+
SurveyQuestionComment.prototype.renderCharacterCounter = function () {
|
|
2027
|
+
var counter = null;
|
|
2028
|
+
if (!!this.question.getMaxLength()) {
|
|
2029
|
+
counter = preact_module_(character_counter_CharacterCounterComponent, { counter: this.question.characterCounter, remainingCharacterCounter: this.question.cssClasses.remainingCharacterCounter });
|
|
2030
|
+
}
|
|
2031
|
+
return counter;
|
|
2032
|
+
};
|
|
1966
2033
|
SurveyQuestionComment.prototype.renderElement = function () {
|
|
1967
|
-
var _this = this;
|
|
1968
|
-
var onBlur = function (e) {
|
|
1969
|
-
if (!_this.question.isInputTextUpdate) {
|
|
1970
|
-
_this.updateValueOnEvent(e);
|
|
1971
|
-
}
|
|
1972
|
-
_this.question.onBlur(e);
|
|
1973
|
-
};
|
|
1974
|
-
var onInput = function (event) {
|
|
1975
|
-
if (_this.question.isInputTextUpdate) {
|
|
1976
|
-
_this.updateValueOnEvent(event);
|
|
1977
|
-
}
|
|
1978
|
-
else {
|
|
1979
|
-
_this.question.updateElement();
|
|
1980
|
-
}
|
|
1981
|
-
var newValue = event.target.value;
|
|
1982
|
-
_this.question.updateRemainingCharacterCounter(newValue);
|
|
1983
|
-
};
|
|
1984
|
-
var placeholder = this.question.renderedPlaceholder;
|
|
1985
2034
|
if (this.question.isReadOnlyRenderDiv()) {
|
|
1986
2035
|
return preact_module_("div", null, this.question.value);
|
|
1987
2036
|
}
|
|
1988
|
-
var counter =
|
|
2037
|
+
var counter = this.renderCharacterCounter();
|
|
2038
|
+
var textAreaModel = this.props.question.textAreaModel;
|
|
1989
2039
|
return (preact_module_(k, null,
|
|
1990
|
-
preact_module_(
|
|
2040
|
+
preact_module_(text_area_TextAreaComponent, { viewModel: textAreaModel }),
|
|
1991
2041
|
counter));
|
|
1992
2042
|
};
|
|
1993
2043
|
return SurveyQuestionComment;
|
|
@@ -1997,61 +2047,22 @@ var reactquestion_comment_SurveyQuestionCommentItem = /** @class */ (function (_
|
|
|
1997
2047
|
reactquestion_comment_extends(SurveyQuestionCommentItem, _super);
|
|
1998
2048
|
function SurveyQuestionCommentItem(props) {
|
|
1999
2049
|
var _this = _super.call(this, props) || this;
|
|
2000
|
-
_this.
|
|
2050
|
+
_this.textAreaModel = _this.getTextAreaModel();
|
|
2001
2051
|
return _this;
|
|
2002
2052
|
}
|
|
2003
|
-
SurveyQuestionCommentItem.prototype.componentDidUpdate = function (prevProps, prevState) {
|
|
2004
|
-
_super.prototype.componentDidUpdate.call(this, prevProps, prevState);
|
|
2005
|
-
this.updateDomElement();
|
|
2006
|
-
};
|
|
2007
|
-
SurveyQuestionCommentItem.prototype.componentDidMount = function () {
|
|
2008
|
-
_super.prototype.componentDidMount.call(this);
|
|
2009
|
-
this.updateDomElement();
|
|
2010
|
-
};
|
|
2011
|
-
SurveyQuestionCommentItem.prototype.updateDomElement = function () {
|
|
2012
|
-
if (!!this.control) {
|
|
2013
|
-
var control = this.control;
|
|
2014
|
-
var newValue = this.getComment() || "";
|
|
2015
|
-
if (!external_root_Survey_commonjs2_survey_core_commonjs_survey_core_amd_survey_core_["Helpers"].isTwoValueEquals(newValue, control.value, false, true, false)) {
|
|
2016
|
-
control.value = newValue;
|
|
2017
|
-
}
|
|
2018
|
-
}
|
|
2019
|
-
};
|
|
2020
|
-
SurveyQuestionCommentItem.prototype.setControl = function (element) {
|
|
2021
|
-
if (!!element) {
|
|
2022
|
-
this.control = element;
|
|
2023
|
-
}
|
|
2024
|
-
};
|
|
2025
2053
|
SurveyQuestionCommentItem.prototype.canRender = function () {
|
|
2026
2054
|
return !!this.props.question;
|
|
2027
2055
|
};
|
|
2028
|
-
SurveyQuestionCommentItem.prototype.
|
|
2029
|
-
this.props.question.
|
|
2030
|
-
};
|
|
2031
|
-
SurveyQuestionCommentItem.prototype.onCommentInput = function (event) {
|
|
2032
|
-
this.props.question.onCommentInput(event);
|
|
2033
|
-
};
|
|
2034
|
-
SurveyQuestionCommentItem.prototype.getComment = function () {
|
|
2035
|
-
return this.props.question.comment;
|
|
2036
|
-
};
|
|
2037
|
-
SurveyQuestionCommentItem.prototype.setComment = function (value) {
|
|
2038
|
-
this.props.question.comment = value;
|
|
2039
|
-
};
|
|
2040
|
-
SurveyQuestionCommentItem.prototype.getId = function () {
|
|
2041
|
-
return this.props.question.commentId;
|
|
2042
|
-
};
|
|
2043
|
-
SurveyQuestionCommentItem.prototype.getPlaceholder = function () {
|
|
2044
|
-
return this.props.question.renderedCommentPlaceholder;
|
|
2056
|
+
SurveyQuestionCommentItem.prototype.getTextAreaModel = function () {
|
|
2057
|
+
return this.props.question.commentTextAreaModel;
|
|
2045
2058
|
};
|
|
2046
2059
|
SurveyQuestionCommentItem.prototype.renderElement = function () {
|
|
2047
|
-
var _this = this;
|
|
2048
2060
|
var question = this.props.question;
|
|
2049
|
-
var className = this.props.otherCss || this.cssClasses.comment;
|
|
2050
2061
|
if (question.isReadOnlyRenderDiv()) {
|
|
2051
|
-
var comment = this.
|
|
2062
|
+
var comment = this.textAreaModel.getTextValue() || "";
|
|
2052
2063
|
return preact_module_("div", null, comment);
|
|
2053
2064
|
}
|
|
2054
|
-
return (preact_module_(
|
|
2065
|
+
return (preact_module_(text_area_TextAreaComponent, { viewModel: this.textAreaModel }));
|
|
2055
2066
|
};
|
|
2056
2067
|
return SurveyQuestionCommentItem;
|
|
2057
2068
|
}(ReactSurveyElement));
|
|
@@ -2061,23 +2072,8 @@ var SurveyQuestionOtherValueItem = /** @class */ (function (_super) {
|
|
|
2061
2072
|
function SurveyQuestionOtherValueItem() {
|
|
2062
2073
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
2063
2074
|
}
|
|
2064
|
-
SurveyQuestionOtherValueItem.prototype.
|
|
2065
|
-
this.props.question.
|
|
2066
|
-
};
|
|
2067
|
-
SurveyQuestionOtherValueItem.prototype.onCommentInput = function (event) {
|
|
2068
|
-
this.props.question.onOtherValueInput(event);
|
|
2069
|
-
};
|
|
2070
|
-
SurveyQuestionOtherValueItem.prototype.getComment = function () {
|
|
2071
|
-
return this.props.question.otherValue;
|
|
2072
|
-
};
|
|
2073
|
-
SurveyQuestionOtherValueItem.prototype.setComment = function (value) {
|
|
2074
|
-
this.props.question.otherValue = value;
|
|
2075
|
-
};
|
|
2076
|
-
SurveyQuestionOtherValueItem.prototype.getId = function () {
|
|
2077
|
-
return this.props.question.otherId;
|
|
2078
|
-
};
|
|
2079
|
-
SurveyQuestionOtherValueItem.prototype.getPlaceholder = function () {
|
|
2080
|
-
return this.props.question.otherPlaceholder;
|
|
2075
|
+
SurveyQuestionOtherValueItem.prototype.getTextAreaModel = function () {
|
|
2076
|
+
return this.props.question.otherTextAreaModel;
|
|
2081
2077
|
};
|
|
2082
2078
|
return SurveyQuestionOtherValueItem;
|
|
2083
2079
|
}(reactquestion_comment_SurveyQuestionCommentItem));
|
|
@@ -3693,7 +3689,7 @@ var reactquestion_checkbox_SurveyQuestionCheckbox = /** @class */ (function (_su
|
|
|
3693
3689
|
var _this = this;
|
|
3694
3690
|
if (this.question.hasHeadItems) {
|
|
3695
3691
|
return this.question.headItems.map(function (item, ii) {
|
|
3696
|
-
return _this.renderItem(
|
|
3692
|
+
return _this.renderItem(item, false, _this.question.cssClasses);
|
|
3697
3693
|
});
|
|
3698
3694
|
}
|
|
3699
3695
|
};
|
|
@@ -3701,7 +3697,7 @@ var reactquestion_checkbox_SurveyQuestionCheckbox = /** @class */ (function (_su
|
|
|
3701
3697
|
var _this = this;
|
|
3702
3698
|
if (this.question.hasFootItems) {
|
|
3703
3699
|
return this.question.footItems.map(function (item, ii) {
|
|
3704
|
-
return _this.renderItem(
|
|
3700
|
+
return _this.renderItem(item, false, _this.question.cssClasses);
|
|
3705
3701
|
});
|
|
3706
3702
|
}
|
|
3707
3703
|
};
|
|
@@ -3712,7 +3708,7 @@ var reactquestion_checkbox_SurveyQuestionCheckbox = /** @class */ (function (_su
|
|
|
3712
3708
|
var _this = this;
|
|
3713
3709
|
return this.question.columns.map(function (column, ci) {
|
|
3714
3710
|
var items = column.map(function (item, ii) {
|
|
3715
|
-
return _this.renderItem(
|
|
3711
|
+
return _this.renderItem(item, ci === 0 && ii === 0, cssClasses, "" + ci + ii);
|
|
3716
3712
|
});
|
|
3717
3713
|
return (preact_module_("div", { key: "column" + ci + _this.question.getItemsColumnKey(column), className: _this.question.getColumnClass(), role: "presentation" }, items));
|
|
3718
3714
|
});
|
|
@@ -3728,8 +3724,8 @@ var reactquestion_checkbox_SurveyQuestionCheckbox = /** @class */ (function (_su
|
|
|
3728
3724
|
var renderedItems = [];
|
|
3729
3725
|
for (var i = 0; i < choices.length; i++) {
|
|
3730
3726
|
var item = choices[i];
|
|
3731
|
-
var key = "item" +
|
|
3732
|
-
var renderedItem = this.renderItem(
|
|
3727
|
+
var key = "item" + item.value;
|
|
3728
|
+
var renderedItem = this.renderItem(item, i == 0, cssClasses, "" + i);
|
|
3733
3729
|
if (!!renderedItem) {
|
|
3734
3730
|
renderedItems.push(renderedItem);
|
|
3735
3731
|
}
|
|
@@ -3748,9 +3744,9 @@ var reactquestion_checkbox_SurveyQuestionCheckbox = /** @class */ (function (_su
|
|
|
3748
3744
|
return (preact_module_("div", { className: this.question.getCommentAreaCss(true) },
|
|
3749
3745
|
preact_module_(SurveyQuestionOtherValueItem, { question: this.question, otherCss: cssClasses.other, cssClasses: cssClasses, isDisplayMode: this.isDisplayMode })));
|
|
3750
3746
|
};
|
|
3751
|
-
SurveyQuestionCheckbox.prototype.renderItem = function (
|
|
3747
|
+
SurveyQuestionCheckbox.prototype.renderItem = function (item, isFirst, cssClasses, index) {
|
|
3752
3748
|
var renderedItem = ReactElementFactory.Instance.createElement(this.question.itemComponent, {
|
|
3753
|
-
key:
|
|
3749
|
+
key: item.value,
|
|
3754
3750
|
question: this.question,
|
|
3755
3751
|
cssClasses: cssClasses,
|
|
3756
3752
|
isDisplayMode: this.isDisplayMode,
|
|
@@ -3776,6 +3772,7 @@ var reactquestion_checkbox_SurveyQuestionCheckboxItem = /** @class */ (function
|
|
|
3776
3772
|
_this.handleOnChange = function (event) {
|
|
3777
3773
|
_this.question.clickItemHandler(_this.item, event.target.checked);
|
|
3778
3774
|
};
|
|
3775
|
+
_this.rootRef = m();
|
|
3779
3776
|
return _this;
|
|
3780
3777
|
}
|
|
3781
3778
|
SurveyQuestionCheckboxItem.prototype.getStateElement = function () {
|
|
@@ -3823,11 +3820,20 @@ var reactquestion_checkbox_SurveyQuestionCheckboxItem = /** @class */ (function
|
|
|
3823
3820
|
enumerable: false,
|
|
3824
3821
|
configurable: true
|
|
3825
3822
|
});
|
|
3823
|
+
SurveyQuestionCheckboxItem.prototype.componentDidUpdate = function (prevProps, prevState) {
|
|
3824
|
+
_super.prototype.componentDidUpdate.call(this, prevProps, prevState);
|
|
3825
|
+
if (prevProps.item !== this.props.item && !this.question.isDesignMode) {
|
|
3826
|
+
if (this.props.item) {
|
|
3827
|
+
this.props.item.setRootElement(this.rootRef.current);
|
|
3828
|
+
}
|
|
3829
|
+
if (prevProps.item) {
|
|
3830
|
+
prevProps.item.setRootElement(undefined);
|
|
3831
|
+
}
|
|
3832
|
+
}
|
|
3833
|
+
};
|
|
3826
3834
|
SurveyQuestionCheckboxItem.prototype.shouldComponentUpdate = function (nextProps, nextState) {
|
|
3827
3835
|
if (!_super.prototype.shouldComponentUpdate.call(this, nextProps, nextState))
|
|
3828
3836
|
return false;
|
|
3829
|
-
if (!this.question)
|
|
3830
|
-
return false;
|
|
3831
3837
|
return (!this.question.customWidget ||
|
|
3832
3838
|
!!this.question.customWidgetData.isNeedRender ||
|
|
3833
3839
|
!!this.question.customWidget.widgetJson.isDefaultRender ||
|
|
@@ -3852,7 +3858,7 @@ var reactquestion_checkbox_SurveyQuestionCheckboxItem = /** @class */ (function
|
|
|
3852
3858
|
var itemClass = this.question.getItemClass(this.item);
|
|
3853
3859
|
var labelClass = this.question.getLabelClass(this.item);
|
|
3854
3860
|
var itemLabel = !this.hideCaption ? preact_module_("span", { className: this.cssClasses.controlLabel }, this.renderLocString(this.item.locText, this.textStyle)) : null;
|
|
3855
|
-
return (preact_module_("div", { className: itemClass, role: "presentation" },
|
|
3861
|
+
return (preact_module_("div", { className: itemClass, role: "presentation", ref: this.rootRef },
|
|
3856
3862
|
preact_module_("label", { className: labelClass },
|
|
3857
3863
|
preact_module_("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() }),
|
|
3858
3864
|
this.cssClasses.materialDecorator ?
|
|
@@ -3864,6 +3870,18 @@ var reactquestion_checkbox_SurveyQuestionCheckboxItem = /** @class */ (function
|
|
|
3864
3870
|
itemLabel),
|
|
3865
3871
|
otherItem));
|
|
3866
3872
|
};
|
|
3873
|
+
SurveyQuestionCheckboxItem.prototype.componentDidMount = function () {
|
|
3874
|
+
_super.prototype.componentDidMount.call(this);
|
|
3875
|
+
if (!this.question.isDesignMode) {
|
|
3876
|
+
this.item.setRootElement(this.rootRef.current);
|
|
3877
|
+
}
|
|
3878
|
+
};
|
|
3879
|
+
SurveyQuestionCheckboxItem.prototype.componentWillUnmount = function () {
|
|
3880
|
+
_super.prototype.componentWillUnmount.call(this);
|
|
3881
|
+
if (!this.question.isDesignMode) {
|
|
3882
|
+
this.item.setRootElement(undefined);
|
|
3883
|
+
}
|
|
3884
|
+
};
|
|
3867
3885
|
return SurveyQuestionCheckboxItem;
|
|
3868
3886
|
}(ReactSurveyElement));
|
|
3869
3887
|
|
|
@@ -4388,10 +4406,10 @@ var tagbox_filter_TagboxFilterString = /** @class */ (function (_super) {
|
|
|
4388
4406
|
this.model.inputKeyHandler(e);
|
|
4389
4407
|
};
|
|
4390
4408
|
TagboxFilterString.prototype.onBlur = function (e) {
|
|
4391
|
-
this.
|
|
4409
|
+
this.question.onBlur(e);
|
|
4392
4410
|
};
|
|
4393
4411
|
TagboxFilterString.prototype.onFocus = function (e) {
|
|
4394
|
-
this.
|
|
4412
|
+
this.question.onFocus(e);
|
|
4395
4413
|
};
|
|
4396
4414
|
TagboxFilterString.prototype.getStateElement = function () {
|
|
4397
4415
|
return this.model;
|
|
@@ -5606,7 +5624,7 @@ var reactquestion_radiogroup_SurveyQuestionRadiogroup = /** @class */ (function
|
|
|
5606
5624
|
var _this = this;
|
|
5607
5625
|
if (this.question.hasFootItems) {
|
|
5608
5626
|
return this.question.footItems.map(function (item, ii) {
|
|
5609
|
-
return _this.renderItem(
|
|
5627
|
+
return _this.renderItem(item, false, _this.question.cssClasses);
|
|
5610
5628
|
});
|
|
5611
5629
|
}
|
|
5612
5630
|
};
|
|
@@ -5618,7 +5636,7 @@ var reactquestion_radiogroup_SurveyQuestionRadiogroup = /** @class */ (function
|
|
|
5618
5636
|
var value = this.getStateValue();
|
|
5619
5637
|
return this.question.columns.map(function (column, ci) {
|
|
5620
5638
|
var items = column.map(function (item, ii) {
|
|
5621
|
-
return _this.renderItem(
|
|
5639
|
+
return _this.renderItem(item, value, cssClasses, "" + ci + ii);
|
|
5622
5640
|
});
|
|
5623
5641
|
return (preact_module_("div", { key: "column" + ci + _this.question.getItemsColumnKey(column), className: _this.question.getColumnClass(), role: "presentation" }, items));
|
|
5624
5642
|
});
|
|
@@ -5635,7 +5653,7 @@ var reactquestion_radiogroup_SurveyQuestionRadiogroup = /** @class */ (function
|
|
|
5635
5653
|
var value = this.getStateValue();
|
|
5636
5654
|
for (var i = 0; i < choices.length; i++) {
|
|
5637
5655
|
var item = choices[i];
|
|
5638
|
-
var renderedItem = this.renderItem(
|
|
5656
|
+
var renderedItem = this.renderItem(item, value, cssClasses, "" + i);
|
|
5639
5657
|
items.push(renderedItem);
|
|
5640
5658
|
}
|
|
5641
5659
|
return items;
|
|
@@ -5651,9 +5669,9 @@ var reactquestion_radiogroup_SurveyQuestionRadiogroup = /** @class */ (function
|
|
|
5651
5669
|
return (preact_module_("div", { className: this.question.getCommentAreaCss(true) },
|
|
5652
5670
|
preact_module_(SurveyQuestionOtherValueItem, { question: this.question, otherCss: cssClasses.other, cssClasses: cssClasses, isDisplayMode: this.isDisplayMode })));
|
|
5653
5671
|
};
|
|
5654
|
-
SurveyQuestionRadiogroup.prototype.renderItem = function (
|
|
5672
|
+
SurveyQuestionRadiogroup.prototype.renderItem = function (item, value, cssClasses, index) {
|
|
5655
5673
|
var renderedItem = ReactElementFactory.Instance.createElement(this.question.itemComponent, {
|
|
5656
|
-
key:
|
|
5674
|
+
key: item.value,
|
|
5657
5675
|
question: this.question,
|
|
5658
5676
|
cssClasses: cssClasses,
|
|
5659
5677
|
isDisplayMode: this.isDisplayMode,
|
|
@@ -5679,6 +5697,7 @@ var reactquestion_radiogroup_SurveyQuestionRadioItem = /** @class */ (function (
|
|
|
5679
5697
|
reactquestion_radiogroup_extends(SurveyQuestionRadioItem, _super);
|
|
5680
5698
|
function SurveyQuestionRadioItem(props) {
|
|
5681
5699
|
var _this = _super.call(this, props) || this;
|
|
5700
|
+
_this.rootRef = m();
|
|
5682
5701
|
_this.handleOnChange = _this.handleOnChange.bind(_this);
|
|
5683
5702
|
_this.handleOnMouseDown = _this.handleOnMouseDown.bind(_this);
|
|
5684
5703
|
return _this;
|
|
@@ -5747,12 +5766,23 @@ var reactquestion_radiogroup_SurveyQuestionRadioItem = /** @class */ (function (
|
|
|
5747
5766
|
SurveyQuestionRadioItem.prototype.canRender = function () {
|
|
5748
5767
|
return !!this.question && !!this.item;
|
|
5749
5768
|
};
|
|
5769
|
+
SurveyQuestionRadioItem.prototype.componentDidUpdate = function (prevProps, prevState) {
|
|
5770
|
+
_super.prototype.componentDidUpdate.call(this, prevProps, prevState);
|
|
5771
|
+
if (prevProps.item !== this.props.item && !this.question.isDesignMode) {
|
|
5772
|
+
if (this.props.item) {
|
|
5773
|
+
this.props.item.setRootElement(this.rootRef.current);
|
|
5774
|
+
}
|
|
5775
|
+
if (prevProps.item) {
|
|
5776
|
+
prevProps.item.setRootElement(undefined);
|
|
5777
|
+
}
|
|
5778
|
+
}
|
|
5779
|
+
};
|
|
5750
5780
|
SurveyQuestionRadioItem.prototype.renderElement = function () {
|
|
5751
5781
|
var itemClass = this.question.getItemClass(this.item);
|
|
5752
5782
|
var labelClass = this.question.getLabelClass(this.item);
|
|
5753
5783
|
var controlLabelClass = this.question.getControlLabelClass(this.item);
|
|
5754
5784
|
var itemLabel = !this.hideCaption ? preact_module_("span", { className: controlLabelClass }, this.renderLocString(this.item.locText, this.textStyle)) : null;
|
|
5755
|
-
return (preact_module_("div", { className: itemClass, role: "presentation" },
|
|
5785
|
+
return (preact_module_("div", { className: itemClass, role: "presentation", ref: this.rootRef },
|
|
5756
5786
|
preact_module_("label", { onMouseDown: this.handleOnMouseDown, className: labelClass },
|
|
5757
5787
|
preact_module_("input", { "aria-errormessage": this.question.ariaErrormessage, className: this.cssClasses.itemControl, id: this.question.getItemId(this.item), type: "radio", name: this.question.questionName, checked: this.isChecked, value: this.item.value, disabled: !this.question.getItemEnabled(this.item), readOnly: this.question.isReadOnlyAttr, onChange: this.handleOnChange }),
|
|
5758
5788
|
this.cssClasses.materialDecorator ?
|
|
@@ -5763,6 +5793,18 @@ var reactquestion_radiogroup_SurveyQuestionRadioItem = /** @class */ (function (
|
|
|
5763
5793
|
null,
|
|
5764
5794
|
itemLabel)));
|
|
5765
5795
|
};
|
|
5796
|
+
SurveyQuestionRadioItem.prototype.componentDidMount = function () {
|
|
5797
|
+
_super.prototype.componentDidMount.call(this);
|
|
5798
|
+
if (!this.question.isDesignMode) {
|
|
5799
|
+
this.item.setRootElement(this.rootRef.current);
|
|
5800
|
+
}
|
|
5801
|
+
};
|
|
5802
|
+
SurveyQuestionRadioItem.prototype.componentWillUnmount = function () {
|
|
5803
|
+
_super.prototype.componentWillUnmount.call(this);
|
|
5804
|
+
if (!this.question.isDesignMode) {
|
|
5805
|
+
this.item.setRootElement(undefined);
|
|
5806
|
+
}
|
|
5807
|
+
};
|
|
5766
5808
|
return SurveyQuestionRadioItem;
|
|
5767
5809
|
}(ReactSurveyElement));
|
|
5768
5810
|
|
|
@@ -6220,6 +6262,9 @@ var drag_drop_icon_SurveyQuestionMatrixDynamicDragDropIcon = /** @class */ (func
|
|
|
6220
6262
|
configurable: true
|
|
6221
6263
|
});
|
|
6222
6264
|
SurveyQuestionMatrixDynamicDragDropIcon.prototype.renderElement = function () {
|
|
6265
|
+
return Rn.createElement("div", null, this.renderIcon());
|
|
6266
|
+
};
|
|
6267
|
+
SurveyQuestionMatrixDynamicDragDropIcon.prototype.renderIcon = function () {
|
|
6223
6268
|
if (this.question.iconDragElement) {
|
|
6224
6269
|
return (Rn.createElement("svg", { className: this.question.cssClasses.dragElementDecorator },
|
|
6225
6270
|
Rn.createElement("use", { xlinkHref: this.question.iconDragElement })));
|
|
@@ -6850,7 +6895,7 @@ var paneldynamic_add_btn_SurveyQuestionPanelDynamicAddButton = /** @class */ (fu
|
|
|
6850
6895
|
if (!this.question.canAddPanel)
|
|
6851
6896
|
return null;
|
|
6852
6897
|
var btnText = this.renderLocString(this.question.locPanelAddText);
|
|
6853
|
-
return (Rn.createElement("button", { type: "button", className: this.question.getAddButtonCss(), onClick: this.handleClick },
|
|
6898
|
+
return (Rn.createElement("button", { type: "button", id: this.question.addButtonId, className: this.question.getAddButtonCss(), onClick: this.handleClick },
|
|
6854
6899
|
Rn.createElement("span", { className: this.question.cssClasses.buttonAddText }, btnText)));
|
|
6855
6900
|
};
|
|
6856
6901
|
return SurveyQuestionPanelDynamicAddButton;
|
|
@@ -9337,7 +9382,7 @@ var preact = compat_module_namespaceObject;
|
|
|
9337
9382
|
|
|
9338
9383
|
|
|
9339
9384
|
|
|
9340
|
-
Object(external_root_Survey_commonjs2_survey_core_commonjs_survey_core_amd_survey_core_["checkLibraryVersion"])("" + "1.
|
|
9385
|
+
Object(external_root_Survey_commonjs2_survey_core_commonjs_survey_core_amd_survey_core_["checkLibraryVersion"])("" + "1.12.2", "survey-js-ui");
|
|
9341
9386
|
|
|
9342
9387
|
|
|
9343
9388
|
/***/ }),
|