survey-react-ui 2.3.10 → 2.3.12

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.10
2
+ * surveyjs - Survey JavaScript library v2.3.12
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
  */
@@ -118,6 +118,16 @@ class SurveyElementBase extends React.Component {
118
118
  });
119
119
  }
120
120
  };
121
+ this.onArrayChangedCallback = (stateElement, options) => {
122
+ if (this.isRendering)
123
+ return;
124
+ this.changedStatePropNameValue = options.name;
125
+ this.setState((state) => {
126
+ var newState = {};
127
+ newState[options.name] = options.newValue;
128
+ return newState;
129
+ });
130
+ };
121
131
  }
122
132
  componentDidMount() {
123
133
  this.makeBaseElementsReact();
@@ -244,16 +254,7 @@ class SurveyElementBase extends React.Component {
244
254
  var val = hash[key];
245
255
  if (Array.isArray(val)) {
246
256
  var val = val;
247
- val["onArrayChanged"] = (arrayChanges) => {
248
- if (this.isRendering)
249
- return;
250
- this.changedStatePropNameValue = key;
251
- this.setState((state) => {
252
- var newState = {};
253
- newState[key] = val;
254
- return newState;
255
- });
256
- };
257
+ stateElement.addOnArrayChangedCallback(val, this.onArrayChangedCallback);
257
258
  }
258
259
  });
259
260
  stateElement.setPropertyValueCoreHandler = this.propertyValueChangedHandler;
@@ -270,7 +271,7 @@ class SurveyElementBase extends React.Component {
270
271
  var val = hash[key];
271
272
  if (Array.isArray(val)) {
272
273
  var val = val;
273
- val["onArrayChanged"] = () => { };
274
+ stateElement.removeOnArrayChangedCallback(val, this.onArrayChangedCallback);
274
275
  }
275
276
  });
276
277
  }
@@ -801,13 +802,16 @@ class TitleActions extends React.Component {
801
802
  get element() {
802
803
  return this.props.element;
803
804
  }
805
+ get renderActions() {
806
+ return this.props.renderActions === undefined ? true : this.props.renderActions;
807
+ }
804
808
  render() {
805
809
  const titleContent = React.createElement(TitleContent, { element: this.element, cssClasses: this.cssClasses });
806
810
  if (!this.element.hasTitleActions)
807
811
  return titleContent;
808
812
  return (React.createElement("div", { className: "sv-title-actions" },
809
813
  React.createElement("span", { className: "sv-title-actions__title" }, titleContent),
810
- React.createElement(SurveyActionBar, { model: this.element.getTitleToolbar() })));
814
+ (this.renderActions ? React.createElement(SurveyActionBar, { model: this.element.getTitleToolbar() }) : null)));
811
815
  }
812
816
  }
813
817
  RendererFactory.Instance.registerRenderer("element", "title-actions", "sv-title-actions");
@@ -834,7 +838,7 @@ class TitleElement extends React.Component {
834
838
  return null;
835
839
  const ariaLabel = element.titleAriaLabel || undefined;
836
840
  const titleExpandableSvg = this.renderTitleExpandableSvg();
837
- const titleContent = (React.createElement(TitleActions, { element: element, cssClasses: element.cssClasses }));
841
+ const titleContent = (React.createElement(TitleActions, { element: element, cssClasses: element.cssClasses, renderActions: this.props.renderActions }));
838
842
  let onClick = undefined;
839
843
  let onKeyUp = undefined;
840
844
  if (element.hasTitleEvents) {
@@ -1074,7 +1078,7 @@ class PopupModal extends SurveyElementBase {
1074
1078
  PopupModal.modalDescriptors = [];
1075
1079
 
1076
1080
  /*!
1077
- * surveyjs - Survey JavaScript library v2.3.10
1081
+ * surveyjs - Survey JavaScript library v2.3.12
1078
1082
  * Copyright (c) 2015-2025 Devsoft Baltic OÜ - http://surveyjs.io/
1079
1083
  * License: MIT (http://www.opensource.org/licenses/mit-license.php)
1080
1084
  */
@@ -1144,7 +1148,7 @@ var iconsV1 = {
1144
1148
  };
1145
1149
 
1146
1150
  /*!
1147
- * surveyjs - Survey JavaScript library v2.3.10
1151
+ * surveyjs - Survey JavaScript library v2.3.12
1148
1152
  * Copyright (c) 2015-2025 Devsoft Baltic OÜ - http://surveyjs.io/
1149
1153
  * License: MIT (http://www.opensource.org/licenses/mit-license.php)
1150
1154
  */
@@ -1928,7 +1932,7 @@ class SurveyQuestionCommentValueItem extends SurveyQuestionCommentItem {
1928
1932
  getTextAreaModel() {
1929
1933
  return this.props.question.getCommentTextAreaModel(this.props.item);
1930
1934
  }
1931
- getKey() { return this.props.item.normalizedId; }
1935
+ getKey() { return this.props.item.uniqueId; }
1932
1936
  }
1933
1937
  ReactQuestionFactory.Instance.registerQuestion("comment", (props) => {
1934
1938
  return React.createElement(SurveyQuestionComment, props);
@@ -2707,7 +2711,7 @@ class SurveyQuestionSelectbase extends SurveyQuestionElementBase {
2707
2711
  }
2708
2712
  renderItem(item, isFirst, cssClasses, index, isChecked) {
2709
2713
  const renderedItem = ReactElementFactory.Instance.createElement(this.question.itemComponent, {
2710
- key: item.value,
2714
+ key: item.uniqueId,
2711
2715
  question: this.question,
2712
2716
  cssClasses: cssClasses,
2713
2717
  isDisplayMode: this.isDisplayMode,
@@ -2927,7 +2931,7 @@ class SurveyQuestionRanking extends SurveyQuestionElementBase {
2927
2931
  const index = i;
2928
2932
  const indexText = this.question.getNumberByIndex(index);
2929
2933
  const tabIndex = this.question.getItemTabIndex(item);
2930
- const renderedItem = (React.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 }));
2934
+ const renderedItem = (React.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 }));
2931
2935
  const survey = this.question.survey;
2932
2936
  let wrappedItem = null;
2933
2937
  if (!!survey) {
@@ -3307,7 +3311,7 @@ class SurveyQuestionDropdownBase extends SurveyQuestionUncontrolledElement {
3307
3311
  renderOther(item, cssClasses) {
3308
3312
  if (!item || !item.isCommentShowing)
3309
3313
  return null;
3310
- return (React.createElement("div", { key: item.normalizedId, className: this.question.getCommentAreaCss(true) },
3314
+ return (React.createElement("div", { key: item.uniqueId, className: this.question.getCommentAreaCss(true) },
3311
3315
  React.createElement(SurveyQuestionCommentValueItem, { question: this.question, item: item, cssClasses: this.question.cssClasses })));
3312
3316
  }
3313
3317
  renderEditorButtons() {
@@ -3430,7 +3434,7 @@ class SurveyQuestionDropdownSelect extends SurveyQuestionDropdown {
3430
3434
  React.createElement("div", { id: this.question.inputId, className: this.question.getControlClass(), disabled: true }, this.question.readOnlyText)) :
3431
3435
  (React.createElement("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 },
3432
3436
  this.question.allowClear ? (React.createElement("option", { value: "" }, this.question.placeholder)) : null,
3433
- this.question.visibleChoices.map((item, i) => React.createElement(SurveyQuestionOptionItem, { key: "item" + i, item: item }))));
3437
+ this.question.visibleChoices.map((item) => React.createElement(SurveyQuestionOptionItem, { key: item.uniqueId, item: item }))));
3434
3438
  return (React.createElement("div", { className: cssClasses.selectWrapper },
3435
3439
  selectElement,
3436
3440
  this.createChevronButton()));
@@ -3476,21 +3480,19 @@ class SurveyQuestionMatrix extends SurveyQuestionElementBase {
3476
3480
  var headers = [];
3477
3481
  for (var i = 0; i < this.question.visibleColumns.length; i++) {
3478
3482
  var column = this.question.visibleColumns[i];
3479
- var key = "column" + i;
3480
3483
  var columText = this.renderLocString(column.locText);
3481
3484
  const style = {};
3482
3485
  if (!!this.question.columnMinWidth) {
3483
3486
  style.minWidth = this.question.columnMinWidth;
3484
3487
  style.width = this.question.columnMinWidth;
3485
3488
  }
3486
- headers.push(React.createElement("th", { className: this.question.cssClasses.headerCell, style: style, key: key }, this.wrapCell({ column: column }, columText, "column-header")));
3489
+ headers.push(React.createElement("th", { className: this.question.cssClasses.headerCell, style: style, key: column.uniqueId }, this.wrapCell({ column: column }, columText, "column-header")));
3487
3490
  }
3488
3491
  var rows = [];
3489
3492
  var visibleRows = this.question.visibleRows;
3490
3493
  for (var i = 0; i < visibleRows.length; i++) {
3491
3494
  var row = visibleRows[i];
3492
- var key = "row-" + row.name + "-" + i;
3493
- rows.push(React.createElement(SurveyQuestionMatrixRow, { key: key, question: this.question, cssClasses: cssClasses, row: row, isFirst: i == 0 }));
3495
+ rows.push(React.createElement(SurveyQuestionMatrixRow, { key: row.uniqueId, question: this.question, cssClasses: cssClasses, row: row, isFirst: i == 0 }));
3494
3496
  }
3495
3497
  var header = !this.question.showHeader ? null : (React.createElement("thead", { role: "presentation" },
3496
3498
  React.createElement("tr", null,
@@ -3556,7 +3558,7 @@ class SurveyQuestionMatrixRow extends ReactSurveyElement {
3556
3558
  for (var i = 0; i < this.question.visibleColumns.length; i++) {
3557
3559
  let td = null;
3558
3560
  const column = this.question.visibleColumns[i];
3559
- const key = "value" + i;
3561
+ const key = column.uniqueId;
3560
3562
  let itemClass = this.question.getItemClass(row, column);
3561
3563
  if (this.question.hasCellText) {
3562
3564
  const getHandler = (column) => () => this.cellClick(row, column);
@@ -3855,7 +3857,7 @@ class SurveyQuestionMultipleText extends SurveyQuestionElementBase {
3855
3857
  else {
3856
3858
  cellContent = React.createElement(SurveyMultipleTextItem, { question: this.question, item: cell.item, creator: this.creator, cssClasses: cssClasses });
3857
3859
  }
3858
- return (React.createElement("td", { key: "item" + index, className: cell.className, onFocus: focusIn }, cellContent));
3860
+ return (React.createElement("td", { key: cell.item.id, className: cell.className, onFocus: focusIn }, cellContent));
3859
3861
  }
3860
3862
  renderRow(rowIndex, cells, cssClasses) {
3861
3863
  const key = "item" + rowIndex;
@@ -5374,7 +5376,7 @@ class SurveyQuestionImagePicker extends SurveyQuestionElementBase {
5374
5376
  }
5375
5377
  getColumns(cssClasses) {
5376
5378
  return this.question.columns.map((column, ci) => {
5377
- var items = column.map((item, ii) => this.renderItem("item" + ii, item, cssClasses));
5379
+ var items = column.map((item, ii) => this.renderItem(item, cssClasses));
5378
5380
  return (React.createElement("div", { key: "column" + ci + this.question.getItemsColumnKey(column), className: this.question.getColumnClass(), role: "presentation" }, items));
5379
5381
  });
5380
5382
  }
@@ -5382,16 +5384,15 @@ class SurveyQuestionImagePicker extends SurveyQuestionElementBase {
5382
5384
  var items = [];
5383
5385
  for (var i = 0; i < this.question.visibleChoices.length; i++) {
5384
5386
  var item = this.question.visibleChoices[i];
5385
- var key = "item" + i;
5386
- items.push(this.renderItem(key, item, cssClasses));
5387
+ items.push(this.renderItem(item, cssClasses));
5387
5388
  }
5388
5389
  return items;
5389
5390
  }
5390
5391
  get textStyle() {
5391
5392
  return { marginLeft: "3px", display: "inline", position: "static" };
5392
5393
  }
5393
- renderItem(key, item, cssClasses) {
5394
- const renderedItem = React.createElement(SurveyQuestionImagePickerItem, { key: key, question: this.question, item: item, cssClasses: cssClasses });
5394
+ renderItem(item, cssClasses) {
5395
+ const renderedItem = React.createElement(SurveyQuestionImagePickerItem, { key: item.uniqueId, question: this.question, item: item, cssClasses: cssClasses });
5395
5396
  const survey = this.question.survey;
5396
5397
  let wrappedItem = null;
5397
5398
  if (!!survey) {
@@ -6033,7 +6034,7 @@ class SliderLabelItem extends SurveyElementBase {
6033
6034
  else {
6034
6035
  labelText = React.createElement("div", { className: cssClasses.labelText }, this.renderLocString(locText));
6035
6036
  }
6036
- return React.createElement("div", { key: this.item.id, className: getLabelCss(locText), style: { left: getPercent(value) + "%" }, onPointerUp: (e) => { handleLabelPointerUp(e.nativeEvent, value); } },
6037
+ return React.createElement("div", { key: this.item.uniqueId, className: getLabelCss(locText), style: { left: getPercent(value) + "%" }, onPointerUp: (e) => { handleLabelPointerUp(e.nativeEvent, value); } },
6037
6038
  React.createElement("div", { className: cssClasses.labelTick }),
6038
6039
  React.createElement("div", { className: cssClasses.labelTextContainer },
6039
6040
  labelText,
@@ -6177,7 +6178,7 @@ ReactElementFactory.Instance.registerElement(LocalizableString.editableRenderer,
6177
6178
  return React.createElement(SurveyLocStringEditor, props);
6178
6179
  });
6179
6180
 
6180
- checkLibraryVersion(`${"2.3.10"}`, "survey-react-ui");
6181
+ checkLibraryVersion(`${"2.3.12"}`, "survey-react-ui");
6181
6182
 
6182
6183
  export { CharacterCounterComponent, ComponentsContainer, Header, HeaderCell, HeaderMobile, List, ListItemContent, ListItemGroup, LoadingIndicatorComponent, LogoImage, MatrixRow, NotifierComponent, Popup, PopupModal, PopupSurvey, QuestionErrorComponent, RatingDropdownItem, RatingItem, RatingItemSmiley, RatingItemStar, ReactElementFactory, ReactQuestionFactory, ReactSurveyElement, ReactSurveyElementsWrapper, Scroll, Skeleton, SliderLabelItem, 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, SvgBundleComponent, SvgIcon, TagboxFilterString, TitleActions, TitleElement, attachKey2click };
6183
6184
  //# sourceMappingURL=survey-react-ui.mjs.map