survey-js-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
  */
@@ -171,6 +171,16 @@ class SurveyElementBase extends x$2 {
171
171
  });
172
172
  }
173
173
  };
174
+ this.onArrayChangedCallback = (stateElement, options) => {
175
+ if (this.isRendering)
176
+ return;
177
+ this.changedStatePropNameValue = options.name;
178
+ this.setState((state) => {
179
+ var newState = {};
180
+ newState[options.name] = options.newValue;
181
+ return newState;
182
+ });
183
+ };
174
184
  }
175
185
  componentDidMount() {
176
186
  this.makeBaseElementsReact();
@@ -297,16 +307,7 @@ class SurveyElementBase extends x$2 {
297
307
  var val = hash[key];
298
308
  if (Array.isArray(val)) {
299
309
  var val = val;
300
- val["onArrayChanged"] = (arrayChanges) => {
301
- if (this.isRendering)
302
- return;
303
- this.changedStatePropNameValue = key;
304
- this.setState((state) => {
305
- var newState = {};
306
- newState[key] = val;
307
- return newState;
308
- });
309
- };
310
+ stateElement.addOnArrayChangedCallback(val, this.onArrayChangedCallback);
310
311
  }
311
312
  });
312
313
  stateElement.setPropertyValueCoreHandler = this.propertyValueChangedHandler;
@@ -323,7 +324,7 @@ class SurveyElementBase extends x$2 {
323
324
  var val = hash[key];
324
325
  if (Array.isArray(val)) {
325
326
  var val = val;
326
- val["onArrayChanged"] = () => { };
327
+ stateElement.removeOnArrayChangedCallback(val, this.onArrayChangedCallback);
327
328
  }
328
329
  });
329
330
  }
@@ -854,13 +855,16 @@ class TitleActions extends x$2 {
854
855
  get element() {
855
856
  return this.props.element;
856
857
  }
858
+ get renderActions() {
859
+ return this.props.renderActions === undefined ? true : this.props.renderActions;
860
+ }
857
861
  render() {
858
862
  const titleContent = _$1(TitleContent, { element: this.element, cssClasses: this.cssClasses });
859
863
  if (!this.element.hasTitleActions)
860
864
  return titleContent;
861
865
  return (_$1("div", { className: "sv-title-actions" },
862
866
  _$1("span", { className: "sv-title-actions__title" }, titleContent),
863
- _$1(SurveyActionBar, { model: this.element.getTitleToolbar() })));
867
+ (this.renderActions ? _$1(SurveyActionBar, { model: this.element.getTitleToolbar() }) : null)));
864
868
  }
865
869
  }
866
870
  RendererFactory.Instance.registerRenderer("element", "title-actions", "sv-title-actions");
@@ -887,7 +891,7 @@ class TitleElement extends x$2 {
887
891
  return null;
888
892
  const ariaLabel = element.titleAriaLabel || undefined;
889
893
  const titleExpandableSvg = this.renderTitleExpandableSvg();
890
- const titleContent = (_$1(TitleActions, { element: element, cssClasses: element.cssClasses }));
894
+ const titleContent = (_$1(TitleActions, { element: element, cssClasses: element.cssClasses, renderActions: this.props.renderActions }));
891
895
  let onClick = undefined;
892
896
  let onKeyUp = undefined;
893
897
  if (element.hasTitleEvents) {
@@ -1127,7 +1131,7 @@ class PopupModal extends SurveyElementBase {
1127
1131
  PopupModal.modalDescriptors = [];
1128
1132
 
1129
1133
  /*!
1130
- * surveyjs - Survey JavaScript library v2.3.9
1134
+ * surveyjs - Survey JavaScript library v2.3.11
1131
1135
  * Copyright (c) 2015-2025 Devsoft Baltic OÜ - http://surveyjs.io/
1132
1136
  * License: MIT (http://www.opensource.org/licenses/mit-license.php)
1133
1137
  */
@@ -1197,7 +1201,7 @@ var iconsV1 = {
1197
1201
  };
1198
1202
 
1199
1203
  /*!
1200
- * surveyjs - Survey JavaScript library v2.3.9
1204
+ * surveyjs - Survey JavaScript library v2.3.11
1201
1205
  * Copyright (c) 2015-2025 Devsoft Baltic OÜ - http://surveyjs.io/
1202
1206
  * License: MIT (http://www.opensource.org/licenses/mit-license.php)
1203
1207
  */
@@ -1981,7 +1985,7 @@ class SurveyQuestionCommentValueItem extends SurveyQuestionCommentItem {
1981
1985
  getTextAreaModel() {
1982
1986
  return this.props.question.getCommentTextAreaModel(this.props.item);
1983
1987
  }
1984
- getKey() { return this.props.item.normalizedId; }
1988
+ getKey() { return this.props.item.uniqueId; }
1985
1989
  }
1986
1990
  ReactQuestionFactory.Instance.registerQuestion("comment", (props) => {
1987
1991
  return _$1(SurveyQuestionComment, props);
@@ -2223,7 +2227,7 @@ class SurveyQuestion extends SurveyElementBase {
2223
2227
  var descriptionUnderInput = question.hasDescriptionUnderInput
2224
2228
  ? this.renderDescription()
2225
2229
  : null;
2226
- return (_$1("div", { className: question.cssContent || undefined, style: contentStyle, "aria-hidden": question.contentAriaHidden, role: "presentation" },
2230
+ return (_$1("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 },
2227
2231
  questionRender,
2228
2232
  comment,
2229
2233
  descriptionUnderInput));
@@ -2699,7 +2703,7 @@ ReactElementFactory.Instance.registerElement("flowpanel", props => {
2699
2703
  return _$1(SurveyFlowPanel, props);
2700
2704
  });
2701
2705
 
2702
- class SurveyQuestionCheckbox extends SurveyQuestionElementBase {
2706
+ class SurveyQuestionSelectbase extends SurveyQuestionElementBase {
2703
2707
  constructor(props) {
2704
2708
  super(props);
2705
2709
  }
@@ -2709,29 +2713,29 @@ class SurveyQuestionCheckbox extends SurveyQuestionElementBase {
2709
2713
  renderElement() {
2710
2714
  var cssClasses = this.question.cssClasses;
2711
2715
  return (_$1("fieldset", { className: this.question.getSelectBaseRootCss(), ref: (fieldset) => (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 },
2712
- _$1("legend", { className: "sv-hidden" }, this.question.locTitle.renderedHtml),
2713
- this.getHeader(),
2716
+ this.renderHeader(),
2714
2717
  this.question.hasColumns
2715
2718
  ? this.getColumnedBody(cssClasses)
2716
2719
  : this.getBody(cssClasses),
2717
2720
  this.getFooter()));
2718
2721
  }
2719
- getHeader() {
2720
- if (this.question.hasHeadItems) {
2721
- return this.question.headItems.map((item, ii) => this.renderItem(item, false, this.question.cssClasses));
2722
- }
2723
- }
2722
+ renderHeader() { return null; }
2724
2723
  getFooter() {
2725
2724
  if (this.question.hasFootItems) {
2726
- return this.question.footItems.map((item, ii) => this.renderItem(item, false, this.question.cssClasses));
2725
+ const items = this.question.footItems.map((item, ii) => this.renderItem(item, false, this.question.cssClasses));
2726
+ return _$1(k$2, null, items);
2727
2727
  }
2728
+ return null;
2728
2729
  }
2730
+ getStateValue() { return undefined; }
2731
+ isItemChecked(item, value) { return false; }
2729
2732
  getColumnedBody(cssClasses) {
2730
2733
  return (_$1("div", { className: cssClasses.rootMultiColumn }, this.getColumns(cssClasses)));
2731
2734
  }
2732
2735
  getColumns(cssClasses) {
2736
+ const value = this.getStateValue();
2733
2737
  return this.question.columns.map((column, ci) => {
2734
- var items = column.map((item, ii) => this.renderItem(item, ci === 0 && ii === 0, cssClasses, "" + ci + ii));
2738
+ var items = column.map((item, ii) => this.renderItem(item, ci === 0 && ii === 0, cssClasses, "" + ci + ii, this.isItemChecked(item, value)));
2735
2739
  return (_$1("div", { key: "column" + ci + this.question.getItemsColumnKey(column), className: this.question.getColumnClass(), role: "presentation" }, items));
2736
2740
  });
2737
2741
  }
@@ -2744,22 +2748,23 @@ class SurveyQuestionCheckbox extends SurveyQuestionElementBase {
2744
2748
  }
2745
2749
  }
2746
2750
  getItems(cssClasses, choices) {
2747
- var renderedItems = [];
2748
- for (var i = 0; i < choices.length; i++) {
2749
- var item = choices[i];
2750
- var renderedItem = this.renderItem(item, i == 0, cssClasses, "" + i);
2751
+ const items = [];
2752
+ const value = this.getStateValue();
2753
+ for (let i = 0; i < choices.length; i++) {
2754
+ const item = choices[i];
2755
+ const renderedItem = this.renderItem(item, i == 0, cssClasses, "" + i, this.isItemChecked(item, value));
2751
2756
  if (!!renderedItem) {
2752
- renderedItems.push(renderedItem);
2757
+ items.push(renderedItem);
2753
2758
  }
2754
2759
  }
2755
- return renderedItems;
2760
+ return items;
2756
2761
  }
2757
2762
  get textStyle() {
2758
2763
  return null;
2759
2764
  }
2760
- renderItem(item, isFirst, cssClasses, index) {
2765
+ renderItem(item, isFirst, cssClasses, index, isChecked) {
2761
2766
  const renderedItem = ReactElementFactory.Instance.createElement(this.question.itemComponent, {
2762
- key: item.value,
2767
+ key: item.uniqueId,
2763
2768
  question: this.question,
2764
2769
  cssClasses: cssClasses,
2765
2770
  isDisplayMode: this.isDisplayMode,
@@ -2767,6 +2772,8 @@ class SurveyQuestionCheckbox extends SurveyQuestionElementBase {
2767
2772
  textStyle: this.textStyle,
2768
2773
  index: index,
2769
2774
  isFirst: isFirst,
2775
+ isChecked: isChecked,
2776
+ creator: this.props.creator,
2770
2777
  });
2771
2778
  const survey = this.question.survey;
2772
2779
  let wrappedItem = null;
@@ -2776,11 +2783,11 @@ class SurveyQuestionCheckbox extends SurveyQuestionElementBase {
2776
2783
  return wrappedItem !== null && wrappedItem !== void 0 ? wrappedItem : renderedItem;
2777
2784
  }
2778
2785
  }
2779
- class SurveyQuestionCheckboxItem extends ReactSurveyElement {
2786
+ class SurveyQuestionSelectBaseItem extends ReactSurveyElement {
2780
2787
  constructor(props) {
2781
2788
  super(props);
2782
2789
  this.handleOnChange = (event) => {
2783
- this.question.clickItemHandler(this.item, event.target.checked);
2790
+ this.doOnItemChange(event);
2784
2791
  };
2785
2792
  this.rootRef = b$1();
2786
2793
  }
@@ -2827,15 +2834,19 @@ class SurveyQuestionCheckboxItem extends ReactSurveyElement {
2827
2834
  !!this.question.customWidget.widgetJson.isDefaultRender ||
2828
2835
  !!this.question.customWidget.widgetJson.render);
2829
2836
  }
2837
+ doOnItemChange(event) { }
2830
2838
  canRender() {
2831
2839
  return !!this.item && !!this.question;
2832
2840
  }
2833
2841
  renderElement() {
2834
- const isChecked = this.question.isItemSelected(this.item);
2835
2842
  return _$1(k$2, null,
2836
- this.renderCheckbox(isChecked, null),
2843
+ this.renderElementContent(),
2844
+ this.renderPanel(),
2837
2845
  this.renderComment());
2838
2846
  }
2847
+ renderElementContent() {
2848
+ return null;
2849
+ }
2839
2850
  get inputStyle() {
2840
2851
  return null; //{ marginRight: "3px" };
2841
2852
  }
@@ -2845,7 +2856,61 @@ class SurveyQuestionCheckboxItem extends ReactSurveyElement {
2845
2856
  return _$1("div", { className: this.question.getCommentAreaCss(true) },
2846
2857
  _$1(SurveyQuestionCommentValueItem, { question: this.question, item: this.item, cssClasses: this.question.cssClasses }));
2847
2858
  }
2848
- renderCheckbox(isChecked, otherItem) {
2859
+ renderPanel() {
2860
+ if (this.item.isPanelShowing) {
2861
+ const panel = this.item.panel;
2862
+ return (_$1(SurveyPanel, { key: panel.id, element: panel, survey: this.question.survey, cssClasses: this.props.cssClasses, isDisplayMode: this.isDisplayMode, creator: this.props.creator }));
2863
+ }
2864
+ return null;
2865
+ }
2866
+ componentDidMount() {
2867
+ super.componentDidMount();
2868
+ if (!this.question.isDesignMode) {
2869
+ this.item.setRootElement(this.rootRef.current);
2870
+ }
2871
+ }
2872
+ componentWillUnmount() {
2873
+ super.componentWillUnmount();
2874
+ if (!this.question.isDesignMode) {
2875
+ this.item.setRootElement(undefined);
2876
+ }
2877
+ }
2878
+ }
2879
+
2880
+ class SurveyQuestionCheckbox extends SurveyQuestionSelectbase {
2881
+ constructor(props) {
2882
+ super(props);
2883
+ }
2884
+ get question() {
2885
+ return this.questionBase;
2886
+ }
2887
+ renderHeader() {
2888
+ return _$1(k$2, null,
2889
+ _$1("legend", { className: "sv-hidden" }, this.question.locTitle.renderedHtml),
2890
+ this.getHeader());
2891
+ }
2892
+ getHeader() {
2893
+ if (this.question.hasHeadItems) {
2894
+ return this.question.headItems.map((item, ii) => this.renderItem(item, false, this.question.cssClasses));
2895
+ }
2896
+ return null;
2897
+ }
2898
+ }
2899
+ class SurveyQuestionCheckboxItem extends SurveyQuestionSelectBaseItem {
2900
+ constructor(props) {
2901
+ super(props);
2902
+ }
2903
+ doOnItemChange(event) {
2904
+ this.question.clickItemHandler(this.item, event.target.checked);
2905
+ }
2906
+ renderElementContent() {
2907
+ const isChecked = this.question.isItemSelected(this.item);
2908
+ return this.renderCheckbox(isChecked);
2909
+ }
2910
+ get inputStyle() {
2911
+ return null; //{ marginRight: "3px" };
2912
+ }
2913
+ renderCheckbox(isChecked) {
2849
2914
  const id = this.question.getItemId(this.item);
2850
2915
  const itemClass = this.question.getItemClass(this.item);
2851
2916
  const labelClass = this.question.getLabelClass(this.item);
@@ -2859,20 +2924,7 @@ class SurveyQuestionCheckboxItem extends ReactSurveyElement {
2859
2924
  _$1("use", { xlinkHref: this.question.itemSvgIcon })) :
2860
2925
  null) :
2861
2926
  null,
2862
- itemLabel),
2863
- otherItem));
2864
- }
2865
- componentDidMount() {
2866
- super.componentDidMount();
2867
- if (!this.question.isDesignMode) {
2868
- this.item.setRootElement(this.rootRef.current);
2869
- }
2870
- }
2871
- componentWillUnmount() {
2872
- super.componentWillUnmount();
2873
- if (!this.question.isDesignMode) {
2874
- this.item.setRootElement(undefined);
2875
- }
2927
+ itemLabel)));
2876
2928
  }
2877
2929
  }
2878
2930
  ReactElementFactory.Instance.registerElement("survey-checkbox-item", (props) => {
@@ -2932,7 +2984,7 @@ class SurveyQuestionRanking extends SurveyQuestionElementBase {
2932
2984
  const index = i;
2933
2985
  const indexText = this.question.getNumberByIndex(index);
2934
2986
  const tabIndex = this.question.getItemTabIndex(item);
2935
- const renderedItem = (_$1(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 }));
2987
+ const renderedItem = (_$1(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 }));
2936
2988
  const survey = this.question.survey;
2937
2989
  let wrappedItem = null;
2938
2990
  if (!!survey) {
@@ -3312,7 +3364,7 @@ class SurveyQuestionDropdownBase extends SurveyQuestionUncontrolledElement {
3312
3364
  renderOther(item, cssClasses) {
3313
3365
  if (!item || !item.isCommentShowing)
3314
3366
  return null;
3315
- return (_$1("div", { key: item.normalizedId, className: this.question.getCommentAreaCss(true) },
3367
+ return (_$1("div", { key: item.uniqueId, className: this.question.getCommentAreaCss(true) },
3316
3368
  _$1(SurveyQuestionCommentValueItem, { question: this.question, item: item, cssClasses: this.question.cssClasses })));
3317
3369
  }
3318
3370
  renderEditorButtons() {
@@ -3435,7 +3487,7 @@ class SurveyQuestionDropdownSelect extends SurveyQuestionDropdown {
3435
3487
  _$1("div", { id: this.question.inputId, className: this.question.getControlClass(), disabled: true }, this.question.readOnlyText)) :
3436
3488
  (_$1("select", { id: this.question.inputId, className: this.question.getControlClass(), ref: (select) => (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 },
3437
3489
  this.question.allowClear ? (_$1("option", { value: "" }, this.question.placeholder)) : null,
3438
- this.question.visibleChoices.map((item, i) => _$1(SurveyQuestionOptionItem, { key: "item" + i, item: item }))));
3490
+ this.question.visibleChoices.map((item) => _$1(SurveyQuestionOptionItem, { key: item.uniqueId, item: item }))));
3439
3491
  return (_$1("div", { className: cssClasses.selectWrapper },
3440
3492
  selectElement,
3441
3493
  this.createChevronButton()));
@@ -3481,21 +3533,19 @@ class SurveyQuestionMatrix extends SurveyQuestionElementBase {
3481
3533
  var headers = [];
3482
3534
  for (var i = 0; i < this.question.visibleColumns.length; i++) {
3483
3535
  var column = this.question.visibleColumns[i];
3484
- var key = "column" + i;
3485
3536
  var columText = this.renderLocString(column.locText);
3486
3537
  const style = {};
3487
3538
  if (!!this.question.columnMinWidth) {
3488
3539
  style.minWidth = this.question.columnMinWidth;
3489
3540
  style.width = this.question.columnMinWidth;
3490
3541
  }
3491
- headers.push(_$1("th", { className: this.question.cssClasses.headerCell, style: style, key: key }, this.wrapCell({ column: column }, columText, "column-header")));
3542
+ headers.push(_$1("th", { className: this.question.cssClasses.headerCell, style: style, key: column.uniqueId }, this.wrapCell({ column: column }, columText, "column-header")));
3492
3543
  }
3493
3544
  var rows = [];
3494
3545
  var visibleRows = this.question.visibleRows;
3495
3546
  for (var i = 0; i < visibleRows.length; i++) {
3496
3547
  var row = visibleRows[i];
3497
- var key = "row-" + row.name + "-" + i;
3498
- rows.push(_$1(SurveyQuestionMatrixRow, { key: key, question: this.question, cssClasses: cssClasses, row: row, isFirst: i == 0 }));
3548
+ rows.push(_$1(SurveyQuestionMatrixRow, { key: row.uniqueId, question: this.question, cssClasses: cssClasses, row: row, isFirst: i == 0 }));
3499
3549
  }
3500
3550
  var header = !this.question.showHeader ? null : (_$1("thead", { role: "presentation" },
3501
3551
  _$1("tr", null,
@@ -3561,7 +3611,7 @@ class SurveyQuestionMatrixRow extends ReactSurveyElement {
3561
3611
  for (var i = 0; i < this.question.visibleColumns.length; i++) {
3562
3612
  let td = null;
3563
3613
  const column = this.question.visibleColumns[i];
3564
- const key = "value" + i;
3614
+ const key = column.uniqueId;
3565
3615
  let itemClass = this.question.getItemClass(row, column);
3566
3616
  if (this.question.hasCellText) {
3567
3617
  const getHandler = (column) => () => this.cellClick(row, column);
@@ -3860,7 +3910,7 @@ class SurveyQuestionMultipleText extends SurveyQuestionElementBase {
3860
3910
  else {
3861
3911
  cellContent = _$1(SurveyMultipleTextItem, { question: this.question, item: cell.item, creator: this.creator, cssClasses: cssClasses });
3862
3912
  }
3863
- return (_$1("td", { key: "item" + index, className: cell.className, onFocus: focusIn }, cellContent));
3913
+ return (_$1("td", { key: cell.item.id, className: cell.className, onFocus: focusIn }, cellContent));
3864
3914
  }
3865
3915
  renderRow(rowIndex, cells, cssClasses) {
3866
3916
  const key = "item" + rowIndex;
@@ -3908,90 +3958,32 @@ ReactQuestionFactory.Instance.registerQuestion("multipletext", (props) => {
3908
3958
  return _$1(SurveyQuestionMultipleText, props);
3909
3959
  });
3910
3960
 
3911
- class SurveyQuestionRadiogroup extends SurveyQuestionElementBase {
3961
+ class SurveyQuestionRadiogroup extends SurveyQuestionSelectbase {
3912
3962
  constructor(props) {
3913
3963
  super(props);
3914
3964
  }
3915
3965
  get question() {
3916
3966
  return this.questionBase;
3917
3967
  }
3918
- renderElement() {
3919
- var cssClasses = this.question.cssClasses;
3920
- var clearButton = null;
3921
- if (this.question.showClearButtonInContent) {
3922
- clearButton = (_$1("div", null,
3923
- _$1("input", { type: "button", className: this.question.cssClasses.clearButton, onClick: () => this.question.clearValue(true), value: this.question.clearButtonCaption })));
3924
- }
3925
- return (_$1("fieldset", { className: this.question.getSelectBaseRootCss(), ref: (fieldset) => (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 },
3926
- this.question.hasColumns
3927
- ? this.getColumnedBody(cssClasses)
3928
- : this.getBody(cssClasses),
3929
- this.getFooter(),
3930
- clearButton));
3931
- }
3932
3968
  getFooter() {
3933
- if (this.question.hasFootItems) {
3934
- return this.question.footItems.map((item, ii) => this.renderItem(item, false, this.question.cssClasses));
3935
- }
3936
- }
3937
- getColumnedBody(cssClasses) {
3938
- return (_$1("div", { className: cssClasses.rootMultiColumn }, this.getColumns(cssClasses)));
3939
- }
3940
- getColumns(cssClasses) {
3941
- var value = this.getStateValue();
3942
- return this.question.columns.map((column, ci) => {
3943
- var items = column.map((item, ii) => this.renderItem(item, value, cssClasses, "" + ci + ii));
3944
- return (_$1("div", { key: "column" + ci + this.question.getItemsColumnKey(column), className: this.question.getColumnClass(), role: "presentation" }, items));
3945
- });
3946
- }
3947
- getBody(cssClasses) {
3948
- if (this.question.blockedRow) {
3949
- return _$1("div", { className: cssClasses.rootRow }, this.getItems(cssClasses, this.question.dataChoices));
3950
- }
3951
- else {
3952
- return _$1(k$2, null, this.getItems(cssClasses, this.question.bodyItems));
3953
- }
3954
- }
3955
- getItems(cssClasses, choices) {
3956
- var items = [];
3957
- var value = this.getStateValue();
3958
- for (var i = 0; i < choices.length; i++) {
3959
- var item = choices[i];
3960
- var renderedItem = this.renderItem(item, value, cssClasses, "" + i);
3961
- items.push(renderedItem);
3962
- }
3963
- return items;
3964
- }
3965
- get textStyle() {
3966
- return null; //{ display: "inline", position: "static" };
3969
+ return _$1(k$2, null,
3970
+ super.getFooter(),
3971
+ this.renderClearButton());
3967
3972
  }
3968
- renderItem(item, value, cssClasses, index) {
3969
- const renderedItem = ReactElementFactory.Instance.createElement(this.question.itemComponent, {
3970
- key: item.value,
3971
- question: this.question,
3972
- cssClasses: cssClasses,
3973
- isDisplayMode: this.isDisplayMode,
3974
- item: item,
3975
- textStyle: this.textStyle,
3976
- index: index,
3977
- isChecked: value === item.value,
3978
- });
3979
- const survey = this.question.survey;
3980
- let wrappedItem = null;
3981
- if (!!survey) {
3982
- wrappedItem = ReactSurveyElementsWrapper.wrapItemValue(survey, renderedItem, this.question, item);
3983
- }
3984
- return wrappedItem !== null && wrappedItem !== void 0 ? wrappedItem : renderedItem;
3973
+ renderClearButton() {
3974
+ if (!this.question.showClearButtonInContent)
3975
+ return null;
3976
+ return (_$1("div", null,
3977
+ _$1("input", { type: "button", className: this.question.cssClasses.clearButton, onClick: () => this.question.clearValueFromUI(), value: this.question.clearButtonCaption })));
3985
3978
  }
3986
3979
  getStateValue() {
3987
3980
  return !this.question.isEmpty() ? this.question.renderedValue : "";
3988
3981
  }
3982
+ isItemChecked(item, value) { return item.value === value; }
3989
3983
  }
3990
- class SurveyQuestionRadioItem extends ReactSurveyElement {
3984
+ class SurveyQuestionRadioItem extends SurveyQuestionSelectBaseItem {
3991
3985
  constructor(props) {
3992
3986
  super(props);
3993
- this.rootRef = b$1();
3994
- this.handleOnChange = this.handleOnChange.bind(this);
3995
3987
  this.handleOnMouseDown = this.handleOnMouseDown.bind(this);
3996
3988
  }
3997
3989
  getStateElement() {
@@ -4000,64 +3992,17 @@ class SurveyQuestionRadioItem extends ReactSurveyElement {
4000
3992
  get question() {
4001
3993
  return this.props.question;
4002
3994
  }
4003
- get item() {
4004
- return this.props.item;
4005
- }
4006
- get textStyle() {
4007
- return this.props.textStyle;
4008
- }
4009
- get index() {
4010
- return this.props.index;
4011
- }
4012
3995
  get isChecked() {
4013
3996
  return this.props.isChecked;
4014
3997
  }
4015
- get hideCaption() {
4016
- return this.props.hideCaption === true;
4017
- }
4018
- get ariaLabel() {
4019
- return this.props.ariaLabel || null;
4020
- }
4021
- shouldComponentUpdate(nextProps, nextState) {
4022
- if (!super.shouldComponentUpdate(nextProps, nextState))
4023
- return false;
4024
- if (!this.question)
4025
- return false;
4026
- return (!this.question.customWidget ||
4027
- !!this.question.customWidgetData.isNeedRender ||
4028
- !!this.question.customWidget.widgetJson.isDefaultRender ||
4029
- !!this.question.customWidget.widgetJson.render);
4030
- }
4031
- handleOnChange(event) {
3998
+ doOnItemChange(event) {
4032
3999
  this.question.clickItemHandler(this.item);
4033
4000
  }
4034
4001
  handleOnMouseDown(event) {
4035
4002
  this.question.onMouseDown();
4036
4003
  }
4037
- canRender() {
4038
- return !!this.question && !!this.item;
4039
- }
4040
- componentDidUpdate(prevProps, prevState) {
4041
- super.componentDidUpdate(prevProps, prevState);
4042
- if (prevProps.item !== this.props.item && !this.question.isDesignMode) {
4043
- if (this.props.item) {
4044
- this.props.item.setRootElement(this.rootRef.current);
4045
- }
4046
- if (prevProps.item) {
4047
- prevProps.item.setRootElement(undefined);
4048
- }
4049
- }
4050
- }
4051
- renderElement() {
4052
- return _$1(k$2, null,
4053
- this.renderRadioButton(),
4054
- this.renderComment());
4055
- }
4056
- renderComment() {
4057
- if (!this.item.isCommentShowing)
4058
- return null;
4059
- return _$1("div", { className: this.question.getCommentAreaCss(true) },
4060
- _$1(SurveyQuestionCommentValueItem, { question: this.question, item: this.item, cssClasses: this.question.cssClasses }));
4004
+ renderElementContent() {
4005
+ return this.renderRadioButton();
4061
4006
  }
4062
4007
  renderRadioButton() {
4063
4008
  var itemClass = this.question.getItemClass(this.item);
@@ -4075,18 +4020,6 @@ class SurveyQuestionRadioItem extends ReactSurveyElement {
4075
4020
  null,
4076
4021
  itemLabel)));
4077
4022
  }
4078
- componentDidMount() {
4079
- super.componentDidMount();
4080
- if (!this.question.isDesignMode) {
4081
- this.item.setRootElement(this.rootRef.current);
4082
- }
4083
- }
4084
- componentWillUnmount() {
4085
- super.componentWillUnmount();
4086
- if (!this.question.isDesignMode) {
4087
- this.item.setRootElement(undefined);
4088
- }
4089
- }
4090
4023
  }
4091
4024
  ReactElementFactory.Instance.registerElement("survey-radiogroup-item", (props) => {
4092
4025
  return _$1(SurveyQuestionRadioItem, props);
@@ -4542,7 +4475,7 @@ class SurveyQuestionMatrixDropdownBase extends SurveyQuestionElementBase {
4542
4475
  return this.renderTableDiv();
4543
4476
  }
4544
4477
  renderTableDiv() {
4545
- return (_$1("div", { className: this.question.cssClasses.tableWrapper, "data-sv-drop-target-matrix-row": this.question.renderedTable.wrapperDropTargetId, ref: (root) => (this.setControl(root)) },
4478
+ return (_$1("div", { className: this.question.cssClasses.tableWrapper, ref: (root) => (this.setControl(root)) },
4546
4479
  _$1(SurveyQuestionMatrixTable, { question: this.question, creator: this.creator, wrapCell: (cell, element, reason) => this.wrapCell(cell, element, reason) })));
4547
4480
  }
4548
4481
  }
@@ -5496,7 +5429,7 @@ class SurveyQuestionImagePicker extends SurveyQuestionElementBase {
5496
5429
  }
5497
5430
  getColumns(cssClasses) {
5498
5431
  return this.question.columns.map((column, ci) => {
5499
- var items = column.map((item, ii) => this.renderItem("item" + ii, item, cssClasses));
5432
+ var items = column.map((item, ii) => this.renderItem(item, cssClasses));
5500
5433
  return (_$1("div", { key: "column" + ci + this.question.getItemsColumnKey(column), className: this.question.getColumnClass(), role: "presentation" }, items));
5501
5434
  });
5502
5435
  }
@@ -5504,16 +5437,15 @@ class SurveyQuestionImagePicker extends SurveyQuestionElementBase {
5504
5437
  var items = [];
5505
5438
  for (var i = 0; i < this.question.visibleChoices.length; i++) {
5506
5439
  var item = this.question.visibleChoices[i];
5507
- var key = "item" + i;
5508
- items.push(this.renderItem(key, item, cssClasses));
5440
+ items.push(this.renderItem(item, cssClasses));
5509
5441
  }
5510
5442
  return items;
5511
5443
  }
5512
5444
  get textStyle() {
5513
5445
  return { marginLeft: "3px", display: "inline", position: "static" };
5514
5446
  }
5515
- renderItem(key, item, cssClasses) {
5516
- const renderedItem = _$1(SurveyQuestionImagePickerItem, { key: key, question: this.question, item: item, cssClasses: cssClasses });
5447
+ renderItem(item, cssClasses) {
5448
+ const renderedItem = _$1(SurveyQuestionImagePickerItem, { key: item.uniqueId, question: this.question, item: item, cssClasses: cssClasses });
5517
5449
  const survey = this.question.survey;
5518
5450
  let wrappedItem = null;
5519
5451
  if (!!survey) {
@@ -5699,7 +5631,7 @@ class SurveyQuestionSignaturePad extends SurveyQuestionElementBase {
5699
5631
  return null;
5700
5632
  var cssClasses = this.question.cssClasses;
5701
5633
  return _$1("div", { className: cssClasses.controls },
5702
- _$1("button", { type: "button", className: cssClasses.clearButton, title: this.question.clearButtonCaption, onClick: () => this.question.clearValue(true) },
5634
+ _$1("button", { type: "button", className: cssClasses.clearButton, title: this.question.clearButtonCaption, onClick: () => this.question.clearValueFromUI() },
5703
5635
  this.question.cssClasses.clearButtonIconId ? _$1(SvgIcon, { iconName: this.question.cssClasses.clearButtonIconId, size: "auto" }) : _$1("span", null, "\u2716"),
5704
5636
  " "));
5705
5637
  }
@@ -6146,9 +6078,20 @@ class SliderLabelItem extends SurveyElementBase {
6146
6078
  renderElement() {
6147
6079
  const { cssClasses, handleLabelPointerUp, getLabelCss, getPercent } = this.question;
6148
6080
  const { value, locText } = this.item;
6149
- return _$1("div", { key: this.item.id, className: getLabelCss(locText), style: { left: getPercent(value) + "%" }, onPointerUp: (e) => { handleLabelPointerUp(e.nativeEvent, value); } },
6081
+ let labelText = null;
6082
+ let labelTextSecondary = null;
6083
+ if (this.item.showValue) {
6084
+ labelText = _$1("div", { className: cssClasses.labelText }, this.item.value);
6085
+ labelTextSecondary = _$1("div", { className: cssClasses.labelTextSecondaryMode }, this.renderLocString(locText));
6086
+ }
6087
+ else {
6088
+ labelText = _$1("div", { className: cssClasses.labelText }, this.renderLocString(locText));
6089
+ }
6090
+ return _$1("div", { key: this.item.uniqueId, className: getLabelCss(locText), style: { left: getPercent(value) + "%" }, onPointerUp: (e) => { handleLabelPointerUp(e.nativeEvent, value); } },
6150
6091
  _$1("div", { className: cssClasses.labelTick }),
6151
- _$1("div", { className: cssClasses.labelText }, this.renderLocString(locText)));
6092
+ _$1("div", { className: cssClasses.labelTextContainer },
6093
+ labelText,
6094
+ labelTextSecondary));
6152
6095
  }
6153
6096
  }
6154
6097
  ReactElementFactory.Instance.registerElement("sv-slider-label-item", (props) => {
@@ -6337,7 +6280,7 @@ SurveyModel.prototype["render"] = function (element = null) {
6337
6280
  }
6338
6281
  };
6339
6282
  const preact = React;
6340
- checkLibraryVersion(`${"2.3.9"}`, "survey-js-ui");
6283
+ checkLibraryVersion(`${"2.3.11"}`, "survey-js-ui");
6341
6284
 
6342
6285
  export { CharacterCounterComponent, O as Children, x$2 as Component, ComponentsContainer, k$2 as Fragment, Header, HeaderCell, HeaderMobile, List, ListItemContent, ListItemGroup, LoadingIndicatorComponent, LogoImage, MatrixRow, NotifierComponent, Popup, PopupModal, PopupSurvey, N as PureComponent, QuestionErrorComponent, RatingDropdownItem, RatingItem, RatingItemSmiley, RatingItemStar, ReactElementFactory, ReactQuestionFactory, ReactSurveyElement, ReactSurveyElementsWrapper, Scroll, Skeleton, SliderLabelItem, Cn as StrictMode, Survey, SurveyActionBar, SurveyElementBase, SurveyElementErrors, SurveyFileChooseButton, SurveyFileItem, SurveyFilePreview, SurveyFlowPanel, SurveyHeader, SurveyLocStringEditor, SurveyLocStringViewer, SurveyNavigationBase, SurveyNavigationButton, SurveyPage, SurveyPanel, SurveyProgress, SurveyProgressButtons, SurveyProgressToc, SurveyQuestion, SurveyQuestionAndErrorsCell, SurveyQuestionBoolean, SurveyQuestionBooleanCheckbox, SurveyQuestionBooleanRadio, SurveyQuestionButtonGroup, SurveyQuestionButtonGroupDropdown, SurveyQuestionCheckbox, SurveyQuestionCheckboxItem, SurveyQuestionComment, SurveyQuestionCommentItem, SurveyQuestionComposite, SurveyQuestionCustom, SurveyQuestionDropdown, SurveyQuestionDropdownBase, SurveyQuestionDropdownSelect, SurveyQuestionElementBase, SurveyQuestionEmpty, SurveyQuestionExpression, SurveyQuestionFile, SurveyQuestionHtml, SurveyQuestionImage, SurveyQuestionImagePicker, SurveyQuestionMatrix, SurveyQuestionMatrixCell, SurveyQuestionMatrixDetailButton, SurveyQuestionMatrixDropdown, SurveyQuestionMatrixDropdownBase, SurveyQuestionMatrixDropdownCell, SurveyQuestionMatrixDynamic, SurveyQuestionMatrixDynamicAddButton, SurveyQuestionMatrixDynamicDragDropIcon, SurveyQuestionMatrixDynamicRemoveButton, SurveyQuestionMatrixRow, SurveyQuestionMultipleText, SurveyQuestionOptionItem, SurveyQuestionPanelDynamic, SurveyQuestionPanelDynamicAddButton, SurveyQuestionPanelDynamicNextButton, SurveyQuestionPanelDynamicPrevButton, SurveyQuestionPanelDynamicProgressText, SurveyQuestionPanelDynamicRemoveButton, SurveyQuestionRadioItem, SurveyQuestionRadiogroup, SurveyQuestionRanking, SurveyQuestionRankingItem, SurveyQuestionRankingItemContent, SurveyQuestionRating, SurveyQuestionRatingDropdown, SurveyQuestionSignaturePad, SurveyQuestionSlider, SurveyQuestionTagbox, SurveyQuestionTagboxItem, SurveyQuestionText, SurveyRow, SurveyTimerPanel, SurveyWindow, P as Suspense, B as SuspenseList, SvgBundleComponent, SvgIcon, TagboxFilterString, TitleActions, TitleElement, attachKey2click, _n as cloneElement, Q$1 as createContext, _$1 as createElement, dn as createFactory, $ as createPortal, b$1 as createRef, Sn as findDOMNode, En as flushSync, D as forwardRef, tn as hydrate, pn as isFragment, yn as isMemo, mn as isValidElement, z as lazy, M as memo, preact, nn as render, renderPopupSurvey, renderSurvey, R as startTransition, bn as unmountComponentAtNode, gn as unstable_batchedUpdates, q$1 as useCallback, x$1 as useContext, P$1 as useDebugValue, w as useDeferredValue, y as useEffect, g$1 as useId, F$1 as useImperativeHandle, I as useInsertionEffect, _ as useLayoutEffect, T$1 as useMemo, h as useReducer, A$1 as useRef, d as useState, C as useSyncExternalStore, k as useTransition, vn as version };
6343
6286
  //# sourceMappingURL=survey-js-ui.mjs.map