survey-react-ui 2.3.9 → 2.3.11

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.
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - Survey JavaScript library v2.3.9
2
+ * surveyjs - Survey JavaScript library v2.3.11
3
3
  * Copyright (c) 2015-2025 Devsoft Baltic OÜ - http://surveyjs.io/
4
4
  * License: MIT (http://www.opensource.org/licenses/mit-license.php)
5
5
  */
@@ -28,7 +28,7 @@ __webpack_require__.r(__webpack_exports__);
28
28
  /* harmony export */ icons: () => (/* binding */ iconsV1)
29
29
  /* harmony export */ });
30
30
  /*!
31
- * surveyjs - Survey JavaScript library v2.3.9
31
+ * surveyjs - Survey JavaScript library v2.3.11
32
32
  * Copyright (c) 2015-2025 Devsoft Baltic OÜ - http://surveyjs.io/
33
33
  * License: MIT (http://www.opensource.org/licenses/mit-license.php)
34
34
  */
@@ -114,7 +114,7 @@ __webpack_require__.r(__webpack_exports__);
114
114
  /* harmony export */ icons: () => (/* binding */ iconsV2)
115
115
  /* harmony export */ });
116
116
  /*!
117
- * surveyjs - Survey JavaScript library v2.3.9
117
+ * surveyjs - Survey JavaScript library v2.3.11
118
118
  * Copyright (c) 2015-2025 Devsoft Baltic OÜ - http://surveyjs.io/
119
119
  * License: MIT (http://www.opensource.org/licenses/mit-license.php)
120
120
  */
@@ -3858,9 +3858,20 @@ var SliderLabelItem = /** @class */ (function (_super) {
3858
3858
  SliderLabelItem.prototype.renderElement = function () {
3859
3859
  var _a = this.question, cssClasses = _a.cssClasses, handleLabelPointerUp = _a.handleLabelPointerUp, getLabelCss = _a.getLabelCss, getPercent = _a.getPercent;
3860
3860
  var _b = this.item, value = _b.value, locText = _b.locText;
3861
- return react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { key: this.item.id, className: getLabelCss(locText), style: { left: getPercent(value) + "%" }, onPointerUp: function (e) { handleLabelPointerUp(e.nativeEvent, value); } },
3861
+ var labelText = null;
3862
+ var labelTextSecondary = null;
3863
+ if (this.item.showValue) {
3864
+ labelText = react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: cssClasses.labelText }, this.item.value);
3865
+ labelTextSecondary = react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: cssClasses.labelTextSecondaryMode }, this.renderLocString(locText));
3866
+ }
3867
+ else {
3868
+ labelText = react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: cssClasses.labelText }, this.renderLocString(locText));
3869
+ }
3870
+ return react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { key: this.item.uniqueId, className: getLabelCss(locText), style: { left: getPercent(value) + "%" }, onPointerUp: function (e) { handleLabelPointerUp(e.nativeEvent, value); } },
3862
3871
  react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: cssClasses.labelTick }),
3863
- react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: cssClasses.labelText }, this.renderLocString(locText)));
3872
+ react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: cssClasses.labelTextContainer },
3873
+ labelText,
3874
+ labelTextSecondary));
3864
3875
  };
3865
3876
  return SliderLabelItem;
3866
3877
  }(_reactquestion_element__WEBPACK_IMPORTED_MODULE_2__.SurveyElementBase));
@@ -4293,13 +4304,20 @@ var TitleActions = /** @class */ (function (_super) {
4293
4304
  enumerable: false,
4294
4305
  configurable: true
4295
4306
  });
4307
+ Object.defineProperty(TitleActions.prototype, "renderActions", {
4308
+ get: function () {
4309
+ return this.props.renderActions === undefined ? true : this.props.renderActions;
4310
+ },
4311
+ enumerable: false,
4312
+ configurable: true
4313
+ });
4296
4314
  TitleActions.prototype.render = function () {
4297
4315
  var titleContent = react__WEBPACK_IMPORTED_MODULE_0__.createElement(_title_content__WEBPACK_IMPORTED_MODULE_4__.TitleContent, { element: this.element, cssClasses: this.cssClasses });
4298
4316
  if (!this.element.hasTitleActions)
4299
4317
  return titleContent;
4300
4318
  return (react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: "sv-title-actions" },
4301
4319
  react__WEBPACK_IMPORTED_MODULE_0__.createElement("span", { className: "sv-title-actions__title" }, titleContent),
4302
- react__WEBPACK_IMPORTED_MODULE_0__.createElement(_action_bar_action_bar__WEBPACK_IMPORTED_MODULE_3__.SurveyActionBar, { model: this.element.getTitleToolbar() })));
4320
+ (this.renderActions ? react__WEBPACK_IMPORTED_MODULE_0__.createElement(_action_bar_action_bar__WEBPACK_IMPORTED_MODULE_3__.SurveyActionBar, { model: this.element.getTitleToolbar() }) : null)));
4303
4321
  };
4304
4322
  return TitleActions;
4305
4323
  }(react__WEBPACK_IMPORTED_MODULE_0__.Component));
@@ -4461,7 +4479,7 @@ var TitleElement = /** @class */ (function (_super) {
4461
4479
  return null;
4462
4480
  var ariaLabel = element.titleAriaLabel || undefined;
4463
4481
  var titleExpandableSvg = this.renderTitleExpandableSvg();
4464
- var titleContent = (react__WEBPACK_IMPORTED_MODULE_0__.createElement(_title_actions__WEBPACK_IMPORTED_MODULE_2__.TitleActions, { element: element, cssClasses: element.cssClasses }));
4482
+ var titleContent = (react__WEBPACK_IMPORTED_MODULE_0__.createElement(_title_actions__WEBPACK_IMPORTED_MODULE_2__.TitleActions, { element: element, cssClasses: element.cssClasses, renderActions: this.props.renderActions }));
4465
4483
  var onClick = undefined;
4466
4484
  var onKeyUp = undefined;
4467
4485
  if (element.hasTitleEvents) {
@@ -4734,7 +4752,7 @@ var SurveyQuestionDropdownBase = /** @class */ (function (_super) {
4734
4752
  SurveyQuestionDropdownBase.prototype.renderOther = function (item, cssClasses) {
4735
4753
  if (!item || !item.isCommentShowing)
4736
4754
  return null;
4737
- return (react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { key: item.normalizedId, className: this.question.getCommentAreaCss(true) },
4755
+ return (react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { key: item.uniqueId, className: this.question.getCommentAreaCss(true) },
4738
4756
  react__WEBPACK_IMPORTED_MODULE_0__.createElement(_reactquestion_comment__WEBPACK_IMPORTED_MODULE_4__.SurveyQuestionCommentValueItem, { question: this.question, item: item, cssClasses: this.question.cssClasses })));
4739
4757
  };
4740
4758
  SurveyQuestionDropdownBase.prototype.renderEditorButtons = function () {
@@ -4910,7 +4928,7 @@ var SurveyQuestionDropdownSelect = /** @class */ (function (_super) {
4910
4928
  react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { id: this.question.inputId, className: this.question.getControlClass(), disabled: true }, this.question.readOnlyText)) :
4911
4929
  (react__WEBPACK_IMPORTED_MODULE_0__.createElement("select", { id: this.question.inputId, className: this.question.getControlClass(), ref: function (select) { return (_this.setControl(select)); }, autoComplete: this.question.autocomplete, onChange: this.updateValueOnEvent, onInput: this.updateValueOnEvent, onClick: click, onKeyUp: keyup, "aria-required": this.question.a11y_input_ariaRequired, "aria-label": this.question.a11y_input_ariaLabel, "aria-invalid": this.question.a11y_input_ariaInvalid, "aria-errormessage": this.question.a11y_input_ariaErrormessage, required: this.question.isRequired },
4912
4930
  this.question.allowClear ? (react__WEBPACK_IMPORTED_MODULE_0__.createElement("option", { value: "" }, this.question.placeholder)) : null,
4913
- this.question.visibleChoices.map(function (item, i) { return react__WEBPACK_IMPORTED_MODULE_0__.createElement(_dropdown_item__WEBPACK_IMPORTED_MODULE_4__.SurveyQuestionOptionItem, { key: "item" + i, item: item }); })));
4931
+ this.question.visibleChoices.map(function (item) { return react__WEBPACK_IMPORTED_MODULE_0__.createElement(_dropdown_item__WEBPACK_IMPORTED_MODULE_4__.SurveyQuestionOptionItem, { key: item.uniqueId, item: item }); })));
4914
4932
  return (react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: cssClasses.selectWrapper },
4915
4933
  selectElement,
4916
4934
  this.createChevronButton()));
@@ -5510,7 +5528,7 @@ var SurveyQuestionImagePicker = /** @class */ (function (_super) {
5510
5528
  var _this = this;
5511
5529
  return this.question.columns.map(function (column, ci) {
5512
5530
  var items = column.map(function (item, ii) {
5513
- return _this.renderItem("item" + ii, item, cssClasses);
5531
+ return _this.renderItem(item, cssClasses);
5514
5532
  });
5515
5533
  return (react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { key: "column" + ci + _this.question.getItemsColumnKey(column), className: _this.question.getColumnClass(), role: "presentation" }, items));
5516
5534
  });
@@ -5519,8 +5537,7 @@ var SurveyQuestionImagePicker = /** @class */ (function (_super) {
5519
5537
  var items = [];
5520
5538
  for (var i = 0; i < this.question.visibleChoices.length; i++) {
5521
5539
  var item = this.question.visibleChoices[i];
5522
- var key = "item" + i;
5523
- items.push(this.renderItem(key, item, cssClasses));
5540
+ items.push(this.renderItem(item, cssClasses));
5524
5541
  }
5525
5542
  return items;
5526
5543
  };
@@ -5531,8 +5548,8 @@ var SurveyQuestionImagePicker = /** @class */ (function (_super) {
5531
5548
  enumerable: false,
5532
5549
  configurable: true
5533
5550
  });
5534
- SurveyQuestionImagePicker.prototype.renderItem = function (key, item, cssClasses) {
5535
- var renderedItem = react__WEBPACK_IMPORTED_MODULE_0__.createElement(SurveyQuestionImagePickerItem, { key: key, question: this.question, item: item, cssClasses: cssClasses });
5551
+ SurveyQuestionImagePicker.prototype.renderItem = function (item, cssClasses) {
5552
+ var renderedItem = react__WEBPACK_IMPORTED_MODULE_0__.createElement(SurveyQuestionImagePickerItem, { key: item.uniqueId, question: this.question, item: item, cssClasses: cssClasses });
5536
5553
  var survey = this.question.survey;
5537
5554
  var wrappedItem = null;
5538
5555
  if (!!survey) {
@@ -7090,7 +7107,7 @@ var SurveyQuestion = /** @class */ (function (_super) {
7090
7107
  var descriptionUnderInput = question.hasDescriptionUnderInput
7091
7108
  ? this.renderDescription()
7092
7109
  : null;
7093
- return (react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: question.cssContent || undefined, style: contentStyle, "aria-hidden": question.contentAriaHidden, role: "presentation" },
7110
+ return (react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: question.cssContent || undefined, style: contentStyle, "aria-hidden": question.contentAriaHidden, role: "presentation", "data-sv-drop-target-matrix": this.question.dragDropMatrixAttribute, "data-sv-drop-target-matrix-row": this.question.dragDropMatrixAttribute },
7094
7111
  questionRender,
7095
7112
  comment,
7096
7113
  descriptionUnderInput));
@@ -7532,11 +7549,9 @@ __webpack_require__.r(__webpack_exports__);
7532
7549
  /* harmony export */ });
7533
7550
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
7534
7551
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
7535
- /* harmony import */ var _reactquestion_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./reactquestion_element */ "./src/reactquestion_element.tsx");
7536
- /* harmony import */ var _reactquestion_comment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./reactquestion_comment */ "./src/reactquestion_comment.tsx");
7537
- /* harmony import */ var _reactquestion_factory__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./reactquestion_factory */ "./src/reactquestion_factory.tsx");
7538
- /* harmony import */ var _reactsurveymodel__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./reactsurveymodel */ "./src/reactsurveymodel.tsx");
7539
- /* harmony import */ var _element_factory__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./element-factory */ "./src/element-factory.tsx");
7552
+ /* harmony import */ var _reactquestion_factory__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./reactquestion_factory */ "./src/reactquestion_factory.tsx");
7553
+ /* harmony import */ var _element_factory__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./element-factory */ "./src/element-factory.tsx");
7554
+ /* harmony import */ var _reactquestion_selectbase__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./reactquestion_selectbase */ "./src/reactquestion_selectbase.tsx");
7540
7555
  var __extends = (undefined && undefined.__extends) || (function () {
7541
7556
  var extendStatics = function (d, b) {
7542
7557
  extendStatics = Object.setPrototypeOf ||
@@ -7556,8 +7571,6 @@ var __extends = (undefined && undefined.__extends) || (function () {
7556
7571
 
7557
7572
 
7558
7573
 
7559
-
7560
-
7561
7574
  var SurveyQuestionCheckbox = /** @class */ (function (_super) {
7562
7575
  __extends(SurveyQuestionCheckbox, _super);
7563
7576
  function SurveyQuestionCheckbox(props) {
@@ -7570,16 +7583,10 @@ var SurveyQuestionCheckbox = /** @class */ (function (_super) {
7570
7583
  enumerable: false,
7571
7584
  configurable: true
7572
7585
  });
7573
- SurveyQuestionCheckbox.prototype.renderElement = function () {
7574
- var _this = this;
7575
- var cssClasses = this.question.cssClasses;
7576
- return (react__WEBPACK_IMPORTED_MODULE_0__.createElement("fieldset", { className: this.question.getSelectBaseRootCss(), ref: function (fieldset) { return (_this.setControl(fieldset)); }, role: this.question.a11y_input_ariaRole, "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 },
7586
+ SurveyQuestionCheckbox.prototype.renderHeader = function () {
7587
+ return react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null,
7577
7588
  react__WEBPACK_IMPORTED_MODULE_0__.createElement("legend", { className: "sv-hidden" }, this.question.locTitle.renderedHtml),
7578
- this.getHeader(),
7579
- this.question.hasColumns
7580
- ? this.getColumnedBody(cssClasses)
7581
- : this.getBody(cssClasses),
7582
- this.getFooter()));
7589
+ this.getHeader());
7583
7590
  };
7584
7591
  SurveyQuestionCheckbox.prototype.getHeader = function () {
7585
7592
  var _this = this;
@@ -7588,163 +7595,22 @@ var SurveyQuestionCheckbox = /** @class */ (function (_super) {
7588
7595
  return _this.renderItem(item, false, _this.question.cssClasses);
7589
7596
  });
7590
7597
  }
7591
- };
7592
- SurveyQuestionCheckbox.prototype.getFooter = function () {
7593
- var _this = this;
7594
- if (this.question.hasFootItems) {
7595
- return this.question.footItems.map(function (item, ii) {
7596
- return _this.renderItem(item, false, _this.question.cssClasses);
7597
- });
7598
- }
7599
- };
7600
- SurveyQuestionCheckbox.prototype.getColumnedBody = function (cssClasses) {
7601
- return (react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: cssClasses.rootMultiColumn }, this.getColumns(cssClasses)));
7602
- };
7603
- SurveyQuestionCheckbox.prototype.getColumns = function (cssClasses) {
7604
- var _this = this;
7605
- return this.question.columns.map(function (column, ci) {
7606
- var items = column.map(function (item, ii) {
7607
- return _this.renderItem(item, ci === 0 && ii === 0, cssClasses, "" + ci + ii);
7608
- });
7609
- return (react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { key: "column" + ci + _this.question.getItemsColumnKey(column), className: _this.question.getColumnClass(), role: "presentation" }, items));
7610
- });
7611
- };
7612
- SurveyQuestionCheckbox.prototype.getBody = function (cssClasses) {
7613
- if (this.question.blockedRow) {
7614
- return react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: cssClasses.rootRow }, this.getItems(cssClasses, this.question.dataChoices));
7615
- }
7616
- else {
7617
- return react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, this.getItems(cssClasses, this.question.bodyItems));
7618
- }
7619
- };
7620
- SurveyQuestionCheckbox.prototype.getItems = function (cssClasses, choices) {
7621
- var renderedItems = [];
7622
- for (var i = 0; i < choices.length; i++) {
7623
- var item = choices[i];
7624
- var renderedItem = this.renderItem(item, i == 0, cssClasses, "" + i);
7625
- if (!!renderedItem) {
7626
- renderedItems.push(renderedItem);
7627
- }
7628
- }
7629
- return renderedItems;
7630
- };
7631
- Object.defineProperty(SurveyQuestionCheckbox.prototype, "textStyle", {
7632
- get: function () {
7633
- return null;
7634
- },
7635
- enumerable: false,
7636
- configurable: true
7637
- });
7638
- SurveyQuestionCheckbox.prototype.renderItem = function (item, isFirst, cssClasses, index) {
7639
- var renderedItem = _element_factory__WEBPACK_IMPORTED_MODULE_5__.ReactElementFactory.Instance.createElement(this.question.itemComponent, {
7640
- key: item.value,
7641
- question: this.question,
7642
- cssClasses: cssClasses,
7643
- isDisplayMode: this.isDisplayMode,
7644
- item: item,
7645
- textStyle: this.textStyle,
7646
- index: index,
7647
- isFirst: isFirst,
7648
- });
7649
- var survey = this.question.survey;
7650
- var wrappedItem = null;
7651
- if (!!survey && !!renderedItem) {
7652
- wrappedItem = _reactsurveymodel__WEBPACK_IMPORTED_MODULE_4__.ReactSurveyElementsWrapper.wrapItemValue(survey, renderedItem, this.question, item);
7653
- }
7654
- return wrappedItem !== null && wrappedItem !== void 0 ? wrappedItem : renderedItem;
7598
+ return null;
7655
7599
  };
7656
7600
  return SurveyQuestionCheckbox;
7657
- }(_reactquestion_element__WEBPACK_IMPORTED_MODULE_1__.SurveyQuestionElementBase));
7601
+ }(_reactquestion_selectbase__WEBPACK_IMPORTED_MODULE_3__.SurveyQuestionSelectbase));
7658
7602
 
7659
7603
  var SurveyQuestionCheckboxItem = /** @class */ (function (_super) {
7660
7604
  __extends(SurveyQuestionCheckboxItem, _super);
7661
7605
  function SurveyQuestionCheckboxItem(props) {
7662
- var _this = _super.call(this, props) || this;
7663
- _this.handleOnChange = function (event) {
7664
- _this.question.clickItemHandler(_this.item, event.target.checked);
7665
- };
7666
- _this.rootRef = react__WEBPACK_IMPORTED_MODULE_0__.createRef();
7667
- return _this;
7606
+ return _super.call(this, props) || this;
7668
7607
  }
7669
- SurveyQuestionCheckboxItem.prototype.getStateElement = function () {
7670
- return this.item;
7671
- };
7672
- Object.defineProperty(SurveyQuestionCheckboxItem.prototype, "question", {
7673
- get: function () {
7674
- return this.props.question;
7675
- },
7676
- enumerable: false,
7677
- configurable: true
7678
- });
7679
- Object.defineProperty(SurveyQuestionCheckboxItem.prototype, "item", {
7680
- get: function () {
7681
- return this.props.item;
7682
- },
7683
- enumerable: false,
7684
- configurable: true
7685
- });
7686
- Object.defineProperty(SurveyQuestionCheckboxItem.prototype, "textStyle", {
7687
- get: function () {
7688
- return this.props.textStyle;
7689
- },
7690
- enumerable: false,
7691
- configurable: true
7692
- });
7693
- Object.defineProperty(SurveyQuestionCheckboxItem.prototype, "isFirst", {
7694
- get: function () {
7695
- return this.props.isFirst;
7696
- },
7697
- enumerable: false,
7698
- configurable: true
7699
- });
7700
- Object.defineProperty(SurveyQuestionCheckboxItem.prototype, "index", {
7701
- get: function () {
7702
- return this.props.index;
7703
- },
7704
- enumerable: false,
7705
- configurable: true
7706
- });
7707
- Object.defineProperty(SurveyQuestionCheckboxItem.prototype, "hideCaption", {
7708
- get: function () {
7709
- return this.props.hideCaption === true;
7710
- },
7711
- enumerable: false,
7712
- configurable: true
7713
- });
7714
- Object.defineProperty(SurveyQuestionCheckboxItem.prototype, "ariaLabel", {
7715
- get: function () {
7716
- return this.props.ariaLabel || null;
7717
- },
7718
- enumerable: false,
7719
- configurable: true
7720
- });
7721
- SurveyQuestionCheckboxItem.prototype.componentDidUpdate = function (prevProps, prevState) {
7722
- _super.prototype.componentDidUpdate.call(this, prevProps, prevState);
7723
- if (prevProps.item !== this.props.item && !this.question.isDesignMode) {
7724
- if (this.props.item) {
7725
- this.props.item.setRootElement(this.rootRef.current);
7726
- }
7727
- if (prevProps.item) {
7728
- prevProps.item.setRootElement(undefined);
7729
- }
7730
- }
7731
- };
7732
- SurveyQuestionCheckboxItem.prototype.shouldComponentUpdate = function (nextProps, nextState) {
7733
- if (!_super.prototype.shouldComponentUpdate.call(this, nextProps, nextState))
7734
- return false;
7735
- return (!this.question.customWidget ||
7736
- !!this.question.customWidgetData.isNeedRender ||
7737
- !!this.question.customWidget.widgetJson.isDefaultRender ||
7738
- !!this.question.customWidget.widgetJson.render);
7739
- };
7740
- SurveyQuestionCheckboxItem.prototype.canRender = function () {
7741
- return !!this.item && !!this.question;
7608
+ SurveyQuestionCheckboxItem.prototype.doOnItemChange = function (event) {
7609
+ this.question.clickItemHandler(this.item, event.target.checked);
7742
7610
  };
7743
- SurveyQuestionCheckboxItem.prototype.renderElement = function () {
7611
+ SurveyQuestionCheckboxItem.prototype.renderElementContent = function () {
7744
7612
  var isChecked = this.question.isItemSelected(this.item);
7745
- return react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null,
7746
- this.renderCheckbox(isChecked, null),
7747
- this.renderComment());
7613
+ return this.renderCheckbox(isChecked);
7748
7614
  };
7749
7615
  Object.defineProperty(SurveyQuestionCheckboxItem.prototype, "inputStyle", {
7750
7616
  get: function () {
@@ -7753,13 +7619,7 @@ var SurveyQuestionCheckboxItem = /** @class */ (function (_super) {
7753
7619
  enumerable: false,
7754
7620
  configurable: true
7755
7621
  });
7756
- SurveyQuestionCheckboxItem.prototype.renderComment = function () {
7757
- if (!this.item.isCommentShowing)
7758
- return null;
7759
- return react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: this.question.getCommentAreaCss(true) },
7760
- react__WEBPACK_IMPORTED_MODULE_0__.createElement(_reactquestion_comment__WEBPACK_IMPORTED_MODULE_2__.SurveyQuestionCommentValueItem, { question: this.question, item: this.item, cssClasses: this.question.cssClasses }));
7761
- };
7762
- SurveyQuestionCheckboxItem.prototype.renderCheckbox = function (isChecked, otherItem) {
7622
+ SurveyQuestionCheckboxItem.prototype.renderCheckbox = function (isChecked) {
7763
7623
  var id = this.question.getItemId(this.item);
7764
7624
  var itemClass = this.question.getItemClass(this.item);
7765
7625
  var labelClass = this.question.getLabelClass(this.item);
@@ -7773,28 +7633,15 @@ var SurveyQuestionCheckboxItem = /** @class */ (function (_super) {
7773
7633
  react__WEBPACK_IMPORTED_MODULE_0__.createElement("use", { xlinkHref: this.question.itemSvgIcon })) :
7774
7634
  null) :
7775
7635
  null,
7776
- itemLabel),
7777
- otherItem));
7778
- };
7779
- SurveyQuestionCheckboxItem.prototype.componentDidMount = function () {
7780
- _super.prototype.componentDidMount.call(this);
7781
- if (!this.question.isDesignMode) {
7782
- this.item.setRootElement(this.rootRef.current);
7783
- }
7784
- };
7785
- SurveyQuestionCheckboxItem.prototype.componentWillUnmount = function () {
7786
- _super.prototype.componentWillUnmount.call(this);
7787
- if (!this.question.isDesignMode) {
7788
- this.item.setRootElement(undefined);
7789
- }
7636
+ itemLabel)));
7790
7637
  };
7791
7638
  return SurveyQuestionCheckboxItem;
7792
- }(_reactquestion_element__WEBPACK_IMPORTED_MODULE_1__.ReactSurveyElement));
7639
+ }(_reactquestion_selectbase__WEBPACK_IMPORTED_MODULE_3__.SurveyQuestionSelectBaseItem));
7793
7640
 
7794
- _element_factory__WEBPACK_IMPORTED_MODULE_5__.ReactElementFactory.Instance.registerElement("survey-checkbox-item", function (props) {
7641
+ _element_factory__WEBPACK_IMPORTED_MODULE_2__.ReactElementFactory.Instance.registerElement("survey-checkbox-item", function (props) {
7795
7642
  return react__WEBPACK_IMPORTED_MODULE_0__.createElement(SurveyQuestionCheckboxItem, props);
7796
7643
  });
7797
- _reactquestion_factory__WEBPACK_IMPORTED_MODULE_3__.ReactQuestionFactory.Instance.registerQuestion("checkbox", function (props) {
7644
+ _reactquestion_factory__WEBPACK_IMPORTED_MODULE_1__.ReactQuestionFactory.Instance.registerQuestion("checkbox", function (props) {
7798
7645
  return react__WEBPACK_IMPORTED_MODULE_0__.createElement(SurveyQuestionCheckbox, props);
7799
7646
  });
7800
7647
 
@@ -7897,7 +7744,7 @@ var SurveyQuestionCommentValueItem = /** @class */ (function (_super) {
7897
7744
  SurveyQuestionCommentValueItem.prototype.getTextAreaModel = function () {
7898
7745
  return this.props.question.getCommentTextAreaModel(this.props.item);
7899
7746
  };
7900
- SurveyQuestionCommentValueItem.prototype.getKey = function () { return this.props.item.normalizedId; };
7747
+ SurveyQuestionCommentValueItem.prototype.getKey = function () { return this.props.item.uniqueId; };
7901
7748
  return SurveyQuestionCommentValueItem;
7902
7749
  }(SurveyQuestionCommentItem));
7903
7750
 
@@ -8101,6 +7948,16 @@ var SurveyElementBase = /** @class */ (function (_super) {
8101
7948
  });
8102
7949
  }
8103
7950
  };
7951
+ _this.onArrayChangedCallback = function (stateElement, options) {
7952
+ if (_this.isRendering)
7953
+ return;
7954
+ _this.changedStatePropNameValue = options.name;
7955
+ _this.setState(function (state) {
7956
+ var newState = {};
7957
+ newState[options.name] = options.newValue;
7958
+ return newState;
7959
+ });
7960
+ };
8104
7961
  return _this;
8105
7962
  }
8106
7963
  SurveyElementBase.renderLocString = function (locStr, style, key) {
@@ -8256,16 +8113,7 @@ var SurveyElementBase = /** @class */ (function (_super) {
8256
8113
  var val = hash[key];
8257
8114
  if (Array.isArray(val)) {
8258
8115
  var val = val;
8259
- val["onArrayChanged"] = function (arrayChanges) {
8260
- if (_this.isRendering)
8261
- return;
8262
- _this.changedStatePropNameValue = key;
8263
- _this.setState(function (state) {
8264
- var newState = {};
8265
- newState[key] = val;
8266
- return newState;
8267
- });
8268
- };
8116
+ stateElement.addOnArrayChangedCallback(val, _this.onArrayChangedCallback);
8269
8117
  }
8270
8118
  });
8271
8119
  stateElement.setPropertyValueCoreHandler = this.propertyValueChangedHandler;
@@ -8274,6 +8122,7 @@ var SurveyElementBase = /** @class */ (function (_super) {
8274
8122
  return true;
8275
8123
  };
8276
8124
  SurveyElementBase.prototype.unMakeBaseElementReact = function (stateElement) {
8125
+ var _this = this;
8277
8126
  if (!this.canMakeReact(stateElement))
8278
8127
  return;
8279
8128
  if (!this.isCurrentStateElement(stateElement)) {
@@ -8286,7 +8135,7 @@ var SurveyElementBase = /** @class */ (function (_super) {
8286
8135
  var val = hash[key];
8287
8136
  if (Array.isArray(val)) {
8288
8137
  var val = val;
8289
- val["onArrayChanged"] = function () { };
8138
+ stateElement.removeOnArrayChangedCallback(val, _this.onArrayChangedCallback);
8290
8139
  }
8291
8140
  });
8292
8141
  };
@@ -8866,21 +8715,19 @@ var SurveyQuestionMatrix = /** @class */ (function (_super) {
8866
8715
  var headers = [];
8867
8716
  for (var i = 0; i < this.question.visibleColumns.length; i++) {
8868
8717
  var column = this.question.visibleColumns[i];
8869
- var key = "column" + i;
8870
8718
  var columText = this.renderLocString(column.locText);
8871
8719
  var style = {};
8872
8720
  if (!!this.question.columnMinWidth) {
8873
8721
  style.minWidth = this.question.columnMinWidth;
8874
8722
  style.width = this.question.columnMinWidth;
8875
8723
  }
8876
- headers.push(react__WEBPACK_IMPORTED_MODULE_0__.createElement("th", { className: this.question.cssClasses.headerCell, style: style, key: key }, this.wrapCell({ column: column }, columText, "column-header")));
8724
+ headers.push(react__WEBPACK_IMPORTED_MODULE_0__.createElement("th", { className: this.question.cssClasses.headerCell, style: style, key: column.uniqueId }, this.wrapCell({ column: column }, columText, "column-header")));
8877
8725
  }
8878
8726
  var rows = [];
8879
8727
  var visibleRows = this.question.visibleRows;
8880
8728
  for (var i = 0; i < visibleRows.length; i++) {
8881
8729
  var row = visibleRows[i];
8882
- var key = "row-" + row.name + "-" + i;
8883
- rows.push(react__WEBPACK_IMPORTED_MODULE_0__.createElement(SurveyQuestionMatrixRow, { key: key, question: this.question, cssClasses: cssClasses, row: row, isFirst: i == 0 }));
8730
+ rows.push(react__WEBPACK_IMPORTED_MODULE_0__.createElement(SurveyQuestionMatrixRow, { key: row.uniqueId, question: this.question, cssClasses: cssClasses, row: row, isFirst: i == 0 }));
8884
8731
  }
8885
8732
  var header = !this.question.showHeader ? null : (react__WEBPACK_IMPORTED_MODULE_0__.createElement("thead", { role: "presentation" },
8886
8733
  react__WEBPACK_IMPORTED_MODULE_0__.createElement("tr", null,
@@ -8958,7 +8805,7 @@ var SurveyQuestionMatrixRow = /** @class */ (function (_super) {
8958
8805
  var _loop_1 = function () {
8959
8806
  var td = null;
8960
8807
  var column = this_1.question.visibleColumns[i];
8961
- var key = "value" + i;
8808
+ var key = column.uniqueId;
8962
8809
  var itemClass = this_1.question.getItemClass(row, column);
8963
8810
  if (this_1.question.hasCellText) {
8964
8811
  var getHandler = function (column) { return function () { return _this.cellClick(row, column); }; };
@@ -9365,7 +9212,7 @@ var SurveyQuestionMatrixDropdownBase = /** @class */ (function (_super) {
9365
9212
  };
9366
9213
  SurveyQuestionMatrixDropdownBase.prototype.renderTableDiv = function () {
9367
9214
  var _this = this;
9368
- return (react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: this.question.cssClasses.tableWrapper, "data-sv-drop-target-matrix-row": this.question.renderedTable.wrapperDropTargetId, ref: function (root) { return (_this.setControl(root)); } },
9215
+ return (react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: this.question.cssClasses.tableWrapper, ref: function (root) { return (_this.setControl(root)); } },
9369
9216
  react__WEBPACK_IMPORTED_MODULE_0__.createElement(SurveyQuestionMatrixTable, { question: this.question, creator: this.creator, wrapCell: function (cell, element, reason) { return _this.wrapCell(cell, element, reason); } })));
9370
9217
  };
9371
9218
  return SurveyQuestionMatrixDropdownBase;
@@ -9786,7 +9633,7 @@ var SurveyQuestionMultipleText = /** @class */ (function (_super) {
9786
9633
  else {
9787
9634
  cellContent = react__WEBPACK_IMPORTED_MODULE_0__.createElement(SurveyMultipleTextItem, { question: this.question, item: cell.item, creator: this.creator, cssClasses: cssClasses });
9788
9635
  }
9789
- return (react__WEBPACK_IMPORTED_MODULE_0__.createElement("td", { key: "item" + index, className: cell.className, onFocus: focusIn }, cellContent));
9636
+ return (react__WEBPACK_IMPORTED_MODULE_0__.createElement("td", { key: cell.item.id, className: cell.className, onFocus: focusIn }, cellContent));
9790
9637
  };
9791
9638
  SurveyQuestionMultipleText.prototype.renderRow = function (rowIndex, cells, cssClasses) {
9792
9639
  var key = "item" + rowIndex;
@@ -10076,11 +9923,9 @@ __webpack_require__.r(__webpack_exports__);
10076
9923
  /* harmony export */ });
10077
9924
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
10078
9925
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
10079
- /* harmony import */ var _reactquestion_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./reactquestion_element */ "./src/reactquestion_element.tsx");
10080
- /* harmony import */ var _reactquestion_comment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./reactquestion_comment */ "./src/reactquestion_comment.tsx");
10081
- /* harmony import */ var _reactquestion_factory__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./reactquestion_factory */ "./src/reactquestion_factory.tsx");
10082
- /* harmony import */ var _reactsurveymodel__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./reactsurveymodel */ "./src/reactsurveymodel.tsx");
10083
- /* harmony import */ var _element_factory__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./element-factory */ "./src/element-factory.tsx");
9926
+ /* harmony import */ var _reactquestion_factory__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./reactquestion_factory */ "./src/reactquestion_factory.tsx");
9927
+ /* harmony import */ var _element_factory__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./element-factory */ "./src/element-factory.tsx");
9928
+ /* harmony import */ var _reactquestion_selectbase__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./reactquestion_selectbase */ "./src/reactquestion_selectbase.tsx");
10084
9929
  var __extends = (undefined && undefined.__extends) || (function () {
10085
9930
  var extendStatics = function (d, b) {
10086
9931
  extendStatics = Object.setPrototypeOf ||
@@ -10100,8 +9945,6 @@ var __extends = (undefined && undefined.__extends) || (function () {
10100
9945
 
10101
9946
 
10102
9947
 
10103
-
10104
-
10105
9948
  var SurveyQuestionRadiogroup = /** @class */ (function (_super) {
10106
9949
  __extends(SurveyQuestionRadiogroup, _super);
10107
9950
  function SurveyQuestionRadiogroup(props) {
@@ -10114,97 +9957,29 @@ var SurveyQuestionRadiogroup = /** @class */ (function (_super) {
10114
9957
  enumerable: false,
10115
9958
  configurable: true
10116
9959
  });
10117
- SurveyQuestionRadiogroup.prototype.renderElement = function () {
10118
- var _this = this;
10119
- var cssClasses = this.question.cssClasses;
10120
- var clearButton = null;
10121
- if (this.question.showClearButtonInContent) {
10122
- clearButton = (react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", null,
10123
- react__WEBPACK_IMPORTED_MODULE_0__.createElement("input", { type: "button", className: this.question.cssClasses.clearButton, onClick: function () { return _this.question.clearValue(true); }, value: this.question.clearButtonCaption })));
10124
- }
10125
- return (react__WEBPACK_IMPORTED_MODULE_0__.createElement("fieldset", { className: this.question.getSelectBaseRootCss(), ref: function (fieldset) { return (_this.setControl(fieldset)); }, role: this.question.a11y_input_ariaRole, "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 },
10126
- this.question.hasColumns
10127
- ? this.getColumnedBody(cssClasses)
10128
- : this.getBody(cssClasses),
10129
- this.getFooter(),
10130
- clearButton));
10131
- };
10132
9960
  SurveyQuestionRadiogroup.prototype.getFooter = function () {
10133
- var _this = this;
10134
- if (this.question.hasFootItems) {
10135
- return this.question.footItems.map(function (item, ii) {
10136
- return _this.renderItem(item, false, _this.question.cssClasses);
10137
- });
10138
- }
10139
- };
10140
- SurveyQuestionRadiogroup.prototype.getColumnedBody = function (cssClasses) {
10141
- return (react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: cssClasses.rootMultiColumn }, this.getColumns(cssClasses)));
9961
+ return react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null,
9962
+ _super.prototype.getFooter.call(this),
9963
+ this.renderClearButton());
10142
9964
  };
10143
- SurveyQuestionRadiogroup.prototype.getColumns = function (cssClasses) {
9965
+ SurveyQuestionRadiogroup.prototype.renderClearButton = function () {
10144
9966
  var _this = this;
10145
- var value = this.getStateValue();
10146
- return this.question.columns.map(function (column, ci) {
10147
- var items = column.map(function (item, ii) {
10148
- return _this.renderItem(item, value, cssClasses, "" + ci + ii);
10149
- });
10150
- return (react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { key: "column" + ci + _this.question.getItemsColumnKey(column), className: _this.question.getColumnClass(), role: "presentation" }, items));
10151
- });
10152
- };
10153
- SurveyQuestionRadiogroup.prototype.getBody = function (cssClasses) {
10154
- if (this.question.blockedRow) {
10155
- return react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: cssClasses.rootRow }, this.getItems(cssClasses, this.question.dataChoices));
10156
- }
10157
- else {
10158
- return react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, this.getItems(cssClasses, this.question.bodyItems));
10159
- }
10160
- };
10161
- SurveyQuestionRadiogroup.prototype.getItems = function (cssClasses, choices) {
10162
- var items = [];
10163
- var value = this.getStateValue();
10164
- for (var i = 0; i < choices.length; i++) {
10165
- var item = choices[i];
10166
- var renderedItem = this.renderItem(item, value, cssClasses, "" + i);
10167
- items.push(renderedItem);
10168
- }
10169
- return items;
10170
- };
10171
- Object.defineProperty(SurveyQuestionRadiogroup.prototype, "textStyle", {
10172
- get: function () {
10173
- return null; //{ display: "inline", position: "static" };
10174
- },
10175
- enumerable: false,
10176
- configurable: true
10177
- });
10178
- SurveyQuestionRadiogroup.prototype.renderItem = function (item, value, cssClasses, index) {
10179
- var renderedItem = _element_factory__WEBPACK_IMPORTED_MODULE_5__.ReactElementFactory.Instance.createElement(this.question.itemComponent, {
10180
- key: item.value,
10181
- question: this.question,
10182
- cssClasses: cssClasses,
10183
- isDisplayMode: this.isDisplayMode,
10184
- item: item,
10185
- textStyle: this.textStyle,
10186
- index: index,
10187
- isChecked: value === item.value,
10188
- });
10189
- var survey = this.question.survey;
10190
- var wrappedItem = null;
10191
- if (!!survey) {
10192
- wrappedItem = _reactsurveymodel__WEBPACK_IMPORTED_MODULE_4__.ReactSurveyElementsWrapper.wrapItemValue(survey, renderedItem, this.question, item);
10193
- }
10194
- return wrappedItem !== null && wrappedItem !== void 0 ? wrappedItem : renderedItem;
9967
+ if (!this.question.showClearButtonInContent)
9968
+ return null;
9969
+ return (react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", null,
9970
+ react__WEBPACK_IMPORTED_MODULE_0__.createElement("input", { type: "button", className: this.question.cssClasses.clearButton, onClick: function () { return _this.question.clearValueFromUI(); }, value: this.question.clearButtonCaption })));
10195
9971
  };
10196
9972
  SurveyQuestionRadiogroup.prototype.getStateValue = function () {
10197
9973
  return !this.question.isEmpty() ? this.question.renderedValue : "";
10198
9974
  };
9975
+ SurveyQuestionRadiogroup.prototype.isItemChecked = function (item, value) { return item.value === value; };
10199
9976
  return SurveyQuestionRadiogroup;
10200
- }(_reactquestion_element__WEBPACK_IMPORTED_MODULE_1__.SurveyQuestionElementBase));
9977
+ }(_reactquestion_selectbase__WEBPACK_IMPORTED_MODULE_3__.SurveyQuestionSelectbase));
10201
9978
 
10202
9979
  var SurveyQuestionRadioItem = /** @class */ (function (_super) {
10203
9980
  __extends(SurveyQuestionRadioItem, _super);
10204
9981
  function SurveyQuestionRadioItem(props) {
10205
9982
  var _this = _super.call(this, props) || this;
10206
- _this.rootRef = react__WEBPACK_IMPORTED_MODULE_0__.createRef();
10207
- _this.handleOnChange = _this.handleOnChange.bind(_this);
10208
9983
  _this.handleOnMouseDown = _this.handleOnMouseDown.bind(_this);
10209
9984
  return _this;
10210
9985
  }
@@ -10218,27 +9993,6 @@ var SurveyQuestionRadioItem = /** @class */ (function (_super) {
10218
9993
  enumerable: false,
10219
9994
  configurable: true
10220
9995
  });
10221
- Object.defineProperty(SurveyQuestionRadioItem.prototype, "item", {
10222
- get: function () {
10223
- return this.props.item;
10224
- },
10225
- enumerable: false,
10226
- configurable: true
10227
- });
10228
- Object.defineProperty(SurveyQuestionRadioItem.prototype, "textStyle", {
10229
- get: function () {
10230
- return this.props.textStyle;
10231
- },
10232
- enumerable: false,
10233
- configurable: true
10234
- });
10235
- Object.defineProperty(SurveyQuestionRadioItem.prototype, "index", {
10236
- get: function () {
10237
- return this.props.index;
10238
- },
10239
- enumerable: false,
10240
- configurable: true
10241
- });
10242
9996
  Object.defineProperty(SurveyQuestionRadioItem.prototype, "isChecked", {
10243
9997
  get: function () {
10244
9998
  return this.props.isChecked;
@@ -10246,60 +10000,14 @@ var SurveyQuestionRadioItem = /** @class */ (function (_super) {
10246
10000
  enumerable: false,
10247
10001
  configurable: true
10248
10002
  });
10249
- Object.defineProperty(SurveyQuestionRadioItem.prototype, "hideCaption", {
10250
- get: function () {
10251
- return this.props.hideCaption === true;
10252
- },
10253
- enumerable: false,
10254
- configurable: true
10255
- });
10256
- Object.defineProperty(SurveyQuestionRadioItem.prototype, "ariaLabel", {
10257
- get: function () {
10258
- return this.props.ariaLabel || null;
10259
- },
10260
- enumerable: false,
10261
- configurable: true
10262
- });
10263
- SurveyQuestionRadioItem.prototype.shouldComponentUpdate = function (nextProps, nextState) {
10264
- if (!_super.prototype.shouldComponentUpdate.call(this, nextProps, nextState))
10265
- return false;
10266
- if (!this.question)
10267
- return false;
10268
- return (!this.question.customWidget ||
10269
- !!this.question.customWidgetData.isNeedRender ||
10270
- !!this.question.customWidget.widgetJson.isDefaultRender ||
10271
- !!this.question.customWidget.widgetJson.render);
10272
- };
10273
- SurveyQuestionRadioItem.prototype.handleOnChange = function (event) {
10003
+ SurveyQuestionRadioItem.prototype.doOnItemChange = function (event) {
10274
10004
  this.question.clickItemHandler(this.item);
10275
10005
  };
10276
10006
  SurveyQuestionRadioItem.prototype.handleOnMouseDown = function (event) {
10277
10007
  this.question.onMouseDown();
10278
10008
  };
10279
- SurveyQuestionRadioItem.prototype.canRender = function () {
10280
- return !!this.question && !!this.item;
10281
- };
10282
- SurveyQuestionRadioItem.prototype.componentDidUpdate = function (prevProps, prevState) {
10283
- _super.prototype.componentDidUpdate.call(this, prevProps, prevState);
10284
- if (prevProps.item !== this.props.item && !this.question.isDesignMode) {
10285
- if (this.props.item) {
10286
- this.props.item.setRootElement(this.rootRef.current);
10287
- }
10288
- if (prevProps.item) {
10289
- prevProps.item.setRootElement(undefined);
10290
- }
10291
- }
10292
- };
10293
- SurveyQuestionRadioItem.prototype.renderElement = function () {
10294
- return react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null,
10295
- this.renderRadioButton(),
10296
- this.renderComment());
10297
- };
10298
- SurveyQuestionRadioItem.prototype.renderComment = function () {
10299
- if (!this.item.isCommentShowing)
10300
- return null;
10301
- return react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: this.question.getCommentAreaCss(true) },
10302
- react__WEBPACK_IMPORTED_MODULE_0__.createElement(_reactquestion_comment__WEBPACK_IMPORTED_MODULE_2__.SurveyQuestionCommentValueItem, { question: this.question, item: this.item, cssClasses: this.question.cssClasses }));
10009
+ SurveyQuestionRadioItem.prototype.renderElementContent = function () {
10010
+ return this.renderRadioButton();
10303
10011
  };
10304
10012
  SurveyQuestionRadioItem.prototype.renderRadioButton = function () {
10305
10013
  var itemClass = this.question.getItemClass(this.item);
@@ -10317,25 +10025,13 @@ var SurveyQuestionRadioItem = /** @class */ (function (_super) {
10317
10025
  null,
10318
10026
  itemLabel)));
10319
10027
  };
10320
- SurveyQuestionRadioItem.prototype.componentDidMount = function () {
10321
- _super.prototype.componentDidMount.call(this);
10322
- if (!this.question.isDesignMode) {
10323
- this.item.setRootElement(this.rootRef.current);
10324
- }
10325
- };
10326
- SurveyQuestionRadioItem.prototype.componentWillUnmount = function () {
10327
- _super.prototype.componentWillUnmount.call(this);
10328
- if (!this.question.isDesignMode) {
10329
- this.item.setRootElement(undefined);
10330
- }
10331
- };
10332
10028
  return SurveyQuestionRadioItem;
10333
- }(_reactquestion_element__WEBPACK_IMPORTED_MODULE_1__.ReactSurveyElement));
10029
+ }(_reactquestion_selectbase__WEBPACK_IMPORTED_MODULE_3__.SurveyQuestionSelectBaseItem));
10334
10030
 
10335
- _element_factory__WEBPACK_IMPORTED_MODULE_5__.ReactElementFactory.Instance.registerElement("survey-radiogroup-item", function (props) {
10031
+ _element_factory__WEBPACK_IMPORTED_MODULE_2__.ReactElementFactory.Instance.registerElement("survey-radiogroup-item", function (props) {
10336
10032
  return react__WEBPACK_IMPORTED_MODULE_0__.createElement(SurveyQuestionRadioItem, props);
10337
10033
  });
10338
- _reactquestion_factory__WEBPACK_IMPORTED_MODULE_3__.ReactQuestionFactory.Instance.registerQuestion("radiogroup", function (props) {
10034
+ _reactquestion_factory__WEBPACK_IMPORTED_MODULE_1__.ReactQuestionFactory.Instance.registerQuestion("radiogroup", function (props) {
10339
10035
  return react__WEBPACK_IMPORTED_MODULE_0__.createElement(SurveyQuestionRadiogroup, props);
10340
10036
  });
10341
10037
 
@@ -10445,7 +10141,7 @@ var SurveyQuestionRanking = /** @class */ (function (_super) {
10445
10141
  var index = i;
10446
10142
  var indexText = this.question.getNumberByIndex(index);
10447
10143
  var tabIndex = this.question.getItemTabIndex(item);
10448
- var renderedItem = (react__WEBPACK_IMPORTED_MODULE_0__.createElement(SurveyQuestionRankingItem, { key: item.value, text: text, index: index, indexText: indexText, itemTabIndex: tabIndex, handleKeydown: handleKeydown, handlePointerDown: handlePointerDown, handlePointerUp: handlePointerUp, cssClasses: cssClasses, itemClass: itemClass, question: question, unrankedItem: unrankedItem, item: item }));
10144
+ var renderedItem = (react__WEBPACK_IMPORTED_MODULE_0__.createElement(SurveyQuestionRankingItem, { key: item.uniqueId, text: text, index: index, indexText: indexText, itemTabIndex: tabIndex, handleKeydown: handleKeydown, handlePointerDown: handlePointerDown, handlePointerUp: handlePointerUp, cssClasses: cssClasses, itemClass: itemClass, question: question, unrankedItem: unrankedItem, item: item }));
10449
10145
  var survey = this.question.survey;
10450
10146
  var wrappedItem = null;
10451
10147
  if (!!survey) {
@@ -10688,6 +10384,276 @@ _reactquestion_factory__WEBPACK_IMPORTED_MODULE_2__.ReactQuestionFactory.Instanc
10688
10384
  });
10689
10385
 
10690
10386
 
10387
+ /***/ }),
10388
+
10389
+ /***/ "./src/reactquestion_selectbase.tsx":
10390
+ /*!******************************************!*\
10391
+ !*** ./src/reactquestion_selectbase.tsx ***!
10392
+ \******************************************/
10393
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
10394
+
10395
+ __webpack_require__.r(__webpack_exports__);
10396
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
10397
+ /* harmony export */ SurveyQuestionSelectBaseItem: () => (/* binding */ SurveyQuestionSelectBaseItem),
10398
+ /* harmony export */ SurveyQuestionSelectbase: () => (/* binding */ SurveyQuestionSelectbase)
10399
+ /* harmony export */ });
10400
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
10401
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
10402
+ /* harmony import */ var _reactquestion_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./reactquestion_element */ "./src/reactquestion_element.tsx");
10403
+ /* harmony import */ var _reactquestion_comment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./reactquestion_comment */ "./src/reactquestion_comment.tsx");
10404
+ /* harmony import */ var _reactsurveymodel__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./reactsurveymodel */ "./src/reactsurveymodel.tsx");
10405
+ /* harmony import */ var _element_factory__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./element-factory */ "./src/element-factory.tsx");
10406
+ /* harmony import */ var _panel__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./panel */ "./src/panel.tsx");
10407
+ var __extends = (undefined && undefined.__extends) || (function () {
10408
+ var extendStatics = function (d, b) {
10409
+ extendStatics = Object.setPrototypeOf ||
10410
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
10411
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
10412
+ return extendStatics(d, b);
10413
+ };
10414
+ return function (d, b) {
10415
+ if (typeof b !== "function" && b !== null)
10416
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
10417
+ extendStatics(d, b);
10418
+ function __() { this.constructor = d; }
10419
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
10420
+ };
10421
+ })();
10422
+
10423
+
10424
+
10425
+
10426
+
10427
+
10428
+ var SurveyQuestionSelectbase = /** @class */ (function (_super) {
10429
+ __extends(SurveyQuestionSelectbase, _super);
10430
+ function SurveyQuestionSelectbase(props) {
10431
+ return _super.call(this, props) || this;
10432
+ }
10433
+ Object.defineProperty(SurveyQuestionSelectbase.prototype, "question", {
10434
+ get: function () {
10435
+ return this.questionBase;
10436
+ },
10437
+ enumerable: false,
10438
+ configurable: true
10439
+ });
10440
+ SurveyQuestionSelectbase.prototype.renderElement = function () {
10441
+ var _this = this;
10442
+ var cssClasses = this.question.cssClasses;
10443
+ return (react__WEBPACK_IMPORTED_MODULE_0__.createElement("fieldset", { className: this.question.getSelectBaseRootCss(), ref: function (fieldset) { return (_this.setControl(fieldset)); }, role: this.question.a11y_input_ariaRole, "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 },
10444
+ this.renderHeader(),
10445
+ this.question.hasColumns
10446
+ ? this.getColumnedBody(cssClasses)
10447
+ : this.getBody(cssClasses),
10448
+ this.getFooter()));
10449
+ };
10450
+ SurveyQuestionSelectbase.prototype.renderHeader = function () { return null; };
10451
+ SurveyQuestionSelectbase.prototype.getFooter = function () {
10452
+ var _this = this;
10453
+ if (this.question.hasFootItems) {
10454
+ var items = this.question.footItems.map(function (item, ii) {
10455
+ return _this.renderItem(item, false, _this.question.cssClasses);
10456
+ });
10457
+ return react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, items);
10458
+ }
10459
+ return null;
10460
+ };
10461
+ SurveyQuestionSelectbase.prototype.getStateValue = function () { return undefined; };
10462
+ SurveyQuestionSelectbase.prototype.isItemChecked = function (item, value) { return false; };
10463
+ SurveyQuestionSelectbase.prototype.getColumnedBody = function (cssClasses) {
10464
+ return (react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: cssClasses.rootMultiColumn }, this.getColumns(cssClasses)));
10465
+ };
10466
+ SurveyQuestionSelectbase.prototype.getColumns = function (cssClasses) {
10467
+ var _this = this;
10468
+ var value = this.getStateValue();
10469
+ return this.question.columns.map(function (column, ci) {
10470
+ var items = column.map(function (item, ii) {
10471
+ return _this.renderItem(item, ci === 0 && ii === 0, cssClasses, "" + ci + ii, _this.isItemChecked(item, value));
10472
+ });
10473
+ return (react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { key: "column" + ci + _this.question.getItemsColumnKey(column), className: _this.question.getColumnClass(), role: "presentation" }, items));
10474
+ });
10475
+ };
10476
+ SurveyQuestionSelectbase.prototype.getBody = function (cssClasses) {
10477
+ if (this.question.blockedRow) {
10478
+ return react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: cssClasses.rootRow }, this.getItems(cssClasses, this.question.dataChoices));
10479
+ }
10480
+ else {
10481
+ return react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, this.getItems(cssClasses, this.question.bodyItems));
10482
+ }
10483
+ };
10484
+ SurveyQuestionSelectbase.prototype.getItems = function (cssClasses, choices) {
10485
+ var items = [];
10486
+ var value = this.getStateValue();
10487
+ for (var i = 0; i < choices.length; i++) {
10488
+ var item = choices[i];
10489
+ var renderedItem = this.renderItem(item, i == 0, cssClasses, "" + i, this.isItemChecked(item, value));
10490
+ if (!!renderedItem) {
10491
+ items.push(renderedItem);
10492
+ }
10493
+ }
10494
+ return items;
10495
+ };
10496
+ Object.defineProperty(SurveyQuestionSelectbase.prototype, "textStyle", {
10497
+ get: function () {
10498
+ return null;
10499
+ },
10500
+ enumerable: false,
10501
+ configurable: true
10502
+ });
10503
+ SurveyQuestionSelectbase.prototype.renderItem = function (item, isFirst, cssClasses, index, isChecked) {
10504
+ var renderedItem = _element_factory__WEBPACK_IMPORTED_MODULE_4__.ReactElementFactory.Instance.createElement(this.question.itemComponent, {
10505
+ key: item.uniqueId,
10506
+ question: this.question,
10507
+ cssClasses: cssClasses,
10508
+ isDisplayMode: this.isDisplayMode,
10509
+ item: item,
10510
+ textStyle: this.textStyle,
10511
+ index: index,
10512
+ isFirst: isFirst,
10513
+ isChecked: isChecked,
10514
+ creator: this.props.creator,
10515
+ });
10516
+ var survey = this.question.survey;
10517
+ var wrappedItem = null;
10518
+ if (!!survey && !!renderedItem) {
10519
+ wrappedItem = _reactsurveymodel__WEBPACK_IMPORTED_MODULE_3__.ReactSurveyElementsWrapper.wrapItemValue(survey, renderedItem, this.question, item);
10520
+ }
10521
+ return wrappedItem !== null && wrappedItem !== void 0 ? wrappedItem : renderedItem;
10522
+ };
10523
+ return SurveyQuestionSelectbase;
10524
+ }(_reactquestion_element__WEBPACK_IMPORTED_MODULE_1__.SurveyQuestionElementBase));
10525
+
10526
+ var SurveyQuestionSelectBaseItem = /** @class */ (function (_super) {
10527
+ __extends(SurveyQuestionSelectBaseItem, _super);
10528
+ function SurveyQuestionSelectBaseItem(props) {
10529
+ var _this = _super.call(this, props) || this;
10530
+ _this.handleOnChange = function (event) {
10531
+ _this.doOnItemChange(event);
10532
+ };
10533
+ _this.rootRef = react__WEBPACK_IMPORTED_MODULE_0__.createRef();
10534
+ return _this;
10535
+ }
10536
+ SurveyQuestionSelectBaseItem.prototype.getStateElement = function () {
10537
+ return this.item;
10538
+ };
10539
+ Object.defineProperty(SurveyQuestionSelectBaseItem.prototype, "question", {
10540
+ get: function () {
10541
+ return this.props.question;
10542
+ },
10543
+ enumerable: false,
10544
+ configurable: true
10545
+ });
10546
+ Object.defineProperty(SurveyQuestionSelectBaseItem.prototype, "item", {
10547
+ get: function () {
10548
+ return this.props.item;
10549
+ },
10550
+ enumerable: false,
10551
+ configurable: true
10552
+ });
10553
+ Object.defineProperty(SurveyQuestionSelectBaseItem.prototype, "textStyle", {
10554
+ get: function () {
10555
+ return this.props.textStyle;
10556
+ },
10557
+ enumerable: false,
10558
+ configurable: true
10559
+ });
10560
+ Object.defineProperty(SurveyQuestionSelectBaseItem.prototype, "isFirst", {
10561
+ get: function () {
10562
+ return this.props.isFirst;
10563
+ },
10564
+ enumerable: false,
10565
+ configurable: true
10566
+ });
10567
+ Object.defineProperty(SurveyQuestionSelectBaseItem.prototype, "index", {
10568
+ get: function () {
10569
+ return this.props.index;
10570
+ },
10571
+ enumerable: false,
10572
+ configurable: true
10573
+ });
10574
+ Object.defineProperty(SurveyQuestionSelectBaseItem.prototype, "hideCaption", {
10575
+ get: function () {
10576
+ return this.props.hideCaption === true;
10577
+ },
10578
+ enumerable: false,
10579
+ configurable: true
10580
+ });
10581
+ Object.defineProperty(SurveyQuestionSelectBaseItem.prototype, "ariaLabel", {
10582
+ get: function () {
10583
+ return this.props.ariaLabel || null;
10584
+ },
10585
+ enumerable: false,
10586
+ configurable: true
10587
+ });
10588
+ SurveyQuestionSelectBaseItem.prototype.componentDidUpdate = function (prevProps, prevState) {
10589
+ _super.prototype.componentDidUpdate.call(this, prevProps, prevState);
10590
+ if (prevProps.item !== this.props.item && !this.question.isDesignMode) {
10591
+ if (this.props.item) {
10592
+ this.props.item.setRootElement(this.rootRef.current);
10593
+ }
10594
+ if (prevProps.item) {
10595
+ prevProps.item.setRootElement(undefined);
10596
+ }
10597
+ }
10598
+ };
10599
+ SurveyQuestionSelectBaseItem.prototype.shouldComponentUpdate = function (nextProps, nextState) {
10600
+ if (!_super.prototype.shouldComponentUpdate.call(this, nextProps, nextState))
10601
+ return false;
10602
+ return (!this.question.customWidget ||
10603
+ !!this.question.customWidgetData.isNeedRender ||
10604
+ !!this.question.customWidget.widgetJson.isDefaultRender ||
10605
+ !!this.question.customWidget.widgetJson.render);
10606
+ };
10607
+ SurveyQuestionSelectBaseItem.prototype.doOnItemChange = function (event) { };
10608
+ SurveyQuestionSelectBaseItem.prototype.canRender = function () {
10609
+ return !!this.item && !!this.question;
10610
+ };
10611
+ SurveyQuestionSelectBaseItem.prototype.renderElement = function () {
10612
+ return react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null,
10613
+ this.renderElementContent(),
10614
+ this.renderPanel(),
10615
+ this.renderComment());
10616
+ };
10617
+ SurveyQuestionSelectBaseItem.prototype.renderElementContent = function () {
10618
+ return null;
10619
+ };
10620
+ Object.defineProperty(SurveyQuestionSelectBaseItem.prototype, "inputStyle", {
10621
+ get: function () {
10622
+ return null; //{ marginRight: "3px" };
10623
+ },
10624
+ enumerable: false,
10625
+ configurable: true
10626
+ });
10627
+ SurveyQuestionSelectBaseItem.prototype.renderComment = function () {
10628
+ if (!this.item.isCommentShowing)
10629
+ return null;
10630
+ return react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: this.question.getCommentAreaCss(true) },
10631
+ react__WEBPACK_IMPORTED_MODULE_0__.createElement(_reactquestion_comment__WEBPACK_IMPORTED_MODULE_2__.SurveyQuestionCommentValueItem, { question: this.question, item: this.item, cssClasses: this.question.cssClasses }));
10632
+ };
10633
+ SurveyQuestionSelectBaseItem.prototype.renderPanel = function () {
10634
+ if (this.item.isPanelShowing) {
10635
+ var panel = this.item.panel;
10636
+ return (react__WEBPACK_IMPORTED_MODULE_0__.createElement(_panel__WEBPACK_IMPORTED_MODULE_5__.SurveyPanel, { key: panel.id, element: panel, survey: this.question.survey, cssClasses: this.props.cssClasses, isDisplayMode: this.isDisplayMode, creator: this.props.creator }));
10637
+ }
10638
+ return null;
10639
+ };
10640
+ SurveyQuestionSelectBaseItem.prototype.componentDidMount = function () {
10641
+ _super.prototype.componentDidMount.call(this);
10642
+ if (!this.question.isDesignMode) {
10643
+ this.item.setRootElement(this.rootRef.current);
10644
+ }
10645
+ };
10646
+ SurveyQuestionSelectBaseItem.prototype.componentWillUnmount = function () {
10647
+ _super.prototype.componentWillUnmount.call(this);
10648
+ if (!this.question.isDesignMode) {
10649
+ this.item.setRootElement(undefined);
10650
+ }
10651
+ };
10652
+ return SurveyQuestionSelectBaseItem;
10653
+ }(_reactquestion_element__WEBPACK_IMPORTED_MODULE_1__.ReactSurveyElement));
10654
+
10655
+
10656
+
10691
10657
  /***/ }),
10692
10658
 
10693
10659
  /***/ "./src/reactquestion_singleinputsummary.tsx":
@@ -11467,7 +11433,7 @@ var SurveyQuestionSignaturePad = /** @class */ (function (_super) {
11467
11433
  return null;
11468
11434
  var cssClasses = this.question.cssClasses;
11469
11435
  return react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { className: cssClasses.controls },
11470
- react__WEBPACK_IMPORTED_MODULE_0__.createElement("button", { type: "button", className: cssClasses.clearButton, title: this.question.clearButtonCaption, onClick: function () { return _this.question.clearValue(true); } },
11436
+ react__WEBPACK_IMPORTED_MODULE_0__.createElement("button", { type: "button", className: cssClasses.clearButton, title: this.question.clearButtonCaption, onClick: function () { return _this.question.clearValueFromUI(); } },
11471
11437
  this.question.cssClasses.clearButtonIconId ? react__WEBPACK_IMPORTED_MODULE_0__.createElement(_components_svg_icon_svg_icon__WEBPACK_IMPORTED_MODULE_3__.SvgIcon, { iconName: this.question.cssClasses.clearButtonIconId, size: "auto" }) : react__WEBPACK_IMPORTED_MODULE_0__.createElement("span", null, "\u2716"),
11472
11438
  " "));
11473
11439
  };
@@ -12155,7 +12121,7 @@ __webpack_require__.r(__webpack_exports__);
12155
12121
 
12156
12122
 
12157
12123
 
12158
- (0,survey_core__WEBPACK_IMPORTED_MODULE_0__.checkLibraryVersion)("".concat("2.3.9"), "survey-react-ui");
12124
+ (0,survey_core__WEBPACK_IMPORTED_MODULE_0__.checkLibraryVersion)("".concat("2.3.11"), "survey-react-ui");
12159
12125
 
12160
12126
  })();
12161
12127