survey-analytics 2.5.13 → 3.0.0-beta.0
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 +754 -3179
- package/fesm/shared.mjs.map +1 -1
- package/fesm/shared2.mjs +9687 -8187
- package/fesm/shared2.mjs.map +1 -1
- package/fesm/shared3.mjs +4982 -0
- package/fesm/shared3.mjs.map +1 -0
- package/fesm/shared4.mjs +42 -0
- package/fesm/shared4.mjs.map +1 -0
- package/fesm/survey.analytics.apexcharts.mjs +1061 -0
- package/fesm/survey.analytics.apexcharts.mjs.map +1 -0
- package/fesm/survey.analytics.core.mjs +3 -3
- package/fesm/survey.analytics.mjs +7 -755
- package/fesm/survey.analytics.mjs.map +1 -1
- package/fesm/survey.analytics.mongo.mjs +1 -1
- package/fesm/survey.analytics.mongo.mjs.map +1 -1
- package/fesm/survey.analytics.plotly.mjs +13 -0
- package/fesm/survey.analytics.plotly.mjs.map +1 -0
- package/fesm/survey.analytics.tabulator.mjs +343 -181
- package/fesm/survey.analytics.tabulator.mjs.map +1 -1
- package/fesm/themes/index.mjs +1942 -0
- package/fesm/themes/index.mjs.map +1 -0
- package/package.json +38 -11
- package/survey-analytics-plotly.types/alternativeVizualizersWrapper.d.ts +73 -0
- package/survey-analytics-plotly.types/analytics-localization/arabic.d.ts +100 -0
- package/survey-analytics-plotly.types/analytics-localization/dutch.d.ts +100 -0
- package/survey-analytics-plotly.types/analytics-localization/english.d.ts +130 -0
- package/survey-analytics-plotly.types/analytics-localization/farsi.d.ts +100 -0
- package/survey-analytics-plotly.types/analytics-localization/finnish.d.ts +100 -0
- package/survey-analytics-plotly.types/analytics-localization/french.d.ts +100 -0
- package/survey-analytics-plotly.types/analytics-localization/german.d.ts +100 -0
- package/survey-analytics-plotly.types/analytics-localization/italian.d.ts +100 -0
- package/survey-analytics-plotly.types/analytics-localization/japanese.d.ts +100 -0
- package/survey-analytics-plotly.types/analytics-localization/norwegian.d.ts +100 -0
- package/survey-analytics-plotly.types/analytics-localization/polish.d.ts +100 -0
- package/survey-analytics-plotly.types/analytics-localization/portuguese.d.ts +100 -0
- package/survey-analytics-plotly.types/analytics-localization/russian.d.ts +100 -0
- package/survey-analytics-plotly.types/analytics-localization/spanish.d.ts +100 -0
- package/survey-analytics-plotly.types/analytics-localization/swedish.d.ts +100 -0
- package/survey-analytics-plotly.types/boolean.d.ts +15 -0
- package/survey-analytics-plotly.types/card.d.ts +29 -0
- package/survey-analytics-plotly.types/chartConfig.d.ts +9 -0
- package/survey-analytics-plotly.types/config.d.ts +35 -0
- package/survey-analytics-plotly.types/dashboard.d.ts +51 -0
- package/survey-analytics-plotly.types/dataProvider.d.ts +69 -0
- package/survey-analytics-plotly.types/entries/plotly.d.ts +2 -0
- package/survey-analytics-plotly.types/entries/summary.core.d.ts +44 -0
- package/survey-analytics-plotly.types/filterInfo.d.ts +11 -0
- package/survey-analytics-plotly.types/histogram.d.ts +102 -0
- package/{survey-analytics.types/layoutEngine.d.ts → survey-analytics-plotly.types/layout-engine.d.ts} +0 -12
- package/survey-analytics-plotly.types/localizationManager.d.ts +152 -0
- package/survey-analytics-plotly.types/matrix.d.ts +17 -0
- package/survey-analytics-plotly.types/matrixDropdownGrouped.d.ts +15 -0
- package/survey-analytics-plotly.types/muuri-layout-engine.d.ts +13 -0
- package/survey-analytics-plotly.types/nps.d.ts +37 -0
- package/survey-analytics-plotly.types/number.d.ts +27 -0
- package/survey-analytics-plotly.types/pivot.d.ts +59 -0
- package/{survey-analytics.types → survey-analytics-plotly.types}/plotly/chart-adapter.d.ts +11 -2
- package/survey-analytics-plotly.types/plotly/setup.d.ts +150 -0
- package/survey-analytics-plotly.types/ranking.d.ts +12 -0
- package/survey-analytics-plotly.types/selectBase.d.ts +116 -0
- package/survey-analytics-plotly.types/statisticCalculators.d.ts +9 -0
- package/survey-analytics-plotly.types/statistics-table.d.ts +28 -0
- package/survey-analytics-plotly.types/svgbundle.d.ts +2 -0
- package/survey-analytics-plotly.types/text.d.ts +25 -0
- package/survey-analytics-plotly.types/theme.d.ts +50 -0
- package/survey-analytics-plotly.types/themes/default-light.d.ts +965 -0
- package/survey-analytics-plotly.types/utils/calculationDateRanges.d.ts +35 -0
- package/survey-analytics-plotly.types/utils/dateRangeModel.d.ts +32 -0
- package/survey-analytics-plotly.types/utils/dateRangeWidget.d.ts +38 -0
- package/survey-analytics-plotly.types/utils/dropdownActionWidget.d.ts +31 -0
- package/survey-analytics-plotly.types/utils/dropdownBase.d.ts +47 -0
- package/survey-analytics-plotly.types/utils/dropdownWidget.d.ts +40 -0
- package/survey-analytics-plotly.types/utils/index.d.ts +62 -0
- package/survey-analytics-plotly.types/utils/toggle.d.ts +17 -0
- package/survey-analytics-plotly.types/utils/utils.d.ts +9 -0
- package/survey-analytics-plotly.types/visualizationComposite.d.ts +8 -0
- package/survey-analytics-plotly.types/visualizationManager.d.ts +60 -0
- package/survey-analytics-plotly.types/visualizationMatrixDropdown.d.ts +23 -0
- package/survey-analytics-plotly.types/visualizationMatrixDynamic.d.ts +8 -0
- package/survey-analytics-plotly.types/visualizationPanel.d.ts +464 -0
- package/survey-analytics-plotly.types/visualizationPanelDynamic.d.ts +20 -0
- package/survey-analytics-plotly.types/visualizerBase.d.ts +422 -0
- package/survey-analytics-plotly.types/visualizerDescription.d.ts +19 -0
- package/survey-analytics-plotly.types/visualizerFactory.d.ts +41 -0
- package/survey-analytics-plotly.types/wordcloud/stopwords/dutch.d.ts +1 -0
- package/survey-analytics-plotly.types/wordcloud/stopwords/english.d.ts +1 -0
- package/survey-analytics-plotly.types/wordcloud/stopwords/index.d.ts +3 -0
- package/survey-analytics-plotly.types/wordcloud/stopwords/norwegian.d.ts +1 -0
- package/survey-analytics-plotly.types/wordcloud/stopwords/spanish.d.ts +1 -0
- package/survey-analytics-plotly.types/wordcloud/widget.d.ts +38 -0
- package/survey-analytics-plotly.types/wordcloud/wordcloud.d.ts +28 -0
- package/survey-analytics-tabulator.types/analytics-localization/english.d.ts +28 -0
- package/survey-analytics-tabulator.types/entries/tabulator.d.ts +2 -25
- package/survey-analytics-tabulator.types/entries/tabulator.fontless.d.ts +26 -0
- package/survey-analytics-tabulator.types/localizationManager.d.ts +28 -0
- package/survey-analytics-tabulator.types/tables/extensions/footerextensions.d.ts +1 -0
- package/survey-analytics-tabulator.types/tables/extensions/tableextensions.d.ts +2 -1
- package/survey-analytics-tabulator.types/tables/tabulator.d.ts +10 -1
- package/survey-analytics-tabulator.types/theme.d.ts +50 -0
- package/survey-analytics-tabulator.types/themes/default-light.d.ts +965 -0
- package/survey-analytics-tabulator.types/utils/dropdownActionWidget.d.ts +31 -0
- package/survey-analytics-tabulator.types/utils/dropdownBase.d.ts +47 -0
- package/survey-analytics-tabulator.types/utils/dropdownWidget.d.ts +40 -0
- package/survey-analytics-tabulator.types/utils/index.d.ts +25 -2
- package/survey-analytics.types/alternativeVizualizersWrapper.d.ts +9 -4
- package/survey-analytics.types/analytics-localization/english.d.ts +28 -0
- package/survey-analytics.types/apexcharts/chart-adapter.d.ts +29 -0
- package/survey-analytics.types/apexcharts/index.d.ts +2 -0
- package/survey-analytics.types/apexcharts/setup.d.ts +185 -0
- package/survey-analytics.types/boolean.d.ts +1 -1
- package/survey-analytics.types/card.d.ts +29 -0
- package/survey-analytics.types/chartConfig.d.ts +9 -0
- package/survey-analytics.types/config.d.ts +1 -33
- package/survey-analytics.types/dashboard.d.ts +51 -0
- package/survey-analytics.types/dataProvider.d.ts +17 -0
- package/survey-analytics.types/entries/apexcharts.d.ts +2 -0
- package/survey-analytics.types/entries/apexcharts.fontless.d.ts +2 -0
- package/survey-analytics.types/entries/summary.core.d.ts +6 -0
- package/survey-analytics.types/histogram.d.ts +29 -13
- package/survey-analytics.types/layout-engine.d.ts +29 -0
- package/survey-analytics.types/localizationManager.d.ts +28 -0
- package/survey-analytics.types/matrix.d.ts +3 -2
- package/survey-analytics.types/matrixDropdownGrouped.d.ts +3 -2
- package/survey-analytics.types/muuri-layout-engine.d.ts +13 -0
- package/survey-analytics.types/nps.d.ts +5 -10
- package/survey-analytics.types/number.d.ts +8 -7
- package/survey-analytics.types/pivot.d.ts +25 -35
- package/survey-analytics.types/ranking.d.ts +3 -2
- package/survey-analytics.types/selectBase.d.ts +12 -15
- package/survey-analytics.types/statisticCalculators.d.ts +8 -13
- package/survey-analytics.types/statistics-table.d.ts +2 -2
- package/survey-analytics.types/text.d.ts +4 -3
- package/survey-analytics.types/theme.d.ts +50 -0
- package/survey-analytics.types/themes/default-light.d.ts +965 -0
- package/survey-analytics.types/utils/calculationDateRanges.d.ts +35 -0
- package/survey-analytics.types/utils/dateRangeModel.d.ts +32 -0
- package/survey-analytics.types/utils/dateRangeWidget.d.ts +38 -0
- package/survey-analytics.types/utils/dropdownActionWidget.d.ts +31 -0
- package/survey-analytics.types/utils/dropdownBase.d.ts +47 -0
- package/survey-analytics.types/utils/dropdownWidget.d.ts +40 -0
- package/survey-analytics.types/utils/index.d.ts +25 -2
- package/survey-analytics.types/utils/toggle.d.ts +17 -0
- package/survey-analytics.types/utils/utils.d.ts +9 -0
- package/survey-analytics.types/visualizationComposite.d.ts +1 -1
- package/survey-analytics.types/visualizationManager.d.ts +5 -5
- package/survey-analytics.types/visualizationMatrixDropdown.d.ts +2 -1
- package/survey-analytics.types/visualizationMatrixDynamic.d.ts +1 -1
- package/survey-analytics.types/visualizationPanel.d.ts +20 -3
- package/survey-analytics.types/visualizationPanelDynamic.d.ts +2 -1
- package/survey-analytics.types/visualizerBase.d.ts +65 -10
- package/survey-analytics.types/visualizerDescription.d.ts +19 -0
- package/survey-analytics.types/visualizerFactory.d.ts +11 -2
- package/survey-analytics.types/wordcloud/wordcloud.d.ts +6 -4
- package/survey.analytics.core.css +1131 -99
- package/survey.analytics.core.css.map +1 -1
- package/survey.analytics.core.js +5063 -1002
- package/survey.analytics.core.js.map +1 -1
- package/survey.analytics.core.min.css +9 -6
- package/survey.analytics.core.min.js +1 -1
- package/survey.analytics.core.min.js.LICENSE.txt +1 -1
- package/survey.analytics.css +1494 -103
- package/survey.analytics.css.map +1 -1
- package/survey.analytics.d.ts +1 -2
- package/survey.analytics.fontless.css +1629 -0
- package/survey.analytics.fontless.css.map +1 -0
- package/survey.analytics.fontless.min.css +14 -0
- package/survey.analytics.js +7427 -3055
- package/survey.analytics.js.map +1 -1
- package/survey.analytics.min.css +11 -6
- package/survey.analytics.min.js +1 -1
- package/survey.analytics.min.js.LICENSE.txt +1 -1
- package/survey.analytics.mongo.js +2 -2
- package/survey.analytics.mongo.js.map +1 -1
- package/survey.analytics.mongo.min.js +1 -1
- package/survey.analytics.mongo.min.js.LICENSE.txt +1 -1
- package/survey.analytics.plotly.css +1714 -0
- package/survey.analytics.plotly.css.map +1 -0
- package/survey.analytics.plotly.d.ts +1 -0
- package/survey.analytics.plotly.fontless.css +1492 -0
- package/survey.analytics.plotly.fontless.css.map +1 -0
- package/survey.analytics.plotly.fontless.min.css +13 -0
- package/survey.analytics.plotly.js +23829 -0
- package/survey.analytics.plotly.js.map +1 -0
- package/survey.analytics.plotly.min.css +14 -0
- package/survey.analytics.plotly.min.js +2 -0
- package/survey.analytics.plotly.min.js.LICENSE.txt +22 -0
- package/survey.analytics.tabulator.css +992 -132
- package/survey.analytics.tabulator.css.map +1 -1
- package/survey.analytics.tabulator.fontless.css +1121 -0
- package/survey.analytics.tabulator.fontless.css.map +1 -0
- package/survey.analytics.tabulator.fontless.min.css +6 -0
- package/survey.analytics.tabulator.js +2634 -251
- package/survey.analytics.tabulator.js.map +1 -1
- package/survey.analytics.tabulator.min.css +3 -2
- package/survey.analytics.tabulator.min.js +1 -1
- package/survey.analytics.tabulator.min.js.LICENSE.txt +1 -1
- package/themes/default-dark.js +1032 -0
- package/themes/default-dark.js.map +1 -0
- package/themes/default-dark.min.js +2 -0
- package/themes/default-dark.min.js.LICENSE.txt +5 -0
- package/themes/default-light.js +1032 -0
- package/themes/default-light.js.map +1 -0
- package/themes/default-light.min.js +2 -0
- package/themes/default-light.min.js.LICENSE.txt +5 -0
- package/themes/index.js +2063 -0
- package/themes/index.js.map +1 -0
- package/themes/index.min.js +2 -0
- package/themes/index.min.js.LICENSE.txt +5 -0
- package/themes/themes/default-dark.d.ts +965 -0
- package/themes/themes/default-light.d.ts +965 -0
- package/themes/themes/index.d.ts +1934 -0
- package/themes/utils/helpers.d.ts +8 -0
- package/survey-analytics.types/plotly/setup.d.ts +0 -32
- /package/{survey-analytics.types/entries/summary.d.ts → survey-analytics-plotly.types/entries/plotly.fontless.d.ts} +0 -0
- /package/{survey-analytics.types → survey-analytics-plotly.types}/plotly/index.d.ts +0 -0
- /package/{survey-analytics.types → survey-analytics-plotly.types}/plotly/legacy.d.ts +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* surveyjs - SurveyJS Dashboard library
|
|
2
|
+
* surveyjs - SurveyJS Dashboard library v3.0.0-beta.0
|
|
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
|
*/
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
export {
|
|
9
|
-
import { ItemValue, settings,
|
|
7
|
+
import { a as DocumentHelper, l as localization, d as createImagesContainer, e as createLinksContainer, f as createCommercialLicenseLink, g as svgTemplate, D as DashboardTheme } from './shared3.mjs';
|
|
8
|
+
export { s as setupLocale, b as surveyStrings } from './shared3.mjs';
|
|
9
|
+
import { ItemValue, settings, Serializer, surveyLocalization, hasLicense, EventBase, Event } from 'survey-core';
|
|
10
10
|
import { TabulatorFull } from 'tabulator-tables';
|
|
11
11
|
|
|
12
12
|
class TableExtensions {
|
|
@@ -19,16 +19,19 @@ class TableExtensions {
|
|
|
19
19
|
if (!!extensions) {
|
|
20
20
|
extensions = this.sortExtensions(extensions);
|
|
21
21
|
extensions.forEach((extension) => {
|
|
22
|
-
|
|
23
|
-
var action = extension.render(this.table, options);
|
|
24
|
-
if (!!action) {
|
|
25
|
-
targetNode.appendChild(action);
|
|
26
|
-
this.renderedExtensions.push(extension);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
22
|
+
this.renderExtension(extension, targetNode, options);
|
|
29
23
|
});
|
|
30
24
|
}
|
|
31
25
|
}
|
|
26
|
+
renderExtension(extension, targetNode, options) {
|
|
27
|
+
if (!!extension.render && this.table.allowExtension(extension)) {
|
|
28
|
+
var action = extension.render(this.table, options);
|
|
29
|
+
if (!!action) {
|
|
30
|
+
targetNode.appendChild(action);
|
|
31
|
+
this.renderedExtensions.push(extension);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
32
35
|
destroy() {
|
|
33
36
|
this.renderedExtensions.forEach((extension) => {
|
|
34
37
|
if (!!extension.destroy)
|
|
@@ -93,8 +96,7 @@ TableExtensions.registerExtension({
|
|
|
93
96
|
name: "details",
|
|
94
97
|
visibleIndex: 0,
|
|
95
98
|
render: (_table, options) => {
|
|
96
|
-
const btn = DocumentHelper.createSvgButton("
|
|
97
|
-
btn.title = localization.getString("showMinorColumns");
|
|
99
|
+
const btn = DocumentHelper.createSvgButton("more-24x24", localization.getString("showMinorColumns"));
|
|
98
100
|
btn.className += " sa-table__row-extension";
|
|
99
101
|
btn.onclick = () => {
|
|
100
102
|
options.row.toggleDetails();
|
|
@@ -107,121 +109,95 @@ TableExtensions.registerExtension({
|
|
|
107
109
|
name: "select",
|
|
108
110
|
visibleIndex: -1,
|
|
109
111
|
render: function (_table, opt) {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
checkbox.checked = row.getIsSelected();
|
|
115
|
-
checkbox.onchange = function () {
|
|
112
|
+
const itemClassSelected = "sa-checkbox--checked";
|
|
113
|
+
const row = opt.row;
|
|
114
|
+
const iconContainer = DocumentHelper.createSvgButton("check-24x24");
|
|
115
|
+
iconContainer.onclick = () => {
|
|
116
116
|
row.toggleSelect();
|
|
117
|
+
if (row.getIsSelected()) {
|
|
118
|
+
iconContainer.classList.add(itemClassSelected);
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
iconContainer.classList.remove(itemClassSelected);
|
|
122
|
+
}
|
|
117
123
|
};
|
|
118
|
-
|
|
124
|
+
iconContainer.className = "sa-checkbox sa-table__row-extension";
|
|
125
|
+
if (row.getIsSelected()) {
|
|
126
|
+
iconContainer.classList.add(itemClassSelected);
|
|
127
|
+
}
|
|
128
|
+
// var checkbox = <HTMLInputElement>DocumentHelper.createElement(
|
|
129
|
+
// "input",
|
|
130
|
+
// "sa-table__row-extension",
|
|
131
|
+
// {
|
|
132
|
+
// type: "checkbox",
|
|
133
|
+
// }
|
|
134
|
+
// );
|
|
135
|
+
// checkbox.checked = row.getIsSelected();
|
|
136
|
+
// checkbox.onchange = function () {
|
|
137
|
+
// row.toggleSelect();
|
|
138
|
+
// };
|
|
139
|
+
return iconContainer;
|
|
119
140
|
},
|
|
120
141
|
});
|
|
121
142
|
|
|
122
143
|
TableExtensions.registerExtension({
|
|
123
144
|
location: "header",
|
|
124
145
|
name: "filter",
|
|
125
|
-
visibleIndex:
|
|
146
|
+
visibleIndex: 1,
|
|
126
147
|
render: function (table) {
|
|
127
|
-
const input = DocumentHelper.createInput(
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
148
|
+
// const input = DocumentHelper.createInput(
|
|
149
|
+
// "sa-table__global-filter sa-table__header-extension",
|
|
150
|
+
// localization.getString("filterPlaceholder")
|
|
151
|
+
// );
|
|
152
|
+
// input.onchange = (event: any) => {
|
|
153
|
+
// table.applyFilter(event.target.value);
|
|
154
|
+
// };
|
|
155
|
+
const el = DocumentHelper.createTextEditor({
|
|
156
|
+
onchange: (val) => { table.applyFilter(val); }
|
|
157
|
+
});
|
|
158
|
+
return el;
|
|
132
159
|
},
|
|
133
160
|
});
|
|
134
161
|
TableExtensions.registerExtension({
|
|
135
162
|
location: "header",
|
|
136
163
|
name: "showcolumn",
|
|
137
|
-
visibleIndex:
|
|
138
|
-
destroy: function () {
|
|
139
|
-
this.onDestroy();
|
|
140
|
-
},
|
|
164
|
+
visibleIndex: 20,
|
|
141
165
|
render: function (table) {
|
|
142
|
-
const dropdown = DocumentHelper.createElement(
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
166
|
+
// const dropdown = DocumentHelper.createElement(
|
|
167
|
+
// "select",
|
|
168
|
+
// "sa-table__show-column sa-table__header-extension"
|
|
169
|
+
// );
|
|
170
|
+
const allColumns = table.columns.map((column) => {
|
|
171
|
+
var text = column.displayName || column.name;
|
|
172
|
+
if (!!text && text.length > 20) {
|
|
173
|
+
text = text.substring(0, 20) + "...";
|
|
148
174
|
}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
selected: true,
|
|
155
|
-
});
|
|
156
|
-
dropdown.appendChild(option);
|
|
157
|
-
hiddenColumns.forEach((column) => {
|
|
158
|
-
var text = column.displayName || column.name;
|
|
159
|
-
if (!!text && text.length > 20) {
|
|
160
|
-
text = text.substring(0, 20) + "...";
|
|
161
|
-
}
|
|
162
|
-
var option = DocumentHelper.createElement("option", "", {
|
|
163
|
-
text: text,
|
|
164
|
-
title: column.displayName,
|
|
165
|
-
value: column.name,
|
|
166
|
-
});
|
|
167
|
-
dropdown.appendChild(option);
|
|
168
|
-
});
|
|
169
|
-
}
|
|
170
|
-
dropdown.onchange = (e) => {
|
|
171
|
-
const val = e.target.value;
|
|
172
|
-
e.stopPropagation();
|
|
173
|
-
if (!val)
|
|
174
|
-
return;
|
|
175
|
-
table.setColumnVisibility(val, true);
|
|
176
|
-
};
|
|
177
|
-
update();
|
|
178
|
-
var onVisibilityChangedCallback = () => {
|
|
179
|
-
update();
|
|
180
|
-
};
|
|
181
|
-
table.onColumnsVisibilityChanged.add(onVisibilityChangedCallback);
|
|
182
|
-
this.onDestroy = () => {
|
|
183
|
-
table.onColumnsVisibilityChanged.remove(onVisibilityChangedCallback);
|
|
184
|
-
};
|
|
185
|
-
return dropdown;
|
|
186
|
-
},
|
|
187
|
-
});
|
|
188
|
-
TableExtensions.registerExtension({
|
|
189
|
-
location: "header",
|
|
190
|
-
name: "showentries",
|
|
191
|
-
visibleIndex: 3,
|
|
192
|
-
render: function (table) {
|
|
193
|
-
if (table.options.paginationEnabled === false) {
|
|
194
|
-
return DocumentHelper.createElement("div");
|
|
195
|
-
}
|
|
196
|
-
function getEntriesDropdown(table) {
|
|
197
|
-
const el = DocumentHelper.createElement("select");
|
|
198
|
-
var optionsValues = table.paginationSizeSelector || ["1", "5", "10", "25", "50", "75", "100"];
|
|
199
|
-
optionsValues.forEach(function (val) {
|
|
200
|
-
var option = DocumentHelper.createElement("option", "", {
|
|
201
|
-
value: val,
|
|
202
|
-
text: val,
|
|
203
|
-
});
|
|
204
|
-
el.appendChild(option);
|
|
205
|
-
});
|
|
206
|
-
el.value = String(table.getPageSize());
|
|
207
|
-
el.onchange = () => {
|
|
208
|
-
table.setPageSize(Number(el.value));
|
|
175
|
+
return {
|
|
176
|
+
value: column.name,
|
|
177
|
+
text: text,
|
|
178
|
+
title: column.displayName || column.name,
|
|
179
|
+
icon: "check-24x24"
|
|
209
180
|
};
|
|
210
|
-
return el;
|
|
211
|
-
}
|
|
212
|
-
const selectorContainer = DocumentHelper.createElement("div", "sa-table__entries");
|
|
213
|
-
const spaceSpan = DocumentHelper.createElement("span", "sa-table__header-space");
|
|
214
|
-
const showSpan = DocumentHelper.createElement("span", "sa-table__entries-label sa-table__entries-label--right", {
|
|
215
|
-
innerText: localization.getString("showLabel"),
|
|
216
181
|
});
|
|
217
|
-
const
|
|
218
|
-
|
|
182
|
+
const dropdown = DocumentHelper.createActionDropdown({
|
|
183
|
+
options: allColumns,
|
|
184
|
+
isSelected: (option) => {
|
|
185
|
+
const hiddenColumns = table.columns.filter((column) => !column.isVisible);
|
|
186
|
+
return hiddenColumns.length === 0 || hiddenColumns.filter(el => el.name === option.value).length === 0;
|
|
187
|
+
},
|
|
188
|
+
handler: (e) => {
|
|
189
|
+
if (!!e) {
|
|
190
|
+
if (!e)
|
|
191
|
+
return;
|
|
192
|
+
const column = table.columns.filter((column) => column.name === e)[0];
|
|
193
|
+
table.setColumnVisibility(e, !column.isVisible);
|
|
194
|
+
return false;
|
|
195
|
+
}
|
|
196
|
+
},
|
|
197
|
+
title: localization.getString("columns")
|
|
219
198
|
});
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
selectorContainer.appendChild(getEntriesDropdown(table));
|
|
223
|
-
selectorContainer.appendChild(entriesSpan);
|
|
224
|
-
return selectorContainer;
|
|
199
|
+
dropdown.className += " sa-table__show-column sa-table__header-extension";
|
|
200
|
+
return dropdown;
|
|
225
201
|
},
|
|
226
202
|
});
|
|
227
203
|
TableExtensions.registerExtension({
|
|
@@ -229,41 +205,126 @@ TableExtensions.registerExtension({
|
|
|
229
205
|
name: "removerows",
|
|
230
206
|
visibleIndex: -1,
|
|
231
207
|
render: function (table) {
|
|
232
|
-
|
|
233
|
-
btn.onclick = function () {
|
|
208
|
+
const btn = DocumentHelper.createButton((e) => {
|
|
234
209
|
table.getCreatedRows().forEach(function (row) {
|
|
235
210
|
if (row.getIsSelected()) {
|
|
236
211
|
row.remove();
|
|
237
212
|
}
|
|
238
213
|
});
|
|
239
|
-
};
|
|
214
|
+
}, localization.getString("removeRows"), "sa-button");
|
|
215
|
+
btn.className += " sa-table__header-extension sa-button-brand-tertiary";
|
|
240
216
|
return btn;
|
|
217
|
+
// var btn = DocumentHelper.createElement(
|
|
218
|
+
// "button",
|
|
219
|
+
// "sa-table__btn sa-table__header-extension ",
|
|
220
|
+
// { innerText: localization.getString("removeRows") }
|
|
221
|
+
// );
|
|
222
|
+
// btn.onclick = function () {
|
|
223
|
+
// table.getCreatedRows().forEach(function (row) {
|
|
224
|
+
// if (row.getIsSelected()) {
|
|
225
|
+
// row.remove();
|
|
226
|
+
// }
|
|
227
|
+
// });
|
|
228
|
+
// };
|
|
229
|
+
// return btn;
|
|
241
230
|
},
|
|
242
231
|
});
|
|
243
232
|
TableExtensions.registerExtension({
|
|
244
233
|
location: "header",
|
|
245
234
|
name: "changelocale",
|
|
246
|
-
visibleIndex:
|
|
235
|
+
visibleIndex: 40,
|
|
247
236
|
render: function (table) {
|
|
248
237
|
var locales = table.getLocales();
|
|
249
238
|
if (table.options.disableLocaleSwitch || locales.length < 2)
|
|
250
239
|
return null;
|
|
251
|
-
|
|
240
|
+
/*
|
|
241
|
+
const el = <HTMLSelectElement>(
|
|
242
|
+
DocumentHelper.createElement("select", "sa-table__header-extension", {})
|
|
243
|
+
);
|
|
252
244
|
var optionsValues = [localization.getString("changeLocale")].concat(locales);
|
|
253
245
|
optionsValues.forEach(function (val) {
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
246
|
+
var option = DocumentHelper.createElement("option", "", {
|
|
247
|
+
value: val,
|
|
248
|
+
text: localization.localeNames[val] || localization.getString(val) || val,
|
|
249
|
+
});
|
|
250
|
+
el.appendChild(option);
|
|
259
251
|
});
|
|
260
252
|
el.onchange = () => {
|
|
261
|
-
|
|
253
|
+
table.locale = el.value;
|
|
262
254
|
};
|
|
255
|
+
*/
|
|
256
|
+
const optionsValues = locales.map(val => { return { value: val, text: localization.localeNames[val] || localization.getString(val) || val }; });
|
|
257
|
+
const el = DocumentHelper.createActionDropdown({
|
|
258
|
+
options: optionsValues,
|
|
259
|
+
isSelected: (option) => false,
|
|
260
|
+
handler: (e) => {
|
|
261
|
+
if (!!e) {
|
|
262
|
+
table.locale = e;
|
|
263
|
+
}
|
|
264
|
+
return true;
|
|
265
|
+
},
|
|
266
|
+
title: () => localization.getString("changeLocale"),
|
|
267
|
+
});
|
|
268
|
+
el.className += " sa-table__header-extension";
|
|
263
269
|
return el;
|
|
264
270
|
},
|
|
265
271
|
});
|
|
266
272
|
|
|
273
|
+
TableExtensions.registerExtension({
|
|
274
|
+
location: "footer",
|
|
275
|
+
name: "showentries",
|
|
276
|
+
visibleIndex: 30,
|
|
277
|
+
render: function (table) {
|
|
278
|
+
if (table.options.paginationEnabled === false) {
|
|
279
|
+
return DocumentHelper.createElement("div");
|
|
280
|
+
}
|
|
281
|
+
function getEntriesDropdown(table) {
|
|
282
|
+
/*
|
|
283
|
+
const el = <HTMLSelectElement>DocumentHelper.createElement("select");
|
|
284
|
+
var optionsValues = table.paginationSizeSelector || ["1", "5", "10", "25", "50", "75", "100"];
|
|
285
|
+
optionsValues.forEach(function (val) {
|
|
286
|
+
var option = DocumentHelper.createElement("option", "", {
|
|
287
|
+
value: val,
|
|
288
|
+
text: val,
|
|
289
|
+
});
|
|
290
|
+
el.appendChild(option);
|
|
291
|
+
});
|
|
292
|
+
el.value = String(table.getPageSize());
|
|
293
|
+
|
|
294
|
+
el.onchange = () => {
|
|
295
|
+
table.setPageSize(Number(el.value));
|
|
296
|
+
};
|
|
297
|
+
|
|
298
|
+
return el;
|
|
299
|
+
*/
|
|
300
|
+
const optionsValues = table.paginationSizeSelector || ["1", "5", "10", "25", "50", "75", "100"];
|
|
301
|
+
const el = DocumentHelper.createActionDropdown({
|
|
302
|
+
options: optionsValues.map(val => { return { value: val, text: val }; }),
|
|
303
|
+
isSelected: (option) => {
|
|
304
|
+
return option.value === table.getPageSize();
|
|
305
|
+
},
|
|
306
|
+
handler: (e) => {
|
|
307
|
+
if (e !== undefined && e !== null) {
|
|
308
|
+
table.setPageSize(Number(e));
|
|
309
|
+
}
|
|
310
|
+
return true;
|
|
311
|
+
},
|
|
312
|
+
title: () => { return String(table.getPageSize()); },
|
|
313
|
+
direction: "up"
|
|
314
|
+
});
|
|
315
|
+
el.className += " sa-table__entries-value";
|
|
316
|
+
return el;
|
|
317
|
+
}
|
|
318
|
+
const selectorContainer = DocumentHelper.createElement("div", "sa-table__entries");
|
|
319
|
+
const showSpan = DocumentHelper.createElement("span", "sa-table__entries-label sa-table__entries-label--right", {
|
|
320
|
+
innerText: localization.getString("entriesOnPageLabel"),
|
|
321
|
+
});
|
|
322
|
+
selectorContainer.appendChild(showSpan);
|
|
323
|
+
selectorContainer.appendChild(getEntriesDropdown(table));
|
|
324
|
+
return selectorContainer;
|
|
325
|
+
},
|
|
326
|
+
});
|
|
327
|
+
|
|
267
328
|
var QuestionLocation;
|
|
268
329
|
(function (QuestionLocation) {
|
|
269
330
|
QuestionLocation[QuestionLocation["Column"] = 0] = "Column";
|
|
@@ -279,10 +340,16 @@ var ColumnDataType;
|
|
|
279
340
|
TableExtensions.registerExtension({
|
|
280
341
|
location: "column",
|
|
281
342
|
name: "drag",
|
|
282
|
-
visibleIndex:
|
|
343
|
+
visibleIndex: 10,
|
|
283
344
|
render: function (table, options) {
|
|
284
|
-
const btn = DocumentHelper.
|
|
285
|
-
btn.
|
|
345
|
+
const btn = DocumentHelper.createSvgButton("drag-24x24");
|
|
346
|
+
btn.className = "sa-table__svg-button sa-table__drag-button";
|
|
347
|
+
btn.title = localization.getString("columnReorder");
|
|
348
|
+
// const btn = DocumentHelper.createElement(
|
|
349
|
+
// "button",
|
|
350
|
+
// "sa-table__svg-button sa-table__drag-button"
|
|
351
|
+
// );
|
|
352
|
+
// btn.appendChild(DocumentHelper.createSvgElement("drag-24x24"));
|
|
286
353
|
btn.addEventListener("mousedown", () => {
|
|
287
354
|
table.enableColumnReorder();
|
|
288
355
|
document.body.addEventListener("mouseup", () => {
|
|
@@ -295,12 +362,12 @@ TableExtensions.registerExtension({
|
|
|
295
362
|
TableExtensions.registerExtension({
|
|
296
363
|
location: "column",
|
|
297
364
|
name: "sort",
|
|
298
|
-
visibleIndex:
|
|
365
|
+
visibleIndex: 20,
|
|
299
366
|
render: function (table, options) {
|
|
300
367
|
const descTitle = localization.getString("descOrder");
|
|
301
368
|
const ascTitle = localization.getString("ascOrder");
|
|
302
|
-
var btn = DocumentHelper.createSvgButton("
|
|
303
|
-
btn.title = "";
|
|
369
|
+
var btn = DocumentHelper.createSvgButton("reorder-24x24");
|
|
370
|
+
btn.title = localization.getString("defaultOrder");
|
|
304
371
|
var direction = "asc";
|
|
305
372
|
btn.onclick = () => {
|
|
306
373
|
if (direction == "asc") {
|
|
@@ -322,10 +389,9 @@ TableExtensions.registerExtension({
|
|
|
322
389
|
TableExtensions.registerExtension({
|
|
323
390
|
location: "column",
|
|
324
391
|
name: "hide",
|
|
325
|
-
visibleIndex:
|
|
392
|
+
visibleIndex: 30,
|
|
326
393
|
render: function (table, options) {
|
|
327
|
-
var btn = DocumentHelper.createSvgButton("
|
|
328
|
-
btn.title = localization.getString("hideColumn");
|
|
394
|
+
var btn = DocumentHelper.createSvgButton("invisible-24x24", localization.getString("hideColumn"));
|
|
329
395
|
btn.onclick = () => {
|
|
330
396
|
table.setColumnVisibility(options.columnName, false);
|
|
331
397
|
};
|
|
@@ -335,10 +401,9 @@ TableExtensions.registerExtension({
|
|
|
335
401
|
TableExtensions.registerExtension({
|
|
336
402
|
location: "column",
|
|
337
403
|
name: "movetodetails",
|
|
338
|
-
visibleIndex:
|
|
404
|
+
visibleIndex: 10,
|
|
339
405
|
render: function (table, options) {
|
|
340
|
-
const button = DocumentHelper.createSvgButton("
|
|
341
|
-
button.title = localization.getString("moveToDetail");
|
|
406
|
+
const button = DocumentHelper.createSvgButton("movetohorizontal-24x24", localization.getString("moveToDetail"));
|
|
342
407
|
button.onclick = (e) => {
|
|
343
408
|
e.stopPropagation();
|
|
344
409
|
table.setColumnLocation(options.columnName, QuestionLocation.Row);
|
|
@@ -347,15 +412,23 @@ TableExtensions.registerExtension({
|
|
|
347
412
|
},
|
|
348
413
|
});
|
|
349
414
|
TableExtensions.registerExtension({
|
|
350
|
-
location: "
|
|
415
|
+
location: "columnfilter",
|
|
351
416
|
name: "filter",
|
|
352
|
-
visibleIndex:
|
|
417
|
+
visibleIndex: 10,
|
|
353
418
|
render: function (table, options) {
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
419
|
+
const el = DocumentHelper.createTextEditor({
|
|
420
|
+
showIcon: false,
|
|
421
|
+
onchange: (val) => {
|
|
422
|
+
table.applyColumnFilter(options.columnName, val);
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
// "sa-table__filter",
|
|
426
|
+
// localization.getString("filterPlaceholder")
|
|
427
|
+
);
|
|
428
|
+
// el.onclick = (e) => e.stopPropagation();
|
|
429
|
+
// el.onchange = (e) => {
|
|
430
|
+
// table.applyColumnFilter(options.columnName, el.value);
|
|
431
|
+
// };
|
|
359
432
|
return el;
|
|
360
433
|
},
|
|
361
434
|
});
|
|
@@ -403,8 +476,9 @@ class Details {
|
|
|
403
476
|
this.targetNode = targetNode;
|
|
404
477
|
this.location = "details";
|
|
405
478
|
this.createShowAsColumnButton = (columnName) => {
|
|
406
|
-
const button = DocumentHelper.
|
|
407
|
-
button
|
|
479
|
+
const button = DocumentHelper.createSvgButton("movetovertical-24x24", localization.getString("showAsColumn"));
|
|
480
|
+
// "button",
|
|
481
|
+
// "sa-table__btn sa-table__btn--gray"
|
|
408
482
|
button.onclick = (e) => {
|
|
409
483
|
e.stopPropagation();
|
|
410
484
|
this.table.setColumnLocation(columnName, QuestionLocation.Column);
|
|
@@ -428,16 +502,20 @@ class Details {
|
|
|
428
502
|
var td2 = DocumentHelper.createElement("td");
|
|
429
503
|
td2.textContent = this.row.getRowData()[column.name];
|
|
430
504
|
if (column.dataType === ColumnDataType.Image) {
|
|
431
|
-
|
|
505
|
+
const imageElement = DocumentHelper.createElement("img", "", {
|
|
506
|
+
src: td2.textContent
|
|
507
|
+
});
|
|
508
|
+
td2.innerHTML = "";
|
|
509
|
+
td2.appendChild(imageElement);
|
|
432
510
|
}
|
|
433
511
|
var td3 = DocumentHelper.createElement("td");
|
|
434
512
|
td3.appendChild(this.createShowAsColumnButton(column.name));
|
|
513
|
+
row.appendChild(td3);
|
|
435
514
|
row.appendChild(td1);
|
|
436
515
|
row.appendChild(td2);
|
|
437
|
-
row.appendChild(td3);
|
|
438
516
|
rows.push(row);
|
|
439
517
|
});
|
|
440
|
-
var row = DocumentHelper.createElement("tr", "sa-table__detail");
|
|
518
|
+
var row = DocumentHelper.createElement("tr", "sa-table__detail sa-table-detail__actions");
|
|
441
519
|
var td = DocumentHelper.createElement("td", "", { colSpan: 3 });
|
|
442
520
|
var extensions = new TableExtensions(this.table);
|
|
443
521
|
extensions.render(td, "details", { row: this.row });
|
|
@@ -1284,8 +1362,8 @@ const defaultDownloadOptions = {
|
|
|
1284
1362
|
};
|
|
1285
1363
|
const defaultOptions = {
|
|
1286
1364
|
tabulatorOptions: {},
|
|
1287
|
-
actionsColumnWidth:
|
|
1288
|
-
columnMinWidth:
|
|
1365
|
+
actionsColumnWidth: 56,
|
|
1366
|
+
columnMinWidth: 384,
|
|
1289
1367
|
downloadHiddenColumns: false,
|
|
1290
1368
|
downloadButtons: ["csv"],
|
|
1291
1369
|
downloadOptions: defaultDownloadOptions,
|
|
@@ -1318,8 +1396,13 @@ class Tabulator extends Table {
|
|
|
1318
1396
|
static set haveCommercialLicense(val) {
|
|
1319
1397
|
Table.haveCommercialLicense = val;
|
|
1320
1398
|
}
|
|
1399
|
+
afterRender(contentContainer) {
|
|
1400
|
+
this.onAfterRender.fire(this, { htmlElement: contentContainer });
|
|
1401
|
+
}
|
|
1321
1402
|
constructor(survey, data, options, _columnsData = []) {
|
|
1322
1403
|
super(survey, data, options, _columnsData);
|
|
1404
|
+
this._theme = new DashboardTheme();
|
|
1405
|
+
this.onAfterRender = new Event();
|
|
1323
1406
|
this.COLUMN_MIN_WIDTH = 155;
|
|
1324
1407
|
this.tabulatorTables = null;
|
|
1325
1408
|
this.tableContainer = null;
|
|
@@ -1330,7 +1413,8 @@ class Tabulator extends Table {
|
|
|
1330
1413
|
};
|
|
1331
1414
|
this.columnMovedCallback = (column, columns) => {
|
|
1332
1415
|
var from = this._columns.indexOf(this.getColumnByName(column.getField()));
|
|
1333
|
-
|
|
1416
|
+
const rowExtensions = TableExtensions.getExtensions("row").filter(e => e.visibleIndex >= 0);
|
|
1417
|
+
var to = columns.indexOf(column) - rowExtensions.length;
|
|
1334
1418
|
this.moveColumn(from, to);
|
|
1335
1419
|
this.disableColumnReorder();
|
|
1336
1420
|
};
|
|
@@ -1390,13 +1474,25 @@ class Tabulator extends Table {
|
|
|
1390
1474
|
targetNode = document.getElementById(targetNode);
|
|
1391
1475
|
}
|
|
1392
1476
|
targetNode.className += " sa-table sa-tabulator";
|
|
1477
|
+
if (!this._appliedTheme) {
|
|
1478
|
+
this._appliedTheme = this.theme;
|
|
1479
|
+
}
|
|
1480
|
+
if (this._appliedTheme) {
|
|
1481
|
+
this._appliedTheme.applyThemeToElement(targetNode);
|
|
1482
|
+
}
|
|
1393
1483
|
const columns = this.getColumns();
|
|
1394
1484
|
const data = this.tableData;
|
|
1485
|
+
var wrapper = DocumentHelper.createElement("div", "sa-tabulator__wrapper");
|
|
1486
|
+
var container = DocumentHelper.createElement("div", "sa-tabulator__container");
|
|
1395
1487
|
var header = DocumentHelper.createElement("div", "sa-tabulator__header");
|
|
1488
|
+
var footer = DocumentHelper.createElement("div", "sa-tabulator__footer");
|
|
1396
1489
|
var paginationElement = DocumentHelper.createElement("div", "sa-tabulator__pagination-container");
|
|
1397
|
-
this.tableContainer = DocumentHelper.createElement("div");
|
|
1398
|
-
|
|
1399
|
-
|
|
1490
|
+
this.tableContainer = DocumentHelper.createElement("div", "sa-tabulator__table-container");
|
|
1491
|
+
container.appendChild(header);
|
|
1492
|
+
container.appendChild(this.tableContainer);
|
|
1493
|
+
container.appendChild(footer);
|
|
1494
|
+
wrapper.appendChild(container);
|
|
1495
|
+
targetNode.appendChild(wrapper);
|
|
1400
1496
|
var config = {};
|
|
1401
1497
|
Object.assign(config, {
|
|
1402
1498
|
data,
|
|
@@ -1405,7 +1501,7 @@ class Tabulator extends Table {
|
|
|
1405
1501
|
paginationMode: "local",
|
|
1406
1502
|
paginationSize: this.currentPageSize,
|
|
1407
1503
|
movableColumns: true,
|
|
1408
|
-
|
|
1504
|
+
maxHeight: "50vw",
|
|
1409
1505
|
columns,
|
|
1410
1506
|
rowFormatter: this.rowFormatter,
|
|
1411
1507
|
paginationElement: paginationElement,
|
|
@@ -1463,38 +1559,77 @@ class Tabulator extends Table {
|
|
|
1463
1559
|
this.tabulatorTables = new Tabulator.tabulatorTablesConstructor(this.tableContainer, config);
|
|
1464
1560
|
this.tabulatorTables.on("columnResized", this.columnResizedCallback);
|
|
1465
1561
|
this.tabulatorTables.on("columnMoved", this.columnMovedCallback);
|
|
1466
|
-
|
|
1562
|
+
this.tabulatorTables.on("tableBuilt", () => {
|
|
1563
|
+
this.renderResult = targetNode;
|
|
1564
|
+
this.afterRender(targetNode);
|
|
1565
|
+
});
|
|
1566
|
+
const extensionsContainer = DocumentHelper.createElement("div", "sa-table__header-extensions");
|
|
1567
|
+
this.extensions.render(extensionsContainer, "header");
|
|
1568
|
+
header.appendChild(extensionsContainer);
|
|
1467
1569
|
header.appendChild(this.createDownloadsBar());
|
|
1468
|
-
this.extensions.render(
|
|
1469
|
-
|
|
1470
|
-
header.appendChild(paginationElement);
|
|
1570
|
+
this.extensions.render(footer, "footer");
|
|
1571
|
+
footer.appendChild(paginationElement);
|
|
1471
1572
|
this.renderResult = targetNode;
|
|
1472
1573
|
}
|
|
1473
1574
|
createDownloadsBar() {
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1575
|
+
/*
|
|
1576
|
+
var createDownloadButton = (type: DownloadType, caption: string): HTMLElement => {
|
|
1577
|
+
const btn = DocumentHelper.createElement(
|
|
1578
|
+
"button",
|
|
1579
|
+
"sa-table__btn sa-table__btn--small sa-table__btn--gray",
|
|
1580
|
+
{
|
|
1581
|
+
innerText: caption,
|
|
1582
|
+
onclick: () => {
|
|
1583
|
+
this.download(type);
|
|
1584
|
+
},
|
|
1585
|
+
}
|
|
1586
|
+
);
|
|
1587
|
+
return btn;
|
|
1482
1588
|
};
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1589
|
+
|
|
1590
|
+
var container = DocumentHelper.createElement(
|
|
1591
|
+
"div",
|
|
1592
|
+
"sa-tabulator__downloads-bar"
|
|
1593
|
+
);
|
|
1594
|
+
|
|
1595
|
+
this._options.downloadButtons.forEach((type: DownloadType) => {
|
|
1596
|
+
container.appendChild(
|
|
1597
|
+
createDownloadButton(
|
|
1598
|
+
type,
|
|
1599
|
+
localization.getString(`${type}DownloadCaption`)
|
|
1600
|
+
)
|
|
1601
|
+
);
|
|
1486
1602
|
});
|
|
1487
1603
|
return container;
|
|
1604
|
+
*/
|
|
1605
|
+
const values = this._options.downloadButtons.map(val => { return { value: val, text: localization.getString(`${val}DownloadCaption`) }; });
|
|
1606
|
+
const exportAsAction = DocumentHelper.createActionDropdown({
|
|
1607
|
+
options: values,
|
|
1608
|
+
isSelected: (option) => false,
|
|
1609
|
+
handler: (e) => {
|
|
1610
|
+
if (!!e) {
|
|
1611
|
+
this.download(e);
|
|
1612
|
+
}
|
|
1613
|
+
return true;
|
|
1614
|
+
},
|
|
1615
|
+
title: localization.getString("exportAs"),
|
|
1616
|
+
showArrow: false
|
|
1617
|
+
});
|
|
1618
|
+
exportAsAction.className += " sa-tabulator__downloads-bar sa-button-brand-secondary";
|
|
1619
|
+
return exportAsAction;
|
|
1488
1620
|
}
|
|
1489
1621
|
getTitleFormatter(cell, formatterParams, onRendered, columnName) {
|
|
1490
|
-
var container = DocumentHelper.createElement("div");
|
|
1491
|
-
var title = DocumentHelper.createElement("span", "", {
|
|
1622
|
+
var container = DocumentHelper.createElement("div", "sa-tabulator-column-header");
|
|
1623
|
+
var title = DocumentHelper.createElement("span", "sa-tabulator-column-title-text", {
|
|
1492
1624
|
innerText: cell.getValue(),
|
|
1493
1625
|
});
|
|
1494
|
-
|
|
1495
|
-
|
|
1626
|
+
const actionContainer = this.getHeaderActions(columnName);
|
|
1627
|
+
const containerFilter = DocumentHelper.createElement("div", "sa-table__filter-container");
|
|
1628
|
+
this.extensions.render(containerFilter, "columnfilter", { columnName: columnName });
|
|
1629
|
+
container.appendChild(actionContainer);
|
|
1496
1630
|
container.appendChild(title);
|
|
1497
|
-
|
|
1631
|
+
container.appendChild(containerFilter);
|
|
1632
|
+
["mousemove", "mousedown"].forEach(eventName => actionContainer.addEventListener(eventName, (event) => {
|
|
1498
1633
|
if (!this.isColumnReorderEnabled) {
|
|
1499
1634
|
event.stopPropagation();
|
|
1500
1635
|
}
|
|
@@ -1533,20 +1668,22 @@ class Tabulator extends Table {
|
|
|
1533
1668
|
},
|
|
1534
1669
|
};
|
|
1535
1670
|
});
|
|
1536
|
-
|
|
1671
|
+
const rowExtensions = TableExtensions.getExtensions("row").filter(e => e.visibleIndex >= 0);
|
|
1537
1672
|
// const detailsExtension = TableExtensions.getExtensions("details").filter(e => e.visibleIndex >= 0);
|
|
1538
1673
|
// const hasRowColumns = this.columns.some(c => c.location === QuestionLocation.Row);
|
|
1539
1674
|
// if(rowExtensions.length > 1 || detailsExtension.length > 0
|
|
1540
1675
|
// || rowExtensions.length == 1 && (rowExtensions[0].name == "details" && hasRowColumns || rowExtensions[0].name != "details")) {
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1676
|
+
rowExtensions.forEach(ext => {
|
|
1677
|
+
columns.unshift({
|
|
1678
|
+
download: false,
|
|
1679
|
+
resizable: false,
|
|
1680
|
+
headerSort: false,
|
|
1681
|
+
minWidth: this._options.actionsColumnWidth,
|
|
1682
|
+
width: this._options.actionsColumnWidth,
|
|
1683
|
+
tooltip: (_, cell) => {
|
|
1684
|
+
return undefined;
|
|
1685
|
+
}
|
|
1686
|
+
});
|
|
1550
1687
|
});
|
|
1551
1688
|
// }
|
|
1552
1689
|
return columns;
|
|
@@ -1644,6 +1781,20 @@ class Tabulator extends Table {
|
|
|
1644
1781
|
dataItem["surveyOriginalData"] = item;
|
|
1645
1782
|
return dataItem;
|
|
1646
1783
|
}
|
|
1784
|
+
get theme() {
|
|
1785
|
+
return this._theme;
|
|
1786
|
+
}
|
|
1787
|
+
set theme(theme) {
|
|
1788
|
+
this._theme = theme;
|
|
1789
|
+
this._appliedTheme = undefined;
|
|
1790
|
+
}
|
|
1791
|
+
applyTheme(theme) {
|
|
1792
|
+
this.theme.setTheme(theme);
|
|
1793
|
+
this._appliedTheme = this.theme;
|
|
1794
|
+
if (this.renderResult) {
|
|
1795
|
+
this._appliedTheme.applyThemeToElement(this.renderResult);
|
|
1796
|
+
}
|
|
1797
|
+
}
|
|
1647
1798
|
}
|
|
1648
1799
|
class TabulatorRow extends TableRow {
|
|
1649
1800
|
constructor(table, extensionsContainer, detailsContainer, innerRow) {
|
|
@@ -1666,6 +1817,17 @@ class TabulatorRow extends TableRow {
|
|
|
1666
1817
|
}
|
|
1667
1818
|
return null;
|
|
1668
1819
|
}
|
|
1820
|
+
render() {
|
|
1821
|
+
let rowExtensions = TableExtensions.getExtensions("row").filter(e => e.visibleIndex >= 0);
|
|
1822
|
+
rowExtensions = this.extensions.sortExtensions(rowExtensions);
|
|
1823
|
+
rowExtensions.forEach((rowExt, index) => {
|
|
1824
|
+
const cellAction = this.innerRow.getCells()[index].getElement();
|
|
1825
|
+
cellAction.innerHTML = "";
|
|
1826
|
+
this.extensions.renderExtension(rowExt, cellAction, { row: this });
|
|
1827
|
+
cellAction.classList.add("sa-tabulator-cell__action");
|
|
1828
|
+
cellAction.classList.add("sa-tabulator-cell__action-" + rowExt.name.toLowerCase());
|
|
1829
|
+
});
|
|
1830
|
+
}
|
|
1669
1831
|
remove() {
|
|
1670
1832
|
this.innerRow.delete();
|
|
1671
1833
|
super.remove();
|