survey-analytics 2.5.12 → 2.5.13

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/fesm/shared.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - SurveyJS Dashboard library v2.5.12
2
+ * surveyjs - SurveyJS Dashboard library v2.5.13
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
  */
package/fesm/shared2.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - SurveyJS Dashboard library v2.5.12
2
+ * surveyjs - SurveyJS Dashboard library v2.5.13
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
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - SurveyJS Dashboard library v2.5.12
2
+ * surveyjs - SurveyJS Dashboard library v2.5.13
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
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - SurveyJS Dashboard library v2.5.12
2
+ * surveyjs - SurveyJS Dashboard library v2.5.13
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
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - SurveyJS Dashboard library v2.5.12
2
+ * surveyjs - SurveyJS Dashboard library v2.5.13
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
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - SurveyJS Dashboard library v2.5.12
2
+ * surveyjs - SurveyJS Dashboard library v2.5.13
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
  */
@@ -465,6 +465,20 @@ class BaseColumn {
465
465
  this.isPublic = true;
466
466
  this.location = QuestionLocation.Column;
467
467
  this.dataType = this.getDataType();
468
+ this.updateWhenQuestionIsReady(question, table);
469
+ }
470
+ updateWhenQuestionIsReady(question, table) {
471
+ if (!question)
472
+ return;
473
+ question.waitForQuestionIsReady().then(() => {
474
+ try {
475
+ table.lockStateChanged();
476
+ table.refresh(!table.isInitTableDataProcessing);
477
+ }
478
+ finally {
479
+ table.unlockStateChanged();
480
+ }
481
+ });
468
482
  }
469
483
  get name() {
470
484
  if (!this.nameValue) {
@@ -499,19 +513,6 @@ class BaseColumn {
499
513
  getDisplayValueCore(data) {
500
514
  return data[this.name];
501
515
  }
502
- setupReadyChangedCallback(table, question) {
503
- if (!!question) {
504
- const onReadyChangedCallback = (sender, options) => {
505
- if (options.isReady) {
506
- table.refresh(!table.isInitTableDataProcessing);
507
- sender.onReadyChanged.remove(onReadyChangedCallback);
508
- }
509
- };
510
- if (!question.isReady) {
511
- question.onReadyChanged.add(onReadyChangedCallback);
512
- }
513
- }
514
- }
515
516
  getDisplayValue(data, table, options) {
516
517
  let displayValue = this.getDisplayValueCore(data);
517
518
  const question = this.question;
@@ -532,7 +533,6 @@ class BaseColumn {
532
533
  }
533
534
  getCellData(table, data) {
534
535
  const displayValue = this.getDisplayValue(data, table, table.options);
535
- this.setupReadyChangedCallback(table, this.question);
536
536
  return { question: this.question, displayValue: this.formatDisplayValue(displayValue) };
537
537
  }
538
538
  toJSON() {
@@ -706,19 +706,19 @@ class MatrixDropdownColumn extends BaseColumn {
706
706
  }
707
707
  }
708
708
  class CustomQuestionColumn extends BaseColumn {
709
- getCellData(table, data) {
710
- this.setupReadyChangedCallback(table, this.question.contentQuestion);
711
- return super.getCellData(table, data);
709
+ constructor(question, table) {
710
+ super(question, table);
711
+ this.updateWhenQuestionIsReady(question.contentQuestion, table);
712
712
  }
713
713
  }
714
714
  class CompositeQuestionColumn extends BaseColumn {
715
- getCellData(table, data) {
715
+ constructor(question, table) {
716
+ super(question, table);
716
717
  const questionList = [];
717
718
  this.question.contentPanel.addQuestionsToList(questionList);
718
- questionList.forEach((question) => {
719
- this.setupReadyChangedCallback(table, question);
719
+ questionList.forEach((q) => {
720
+ this.updateWhenQuestionIsReady(q, table);
720
721
  });
721
- return super.getCellData(table, data);
722
722
  }
723
723
  }
724
724
 
@@ -878,6 +878,7 @@ class Table {
878
878
  });
879
879
  return columns;
880
880
  };
881
+ this._lockStateChanged = false;
881
882
  /**
882
883
  * Fires when table state changed.
883
884
  */
@@ -949,7 +950,7 @@ class Table {
949
950
  */
950
951
  setPageSize(value) {
951
952
  this.currentPageSize = value;
952
- this.onStateChanged.fire(this, this.state);
953
+ this.stateChanged();
953
954
  }
954
955
  getCreatedRows() {
955
956
  return [].concat(this._rows);
@@ -980,7 +981,7 @@ class Table {
980
981
  set columns(columns) {
981
982
  this._columns = columns;
982
983
  this.refresh(true);
983
- this.onStateChanged.fire(this, this.state);
984
+ this.stateChanged();
984
985
  }
985
986
  get isInitTableDataProcessing() { return this.isInitTableDataProcessingValue; }
986
987
  initTableData(data) {
@@ -1007,7 +1008,7 @@ class Table {
1007
1008
  moveColumn(from, to) {
1008
1009
  var deletedColumns = this._columns.splice(from, 1);
1009
1010
  this._columns.splice(to, 0, deletedColumns[0]);
1010
- this.onStateChanged.fire(this, this.state);
1011
+ this.stateChanged();
1011
1012
  }
1012
1013
  setColumnLocation(columnName, location) {
1013
1014
  this.getColumnByName(columnName).location = location;
@@ -1015,7 +1016,7 @@ class Table {
1015
1016
  columnName: columnName,
1016
1017
  location: location,
1017
1018
  });
1018
- this.onStateChanged.fire(this, this.state);
1019
+ this.stateChanged();
1019
1020
  }
1020
1021
  getColumnByName(columnName) {
1021
1022
  return this._columns.filter((column) => column.name === columnName)[0];
@@ -1027,12 +1028,12 @@ class Table {
1027
1028
  columnName: columnName,
1028
1029
  columnVisibility: isVisible,
1029
1030
  });
1030
- this.onStateChanged.fire(this, this.state);
1031
+ this.stateChanged();
1031
1032
  }
1032
1033
  setColumnWidth(columnName, width) {
1033
1034
  var column = this.getColumnByName(columnName);
1034
1035
  column.width = width;
1035
- this.onStateChanged.fire(this, this.state);
1036
+ this.stateChanged();
1036
1037
  }
1037
1038
  removeRow(row) {
1038
1039
  var index = this._rows.indexOf(row);
@@ -1054,6 +1055,17 @@ class Table {
1054
1055
  localization.currentLocale = newLocale;
1055
1056
  this.columns.forEach(c => c.displayName = undefined);
1056
1057
  this.refresh(true);
1058
+ this.stateChanged();
1059
+ }
1060
+ lockStateChanged() {
1061
+ this._lockStateChanged = true;
1062
+ }
1063
+ unlockStateChanged() {
1064
+ this._lockStateChanged = false;
1065
+ }
1066
+ stateChanged() {
1067
+ if (this._lockStateChanged)
1068
+ return;
1057
1069
  this.onStateChanged.fire(this, this.state);
1058
1070
  }
1059
1071
  getLocales() {
@@ -1129,7 +1141,7 @@ class Table {
1129
1141
  this._survey.locale = surveyLocalization.defaultLocale;
1130
1142
  this.initialize();
1131
1143
  this.refresh(true);
1132
- this.onStateChanged.fire(this, this.state);
1144
+ this.stateChanged();
1133
1145
  }
1134
1146
  updateColumnsFromData(columnsData) {
1135
1147
  const columns = this._columns;