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/fesm/shared.mjs +1 -1
- package/fesm/shared2.mjs +1 -1
- package/fesm/survey.analytics.core.mjs +1 -1
- package/fesm/survey.analytics.mjs +1 -1
- package/fesm/survey.analytics.mongo.mjs +1 -1
- package/fesm/survey.analytics.tabulator.mjs +80 -3
- package/fesm/survey.analytics.tabulator.mjs.map +1 -1
- package/package.json +2 -2
- package/survey-analytics-tabulator.types/tables/columnbuilder.d.ts +1 -0
- package/survey-analytics-tabulator.types/tables/columns.d.ts +9 -0
- package/survey-analytics-tabulator.types/tables/config.d.ts +2 -1
- package/survey-analytics-tabulator.types/tables/table.d.ts +20 -0
- package/survey.analytics.core.css +1 -1
- package/survey.analytics.core.js +1 -1
- package/survey.analytics.core.min.css +1 -1
- package/survey.analytics.core.min.js.LICENSE.txt +1 -1
- package/survey.analytics.css +1 -1
- package/survey.analytics.js +1 -1
- package/survey.analytics.min.css +1 -1
- package/survey.analytics.min.js.LICENSE.txt +1 -1
- package/survey.analytics.mongo.js +1 -1
- package/survey.analytics.mongo.min.js.LICENSE.txt +1 -1
- package/survey.analytics.tabulator.css +1 -1
- package/survey.analytics.tabulator.js +89 -5
- package/survey.analytics.tabulator.js.map +1 -1
- package/survey.analytics.tabulator.min.css +1 -1
- package/survey.analytics.tabulator.min.js +1 -1
- package/survey.analytics.tabulator.min.js.LICENSE.txt +1 -1
package/fesm/shared.mjs
CHANGED
package/fesm/shared2.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* surveyjs - SurveyJS Dashboard library v2.5.
|
|
2
|
+
* surveyjs - SurveyJS Dashboard library v2.5.18
|
|
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
|
*/
|
|
@@ -274,6 +274,7 @@ var ColumnDataType;
|
|
|
274
274
|
ColumnDataType[ColumnDataType["Text"] = 0] = "Text";
|
|
275
275
|
ColumnDataType[ColumnDataType["FileLink"] = 1] = "FileLink";
|
|
276
276
|
ColumnDataType[ColumnDataType["Image"] = 2] = "Image";
|
|
277
|
+
ColumnDataType[ColumnDataType["Html"] = 3] = "Html";
|
|
277
278
|
})(ColumnDataType || (ColumnDataType = {}));
|
|
278
279
|
|
|
279
280
|
TableExtensions.registerExtension({
|
|
@@ -583,6 +584,40 @@ class CheckboxColumn extends SelectBaseColumn {
|
|
|
583
584
|
return super.getDisplayValue(data, table, options);
|
|
584
585
|
}
|
|
585
586
|
}
|
|
587
|
+
class FlattenedCheckboxColumn extends BaseColumn {
|
|
588
|
+
constructor(question, choiceValue, choiceText, table) {
|
|
589
|
+
super(question, table);
|
|
590
|
+
this.choiceValue = choiceValue;
|
|
591
|
+
this.choiceText = choiceText;
|
|
592
|
+
}
|
|
593
|
+
getDataType() {
|
|
594
|
+
return ColumnDataType.Html;
|
|
595
|
+
}
|
|
596
|
+
getName() {
|
|
597
|
+
return `${this.question.name}.${this.choiceValue}`;
|
|
598
|
+
}
|
|
599
|
+
getDisplayName() {
|
|
600
|
+
var _a;
|
|
601
|
+
const questionDisplayName = this.table.useNamesAsTitles
|
|
602
|
+
? this.question.name
|
|
603
|
+
: (((_a = this.question.locTitle) === null || _a === void 0 ? void 0 : _a.renderedHtml) || this.question.title || "").trim() || this.question.name;
|
|
604
|
+
const choiceDisplayText = this.table.useNamesAsTitles ? this.choiceValue : this.choiceText;
|
|
605
|
+
return `${questionDisplayName} - ${choiceDisplayText}`;
|
|
606
|
+
}
|
|
607
|
+
getDisplayValue(data, table, options) {
|
|
608
|
+
const questionValue = data[this.question.name];
|
|
609
|
+
if (!Array.isArray(questionValue)) {
|
|
610
|
+
return "";
|
|
611
|
+
}
|
|
612
|
+
const index = questionValue.indexOf(this.choiceValue);
|
|
613
|
+
if (index < 0) {
|
|
614
|
+
return "";
|
|
615
|
+
}
|
|
616
|
+
// Default to checkmark if not specified
|
|
617
|
+
const displayMode = options.multiSelectColumnValueFormat || "checkmark";
|
|
618
|
+
return displayMode === "checkmark" ? "✔" : (index + 1).toString();
|
|
619
|
+
}
|
|
620
|
+
}
|
|
586
621
|
class SingleChoiceColumn extends SelectBaseColumn {
|
|
587
622
|
getDisplayValue(data, table, options) {
|
|
588
623
|
if (this.isOtherInSeparateColumn) {
|
|
@@ -767,6 +802,16 @@ class CheckboxColumnsBuilder extends SelectBaseColumnsBuilder {
|
|
|
767
802
|
createColumn(question, table) {
|
|
768
803
|
return new CheckboxColumn(question, table);
|
|
769
804
|
}
|
|
805
|
+
buildColumnsCore(question, table) {
|
|
806
|
+
if (table.options.splitMultiSelectIntoColumns) {
|
|
807
|
+
const columns = [];
|
|
808
|
+
question.visibleChoices.forEach(choice => {
|
|
809
|
+
columns.push(new FlattenedCheckboxColumn(question, choice.value, choice.text, table));
|
|
810
|
+
});
|
|
811
|
+
return columns;
|
|
812
|
+
}
|
|
813
|
+
return super.buildColumnsCore(question, table);
|
|
814
|
+
}
|
|
770
815
|
}
|
|
771
816
|
ColumnsBuilderFactory.Instance.registerBuilderColumn("checkbox", new CheckboxColumnsBuilder());
|
|
772
817
|
ColumnsBuilderFactory.Instance.registerBuilderColumn("tagbox", new CheckboxColumnsBuilder());
|
|
@@ -1321,6 +1366,35 @@ const escapeCellFormula = (field) => {
|
|
|
1321
1366
|
return field;
|
|
1322
1367
|
}
|
|
1323
1368
|
};
|
|
1369
|
+
const decodeHtmlEntities = (text) => {
|
|
1370
|
+
if (typeof text !== "string")
|
|
1371
|
+
return text;
|
|
1372
|
+
const entityMap = {
|
|
1373
|
+
// eslint-disable-next-line surveyjs/eslint-plugin-i18n/only-english-or-code
|
|
1374
|
+
"✔": "+",
|
|
1375
|
+
// eslint-disable-next-line surveyjs/eslint-plugin-i18n/only-english-or-code
|
|
1376
|
+
"✓": "✓",
|
|
1377
|
+
// eslint-disable-next-line surveyjs/eslint-plugin-i18n/only-english-or-code
|
|
1378
|
+
"✓": "✓",
|
|
1379
|
+
// eslint-disable-next-line surveyjs/eslint-plugin-i18n/only-english-or-code
|
|
1380
|
+
"✓": "✓",
|
|
1381
|
+
// eslint-disable-next-line surveyjs/eslint-plugin-i18n/only-english-or-code
|
|
1382
|
+
"☑": "☑",
|
|
1383
|
+
// eslint-disable-next-line surveyjs/eslint-plugin-i18n/only-english-or-code
|
|
1384
|
+
"☑": "☑",
|
|
1385
|
+
"&": "&",
|
|
1386
|
+
"<": "<",
|
|
1387
|
+
">": ">",
|
|
1388
|
+
""": '"',
|
|
1389
|
+
"'": "'",
|
|
1390
|
+
"'": "'"
|
|
1391
|
+
};
|
|
1392
|
+
let decoded = text;
|
|
1393
|
+
for (const entity in entityMap) {
|
|
1394
|
+
decoded = decoded.replace(new RegExp(entity, "g"), entityMap[entity]);
|
|
1395
|
+
}
|
|
1396
|
+
return decoded;
|
|
1397
|
+
};
|
|
1324
1398
|
class Tabulator extends Table {
|
|
1325
1399
|
static initTabulatorConstructor(tabulatorTablesConstructor) {
|
|
1326
1400
|
this.tabulatorTablesConstructor = tabulatorTablesConstructor;
|
|
@@ -1375,6 +1449,9 @@ class Tabulator extends Table {
|
|
|
1375
1449
|
if (column.dataType === ColumnDataType.FileLink && Array.isArray(dataCell)) {
|
|
1376
1450
|
return (dataCell || []).map(f => f.name).join(", ");
|
|
1377
1451
|
}
|
|
1452
|
+
if (column.dataType === ColumnDataType.Html) {
|
|
1453
|
+
return decodeHtmlEntities(cellData);
|
|
1454
|
+
}
|
|
1378
1455
|
}
|
|
1379
1456
|
}
|
|
1380
1457
|
if (this.currentDownloadType === "csv" || this.currentDownloadType === "xlsx") {
|
|
@@ -1526,7 +1603,7 @@ class Tabulator extends Table {
|
|
|
1526
1603
|
getColumns() {
|
|
1527
1604
|
const columns = this.columns.map((column, index) => {
|
|
1528
1605
|
let formatter = "plaintext";
|
|
1529
|
-
if (column.dataType == ColumnDataType.FileLink) {
|
|
1606
|
+
if (column.dataType == ColumnDataType.FileLink || column.dataType == ColumnDataType.Html) {
|
|
1530
1607
|
formatter = "html";
|
|
1531
1608
|
}
|
|
1532
1609
|
if (column.dataType == ColumnDataType.Image) {
|
|
@@ -1691,5 +1768,5 @@ class TabulatorRow extends TableRow {
|
|
|
1691
1768
|
|
|
1692
1769
|
Tabulator.initTabulatorConstructor(TabulatorFull);
|
|
1693
1770
|
|
|
1694
|
-
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 };
|
|
1771
|
+
export { BaseColumn, CheckboxColumn, CheckboxColumnsBuilder, ColumnsBuilderFactory, CommentColumn, CompositeColumnsBuilder, CompositeQuestionColumn, CustomColumnsBuilder, CustomQuestionColumn, DefaultColumn, DefaultColumnsBuilder, DocumentHelper, FileColumn, FileColumnsBuilder, FlattenedCheckboxColumn, ImageColumn, ImageColumnsBuilder, MatrixColumn, MatrixColumnsBuilder, MatrixDropdownColumn, MatrixDropdownColumnBuilder, OtherColumn, SelectBaseColumn, SelectBaseColumnsBuilder, SingleChoiceColumn, SingleChoiceColumnsBuilder, Table, TableEvent, TableExtensions, TableRow, Tabulator, TabulatorRow, defaultDownloadOptions, defaultOptions, localization };
|
|
1695
1772
|
//# sourceMappingURL=survey.analytics.tabulator.mjs.map
|