survey-js-ui 3.0.4 → 3.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "survey-js-ui",
3
- "version": "3.0.4",
3
+ "version": "3.1.1",
4
4
  "license": "MIT",
5
5
  "homepage": "https://surveyjs.io/",
6
6
  "author": "DevSoft Baltic OU <info@devsoftbaltic.com>",
@@ -60,7 +60,7 @@
60
60
  },
61
61
  "dependencies": {},
62
62
  "peerDependencies": {
63
- "survey-core": "3.0.4",
63
+ "survey-core": "3.1.1",
64
64
  "@types/react-dom": "*",
65
65
  "@types/react": "*"
66
66
  }
package/survey-js-ui.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - Survey JavaScript library v3.0.4
2
+ * surveyjs - Survey JavaScript library v3.1.1
3
3
  * Copyright (c) 2015-2026 Devsoft Baltic OÜ - http://surveyjs.io/
4
4
  * License: MIT (http://www.opensource.org/licenses/mit-license.php)
5
5
  */
@@ -3661,7 +3661,7 @@
3661
3661
  }
3662
3662
  renderElement() {
3663
3663
  var cssClasses = this.question.cssClasses;
3664
- var rowsTH = this.question.hasRows ? _$1("td", null) : null;
3664
+ var rowsTH = this.question.hasRows ? _$1("td", { className: this.question.emptyCellCss }) : null;
3665
3665
  var headers = [];
3666
3666
  for (var i = 0; i < this.question.visibleColumns.length; i++) {
3667
3667
  var column = this.question.visibleColumns[i];
@@ -3688,7 +3688,7 @@
3688
3688
  _$1("legend", { className: "sv-visuallyhidden" }, this.question.locTitle.renderedHtml),
3689
3689
  _$1("table", { className: this.question.getTableCss(), role: "presentation" },
3690
3690
  header,
3691
- _$1("tbody", null, rows)))));
3691
+ _$1("tbody", { className: this.question.getTableBodyCss() }, rows)))));
3692
3692
  }
3693
3693
  }
3694
3694
  class SurveyQuestionMatrixRow extends ReactSurveyElement {
@@ -4116,6 +4116,10 @@
4116
4116
  class SurveyQuestionRadioItem extends SurveyQuestionSelectBaseItem {
4117
4117
  constructor(props) {
4118
4118
  super(props);
4119
+ this.handleOnKeyDown = (event) => {
4120
+ var _a, _b;
4121
+ (_b = (_a = this.question).onKeyDown) === null || _b === void 0 ? void 0 : _b.call(_a, event);
4122
+ };
4119
4123
  this.handleOnMouseDown = this.handleOnMouseDown.bind(this);
4120
4124
  }
4121
4125
  getStateElement() {
@@ -4143,7 +4147,7 @@
4143
4147
  const itemLabel = !this.hideCaption ? _$1("span", { className: controlLabelClass }, this.renderLocString(this.item.locText, this.textStyle)) : null;
4144
4148
  return (_$1("div", { className: itemClass, role: "presentation", ref: this.rootRef },
4145
4149
  _$1("label", { onMouseDown: this.handleOnMouseDown, className: labelClass },
4146
- _$1("input", { "aria-errormessage": this.question.ariaErrormessage, className: this.cssClasses.itemControl, id: this.question.getItemId(this.item), type: "radio", name: this.question.questionName, checked: this.isChecked, value: this.item.value, disabled: !this.question.getItemEnabled(this.item), readOnly: this.question.isReadOnlyAttr, onChange: this.handleOnChange, "aria-label": this.ariaLabel }),
4150
+ _$1("input", { "aria-errormessage": this.question.ariaErrormessage, className: this.cssClasses.itemControl, id: this.question.getItemId(this.item), type: "radio", name: this.question.questionName, checked: this.isChecked, value: this.item.value, disabled: !this.question.getItemEnabled(this.item), readOnly: this.question.isReadOnlyAttr, onChange: this.handleOnChange, onKeyDown: this.handleOnKeyDown, "aria-label": this.ariaLabel }),
4147
4151
  this.cssClasses.materialDecorator ?
4148
4152
  _$1("span", { className: this.cssClasses.materialDecorator }, this.question.itemSvgIcon ?
4149
4153
  _$1("svg", { className: this.cssClasses.itemDecorator },
@@ -4444,30 +4448,6 @@
4444
4448
  return _$1(MatrixRow, props);
4445
4449
  });
4446
4450
 
4447
- class SurveyQuestionMatrixDynamicDragDropIcon extends ReactSurveyElement {
4448
- get question() {
4449
- return this.props.item.data.question;
4450
- }
4451
- get row() {
4452
- return this.props.item.data.row;
4453
- }
4454
- renderElement() {
4455
- return _$1("div", { onPointerDown: (event) => { this.question.onPointerDown(event.nativeEvent, this.row); } }, this.renderIcon());
4456
- }
4457
- renderIcon() {
4458
- if (this.question.iconDragElement) {
4459
- return (_$1("svg", { className: this.question.cssClasses.dragElementDecorator },
4460
- _$1("use", { xlinkHref: this.question.iconDragElement })));
4461
- }
4462
- else {
4463
- return (_$1("span", { className: this.question.cssClasses.iconDrag }));
4464
- }
4465
- }
4466
- }
4467
- ReactElementFactory.Instance.registerElement("sv-matrix-drag-drop-icon", (props) => {
4468
- return _$1(SurveyQuestionMatrixDynamicDragDropIcon, props);
4469
- });
4470
-
4471
4451
  class SurveyQuestionMatrixTable extends SurveyElementBase {
4472
4452
  get question() {
4473
4453
  return this.props.question;
@@ -4526,7 +4506,7 @@
4526
4506
  for (var i = 0; i < renderedRows.length; i++) {
4527
4507
  rows.push(this.renderRow(renderedRows[i].id, renderedRows[i], cssClasses));
4528
4508
  }
4529
- return _$1("tbody", null, rows);
4509
+ return _$1("tbody", { className: this.question.getTableBodyCss() }, rows);
4530
4510
  }
4531
4511
  renderRow(keyValue, row, cssClasses, reason) {
4532
4512
  const matrixrow = [];
@@ -4535,7 +4515,7 @@
4535
4515
  matrixrow.push(this.renderCell(cells[i], cssClasses, reason));
4536
4516
  }
4537
4517
  const key = "row" + keyValue;
4538
- return (_$1(k$2, { key: key }, (reason == "row-footer") ? _$1("tr", null, matrixrow) : _$1(MatrixRow, { model: row, parentMatrix: this.question }, matrixrow)));
4518
+ return (_$1(k$2, { key: key }, (reason == "row-footer") ? _$1("tr", { className: row.className }, matrixrow) : _$1(MatrixRow, { model: row, parentMatrix: this.question }, matrixrow)));
4539
4519
  }
4540
4520
  renderCell(cell, cssClasses, reason) {
4541
4521
  const key = "cell" + cell.id;
@@ -4580,10 +4560,6 @@
4580
4560
  str,
4581
4561
  require));
4582
4562
  }
4583
- if (cell.isDragHandlerCell) {
4584
- cellContent = (_$1(k$2, null,
4585
- _$1(SurveyQuestionMatrixDynamicDragDropIcon, { item: { data: { row: cell.row, question: this.question } } })));
4586
- }
4587
4563
  if (cell.isActionsCell) {
4588
4564
  cellContent = (ReactElementFactory.Instance.createElement("sv-matrixdynamic-actions-cell", {
4589
4565
  question: this.question, cssClasses, cell, model: cell.item.getData()
@@ -4762,9 +4738,12 @@
4762
4738
  const responsiveTitle = this.cell.showResponsiveTitle ? (_$1("span", { className: this.cell.responsiveTitleCss },
4763
4739
  this.renderLocString(this.cell.responsiveLocTitle),
4764
4740
  _$1(SurveyQuestionMatrixHeaderRequired, { column: this.cell.column, question: this.cell.matrix }))) : null;
4741
+ const errors = this.cell.matrix.isMobile ? _$1(SurveyElementErrors, { element: this.cell.question, creator: this.props.creator, cssClasses: this.question.cssClasses }) : null;
4765
4742
  return _$1(k$2, null,
4743
+ this.cell.matrix.getErrorLocation() === "top" ? errors : null,
4766
4744
  responsiveTitle,
4767
- content);
4745
+ content,
4746
+ this.cell.matrix.getErrorLocation() === "bottom" ? errors : null);
4768
4747
  }
4769
4748
  renderQuestion() {
4770
4749
  if (!this.question.isVisible)
@@ -4826,18 +4805,16 @@
4826
4805
  mainDiv,
4827
4806
  this.renderBottomToolbar()));
4828
4807
  }
4829
- renderToolbar() {
4830
- return _$1("div", { className: this.matrix.cssClasses.footer }, ReactElementFactory.Instance.createElement("sv-action-bar", { model: this.matrix.toolbar }));
4808
+ renderToolbar(location) {
4809
+ if (!this.matrix.getShowToolbar(location))
4810
+ return null;
4811
+ return _$1("div", { className: this.matrix.getToolbarCssClass(location) }, ReactElementFactory.Instance.createElement("sv-action-bar", { model: this.matrix.toolbar }));
4831
4812
  }
4832
4813
  renderTopToolbar() {
4833
- if (!this.matrix.getShowToolbar("top"))
4834
- return null;
4835
- return this.renderToolbar();
4814
+ return this.renderToolbar("top");
4836
4815
  }
4837
4816
  renderBottomToolbar() {
4838
- if (!this.matrix.getShowToolbar("bottom"))
4839
- return null;
4840
- return this.renderToolbar();
4817
+ return this.renderToolbar("bottom");
4841
4818
  }
4842
4819
  renderNoRowsContent(cssClasses) {
4843
4820
  return ReactElementFactory.Instance.createElement("sv-placeholder-matrixdynamic", { cssClasses: cssClasses, question: this.matrix });
@@ -5293,7 +5270,7 @@
5293
5270
  ? this.renderLocString(this.question.locMaxRateDescription)
5294
5271
  : null;
5295
5272
  return (_$1("div", { className: this.question.ratingRootCss, ref: (div) => (this.setControl(div)) },
5296
- _$1("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 },
5273
+ _$1("fieldset", { onKeyDown: (event) => this.question.onKeyDown(event), 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 },
5297
5274
  _$1("legend", { role: "presentation", className: "sv-hidden" }),
5298
5275
  !!this.question.hasMinLabel ? _$1("span", { className: cssClasses.minText }, minText) : null,
5299
5276
  this.question.renderedRateItems.map((item, index) => this.renderItem(item, index)),
@@ -5983,6 +5960,32 @@
5983
5960
  return _$1(LogoImage, props);
5984
5961
  });
5985
5962
 
5963
+ class SurveyQuestionMatrixDynamicDragDropIcon extends ReactSurveyElement {
5964
+ get question() {
5965
+ return this.props.item.data.question;
5966
+ }
5967
+ get row() {
5968
+ return this.props.item.data.row;
5969
+ }
5970
+ getStateElement() {
5971
+ return this.props.item;
5972
+ }
5973
+ renderElement() {
5974
+ return _$1("div", { onPointerDown: (event) => { this.question.onPointerDown(event.nativeEvent, this.row); } }, this.renderIcon());
5975
+ }
5976
+ renderIcon() {
5977
+ if (this.question.iconDragElement) {
5978
+ return _$1(SvgIcon, { className: this.question.cssClasses.dragElementDecorator, size: this.props.item.iconSize, iconName: this.props.item.iconName });
5979
+ }
5980
+ else {
5981
+ return (_$1("span", { className: this.question.cssClasses.iconDrag }));
5982
+ }
5983
+ }
5984
+ }
5985
+ ReactElementFactory.Instance.registerElement("sv-matrix-drag-drop-icon", (props) => {
5986
+ return _$1(SurveyQuestionMatrixDynamicDragDropIcon, props);
5987
+ });
5988
+
5986
5989
  class SurveyQuestionPanelDynamicProgressText extends ReactSurveyElement {
5987
5990
  get data() {
5988
5991
  return (this.props.item && this.props.item.data) || this.props.data;
@@ -6260,7 +6263,7 @@
6260
6263
  }
6261
6264
  };
6262
6265
  const preact = React;
6263
- surveyCore.checkLibraryVersion(`${"3.0.4"}`, "survey-js-ui");
6266
+ surveyCore.checkLibraryVersion(`${"3.1.1"}`, "survey-js-ui");
6264
6267
 
6265
6268
  Object.defineProperty(exports, 'Model', {
6266
6269
  enumerable: true,