survey-analytics 2.2.5 → 2.2.6

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.2.5
2
+ * surveyjs - SurveyJS Dashboard library v2.2.6
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.2.5
2
+ * surveyjs - SurveyJS Dashboard library v2.2.6
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, f as createLoadingIndicator, a as DataHelper, e as svgTemplate, d as createCommercialLicenseLink, t as toPrecision } from './shared.mjs';
8
- import { Event, QuestionCommentModel, settings, ItemValue, hasLicense, surveyLocalization, IsTouch, Helpers } from 'survey-core';
8
+ import { Event, QuestionCommentModel, settings, ItemValue, hasLicense, surveyLocalization, IsTouch } from 'survey-core';
9
9
 
10
10
  /******************************************************************************
11
11
  Copyright (c) Microsoft Corporation.
@@ -10369,6 +10369,17 @@ class VisualizationMatrixDynamic extends VisualizationPanelDynamic {
10369
10369
  }
10370
10370
  VisualizationManager.registerVisualizer("matrixdynamic", VisualizationMatrixDynamic);
10371
10371
 
10372
+ function isChoicesArraysEqual(choices1, choices2) {
10373
+ if (choices1.length !== choices2.length)
10374
+ return false;
10375
+ for (let i = 0; i < choices1.length; i++) {
10376
+ if (choices1[i].value !== choices2[i].value ||
10377
+ choices1[i].text !== choices2[i].text) {
10378
+ return false;
10379
+ }
10380
+ }
10381
+ return true;
10382
+ }
10372
10383
  class VisualizationMatrixDropdown extends VisualizerBase {
10373
10384
  constructor(question, data, options = {}, name) {
10374
10385
  super(question, data, options, name || "matrixDropdown");
@@ -10385,8 +10396,7 @@ class VisualizationMatrixDropdown extends VisualizerBase {
10385
10396
  this._childOptions.seriesValues = question.rows.map((row) => row.value);
10386
10397
  this._childOptions.seriesLabels = question.rows.map((row) => row.text);
10387
10398
  const innerQuestions = this.getQuestions();
10388
- const canGroupColumns = this._childOptions.seriesValues.length == 1 && innerQuestions.every(innerQuestion => Helpers.isArraysEqual(innerQuestion.choices, this.question.choices));
10389
- if (canGroupColumns) {
10399
+ if (this.canGroupColumns) {
10390
10400
  var creators = VisualizationManager.getVisualizersByType("matrixdropdown-grouped");
10391
10401
  this._matrixDropdownVisualizer = new creators[0](this.question, [], this._childOptions);
10392
10402
  }
@@ -10396,6 +10406,11 @@ class VisualizationMatrixDropdown extends VisualizerBase {
10396
10406
  this._matrixDropdownVisualizer.onAfterRender.add(this.onPanelAfterRenderCallback);
10397
10407
  this.updateData(data);
10398
10408
  }
10409
+ get canGroupColumns() {
10410
+ const innerQuestions = this.getQuestions();
10411
+ const canGroupColumns = this._childOptions.seriesValues.length == 1 && innerQuestions.every(innerQuestion => isChoicesArraysEqual(innerQuestion.choices, this.question.choices));
10412
+ return canGroupColumns;
10413
+ }
10399
10414
  setLocale(newLocale) {
10400
10415
  super.setLocale(newLocale);
10401
10416
  this._childOptions.seriesLabels = this.question.rows.map((row) => row.text);