survey-analytics 2.5.17 → 2.5.18

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/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.5.17",
2
+ "version": "2.5.18",
3
3
  "name": "survey-analytics",
4
4
  "scripts": {
5
5
  "start": "webpack-dev-server --env buildType=dev",
@@ -93,7 +93,7 @@
93
93
  "@types/mongodb": "^4.0.6",
94
94
  "@types/plotly.js-dist-min": "^2.3.0",
95
95
  "@types/tabulator-tables": "^6.2.3",
96
- "survey-core": "2.5.17"
96
+ "survey-core": "2.5.18"
97
97
  },
98
98
  "husky": {
99
99
  "hooks": {
@@ -23,6 +23,7 @@ export declare class SelectBaseColumnsBuilder<T extends QuestionSelectBase> exte
23
23
  }
24
24
  export declare class CheckboxColumnsBuilder extends SelectBaseColumnsBuilder<QuestionCheckboxModel> {
25
25
  protected createColumn(question: QuestionCheckboxModel, table: Table): BaseColumn<QuestionCheckboxModel>;
26
+ protected buildColumnsCore(question: QuestionCheckboxModel, table: Table): Array<IColumn>;
26
27
  }
27
28
  export declare class SingleChoiceColumnsBuilder extends SelectBaseColumnsBuilder<QuestionDropdownModel | QuestionRadiogroupModel> {
28
29
  protected createColumn(question: QuestionDropdownModel | QuestionRadiogroupModel, table: Table): BaseColumn<QuestionDropdownModel | QuestionRadiogroupModel>;
@@ -40,6 +40,15 @@ export declare class SelectBaseColumn<T extends QuestionSelectBase> extends Base
40
40
  export declare class CheckboxColumn extends SelectBaseColumn<QuestionCheckboxModel | QuestionTagboxModel> {
41
41
  protected getDisplayValue(data: any, table: Table, options: ITableOptions): string;
42
42
  }
43
+ export declare class FlattenedCheckboxColumn extends BaseColumn<QuestionCheckboxModel | QuestionTagboxModel> {
44
+ private choiceValue;
45
+ private choiceText;
46
+ constructor(question: QuestionCheckboxModel | QuestionTagboxModel, choiceValue: any, choiceText: string, table: Table);
47
+ protected getDataType(): ColumnDataType;
48
+ protected getName(): string;
49
+ protected getDisplayName(): string;
50
+ protected getDisplayValue(data: any, table: Table, options: ITableOptions): any;
51
+ }
43
52
  export declare class SingleChoiceColumn extends SelectBaseColumn<QuestionDropdownModel | QuestionRadiogroupModel> {
44
53
  protected getDisplayValue(data: any, table: Table, options: ITableOptions): string;
45
54
  }
@@ -7,7 +7,8 @@ export declare enum QuestionLocation {
7
7
  export declare enum ColumnDataType {
8
8
  Text = 0,
9
9
  FileLink = 1,
10
- Image = 2
10
+ Image = 2,
11
+ Html = 3
11
12
  }
12
13
  export interface ICellData {
13
14
  question: Question;
@@ -46,6 +46,26 @@ export interface ITableOptions {
46
46
  * @see pageSize
47
47
  */
48
48
  paginationEnabled?: boolean;
49
+ /**
50
+ * Specifies whether to split responses to multi-select questions (Checkboxes and Multi-Select Dropdown) into separate columns.
51
+ *
52
+ * When enabled, each choice is represented as an individual column. Cell values indicate whether the choice was selected or the selection order, depending on the `multiSelectColumnValueFormat` setting. Empty cells indicate that the choice was not selected.
53
+ *
54
+ * Default value: `false`
55
+ *
56
+ */
57
+ splitMultiSelectIntoColumns?: boolean;
58
+ /**
59
+ * Specifies how selected values are represented in columns generated from multi-select questions. Applies only when `splitMultiSelectIntoColumns` is `true`.
60
+ *
61
+ * Accepted values:
62
+ *
63
+ * - `"checkmark"` &ndash; Displays a checkmark symbol for selected choices.
64
+ * - `"selectionOrder"` &ndash; Displays the order in which choices were selected (1, 2, 3, ...).
65
+ *
66
+ * Default value: `"checkmark"`
67
+ */
68
+ multiSelectColumnValueFormat?: "checkmark" | "selectionOrder";
49
69
  }
50
70
  export type TabulatorFilter = {
51
71
  field: string;
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - SurveyJS Dashboard library v2.5.17
2
+ * surveyjs - SurveyJS Dashboard library v2.5.18
3
3
  * Copyright (c) 2015-2026 Devsoft Baltic OÜ - http://surveyjs.io/
4
4
  * License: SEE LICENSE IN LICENSE
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - SurveyJS Dashboard library v2.5.17
2
+ * surveyjs - SurveyJS Dashboard library v2.5.18
3
3
  * Copyright (c) 2015-2026 Devsoft Baltic OÜ - http://surveyjs.io/
4
4
  * License: SEE LICENSE IN LICENSE
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - SurveyJS Dashboard library v2.5.17
2
+ * surveyjs - SurveyJS Dashboard library v2.5.18
3
3
  * Copyright (c) 2015-2026 Devsoft Baltic OÜ - http://surveyjs.io/
4
4
  * License: SEE LICENSE IN LICENSE
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - SurveyJS Dashboard library v2.5.17
2
+ * surveyjs - SurveyJS Dashboard library v2.5.18
3
3
  * Copyright (c) 2015-2026 Devsoft Baltic OÜ - http://surveyjs.io/
4
4
  * License: SEE LICENSE IN LICENSE
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - SurveyJS Dashboard library v2.5.17
2
+ * surveyjs - SurveyJS Dashboard library v2.5.18
3
3
  * Copyright (c) 2015-2026 Devsoft Baltic OÜ - http://surveyjs.io/
4
4
  * License: SEE LICENSE IN LICENSE
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - SurveyJS Dashboard library v2.5.17
2
+ * surveyjs - SurveyJS Dashboard library v2.5.18
3
3
  * Copyright (c) 2015-2026 Devsoft Baltic OÜ - http://surveyjs.io/
4
4
  * License: SEE LICENSE IN LICENSE
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - SurveyJS Dashboard library v2.5.17
2
+ * surveyjs - SurveyJS Dashboard library v2.5.18
3
3
  * Copyright (c) 2015-2026 Devsoft Baltic OÜ - http://surveyjs.io/
4
4
  * License: SEE LICENSE IN LICENSE
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - SurveyJS Dashboard library v2.5.17
2
+ * surveyjs - SurveyJS Dashboard library v2.5.18
3
3
  * Copyright (c) 2015-2026 Devsoft Baltic OÜ - http://surveyjs.io/
4
4
  * License: SEE LICENSE IN LICENSE
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - SurveyJS Dashboard library v2.5.17
2
+ * surveyjs - SurveyJS Dashboard library v2.5.18
3
3
  * Copyright (c) 2015-2026 Devsoft Baltic OÜ - http://surveyjs.io/
4
4
  * License: SEE LICENSE IN LICENSE
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - SurveyJS Dashboard library v2.5.17
2
+ * surveyjs - SurveyJS Dashboard library v2.5.18
3
3
  * Copyright (c) 2015-2026 Devsoft Baltic OÜ - http://surveyjs.io/
4
4
  * License: SEE LICENSE IN LICENSE
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - SurveyJS Dashboard library v2.5.17
2
+ * surveyjs - SurveyJS Dashboard library v2.5.18
3
3
  * Copyright (c) 2015-2026 Devsoft Baltic OÜ - http://surveyjs.io/
4
4
  * License: SEE LICENSE IN LICENSE
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - SurveyJS Dashboard library v2.5.17
2
+ * surveyjs - SurveyJS Dashboard library v2.5.18
3
3
  * Copyright (c) 2015-2026 Devsoft Baltic OÜ - http://surveyjs.io/
4
4
  * License: SEE LICENSE IN LICENSE
5
5
  */
@@ -3158,6 +3158,7 @@ __webpack_require__.r(__webpack_exports__);
3158
3158
  /* harmony export */ DocumentHelper: () => (/* reexport safe */ _utils_index__WEBPACK_IMPORTED_MODULE_24__.DocumentHelper),
3159
3159
  /* harmony export */ FileColumn: () => (/* reexport safe */ _tables_columns__WEBPACK_IMPORTED_MODULE_22__.FileColumn),
3160
3160
  /* harmony export */ FileColumnsBuilder: () => (/* reexport safe */ _tables_columnbuilder__WEBPACK_IMPORTED_MODULE_21__.FileColumnsBuilder),
3161
+ /* harmony export */ FlattenedCheckboxColumn: () => (/* reexport safe */ _tables_columns__WEBPACK_IMPORTED_MODULE_22__.FlattenedCheckboxColumn),
3161
3162
  /* harmony export */ ImageColumn: () => (/* reexport safe */ _tables_columns__WEBPACK_IMPORTED_MODULE_22__.ImageColumn),
3162
3163
  /* harmony export */ ImageColumnsBuilder: () => (/* reexport safe */ _tables_columnbuilder__WEBPACK_IMPORTED_MODULE_21__.ImageColumnsBuilder),
3163
3164
  /* harmony export */ MatrixColumn: () => (/* reexport safe */ _tables_columns__WEBPACK_IMPORTED_MODULE_22__.MatrixColumn),
@@ -3589,6 +3590,16 @@ var CheckboxColumnsBuilder = /** @class */ (function (_super) {
3589
3590
  CheckboxColumnsBuilder.prototype.createColumn = function (question, table) {
3590
3591
  return new _columns__WEBPACK_IMPORTED_MODULE_1__.CheckboxColumn(question, table);
3591
3592
  };
3593
+ CheckboxColumnsBuilder.prototype.buildColumnsCore = function (question, table) {
3594
+ if (table.options.splitMultiSelectIntoColumns) {
3595
+ var columns_1 = [];
3596
+ question.visibleChoices.forEach(function (choice) {
3597
+ columns_1.push(new _columns__WEBPACK_IMPORTED_MODULE_1__.FlattenedCheckboxColumn(question, choice.value, choice.text, table));
3598
+ });
3599
+ return columns_1;
3600
+ }
3601
+ return _super.prototype.buildColumnsCore.call(this, question, table);
3602
+ };
3592
3603
  return CheckboxColumnsBuilder;
3593
3604
  }(SelectBaseColumnsBuilder));
3594
3605
 
@@ -3700,7 +3711,7 @@ var CompositeColumnsBuilder = /** @class */ (function (_super) {
3700
3711
  if (CompositeColumnsBuilder.ShowAsSeparateColumns) {
3701
3712
  var innerQuestions = [];
3702
3713
  question.contentPanel.addQuestionsToList(innerQuestions);
3703
- var columns_1 = [];
3714
+ var columns_2 = [];
3704
3715
  innerQuestions.forEach(function (innerQuestion) {
3705
3716
  var builder = ColumnsBuilderFactory.Instance.getColumnsBuilder(innerQuestion.getType());
3706
3717
  var cols = builder.buildColumns(innerQuestion, table);
@@ -3708,9 +3719,9 @@ var CompositeColumnsBuilder = /** @class */ (function (_super) {
3708
3719
  col.name = question.name + "." + col.name;
3709
3720
  col.displayName = _this.getDisplayName(question, table) + " - " + _this.getDisplayName(innerQuestion, table);
3710
3721
  });
3711
- columns_1 = columns_1.concat(cols);
3722
+ columns_2 = columns_2.concat(cols);
3712
3723
  });
3713
- return columns_1;
3724
+ return columns_2;
3714
3725
  }
3715
3726
  return _super.prototype.buildColumnsCore.call(this, question, table);
3716
3727
  };
@@ -3742,6 +3753,7 @@ __webpack_require__.r(__webpack_exports__);
3742
3753
  /* harmony export */ CustomQuestionColumn: () => (/* binding */ CustomQuestionColumn),
3743
3754
  /* harmony export */ DefaultColumn: () => (/* binding */ DefaultColumn),
3744
3755
  /* harmony export */ FileColumn: () => (/* binding */ FileColumn),
3756
+ /* harmony export */ FlattenedCheckboxColumn: () => (/* binding */ FlattenedCheckboxColumn),
3745
3757
  /* harmony export */ ImageColumn: () => (/* binding */ ImageColumn),
3746
3758
  /* harmony export */ MatrixColumn: () => (/* binding */ MatrixColumn),
3747
3759
  /* harmony export */ MatrixDropdownColumn: () => (/* binding */ MatrixDropdownColumn),
@@ -3920,6 +3932,44 @@ var CheckboxColumn = /** @class */ (function (_super) {
3920
3932
  return CheckboxColumn;
3921
3933
  }(SelectBaseColumn));
3922
3934
 
3935
+ var FlattenedCheckboxColumn = /** @class */ (function (_super) {
3936
+ (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(FlattenedCheckboxColumn, _super);
3937
+ function FlattenedCheckboxColumn(question, choiceValue, choiceText, table) {
3938
+ var _this = _super.call(this, question, table) || this;
3939
+ _this.choiceValue = choiceValue;
3940
+ _this.choiceText = choiceText;
3941
+ return _this;
3942
+ }
3943
+ FlattenedCheckboxColumn.prototype.getDataType = function () {
3944
+ return _config__WEBPACK_IMPORTED_MODULE_3__.ColumnDataType.Html;
3945
+ };
3946
+ FlattenedCheckboxColumn.prototype.getName = function () {
3947
+ return "".concat(this.question.name, ".").concat(this.choiceValue);
3948
+ };
3949
+ FlattenedCheckboxColumn.prototype.getDisplayName = function () {
3950
+ var _a;
3951
+ var questionDisplayName = this.table.useNamesAsTitles
3952
+ ? this.question.name
3953
+ : (((_a = this.question.locTitle) === null || _a === void 0 ? void 0 : _a.renderedHtml) || this.question.title || "").trim() || this.question.name;
3954
+ var choiceDisplayText = this.table.useNamesAsTitles ? this.choiceValue : this.choiceText;
3955
+ return "".concat(questionDisplayName, " - ").concat(choiceDisplayText);
3956
+ };
3957
+ FlattenedCheckboxColumn.prototype.getDisplayValue = function (data, table, options) {
3958
+ var questionValue = data[this.question.name];
3959
+ if (!Array.isArray(questionValue)) {
3960
+ return "";
3961
+ }
3962
+ var index = questionValue.indexOf(this.choiceValue);
3963
+ if (index < 0) {
3964
+ return "";
3965
+ }
3966
+ // Default to checkmark if not specified
3967
+ var displayMode = options.multiSelectColumnValueFormat || "checkmark";
3968
+ return displayMode === "checkmark" ? "&#10004;" : (index + 1).toString();
3969
+ };
3970
+ return FlattenedCheckboxColumn;
3971
+ }(BaseColumn));
3972
+
3923
3973
  var SingleChoiceColumn = /** @class */ (function (_super) {
3924
3974
  (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(SingleChoiceColumn, _super);
3925
3975
  function SingleChoiceColumn() {
@@ -4134,6 +4184,7 @@ var ColumnDataType;
4134
4184
  ColumnDataType[ColumnDataType["Text"] = 0] = "Text";
4135
4185
  ColumnDataType[ColumnDataType["FileLink"] = 1] = "FileLink";
4136
4186
  ColumnDataType[ColumnDataType["Image"] = 2] = "Image";
4187
+ ColumnDataType[ColumnDataType["Html"] = 3] = "Html";
4137
4188
  })(ColumnDataType || (ColumnDataType = {}));
4138
4189
 
4139
4190
 
@@ -5298,6 +5349,35 @@ var escapeCellFormula = function (field) {
5298
5349
  return field;
5299
5350
  }
5300
5351
  };
5352
+ var decodeHtmlEntities = function (text) {
5353
+ if (typeof text !== "string")
5354
+ return text;
5355
+ var entityMap = {
5356
+ // eslint-disable-next-line surveyjs/eslint-plugin-i18n/only-english-or-code
5357
+ "&#10004;": "+",
5358
+ // eslint-disable-next-line surveyjs/eslint-plugin-i18n/only-english-or-code
5359
+ "&check;": "✓",
5360
+ // eslint-disable-next-line surveyjs/eslint-plugin-i18n/only-english-or-code
5361
+ "&checkmark;": "✓",
5362
+ // eslint-disable-next-line surveyjs/eslint-plugin-i18n/only-english-or-code
5363
+ "&#x2713;": "✓",
5364
+ // eslint-disable-next-line surveyjs/eslint-plugin-i18n/only-english-or-code
5365
+ "&#9745;": "☑",
5366
+ // eslint-disable-next-line surveyjs/eslint-plugin-i18n/only-english-or-code
5367
+ "&#x2611;": "☑",
5368
+ "&amp;": "&",
5369
+ "&lt;": "<",
5370
+ "&gt;": ">",
5371
+ "&quot;": '"',
5372
+ "&#39;": "'",
5373
+ "&apos;": "'"
5374
+ };
5375
+ var decoded = text;
5376
+ for (var entity in entityMap) {
5377
+ decoded = decoded.replace(new RegExp(entity, "g"), entityMap[entity]);
5378
+ }
5379
+ return decoded;
5380
+ };
5301
5381
  var Tabulator = /** @class */ (function (_super) {
5302
5382
  (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__extends)(Tabulator, _super);
5303
5383
  function Tabulator(survey, data, options, _columnsData) {
@@ -5345,6 +5425,9 @@ var Tabulator = /** @class */ (function (_super) {
5345
5425
  if (column.dataType === _config__WEBPACK_IMPORTED_MODULE_3__.ColumnDataType.FileLink && Array.isArray(dataCell)) {
5346
5426
  return (dataCell || []).map(function (f) { return f.name; }).join(", ");
5347
5427
  }
5428
+ if (column.dataType === _config__WEBPACK_IMPORTED_MODULE_3__.ColumnDataType.Html) {
5429
+ return decodeHtmlEntities(cellData);
5430
+ }
5348
5431
  }
5349
5432
  }
5350
5433
  if (_this.currentDownloadType === "csv" || _this.currentDownloadType === "xlsx") {
@@ -5514,7 +5597,7 @@ var Tabulator = /** @class */ (function (_super) {
5514
5597
  var _this = this;
5515
5598
  var columns = this.columns.map(function (column, index) {
5516
5599
  var formatter = "plaintext";
5517
- if (column.dataType == _config__WEBPACK_IMPORTED_MODULE_3__.ColumnDataType.FileLink) {
5600
+ if (column.dataType == _config__WEBPACK_IMPORTED_MODULE_3__.ColumnDataType.FileLink || column.dataType == _config__WEBPACK_IMPORTED_MODULE_3__.ColumnDataType.Html) {
5518
5601
  formatter = "html";
5519
5602
  }
5520
5603
  if (column.dataType == _config__WEBPACK_IMPORTED_MODULE_3__.ColumnDataType.Image) {
@@ -6233,6 +6316,7 @@ __webpack_require__.r(__webpack_exports__);
6233
6316
  /* harmony export */ DocumentHelper: () => (/* reexport safe */ _tabulator__WEBPACK_IMPORTED_MODULE_0__.DocumentHelper),
6234
6317
  /* harmony export */ FileColumn: () => (/* reexport safe */ _tabulator__WEBPACK_IMPORTED_MODULE_0__.FileColumn),
6235
6318
  /* harmony export */ FileColumnsBuilder: () => (/* reexport safe */ _tabulator__WEBPACK_IMPORTED_MODULE_0__.FileColumnsBuilder),
6319
+ /* harmony export */ FlattenedCheckboxColumn: () => (/* reexport safe */ _tabulator__WEBPACK_IMPORTED_MODULE_0__.FlattenedCheckboxColumn),
6236
6320
  /* harmony export */ ImageColumn: () => (/* reexport safe */ _tabulator__WEBPACK_IMPORTED_MODULE_0__.ImageColumn),
6237
6321
  /* harmony export */ ImageColumnsBuilder: () => (/* reexport safe */ _tabulator__WEBPACK_IMPORTED_MODULE_0__.ImageColumnsBuilder),
6238
6322
  /* harmony export */ MatrixColumn: () => (/* reexport safe */ _tabulator__WEBPACK_IMPORTED_MODULE_0__.MatrixColumn),