@conduction/nextcloud-vue 2.149.0 → 2.150.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/dist/esm/components/CnChartWidget/CnChartWidget.vue.js +1 -1
- package/dist/esm/components/CnChartWidget/CnChartWidget.vue2.js +12 -0
- package/dist/esm/components/CnChartWidget/CnChartWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnChartWidget/CnChartWidget.vue3.js.map +1 -1
- package/dist/esm/library-style.js +1 -1
- package/dist/esm/nextcloud-vue.css +84 -76
- package/dist/esm/utils/fillTemplate.js +19 -2
- package/dist/esm/utils/fillTemplate.js.map +1 -1
- package/dist/nextcloud-vue.cjs.js +32 -3
- package/dist/nextcloud-vue.cjs.js.map +2 -2
- package/dist/nextcloud-vue.css +84 -76
- package/package.json +1 -1
- package/src/components/CnChartWidget/CnChartWidget.md +1 -1
- package/src/components/CnChartWidget/CnChartWidget.vue +12 -0
- package/src/css/board.css +2 -0
- package/src/css/look-board-index.css +5 -1
- package/src/utils/fillTemplate.js +19 -2
|
@@ -60,6 +60,22 @@ export function formatLongDate(value, now = new Date(), withYear = false) {
|
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
+
/**
|
|
64
|
+
* How many entries a list holds; with a key, the entries of that list in each
|
|
65
|
+
* of its entries summed (`{sections|count:items}`: the questions of every
|
|
66
|
+
* section of a checklist).
|
|
67
|
+
*
|
|
68
|
+
* @param {Array} list The list.
|
|
69
|
+
* @param {string} key The key of each entry's own list, or '' to count the entries.
|
|
70
|
+
* @return {number} The count.
|
|
71
|
+
*/
|
|
72
|
+
function countEntries(list, key) {
|
|
73
|
+
if (key === '') {
|
|
74
|
+
return list.length
|
|
75
|
+
}
|
|
76
|
+
return list.reduce((sum, entry) => sum + (entry && Array.isArray(entry[key]) ? entry[key].length : 0), 0)
|
|
77
|
+
}
|
|
78
|
+
|
|
63
79
|
/**
|
|
64
80
|
* Format one token value.
|
|
65
81
|
*
|
|
@@ -76,7 +92,7 @@ export function formatLongDate(value, now = new Date(), withYear = false) {
|
|
|
76
92
|
function formatValue(value, format, now, arg = '', object = null, config = null, formatters = null) {
|
|
77
93
|
// `{list|count}`: how many entries a list holds, nothing for an empty one.
|
|
78
94
|
if (format === 'count') {
|
|
79
|
-
const count = Array.isArray(value) ? value
|
|
95
|
+
const count = Array.isArray(value) ? countEntries(value, arg) : Number(value)
|
|
80
96
|
return Number.isFinite(count) && count > 0 ? String(count) : ''
|
|
81
97
|
}
|
|
82
98
|
if (value === null || value === undefined || value === '' || typeof value === 'object') {
|
|
@@ -160,7 +176,8 @@ function formatValue(value, format, now, arg = '', object = null, config = null,
|
|
|
160
176
|
* ("vandaag, 09.42"), `{path|ago}` says how long ago it was ("10 min
|
|
161
177
|
* geleden", "vanochtend", "vrijdag"), and `{path|days}` is the
|
|
162
178
|
* whole days since that date ("has waited {createdAt|days} days"),
|
|
163
|
-
* `{path|count}` is how many entries a list holds (nothing for an empty one
|
|
179
|
+
* `{path|count}` is how many entries a list holds (nothing for an empty one;
|
|
180
|
+
* `{path|count:key}` sums the `key` list of each entry),
|
|
164
181
|
* `{path|lower}` writes the value in lower case ("Step 2: {statusLabel|lower}"
|
|
165
182
|
* reads "Step 2: in progress" mid-sentence), and any other name is one of
|
|
166
183
|
* the app's formatters, passed as `context.formatters` (`{id|caseAddress}`).
|