survey-analytics 2.5.8 → 2.5.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.
package/fesm/shared.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - SurveyJS Dashboard library v2.5.8
2
+ * surveyjs - SurveyJS Dashboard library v2.5.10
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.8
2
+ * surveyjs - SurveyJS Dashboard library v2.5.10
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.8
2
+ * surveyjs - SurveyJS Dashboard library v2.5.10
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.8
2
+ * surveyjs - SurveyJS Dashboard library v2.5.10
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.8
2
+ * surveyjs - SurveyJS Dashboard library v2.5.10
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.8
2
+ * surveyjs - SurveyJS Dashboard library v2.5.10
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
  */
@@ -556,33 +556,40 @@ class DefaultColumn extends BaseColumn {
556
556
  return this.getDisplayValueCore(data);
557
557
  }
558
558
  }
559
- class CheckboxColumn extends BaseColumn {
559
+ class SelectBaseColumn extends BaseColumn {
560
+ get isOtherInSeparateColumn() {
561
+ return this.question.hasOther && this.question.getStoreOthersAsComment();
562
+ }
563
+ getItemDisplayText(item, options) {
564
+ return options.useValuesAsLabels ? item.value : item.textOrHtml;
565
+ }
560
566
  getDisplayValue(data, table, options) {
561
- const selectedItems = this.question.selectedItems;
562
- const res = [];
563
- selectedItems.forEach(item => {
564
- res.push(options.useValuesAsLabels ? item.value : item.textOrHtml);
565
- });
566
- return res.join(table.itemsDelimiter);
567
+ const prevSeparator = settings.choicesSeparator;
568
+ settings.choicesSeparator = table.itemsDelimiter;
569
+ const value = options.useValuesAsLabels ? this.question.renderedValue : this.question.displayValue;
570
+ settings.choicesSeparator = prevSeparator;
571
+ return value;
567
572
  }
568
573
  }
569
- class SingleChoiceColumn extends BaseColumn {
574
+ class CheckboxColumn extends SelectBaseColumn {
570
575
  getDisplayValue(data, table, options) {
571
- const selectedItem = this.question.selectedItem;
572
- if (!selectedItem)
573
- return "";
574
- return options.useValuesAsLabels ? selectedItem.value : selectedItem.textOrHtml;
576
+ if (this.isOtherInSeparateColumn) {
577
+ const selectedItems = this.question.selectedItems;
578
+ const res = selectedItems.map(item => this.getItemDisplayText(item, options));
579
+ return res.join(table.itemsDelimiter);
580
+ }
581
+ return super.getDisplayValue(data, table, options);
575
582
  }
576
583
  }
577
- class SelectBaseColumn extends BaseColumn {
584
+ class SingleChoiceColumn extends SelectBaseColumn {
578
585
  getDisplayValue(data, table, options) {
579
- const value = options.useValuesAsLabels ? this.question.renderedValue : this.question.displayValue;
580
- if (Array.isArray(value)) {
581
- return value.join(table.itemsDelimiter);
582
- }
583
- else {
584
- return value;
586
+ if (this.isOtherInSeparateColumn) {
587
+ const selectedItem = this.question.selectedItem;
588
+ if (!selectedItem)
589
+ return "";
590
+ return this.getItemDisplayText(selectedItem, options);
585
591
  }
592
+ return super.getDisplayValue(data, table, options);
586
593
  }
587
594
  }
588
595
  class CommentColumn extends BaseColumn {
@@ -729,9 +736,6 @@ class DefaultColumnsBuilder {
729
736
  if (question.hasComment) {
730
737
  columns.push(new CommentColumn(question, table));
731
738
  }
732
- if (question.hasOther && question["getStoreOthersAsComment"]()) {
733
- columns.push(new OtherColumn(question, table));
734
- }
735
739
  return columns;
736
740
  }
737
741
  }
@@ -748,14 +752,23 @@ class ColumnsBuilderFactory {
748
752
  }
749
753
  }
750
754
  ColumnsBuilderFactory.Instance = new ColumnsBuilderFactory();
751
- class CheckboxColumnsBuilder extends DefaultColumnsBuilder {
755
+ class SelectBaseColumnsBuilder extends DefaultColumnsBuilder {
756
+ buildColumns(question, table) {
757
+ const columns = super.buildColumns(question, table);
758
+ if (question.hasOther && question.getStoreOthersAsComment()) {
759
+ columns.push(new OtherColumn(question, table));
760
+ }
761
+ return columns;
762
+ }
763
+ }
764
+ class CheckboxColumnsBuilder extends SelectBaseColumnsBuilder {
752
765
  createColumn(question, table) {
753
766
  return new CheckboxColumn(question, table);
754
767
  }
755
768
  }
756
769
  ColumnsBuilderFactory.Instance.registerBuilderColumn("checkbox", new CheckboxColumnsBuilder());
757
770
  ColumnsBuilderFactory.Instance.registerBuilderColumn("tagbox", new CheckboxColumnsBuilder());
758
- class SingleChoiceColumnsBuilder extends DefaultColumnsBuilder {
771
+ class SingleChoiceColumnsBuilder extends SelectBaseColumnsBuilder {
759
772
  createColumn(question, table) {
760
773
  return new SingleChoiceColumn(question, table);
761
774
  }
@@ -1649,5 +1662,5 @@ class TabulatorRow extends TableRow {
1649
1662
 
1650
1663
  Tabulator.initTabulatorConstructor(TabulatorFull);
1651
1664
 
1652
- export { BaseColumn, CheckboxColumn, CheckboxColumnsBuilder, ColumnsBuilderFactory, CommentColumn, CompositeColumnsBuilder, CompositeQuestionColumn, CustomColumnsBuilder, CustomQuestionColumn, DefaultColumn, DefaultColumnsBuilder, DocumentHelper, FileColumn, FileColumnsBuilder, ImageColumn, ImageColumnsBuilder, MatrixColumn, MatrixColumnsBuilder, MatrixDropdownColumn, MatrixDropdownColumnBuilder, OtherColumn, SelectBaseColumn, SingleChoiceColumn, SingleChoiceColumnsBuilder, Table, TableEvent, TableExtensions, TableRow, Tabulator, TabulatorRow, defaultDownloadOptions, defaultOptions, localization };
1665
+ export { BaseColumn, CheckboxColumn, CheckboxColumnsBuilder, ColumnsBuilderFactory, CommentColumn, CompositeColumnsBuilder, CompositeQuestionColumn, CustomColumnsBuilder, CustomQuestionColumn, DefaultColumn, DefaultColumnsBuilder, DocumentHelper, FileColumn, FileColumnsBuilder, ImageColumn, ImageColumnsBuilder, MatrixColumn, MatrixColumnsBuilder, MatrixDropdownColumn, MatrixDropdownColumnBuilder, OtherColumn, SelectBaseColumn, SelectBaseColumnsBuilder, SingleChoiceColumn, SingleChoiceColumnsBuilder, Table, TableEvent, TableExtensions, TableRow, Tabulator, TabulatorRow, defaultDownloadOptions, defaultOptions, localization };
1653
1666
  //# sourceMappingURL=survey.analytics.tabulator.mjs.map