survey-analytics 2.3.7 → 2.3.9
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 +61 -38
- package/fesm/shared2.mjs.map +1 -1
- package/fesm/survey.analytics.core.mjs +1 -1
- package/fesm/survey.analytics.mjs +1 -1
- package/fesm/survey.analytics.mongo.mjs +221 -0
- package/fesm/survey.analytics.mongo.mjs.map +1 -0
- package/fesm/survey.analytics.tabulator.mjs +37 -2
- package/fesm/survey.analytics.tabulator.mjs.map +1 -1
- package/package.json +12 -3
- package/survey-analytics-tabulator.types/entries/tabulator.d.ts +2 -0
- package/survey-analytics-tabulator.types/tables/columnbuilder.d.ts +3 -0
- package/survey-analytics.types/visualizationComposite.d.ts +1 -1
- package/survey-analytics.types/visualizationPanel.d.ts +6 -0
- package/survey-analytics.types/visualizerBase.d.ts +5 -0
- package/survey.analytics.core.css +1 -1
- package/survey.analytics.core.js +66 -39
- package/survey.analytics.core.js.map +1 -1
- package/survey.analytics.core.min.css +1 -1
- package/survey.analytics.core.min.js +1 -1
- package/survey.analytics.core.min.js.LICENSE.txt +1 -1
- package/survey.analytics.css +1 -1
- package/survey.analytics.js +66 -39
- package/survey.analytics.js.map +1 -1
- package/survey.analytics.min.css +1 -1
- package/survey.analytics.min.js +1 -1
- package/survey.analytics.min.js.LICENSE.txt +1 -1
- package/survey.analytics.mongo.js +359 -0
- package/survey.analytics.mongo.js.map +1 -0
- package/survey.analytics.mongo.min.js +2 -0
- package/survey.analytics.mongo.min.js.LICENSE.txt +5 -0
- package/survey.analytics.tabulator.css +1 -1
- package/survey.analytics.tabulator.js +80 -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
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* surveyjs - SurveyJS Dashboard library v2.3.9
|
|
3
|
+
* Copyright (c) 2015-2025 Devsoft Baltic OÜ - http://surveyjs.io/
|
|
4
|
+
* License: MIT (http://www.opensource.org/licenses/mit-license.php)
|
|
5
|
+
*/
|
|
6
|
+
(function webpackUniversalModuleDefinition(root, factory) {
|
|
7
|
+
if(typeof exports === 'object' && typeof module === 'object')
|
|
8
|
+
module.exports = factory();
|
|
9
|
+
else if(typeof define === 'function' && define.amd)
|
|
10
|
+
define("SurveyAnalyticsMongo", [], factory);
|
|
11
|
+
else if(typeof exports === 'object')
|
|
12
|
+
exports["SurveyAnalyticsMongo"] = factory();
|
|
13
|
+
else
|
|
14
|
+
root["SurveyAnalyticsMongo"] = factory();
|
|
15
|
+
})(this, () => {
|
|
16
|
+
return /******/ (() => { // webpackBootstrap
|
|
17
|
+
/******/ "use strict";
|
|
18
|
+
/******/ var __webpack_modules__ = ({
|
|
19
|
+
|
|
20
|
+
/***/ "./src/mongo/index.ts":
|
|
21
|
+
/*!****************************!*\
|
|
22
|
+
!*** ./src/mongo/index.ts ***!
|
|
23
|
+
\****************************/
|
|
24
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
25
|
+
|
|
26
|
+
__webpack_require__.r(__webpack_exports__);
|
|
27
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
28
|
+
/* harmony export */ MongoDbAdapter: () => (/* binding */ MongoDbAdapter)
|
|
29
|
+
/* harmony export */ });
|
|
30
|
+
/* harmony import */ var _result_transformers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./result-transformers */ "./src/mongo/result-transformers.ts");
|
|
31
|
+
/* harmony import */ var _pipelines__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./pipelines */ "./src/mongo/pipelines.ts");
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
var MongoDbAdapter = /** @class */ (function () {
|
|
35
|
+
function MongoDbAdapter(db, getId) {
|
|
36
|
+
this.db = db;
|
|
37
|
+
this.getId = getId;
|
|
38
|
+
}
|
|
39
|
+
MongoDbAdapter.prototype.create = function (collectionName, object) {
|
|
40
|
+
var _this = this;
|
|
41
|
+
object.id = object.id || this.getId();
|
|
42
|
+
return new Promise(function (resolve, reject) {
|
|
43
|
+
_this.db.collection(collectionName).insertOne(object)
|
|
44
|
+
.then(function (results) {
|
|
45
|
+
resolve(object.id);
|
|
46
|
+
})
|
|
47
|
+
.catch(function (e) {
|
|
48
|
+
reject(JSON.stringify(e));
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
MongoDbAdapter.prototype.retrieve = function (collectionName, filter) {
|
|
53
|
+
var _this = this;
|
|
54
|
+
filter = filter || [];
|
|
55
|
+
var query = {};
|
|
56
|
+
filter.forEach(function (fi) { return query[fi.field] = fi.value; });
|
|
57
|
+
return new Promise(function (resolve, reject) {
|
|
58
|
+
_this.db.collection(collectionName).find(query).toArray()
|
|
59
|
+
.then(function (results) {
|
|
60
|
+
resolve(results);
|
|
61
|
+
})
|
|
62
|
+
.catch(function (e) {
|
|
63
|
+
reject(JSON.stringify(e));
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
};
|
|
67
|
+
MongoDbAdapter.prototype.update = function (collectionName, object) {
|
|
68
|
+
var _this = this;
|
|
69
|
+
return new Promise(function (resolve, reject) {
|
|
70
|
+
_this.db.collection(collectionName).updateOne({ id: object.id }, { $set: object })
|
|
71
|
+
.then(function (results) {
|
|
72
|
+
resolve(results);
|
|
73
|
+
})
|
|
74
|
+
.catch(function (e) {
|
|
75
|
+
reject(JSON.stringify(e));
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
};
|
|
79
|
+
MongoDbAdapter.prototype.delete = function (collectionName, id) {
|
|
80
|
+
var _this = this;
|
|
81
|
+
return new Promise(function (resolve, reject) {
|
|
82
|
+
_this.db.collection(collectionName).deleteMany({ id: id })
|
|
83
|
+
.then(function (results) {
|
|
84
|
+
resolve(results);
|
|
85
|
+
})
|
|
86
|
+
.catch(function (e) {
|
|
87
|
+
reject(JSON.stringify(e));
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
};
|
|
91
|
+
MongoDbAdapter.prototype.retrievePaginated = function (collectionName, filter, order, offset, limit) {
|
|
92
|
+
var _this = this;
|
|
93
|
+
filter = filter || [];
|
|
94
|
+
var query = {};
|
|
95
|
+
filter.forEach(function (fi) {
|
|
96
|
+
if (!!fi.value) {
|
|
97
|
+
var val = fi.value;
|
|
98
|
+
query[fi.field] = val;
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
var sort = {};
|
|
102
|
+
order.forEach(function (fi) {
|
|
103
|
+
sort[fi.field] = fi.value == "desc" ? -1 : 1;
|
|
104
|
+
});
|
|
105
|
+
return new Promise(function (resolve, reject) {
|
|
106
|
+
_this.db.collection(collectionName).count(query).then(function (count) {
|
|
107
|
+
_this.db.collection(collectionName).find(query).sort(sort).skip(offset).limit(limit).toArray()
|
|
108
|
+
.then(function (results) {
|
|
109
|
+
var result = { data: results, totalCount: count };
|
|
110
|
+
resolve(result);
|
|
111
|
+
})
|
|
112
|
+
.catch(function (e) {
|
|
113
|
+
reject(JSON.stringify(e));
|
|
114
|
+
});
|
|
115
|
+
});
|
|
116
|
+
});
|
|
117
|
+
};
|
|
118
|
+
MongoDbAdapter.prototype.retrieveSummary = function (collectionName, surveyId, questionId, questionType, visualizerType, filter) {
|
|
119
|
+
var _this = this;
|
|
120
|
+
var pipeline = (0,_pipelines__WEBPACK_IMPORTED_MODULE_1__.createPipeline)(surveyId, questionId, visualizerType, questionType);
|
|
121
|
+
return new Promise(function (resolve, reject) {
|
|
122
|
+
_this.db.collection(collectionName).aggregate(pipeline).toArray()
|
|
123
|
+
.then(function (results) {
|
|
124
|
+
var transformer = _result_transformers__WEBPACK_IMPORTED_MODULE_0__.transformers[visualizerType] || _result_transformers__WEBPACK_IMPORTED_MODULE_0__.transformers[questionType] || (function (r) { return r; });
|
|
125
|
+
var result = transformer(results);
|
|
126
|
+
resolve(result);
|
|
127
|
+
})
|
|
128
|
+
.catch(function (e) {
|
|
129
|
+
reject(JSON.stringify(e));
|
|
130
|
+
});
|
|
131
|
+
});
|
|
132
|
+
};
|
|
133
|
+
return MongoDbAdapter;
|
|
134
|
+
}());
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
/***/ }),
|
|
139
|
+
|
|
140
|
+
/***/ "./src/mongo/pipelines.ts":
|
|
141
|
+
/*!********************************!*\
|
|
142
|
+
!*** ./src/mongo/pipelines.ts ***!
|
|
143
|
+
\********************************/
|
|
144
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
145
|
+
|
|
146
|
+
__webpack_require__.r(__webpack_exports__);
|
|
147
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
148
|
+
/* harmony export */ createPipeline: () => (/* binding */ createPipeline)
|
|
149
|
+
/* harmony export */ });
|
|
150
|
+
function createPipeline(surveyId, questionId, visualizerType, questionType) {
|
|
151
|
+
var singleChoicePipeline = [
|
|
152
|
+
{ $match: { postid: surveyId } },
|
|
153
|
+
{ $project: { value: "$json." + questionId } },
|
|
154
|
+
{ $match: { value: { $exists: true } } },
|
|
155
|
+
{
|
|
156
|
+
$group: {
|
|
157
|
+
_id: "$value",
|
|
158
|
+
count: { $sum: 1 },
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
];
|
|
162
|
+
var multipleChoicePipeline = [
|
|
163
|
+
{ $match: { postid: surveyId } },
|
|
164
|
+
{ $project: { value: "$json." + questionId } },
|
|
165
|
+
{ $match: { value: { $exists: true } } },
|
|
166
|
+
{ $unwind: "$value" },
|
|
167
|
+
{
|
|
168
|
+
$group: {
|
|
169
|
+
_id: "$value",
|
|
170
|
+
count: { $sum: 1 },
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
];
|
|
174
|
+
var numberPipeline = [
|
|
175
|
+
{ $match: { postid: surveyId } },
|
|
176
|
+
{ $project: { value: "$json." + questionId } },
|
|
177
|
+
{ $match: { value: { $exists: true } } },
|
|
178
|
+
{
|
|
179
|
+
$group: {
|
|
180
|
+
_id: null,
|
|
181
|
+
count: { $sum: 1 },
|
|
182
|
+
average: { $avg: "$value" },
|
|
183
|
+
min: { $min: "$value" },
|
|
184
|
+
max: { $max: "$value" },
|
|
185
|
+
values: { $push: "$value" }
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
];
|
|
189
|
+
var histogramPipeline = [
|
|
190
|
+
{ $match: { postid: surveyId } },
|
|
191
|
+
{ $project: { value: "$json." + questionId } },
|
|
192
|
+
{ $match: { value: { $exists: true } } },
|
|
193
|
+
{
|
|
194
|
+
$bucketAuto: {
|
|
195
|
+
groupBy: "$value",
|
|
196
|
+
buckets: 10,
|
|
197
|
+
output: {
|
|
198
|
+
count: { $sum: 1 },
|
|
199
|
+
minValue: { $min: "$value" },
|
|
200
|
+
maxValue: { $max: "$value" }
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
$project: {
|
|
206
|
+
_id: 0,
|
|
207
|
+
start: "$minValue",
|
|
208
|
+
end: "$maxValue",
|
|
209
|
+
label: {
|
|
210
|
+
$concat: [
|
|
211
|
+
{ $toString: { $round: ["$minValue", 2] } },
|
|
212
|
+
" - ",
|
|
213
|
+
{ $toString: { $round: ["$maxValue", 2] } }
|
|
214
|
+
]
|
|
215
|
+
},
|
|
216
|
+
count: 1
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
];
|
|
220
|
+
var mongoPipelines = {
|
|
221
|
+
"boolean": singleChoicePipeline,
|
|
222
|
+
"radiogroup": singleChoicePipeline,
|
|
223
|
+
"dropdown": singleChoicePipeline,
|
|
224
|
+
"checkbox": multipleChoicePipeline,
|
|
225
|
+
"tagbox": multipleChoicePipeline,
|
|
226
|
+
"number": numberPipeline,
|
|
227
|
+
"rating": numberPipeline,
|
|
228
|
+
"histogram": histogramPipeline
|
|
229
|
+
};
|
|
230
|
+
var pipeline = mongoPipelines[visualizerType] || mongoPipelines[questionType] || [];
|
|
231
|
+
return pipeline;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
/***/ }),
|
|
236
|
+
|
|
237
|
+
/***/ "./src/mongo/result-transformers.ts":
|
|
238
|
+
/*!******************************************!*\
|
|
239
|
+
!*** ./src/mongo/result-transformers.ts ***!
|
|
240
|
+
\******************************************/
|
|
241
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
242
|
+
|
|
243
|
+
__webpack_require__.r(__webpack_exports__);
|
|
244
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
245
|
+
/* harmony export */ transformers: () => (/* binding */ transformers)
|
|
246
|
+
/* harmony export */ });
|
|
247
|
+
function choiceTransformationPipeline(result) {
|
|
248
|
+
var res = {};
|
|
249
|
+
var totalCount = 0;
|
|
250
|
+
result.forEach(function (item) {
|
|
251
|
+
res[item._id] = item.count;
|
|
252
|
+
totalCount += item.count;
|
|
253
|
+
});
|
|
254
|
+
return { data: res, totalCount: totalCount };
|
|
255
|
+
}
|
|
256
|
+
function numberTransformationPipeline(result) {
|
|
257
|
+
if (result.length == 0)
|
|
258
|
+
return { value: 0, minValue: 0, maxValue: 0 };
|
|
259
|
+
return { data: { value: result[0].average, minValue: result[0].min, maxValue: result[0].max } };
|
|
260
|
+
}
|
|
261
|
+
function histogramTransformationPipeline(result) {
|
|
262
|
+
var res = [];
|
|
263
|
+
var totalCount = 0;
|
|
264
|
+
result.forEach(function (item) {
|
|
265
|
+
res.push(item.count);
|
|
266
|
+
totalCount += item.count;
|
|
267
|
+
});
|
|
268
|
+
return { data: res, intervals: result, totalCount: totalCount };
|
|
269
|
+
}
|
|
270
|
+
var transformers = {
|
|
271
|
+
"boolean": choiceTransformationPipeline,
|
|
272
|
+
"radiogroup": choiceTransformationPipeline,
|
|
273
|
+
"dropdown": choiceTransformationPipeline,
|
|
274
|
+
"checkbox": choiceTransformationPipeline,
|
|
275
|
+
"tagbox": choiceTransformationPipeline,
|
|
276
|
+
"number": numberTransformationPipeline,
|
|
277
|
+
"rating": numberTransformationPipeline,
|
|
278
|
+
"histogram": histogramTransformationPipeline
|
|
279
|
+
};
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
/***/ })
|
|
283
|
+
|
|
284
|
+
/******/ });
|
|
285
|
+
/************************************************************************/
|
|
286
|
+
/******/ // The module cache
|
|
287
|
+
/******/ var __webpack_module_cache__ = {};
|
|
288
|
+
/******/
|
|
289
|
+
/******/ // The require function
|
|
290
|
+
/******/ function __webpack_require__(moduleId) {
|
|
291
|
+
/******/ // Check if module is in cache
|
|
292
|
+
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
|
293
|
+
/******/ if (cachedModule !== undefined) {
|
|
294
|
+
/******/ return cachedModule.exports;
|
|
295
|
+
/******/ }
|
|
296
|
+
/******/ // Create a new module (and put it into the cache)
|
|
297
|
+
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
298
|
+
/******/ // no module.id needed
|
|
299
|
+
/******/ // no module.loaded needed
|
|
300
|
+
/******/ exports: {}
|
|
301
|
+
/******/ };
|
|
302
|
+
/******/
|
|
303
|
+
/******/ // Execute the module function
|
|
304
|
+
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
305
|
+
/******/
|
|
306
|
+
/******/ // Return the exports of the module
|
|
307
|
+
/******/ return module.exports;
|
|
308
|
+
/******/ }
|
|
309
|
+
/******/
|
|
310
|
+
/************************************************************************/
|
|
311
|
+
/******/ /* webpack/runtime/define property getters */
|
|
312
|
+
/******/ (() => {
|
|
313
|
+
/******/ // define getter functions for harmony exports
|
|
314
|
+
/******/ __webpack_require__.d = (exports, definition) => {
|
|
315
|
+
/******/ for(var key in definition) {
|
|
316
|
+
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
317
|
+
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
318
|
+
/******/ }
|
|
319
|
+
/******/ }
|
|
320
|
+
/******/ };
|
|
321
|
+
/******/ })();
|
|
322
|
+
/******/
|
|
323
|
+
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
324
|
+
/******/ (() => {
|
|
325
|
+
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
326
|
+
/******/ })();
|
|
327
|
+
/******/
|
|
328
|
+
/******/ /* webpack/runtime/make namespace object */
|
|
329
|
+
/******/ (() => {
|
|
330
|
+
/******/ // define __esModule on exports
|
|
331
|
+
/******/ __webpack_require__.r = (exports) => {
|
|
332
|
+
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
333
|
+
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
334
|
+
/******/ }
|
|
335
|
+
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
336
|
+
/******/ };
|
|
337
|
+
/******/ })();
|
|
338
|
+
/******/
|
|
339
|
+
/************************************************************************/
|
|
340
|
+
var __webpack_exports__ = {};
|
|
341
|
+
// This entry needs to be wrapped in an IIFE because it needs to be isolated against other modules in the chunk.
|
|
342
|
+
(() => {
|
|
343
|
+
/*!******************************!*\
|
|
344
|
+
!*** ./src/entries/mongo.ts ***!
|
|
345
|
+
\******************************/
|
|
346
|
+
__webpack_require__.r(__webpack_exports__);
|
|
347
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
348
|
+
/* harmony export */ MongoDbAdapter: () => (/* reexport safe */ _mongo__WEBPACK_IMPORTED_MODULE_0__.MongoDbAdapter)
|
|
349
|
+
/* harmony export */ });
|
|
350
|
+
/* harmony import */ var _mongo__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../mongo */ "./src/mongo/index.ts");
|
|
351
|
+
|
|
352
|
+
|
|
353
|
+
})();
|
|
354
|
+
|
|
355
|
+
/******/ return __webpack_exports__;
|
|
356
|
+
/******/ })()
|
|
357
|
+
;
|
|
358
|
+
});
|
|
359
|
+
//# sourceMappingURL=survey.analytics.mongo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"survey.analytics.mongo.js","mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;;;;ACTqD;AACR;AAI7C;IACE,wBAAoB,EAAM,EAAU,KAAmB;QAAnC,OAAE,GAAF,EAAE,CAAI;QAAU,UAAK,GAAL,KAAK,CAAc;IACvD,CAAC;IAED,+BAAM,GAAN,UAAO,cAAsB,EAAE,MAAM;QAArC,iBAWC;QAVC,MAAM,CAAC,EAAE,GAAG,MAAM,CAAC,EAAE,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;QACtC,OAAO,IAAI,OAAO,CAAC,UAAC,OAAO,EAAE,MAAM;YACjC,KAAI,CAAC,EAAE,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC;iBACjD,IAAI,CAAC,UAAC,OAAO;gBACZ,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;YACrB,CAAC,CAAC;iBACD,KAAK,CAAC,UAAC,CAAC;gBACP,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;YAC5B,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACL,CAAC;IAED,iCAAQ,GAAR,UAAS,cAAsB,EAAE,MAA0B;QAA3D,iBAaC;QAZC,MAAM,GAAG,MAAM,IAAI,EAAE,CAAC;QACtB,IAAM,KAAK,GAAG,EAAE,CAAC;QACjB,MAAM,CAAC,OAAO,CAAC,YAAE,IAAI,YAAK,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,KAAK,EAA1B,CAA0B,CAAC,CAAC;QACjD,OAAO,IAAI,OAAO,CAAC,UAAC,OA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AAE,4BAA4B;IACvC,YAAY,EAAE,4BAA4B;IAC1C,UAAU,EAAE,4BAA4B;IACxC,UAAU,EAAE,4BAA4B;IACxC,QAAQ,EAAE,4BAA4B;IACtC,QAAQ,EAAE,4BAA4B;IACtC,QAAQ,EAAE,4BAA4B;IACtC,WAAW,EAAE,+BAA+B;CAC7C,CAAC;;;;;;;UChCF;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;;;;;;;;;;;ACNyB","sources":["webpack://SurveyAnalyticsTabulator/webpack/universalModuleDefinition","webpack://SurveyAnalyticsMongo/./src/mongo/index.ts","webpack://SurveyAnalyticsMongo/./src/mongo/pipelines.ts","webpack://SurveyAnalyticsMongo/./src/mongo/result-transformers.ts","webpack://SurveyAnalyticsTabulator/webpack/bootstrap","webpack://SurveyAnalyticsTabulator/webpack/runtime/define property getters","webpack://SurveyAnalyticsTabulator/webpack/runtime/hasOwnProperty shorthand","webpack://SurveyAnalyticsTabulator/webpack/runtime/make namespace object","webpack://SurveyAnalyticsMongo/./src/entries/mongo.ts"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"SurveyAnalyticsMongo\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"SurveyAnalyticsMongo\"] = factory();\n\telse\n\t\troot[\"SurveyAnalyticsMongo\"] = factory();\n})(this, () => {\nreturn ","import { Db } from \"mongodb\";\nimport { transformers } from \"./result-transformers\";\nimport { createPipeline } from \"./pipelines\";\n\nexport interface IFilterItem { field: string, value: any }\n\nexport class MongoDbAdapter {\n constructor(private db: Db, private getId: () => string) {\n }\n\n create(collectionName: string, object) {\n object.id = object.id || this.getId();\n return new Promise((resolve, reject) => {\n this.db.collection(collectionName).insertOne(object)\n .then((results) => {\n resolve(object.id);\n })\n .catch((e) => {\n reject(JSON.stringify(e));\n });\n });\n }\n\n retrieve(collectionName: string, filter: Array<IFilterItem>) {\n filter = filter || [];\n const query = {};\n filter.forEach(fi => query[fi.field] = fi.value);\n return new Promise((resolve, reject) => {\n this.db.collection(collectionName).find(query).toArray()\n .then((results) => {\n resolve(results);\n })\n .catch((e) => {\n reject(JSON.stringify(e));\n });\n });\n }\n\n update(collectionName: string, object) {\n return new Promise((resolve, reject) => {\n this.db.collection(collectionName).updateOne({ id: object.id }, { $set: object })\n .then((results) => {\n resolve(results);\n })\n .catch((e) => {\n reject(JSON.stringify(e));\n });\n });\n }\n\n delete(collectionName: string, id) {\n return new Promise((resolve, reject) => {\n this.db.collection(collectionName).deleteMany({ id: id })\n .then((results) => {\n resolve(results);\n })\n .catch((e) => {\n reject(JSON.stringify(e));\n });\n });\n }\n\n retrievePaginated(collectionName: string, filter, order, offset: number, limit: number) {\n filter = filter || [];\n let query = {};\n filter.forEach(fi => {\n if (!!fi.value) {\n let val = fi.value;\n query[fi.field] = val;\n }\n });\n let sort = {};\n order.forEach(fi => {\n sort[fi.field] = fi.value == \"desc\" ? -1 : 1;\n });\n return new Promise((resolve, reject) => {\n this.db.collection(collectionName).count(query).then(count => {\n this.db.collection(collectionName).find(query).sort(sort).skip(offset).limit(limit).toArray()\n .then((results) => {\n const result = { data: results, totalCount: count };\n resolve(result);\n })\n .catch((e) => {\n reject(JSON.stringify(e));\n });\n });\n });\n }\n\n retrieveSummary(collectionName: string, surveyId: string, questionId: string, questionType: string, visualizerType: string, filter: Array<IFilterItem>) {\n const pipeline = createPipeline(surveyId, questionId, visualizerType, questionType);\n return new Promise((resolve, reject) => {\n this.db.collection(collectionName).aggregate(pipeline).toArray()\n .then((results) => {\n const transformer = transformers[visualizerType] || transformers[questionType] || (r => r);\n const result = transformer(results);\n resolve(result);\n })\n .catch((e) => {\n reject(JSON.stringify(e));\n });\n });\n }\n}\n\n","export function createPipeline(surveyId: string, questionId: string, visualizerType: string, questionType: string): any[] {\n const singleChoicePipeline = [\n { $match: { postid: surveyId } },\n { $project: { value: \"$json.\" + questionId } },\n { $match: { value: { $exists: true } } },\n {\n $group: {\n _id: \"$value\",\n count: { $sum: 1 },\n }\n }\n ];\n const multipleChoicePipeline = [\n { $match: { postid: surveyId } },\n { $project: { value: \"$json.\" + questionId } },\n { $match: { value: { $exists: true } } },\n { $unwind: \"$value\" },\n {\n $group: {\n _id: \"$value\",\n count: { $sum: 1 },\n }\n }\n ];\n const numberPipeline = [\n { $match: { postid: surveyId } },\n { $project: { value: \"$json.\" + questionId } },\n { $match: { value: { $exists: true } } },\n {\n $group: {\n _id: null,\n count: { $sum: 1 },\n average: { $avg: \"$value\" },\n min: { $min: \"$value\" },\n max: { $max: \"$value\" },\n values: { $push: \"$value\" }\n }\n }\n ];\n const histogramPipeline = [\n { $match: { postid: surveyId } },\n { $project: { value: \"$json.\" + questionId } },\n { $match: { value: { $exists: true } } },\n {\n $bucketAuto: {\n groupBy: \"$value\",\n buckets: 10,\n output: {\n count: { $sum: 1 },\n minValue: { $min: \"$value\" },\n maxValue: { $max: \"$value\" }\n }\n }\n },\n {\n $project: {\n _id: 0,\n start: \"$minValue\",\n end: \"$maxValue\",\n label: {\n $concat: [\n { $toString: { $round: [\"$minValue\", 2] } },\n \" - \",\n { $toString: { $round: [\"$maxValue\", 2] } }\n ]\n },\n count: 1\n }\n }\n ];\n const mongoPipelines = {\n \"boolean\": singleChoicePipeline,\n \"radiogroup\": singleChoicePipeline,\n \"dropdown\": singleChoicePipeline,\n \"checkbox\": multipleChoicePipeline,\n \"tagbox\": multipleChoicePipeline,\n \"number\": numberPipeline,\n \"rating\": numberPipeline,\n \"histogram\": histogramPipeline\n };\n const pipeline = mongoPipelines[visualizerType] || mongoPipelines[questionType] || [];\n return pipeline;\n}\n","function choiceTransformationPipeline(result) {\n let res = {};\n let totalCount = 0;\n result.forEach(item => {\n res[item._id] = item.count;\n totalCount += item.count;\n });\n return { data: res, totalCount: totalCount };\n}\nfunction numberTransformationPipeline(result) {\n if (result.length == 0) return { value: 0, minValue: 0, maxValue: 0 };\n return { data: { value: result[0].average, minValue: result[0].min, maxValue: result[0].max } };\n}\nfunction histogramTransformationPipeline(result) {\n let res = [];\n let totalCount = 0;\n result.forEach(item => {\n res.push(item.count);\n totalCount += item.count;\n });\n return { data: res, intervals: result, totalCount: totalCount };\n}\n\nexport const transformers = {\n \"boolean\": choiceTransformationPipeline,\n \"radiogroup\": choiceTransformationPipeline,\n \"dropdown\": choiceTransformationPipeline,\n \"checkbox\": choiceTransformationPipeline,\n \"tagbox\": choiceTransformationPipeline,\n \"number\": numberTransformationPipeline,\n \"rating\": numberTransformationPipeline,\n \"histogram\": histogramTransformationPipeline\n};\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","export * from \"../mongo\";"],"names":[],"sourceRoot":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! For license information please see survey.analytics.mongo.min.js.LICENSE.txt */
|
|
2
|
+
!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define("SurveyAnalyticsMongo",[],n):"object"==typeof exports?exports.SurveyAnalyticsMongo=n():t.SurveyAnalyticsMongo=n()}(this,(()=>(()=>{"use strict";var t={d:(n,e)=>{for(var o in e)t.o(e,o)&&!t.o(n,o)&&Object.defineProperty(n,o,{enumerable:!0,get:e[o]})},o:(t,n)=>Object.prototype.hasOwnProperty.call(t,n),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},n={};function e(t){var n={},e=0;return t.forEach((function(t){n[t._id]=t.count,e+=t.count})),{data:n,totalCount:e}}function o(t){return 0==t.length?{value:0,minValue:0,maxValue:0}:{data:{value:t[0].average,minValue:t[0].min,maxValue:t[0].max}}}t.r(n),t.d(n,{MongoDbAdapter:()=>u});var i={boolean:e,radiogroup:e,dropdown:e,checkbox:e,tagbox:e,number:o,rating:o,histogram:function(t){var n=[],e=0;return t.forEach((function(t){n.push(t.count),e+=t.count})),{data:n,intervals:t,totalCount:e}}},u=function(){function t(t,n){this.db=t,this.getId=n}return t.prototype.create=function(t,n){var e=this;return n.id=n.id||this.getId(),new Promise((function(o,i){e.db.collection(t).insertOne(n).then((function(t){o(n.id)})).catch((function(t){i(JSON.stringify(t))}))}))},t.prototype.retrieve=function(t,n){var e=this,o={};return(n=n||[]).forEach((function(t){return o[t.field]=t.value})),new Promise((function(n,i){e.db.collection(t).find(o).toArray().then((function(t){n(t)})).catch((function(t){i(JSON.stringify(t))}))}))},t.prototype.update=function(t,n){var e=this;return new Promise((function(o,i){e.db.collection(t).updateOne({id:n.id},{$set:n}).then((function(t){o(t)})).catch((function(t){i(JSON.stringify(t))}))}))},t.prototype.delete=function(t,n){var e=this;return new Promise((function(o,i){e.db.collection(t).deleteMany({id:n}).then((function(t){o(t)})).catch((function(t){i(JSON.stringify(t))}))}))},t.prototype.retrievePaginated=function(t,n,e,o,i){var u=this,r={};(n=n||[]).forEach((function(t){if(t.value){var n=t.value;r[t.field]=n}}));var a={};return e.forEach((function(t){a[t.field]="desc"==t.value?-1:1})),new Promise((function(n,e){u.db.collection(t).count(r).then((function(c){u.db.collection(t).find(r).sort(a).skip(o).limit(i).toArray().then((function(t){n({data:t,totalCount:c})})).catch((function(t){e(JSON.stringify(t))}))}))}))},t.prototype.retrieveSummary=function(t,n,e,o,u,r){var a=this,c=function(t,n,e,o){var i=[{$match:{postid:t}},{$project:{value:"$json."+n}},{$match:{value:{$exists:!0}}},{$group:{_id:"$value",count:{$sum:1}}}],u=[{$match:{postid:t}},{$project:{value:"$json."+n}},{$match:{value:{$exists:!0}}},{$unwind:"$value"},{$group:{_id:"$value",count:{$sum:1}}}],r=[{$match:{postid:t}},{$project:{value:"$json."+n}},{$match:{value:{$exists:!0}}},{$group:{_id:null,count:{$sum:1},average:{$avg:"$value"},min:{$min:"$value"},max:{$max:"$value"},values:{$push:"$value"}}}],a={boolean:i,radiogroup:i,dropdown:i,checkbox:u,tagbox:u,number:r,rating:r,histogram:[{$match:{postid:t}},{$project:{value:"$json."+n}},{$match:{value:{$exists:!0}}},{$bucketAuto:{groupBy:"$value",buckets:10,output:{count:{$sum:1},minValue:{$min:"$value"},maxValue:{$max:"$value"}}}},{$project:{_id:0,start:"$minValue",end:"$maxValue",label:{$concat:[{$toString:{$round:["$minValue",2]}}," - ",{$toString:{$round:["$maxValue",2]}}]},count:1}}]};return a[e]||a[o]||[]}(n,e,u,o);return new Promise((function(n,e){a.db.collection(t).aggregate(c).toArray().then((function(t){var e=(i[u]||i[o]||function(t){return t})(t);n(e)})).catch((function(t){e(JSON.stringify(t))}))}))},t}();return n})()));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* surveyjs - SurveyJS Dashboard library v2.3.
|
|
2
|
+
* surveyjs - SurveyJS Dashboard library v2.3.9
|
|
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
|
*/
|
|
@@ -2708,10 +2708,33 @@ var swedishStrings = {
|
|
|
2708
2708
|
"use strict";
|
|
2709
2709
|
__webpack_require__.r(__webpack_exports__);
|
|
2710
2710
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2711
|
-
/* harmony export */
|
|
2711
|
+
/* harmony export */ BaseColumn: () => (/* reexport safe */ _tables_columns__WEBPACK_IMPORTED_MODULE_22__.BaseColumn),
|
|
2712
|
+
/* harmony export */ CheckboxColumn: () => (/* reexport safe */ _tables_columns__WEBPACK_IMPORTED_MODULE_22__.CheckboxColumn),
|
|
2713
|
+
/* harmony export */ CheckboxColumnsBuilder: () => (/* reexport safe */ _tables_columnbuilder__WEBPACK_IMPORTED_MODULE_21__.CheckboxColumnsBuilder),
|
|
2714
|
+
/* harmony export */ ColumnsBuilderFactory: () => (/* reexport safe */ _tables_columnbuilder__WEBPACK_IMPORTED_MODULE_21__.ColumnsBuilderFactory),
|
|
2715
|
+
/* harmony export */ CommentColumn: () => (/* reexport safe */ _tables_columns__WEBPACK_IMPORTED_MODULE_22__.CommentColumn),
|
|
2716
|
+
/* harmony export */ CompositeColumnsBuilder: () => (/* reexport safe */ _tables_columnbuilder__WEBPACK_IMPORTED_MODULE_21__.CompositeColumnsBuilder),
|
|
2717
|
+
/* harmony export */ CompositeQuestionColumn: () => (/* reexport safe */ _tables_columns__WEBPACK_IMPORTED_MODULE_22__.CompositeQuestionColumn),
|
|
2718
|
+
/* harmony export */ CustomColumnsBuilder: () => (/* reexport safe */ _tables_columnbuilder__WEBPACK_IMPORTED_MODULE_21__.CustomColumnsBuilder),
|
|
2719
|
+
/* harmony export */ CustomQuestionColumn: () => (/* reexport safe */ _tables_columns__WEBPACK_IMPORTED_MODULE_22__.CustomQuestionColumn),
|
|
2720
|
+
/* harmony export */ DefaultColumn: () => (/* reexport safe */ _tables_columns__WEBPACK_IMPORTED_MODULE_22__.DefaultColumn),
|
|
2721
|
+
/* harmony export */ DefaultColumnsBuilder: () => (/* reexport safe */ _tables_columnbuilder__WEBPACK_IMPORTED_MODULE_21__.DefaultColumnsBuilder),
|
|
2722
|
+
/* harmony export */ DocumentHelper: () => (/* reexport safe */ _utils_index__WEBPACK_IMPORTED_MODULE_24__.DocumentHelper),
|
|
2723
|
+
/* harmony export */ FileColumn: () => (/* reexport safe */ _tables_columns__WEBPACK_IMPORTED_MODULE_22__.FileColumn),
|
|
2724
|
+
/* harmony export */ FileColumnsBuilder: () => (/* reexport safe */ _tables_columnbuilder__WEBPACK_IMPORTED_MODULE_21__.FileColumnsBuilder),
|
|
2725
|
+
/* harmony export */ ImageColumn: () => (/* reexport safe */ _tables_columns__WEBPACK_IMPORTED_MODULE_22__.ImageColumn),
|
|
2726
|
+
/* harmony export */ ImageColumnsBuilder: () => (/* reexport safe */ _tables_columnbuilder__WEBPACK_IMPORTED_MODULE_21__.ImageColumnsBuilder),
|
|
2727
|
+
/* harmony export */ MatrixColumn: () => (/* reexport safe */ _tables_columns__WEBPACK_IMPORTED_MODULE_22__.MatrixColumn),
|
|
2728
|
+
/* harmony export */ MatrixColumnsBuilder: () => (/* reexport safe */ _tables_columnbuilder__WEBPACK_IMPORTED_MODULE_21__.MatrixColumnsBuilder),
|
|
2729
|
+
/* harmony export */ MatrixDropdownColumn: () => (/* reexport safe */ _tables_columns__WEBPACK_IMPORTED_MODULE_22__.MatrixDropdownColumn),
|
|
2730
|
+
/* harmony export */ MatrixDropdownColumnBuilder: () => (/* reexport safe */ _tables_columnbuilder__WEBPACK_IMPORTED_MODULE_21__.MatrixDropdownColumnBuilder),
|
|
2731
|
+
/* harmony export */ OtherColumn: () => (/* reexport safe */ _tables_columns__WEBPACK_IMPORTED_MODULE_22__.OtherColumn),
|
|
2732
|
+
/* harmony export */ SelectBaseColumn: () => (/* reexport safe */ _tables_columns__WEBPACK_IMPORTED_MODULE_22__.SelectBaseColumn),
|
|
2733
|
+
/* harmony export */ SingleChoiceColumn: () => (/* reexport safe */ _tables_columns__WEBPACK_IMPORTED_MODULE_22__.SingleChoiceColumn),
|
|
2734
|
+
/* harmony export */ SingleChoiceColumnsBuilder: () => (/* reexport safe */ _tables_columnbuilder__WEBPACK_IMPORTED_MODULE_21__.SingleChoiceColumnsBuilder),
|
|
2712
2735
|
/* harmony export */ Table: () => (/* reexport safe */ _tables_table__WEBPACK_IMPORTED_MODULE_19__.Table),
|
|
2713
2736
|
/* harmony export */ TableEvent: () => (/* reexport safe */ _tables_table__WEBPACK_IMPORTED_MODULE_19__.TableEvent),
|
|
2714
|
-
/* harmony export */ TableExtensions: () => (/* reexport safe */
|
|
2737
|
+
/* harmony export */ TableExtensions: () => (/* reexport safe */ _tables_extensions_tableextensions__WEBPACK_IMPORTED_MODULE_23__.TableExtensions),
|
|
2715
2738
|
/* harmony export */ TableRow: () => (/* reexport safe */ _tables_table__WEBPACK_IMPORTED_MODULE_19__.TableRow),
|
|
2716
2739
|
/* harmony export */ Tabulator: () => (/* reexport safe */ _tables_tabulator__WEBPACK_IMPORTED_MODULE_20__.Tabulator),
|
|
2717
2740
|
/* harmony export */ TabulatorRow: () => (/* reexport safe */ _tables_tabulator__WEBPACK_IMPORTED_MODULE_20__.TabulatorRow),
|
|
@@ -2742,8 +2765,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
2742
2765
|
/* harmony import */ var _tables_extensions_detailsextensions__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../tables/extensions/detailsextensions */ "./src/tables/extensions/detailsextensions.ts");
|
|
2743
2766
|
/* harmony import */ var _tables_table__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../tables/table */ "./src/tables/table.ts");
|
|
2744
2767
|
/* harmony import */ var _tables_tabulator__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../tables/tabulator */ "./src/tables/tabulator.ts");
|
|
2745
|
-
/* harmony import */ var
|
|
2746
|
-
/* harmony import */ var
|
|
2768
|
+
/* harmony import */ var _tables_columnbuilder__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../tables/columnbuilder */ "./src/tables/columnbuilder.ts");
|
|
2769
|
+
/* harmony import */ var _tables_columns__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../tables/columns */ "./src/tables/columns.ts");
|
|
2770
|
+
/* harmony import */ var _tables_extensions_tableextensions__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../tables/extensions/tableextensions */ "./src/tables/extensions/tableextensions.ts");
|
|
2771
|
+
/* harmony import */ var _utils_index__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../utils/index */ "./src/utils/index.ts");
|
|
2747
2772
|
|
|
2748
2773
|
//localization
|
|
2749
2774
|
|
|
@@ -2771,6 +2796,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
2771
2796
|
|
|
2772
2797
|
|
|
2773
2798
|
|
|
2799
|
+
|
|
2800
|
+
|
|
2774
2801
|
/***/ }),
|
|
2775
2802
|
|
|
2776
2803
|
/***/ "./src/icons.ts":
|
|
@@ -3204,9 +3231,34 @@ var CompositeColumnsBuilder = /** @class */ (function (_super) {
|
|
|
3204
3231
|
function CompositeColumnsBuilder() {
|
|
3205
3232
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
3206
3233
|
}
|
|
3234
|
+
CompositeColumnsBuilder.prototype.getDisplayName = function (question, table) {
|
|
3235
|
+
return table.useNamesAsTitles
|
|
3236
|
+
? question.name
|
|
3237
|
+
: (question.title || "").trim() || question.name;
|
|
3238
|
+
};
|
|
3239
|
+
CompositeColumnsBuilder.prototype.buildColumnsCore = function (question, table) {
|
|
3240
|
+
var _this = this;
|
|
3241
|
+
if (CompositeColumnsBuilder.ShowAsSeparateColumns) {
|
|
3242
|
+
var innerQuestions = [];
|
|
3243
|
+
question.contentPanel.addQuestionsToList(innerQuestions);
|
|
3244
|
+
var columns_1 = [];
|
|
3245
|
+
innerQuestions.forEach(function (innerQuestion) {
|
|
3246
|
+
var builder = ColumnsBuilderFactory.Instance.getColumnsBuilder(innerQuestion.getType());
|
|
3247
|
+
var cols = builder.buildColumns(innerQuestion, table);
|
|
3248
|
+
cols.forEach(function (col) {
|
|
3249
|
+
col.name = question.name + "." + col.name;
|
|
3250
|
+
col.displayName = _this.getDisplayName(question, table) + " - " + _this.getDisplayName(innerQuestion, table);
|
|
3251
|
+
});
|
|
3252
|
+
columns_1 = columns_1.concat(cols);
|
|
3253
|
+
});
|
|
3254
|
+
return columns_1;
|
|
3255
|
+
}
|
|
3256
|
+
return _super.prototype.buildColumnsCore.call(this, question, table);
|
|
3257
|
+
};
|
|
3207
3258
|
CompositeColumnsBuilder.prototype.createColumn = function (question, table) {
|
|
3208
3259
|
return new _columns__WEBPACK_IMPORTED_MODULE_1__.CompositeQuestionColumn(question, table);
|
|
3209
3260
|
};
|
|
3261
|
+
CompositeColumnsBuilder.ShowAsSeparateColumns = true;
|
|
3210
3262
|
return CompositeColumnsBuilder;
|
|
3211
3263
|
}(DefaultColumnsBuilder));
|
|
3212
3264
|
|
|
@@ -5641,7 +5693,30 @@ var __webpack_exports__ = {};
|
|
|
5641
5693
|
\**************************************/
|
|
5642
5694
|
__webpack_require__.r(__webpack_exports__);
|
|
5643
5695
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
5696
|
+
/* harmony export */ BaseColumn: () => (/* reexport safe */ _tabulator__WEBPACK_IMPORTED_MODULE_0__.BaseColumn),
|
|
5697
|
+
/* harmony export */ CheckboxColumn: () => (/* reexport safe */ _tabulator__WEBPACK_IMPORTED_MODULE_0__.CheckboxColumn),
|
|
5698
|
+
/* harmony export */ CheckboxColumnsBuilder: () => (/* reexport safe */ _tabulator__WEBPACK_IMPORTED_MODULE_0__.CheckboxColumnsBuilder),
|
|
5699
|
+
/* harmony export */ ColumnsBuilderFactory: () => (/* reexport safe */ _tabulator__WEBPACK_IMPORTED_MODULE_0__.ColumnsBuilderFactory),
|
|
5700
|
+
/* harmony export */ CommentColumn: () => (/* reexport safe */ _tabulator__WEBPACK_IMPORTED_MODULE_0__.CommentColumn),
|
|
5701
|
+
/* harmony export */ CompositeColumnsBuilder: () => (/* reexport safe */ _tabulator__WEBPACK_IMPORTED_MODULE_0__.CompositeColumnsBuilder),
|
|
5702
|
+
/* harmony export */ CompositeQuestionColumn: () => (/* reexport safe */ _tabulator__WEBPACK_IMPORTED_MODULE_0__.CompositeQuestionColumn),
|
|
5703
|
+
/* harmony export */ CustomColumnsBuilder: () => (/* reexport safe */ _tabulator__WEBPACK_IMPORTED_MODULE_0__.CustomColumnsBuilder),
|
|
5704
|
+
/* harmony export */ CustomQuestionColumn: () => (/* reexport safe */ _tabulator__WEBPACK_IMPORTED_MODULE_0__.CustomQuestionColumn),
|
|
5705
|
+
/* harmony export */ DefaultColumn: () => (/* reexport safe */ _tabulator__WEBPACK_IMPORTED_MODULE_0__.DefaultColumn),
|
|
5706
|
+
/* harmony export */ DefaultColumnsBuilder: () => (/* reexport safe */ _tabulator__WEBPACK_IMPORTED_MODULE_0__.DefaultColumnsBuilder),
|
|
5644
5707
|
/* harmony export */ DocumentHelper: () => (/* reexport safe */ _tabulator__WEBPACK_IMPORTED_MODULE_0__.DocumentHelper),
|
|
5708
|
+
/* harmony export */ FileColumn: () => (/* reexport safe */ _tabulator__WEBPACK_IMPORTED_MODULE_0__.FileColumn),
|
|
5709
|
+
/* harmony export */ FileColumnsBuilder: () => (/* reexport safe */ _tabulator__WEBPACK_IMPORTED_MODULE_0__.FileColumnsBuilder),
|
|
5710
|
+
/* harmony export */ ImageColumn: () => (/* reexport safe */ _tabulator__WEBPACK_IMPORTED_MODULE_0__.ImageColumn),
|
|
5711
|
+
/* harmony export */ ImageColumnsBuilder: () => (/* reexport safe */ _tabulator__WEBPACK_IMPORTED_MODULE_0__.ImageColumnsBuilder),
|
|
5712
|
+
/* harmony export */ MatrixColumn: () => (/* reexport safe */ _tabulator__WEBPACK_IMPORTED_MODULE_0__.MatrixColumn),
|
|
5713
|
+
/* harmony export */ MatrixColumnsBuilder: () => (/* reexport safe */ _tabulator__WEBPACK_IMPORTED_MODULE_0__.MatrixColumnsBuilder),
|
|
5714
|
+
/* harmony export */ MatrixDropdownColumn: () => (/* reexport safe */ _tabulator__WEBPACK_IMPORTED_MODULE_0__.MatrixDropdownColumn),
|
|
5715
|
+
/* harmony export */ MatrixDropdownColumnBuilder: () => (/* reexport safe */ _tabulator__WEBPACK_IMPORTED_MODULE_0__.MatrixDropdownColumnBuilder),
|
|
5716
|
+
/* harmony export */ OtherColumn: () => (/* reexport safe */ _tabulator__WEBPACK_IMPORTED_MODULE_0__.OtherColumn),
|
|
5717
|
+
/* harmony export */ SelectBaseColumn: () => (/* reexport safe */ _tabulator__WEBPACK_IMPORTED_MODULE_0__.SelectBaseColumn),
|
|
5718
|
+
/* harmony export */ SingleChoiceColumn: () => (/* reexport safe */ _tabulator__WEBPACK_IMPORTED_MODULE_0__.SingleChoiceColumn),
|
|
5719
|
+
/* harmony export */ SingleChoiceColumnsBuilder: () => (/* reexport safe */ _tabulator__WEBPACK_IMPORTED_MODULE_0__.SingleChoiceColumnsBuilder),
|
|
5645
5720
|
/* harmony export */ Table: () => (/* reexport safe */ _tabulator__WEBPACK_IMPORTED_MODULE_0__.Table),
|
|
5646
5721
|
/* harmony export */ TableEvent: () => (/* reexport safe */ _tabulator__WEBPACK_IMPORTED_MODULE_0__.TableEvent),
|
|
5647
5722
|
/* harmony export */ TableExtensions: () => (/* reexport safe */ _tabulator__WEBPACK_IMPORTED_MODULE_0__.TableExtensions),
|