survey-analytics 2.3.7 → 2.3.9

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.
Files changed (37) hide show
  1. package/fesm/shared.mjs +1 -1
  2. package/fesm/shared2.mjs +61 -38
  3. package/fesm/shared2.mjs.map +1 -1
  4. package/fesm/survey.analytics.core.mjs +1 -1
  5. package/fesm/survey.analytics.mjs +1 -1
  6. package/fesm/survey.analytics.mongo.mjs +221 -0
  7. package/fesm/survey.analytics.mongo.mjs.map +1 -0
  8. package/fesm/survey.analytics.tabulator.mjs +37 -2
  9. package/fesm/survey.analytics.tabulator.mjs.map +1 -1
  10. package/package.json +12 -3
  11. package/survey-analytics-tabulator.types/entries/tabulator.d.ts +2 -0
  12. package/survey-analytics-tabulator.types/tables/columnbuilder.d.ts +3 -0
  13. package/survey-analytics.types/visualizationComposite.d.ts +1 -1
  14. package/survey-analytics.types/visualizationPanel.d.ts +6 -0
  15. package/survey-analytics.types/visualizerBase.d.ts +5 -0
  16. package/survey.analytics.core.css +1 -1
  17. package/survey.analytics.core.js +66 -39
  18. package/survey.analytics.core.js.map +1 -1
  19. package/survey.analytics.core.min.css +1 -1
  20. package/survey.analytics.core.min.js +1 -1
  21. package/survey.analytics.core.min.js.LICENSE.txt +1 -1
  22. package/survey.analytics.css +1 -1
  23. package/survey.analytics.js +66 -39
  24. package/survey.analytics.js.map +1 -1
  25. package/survey.analytics.min.css +1 -1
  26. package/survey.analytics.min.js +1 -1
  27. package/survey.analytics.min.js.LICENSE.txt +1 -1
  28. package/survey.analytics.mongo.js +359 -0
  29. package/survey.analytics.mongo.js.map +1 -0
  30. package/survey.analytics.mongo.min.js +2 -0
  31. package/survey.analytics.mongo.min.js.LICENSE.txt +5 -0
  32. package/survey.analytics.tabulator.css +1 -1
  33. package/survey.analytics.tabulator.js +80 -5
  34. package/survey.analytics.tabulator.js.map +1 -1
  35. package/survey.analytics.tabulator.min.css +1 -1
  36. package/survey.analytics.tabulator.min.js +1 -1
  37. package/survey.analytics.tabulator.min.js.LICENSE.txt +1 -1
package/fesm/shared.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - SurveyJS Dashboard library v2.3.7
2
+ * surveyjs - SurveyJS Dashboard library v2.3.9
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
  */
package/fesm/shared2.mjs CHANGED
@@ -1,11 +1,11 @@
1
1
  /*!
2
- * surveyjs - SurveyJS Dashboard library v2.3.7
2
+ * surveyjs - SurveyJS Dashboard library v2.3.9
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
  */
6
6
 
7
7
  import { D as DocumentHelper, l as localization, g as createLoadingIndicator, b as DataHelper, e as createCommercialLicenseLink, f as svgTemplate, t as toPrecision } from './shared.mjs';
8
- import { Event, QuestionCustomModel, QuestionCompositeModel, hasLicense, QuestionCommentModel, settings, ItemValue, surveyLocalization, IsTouch } from 'survey-core';
8
+ import { Event, QuestionCustomModel, QuestionCompositeModel, hasLicense, QuestionCommentModel, settings, ItemValue, QuestionRatingModel, surveyLocalization, IsTouch } from 'survey-core';
9
9
 
10
10
  /******************************************************************************
11
11
  Copyright (c) Microsoft Corporation.
@@ -699,6 +699,18 @@ class VisualizerBase {
699
699
  }
700
700
  return undefined;
701
701
  }
702
+ /**
703
+ * Returns the visualizer's title.
704
+ */
705
+ get title() {
706
+ return this.getTitle(this.question);
707
+ }
708
+ getTitle(question) {
709
+ var _a;
710
+ if (question === undefined)
711
+ return "";
712
+ return this.processText(((_a = question.locTitle) === null || _a === void 0 ? void 0 : _a.renderedHtml) ? question.locTitle.renderedHtml : question.title);
713
+ }
702
714
  /**
703
715
  * Returns the visualizer's type.
704
716
  */
@@ -1197,19 +1209,21 @@ class NumberModel extends VisualizerBase {
1197
1209
  this.chartTypes = this._chartAdapter.getChartTypes();
1198
1210
  this.chartType = this.chartTypes[0];
1199
1211
  }
1200
- this.registerToolbarItem("changeChartType", () => {
1201
- if (this.chartTypes.length > 1) {
1202
- return DocumentHelper.createSelector(this.chartTypes.map((chartType) => {
1203
- return {
1204
- value: chartType,
1205
- text: localization.getString("chartType_" + chartType),
1206
- };
1207
- }), (option) => this.chartType === option.value, (e) => {
1208
- this.setChartType(e.target.value);
1209
- });
1210
- }
1211
- return null;
1212
- });
1212
+ if (this.options.allowChangeVisualizerType !== false) {
1213
+ this.registerToolbarItem("changeChartType", () => {
1214
+ if (this.chartTypes.length > 1) {
1215
+ return DocumentHelper.createSelector(this.chartTypes.map((chartType) => {
1216
+ return {
1217
+ value: chartType,
1218
+ text: localization.getString("chartType_" + chartType),
1219
+ };
1220
+ }), (option) => this.chartType === option.value, (e) => {
1221
+ this.setChartType(e.target.value);
1222
+ });
1223
+ }
1224
+ return null;
1225
+ });
1226
+ }
1213
1227
  }
1214
1228
  onDataChanged() {
1215
1229
  this._resultAverage = undefined;
@@ -1408,19 +1422,21 @@ class SelectBase extends VisualizerBase {
1408
1422
  this._chartType = this.options.defaultChartType;
1409
1423
  }
1410
1424
  }
1411
- this.registerToolbarItem("changeChartType", () => {
1412
- if (this.chartTypes.length > 1) {
1413
- return DocumentHelper.createSelector(this.chartTypes.map((chartType) => {
1414
- return {
1415
- value: chartType,
1416
- text: localization.getString("chartType_" + chartType),
1417
- };
1418
- }), (option) => this.chartType === option.value, (e) => {
1419
- this.setChartType(e.target.value);
1420
- });
1421
- }
1422
- return null;
1423
- });
1425
+ if (this.options.allowChangeVisualizerType !== false) {
1426
+ this.registerToolbarItem("changeChartType", () => {
1427
+ if (this.chartTypes.length > 1) {
1428
+ return DocumentHelper.createSelector(this.chartTypes.map((chartType) => {
1429
+ return {
1430
+ value: chartType,
1431
+ text: localization.getString("chartType_" + chartType),
1432
+ };
1433
+ }), (option) => this.chartType === option.value, (e) => {
1434
+ this.setChartType(e.target.value);
1435
+ });
1436
+ }
1437
+ return null;
1438
+ });
1439
+ }
1424
1440
  this.registerToolbarItem("changeAnswersOrder", () => {
1425
1441
  if (this.isSupportAnswersOrder()) {
1426
1442
  this.choicesOrderSelector = DocumentHelper.createSelector([
@@ -1596,6 +1612,11 @@ class SelectBase extends VisualizerBase {
1596
1612
  }
1597
1613
  }
1598
1614
  getSelectedItemByText(itemText) {
1615
+ var _a;
1616
+ if (this.question instanceof QuestionRatingModel) {
1617
+ const rateValues = this.question.rateValues;
1618
+ return (_a = rateValues === null || rateValues === void 0 ? void 0 : rateValues.filter((choice) => choice.text === itemText)[0]) !== null && _a !== void 0 ? _a : new ItemValue(parseFloat(itemText), itemText);
1619
+ }
1599
1620
  const selBase = this.question;
1600
1621
  if (this.question.hasOther && itemText == selBase.otherText) {
1601
1622
  return selBase.otherItem;
@@ -2715,12 +2736,14 @@ class AlternativeVisualizersWrapper extends VisualizerBase {
2715
2736
  this.visualizersWithSelection.push(visualizer);
2716
2737
  }
2717
2738
  });
2718
- this.registerToolbarItem("changeVisualizer", () => this.visualizerSelector = DocumentHelper.createSelector(this.visualizers.map((visualizer) => {
2719
- return {
2720
- value: visualizer.type,
2721
- text: localization.getString("visualizer_" + visualizer.type),
2722
- };
2723
- }), (option) => this.visualizer.type === option.value, (e) => this.setVisualizer(e.target.value)), 0);
2739
+ if (this.options.allowChangeVisualizerType !== false) {
2740
+ this.registerToolbarItem("changeVisualizer", () => this.visualizerSelector = DocumentHelper.createSelector(this.visualizers.map((visualizer) => {
2741
+ return {
2742
+ value: visualizer.type,
2743
+ text: localization.getString("visualizer_" + visualizer.type),
2744
+ };
2745
+ }), (option) => this.visualizer.type === option.value, (e) => this.setVisualizer(e.target.value)), 0);
2746
+ }
2724
2747
  this.visualizer = visualizers[0];
2725
2748
  this.visualizer.onAfterRender.add(this.onAfterVisualizerRenderCallback);
2726
2749
  this.visualizer.onStateChanged.add(this.onVisualizerStateChangedCallback);
@@ -10171,7 +10194,7 @@ class VisualizationPanel extends VisualizerBase {
10171
10194
  question = Array.isArray(question) ? question[0] : question;
10172
10195
  const element = this.getElement(question.name);
10173
10196
  if (!!element) {
10174
- element.displayName = this.processText(question.title);
10197
+ element.displayName = this.getTitle(question);
10175
10198
  }
10176
10199
  });
10177
10200
  this.visualizers.forEach(v => {
@@ -10218,7 +10241,7 @@ class VisualizationPanel extends VisualizerBase {
10218
10241
  question = Array.isArray(question) ? question[0] : question;
10219
10242
  return {
10220
10243
  name: question.name,
10221
- displayName: this.processText(question.title),
10244
+ displayName: this.getTitle(question),
10222
10245
  isVisible: true,
10223
10246
  isPublic: true,
10224
10247
  };
@@ -10640,9 +10663,9 @@ class VisualizationComposite extends VisualizationPanelDynamic {
10640
10663
  super(question, data, options, name || "composite");
10641
10664
  }
10642
10665
  getQuestions() {
10643
- const matrixdynamic = this.question;
10666
+ const questionComposite = this.question;
10644
10667
  const innerQuestions = [];
10645
- matrixdynamic.contentPanel.addQuestionsToList(innerQuestions);
10668
+ questionComposite.contentPanel.addQuestionsToList(innerQuestions);
10646
10669
  return innerQuestions;
10647
10670
  }
10648
10671
  }