survey-analytics 2.3.9 → 2.3.10

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 - SurveyJS Dashboard library v2.3.9
2
+ * surveyjs - SurveyJS Dashboard library v2.3.10
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
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - SurveyJS Dashboard library v2.3.9
2
+ * surveyjs - SurveyJS Dashboard library v2.3.10
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
  */
@@ -482,9 +482,10 @@ class BaseColumn {
482
482
  this.displayNameValue = val;
483
483
  }
484
484
  getDisplayName() {
485
+ var _a;
485
486
  return this.table.useNamesAsTitles
486
487
  ? this.question.name
487
- : (this.question.title || "").trim() || this.question.name;
488
+ : (((_a = this.question.locTitle) === null || _a === void 0 ? void 0 : _a.renderedHtml) || this.question.title || "").trim() || this.question.name;
488
489
  }
489
490
  getName() {
490
491
  return this.question.name;
@@ -801,9 +802,10 @@ class CustomColumnsBuilder extends DefaultColumnsBuilder {
801
802
  ColumnsBuilderFactory.Instance.registerBuilderColumn("custom", new CustomColumnsBuilder());
802
803
  class CompositeColumnsBuilder extends DefaultColumnsBuilder {
803
804
  getDisplayName(question, table) {
805
+ var _a;
804
806
  return table.useNamesAsTitles
805
807
  ? question.name
806
- : (question.title || "").trim() || question.name;
808
+ : (((_a = question.locTitle) === null || _a === void 0 ? void 0 : _a.renderedHtml) || question.title || "").trim() || question.name;
807
809
  }
808
810
  buildColumnsCore(question, table) {
809
811
  if (CompositeColumnsBuilder.ShowAsSeparateColumns) {
@@ -866,13 +868,7 @@ class Table {
866
868
  if (!this._options) {
867
869
  this._options = {};
868
870
  }
869
- this._columns = this.buildColumns(_survey);
870
- this.initTableData(data);
871
- localization.currentLocale = this._survey.locale;
872
- this._columns = this.buildColumns(_survey);
873
- if (_columnsData.length !== 0) {
874
- this.updateColumnsFromData(this._columnsData);
875
- }
871
+ this.initialize();
876
872
  this.extensions = new TableExtensions(this);
877
873
  const f = hasLicense;
878
874
  this.haveCommercialLicense = (!!f && f(4)) ||
@@ -882,6 +878,16 @@ class Table {
882
878
  ? _options.haveCommercialLicense
883
879
  : false));
884
880
  }
881
+ initialize() {
882
+ this.currentPageSize = 5;
883
+ this.currentPageNumber = 1;
884
+ this._columns = this.buildColumns(this._survey);
885
+ this.initTableData(this.data);
886
+ localization.currentLocale = this._survey.locale;
887
+ if (this._columnsData.length !== 0) {
888
+ this.updateColumnsFromData(this._columnsData);
889
+ }
890
+ }
885
891
  getTableData() {
886
892
  return [].concat(this.tableData || []);
887
893
  }
@@ -1029,6 +1035,7 @@ class Table {
1029
1035
  set locale(newLocale) {
1030
1036
  this._survey.locale = newLocale;
1031
1037
  localization.currentLocale = newLocale;
1038
+ this.columns.forEach(c => c.displayName = undefined);
1032
1039
  this.refresh(true);
1033
1040
  this.onStateChanged.fire(this, this.state);
1034
1041
  }
@@ -1073,27 +1080,26 @@ class Table {
1073
1080
  set state(newState) {
1074
1081
  if (!newState)
1075
1082
  return;
1083
+ if (typeof newState.elements !== "undefined") {
1084
+ this.updateColumnsFromData(newState.elements);
1085
+ }
1076
1086
  if (typeof newState.locale !== "undefined") {
1077
1087
  localization.currentLocale = newState.locale;
1078
1088
  this._survey.locale = newState.locale;
1079
1089
  this.initTableData(this.data);
1080
1090
  }
1081
- if (typeof newState.elements !== "undefined")
1082
- this.updateColumnsFromData(newState.elements);
1083
- if (typeof newState.pageSize !== "undefined")
1091
+ if (typeof newState.pageSize !== "undefined") {
1084
1092
  this.currentPageSize = newState.pageSize;
1093
+ }
1094
+ this.refresh(true);
1085
1095
  }
1086
1096
  /**
1087
1097
  * Resets table state.
1088
1098
  */
1089
1099
  resetState() {
1090
- this._columns.forEach((column, index) => {
1091
- column.fromJSON({});
1092
- column.visibleIndex = index;
1093
- });
1094
- this.locale = surveyLocalization.defaultLocale;
1095
- this.currentPageSize = 5;
1096
- this.initTableData(this.data);
1100
+ this._survey.locale = surveyLocalization.defaultLocale;
1101
+ this.initialize();
1102
+ this.refresh(true);
1097
1103
  this.onStateChanged.fire(this, this.state);
1098
1104
  }
1099
1105
  updateColumnsFromData(columnsData) {
@@ -1451,7 +1457,6 @@ class Tabulator extends Table {
1451
1457
  }
1452
1458
  getColumns() {
1453
1459
  const columns = this.columns.map((column, index) => {
1454
- let question = this._survey.getQuestionByName(column.name);
1455
1460
  let formatter = "plaintext";
1456
1461
  if (column.dataType == ColumnDataType.FileLink) {
1457
1462
  formatter = "html";
@@ -1461,9 +1466,7 @@ class Tabulator extends Table {
1461
1466
  }
1462
1467
  return {
1463
1468
  field: column.name,
1464
- title: (question &&
1465
- (this._options.useNamesAsTitles ? question.name : question.title)) ||
1466
- column.displayName,
1469
+ title: column.displayName || column.name,
1467
1470
  width: column.width,
1468
1471
  widthShrink: !column.width ? 1 : 0,
1469
1472
  visible: this.isColumnVisible(column),
@@ -1472,6 +1475,7 @@ class Tabulator extends Table {
1472
1475
  download: this.options.downloadHiddenColumns ? true : undefined,
1473
1476
  formatter,
1474
1477
  headerTooltip: true,
1478
+ headerWordWrap: true,
1475
1479
  accessorDownload: this.accessorDownload,
1476
1480
  titleFormatter: (cell, formatterParams, onRendered) => {
1477
1481
  return this.getTitleFormatter(cell, formatterParams, onRendered, column.name);