survey-react-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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "survey-react-ui",
3
- "version": "1.11.14",
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",
@@ -21,7 +21,7 @@
21
21
  },
22
22
  "typings": "./typings/src/entries/react-ui.d.ts",
23
23
  "peerDependencies": {
24
- "survey-core": "1.11.14",
24
+ "survey-core": "1.12.2",
25
25
  "react": "^16.5.0 || ^17.0.1 || ^18.2.0",
26
26
  "react-dom": "^16.5.0 || ^17.0.1 || ^18.2.0"
27
27
  }
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - Survey JavaScript library v1.11.14
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
  */
@@ -103,7 +103,7 @@ return /******/ (function(modules) { // webpackBootstrap
103
103
 
104
104
  /***/ "./src/entries/react-ui.ts":
105
105
  /*!**********************************************!*\
106
- !*** ./src/entries/react-ui.ts + 95 modules ***!
106
+ !*** ./src/entries/react-ui.ts + 96 modules ***!
107
107
  \**********************************************/
108
108
  /*! exports provided: 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, Model, settings, surveyLocalization, surveyStrings */
109
109
  /*! ModuleConcatenation bailout: Cannot concat with external {"root":"React","commonjs2":"react","commonjs":"react","amd":"react"} (<- Module is not an ECMAScript module) */
@@ -345,6 +345,7 @@ var reactquestion_element_SurveyElementBase = /** @class */ (function (_super) {
345
345
  function SurveyElementBase(props) {
346
346
  var _this = _super.call(this, props) || this;
347
347
  _this._allowComponentUpdate = true;
348
+ _this.prevStateElements = [];
348
349
  return _this;
349
350
  }
350
351
  SurveyElementBase.renderLocString = function (locStr, style, key) {
@@ -364,9 +365,14 @@ var reactquestion_element_SurveyElementBase = /** @class */ (function (_super) {
364
365
  };
365
366
  SurveyElementBase.prototype.componentWillUnmount = function () {
366
367
  this.unMakeBaseElementsReact();
368
+ this.disableStateElementsRerenderEvent(this.getStateElements());
367
369
  };
368
370
  SurveyElementBase.prototype.componentDidUpdate = function (prevProps, prevState) {
371
+ var _a;
369
372
  this.makeBaseElementsReact();
373
+ var stateElements = this.getStateElements();
374
+ this.disableStateElementsRerenderEvent(((_a = this.prevStateElements) !== null && _a !== void 0 ? _a : []).filter(function (el) { return !stateElements.includes(el); }));
375
+ this.prevStateElements = [];
370
376
  this.getStateElements().forEach(function (el) {
371
377
  el.afterRerender();
372
378
  });
@@ -381,6 +387,7 @@ var reactquestion_element_SurveyElementBase = /** @class */ (function (_super) {
381
387
  SurveyElementBase.prototype.shouldComponentUpdate = function (nextProps, nextState) {
382
388
  if (this._allowComponentUpdate) {
383
389
  this.unMakeBaseElementsReact();
390
+ this.prevStateElements = this.getStateElements();
384
391
  }
385
392
  return this._allowComponentUpdate;
386
393
  };
@@ -448,10 +455,14 @@ var reactquestion_element_SurveyElementBase = /** @class */ (function (_super) {
448
455
  SurveyElementBase.prototype.unMakeBaseElementsReact = function () {
449
456
  var els = this.getStateElements();
450
457
  for (var i = 0; i < els.length; i++) {
451
- els[i].disableOnElementRenderedEvent();
452
458
  this.unMakeBaseElementReact(els[i]);
453
459
  }
454
460
  };
461
+ SurveyElementBase.prototype.disableStateElementsRerenderEvent = function (els) {
462
+ els.forEach(function (el) {
463
+ el.disableOnElementRenderedEvent();
464
+ });
465
+ };
455
466
  SurveyElementBase.prototype.getStateElements = function () {
456
467
  var el = this.getStateElement();
457
468
  return !!el ? [el] : [];
@@ -1643,28 +1654,27 @@ var title_content_TitleContent = /** @class */ (function (_super) {
1643
1654
  };
1644
1655
  var spans = [];
1645
1656
  if (element.isRequireTextOnStart) {
1646
- spans.push(this.renderRequireText(element, cssClasses));
1657
+ spans.push(this.renderRequireText(element));
1647
1658
  spans.push(getSpaceSpan("req-sp"));
1648
1659
  }
1649
1660
  var questionNumber = element.no;
1650
1661
  if (questionNumber) {
1651
- var panelNumber = !!cssClasses.panel ? cssClasses.panel.number : undefined;
1652
- spans.push(external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("span", { "data-key": "q_num", key: "q_num", className: cssClasses.number || panelNumber, style: { position: "static" }, "aria-hidden": true }, questionNumber));
1662
+ spans.push(external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("span", { "data-key": "q_num", key: "q_num", className: element.cssTitleNumber, style: { position: "static" }, "aria-hidden": true }, questionNumber));
1653
1663
  spans.push(getSpaceSpan("num-sp"));
1654
1664
  }
1655
1665
  if (element.isRequireTextBeforeTitle) {
1656
- spans.push(this.renderRequireText(element, cssClasses));
1666
+ spans.push(this.renderRequireText(element));
1657
1667
  spans.push(getSpaceSpan("req-sp"));
1658
1668
  }
1659
1669
  spans.push(reactquestion_element_SurveyElementBase.renderLocString(element.locTitle, null, "q_title"));
1660
1670
  if (element.isRequireTextAfterTitle) {
1661
1671
  spans.push(getSpaceSpan("req-sp"));
1662
- spans.push(this.renderRequireText(element, cssClasses));
1672
+ spans.push(this.renderRequireText(element));
1663
1673
  }
1664
1674
  return spans;
1665
1675
  };
1666
- TitleContent.prototype.renderRequireText = function (element, cssClasses) {
1667
- return (external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("span", { "data-key": "req-text", key: "req-text", className: cssClasses.requiredText || cssClasses.panel.requiredText, "aria-hidden": true }, element.requiredText));
1676
+ TitleContent.prototype.renderRequireText = function (element) {
1677
+ return (external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("span", { "data-key": "req-text", key: "req-text", className: element.cssRequiredText, "aria-hidden": true }, element.requiredText));
1668
1678
  };
1669
1679
  return TitleContent;
1670
1680
  }(external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.Component));
@@ -1840,6 +1850,56 @@ ReactElementFactory.Instance.registerElement("sv-character-counter", function (p
1840
1850
  return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(character_counter_CharacterCounterComponent, props);
1841
1851
  });
1842
1852
 
1853
+ // CONCATENATED MODULE: ./packages/survey-react-ui/src/components/text-area.tsx
1854
+ var text_area_extends = (undefined && undefined.__extends) || (function () {
1855
+ var extendStatics = function (d, b) {
1856
+ extendStatics = Object.setPrototypeOf ||
1857
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
1858
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
1859
+ return extendStatics(d, b);
1860
+ };
1861
+ return function (d, b) {
1862
+ if (typeof b !== "function" && b !== null)
1863
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
1864
+ extendStatics(d, b);
1865
+ function __() { this.constructor = d; }
1866
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
1867
+ };
1868
+ })();
1869
+
1870
+
1871
+
1872
+ var text_area_TextAreaComponent = /** @class */ (function (_super) {
1873
+ text_area_extends(TextAreaComponent, _super);
1874
+ function TextAreaComponent(props) {
1875
+ var _this = _super.call(this, props) || this;
1876
+ _this.initialValue = _this.viewModel.getTextValue() || "";
1877
+ return _this;
1878
+ }
1879
+ Object.defineProperty(TextAreaComponent.prototype, "viewModel", {
1880
+ get: function () {
1881
+ return this.props.viewModel;
1882
+ },
1883
+ enumerable: false,
1884
+ configurable: true
1885
+ });
1886
+ TextAreaComponent.prototype.canRender = function () {
1887
+ return !!this.viewModel.question;
1888
+ };
1889
+ TextAreaComponent.prototype.renderElement = function () {
1890
+ var _this = this;
1891
+ return (external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.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 } }));
1892
+ };
1893
+ TextAreaComponent.prototype.componentWillUnmount = function () {
1894
+ this.viewModel.dispose();
1895
+ };
1896
+ return TextAreaComponent;
1897
+ }(reactquestion_element_SurveyElementBase));
1898
+
1899
+ ReactElementFactory.Instance.registerElement("sv-text-area", function (props) {
1900
+ return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(text_area_TextAreaComponent, props);
1901
+ });
1902
+
1843
1903
  // CONCATENATED MODULE: ./packages/survey-react-ui/src/reactquestion_comment.tsx
1844
1904
  var reactquestion_comment_extends = (undefined && undefined.__extends) || (function () {
1845
1905
  var extendStatics = function (d, b) {
@@ -1866,31 +1926,21 @@ var reactquestion_comment_SurveyQuestionComment = /** @class */ (function (_supe
1866
1926
  function SurveyQuestionComment(props) {
1867
1927
  return _super.call(this, props) || this;
1868
1928
  }
1929
+ SurveyQuestionComment.prototype.renderCharacterCounter = function () {
1930
+ var counter = null;
1931
+ if (!!this.question.getMaxLength()) {
1932
+ counter = external_root_React_commonjs2_react_commonjs_react_amd_react_["createElement"](character_counter_CharacterCounterComponent, { counter: this.question.characterCounter, remainingCharacterCounter: this.question.cssClasses.remainingCharacterCounter });
1933
+ }
1934
+ return counter;
1935
+ };
1869
1936
  SurveyQuestionComment.prototype.renderElement = function () {
1870
- var _this = this;
1871
- var onBlur = function (e) {
1872
- if (!_this.question.isInputTextUpdate) {
1873
- _this.updateValueOnEvent(e);
1874
- }
1875
- _this.question.onBlur(e);
1876
- };
1877
- var onInput = function (event) {
1878
- if (_this.question.isInputTextUpdate) {
1879
- _this.updateValueOnEvent(event);
1880
- }
1881
- else {
1882
- _this.question.updateElement();
1883
- }
1884
- var newValue = event.target.value;
1885
- _this.question.updateRemainingCharacterCounter(newValue);
1886
- };
1887
- var placeholder = this.question.renderedPlaceholder;
1888
1937
  if (this.question.isReadOnlyRenderDiv()) {
1889
1938
  return external_root_React_commonjs2_react_commonjs_react_amd_react_["createElement"]("div", null, this.question.value);
1890
1939
  }
1891
- var counter = !!this.question.getMaxLength() ? (external_root_React_commonjs2_react_commonjs_react_amd_react_["createElement"](character_counter_CharacterCounterComponent, { counter: this.question.characterCounter, remainingCharacterCounter: this.question.cssClasses.remainingCharacterCounter })) : null;
1940
+ var counter = this.renderCharacterCounter();
1941
+ var textAreaModel = this.props.question.textAreaModel;
1892
1942
  return (external_root_React_commonjs2_react_commonjs_react_amd_react_["createElement"](external_root_React_commonjs2_react_commonjs_react_amd_react_["Fragment"], null,
1893
- external_root_React_commonjs2_react_commonjs_react_amd_react_["createElement"]("textarea", { id: this.question.inputId, className: this.question.className, disabled: this.question.isDisabledAttr, readOnly: this.question.isReadOnlyAttr, ref: function (textarea) { return (_this.setControl(textarea)); }, maxLength: this.question.getMaxLength(), placeholder: placeholder, onFocus: function (event) { _this.question.onFocus(event); }, 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-describedby": this.question.a11y_input_ariaDescribedBy, "aria-invalid": this.question.a11y_input_ariaInvalid, "aria-errormessage": this.question.a11y_input_ariaErrormessage, style: { resize: this.question.resizeStyle } }),
1943
+ external_root_React_commonjs2_react_commonjs_react_amd_react_["createElement"](text_area_TextAreaComponent, { viewModel: textAreaModel }),
1894
1944
  counter));
1895
1945
  };
1896
1946
  return SurveyQuestionComment;
@@ -1900,61 +1950,22 @@ var reactquestion_comment_SurveyQuestionCommentItem = /** @class */ (function (_
1900
1950
  reactquestion_comment_extends(SurveyQuestionCommentItem, _super);
1901
1951
  function SurveyQuestionCommentItem(props) {
1902
1952
  var _this = _super.call(this, props) || this;
1903
- _this.state = { comment: _this.getComment() || "" };
1953
+ _this.textAreaModel = _this.getTextAreaModel();
1904
1954
  return _this;
1905
1955
  }
1906
- SurveyQuestionCommentItem.prototype.componentDidUpdate = function (prevProps, prevState) {
1907
- _super.prototype.componentDidUpdate.call(this, prevProps, prevState);
1908
- this.updateDomElement();
1909
- };
1910
- SurveyQuestionCommentItem.prototype.componentDidMount = function () {
1911
- _super.prototype.componentDidMount.call(this);
1912
- this.updateDomElement();
1913
- };
1914
- SurveyQuestionCommentItem.prototype.updateDomElement = function () {
1915
- if (!!this.control) {
1916
- var control = this.control;
1917
- var newValue = this.getComment() || "";
1918
- if (!external_root_Survey_commonjs2_survey_core_commonjs_survey_core_amd_survey_core_["Helpers"].isTwoValueEquals(newValue, control.value, false, true, false)) {
1919
- control.value = newValue;
1920
- }
1921
- }
1922
- };
1923
- SurveyQuestionCommentItem.prototype.setControl = function (element) {
1924
- if (!!element) {
1925
- this.control = element;
1926
- }
1927
- };
1928
1956
  SurveyQuestionCommentItem.prototype.canRender = function () {
1929
1957
  return !!this.props.question;
1930
1958
  };
1931
- SurveyQuestionCommentItem.prototype.onCommentChange = function (event) {
1932
- this.props.question.onCommentChange(event);
1933
- };
1934
- SurveyQuestionCommentItem.prototype.onCommentInput = function (event) {
1935
- this.props.question.onCommentInput(event);
1936
- };
1937
- SurveyQuestionCommentItem.prototype.getComment = function () {
1938
- return this.props.question.comment;
1939
- };
1940
- SurveyQuestionCommentItem.prototype.setComment = function (value) {
1941
- this.props.question.comment = value;
1942
- };
1943
- SurveyQuestionCommentItem.prototype.getId = function () {
1944
- return this.props.question.commentId;
1945
- };
1946
- SurveyQuestionCommentItem.prototype.getPlaceholder = function () {
1947
- return this.props.question.renderedCommentPlaceholder;
1959
+ SurveyQuestionCommentItem.prototype.getTextAreaModel = function () {
1960
+ return this.props.question.commentTextAreaModel;
1948
1961
  };
1949
1962
  SurveyQuestionCommentItem.prototype.renderElement = function () {
1950
- var _this = this;
1951
1963
  var question = this.props.question;
1952
- var className = this.props.otherCss || this.cssClasses.comment;
1953
1964
  if (question.isReadOnlyRenderDiv()) {
1954
- var comment = this.getComment() || "";
1965
+ var comment = this.textAreaModel.getTextValue() || "";
1955
1966
  return external_root_React_commonjs2_react_commonjs_react_amd_react_["createElement"]("div", null, comment);
1956
1967
  }
1957
- return (external_root_React_commonjs2_react_commonjs_react_amd_react_["createElement"]("textarea", { id: this.getId(), className: className, ref: function (textarea) { return (_this.setControl(textarea)); }, disabled: this.isDisplayMode, maxLength: question.getOthersMaxLength(), rows: question.commentAreaRows, placeholder: this.getPlaceholder(), onBlur: function (e) { _this.onCommentChange(e); }, onInput: function (e) { return _this.onCommentInput(e); }, "aria-required": question.isRequired || question.a11y_input_ariaRequired, "aria-label": question.ariaLabel || question.a11y_input_ariaLabel, style: { resize: question.resizeStyle } }));
1968
+ return (external_root_React_commonjs2_react_commonjs_react_amd_react_["createElement"](text_area_TextAreaComponent, { viewModel: this.textAreaModel }));
1958
1969
  };
1959
1970
  return SurveyQuestionCommentItem;
1960
1971
  }(ReactSurveyElement));
@@ -1964,23 +1975,8 @@ var SurveyQuestionOtherValueItem = /** @class */ (function (_super) {
1964
1975
  function SurveyQuestionOtherValueItem() {
1965
1976
  return _super !== null && _super.apply(this, arguments) || this;
1966
1977
  }
1967
- SurveyQuestionOtherValueItem.prototype.onCommentChange = function (event) {
1968
- this.props.question.onOtherValueChange(event);
1969
- };
1970
- SurveyQuestionOtherValueItem.prototype.onCommentInput = function (event) {
1971
- this.props.question.onOtherValueInput(event);
1972
- };
1973
- SurveyQuestionOtherValueItem.prototype.getComment = function () {
1974
- return this.props.question.otherValue;
1975
- };
1976
- SurveyQuestionOtherValueItem.prototype.setComment = function (value) {
1977
- this.props.question.otherValue = value;
1978
- };
1979
- SurveyQuestionOtherValueItem.prototype.getId = function () {
1980
- return this.props.question.otherId;
1981
- };
1982
- SurveyQuestionOtherValueItem.prototype.getPlaceholder = function () {
1983
- return this.props.question.otherPlaceholder;
1978
+ SurveyQuestionOtherValueItem.prototype.getTextAreaModel = function () {
1979
+ return this.props.question.otherTextAreaModel;
1984
1980
  };
1985
1981
  return SurveyQuestionOtherValueItem;
1986
1982
  }(reactquestion_comment_SurveyQuestionCommentItem));
@@ -3596,7 +3592,7 @@ var reactquestion_checkbox_SurveyQuestionCheckbox = /** @class */ (function (_su
3596
3592
  var _this = this;
3597
3593
  if (this.question.hasHeadItems) {
3598
3594
  return this.question.headItems.map(function (item, ii) {
3599
- return _this.renderItem("item_h" + ii, item, false, _this.question.cssClasses);
3595
+ return _this.renderItem(item, false, _this.question.cssClasses);
3600
3596
  });
3601
3597
  }
3602
3598
  };
@@ -3604,7 +3600,7 @@ var reactquestion_checkbox_SurveyQuestionCheckbox = /** @class */ (function (_su
3604
3600
  var _this = this;
3605
3601
  if (this.question.hasFootItems) {
3606
3602
  return this.question.footItems.map(function (item, ii) {
3607
- return _this.renderItem("item_f" + ii, item, false, _this.question.cssClasses);
3603
+ return _this.renderItem(item, false, _this.question.cssClasses);
3608
3604
  });
3609
3605
  }
3610
3606
  };
@@ -3615,7 +3611,7 @@ var reactquestion_checkbox_SurveyQuestionCheckbox = /** @class */ (function (_su
3615
3611
  var _this = this;
3616
3612
  return this.question.columns.map(function (column, ci) {
3617
3613
  var items = column.map(function (item, ii) {
3618
- return _this.renderItem("item" + ii, item, ci === 0 && ii === 0, cssClasses, "" + ci + ii);
3614
+ return _this.renderItem(item, ci === 0 && ii === 0, cssClasses, "" + ci + ii);
3619
3615
  });
3620
3616
  return (external_root_React_commonjs2_react_commonjs_react_amd_react_["createElement"]("div", { key: "column" + ci + _this.question.getItemsColumnKey(column), className: _this.question.getColumnClass(), role: "presentation" }, items));
3621
3617
  });
@@ -3631,8 +3627,8 @@ var reactquestion_checkbox_SurveyQuestionCheckbox = /** @class */ (function (_su
3631
3627
  var renderedItems = [];
3632
3628
  for (var i = 0; i < choices.length; i++) {
3633
3629
  var item = choices[i];
3634
- var key = "item" + i;
3635
- var renderedItem = this.renderItem(key, item, i == 0, cssClasses, "" + i);
3630
+ var key = "item" + item.value;
3631
+ var renderedItem = this.renderItem(item, i == 0, cssClasses, "" + i);
3636
3632
  if (!!renderedItem) {
3637
3633
  renderedItems.push(renderedItem);
3638
3634
  }
@@ -3651,9 +3647,9 @@ var reactquestion_checkbox_SurveyQuestionCheckbox = /** @class */ (function (_su
3651
3647
  return (external_root_React_commonjs2_react_commonjs_react_amd_react_["createElement"]("div", { className: this.question.getCommentAreaCss(true) },
3652
3648
  external_root_React_commonjs2_react_commonjs_react_amd_react_["createElement"](SurveyQuestionOtherValueItem, { question: this.question, otherCss: cssClasses.other, cssClasses: cssClasses, isDisplayMode: this.isDisplayMode })));
3653
3649
  };
3654
- SurveyQuestionCheckbox.prototype.renderItem = function (key, item, isFirst, cssClasses, index) {
3650
+ SurveyQuestionCheckbox.prototype.renderItem = function (item, isFirst, cssClasses, index) {
3655
3651
  var renderedItem = ReactElementFactory.Instance.createElement(this.question.itemComponent, {
3656
- key: key,
3652
+ key: item.value,
3657
3653
  question: this.question,
3658
3654
  cssClasses: cssClasses,
3659
3655
  isDisplayMode: this.isDisplayMode,
@@ -3679,6 +3675,7 @@ var reactquestion_checkbox_SurveyQuestionCheckboxItem = /** @class */ (function
3679
3675
  _this.handleOnChange = function (event) {
3680
3676
  _this.question.clickItemHandler(_this.item, event.target.checked);
3681
3677
  };
3678
+ _this.rootRef = external_root_React_commonjs2_react_commonjs_react_amd_react_["createRef"]();
3682
3679
  return _this;
3683
3680
  }
3684
3681
  SurveyQuestionCheckboxItem.prototype.getStateElement = function () {
@@ -3726,11 +3723,20 @@ var reactquestion_checkbox_SurveyQuestionCheckboxItem = /** @class */ (function
3726
3723
  enumerable: false,
3727
3724
  configurable: true
3728
3725
  });
3726
+ SurveyQuestionCheckboxItem.prototype.componentDidUpdate = function (prevProps, prevState) {
3727
+ _super.prototype.componentDidUpdate.call(this, prevProps, prevState);
3728
+ if (prevProps.item !== this.props.item && !this.question.isDesignMode) {
3729
+ if (this.props.item) {
3730
+ this.props.item.setRootElement(this.rootRef.current);
3731
+ }
3732
+ if (prevProps.item) {
3733
+ prevProps.item.setRootElement(undefined);
3734
+ }
3735
+ }
3736
+ };
3729
3737
  SurveyQuestionCheckboxItem.prototype.shouldComponentUpdate = function (nextProps, nextState) {
3730
3738
  if (!_super.prototype.shouldComponentUpdate.call(this, nextProps, nextState))
3731
3739
  return false;
3732
- if (!this.question)
3733
- return false;
3734
3740
  return (!this.question.customWidget ||
3735
3741
  !!this.question.customWidgetData.isNeedRender ||
3736
3742
  !!this.question.customWidget.widgetJson.isDefaultRender ||
@@ -3755,7 +3761,7 @@ var reactquestion_checkbox_SurveyQuestionCheckboxItem = /** @class */ (function
3755
3761
  var itemClass = this.question.getItemClass(this.item);
3756
3762
  var labelClass = this.question.getLabelClass(this.item);
3757
3763
  var itemLabel = !this.hideCaption ? external_root_React_commonjs2_react_commonjs_react_amd_react_["createElement"]("span", { className: this.cssClasses.controlLabel }, this.renderLocString(this.item.locText, this.textStyle)) : null;
3758
- return (external_root_React_commonjs2_react_commonjs_react_amd_react_["createElement"]("div", { className: itemClass, role: "presentation" },
3764
+ return (external_root_React_commonjs2_react_commonjs_react_amd_react_["createElement"]("div", { className: itemClass, role: "presentation", ref: this.rootRef },
3759
3765
  external_root_React_commonjs2_react_commonjs_react_amd_react_["createElement"]("label", { className: labelClass },
3760
3766
  external_root_React_commonjs2_react_commonjs_react_amd_react_["createElement"]("input", { className: this.cssClasses.itemControl, type: "checkbox", name: this.question.name + this.item.id, value: this.item.value, id: id, style: this.inputStyle, disabled: !this.question.getItemEnabled(this.item), readOnly: this.question.isReadOnlyAttr, checked: isChecked, onChange: this.handleOnChange, required: this.question.hasRequiredError() }),
3761
3767
  this.cssClasses.materialDecorator ?
@@ -3767,6 +3773,18 @@ var reactquestion_checkbox_SurveyQuestionCheckboxItem = /** @class */ (function
3767
3773
  itemLabel),
3768
3774
  otherItem));
3769
3775
  };
3776
+ SurveyQuestionCheckboxItem.prototype.componentDidMount = function () {
3777
+ _super.prototype.componentDidMount.call(this);
3778
+ if (!this.question.isDesignMode) {
3779
+ this.item.setRootElement(this.rootRef.current);
3780
+ }
3781
+ };
3782
+ SurveyQuestionCheckboxItem.prototype.componentWillUnmount = function () {
3783
+ _super.prototype.componentWillUnmount.call(this);
3784
+ if (!this.question.isDesignMode) {
3785
+ this.item.setRootElement(undefined);
3786
+ }
3787
+ };
3770
3788
  return SurveyQuestionCheckboxItem;
3771
3789
  }(ReactSurveyElement));
3772
3790
 
@@ -4291,10 +4309,10 @@ var tagbox_filter_TagboxFilterString = /** @class */ (function (_super) {
4291
4309
  this.model.inputKeyHandler(e);
4292
4310
  };
4293
4311
  TagboxFilterString.prototype.onBlur = function (e) {
4294
- this.model.onBlur(e);
4312
+ this.question.onBlur(e);
4295
4313
  };
4296
4314
  TagboxFilterString.prototype.onFocus = function (e) {
4297
- this.model.onFocus(e);
4315
+ this.question.onFocus(e);
4298
4316
  };
4299
4317
  TagboxFilterString.prototype.getStateElement = function () {
4300
4318
  return this.model;
@@ -5509,7 +5527,7 @@ var reactquestion_radiogroup_SurveyQuestionRadiogroup = /** @class */ (function
5509
5527
  var _this = this;
5510
5528
  if (this.question.hasFootItems) {
5511
5529
  return this.question.footItems.map(function (item, ii) {
5512
- return _this.renderItem("item_f" + ii, item, false, _this.question.cssClasses);
5530
+ return _this.renderItem(item, false, _this.question.cssClasses);
5513
5531
  });
5514
5532
  }
5515
5533
  };
@@ -5521,7 +5539,7 @@ var reactquestion_radiogroup_SurveyQuestionRadiogroup = /** @class */ (function
5521
5539
  var value = this.getStateValue();
5522
5540
  return this.question.columns.map(function (column, ci) {
5523
5541
  var items = column.map(function (item, ii) {
5524
- return _this.renderItem("item" + ci + ii, item, value, cssClasses, "" + ci + ii);
5542
+ return _this.renderItem(item, value, cssClasses, "" + ci + ii);
5525
5543
  });
5526
5544
  return (external_root_React_commonjs2_react_commonjs_react_amd_react_["createElement"]("div", { key: "column" + ci + _this.question.getItemsColumnKey(column), className: _this.question.getColumnClass(), role: "presentation" }, items));
5527
5545
  });
@@ -5538,7 +5556,7 @@ var reactquestion_radiogroup_SurveyQuestionRadiogroup = /** @class */ (function
5538
5556
  var value = this.getStateValue();
5539
5557
  for (var i = 0; i < choices.length; i++) {
5540
5558
  var item = choices[i];
5541
- var renderedItem = this.renderItem("item" + i, item, value, cssClasses, "" + i);
5559
+ var renderedItem = this.renderItem(item, value, cssClasses, "" + i);
5542
5560
  items.push(renderedItem);
5543
5561
  }
5544
5562
  return items;
@@ -5554,9 +5572,9 @@ var reactquestion_radiogroup_SurveyQuestionRadiogroup = /** @class */ (function
5554
5572
  return (external_root_React_commonjs2_react_commonjs_react_amd_react_["createElement"]("div", { className: this.question.getCommentAreaCss(true) },
5555
5573
  external_root_React_commonjs2_react_commonjs_react_amd_react_["createElement"](SurveyQuestionOtherValueItem, { question: this.question, otherCss: cssClasses.other, cssClasses: cssClasses, isDisplayMode: this.isDisplayMode })));
5556
5574
  };
5557
- SurveyQuestionRadiogroup.prototype.renderItem = function (key, item, value, cssClasses, index) {
5575
+ SurveyQuestionRadiogroup.prototype.renderItem = function (item, value, cssClasses, index) {
5558
5576
  var renderedItem = ReactElementFactory.Instance.createElement(this.question.itemComponent, {
5559
- key: key,
5577
+ key: item.value,
5560
5578
  question: this.question,
5561
5579
  cssClasses: cssClasses,
5562
5580
  isDisplayMode: this.isDisplayMode,
@@ -5582,6 +5600,7 @@ var reactquestion_radiogroup_SurveyQuestionRadioItem = /** @class */ (function (
5582
5600
  reactquestion_radiogroup_extends(SurveyQuestionRadioItem, _super);
5583
5601
  function SurveyQuestionRadioItem(props) {
5584
5602
  var _this = _super.call(this, props) || this;
5603
+ _this.rootRef = external_root_React_commonjs2_react_commonjs_react_amd_react_["createRef"]();
5585
5604
  _this.handleOnChange = _this.handleOnChange.bind(_this);
5586
5605
  _this.handleOnMouseDown = _this.handleOnMouseDown.bind(_this);
5587
5606
  return _this;
@@ -5650,12 +5669,23 @@ var reactquestion_radiogroup_SurveyQuestionRadioItem = /** @class */ (function (
5650
5669
  SurveyQuestionRadioItem.prototype.canRender = function () {
5651
5670
  return !!this.question && !!this.item;
5652
5671
  };
5672
+ SurveyQuestionRadioItem.prototype.componentDidUpdate = function (prevProps, prevState) {
5673
+ _super.prototype.componentDidUpdate.call(this, prevProps, prevState);
5674
+ if (prevProps.item !== this.props.item && !this.question.isDesignMode) {
5675
+ if (this.props.item) {
5676
+ this.props.item.setRootElement(this.rootRef.current);
5677
+ }
5678
+ if (prevProps.item) {
5679
+ prevProps.item.setRootElement(undefined);
5680
+ }
5681
+ }
5682
+ };
5653
5683
  SurveyQuestionRadioItem.prototype.renderElement = function () {
5654
5684
  var itemClass = this.question.getItemClass(this.item);
5655
5685
  var labelClass = this.question.getLabelClass(this.item);
5656
5686
  var controlLabelClass = this.question.getControlLabelClass(this.item);
5657
5687
  var itemLabel = !this.hideCaption ? external_root_React_commonjs2_react_commonjs_react_amd_react_["createElement"]("span", { className: controlLabelClass }, this.renderLocString(this.item.locText, this.textStyle)) : null;
5658
- return (external_root_React_commonjs2_react_commonjs_react_amd_react_["createElement"]("div", { className: itemClass, role: "presentation" },
5688
+ return (external_root_React_commonjs2_react_commonjs_react_amd_react_["createElement"]("div", { className: itemClass, role: "presentation", ref: this.rootRef },
5659
5689
  external_root_React_commonjs2_react_commonjs_react_amd_react_["createElement"]("label", { onMouseDown: this.handleOnMouseDown, className: labelClass },
5660
5690
  external_root_React_commonjs2_react_commonjs_react_amd_react_["createElement"]("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 }),
5661
5691
  this.cssClasses.materialDecorator ?
@@ -5666,6 +5696,18 @@ var reactquestion_radiogroup_SurveyQuestionRadioItem = /** @class */ (function (
5666
5696
  null,
5667
5697
  itemLabel)));
5668
5698
  };
5699
+ SurveyQuestionRadioItem.prototype.componentDidMount = function () {
5700
+ _super.prototype.componentDidMount.call(this);
5701
+ if (!this.question.isDesignMode) {
5702
+ this.item.setRootElement(this.rootRef.current);
5703
+ }
5704
+ };
5705
+ SurveyQuestionRadioItem.prototype.componentWillUnmount = function () {
5706
+ _super.prototype.componentWillUnmount.call(this);
5707
+ if (!this.question.isDesignMode) {
5708
+ this.item.setRootElement(undefined);
5709
+ }
5710
+ };
5669
5711
  return SurveyQuestionRadioItem;
5670
5712
  }(ReactSurveyElement));
5671
5713
 
@@ -6123,6 +6165,9 @@ var drag_drop_icon_SurveyQuestionMatrixDynamicDragDropIcon = /** @class */ (func
6123
6165
  configurable: true
6124
6166
  });
6125
6167
  SurveyQuestionMatrixDynamicDragDropIcon.prototype.renderElement = function () {
6168
+ return external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", null, this.renderIcon());
6169
+ };
6170
+ SurveyQuestionMatrixDynamicDragDropIcon.prototype.renderIcon = function () {
6126
6171
  if (this.question.iconDragElement) {
6127
6172
  return (external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("svg", { className: this.question.cssClasses.dragElementDecorator },
6128
6173
  external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("use", { xlinkHref: this.question.iconDragElement })));
@@ -6753,7 +6798,7 @@ var paneldynamic_add_btn_SurveyQuestionPanelDynamicAddButton = /** @class */ (fu
6753
6798
  if (!this.question.canAddPanel)
6754
6799
  return null;
6755
6800
  var btnText = this.renderLocString(this.question.locPanelAddText);
6756
- return (external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("button", { type: "button", className: this.question.getAddButtonCss(), onClick: this.handleClick },
6801
+ return (external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("button", { type: "button", id: this.question.addButtonId, className: this.question.getAddButtonCss(), onClick: this.handleClick },
6757
6802
  external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("span", { className: this.question.cssClasses.buttonAddText }, btnText)));
6758
6803
  };
6759
6804
  return SurveyQuestionPanelDynamicAddButton;
@@ -9168,7 +9213,7 @@ ReactElementFactory.Instance.registerElement(external_root_Survey_commonjs2_surv
9168
9213
 
9169
9214
 
9170
9215
 
9171
- Object(external_root_Survey_commonjs2_survey_core_commonjs_survey_core_amd_survey_core_["checkLibraryVersion"])("" + "1.11.14", "survey-react-ui");
9216
+ Object(external_root_Survey_commonjs2_survey_core_commonjs_survey_core_amd_survey_core_["checkLibraryVersion"])("" + "1.12.2", "survey-react-ui");
9172
9217
 
9173
9218
 
9174
9219
  /***/ }),