survey-analytics 2.3.7 → 2.3.8

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.7
2
+ * surveyjs - SurveyJS Dashboard library v2.3.8
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.7
2
+ * surveyjs - SurveyJS Dashboard library v2.3.8
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.7
2
+ * surveyjs - SurveyJS Dashboard library v2.3.8
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
  */
@@ -6885,14 +6885,16 @@ var AlternativeVisualizersWrapper = /** @class */ (function (_super) {
6885
6885
  _this.visualizersWithSelection.push(visualizer);
6886
6886
  }
6887
6887
  });
6888
- _this.registerToolbarItem("changeVisualizer", function () {
6889
- return _this.visualizerSelector = _utils_index__WEBPACK_IMPORTED_MODULE_3__.DocumentHelper.createSelector(_this.visualizers.map(function (visualizer) {
6890
- return {
6891
- value: visualizer.type,
6892
- text: _localizationManager__WEBPACK_IMPORTED_MODULE_2__.localization.getString("visualizer_" + visualizer.type),
6893
- };
6894
- }), function (option) { return _this.visualizer.type === option.value; }, function (e) { return _this.setVisualizer(e.target.value); });
6895
- }, 0);
6888
+ if (_this.options.allowChangeVisualizerType !== false) {
6889
+ _this.registerToolbarItem("changeVisualizer", function () {
6890
+ return _this.visualizerSelector = _utils_index__WEBPACK_IMPORTED_MODULE_3__.DocumentHelper.createSelector(_this.visualizers.map(function (visualizer) {
6891
+ return {
6892
+ value: visualizer.type,
6893
+ text: _localizationManager__WEBPACK_IMPORTED_MODULE_2__.localization.getString("visualizer_" + visualizer.type),
6894
+ };
6895
+ }), function (option) { return _this.visualizer.type === option.value; }, function (e) { return _this.setVisualizer(e.target.value); });
6896
+ }, 0);
6897
+ }
6896
6898
  _this.visualizer = visualizers[0];
6897
6899
  _this.visualizer.onAfterRender.add(_this.onAfterVisualizerRenderCallback);
6898
6900
  _this.visualizer.onStateChanged.add(_this.onVisualizerStateChangedCallback);
@@ -11146,19 +11148,21 @@ var NumberModel = /** @class */ (function (_super) {
11146
11148
  _this.chartTypes = _this._chartAdapter.getChartTypes();
11147
11149
  _this.chartType = _this.chartTypes[0];
11148
11150
  }
11149
- _this.registerToolbarItem("changeChartType", function () {
11150
- if (_this.chartTypes.length > 1) {
11151
- return _utils_index__WEBPACK_IMPORTED_MODULE_3__.DocumentHelper.createSelector(_this.chartTypes.map(function (chartType) {
11152
- return {
11153
- value: chartType,
11154
- text: _localizationManager__WEBPACK_IMPORTED_MODULE_2__.localization.getString("chartType_" + chartType),
11155
- };
11156
- }), function (option) { return _this.chartType === option.value; }, function (e) {
11157
- _this.setChartType(e.target.value);
11158
- });
11159
- }
11160
- return null;
11161
- });
11151
+ if (_this.options.allowChangeVisualizerType !== false) {
11152
+ _this.registerToolbarItem("changeChartType", function () {
11153
+ if (_this.chartTypes.length > 1) {
11154
+ return _utils_index__WEBPACK_IMPORTED_MODULE_3__.DocumentHelper.createSelector(_this.chartTypes.map(function (chartType) {
11155
+ return {
11156
+ value: chartType,
11157
+ text: _localizationManager__WEBPACK_IMPORTED_MODULE_2__.localization.getString("chartType_" + chartType),
11158
+ };
11159
+ }), function (option) { return _this.chartType === option.value; }, function (e) {
11160
+ _this.setChartType(e.target.value);
11161
+ });
11162
+ }
11163
+ return null;
11164
+ });
11165
+ }
11162
11166
  return _this;
11163
11167
  }
11164
11168
  NumberModel.prototype.onDataChanged = function () {
@@ -12821,19 +12825,21 @@ var SelectBase = /** @class */ (function (_super) {
12821
12825
  _this._chartType = _this.options.defaultChartType;
12822
12826
  }
12823
12827
  }
12824
- _this.registerToolbarItem("changeChartType", function () {
12825
- if (_this.chartTypes.length > 1) {
12826
- return _utils_index__WEBPACK_IMPORTED_MODULE_4__.DocumentHelper.createSelector(_this.chartTypes.map(function (chartType) {
12827
- return {
12828
- value: chartType,
12829
- text: _localizationManager__WEBPACK_IMPORTED_MODULE_3__.localization.getString("chartType_" + chartType),
12830
- };
12831
- }), function (option) { return _this.chartType === option.value; }, function (e) {
12832
- _this.setChartType(e.target.value);
12833
- });
12834
- }
12835
- return null;
12836
- });
12828
+ if (_this.options.allowChangeVisualizerType !== false) {
12829
+ _this.registerToolbarItem("changeChartType", function () {
12830
+ if (_this.chartTypes.length > 1) {
12831
+ return _utils_index__WEBPACK_IMPORTED_MODULE_4__.DocumentHelper.createSelector(_this.chartTypes.map(function (chartType) {
12832
+ return {
12833
+ value: chartType,
12834
+ text: _localizationManager__WEBPACK_IMPORTED_MODULE_3__.localization.getString("chartType_" + chartType),
12835
+ };
12836
+ }), function (option) { return _this.chartType === option.value; }, function (e) {
12837
+ _this.setChartType(e.target.value);
12838
+ });
12839
+ }
12840
+ return null;
12841
+ });
12842
+ }
12837
12843
  _this.registerToolbarItem("changeAnswersOrder", function () {
12838
12844
  if (_this.isSupportAnswersOrder()) {
12839
12845
  _this.choicesOrderSelector = _utils_index__WEBPACK_IMPORTED_MODULE_4__.DocumentHelper.createSelector([
@@ -15148,7 +15154,7 @@ var VisualizationPanel = /** @class */ (function (_super) {
15148
15154
  question = Array.isArray(question) ? question[0] : question;
15149
15155
  var element = _this.getElement(question.name);
15150
15156
  if (!!element) {
15151
- element.displayName = _this.processText(question.title);
15157
+ element.displayName = _this.getTitle(question);
15152
15158
  }
15153
15159
  });
15154
15160
  this.visualizers.forEach(function (v) {
@@ -15216,7 +15222,7 @@ var VisualizationPanel = /** @class */ (function (_super) {
15216
15222
  question = Array.isArray(question) ? question[0] : question;
15217
15223
  return {
15218
15224
  name: question.name,
15219
- displayName: _this.processText(question.title),
15225
+ displayName: _this.getTitle(question),
15220
15226
  isVisible: true,
15221
15227
  isPublic: true,
15222
15228
  };
@@ -15949,6 +15955,22 @@ var VisualizerBase = /** @class */ (function () {
15949
15955
  }
15950
15956
  return undefined;
15951
15957
  };
15958
+ Object.defineProperty(VisualizerBase.prototype, "title", {
15959
+ /**
15960
+ * Returns the visualizer's title.
15961
+ */
15962
+ get: function () {
15963
+ return this.getTitle(this.question);
15964
+ },
15965
+ enumerable: false,
15966
+ configurable: true
15967
+ });
15968
+ VisualizerBase.prototype.getTitle = function (question) {
15969
+ var _a;
15970
+ if (question === undefined)
15971
+ return "";
15972
+ return this.processText(((_a = question.locTitle) === null || _a === void 0 ? void 0 : _a.renderedHtml) ? question.locTitle.renderedHtml : question.title);
15973
+ };
15952
15974
  Object.defineProperty(VisualizerBase.prototype, "type", {
15953
15975
  /**
15954
15976
  * Returns the visualizer's type.