@conduction/nextcloud-vue 2.56.0-beta.71 → 2.56.0-beta.72
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/CnDataMatrix/CnDataMatrix.vue.js +1 -1
- package/dist/esm/components/CnDataMatrix/CnDataMatrix.vue2.js +93 -1
- package/dist/esm/components/CnDataMatrix/CnDataMatrix.vue2.js.map +1 -1
- package/dist/esm/components/CnDataMatrix/CnDataMatrix.vue3.js +11 -9
- package/dist/esm/components/CnDataMatrix/CnDataMatrix.vue3.js.map +1 -1
- package/dist/esm/l10n/en.json.js +3 -0
- package/dist/esm/l10n/en.json.js.map +1 -1
- package/dist/esm/l10n/nl.json.js +3 -0
- package/dist/esm/l10n/nl.json.js.map +1 -1
- package/dist/esm/library-style.js +1 -1
- package/dist/esm/nextcloud-vue.css +27 -23
- package/dist/nextcloud-vue.cjs.js +110 -10
- package/dist/nextcloud-vue.cjs.js.map +2 -2
- package/dist/nextcloud-vue.css +27 -23
- package/l10n/en.json +3 -0
- package/l10n/nl.json +3 -0
- package/package.json +1 -1
- package/src/components/CnDataMatrix/CnDataMatrix.vue +105 -4
|
@@ -2,7 +2,7 @@ import script from './CnDataMatrix.vue2.js';
|
|
|
2
2
|
import { render } from './CnDataMatrix.vue3.js';
|
|
3
3
|
|
|
4
4
|
script.render = render;
|
|
5
|
-
script.__scopeId = "data-v-
|
|
5
|
+
script.__scopeId = "data-v-7c401d14";
|
|
6
6
|
const __sfc_main = script;
|
|
7
7
|
|
|
8
8
|
export { __sfc_main as default };
|
|
@@ -16,7 +16,8 @@ function numberIn(raw) {
|
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* CnDataMatrix — Inline-edit data grid for matrix-shaped data
|
|
19
|
-
* (rows × columns). Each cell is click-to-edit
|
|
19
|
+
* (rows × columns). Each cell is click-to-edit, and keyboard editable:
|
|
20
|
+
* Tab reaches it, Enter or F2 opens it, Enter commits, Escape cancels. Commits emit
|
|
20
21
|
* `@cell-edit({ rowId, colKey, value })` so the parent can persist.
|
|
21
22
|
* Optional row / column / grand totals computed from the live data
|
|
22
23
|
* with the column's `aggregate` setting (`sum` by default).
|
|
@@ -228,6 +229,97 @@ var script = {
|
|
|
228
229
|
return Boolean(col.readOnly || col.formula)
|
|
229
230
|
},
|
|
230
231
|
|
|
232
|
+
/**
|
|
233
|
+
* Whether a cell can be edited, and so takes keyboard focus.
|
|
234
|
+
*
|
|
235
|
+
* @param {object} row Row record.
|
|
236
|
+
* @param {object} col Column definition.
|
|
237
|
+
* @return {boolean}
|
|
238
|
+
*/
|
|
239
|
+
isCellEditable(row, col) {
|
|
240
|
+
return !this.readOnly && !this.isCellReadOnly(row, col)
|
|
241
|
+
},
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Accessible name of a cell's input: its column and row.
|
|
245
|
+
*
|
|
246
|
+
* @param {object} row Row record.
|
|
247
|
+
* @param {object} col Column definition.
|
|
248
|
+
* @return {string} The label.
|
|
249
|
+
*/
|
|
250
|
+
inputLabel(row, col) {
|
|
251
|
+
return translate('nextcloud-vue', '{column}, {row}', {
|
|
252
|
+
column: col.label || col.key,
|
|
253
|
+
row: row[this.rowLabelKey] ?? row[this.rowIdKey],
|
|
254
|
+
}, undefined, { escape: false })
|
|
255
|
+
},
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* Accessible name of an editable cell: its column, row and value.
|
|
259
|
+
*
|
|
260
|
+
* @param {object} row Row record.
|
|
261
|
+
* @param {object} col Column definition.
|
|
262
|
+
* @return {string} The label.
|
|
263
|
+
*/
|
|
264
|
+
cellLabel(row, col) {
|
|
265
|
+
const value = this.formatCell(this.cellValue(row, col), col);
|
|
266
|
+
const vars = { cell: this.inputLabel(row, col), value: String(value) };
|
|
267
|
+
return value === ''
|
|
268
|
+
? translate('nextcloud-vue', '{cell}: empty', vars, undefined, { escape: false })
|
|
269
|
+
: translate('nextcloud-vue', '{cell}: {value}', vars, undefined, { escape: false })
|
|
270
|
+
},
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* Enter or F2 on a focused cell starts editing it.
|
|
274
|
+
*
|
|
275
|
+
* @param {KeyboardEvent} event The key event.
|
|
276
|
+
* @param {object} row Row record.
|
|
277
|
+
* @param {object} col Column definition.
|
|
278
|
+
* @return {void}
|
|
279
|
+
*/
|
|
280
|
+
onCellKeydown(event, row, col) {
|
|
281
|
+
if ((event.key === 'Enter' || event.key === 'F2') && this.isCellEditable(row, col)) {
|
|
282
|
+
event.preventDefault();
|
|
283
|
+
this.startEdit(row, col);
|
|
284
|
+
}
|
|
285
|
+
},
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* Enter commits and Escape cancels the edit; both return focus to the cell.
|
|
289
|
+
*
|
|
290
|
+
* @param {KeyboardEvent} event The key event.
|
|
291
|
+
* @param {object} row Row record.
|
|
292
|
+
* @param {object} col Column definition.
|
|
293
|
+
* @return {void}
|
|
294
|
+
*/
|
|
295
|
+
onInputKeydown(event, row, col) {
|
|
296
|
+
if (event.key === 'Enter') {
|
|
297
|
+
event.preventDefault();
|
|
298
|
+
this.commitEdit(row, col, event.target.value);
|
|
299
|
+
this.focusCell(row, col);
|
|
300
|
+
} else if (event.key === 'Escape' || event.key === 'Esc') {
|
|
301
|
+
event.preventDefault();
|
|
302
|
+
this.cancelEdit();
|
|
303
|
+
this.focusCell(row, col);
|
|
304
|
+
}
|
|
305
|
+
},
|
|
306
|
+
|
|
307
|
+
/**
|
|
308
|
+
* Move focus to a cell's value after the edit input is gone.
|
|
309
|
+
*
|
|
310
|
+
* @param {object} row Row record.
|
|
311
|
+
* @param {object} col Column definition.
|
|
312
|
+
* @return {void}
|
|
313
|
+
*/
|
|
314
|
+
focusCell(row, col) {
|
|
315
|
+
const rowId = String(row[this.rowIdKey]);
|
|
316
|
+
this.$nextTick(() => {
|
|
317
|
+
const cell = Array.from(this.$el.querySelectorAll('.cn-data-matrix__cell'))
|
|
318
|
+
.find((td) => td.dataset.rowId === rowId && td.dataset.colKey === col.key);
|
|
319
|
+
cell?.querySelector('.cn-data-matrix__cell-value')?.focus();
|
|
320
|
+
});
|
|
321
|
+
},
|
|
322
|
+
|
|
231
323
|
/**
|
|
232
324
|
* Read the cell value from the row.
|
|
233
325
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CnDataMatrix.vue2.js","sources":["../../../../src/components/CnDataMatrix/CnDataMatrix.vue"],"sourcesContent":["<template>\n\t<div class=\"cn-data-matrix\" data-testid=\"cn-data-matrix\">\n\t\t<header v-if=\"title || description\" class=\"cn-data-matrix__header\">\n\t\t\t<h3 v-if=\"title\" class=\"cn-data-matrix__title\">\n\t\t\t\t{{ title }}\n\t\t\t</h3>\n\t\t\t<p v-if=\"description\" class=\"cn-data-matrix__description\">\n\t\t\t\t{{ description }}\n\t\t\t</p>\n\t\t</header>\n\n\t\t<div class=\"cn-data-matrix__scroller\">\n\t\t\t<table class=\"cn-data-matrix__table\">\n\t\t\t\t<thead>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th v-if=\"rowHeader\" class=\"cn-data-matrix__row-header-corner\">\n\t\t\t\t\t\t\t{{ rowHeader }}\n\t\t\t\t\t\t</th>\n\t\t\t\t\t\t<th v-for=\"col in columns\"\n\t\t\t\t\t\t\t:key=\"col.key\"\n\t\t\t\t\t\t\tclass=\"cn-data-matrix__col-header\"\n\t\t\t\t\t\t\t:style=\"col.width ? { width: col.width } : null\">\n\t\t\t\t\t\t\t{{ col.label || col.key }}\n\t\t\t\t\t\t\t<span v-if=\"weightText(col)\" class=\"cn-data-matrix__weight\">{{ weightText(col) }}</span>\n\t\t\t\t\t\t</th>\n\t\t\t\t\t\t<th v-if=\"showRowTotals\" class=\"cn-data-matrix__total-header\">\n\t\t\t\t\t\t\t{{ rowTotalsLabel }}\n\t\t\t\t\t\t</th>\n\t\t\t\t\t\t<th v-if=\"showRank\" class=\"cn-data-matrix__total-header cn-data-matrix__rank-header\">\n\t\t\t\t\t\t\t{{ resolvedRankLabel }}\n\t\t\t\t\t\t</th>\n\t\t\t\t\t</tr>\n\t\t\t\t</thead>\n\t\t\t\t<tbody>\n\t\t\t\t\t<tr v-for=\"row in rows\"\n\t\t\t\t\t\t:key=\"row[rowIdKey]\"\n\t\t\t\t\t\tclass=\"cn-data-matrix__row\"\n\t\t\t\t\t\t:class=\"{ 'cn-data-matrix__row--top': highlightTopRank && ranks.get(row[rowIdKey]) === 1 }\">\n\t\t\t\t\t\t<th v-if=\"rowHeader\"\n\t\t\t\t\t\t\tscope=\"row\"\n\t\t\t\t\t\t\tclass=\"cn-data-matrix__row-header\"\n\t\t\t\t\t\t\t:title=\"row[rowLabelKey]\">\n\t\t\t\t\t\t\t{{ row[rowLabelKey] }}\n\t\t\t\t\t\t\t<span v-if=\"rowSublabelKey && row[rowSublabelKey]\" class=\"cn-data-matrix__row-sublabel\">{{ row[rowSublabelKey] }}</span>\n\t\t\t\t\t\t</th>\n\t\t\t\t\t\t<td v-for=\"col in columns\"\n\t\t\t\t\t\t\t:key=\"col.key\"\n\t\t\t\t\t\t\tclass=\"cn-data-matrix__cell\"\n\t\t\t\t\t\t\t:class=\"cellClass(row, col)\"\n\t\t\t\t\t\t\t:data-row-id=\"row[rowIdKey]\"\n\t\t\t\t\t\t\t:data-col-key=\"col.key\">\n\t\t\t\t\t\t\t<input v-if=\"isEditing(row, col)\"\n\t\t\t\t\t\t\t\tref=\"activeInput\"\n\t\t\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\t\t\tclass=\"cn-data-matrix__cell-input\"\n\t\t\t\t\t\t\t\t:value=\"cellValue(row, col)\"\n\t\t\t\t\t\t\t\t:disabled=\"readOnly || isCellReadOnly(row, col)\"\n\t\t\t\t\t\t\t\t@blur=\"commitEdit(row, col, $event.target.value)\"\n\t\t\t\t\t\t\t\t@keydown.enter=\"commitEdit(row, col, $event.target.value)\"\n\t\t\t\t\t\t\t\t@keydown.esc=\"cancelEdit\">\n\t\t\t\t\t\t\t<span v-else\n\t\t\t\t\t\t\t\tclass=\"cn-data-matrix__cell-value\"\n\t\t\t\t\t\t\t\t@click=\"startEdit(row, col)\">\n\t\t\t\t\t\t\t\t{{ formatCell(cellValue(row, col), col) }}\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td v-if=\"showRowTotals\" class=\"cn-data-matrix__total-cell\">\n\t\t\t\t\t\t\t{{ formatTotal(rowTotal(row)) }}\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td v-if=\"showRank\" class=\"cn-data-matrix__total-cell cn-data-matrix__rank-cell\">\n\t\t\t\t\t\t\t{{ ranks.has(row[rowIdKey]) ? ranks.get(row[rowIdKey]) : '' }}\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr v-if=\"showColumnTotals\" class=\"cn-data-matrix__totals-row\">\n\t\t\t\t\t\t<th v-if=\"rowHeader\" class=\"cn-data-matrix__totals-label\">\n\t\t\t\t\t\t\t{{ columnTotalsLabel }}\n\t\t\t\t\t\t</th>\n\t\t\t\t\t\t<td v-for=\"col in columns\"\n\t\t\t\t\t\t\t:key=\"col.key\"\n\t\t\t\t\t\t\tclass=\"cn-data-matrix__total-cell\">\n\t\t\t\t\t\t\t{{ formatCell(columnTotal(col), { type: 'number' }) }}\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td v-if=\"showRowTotals\" class=\"cn-data-matrix__total-cell cn-data-matrix__grand-total\">\n\t\t\t\t\t\t\t{{ formatTotal(grandTotal) }}\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td v-if=\"showRank\" class=\"cn-data-matrix__total-cell\" />\n\t\t\t\t\t</tr>\n\t\t\t\t</tbody>\n\t\t\t</table>\n\t\t</div>\n\n\t\t<p v-if=\"rows.length === 0\" class=\"cn-data-matrix__empty\">\n\t\t\t{{ emptyLabel }}\n\t\t</p>\n\t</div>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport { evalFormula } from '../../utils/evalFormula.js'\nimport { userLocale } from '../../utils/userLocale.js'\n\nconst ROUNDERS = Object.freeze({ round: Math.round, ceil: Math.ceil, floor: Math.floor })\n\n/**\n * The number a cell holds; an empty cell is no number, rather than zero.\n *\n * @param {unknown} raw The cell.\n * @return {number|null} The number, or null.\n */\nfunction numberIn(raw) {\n\treturn raw === null || raw === undefined || raw === '' || !Number.isFinite(Number(raw)) ? null : Number(raw)\n}\n\n/**\n * CnDataMatrix — Inline-edit data grid for matrix-shaped data\n * (rows × columns). Each cell is click-to-edit; commits emit\n * `@cell-edit({ rowId, colKey, value })` so the parent can persist.\n * Optional row / column / grand totals computed from the live data\n * with the column's `aggregate` setting (`sum` by default).\n *\n * Use for gradebooks, weight matrices, allocation tables, scoring\n * rubrics — the \"spreadsheet\" shape where cells are independently\n * editable values rather than a row/object form.\n *\n * A column with `formula` computes its cells from the other columns and is\n * read only: `now*(rate/100)`, with `prev_now` for the row above and `round`\n * set to `round`, `ceil` or `floor`. A row where the formula has no answer shows\n * its own stored value. Formulas are arithmetic only, through `evalFormula`.\n *\n * A scoring matrix weighs its columns: give each column a `weight` (and an\n * optional `weightLabel` such as \"40%\"), set `rowTotalsMode=\"weighted\"` and\n * the row total is the weighted mean of the row's scores. `showRank` ranks\n * the rows by that total, highest first, and `highlightTopRank` tints the\n * leading row.\n *\n * Not a full spreadsheet engine — there are no cell-range references, no\n * charts. Consumers wanting that should\n * embed a dedicated library (e.g. handsontable) and use this for\n * the simpler cases.\n *\n * ```vue\n * <CnDataMatrix\n * title=\"Cohort gradebook\"\n * row-header=\"Student\"\n * :rows=\"students\"\n * :columns=\"[\n * { key: 'midterm', label: 'Midterm', type: 'number', aggregate: 'sum' },\n * { key: 'final', label: 'Final', type: 'number', aggregate: 'sum' },\n * { key: 'notes', label: 'Notes', type: 'string', readOnly: true },\n * ]\"\n * :show-row-totals=\"true\"\n * :show-column-totals=\"true\"\n * @cell-edit=\"onCellEdit\" />\n * ```\n */\nexport default {\n\tname: 'CnDataMatrix',\n\tprops: {\n\t\t/**\n\t\t * Row records. Each record holds an `id`, an optional row\n\t\t * label, and one field per column key.\n\t\t *\n\t\t * @type {Array<object>}\n\t\t */\n\t\trows: { type: Array, default: () => [] },\n\t\t/**\n\t\t * Column declarations.\n\t\t *\n\t\t * @type {Array<{key:string,label?:string,type?:'number'|'string',readOnly?:boolean,formula?:string,round?:'round'|'ceil'|'floor',formatter?:(value: unknown) => string,aggregate?:'sum'|'avg'|'count'|'none',width?:string,weight?:number,weightLabel?:string}>}\n\t\t */\n\t\tcolumns: { type: Array, default: () => [] },\n\t\t/** Field on each row carrying its id. */\n\t\trowIdKey: { type: String, default: 'id' },\n\t\t/** Field on each row carrying its label (shown in the row header). */\n\t\trowLabelKey: { type: String, default: 'label' },\n\t\t/** Header for the row-label column (empty hides it). */\n\t\trowHeader: { type: String, default: '' },\n\t\t/** Optional title. */\n\t\ttitle: { type: String, default: '' },\n\t\t/** Optional description. */\n\t\tdescription: { type: String, default: '' },\n\t\t/** Empty-state text when rows[] is empty. */\n\t\temptyLabel: { type: String, default: 'No data.' },\n\t\t/** Disable all cell editing globally. */\n\t\treadOnly: { type: Boolean, default: false },\n\t\t/** Render the per-row totals column. */\n\t\tshowRowTotals: { type: Boolean, default: false },\n\t\t/** Render the per-column totals row at the bottom. */\n\t\tshowColumnTotals: { type: Boolean, default: false },\n\t\t/** Label for the row-totals column header. */\n\t\trowTotalsLabel: { type: String, default: 'Total' },\n\t\t/** Label preceding the column-totals row. */\n\t\tcolumnTotalsLabel: { type: String, default: 'Total' },\n\t\t/**\n\t\t * How a row total is computed: `sum` adds the number columns,\n\t\t * `weighted` takes the mean of the number columns weighted by each\n\t\t * column's `weight`, leaving out a cell without a value.\n\t\t */\n\t\trowTotalsMode: { type: String, default: 'sum', validator: (v) => ['sum', 'weighted'].includes(v) },\n\t\t/** Fraction digits of the totals; null keeps the locale default. */\n\t\ttotalsFractionDigits: { type: Number, default: null },\n\t\t/** Render a rank column: the rows ranked by their row total, highest first, ties sharing a rank. */\n\t\tshowRank: { type: Boolean, default: false },\n\t\t/** Header of the rank column, already translated; the library default is \"Rank\". */\n\t\trankLabel: { type: String, default: '' },\n\t\t/** Tint the row ranked first. */\n\t\thighlightTopRank: { type: Boolean, default: false },\n\t\t/** Field on each row with a second line under its label, such as a price. */\n\t\trowSublabelKey: { type: String, default: '' },\n\t},\n\n\temits: ['cell-edit'],\n\tdata() {\n\t\treturn {\n\t\t\tediting: null, // { rowId, colKey }\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/** @return {string} The rank column header. */\n\t\tresolvedRankLabel() {\n\t\t\treturn this.rankLabel || t('nextcloud-vue', 'Rank')\n\t\t},\n\n\t\t/**\n\t\t * The rank of every row with a row total: highest total first, rows\n\t\t * with an equal total sharing a rank (1, 2, 2, 4).\n\t\t *\n\t\t * @return {Map<unknown, number>} Rank per row id.\n\t\t */\n\t\tranks() {\n\t\t\tconst totals = this.rows\n\t\t\t\t.map((row) => ({ id: row[this.rowIdKey], total: this.rowTotal(row) }))\n\t\t\t\t.filter((entry) => Number.isFinite(entry.total))\n\t\t\t\t.sort((a, b) => b.total - a.total)\n\t\t\tconst ranks = new Map()\n\t\t\ttotals.forEach((entry, index) => {\n\t\t\t\tconst previous = totals[index - 1]\n\t\t\t\tranks.set(entry.id, previous && previous.total === entry.total ? ranks.get(previous.id) : index + 1)\n\t\t\t})\n\t\t\treturn ranks\n\t\t},\n\n\t\t/**\n\t\t * The computed cells of every row, in order. A formula reads the row's\n\t\t * numbers by column key and the previous row's as `prev_<key>`, and sees\n\t\t * formula columns to its left. A formula without an answer has no entry\n\t\t * here, so the cell shows what the row itself holds.\n\t\t *\n\t\t * @return {Map<object, Record<string, number>>} Computed values per row.\n\t\t */\n\t\tformulaValues() {\n\t\t\tconst values = new Map()\n\t\t\tif (!this.columns.some((col) => col.formula)) {\n\t\t\t\treturn values\n\t\t\t}\n\t\t\tlet previous = {}\n\t\t\tfor (const row of this.rows) {\n\t\t\t\tconst vars = { ...previous }\n\t\t\t\tfor (const col of this.columns) {\n\t\t\t\t\tif (!col.formula && numberIn(row[col.key]) !== null) {\n\t\t\t\t\t\tvars[col.key] = numberIn(row[col.key])\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tconst computed = {}\n\t\t\t\tfor (const col of this.columns) {\n\t\t\t\t\tif (col.formula) {\n\t\t\t\t\t\tconst answer = evalFormula(col.formula, vars)\n\t\t\t\t\t\tif (answer !== null) {\n\t\t\t\t\t\t\tcomputed[col.key] = (ROUNDERS[col.round] ?? Number)(answer)\n\t\t\t\t\t\t\tvars[col.key] = computed[col.key]\n\t\t\t\t\t\t} else if (numberIn(row[col.key]) !== null) {\n\t\t\t\t\t\t\tvars[col.key] = numberIn(row[col.key])\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tvalues.set(row, computed)\n\t\t\t\tprevious = Object.fromEntries(Object.entries(vars).filter(([key]) => !key.startsWith('prev_')).map(([key, value]) => [`prev_${key}`, value]))\n\t\t\t}\n\t\t\treturn values\n\t\t},\n\n\t\t/**\n\t\t * Grand total (sum of every numeric cell). Shown in the\n\t\t * bottom-right corner when both totals are enabled.\n\t\t *\n\t\t * @return {number}\n\t\t */\n\t\tgrandTotal() {\n\t\t\tlet total = 0\n\t\t\tfor (const row of this.rows) {\n\t\t\t\tfor (const col of this.columns) {\n\t\t\t\t\tif (col.type === 'number') {\n\t\t\t\t\t\tconst v = Number(this.cellValue(row, col))\n\t\t\t\t\t\tif (Number.isFinite(v)) {\n\t\t\t\t\t\t\ttotal += v\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn total\n\t\t},\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Whether the given (row, col) is the active edit cell.\n\t\t *\n\t\t * @param {object} row Row record.\n\t\t * @param {object} col Column definition.\n\t\t * @return {boolean}\n\t\t */\n\t\tisEditing(row, col) {\n\t\t\treturn this.editing && this.editing.rowId === row[this.rowIdKey] && this.editing.colKey === col.key\n\t\t},\n\n\t\t/**\n\t\t * Effective read-only flag for a single cell.\n\t\t *\n\t\t * @param {object} row Row record.\n\t\t * @param {object} col Column definition.\n\t\t * @return {boolean}\n\t\t */\n\t\tisCellReadOnly(row, col) {\n\t\t\treturn Boolean(col.readOnly || col.formula)\n\t\t},\n\n\t\t/**\n\t\t * Read the cell value from the row.\n\t\t *\n\t\t * @param {object} row Row record.\n\t\t * @param {object} col Column definition.\n\t\t * @return {unknown} The raw value.\n\t\t */\n\t\tcellValue(row, col) {\n\t\t\tif (col.formula && this.formulaValues.get(row)?.[col.key] !== undefined) {\n\t\t\t\treturn this.formulaValues.get(row)[col.key]\n\t\t\t}\n\t\t\treturn row[col.key]\n\t\t},\n\n\t\t/**\n\t\t * Format a cell value for display. Number columns get a\n\t\t * locale-formatted number; others go through the column's\n\t\t * `formatter` (if any) or are returned verbatim.\n\t\t *\n\t\t * @param {unknown} value The raw value.\n\t\t * @param {object} col Column definition.\n\t\t * @return {string} The display string.\n\t\t */\n\t\tformatCell(value, col) {\n\t\t\tif (value === undefined || value === null || value === '') {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tif (typeof col.formatter === 'function') {\n\t\t\t\treturn col.formatter(value)\n\t\t\t}\n\t\t\tif (col.type === 'number') {\n\t\t\t\tconst n = Number(value)\n\t\t\t\tif (!Number.isFinite(n)) {\n\t\t\t\t\treturn value\n\t\t\t\t}\n\t\t\t\treturn n.toLocaleString(userLocale())\n\t\t\t}\n\t\t\treturn value\n\t\t},\n\n\t\t/**\n\t\t * BEM modifier(s) for a cell — currently only the read-only\n\t\t * flag. Consumers extend via the `formatter` if they want\n\t\t * to swap to a styled component.\n\t\t *\n\t\t * @param {object} row Row record.\n\t\t * @param {object} col Column definition.\n\t\t * @return {object} Class binding.\n\t\t */\n\t\tcellClass(row, col) {\n\t\t\treturn {\n\t\t\t\t'cn-data-matrix__cell--read-only': this.readOnly || this.isCellReadOnly(row, col),\n\t\t\t\t'cn-data-matrix__cell--number': col.type === 'number',\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Start editing a cell.\n\t\t *\n\t\t * @param {object} row Row record.\n\t\t * @param {object} col Column definition.\n\t\t * @return {void}\n\t\t */\n\t\tstartEdit(row, col) {\n\t\t\tif (this.readOnly || this.isCellReadOnly(row, col)) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.editing = { rowId: row[this.rowIdKey], colKey: col.key }\n\t\t\tthis.$nextTick(() => {\n\t\t\t\tif (this.$refs.activeInput && this.$refs.activeInput[0]) {\n\t\t\t\t\tthis.$refs.activeInput[0].focus()\n\t\t\t\t\tthis.$refs.activeInput[0].select()\n\t\t\t\t} else if (this.$refs.activeInput && this.$refs.activeInput.focus) {\n\t\t\t\t\tthis.$refs.activeInput.focus()\n\t\t\t\t\tthis.$refs.activeInput.select()\n\t\t\t\t}\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * Commit an edit — coerces the value to the column type and\n\t\t * emits `@cell-edit`.\n\t\t *\n\t\t * @param {object} row Row record.\n\t\t * @param {object} col Column definition.\n\t\t * @param {string} raw The raw input string.\n\t\t * @return {void}\n\t\t */\n\t\tcommitEdit(row, col, raw) {\n\t\t\tif (!this.editing) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tlet value = raw\n\t\t\tif (col.type === 'number') {\n\t\t\t\tconst n = Number(raw)\n\t\t\t\tvalue = Number.isFinite(n) ? n : null\n\t\t\t}\n\t\t\tthis.editing = null\n\t\t\t/**\n\t\t\t * @event cell-edit Emitted on commit (blur or Enter).\n\t\t\t * Payload: `{rowId, colKey, value, row}`.\n\t\t\t * @type {object}\n\t\t\t */\n\t\t\tthis.$emit('cell-edit', { rowId: row[this.rowIdKey], colKey: col.key, value, row })\n\t\t},\n\n\t\t/**\n\t\t * Cancel the active edit (Esc).\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tcancelEdit() {\n\t\t\tthis.editing = null\n\t\t},\n\n\t\t/**\n\t\t * The weight shown beside a column label: `weightLabel`, else the\n\t\t * `weight` itself, or '' for an unweighted column.\n\t\t *\n\t\t * @param {object} col Column definition.\n\t\t * @return {string} The weight text.\n\t\t */\n\t\tweightText(col) {\n\t\t\tif (typeof col.weightLabel === 'string' && col.weightLabel !== '') {\n\t\t\t\treturn col.weightLabel\n\t\t\t}\n\t\t\treturn Number.isFinite(col.weight) ? String(col.weight) : ''\n\t\t},\n\n\t\t/**\n\t\t * Format a total with `totalsFractionDigits` when set.\n\t\t *\n\t\t * @param {number|null} value The total.\n\t\t * @return {string} The display string.\n\t\t */\n\t\tformatTotal(value) {\n\t\t\tif (!Number.isFinite(value)) {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tif (this.totalsFractionDigits === null) {\n\t\t\t\treturn this.formatCell(value, { type: 'number' })\n\t\t\t}\n\t\t\tconst digits = this.totalsFractionDigits\n\t\t\treturn value.toLocaleString(userLocale(), { minimumFractionDigits: digits, maximumFractionDigits: digits })\n\t\t},\n\n\t\t/**\n\t\t * Per-row total: the sum of every numeric column, or in `weighted`\n\t\t * mode the weighted mean over the weighted columns that hold a value\n\t\t * (null when none does).\n\t\t *\n\t\t * @param {object} row Row record.\n\t\t * @return {number|null}\n\t\t */\n\t\trowTotal(row) {\n\t\t\tif (this.rowTotalsMode === 'weighted') {\n\t\t\t\tlet weighted = 0\n\t\t\t\tlet weights = 0\n\t\t\t\tfor (const col of this.columns) {\n\t\t\t\t\tconst raw = this.cellValue(row, col)\n\t\t\t\t\tconst v = Number(raw)\n\t\t\t\t\tif (col.type === 'number' && Number.isFinite(col.weight) && col.weight > 0 && raw !== null && raw !== undefined && raw !== '' && Number.isFinite(v)) {\n\t\t\t\t\t\tweighted += v * col.weight\n\t\t\t\t\t\tweights += col.weight\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn weights > 0 ? weighted / weights : null\n\t\t\t}\n\t\t\tlet total = 0\n\t\t\tfor (const col of this.columns) {\n\t\t\t\tif (col.type === 'number') {\n\t\t\t\t\tconst v = Number(this.cellValue(row, col))\n\t\t\t\t\tif (Number.isFinite(v)) {\n\t\t\t\t\t\ttotal += v\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn total\n\t\t},\n\n\t\t/**\n\t\t * Per-column total — aggregate over all rows using the\n\t\t * column's `aggregate` setting (`sum` by default).\n\t\t *\n\t\t * @param {object} col Column definition.\n\t\t * @return {number}\n\t\t */\n\t\tcolumnTotal(col) {\n\t\t\tif (col.type !== 'number') {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tconst mode = col.aggregate || 'sum'\n\t\t\tif (mode === 'none') {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\t// Drop empty cells (null / undefined / '') BEFORE coercing —\n\t\t\t// `Number(null)` is `0`, which would otherwise be counted and\n\t\t\t// summed as a real zero value.\n\t\t\tconst values = this.rows\n\t\t\t\t.map((r) => this.cellValue(r, col))\n\t\t\t\t.filter((v) => v !== null && v !== undefined && v !== '')\n\t\t\t\t.map((v) => Number(v))\n\t\t\t\t.filter((v) => Number.isFinite(v))\n\t\t\tif (values.length === 0) {\n\t\t\t\treturn 0\n\t\t\t}\n\t\t\tif (mode === 'count') {\n\t\t\t\treturn values.length\n\t\t\t}\n\t\t\tif (mode === 'avg') {\n\t\t\t\treturn values.reduce((a, b) => a + b, 0) / values.length\n\t\t\t}\n\t\t\t// default: sum\n\t\t\treturn values.reduce((a, b) => a + b, 0)\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-data-matrix {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 8px;\n}\n\n.cn-data-matrix__title {\n\tmargin: 0;\n\tfont-size: 1.1em;\n}\n\n.cn-data-matrix__description {\n\tmargin: 4px 0 0;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-data-matrix__scroller {\n\toverflow-x: auto;\n\tborder: 1px solid var(--color-border);\n\tborder-radius: var(--border-radius);\n}\n\n.cn-data-matrix__table {\n\twidth: 100%;\n\tborder-collapse: collapse;\n\tfont-size: 0.95em;\n}\n\n.cn-data-matrix__col-header,\n.cn-data-matrix__row-header-corner,\n.cn-data-matrix__total-header {\n\tbackground: var(--color-background-hover);\n\ttext-align: left;\n\tpadding: 8px 10px;\n\tfont-weight: 600;\n\tborder-bottom: 1px solid var(--color-border);\n\tborder-right: 1px solid var(--color-border);\n}\n\n.cn-data-matrix__row-header {\n\tbackground: var(--color-background-hover);\n\ttext-align: left;\n\tpadding: 6px 10px;\n\tfont-weight: 500;\n\tborder-right: 1px solid var(--color-border);\n\tborder-bottom: 1px solid var(--color-border);\n\tmax-width: 200px;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n}\n\n.cn-data-matrix__cell {\n\tpadding: 0;\n\tborder-right: 1px solid var(--color-border);\n\tborder-bottom: 1px solid var(--color-border);\n\tmin-width: 80px;\n}\n\n.cn-data-matrix__cell--number {\n\ttext-align: right;\n}\n\n.cn-data-matrix__cell-value {\n\tdisplay: block;\n\tpadding: 6px 10px;\n\tcursor: cell;\n\tmin-height: 28px;\n}\n\n.cn-data-matrix__cell--read-only .cn-data-matrix__cell-value {\n\tcursor: default;\n\tbackground: var(--color-background-hover);\n}\n\n.cn-data-matrix__cell-input {\n\twidth: 100%;\n\tpadding: 5px 10px;\n\tborder: 1px solid var(--color-primary-element);\n\tbackground: var(--color-main-background);\n\toutline: none;\n\tfont: inherit;\n}\n\n.cn-data-matrix__totals-row .cn-data-matrix__total-cell,\n.cn-data-matrix__total-header {\n\tbackground: var(--color-background-darker, var(--color-background-hover));\n\tfont-weight: 600;\n\ttext-align: right;\n\tpadding: 6px 10px;\n}\n\n.cn-data-matrix__totals-label {\n\tbackground: var(--color-background-darker, var(--color-background-hover));\n\tfont-weight: 600;\n\tpadding: 6px 10px;\n\ttext-align: left;\n}\n\n.cn-data-matrix__grand-total {\n\tbackground: var(--color-primary-element-light);\n}\n\n.cn-data-matrix__weight {\n\tcolor: var(--color-text-maxcontrast);\n\tfont-weight: 400;\n\twhite-space: nowrap;\n}\n\n.cn-data-matrix__row-sublabel {\n\tdisplay: block;\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 0.85em;\n\tfont-weight: 400;\n}\n\n.cn-data-matrix__row--top > th,\n.cn-data-matrix__row--top > td {\n\tbackground: var(--color-primary-element-light);\n\tcolor: var(--color-primary-element-light-text);\n}\n\n.cn-data-matrix__empty {\n\tcolor: var(--color-text-maxcontrast);\n\tfont-style: italic;\n\tmargin: 16px 0;\n\ttext-align: center;\n}\n</style>\n"],"names":["t"],"mappings":";;;;AAsGA,MAAM,QAAS,GAAE,MAAM,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,OAAO,EAAA;;AAExF;;AAEC;;AAEA;;AAED,SAAS,QAAQ,CAAC,GAAG,EAAE;AACtB,CAAA,OAAO,GAAI,KAAI,IAAG,IAAK,GAAI,KAAI,SAAQ,IAAK,GAAI,KAAI,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,IAAG,GAAI,MAAM,CAAC,GAAG,CAAA;AAC5G,CAAA;;AAEA;;;;;;AAMC;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;;;AAIA;;AAEA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;;;AAGA;;;;AAIA;;AAED,aAAe;AACd,CAAA,IAAI,EAAE,cAAc;AACpB,CAAA,KAAK,EAAE;AACN;;AAEC;AACA;AACA;;AAED,EAAA,IAAI,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,IAAI;AACxC;AACC;AACA;;;AAGD,EAAA,OAAO,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,IAAI;AAC3C;AACA,EAAA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C,EAAE,CAAC,CAAA;GACvC;EACD;AACF;;;;"}
|
|
1
|
+
{"version":3,"file":"CnDataMatrix.vue2.js","sources":["../../../../src/components/CnDataMatrix/CnDataMatrix.vue"],"sourcesContent":["<template>\n\t<div class=\"cn-data-matrix\" data-testid=\"cn-data-matrix\">\n\t\t<header v-if=\"title || description\" class=\"cn-data-matrix__header\">\n\t\t\t<h3 v-if=\"title\" class=\"cn-data-matrix__title\">\n\t\t\t\t{{ title }}\n\t\t\t</h3>\n\t\t\t<p v-if=\"description\" class=\"cn-data-matrix__description\">\n\t\t\t\t{{ description }}\n\t\t\t</p>\n\t\t</header>\n\n\t\t<div class=\"cn-data-matrix__scroller\">\n\t\t\t<table class=\"cn-data-matrix__table\">\n\t\t\t\t<thead>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th v-if=\"rowHeader\" class=\"cn-data-matrix__row-header-corner\">\n\t\t\t\t\t\t\t{{ rowHeader }}\n\t\t\t\t\t\t</th>\n\t\t\t\t\t\t<th v-for=\"col in columns\"\n\t\t\t\t\t\t\t:key=\"col.key\"\n\t\t\t\t\t\t\tclass=\"cn-data-matrix__col-header\"\n\t\t\t\t\t\t\t:style=\"col.width ? { width: col.width } : null\">\n\t\t\t\t\t\t\t{{ col.label || col.key }}\n\t\t\t\t\t\t\t<span v-if=\"weightText(col)\" class=\"cn-data-matrix__weight\">{{ weightText(col) }}</span>\n\t\t\t\t\t\t</th>\n\t\t\t\t\t\t<th v-if=\"showRowTotals\" class=\"cn-data-matrix__total-header\">\n\t\t\t\t\t\t\t{{ rowTotalsLabel }}\n\t\t\t\t\t\t</th>\n\t\t\t\t\t\t<th v-if=\"showRank\" class=\"cn-data-matrix__total-header cn-data-matrix__rank-header\">\n\t\t\t\t\t\t\t{{ resolvedRankLabel }}\n\t\t\t\t\t\t</th>\n\t\t\t\t\t</tr>\n\t\t\t\t</thead>\n\t\t\t\t<tbody>\n\t\t\t\t\t<tr v-for=\"row in rows\"\n\t\t\t\t\t\t:key=\"row[rowIdKey]\"\n\t\t\t\t\t\tclass=\"cn-data-matrix__row\"\n\t\t\t\t\t\t:class=\"{ 'cn-data-matrix__row--top': highlightTopRank && ranks.get(row[rowIdKey]) === 1 }\">\n\t\t\t\t\t\t<th v-if=\"rowHeader\"\n\t\t\t\t\t\t\tscope=\"row\"\n\t\t\t\t\t\t\tclass=\"cn-data-matrix__row-header\"\n\t\t\t\t\t\t\t:title=\"row[rowLabelKey]\">\n\t\t\t\t\t\t\t{{ row[rowLabelKey] }}\n\t\t\t\t\t\t\t<span v-if=\"rowSublabelKey && row[rowSublabelKey]\" class=\"cn-data-matrix__row-sublabel\">{{ row[rowSublabelKey] }}</span>\n\t\t\t\t\t\t</th>\n\t\t\t\t\t\t<td v-for=\"col in columns\"\n\t\t\t\t\t\t\t:key=\"col.key\"\n\t\t\t\t\t\t\tclass=\"cn-data-matrix__cell\"\n\t\t\t\t\t\t\t:class=\"cellClass(row, col)\"\n\t\t\t\t\t\t\t:data-row-id=\"row[rowIdKey]\"\n\t\t\t\t\t\t\t:data-col-key=\"col.key\">\n\t\t\t\t\t\t\t<input v-if=\"isEditing(row, col)\"\n\t\t\t\t\t\t\t\tref=\"activeInput\"\n\t\t\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\t\t\tclass=\"cn-data-matrix__cell-input\"\n\t\t\t\t\t\t\t\t:value=\"cellValue(row, col)\"\n\t\t\t\t\t\t\t\t:aria-label=\"inputLabel(row, col)\"\n\t\t\t\t\t\t\t\t:disabled=\"readOnly || isCellReadOnly(row, col)\"\n\t\t\t\t\t\t\t\t@blur=\"commitEdit(row, col, $event.target.value)\"\n\t\t\t\t\t\t\t\t@keydown=\"onInputKeydown($event, row, col)\">\n\t\t\t\t\t\t\t<span v-else\n\t\t\t\t\t\t\t\tclass=\"cn-data-matrix__cell-value\"\n\t\t\t\t\t\t\t\t:tabindex=\"isCellEditable(row, col) ? 0 : null\"\n\t\t\t\t\t\t\t\t:role=\"isCellEditable(row, col) ? 'button' : null\"\n\t\t\t\t\t\t\t\t:aria-label=\"isCellEditable(row, col) ? cellLabel(row, col) : null\"\n\t\t\t\t\t\t\t\t@click=\"startEdit(row, col)\"\n\t\t\t\t\t\t\t\t@keydown=\"onCellKeydown($event, row, col)\">\n\t\t\t\t\t\t\t\t{{ formatCell(cellValue(row, col), col) }}\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td v-if=\"showRowTotals\" class=\"cn-data-matrix__total-cell\">\n\t\t\t\t\t\t\t{{ formatTotal(rowTotal(row)) }}\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td v-if=\"showRank\" class=\"cn-data-matrix__total-cell cn-data-matrix__rank-cell\">\n\t\t\t\t\t\t\t{{ ranks.has(row[rowIdKey]) ? ranks.get(row[rowIdKey]) : '' }}\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr v-if=\"showColumnTotals\" class=\"cn-data-matrix__totals-row\">\n\t\t\t\t\t\t<th v-if=\"rowHeader\" class=\"cn-data-matrix__totals-label\">\n\t\t\t\t\t\t\t{{ columnTotalsLabel }}\n\t\t\t\t\t\t</th>\n\t\t\t\t\t\t<td v-for=\"col in columns\"\n\t\t\t\t\t\t\t:key=\"col.key\"\n\t\t\t\t\t\t\tclass=\"cn-data-matrix__total-cell\">\n\t\t\t\t\t\t\t{{ formatCell(columnTotal(col), { type: 'number' }) }}\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td v-if=\"showRowTotals\" class=\"cn-data-matrix__total-cell cn-data-matrix__grand-total\">\n\t\t\t\t\t\t\t{{ formatTotal(grandTotal) }}\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td v-if=\"showRank\" class=\"cn-data-matrix__total-cell\" />\n\t\t\t\t\t</tr>\n\t\t\t\t</tbody>\n\t\t\t</table>\n\t\t</div>\n\n\t\t<p v-if=\"rows.length === 0\" class=\"cn-data-matrix__empty\">\n\t\t\t{{ emptyLabel }}\n\t\t</p>\n\t</div>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport { evalFormula } from '../../utils/evalFormula.js'\nimport { userLocale } from '../../utils/userLocale.js'\n\nconst ROUNDERS = Object.freeze({ round: Math.round, ceil: Math.ceil, floor: Math.floor })\n\n/**\n * The number a cell holds; an empty cell is no number, rather than zero.\n *\n * @param {unknown} raw The cell.\n * @return {number|null} The number, or null.\n */\nfunction numberIn(raw) {\n\treturn raw === null || raw === undefined || raw === '' || !Number.isFinite(Number(raw)) ? null : Number(raw)\n}\n\n/**\n * CnDataMatrix — Inline-edit data grid for matrix-shaped data\n * (rows × columns). Each cell is click-to-edit, and keyboard editable:\n * Tab reaches it, Enter or F2 opens it, Enter commits, Escape cancels. Commits emit\n * `@cell-edit({ rowId, colKey, value })` so the parent can persist.\n * Optional row / column / grand totals computed from the live data\n * with the column's `aggregate` setting (`sum` by default).\n *\n * Use for gradebooks, weight matrices, allocation tables, scoring\n * rubrics — the \"spreadsheet\" shape where cells are independently\n * editable values rather than a row/object form.\n *\n * A column with `formula` computes its cells from the other columns and is\n * read only: `now*(rate/100)`, with `prev_now` for the row above and `round`\n * set to `round`, `ceil` or `floor`. A row where the formula has no answer shows\n * its own stored value. Formulas are arithmetic only, through `evalFormula`.\n *\n * A scoring matrix weighs its columns: give each column a `weight` (and an\n * optional `weightLabel` such as \"40%\"), set `rowTotalsMode=\"weighted\"` and\n * the row total is the weighted mean of the row's scores. `showRank` ranks\n * the rows by that total, highest first, and `highlightTopRank` tints the\n * leading row.\n *\n * Not a full spreadsheet engine — there are no cell-range references, no\n * charts. Consumers wanting that should\n * embed a dedicated library (e.g. handsontable) and use this for\n * the simpler cases.\n *\n * ```vue\n * <CnDataMatrix\n * title=\"Cohort gradebook\"\n * row-header=\"Student\"\n * :rows=\"students\"\n * :columns=\"[\n * { key: 'midterm', label: 'Midterm', type: 'number', aggregate: 'sum' },\n * { key: 'final', label: 'Final', type: 'number', aggregate: 'sum' },\n * { key: 'notes', label: 'Notes', type: 'string', readOnly: true },\n * ]\"\n * :show-row-totals=\"true\"\n * :show-column-totals=\"true\"\n * @cell-edit=\"onCellEdit\" />\n * ```\n */\nexport default {\n\tname: 'CnDataMatrix',\n\tprops: {\n\t\t/**\n\t\t * Row records. Each record holds an `id`, an optional row\n\t\t * label, and one field per column key.\n\t\t *\n\t\t * @type {Array<object>}\n\t\t */\n\t\trows: { type: Array, default: () => [] },\n\t\t/**\n\t\t * Column declarations.\n\t\t *\n\t\t * @type {Array<{key:string,label?:string,type?:'number'|'string',readOnly?:boolean,formula?:string,round?:'round'|'ceil'|'floor',formatter?:(value: unknown) => string,aggregate?:'sum'|'avg'|'count'|'none',width?:string,weight?:number,weightLabel?:string}>}\n\t\t */\n\t\tcolumns: { type: Array, default: () => [] },\n\t\t/** Field on each row carrying its id. */\n\t\trowIdKey: { type: String, default: 'id' },\n\t\t/** Field on each row carrying its label (shown in the row header). */\n\t\trowLabelKey: { type: String, default: 'label' },\n\t\t/** Header for the row-label column (empty hides it). */\n\t\trowHeader: { type: String, default: '' },\n\t\t/** Optional title. */\n\t\ttitle: { type: String, default: '' },\n\t\t/** Optional description. */\n\t\tdescription: { type: String, default: '' },\n\t\t/** Empty-state text when rows[] is empty. */\n\t\temptyLabel: { type: String, default: 'No data.' },\n\t\t/** Disable all cell editing globally. */\n\t\treadOnly: { type: Boolean, default: false },\n\t\t/** Render the per-row totals column. */\n\t\tshowRowTotals: { type: Boolean, default: false },\n\t\t/** Render the per-column totals row at the bottom. */\n\t\tshowColumnTotals: { type: Boolean, default: false },\n\t\t/** Label for the row-totals column header. */\n\t\trowTotalsLabel: { type: String, default: 'Total' },\n\t\t/** Label preceding the column-totals row. */\n\t\tcolumnTotalsLabel: { type: String, default: 'Total' },\n\t\t/**\n\t\t * How a row total is computed: `sum` adds the number columns,\n\t\t * `weighted` takes the mean of the number columns weighted by each\n\t\t * column's `weight`, leaving out a cell without a value.\n\t\t */\n\t\trowTotalsMode: { type: String, default: 'sum', validator: (v) => ['sum', 'weighted'].includes(v) },\n\t\t/** Fraction digits of the totals; null keeps the locale default. */\n\t\ttotalsFractionDigits: { type: Number, default: null },\n\t\t/** Render a rank column: the rows ranked by their row total, highest first, ties sharing a rank. */\n\t\tshowRank: { type: Boolean, default: false },\n\t\t/** Header of the rank column, already translated; the library default is \"Rank\". */\n\t\trankLabel: { type: String, default: '' },\n\t\t/** Tint the row ranked first. */\n\t\thighlightTopRank: { type: Boolean, default: false },\n\t\t/** Field on each row with a second line under its label, such as a price. */\n\t\trowSublabelKey: { type: String, default: '' },\n\t},\n\n\temits: ['cell-edit'],\n\tdata() {\n\t\treturn {\n\t\t\tediting: null, // { rowId, colKey }\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/** @return {string} The rank column header. */\n\t\tresolvedRankLabel() {\n\t\t\treturn this.rankLabel || t('nextcloud-vue', 'Rank')\n\t\t},\n\n\t\t/**\n\t\t * The rank of every row with a row total: highest total first, rows\n\t\t * with an equal total sharing a rank (1, 2, 2, 4).\n\t\t *\n\t\t * @return {Map<unknown, number>} Rank per row id.\n\t\t */\n\t\tranks() {\n\t\t\tconst totals = this.rows\n\t\t\t\t.map((row) => ({ id: row[this.rowIdKey], total: this.rowTotal(row) }))\n\t\t\t\t.filter((entry) => Number.isFinite(entry.total))\n\t\t\t\t.sort((a, b) => b.total - a.total)\n\t\t\tconst ranks = new Map()\n\t\t\ttotals.forEach((entry, index) => {\n\t\t\t\tconst previous = totals[index - 1]\n\t\t\t\tranks.set(entry.id, previous && previous.total === entry.total ? ranks.get(previous.id) : index + 1)\n\t\t\t})\n\t\t\treturn ranks\n\t\t},\n\n\t\t/**\n\t\t * The computed cells of every row, in order. A formula reads the row's\n\t\t * numbers by column key and the previous row's as `prev_<key>`, and sees\n\t\t * formula columns to its left. A formula without an answer has no entry\n\t\t * here, so the cell shows what the row itself holds.\n\t\t *\n\t\t * @return {Map<object, Record<string, number>>} Computed values per row.\n\t\t */\n\t\tformulaValues() {\n\t\t\tconst values = new Map()\n\t\t\tif (!this.columns.some((col) => col.formula)) {\n\t\t\t\treturn values\n\t\t\t}\n\t\t\tlet previous = {}\n\t\t\tfor (const row of this.rows) {\n\t\t\t\tconst vars = { ...previous }\n\t\t\t\tfor (const col of this.columns) {\n\t\t\t\t\tif (!col.formula && numberIn(row[col.key]) !== null) {\n\t\t\t\t\t\tvars[col.key] = numberIn(row[col.key])\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tconst computed = {}\n\t\t\t\tfor (const col of this.columns) {\n\t\t\t\t\tif (col.formula) {\n\t\t\t\t\t\tconst answer = evalFormula(col.formula, vars)\n\t\t\t\t\t\tif (answer !== null) {\n\t\t\t\t\t\t\tcomputed[col.key] = (ROUNDERS[col.round] ?? Number)(answer)\n\t\t\t\t\t\t\tvars[col.key] = computed[col.key]\n\t\t\t\t\t\t} else if (numberIn(row[col.key]) !== null) {\n\t\t\t\t\t\t\tvars[col.key] = numberIn(row[col.key])\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tvalues.set(row, computed)\n\t\t\t\tprevious = Object.fromEntries(Object.entries(vars).filter(([key]) => !key.startsWith('prev_')).map(([key, value]) => [`prev_${key}`, value]))\n\t\t\t}\n\t\t\treturn values\n\t\t},\n\n\t\t/**\n\t\t * Grand total (sum of every numeric cell). Shown in the\n\t\t * bottom-right corner when both totals are enabled.\n\t\t *\n\t\t * @return {number}\n\t\t */\n\t\tgrandTotal() {\n\t\t\tlet total = 0\n\t\t\tfor (const row of this.rows) {\n\t\t\t\tfor (const col of this.columns) {\n\t\t\t\t\tif (col.type === 'number') {\n\t\t\t\t\t\tconst v = Number(this.cellValue(row, col))\n\t\t\t\t\t\tif (Number.isFinite(v)) {\n\t\t\t\t\t\t\ttotal += v\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn total\n\t\t},\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Whether the given (row, col) is the active edit cell.\n\t\t *\n\t\t * @param {object} row Row record.\n\t\t * @param {object} col Column definition.\n\t\t * @return {boolean}\n\t\t */\n\t\tisEditing(row, col) {\n\t\t\treturn this.editing && this.editing.rowId === row[this.rowIdKey] && this.editing.colKey === col.key\n\t\t},\n\n\t\t/**\n\t\t * Effective read-only flag for a single cell.\n\t\t *\n\t\t * @param {object} row Row record.\n\t\t * @param {object} col Column definition.\n\t\t * @return {boolean}\n\t\t */\n\t\tisCellReadOnly(row, col) {\n\t\t\treturn Boolean(col.readOnly || col.formula)\n\t\t},\n\n\t\t/**\n\t\t * Whether a cell can be edited, and so takes keyboard focus.\n\t\t *\n\t\t * @param {object} row Row record.\n\t\t * @param {object} col Column definition.\n\t\t * @return {boolean}\n\t\t */\n\t\tisCellEditable(row, col) {\n\t\t\treturn !this.readOnly && !this.isCellReadOnly(row, col)\n\t\t},\n\n\t\t/**\n\t\t * Accessible name of a cell's input: its column and row.\n\t\t *\n\t\t * @param {object} row Row record.\n\t\t * @param {object} col Column definition.\n\t\t * @return {string} The label.\n\t\t */\n\t\tinputLabel(row, col) {\n\t\t\treturn t('nextcloud-vue', '{column}, {row}', {\n\t\t\t\tcolumn: col.label || col.key,\n\t\t\t\trow: row[this.rowLabelKey] ?? row[this.rowIdKey],\n\t\t\t}, undefined, { escape: false })\n\t\t},\n\n\t\t/**\n\t\t * Accessible name of an editable cell: its column, row and value.\n\t\t *\n\t\t * @param {object} row Row record.\n\t\t * @param {object} col Column definition.\n\t\t * @return {string} The label.\n\t\t */\n\t\tcellLabel(row, col) {\n\t\t\tconst value = this.formatCell(this.cellValue(row, col), col)\n\t\t\tconst vars = { cell: this.inputLabel(row, col), value: String(value) }\n\t\t\treturn value === ''\n\t\t\t\t? t('nextcloud-vue', '{cell}: empty', vars, undefined, { escape: false })\n\t\t\t\t: t('nextcloud-vue', '{cell}: {value}', vars, undefined, { escape: false })\n\t\t},\n\n\t\t/**\n\t\t * Enter or F2 on a focused cell starts editing it.\n\t\t *\n\t\t * @param {KeyboardEvent} event The key event.\n\t\t * @param {object} row Row record.\n\t\t * @param {object} col Column definition.\n\t\t * @return {void}\n\t\t */\n\t\tonCellKeydown(event, row, col) {\n\t\t\tif ((event.key === 'Enter' || event.key === 'F2') && this.isCellEditable(row, col)) {\n\t\t\t\tevent.preventDefault()\n\t\t\t\tthis.startEdit(row, col)\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Enter commits and Escape cancels the edit; both return focus to the cell.\n\t\t *\n\t\t * @param {KeyboardEvent} event The key event.\n\t\t * @param {object} row Row record.\n\t\t * @param {object} col Column definition.\n\t\t * @return {void}\n\t\t */\n\t\tonInputKeydown(event, row, col) {\n\t\t\tif (event.key === 'Enter') {\n\t\t\t\tevent.preventDefault()\n\t\t\t\tthis.commitEdit(row, col, event.target.value)\n\t\t\t\tthis.focusCell(row, col)\n\t\t\t} else if (event.key === 'Escape' || event.key === 'Esc') {\n\t\t\t\tevent.preventDefault()\n\t\t\t\tthis.cancelEdit()\n\t\t\t\tthis.focusCell(row, col)\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Move focus to a cell's value after the edit input is gone.\n\t\t *\n\t\t * @param {object} row Row record.\n\t\t * @param {object} col Column definition.\n\t\t * @return {void}\n\t\t */\n\t\tfocusCell(row, col) {\n\t\t\tconst rowId = String(row[this.rowIdKey])\n\t\t\tthis.$nextTick(() => {\n\t\t\t\tconst cell = Array.from(this.$el.querySelectorAll('.cn-data-matrix__cell'))\n\t\t\t\t\t.find((td) => td.dataset.rowId === rowId && td.dataset.colKey === col.key)\n\t\t\t\tcell?.querySelector('.cn-data-matrix__cell-value')?.focus()\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * Read the cell value from the row.\n\t\t *\n\t\t * @param {object} row Row record.\n\t\t * @param {object} col Column definition.\n\t\t * @return {unknown} The raw value.\n\t\t */\n\t\tcellValue(row, col) {\n\t\t\tif (col.formula && this.formulaValues.get(row)?.[col.key] !== undefined) {\n\t\t\t\treturn this.formulaValues.get(row)[col.key]\n\t\t\t}\n\t\t\treturn row[col.key]\n\t\t},\n\n\t\t/**\n\t\t * Format a cell value for display. Number columns get a\n\t\t * locale-formatted number; others go through the column's\n\t\t * `formatter` (if any) or are returned verbatim.\n\t\t *\n\t\t * @param {unknown} value The raw value.\n\t\t * @param {object} col Column definition.\n\t\t * @return {string} The display string.\n\t\t */\n\t\tformatCell(value, col) {\n\t\t\tif (value === undefined || value === null || value === '') {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tif (typeof col.formatter === 'function') {\n\t\t\t\treturn col.formatter(value)\n\t\t\t}\n\t\t\tif (col.type === 'number') {\n\t\t\t\tconst n = Number(value)\n\t\t\t\tif (!Number.isFinite(n)) {\n\t\t\t\t\treturn value\n\t\t\t\t}\n\t\t\t\treturn n.toLocaleString(userLocale())\n\t\t\t}\n\t\t\treturn value\n\t\t},\n\n\t\t/**\n\t\t * BEM modifier(s) for a cell — currently only the read-only\n\t\t * flag. Consumers extend via the `formatter` if they want\n\t\t * to swap to a styled component.\n\t\t *\n\t\t * @param {object} row Row record.\n\t\t * @param {object} col Column definition.\n\t\t * @return {object} Class binding.\n\t\t */\n\t\tcellClass(row, col) {\n\t\t\treturn {\n\t\t\t\t'cn-data-matrix__cell--read-only': this.readOnly || this.isCellReadOnly(row, col),\n\t\t\t\t'cn-data-matrix__cell--number': col.type === 'number',\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Start editing a cell.\n\t\t *\n\t\t * @param {object} row Row record.\n\t\t * @param {object} col Column definition.\n\t\t * @return {void}\n\t\t */\n\t\tstartEdit(row, col) {\n\t\t\tif (this.readOnly || this.isCellReadOnly(row, col)) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.editing = { rowId: row[this.rowIdKey], colKey: col.key }\n\t\t\tthis.$nextTick(() => {\n\t\t\t\tif (this.$refs.activeInput && this.$refs.activeInput[0]) {\n\t\t\t\t\tthis.$refs.activeInput[0].focus()\n\t\t\t\t\tthis.$refs.activeInput[0].select()\n\t\t\t\t} else if (this.$refs.activeInput && this.$refs.activeInput.focus) {\n\t\t\t\t\tthis.$refs.activeInput.focus()\n\t\t\t\t\tthis.$refs.activeInput.select()\n\t\t\t\t}\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * Commit an edit — coerces the value to the column type and\n\t\t * emits `@cell-edit`.\n\t\t *\n\t\t * @param {object} row Row record.\n\t\t * @param {object} col Column definition.\n\t\t * @param {string} raw The raw input string.\n\t\t * @return {void}\n\t\t */\n\t\tcommitEdit(row, col, raw) {\n\t\t\tif (!this.editing) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tlet value = raw\n\t\t\tif (col.type === 'number') {\n\t\t\t\tconst n = Number(raw)\n\t\t\t\tvalue = Number.isFinite(n) ? n : null\n\t\t\t}\n\t\t\tthis.editing = null\n\t\t\t/**\n\t\t\t * @event cell-edit Emitted on commit (blur or Enter).\n\t\t\t * Payload: `{rowId, colKey, value, row}`.\n\t\t\t * @type {object}\n\t\t\t */\n\t\t\tthis.$emit('cell-edit', { rowId: row[this.rowIdKey], colKey: col.key, value, row })\n\t\t},\n\n\t\t/**\n\t\t * Cancel the active edit (Esc).\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tcancelEdit() {\n\t\t\tthis.editing = null\n\t\t},\n\n\t\t/**\n\t\t * The weight shown beside a column label: `weightLabel`, else the\n\t\t * `weight` itself, or '' for an unweighted column.\n\t\t *\n\t\t * @param {object} col Column definition.\n\t\t * @return {string} The weight text.\n\t\t */\n\t\tweightText(col) {\n\t\t\tif (typeof col.weightLabel === 'string' && col.weightLabel !== '') {\n\t\t\t\treturn col.weightLabel\n\t\t\t}\n\t\t\treturn Number.isFinite(col.weight) ? String(col.weight) : ''\n\t\t},\n\n\t\t/**\n\t\t * Format a total with `totalsFractionDigits` when set.\n\t\t *\n\t\t * @param {number|null} value The total.\n\t\t * @return {string} The display string.\n\t\t */\n\t\tformatTotal(value) {\n\t\t\tif (!Number.isFinite(value)) {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tif (this.totalsFractionDigits === null) {\n\t\t\t\treturn this.formatCell(value, { type: 'number' })\n\t\t\t}\n\t\t\tconst digits = this.totalsFractionDigits\n\t\t\treturn value.toLocaleString(userLocale(), { minimumFractionDigits: digits, maximumFractionDigits: digits })\n\t\t},\n\n\t\t/**\n\t\t * Per-row total: the sum of every numeric column, or in `weighted`\n\t\t * mode the weighted mean over the weighted columns that hold a value\n\t\t * (null when none does).\n\t\t *\n\t\t * @param {object} row Row record.\n\t\t * @return {number|null}\n\t\t */\n\t\trowTotal(row) {\n\t\t\tif (this.rowTotalsMode === 'weighted') {\n\t\t\t\tlet weighted = 0\n\t\t\t\tlet weights = 0\n\t\t\t\tfor (const col of this.columns) {\n\t\t\t\t\tconst raw = this.cellValue(row, col)\n\t\t\t\t\tconst v = Number(raw)\n\t\t\t\t\tif (col.type === 'number' && Number.isFinite(col.weight) && col.weight > 0 && raw !== null && raw !== undefined && raw !== '' && Number.isFinite(v)) {\n\t\t\t\t\t\tweighted += v * col.weight\n\t\t\t\t\t\tweights += col.weight\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn weights > 0 ? weighted / weights : null\n\t\t\t}\n\t\t\tlet total = 0\n\t\t\tfor (const col of this.columns) {\n\t\t\t\tif (col.type === 'number') {\n\t\t\t\t\tconst v = Number(this.cellValue(row, col))\n\t\t\t\t\tif (Number.isFinite(v)) {\n\t\t\t\t\t\ttotal += v\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn total\n\t\t},\n\n\t\t/**\n\t\t * Per-column total — aggregate over all rows using the\n\t\t * column's `aggregate` setting (`sum` by default).\n\t\t *\n\t\t * @param {object} col Column definition.\n\t\t * @return {number}\n\t\t */\n\t\tcolumnTotal(col) {\n\t\t\tif (col.type !== 'number') {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tconst mode = col.aggregate || 'sum'\n\t\t\tif (mode === 'none') {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\t// Drop empty cells (null / undefined / '') BEFORE coercing —\n\t\t\t// `Number(null)` is `0`, which would otherwise be counted and\n\t\t\t// summed as a real zero value.\n\t\t\tconst values = this.rows\n\t\t\t\t.map((r) => this.cellValue(r, col))\n\t\t\t\t.filter((v) => v !== null && v !== undefined && v !== '')\n\t\t\t\t.map((v) => Number(v))\n\t\t\t\t.filter((v) => Number.isFinite(v))\n\t\t\tif (values.length === 0) {\n\t\t\t\treturn 0\n\t\t\t}\n\t\t\tif (mode === 'count') {\n\t\t\t\treturn values.length\n\t\t\t}\n\t\t\tif (mode === 'avg') {\n\t\t\t\treturn values.reduce((a, b) => a + b, 0) / values.length\n\t\t\t}\n\t\t\t// default: sum\n\t\t\treturn values.reduce((a, b) => a + b, 0)\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-data-matrix {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 8px;\n}\n\n.cn-data-matrix__title {\n\tmargin: 0;\n\tfont-size: 1.1em;\n}\n\n.cn-data-matrix__description {\n\tmargin: 4px 0 0;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-data-matrix__scroller {\n\toverflow-x: auto;\n\tborder: 1px solid var(--color-border);\n\tborder-radius: var(--border-radius);\n}\n\n.cn-data-matrix__table {\n\twidth: 100%;\n\tborder-collapse: collapse;\n\tfont-size: 0.95em;\n}\n\n.cn-data-matrix__col-header,\n.cn-data-matrix__row-header-corner,\n.cn-data-matrix__total-header {\n\tbackground: var(--color-background-hover);\n\ttext-align: left;\n\tpadding: 8px 10px;\n\tfont-weight: 600;\n\tborder-bottom: 1px solid var(--color-border);\n\tborder-right: 1px solid var(--color-border);\n}\n\n.cn-data-matrix__row-header {\n\tbackground: var(--color-background-hover);\n\ttext-align: left;\n\tpadding: 6px 10px;\n\tfont-weight: 500;\n\tborder-right: 1px solid var(--color-border);\n\tborder-bottom: 1px solid var(--color-border);\n\tmax-width: 200px;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n}\n\n.cn-data-matrix__cell {\n\tpadding: 0;\n\tborder-right: 1px solid var(--color-border);\n\tborder-bottom: 1px solid var(--color-border);\n\tmin-width: 80px;\n}\n\n.cn-data-matrix__cell--number {\n\ttext-align: right;\n}\n\n.cn-data-matrix__cell-value {\n\tdisplay: block;\n\tpadding: 6px 10px;\n\tcursor: cell;\n\tmin-height: 28px;\n}\n\n.cn-data-matrix__cell-value:focus-visible {\n\toutline: 2px solid var(--color-primary-element);\n\toutline-offset: -2px;\n}\n\n.cn-data-matrix__cell--read-only .cn-data-matrix__cell-value {\n\tcursor: default;\n\tbackground: var(--color-background-hover);\n}\n\n.cn-data-matrix__cell-input {\n\twidth: 100%;\n\tpadding: 5px 10px;\n\tborder: 1px solid var(--color-primary-element);\n\tbackground: var(--color-main-background);\n\toutline: none;\n\tfont: inherit;\n}\n\n.cn-data-matrix__totals-row .cn-data-matrix__total-cell,\n.cn-data-matrix__total-header {\n\tbackground: var(--color-background-darker, var(--color-background-hover));\n\tfont-weight: 600;\n\ttext-align: right;\n\tpadding: 6px 10px;\n}\n\n.cn-data-matrix__totals-label {\n\tbackground: var(--color-background-darker, var(--color-background-hover));\n\tfont-weight: 600;\n\tpadding: 6px 10px;\n\ttext-align: left;\n}\n\n.cn-data-matrix__grand-total {\n\tbackground: var(--color-primary-element-light);\n}\n\n.cn-data-matrix__weight {\n\tcolor: var(--color-text-maxcontrast);\n\tfont-weight: 400;\n\twhite-space: nowrap;\n}\n\n.cn-data-matrix__row-sublabel {\n\tdisplay: block;\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 0.85em;\n\tfont-weight: 400;\n}\n\n.cn-data-matrix__row--top > th,\n.cn-data-matrix__row--top > td {\n\tbackground: var(--color-primary-element-light);\n\tcolor: var(--color-primary-element-light-text);\n}\n\n.cn-data-matrix__empty {\n\tcolor: var(--color-text-maxcontrast);\n\tfont-style: italic;\n\tmargin: 16px 0;\n\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CAAC,SAAU,IAAG,MAAI;AAClC,GAAA,IAAI,IAAK,KAAI,MAAM,EAAE;AACpB,IAAA,OAAO,EAAC;AACT,IAAA;;;;AAIA,GAAA,MAAM,MAAO,GAAE,IAAI,CAAC,IAAG;AACtB,KAAC,GAAG,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,GAAG,CAAC,CAAA;AAClC,KAAC,MAAM,CAAC,CAAC,CAAC,KAAK,MAAM,IAAK,IAAG,CAAA,KAAM,SAAQ,IAAK,CAAA,KAAM,EAAE,CAAA;AACxD,KAAC,GAAG,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,CAAC,CAAC,CAAA;AACrB,KAAC,MAAM,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAA;AAClC,GAAA,IAAI,MAAM,CAAC,MAAK,KAAM,CAAC,EAAE;AACxB,IAAA,OAAO,CAAA;AACR,IAAA;AACA,GAAA,IAAI,SAAS,OAAO,EAAE;AACrB,IAAA,OAAO,MAAM,CAAC,MAAK;AACpB,IAAA;AACA,GAAA,IAAI,IAAK,KAAI,KAAK,EAAE;IACnB,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAE,GAAE,CAAC,EAAE,CAAC,IAAI,MAAM,CAAC,MAAK;AACxD,IAAA;;AAEA,GAAA,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAA,GAAI,CAAC,EAAE,CAAC,CAAA;GACvC;EACD;AACF;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { openBlock, createElementBlock, toDisplayString, createCommentVNode, createElementVNode, Fragment, renderList, normalizeStyle, createTextVNode, normalizeClass
|
|
1
|
+
import { openBlock, createElementBlock, toDisplayString, createCommentVNode, createElementVNode, Fragment, renderList, normalizeStyle, createTextVNode, normalizeClass } from 'vue';
|
|
2
2
|
|
|
3
3
|
const _hoisted_1 = {
|
|
4
4
|
class: "cn-data-matrix",
|
|
@@ -40,8 +40,8 @@ const _hoisted_12 = {
|
|
|
40
40
|
class: "cn-data-matrix__row-sublabel"
|
|
41
41
|
};
|
|
42
42
|
const _hoisted_13 = ["data-row-id", "data-col-key"];
|
|
43
|
-
const _hoisted_14 = ["value", "disabled", "onBlur", "onKeydown"];
|
|
44
|
-
const _hoisted_15 = ["onClick"];
|
|
43
|
+
const _hoisted_14 = ["value", "aria-label", "disabled", "onBlur", "onKeydown"];
|
|
44
|
+
const _hoisted_15 = ["tabindex", "role", "aria-label", "onClick", "onKeydown"];
|
|
45
45
|
const _hoisted_16 = {
|
|
46
46
|
key: 1,
|
|
47
47
|
class: "cn-data-matrix__total-cell"
|
|
@@ -144,18 +144,20 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
144
144
|
type: "text",
|
|
145
145
|
class: "cn-data-matrix__cell-input",
|
|
146
146
|
value: $options.cellValue(row, col),
|
|
147
|
+
"aria-label": $options.inputLabel(row, col),
|
|
147
148
|
disabled: $props.readOnly || $options.isCellReadOnly(row, col),
|
|
148
149
|
onBlur: $event => ($options.commitEdit(row, col, $event.target.value)),
|
|
149
|
-
onKeydown:
|
|
150
|
-
withKeys($event => ($options.commitEdit(row, col, $event.target.value)), ["enter"]),
|
|
151
|
-
_cache[0] || (_cache[0] = withKeys((...args) => ($options.cancelEdit && $options.cancelEdit(...args)), ["esc"]))
|
|
152
|
-
]
|
|
150
|
+
onKeydown: $event => ($options.onInputKeydown($event, row, col))
|
|
153
151
|
}, null, 40 /* PROPS, NEED_HYDRATION */, _hoisted_14))
|
|
154
152
|
: (openBlock(), createElementBlock("span", {
|
|
155
153
|
key: 1,
|
|
156
154
|
class: "cn-data-matrix__cell-value",
|
|
157
|
-
|
|
158
|
-
|
|
155
|
+
tabindex: $options.isCellEditable(row, col) ? 0 : null,
|
|
156
|
+
role: $options.isCellEditable(row, col) ? 'button' : null,
|
|
157
|
+
"aria-label": $options.isCellEditable(row, col) ? $options.cellLabel(row, col) : null,
|
|
158
|
+
onClick: $event => ($options.startEdit(row, col)),
|
|
159
|
+
onKeydown: $event => ($options.onCellKeydown($event, row, col))
|
|
160
|
+
}, toDisplayString($options.formatCell($options.cellValue(row, col), col)), 41 /* TEXT, PROPS, NEED_HYDRATION */, _hoisted_15))
|
|
159
161
|
], 10 /* CLASS, PROPS */, _hoisted_13))
|
|
160
162
|
}), 128 /* KEYED_FRAGMENT */)),
|
|
161
163
|
($props.showRowTotals)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CnDataMatrix.vue3.js","sources":["../../../../src/components/CnDataMatrix/CnDataMatrix.vue?vue&type=template&id=401dc886&lang.js"],"sourcesContent":["<template>\n\t<div class=\"cn-data-matrix\" data-testid=\"cn-data-matrix\">\n\t\t<header v-if=\"title || description\" class=\"cn-data-matrix__header\">\n\t\t\t<h3 v-if=\"title\" class=\"cn-data-matrix__title\">\n\t\t\t\t{{ title }}\n\t\t\t</h3>\n\t\t\t<p v-if=\"description\" class=\"cn-data-matrix__description\">\n\t\t\t\t{{ description }}\n\t\t\t</p>\n\t\t</header>\n\n\t\t<div class=\"cn-data-matrix__scroller\">\n\t\t\t<table class=\"cn-data-matrix__table\">\n\t\t\t\t<thead>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th v-if=\"rowHeader\" class=\"cn-data-matrix__row-header-corner\">\n\t\t\t\t\t\t\t{{ rowHeader }}\n\t\t\t\t\t\t</th>\n\t\t\t\t\t\t<th v-for=\"col in columns\"\n\t\t\t\t\t\t\t:key=\"col.key\"\n\t\t\t\t\t\t\tclass=\"cn-data-matrix__col-header\"\n\t\t\t\t\t\t\t:style=\"col.width ? { width: col.width } : null\">\n\t\t\t\t\t\t\t{{ col.label || col.key }}\n\t\t\t\t\t\t\t<span v-if=\"weightText(col)\" class=\"cn-data-matrix__weight\">{{ weightText(col) }}</span>\n\t\t\t\t\t\t</th>\n\t\t\t\t\t\t<th v-if=\"showRowTotals\" class=\"cn-data-matrix__total-header\">\n\t\t\t\t\t\t\t{{ rowTotalsLabel }}\n\t\t\t\t\t\t</th>\n\t\t\t\t\t\t<th v-if=\"showRank\" class=\"cn-data-matrix__total-header cn-data-matrix__rank-header\">\n\t\t\t\t\t\t\t{{ resolvedRankLabel }}\n\t\t\t\t\t\t</th>\n\t\t\t\t\t</tr>\n\t\t\t\t</thead>\n\t\t\t\t<tbody>\n\t\t\t\t\t<tr v-for=\"row in rows\"\n\t\t\t\t\t\t:key=\"row[rowIdKey]\"\n\t\t\t\t\t\tclass=\"cn-data-matrix__row\"\n\t\t\t\t\t\t:class=\"{ 'cn-data-matrix__row--top': highlightTopRank && ranks.get(row[rowIdKey]) === 1 }\">\n\t\t\t\t\t\t<th v-if=\"rowHeader\"\n\t\t\t\t\t\t\tscope=\"row\"\n\t\t\t\t\t\t\tclass=\"cn-data-matrix__row-header\"\n\t\t\t\t\t\t\t:title=\"row[rowLabelKey]\">\n\t\t\t\t\t\t\t{{ row[rowLabelKey] }}\n\t\t\t\t\t\t\t<span v-if=\"rowSublabelKey && row[rowSublabelKey]\" class=\"cn-data-matrix__row-sublabel\">{{ row[rowSublabelKey] }}</span>\n\t\t\t\t\t\t</th>\n\t\t\t\t\t\t<td v-for=\"col in columns\"\n\t\t\t\t\t\t\t:key=\"col.key\"\n\t\t\t\t\t\t\tclass=\"cn-data-matrix__cell\"\n\t\t\t\t\t\t\t:class=\"cellClass(row, col)\"\n\t\t\t\t\t\t\t:data-row-id=\"row[rowIdKey]\"\n\t\t\t\t\t\t\t:data-col-key=\"col.key\">\n\t\t\t\t\t\t\t<input v-if=\"isEditing(row, col)\"\n\t\t\t\t\t\t\t\tref=\"activeInput\"\n\t\t\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\t\t\tclass=\"cn-data-matrix__cell-input\"\n\t\t\t\t\t\t\t\t:value=\"cellValue(row, col)\"\n\t\t\t\t\t\t\t\t:disabled=\"readOnly || isCellReadOnly(row, col)\"\n\t\t\t\t\t\t\t\t@blur=\"commitEdit(row, col, $event.target.value)\"\n\t\t\t\t\t\t\t\t@keydown.enter=\"commitEdit(row, col, $event.target.value)\"\n\t\t\t\t\t\t\t\t@keydown.esc=\"cancelEdit\">\n\t\t\t\t\t\t\t<span v-else\n\t\t\t\t\t\t\t\tclass=\"cn-data-matrix__cell-value\"\n\t\t\t\t\t\t\t\t@click=\"startEdit(row, col)\">\n\t\t\t\t\t\t\t\t{{ formatCell(cellValue(row, col), col) }}\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td v-if=\"showRowTotals\" class=\"cn-data-matrix__total-cell\">\n\t\t\t\t\t\t\t{{ formatTotal(rowTotal(row)) }}\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td v-if=\"showRank\" class=\"cn-data-matrix__total-cell cn-data-matrix__rank-cell\">\n\t\t\t\t\t\t\t{{ ranks.has(row[rowIdKey]) ? ranks.get(row[rowIdKey]) : '' }}\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr v-if=\"showColumnTotals\" class=\"cn-data-matrix__totals-row\">\n\t\t\t\t\t\t<th v-if=\"rowHeader\" class=\"cn-data-matrix__totals-label\">\n\t\t\t\t\t\t\t{{ columnTotalsLabel }}\n\t\t\t\t\t\t</th>\n\t\t\t\t\t\t<td v-for=\"col in columns\"\n\t\t\t\t\t\t\t:key=\"col.key\"\n\t\t\t\t\t\t\tclass=\"cn-data-matrix__total-cell\">\n\t\t\t\t\t\t\t{{ formatCell(columnTotal(col), { type: 'number' }) }}\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td v-if=\"showRowTotals\" class=\"cn-data-matrix__total-cell cn-data-matrix__grand-total\">\n\t\t\t\t\t\t\t{{ formatTotal(grandTotal) }}\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td v-if=\"showRank\" class=\"cn-data-matrix__total-cell\" />\n\t\t\t\t\t</tr>\n\t\t\t\t</tbody>\n\t\t\t</table>\n\t\t</div>\n\n\t\t<p v-if=\"rows.length === 0\" class=\"cn-data-matrix__empty\">\n\t\t\t{{ emptyLabel }}\n\t\t</p>\n\t</div>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport { evalFormula } from '../../utils/evalFormula.js'\nimport { userLocale } from '../../utils/userLocale.js'\n\nconst ROUNDERS = Object.freeze({ round: Math.round, ceil: Math.ceil, floor: Math.floor })\n\n/**\n * The number a cell holds; an empty cell is no number, rather than zero.\n *\n * @param {unknown} raw The cell.\n * @return {number|null} The number, or null.\n */\nfunction numberIn(raw) {\n\treturn raw === null || raw === undefined || raw === '' || !Number.isFinite(Number(raw)) ? null : Number(raw)\n}\n\n/**\n * CnDataMatrix — Inline-edit data grid for matrix-shaped data\n * (rows × columns). Each cell is click-to-edit; commits emit\n * `@cell-edit({ rowId, colKey, value })` so the parent can persist.\n * Optional row / column / grand totals computed from the live data\n * with the column's `aggregate` setting (`sum` by default).\n *\n * Use for gradebooks, weight matrices, allocation tables, scoring\n * rubrics — the \"spreadsheet\" shape where cells are independently\n * editable values rather than a row/object form.\n *\n * A column with `formula` computes its cells from the other columns and is\n * read only: `now*(rate/100)`, with `prev_now` for the row above and `round`\n * set to `round`, `ceil` or `floor`. A row where the formula has no answer shows\n * its own stored value. Formulas are arithmetic only, through `evalFormula`.\n *\n * A scoring matrix weighs its columns: give each column a `weight` (and an\n * optional `weightLabel` such as \"40%\"), set `rowTotalsMode=\"weighted\"` and\n * the row total is the weighted mean of the row's scores. `showRank` ranks\n * the rows by that total, highest first, and `highlightTopRank` tints the\n * leading row.\n *\n * Not a full spreadsheet engine — there are no cell-range references, no\n * charts. Consumers wanting that should\n * embed a dedicated library (e.g. handsontable) and use this for\n * the simpler cases.\n *\n * ```vue\n * <CnDataMatrix\n * title=\"Cohort gradebook\"\n * row-header=\"Student\"\n * :rows=\"students\"\n * :columns=\"[\n * { key: 'midterm', label: 'Midterm', type: 'number', aggregate: 'sum' },\n * { key: 'final', label: 'Final', type: 'number', aggregate: 'sum' },\n * { key: 'notes', label: 'Notes', type: 'string', readOnly: true },\n * ]\"\n * :show-row-totals=\"true\"\n * :show-column-totals=\"true\"\n * @cell-edit=\"onCellEdit\" />\n * ```\n */\nexport default {\n\tname: 'CnDataMatrix',\n\tprops: {\n\t\t/**\n\t\t * Row records. Each record holds an `id`, an optional row\n\t\t * label, and one field per column key.\n\t\t *\n\t\t * @type {Array<object>}\n\t\t */\n\t\trows: { type: Array, default: () => [] },\n\t\t/**\n\t\t * Column declarations.\n\t\t *\n\t\t * @type {Array<{key:string,label?:string,type?:'number'|'string',readOnly?:boolean,formula?:string,round?:'round'|'ceil'|'floor',formatter?:(value: unknown) => string,aggregate?:'sum'|'avg'|'count'|'none',width?:string,weight?:number,weightLabel?:string}>}\n\t\t */\n\t\tcolumns: { type: Array, default: () => [] },\n\t\t/** Field on each row carrying its id. */\n\t\trowIdKey: { type: String, default: 'id' },\n\t\t/** Field on each row carrying its label (shown in the row header). */\n\t\trowLabelKey: { type: String, default: 'label' },\n\t\t/** Header for the row-label column (empty hides it). */\n\t\trowHeader: { type: String, default: '' },\n\t\t/** Optional title. */\n\t\ttitle: { type: String, default: '' },\n\t\t/** Optional description. */\n\t\tdescription: { type: String, default: '' },\n\t\t/** Empty-state text when rows[] is empty. */\n\t\temptyLabel: { type: String, default: 'No data.' },\n\t\t/** Disable all cell editing globally. */\n\t\treadOnly: { type: Boolean, default: false },\n\t\t/** Render the per-row totals column. */\n\t\tshowRowTotals: { type: Boolean, default: false },\n\t\t/** Render the per-column totals row at the bottom. */\n\t\tshowColumnTotals: { type: Boolean, default: false },\n\t\t/** Label for the row-totals column header. */\n\t\trowTotalsLabel: { type: String, default: 'Total' },\n\t\t/** Label preceding the column-totals row. */\n\t\tcolumnTotalsLabel: { type: String, default: 'Total' },\n\t\t/**\n\t\t * How a row total is computed: `sum` adds the number columns,\n\t\t * `weighted` takes the mean of the number columns weighted by each\n\t\t * column's `weight`, leaving out a cell without a value.\n\t\t */\n\t\trowTotalsMode: { type: String, default: 'sum', validator: (v) => ['sum', 'weighted'].includes(v) },\n\t\t/** Fraction digits of the totals; null keeps the locale default. */\n\t\ttotalsFractionDigits: { type: Number, default: null },\n\t\t/** Render a rank column: the rows ranked by their row total, highest first, ties sharing a rank. */\n\t\tshowRank: { type: Boolean, default: false },\n\t\t/** Header of the rank column, already translated; the library default is \"Rank\". */\n\t\trankLabel: { type: String, default: '' },\n\t\t/** Tint the row ranked first. */\n\t\thighlightTopRank: { type: Boolean, default: false },\n\t\t/** Field on each row with a second line under its label, such as a price. */\n\t\trowSublabelKey: { type: String, default: '' },\n\t},\n\n\temits: ['cell-edit'],\n\tdata() {\n\t\treturn {\n\t\t\tediting: null, // { rowId, colKey }\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/** @return {string} The rank column header. */\n\t\tresolvedRankLabel() {\n\t\t\treturn this.rankLabel || t('nextcloud-vue', 'Rank')\n\t\t},\n\n\t\t/**\n\t\t * The rank of every row with a row total: highest total first, rows\n\t\t * with an equal total sharing a rank (1, 2, 2, 4).\n\t\t *\n\t\t * @return {Map<unknown, number>} Rank per row id.\n\t\t */\n\t\tranks() {\n\t\t\tconst totals = this.rows\n\t\t\t\t.map((row) => ({ id: row[this.rowIdKey], total: this.rowTotal(row) }))\n\t\t\t\t.filter((entry) => Number.isFinite(entry.total))\n\t\t\t\t.sort((a, b) => b.total - a.total)\n\t\t\tconst ranks = new Map()\n\t\t\ttotals.forEach((entry, index) => {\n\t\t\t\tconst previous = totals[index - 1]\n\t\t\t\tranks.set(entry.id, previous && previous.total === entry.total ? ranks.get(previous.id) : index + 1)\n\t\t\t})\n\t\t\treturn ranks\n\t\t},\n\n\t\t/**\n\t\t * The computed cells of every row, in order. A formula reads the row's\n\t\t * numbers by column key and the previous row's as `prev_<key>`, and sees\n\t\t * formula columns to its left. A formula without an answer has no entry\n\t\t * here, so the cell shows what the row itself holds.\n\t\t *\n\t\t * @return {Map<object, Record<string, number>>} Computed values per row.\n\t\t */\n\t\tformulaValues() {\n\t\t\tconst values = new Map()\n\t\t\tif (!this.columns.some((col) => col.formula)) {\n\t\t\t\treturn values\n\t\t\t}\n\t\t\tlet previous = {}\n\t\t\tfor (const row of this.rows) {\n\t\t\t\tconst vars = { ...previous }\n\t\t\t\tfor (const col of this.columns) {\n\t\t\t\t\tif (!col.formula && numberIn(row[col.key]) !== null) {\n\t\t\t\t\t\tvars[col.key] = numberIn(row[col.key])\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tconst computed = {}\n\t\t\t\tfor (const col of this.columns) {\n\t\t\t\t\tif (col.formula) {\n\t\t\t\t\t\tconst answer = evalFormula(col.formula, vars)\n\t\t\t\t\t\tif (answer !== null) {\n\t\t\t\t\t\t\tcomputed[col.key] = (ROUNDERS[col.round] ?? Number)(answer)\n\t\t\t\t\t\t\tvars[col.key] = computed[col.key]\n\t\t\t\t\t\t} else if (numberIn(row[col.key]) !== null) {\n\t\t\t\t\t\t\tvars[col.key] = numberIn(row[col.key])\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tvalues.set(row, computed)\n\t\t\t\tprevious = Object.fromEntries(Object.entries(vars).filter(([key]) => !key.startsWith('prev_')).map(([key, value]) => [`prev_${key}`, value]))\n\t\t\t}\n\t\t\treturn values\n\t\t},\n\n\t\t/**\n\t\t * Grand total (sum of every numeric cell). Shown in the\n\t\t * bottom-right corner when both totals are enabled.\n\t\t *\n\t\t * @return {number}\n\t\t */\n\t\tgrandTotal() {\n\t\t\tlet total = 0\n\t\t\tfor (const row of this.rows) {\n\t\t\t\tfor (const col of this.columns) {\n\t\t\t\t\tif (col.type === 'number') {\n\t\t\t\t\t\tconst v = Number(this.cellValue(row, col))\n\t\t\t\t\t\tif (Number.isFinite(v)) {\n\t\t\t\t\t\t\ttotal += v\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn total\n\t\t},\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Whether the given (row, col) is the active edit cell.\n\t\t *\n\t\t * @param {object} row Row record.\n\t\t * @param {object} col Column definition.\n\t\t * @return {boolean}\n\t\t */\n\t\tisEditing(row, col) {\n\t\t\treturn this.editing && this.editing.rowId === row[this.rowIdKey] && this.editing.colKey === col.key\n\t\t},\n\n\t\t/**\n\t\t * Effective read-only flag for a single cell.\n\t\t *\n\t\t * @param {object} row Row record.\n\t\t * @param {object} col Column definition.\n\t\t * @return {boolean}\n\t\t */\n\t\tisCellReadOnly(row, col) {\n\t\t\treturn Boolean(col.readOnly || col.formula)\n\t\t},\n\n\t\t/**\n\t\t * Read the cell value from the row.\n\t\t *\n\t\t * @param {object} row Row record.\n\t\t * @param {object} col Column definition.\n\t\t * @return {unknown} The raw value.\n\t\t */\n\t\tcellValue(row, col) {\n\t\t\tif (col.formula && this.formulaValues.get(row)?.[col.key] !== undefined) {\n\t\t\t\treturn this.formulaValues.get(row)[col.key]\n\t\t\t}\n\t\t\treturn row[col.key]\n\t\t},\n\n\t\t/**\n\t\t * Format a cell value for display. Number columns get a\n\t\t * locale-formatted number; others go through the column's\n\t\t * `formatter` (if any) or are returned verbatim.\n\t\t *\n\t\t * @param {unknown} value The raw value.\n\t\t * @param {object} col Column definition.\n\t\t * @return {string} The display string.\n\t\t */\n\t\tformatCell(value, col) {\n\t\t\tif (value === undefined || value === null || value === '') {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tif (typeof col.formatter === 'function') {\n\t\t\t\treturn col.formatter(value)\n\t\t\t}\n\t\t\tif (col.type === 'number') {\n\t\t\t\tconst n = Number(value)\n\t\t\t\tif (!Number.isFinite(n)) {\n\t\t\t\t\treturn value\n\t\t\t\t}\n\t\t\t\treturn n.toLocaleString(userLocale())\n\t\t\t}\n\t\t\treturn value\n\t\t},\n\n\t\t/**\n\t\t * BEM modifier(s) for a cell — currently only the read-only\n\t\t * flag. Consumers extend via the `formatter` if they want\n\t\t * to swap to a styled component.\n\t\t *\n\t\t * @param {object} row Row record.\n\t\t * @param {object} col Column definition.\n\t\t * @return {object} Class binding.\n\t\t */\n\t\tcellClass(row, col) {\n\t\t\treturn {\n\t\t\t\t'cn-data-matrix__cell--read-only': this.readOnly || this.isCellReadOnly(row, col),\n\t\t\t\t'cn-data-matrix__cell--number': col.type === 'number',\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Start editing a cell.\n\t\t *\n\t\t * @param {object} row Row record.\n\t\t * @param {object} col Column definition.\n\t\t * @return {void}\n\t\t */\n\t\tstartEdit(row, col) {\n\t\t\tif (this.readOnly || this.isCellReadOnly(row, col)) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.editing = { rowId: row[this.rowIdKey], colKey: col.key }\n\t\t\tthis.$nextTick(() => {\n\t\t\t\tif (this.$refs.activeInput && this.$refs.activeInput[0]) {\n\t\t\t\t\tthis.$refs.activeInput[0].focus()\n\t\t\t\t\tthis.$refs.activeInput[0].select()\n\t\t\t\t} else if (this.$refs.activeInput && this.$refs.activeInput.focus) {\n\t\t\t\t\tthis.$refs.activeInput.focus()\n\t\t\t\t\tthis.$refs.activeInput.select()\n\t\t\t\t}\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * Commit an edit — coerces the value to the column type and\n\t\t * emits `@cell-edit`.\n\t\t *\n\t\t * @param {object} row Row record.\n\t\t * @param {object} col Column definition.\n\t\t * @param {string} raw The raw input string.\n\t\t * @return {void}\n\t\t */\n\t\tcommitEdit(row, col, raw) {\n\t\t\tif (!this.editing) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tlet value = raw\n\t\t\tif (col.type === 'number') {\n\t\t\t\tconst n = Number(raw)\n\t\t\t\tvalue = Number.isFinite(n) ? n : null\n\t\t\t}\n\t\t\tthis.editing = null\n\t\t\t/**\n\t\t\t * @event cell-edit Emitted on commit (blur or Enter).\n\t\t\t * Payload: `{rowId, colKey, value, row}`.\n\t\t\t * @type {object}\n\t\t\t */\n\t\t\tthis.$emit('cell-edit', { rowId: row[this.rowIdKey], colKey: col.key, value, row })\n\t\t},\n\n\t\t/**\n\t\t * Cancel the active edit (Esc).\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tcancelEdit() {\n\t\t\tthis.editing = null\n\t\t},\n\n\t\t/**\n\t\t * The weight shown beside a column label: `weightLabel`, else the\n\t\t * `weight` itself, or '' for an unweighted column.\n\t\t *\n\t\t * @param {object} col Column definition.\n\t\t * @return {string} The weight text.\n\t\t */\n\t\tweightText(col) {\n\t\t\tif (typeof col.weightLabel === 'string' && col.weightLabel !== '') {\n\t\t\t\treturn col.weightLabel\n\t\t\t}\n\t\t\treturn Number.isFinite(col.weight) ? String(col.weight) : ''\n\t\t},\n\n\t\t/**\n\t\t * Format a total with `totalsFractionDigits` when set.\n\t\t *\n\t\t * @param {number|null} value The total.\n\t\t * @return {string} The display string.\n\t\t */\n\t\tformatTotal(value) {\n\t\t\tif (!Number.isFinite(value)) {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tif (this.totalsFractionDigits === null) {\n\t\t\t\treturn this.formatCell(value, { type: 'number' })\n\t\t\t}\n\t\t\tconst digits = this.totalsFractionDigits\n\t\t\treturn value.toLocaleString(userLocale(), { minimumFractionDigits: digits, maximumFractionDigits: digits })\n\t\t},\n\n\t\t/**\n\t\t * Per-row total: the sum of every numeric column, or in `weighted`\n\t\t * mode the weighted mean over the weighted columns that hold a value\n\t\t * (null when none does).\n\t\t *\n\t\t * @param {object} row Row record.\n\t\t * @return {number|null}\n\t\t */\n\t\trowTotal(row) {\n\t\t\tif (this.rowTotalsMode === 'weighted') {\n\t\t\t\tlet weighted = 0\n\t\t\t\tlet weights = 0\n\t\t\t\tfor (const col of this.columns) {\n\t\t\t\t\tconst raw = this.cellValue(row, col)\n\t\t\t\t\tconst v = Number(raw)\n\t\t\t\t\tif (col.type === 'number' && Number.isFinite(col.weight) && col.weight > 0 && raw !== null && raw !== undefined && raw !== '' && Number.isFinite(v)) {\n\t\t\t\t\t\tweighted += v * col.weight\n\t\t\t\t\t\tweights += col.weight\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn weights > 0 ? weighted / weights : null\n\t\t\t}\n\t\t\tlet total = 0\n\t\t\tfor (const col of this.columns) {\n\t\t\t\tif (col.type === 'number') {\n\t\t\t\t\tconst v = Number(this.cellValue(row, col))\n\t\t\t\t\tif (Number.isFinite(v)) {\n\t\t\t\t\t\ttotal += v\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn total\n\t\t},\n\n\t\t/**\n\t\t * Per-column total — aggregate over all rows using the\n\t\t * column's `aggregate` setting (`sum` by default).\n\t\t *\n\t\t * @param {object} col Column definition.\n\t\t * @return {number}\n\t\t */\n\t\tcolumnTotal(col) {\n\t\t\tif (col.type !== 'number') {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tconst mode = col.aggregate || 'sum'\n\t\t\tif (mode === 'none') {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\t// Drop empty cells (null / undefined / '') BEFORE coercing —\n\t\t\t// `Number(null)` is `0`, which would otherwise be counted and\n\t\t\t// summed as a real zero value.\n\t\t\tconst values = this.rows\n\t\t\t\t.map((r) => this.cellValue(r, col))\n\t\t\t\t.filter((v) => v !== null && v !== undefined && v !== '')\n\t\t\t\t.map((v) => Number(v))\n\t\t\t\t.filter((v) => Number.isFinite(v))\n\t\t\tif (values.length === 0) {\n\t\t\t\treturn 0\n\t\t\t}\n\t\t\tif (mode === 'count') {\n\t\t\t\treturn values.length\n\t\t\t}\n\t\t\tif (mode === 'avg') {\n\t\t\t\treturn values.reduce((a, b) => a + b, 0) / values.length\n\t\t\t}\n\t\t\t// default: sum\n\t\t\treturn values.reduce((a, b) => a + b, 0)\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-data-matrix {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 8px;\n}\n\n.cn-data-matrix__title {\n\tmargin: 0;\n\tfont-size: 1.1em;\n}\n\n.cn-data-matrix__description {\n\tmargin: 4px 0 0;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-data-matrix__scroller {\n\toverflow-x: auto;\n\tborder: 1px solid var(--color-border);\n\tborder-radius: var(--border-radius);\n}\n\n.cn-data-matrix__table {\n\twidth: 100%;\n\tborder-collapse: collapse;\n\tfont-size: 0.95em;\n}\n\n.cn-data-matrix__col-header,\n.cn-data-matrix__row-header-corner,\n.cn-data-matrix__total-header {\n\tbackground: var(--color-background-hover);\n\ttext-align: left;\n\tpadding: 8px 10px;\n\tfont-weight: 600;\n\tborder-bottom: 1px solid var(--color-border);\n\tborder-right: 1px solid var(--color-border);\n}\n\n.cn-data-matrix__row-header {\n\tbackground: var(--color-background-hover);\n\ttext-align: left;\n\tpadding: 6px 10px;\n\tfont-weight: 500;\n\tborder-right: 1px solid var(--color-border);\n\tborder-bottom: 1px solid var(--color-border);\n\tmax-width: 200px;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n}\n\n.cn-data-matrix__cell {\n\tpadding: 0;\n\tborder-right: 1px solid var(--color-border);\n\tborder-bottom: 1px solid var(--color-border);\n\tmin-width: 80px;\n}\n\n.cn-data-matrix__cell--number {\n\ttext-align: right;\n}\n\n.cn-data-matrix__cell-value {\n\tdisplay: block;\n\tpadding: 6px 10px;\n\tcursor: cell;\n\tmin-height: 28px;\n}\n\n.cn-data-matrix__cell--read-only .cn-data-matrix__cell-value {\n\tcursor: default;\n\tbackground: var(--color-background-hover);\n}\n\n.cn-data-matrix__cell-input {\n\twidth: 100%;\n\tpadding: 5px 10px;\n\tborder: 1px solid var(--color-primary-element);\n\tbackground: var(--color-main-background);\n\toutline: none;\n\tfont: inherit;\n}\n\n.cn-data-matrix__totals-row .cn-data-matrix__total-cell,\n.cn-data-matrix__total-header {\n\tbackground: var(--color-background-darker, var(--color-background-hover));\n\tfont-weight: 600;\n\ttext-align: right;\n\tpadding: 6px 10px;\n}\n\n.cn-data-matrix__totals-label {\n\tbackground: var(--color-background-darker, var(--color-background-hover));\n\tfont-weight: 600;\n\tpadding: 6px 10px;\n\ttext-align: left;\n}\n\n.cn-data-matrix__grand-total {\n\tbackground: var(--color-primary-element-light);\n}\n\n.cn-data-matrix__weight {\n\tcolor: var(--color-text-maxcontrast);\n\tfont-weight: 400;\n\twhite-space: nowrap;\n}\n\n.cn-data-matrix__row-sublabel {\n\tdisplay: block;\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 0.85em;\n\tfont-weight: 400;\n}\n\n.cn-data-matrix__row--top > th,\n.cn-data-matrix__row--top > td {\n\tbackground: var(--color-primary-element-light);\n\tcolor: var(--color-primary-element-light-text);\n}\n\n.cn-data-matrix__empty {\n\tcolor: var(--color-text-maxcontrast);\n\tfont-style: italic;\n\tmargin: 16px 0;\n\ttext-align: center;\n}\n</style>\n"],"names":["_openBlock","_createElementBlock","_toDisplayString","_createElementVNode","_Fragment","_renderList","_createTextVNode","_normalizeClass"],"mappings":";;;AACM,EAAA,KAAK,EAAC,gBAAiB;AAAA,EAAA,aAAW,EAAC,gBAAgB;;;;AACnB,EAAA,KAAK,EAAC,wBAAwB;;;;AAChD,EAAA,KAAK,EAAC,uBAAuB;;;;AAGxB,EAAA,KAAK,EAAC,6BAA6B;;AAKrD,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,0BAA0B,GAAA;AAC7B,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,uBAAuB,GAAA;;;AAGZ,EAAA,KAAK,EAAC,mCAAmC;;;;AAQhC,EAAA,KAAK,EAAC,wBAAwB;;;;AAEnC,EAAA,KAAK,EAAC,8BAA8B;;;;AAGzC,EAAA,KAAK,EAAC,0DAA0D;;;;;AAehC,EAAA,KAAK,EAAC,8BAA8B;;;;;;;AAuB/D,EAAA,KAAK,EAAC,4BAA4B;;;;AAGvC,EAAA,KAAK,EAAC,sDAAsD;;;;AAIrD,EAAA,KAAK,EAAC,4BAA4B;;;;A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AA,CAAC,GAAG,CAAA,EAAA,EAAA,IAAA,EAAA,QAAA,EAAA,CAAA,CAAA,EAAA,CAAA,YAAA,CAAA;;iBAEpB,MAAa,CAAA,aAAA;AAAvB,qBAAAD,SAAA,EAAA,EAAAC,kBAAA,CAEI,IAFJ,EAAA,WAEI,EADAC,eAAA,CAAA,QAAA,CAAA,WAAW,CAAC,QAAU,CAAA,UAAA,CAAA,CAAA,EAAA,CAAA,YAAA;;iBAEhB,MAAQ,CAAA,QAAA;AAAlB,qBAAAF,SAAA,EAAA,EAAAC,kBAAA,CAAwD,MAAxD,WAAwD,CAAA;;;;;;;AAMnD,IAAA,CAAA,MAAA,CAAA,IAAI,CAAC,MAAK,KAAA,CAAA;sBAAnBA,kBAEG,CAAA,GAAA,EAFH,WAEG,EAAAC,eAAA,CADC,MAAS,CAAA,UAAA,CAAA,EAAA,CAAA,YAAA;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"CnDataMatrix.vue3.js","sources":["../../../../src/components/CnDataMatrix/CnDataMatrix.vue?vue&type=template&id=7c401d14&lang.js"],"sourcesContent":["<template>\n\t<div class=\"cn-data-matrix\" data-testid=\"cn-data-matrix\">\n\t\t<header v-if=\"title || description\" class=\"cn-data-matrix__header\">\n\t\t\t<h3 v-if=\"title\" class=\"cn-data-matrix__title\">\n\t\t\t\t{{ title }}\n\t\t\t</h3>\n\t\t\t<p v-if=\"description\" class=\"cn-data-matrix__description\">\n\t\t\t\t{{ description }}\n\t\t\t</p>\n\t\t</header>\n\n\t\t<div class=\"cn-data-matrix__scroller\">\n\t\t\t<table class=\"cn-data-matrix__table\">\n\t\t\t\t<thead>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th v-if=\"rowHeader\" class=\"cn-data-matrix__row-header-corner\">\n\t\t\t\t\t\t\t{{ rowHeader }}\n\t\t\t\t\t\t</th>\n\t\t\t\t\t\t<th v-for=\"col in columns\"\n\t\t\t\t\t\t\t:key=\"col.key\"\n\t\t\t\t\t\t\tclass=\"cn-data-matrix__col-header\"\n\t\t\t\t\t\t\t:style=\"col.width ? { width: col.width } : null\">\n\t\t\t\t\t\t\t{{ col.label || col.key }}\n\t\t\t\t\t\t\t<span v-if=\"weightText(col)\" class=\"cn-data-matrix__weight\">{{ weightText(col) }}</span>\n\t\t\t\t\t\t</th>\n\t\t\t\t\t\t<th v-if=\"showRowTotals\" class=\"cn-data-matrix__total-header\">\n\t\t\t\t\t\t\t{{ rowTotalsLabel }}\n\t\t\t\t\t\t</th>\n\t\t\t\t\t\t<th v-if=\"showRank\" class=\"cn-data-matrix__total-header cn-data-matrix__rank-header\">\n\t\t\t\t\t\t\t{{ resolvedRankLabel }}\n\t\t\t\t\t\t</th>\n\t\t\t\t\t</tr>\n\t\t\t\t</thead>\n\t\t\t\t<tbody>\n\t\t\t\t\t<tr v-for=\"row in rows\"\n\t\t\t\t\t\t:key=\"row[rowIdKey]\"\n\t\t\t\t\t\tclass=\"cn-data-matrix__row\"\n\t\t\t\t\t\t:class=\"{ 'cn-data-matrix__row--top': highlightTopRank && ranks.get(row[rowIdKey]) === 1 }\">\n\t\t\t\t\t\t<th v-if=\"rowHeader\"\n\t\t\t\t\t\t\tscope=\"row\"\n\t\t\t\t\t\t\tclass=\"cn-data-matrix__row-header\"\n\t\t\t\t\t\t\t:title=\"row[rowLabelKey]\">\n\t\t\t\t\t\t\t{{ row[rowLabelKey] }}\n\t\t\t\t\t\t\t<span v-if=\"rowSublabelKey && row[rowSublabelKey]\" class=\"cn-data-matrix__row-sublabel\">{{ row[rowSublabelKey] }}</span>\n\t\t\t\t\t\t</th>\n\t\t\t\t\t\t<td v-for=\"col in columns\"\n\t\t\t\t\t\t\t:key=\"col.key\"\n\t\t\t\t\t\t\tclass=\"cn-data-matrix__cell\"\n\t\t\t\t\t\t\t:class=\"cellClass(row, col)\"\n\t\t\t\t\t\t\t:data-row-id=\"row[rowIdKey]\"\n\t\t\t\t\t\t\t:data-col-key=\"col.key\">\n\t\t\t\t\t\t\t<input v-if=\"isEditing(row, col)\"\n\t\t\t\t\t\t\t\tref=\"activeInput\"\n\t\t\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\t\t\tclass=\"cn-data-matrix__cell-input\"\n\t\t\t\t\t\t\t\t:value=\"cellValue(row, col)\"\n\t\t\t\t\t\t\t\t:aria-label=\"inputLabel(row, col)\"\n\t\t\t\t\t\t\t\t:disabled=\"readOnly || isCellReadOnly(row, col)\"\n\t\t\t\t\t\t\t\t@blur=\"commitEdit(row, col, $event.target.value)\"\n\t\t\t\t\t\t\t\t@keydown=\"onInputKeydown($event, row, col)\">\n\t\t\t\t\t\t\t<span v-else\n\t\t\t\t\t\t\t\tclass=\"cn-data-matrix__cell-value\"\n\t\t\t\t\t\t\t\t:tabindex=\"isCellEditable(row, col) ? 0 : null\"\n\t\t\t\t\t\t\t\t:role=\"isCellEditable(row, col) ? 'button' : null\"\n\t\t\t\t\t\t\t\t:aria-label=\"isCellEditable(row, col) ? cellLabel(row, col) : null\"\n\t\t\t\t\t\t\t\t@click=\"startEdit(row, col)\"\n\t\t\t\t\t\t\t\t@keydown=\"onCellKeydown($event, row, col)\">\n\t\t\t\t\t\t\t\t{{ formatCell(cellValue(row, col), col) }}\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td v-if=\"showRowTotals\" class=\"cn-data-matrix__total-cell\">\n\t\t\t\t\t\t\t{{ formatTotal(rowTotal(row)) }}\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td v-if=\"showRank\" class=\"cn-data-matrix__total-cell cn-data-matrix__rank-cell\">\n\t\t\t\t\t\t\t{{ ranks.has(row[rowIdKey]) ? ranks.get(row[rowIdKey]) : '' }}\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr v-if=\"showColumnTotals\" class=\"cn-data-matrix__totals-row\">\n\t\t\t\t\t\t<th v-if=\"rowHeader\" class=\"cn-data-matrix__totals-label\">\n\t\t\t\t\t\t\t{{ columnTotalsLabel }}\n\t\t\t\t\t\t</th>\n\t\t\t\t\t\t<td v-for=\"col in columns\"\n\t\t\t\t\t\t\t:key=\"col.key\"\n\t\t\t\t\t\t\tclass=\"cn-data-matrix__total-cell\">\n\t\t\t\t\t\t\t{{ formatCell(columnTotal(col), { type: 'number' }) }}\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td v-if=\"showRowTotals\" class=\"cn-data-matrix__total-cell cn-data-matrix__grand-total\">\n\t\t\t\t\t\t\t{{ formatTotal(grandTotal) }}\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td v-if=\"showRank\" class=\"cn-data-matrix__total-cell\" />\n\t\t\t\t\t</tr>\n\t\t\t\t</tbody>\n\t\t\t</table>\n\t\t</div>\n\n\t\t<p v-if=\"rows.length === 0\" class=\"cn-data-matrix__empty\">\n\t\t\t{{ emptyLabel }}\n\t\t</p>\n\t</div>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport { evalFormula } from '../../utils/evalFormula.js'\nimport { userLocale } from '../../utils/userLocale.js'\n\nconst ROUNDERS = Object.freeze({ round: Math.round, ceil: Math.ceil, floor: Math.floor })\n\n/**\n * The number a cell holds; an empty cell is no number, rather than zero.\n *\n * @param {unknown} raw The cell.\n * @return {number|null} The number, or null.\n */\nfunction numberIn(raw) {\n\treturn raw === null || raw === undefined || raw === '' || !Number.isFinite(Number(raw)) ? null : Number(raw)\n}\n\n/**\n * CnDataMatrix — Inline-edit data grid for matrix-shaped data\n * (rows × columns). Each cell is click-to-edit, and keyboard editable:\n * Tab reaches it, Enter or F2 opens it, Enter commits, Escape cancels. Commits emit\n * `@cell-edit({ rowId, colKey, value })` so the parent can persist.\n * Optional row / column / grand totals computed from the live data\n * with the column's `aggregate` setting (`sum` by default).\n *\n * Use for gradebooks, weight matrices, allocation tables, scoring\n * rubrics — the \"spreadsheet\" shape where cells are independently\n * editable values rather than a row/object form.\n *\n * A column with `formula` computes its cells from the other columns and is\n * read only: `now*(rate/100)`, with `prev_now` for the row above and `round`\n * set to `round`, `ceil` or `floor`. A row where the formula has no answer shows\n * its own stored value. Formulas are arithmetic only, through `evalFormula`.\n *\n * A scoring matrix weighs its columns: give each column a `weight` (and an\n * optional `weightLabel` such as \"40%\"), set `rowTotalsMode=\"weighted\"` and\n * the row total is the weighted mean of the row's scores. `showRank` ranks\n * the rows by that total, highest first, and `highlightTopRank` tints the\n * leading row.\n *\n * Not a full spreadsheet engine — there are no cell-range references, no\n * charts. Consumers wanting that should\n * embed a dedicated library (e.g. handsontable) and use this for\n * the simpler cases.\n *\n * ```vue\n * <CnDataMatrix\n * title=\"Cohort gradebook\"\n * row-header=\"Student\"\n * :rows=\"students\"\n * :columns=\"[\n * { key: 'midterm', label: 'Midterm', type: 'number', aggregate: 'sum' },\n * { key: 'final', label: 'Final', type: 'number', aggregate: 'sum' },\n * { key: 'notes', label: 'Notes', type: 'string', readOnly: true },\n * ]\"\n * :show-row-totals=\"true\"\n * :show-column-totals=\"true\"\n * @cell-edit=\"onCellEdit\" />\n * ```\n */\nexport default {\n\tname: 'CnDataMatrix',\n\tprops: {\n\t\t/**\n\t\t * Row records. Each record holds an `id`, an optional row\n\t\t * label, and one field per column key.\n\t\t *\n\t\t * @type {Array<object>}\n\t\t */\n\t\trows: { type: Array, default: () => [] },\n\t\t/**\n\t\t * Column declarations.\n\t\t *\n\t\t * @type {Array<{key:string,label?:string,type?:'number'|'string',readOnly?:boolean,formula?:string,round?:'round'|'ceil'|'floor',formatter?:(value: unknown) => string,aggregate?:'sum'|'avg'|'count'|'none',width?:string,weight?:number,weightLabel?:string}>}\n\t\t */\n\t\tcolumns: { type: Array, default: () => [] },\n\t\t/** Field on each row carrying its id. */\n\t\trowIdKey: { type: String, default: 'id' },\n\t\t/** Field on each row carrying its label (shown in the row header). */\n\t\trowLabelKey: { type: String, default: 'label' },\n\t\t/** Header for the row-label column (empty hides it). */\n\t\trowHeader: { type: String, default: '' },\n\t\t/** Optional title. */\n\t\ttitle: { type: String, default: '' },\n\t\t/** Optional description. */\n\t\tdescription: { type: String, default: '' },\n\t\t/** Empty-state text when rows[] is empty. */\n\t\temptyLabel: { type: String, default: 'No data.' },\n\t\t/** Disable all cell editing globally. */\n\t\treadOnly: { type: Boolean, default: false },\n\t\t/** Render the per-row totals column. */\n\t\tshowRowTotals: { type: Boolean, default: false },\n\t\t/** Render the per-column totals row at the bottom. */\n\t\tshowColumnTotals: { type: Boolean, default: false },\n\t\t/** Label for the row-totals column header. */\n\t\trowTotalsLabel: { type: String, default: 'Total' },\n\t\t/** Label preceding the column-totals row. */\n\t\tcolumnTotalsLabel: { type: String, default: 'Total' },\n\t\t/**\n\t\t * How a row total is computed: `sum` adds the number columns,\n\t\t * `weighted` takes the mean of the number columns weighted by each\n\t\t * column's `weight`, leaving out a cell without a value.\n\t\t */\n\t\trowTotalsMode: { type: String, default: 'sum', validator: (v) => ['sum', 'weighted'].includes(v) },\n\t\t/** Fraction digits of the totals; null keeps the locale default. */\n\t\ttotalsFractionDigits: { type: Number, default: null },\n\t\t/** Render a rank column: the rows ranked by their row total, highest first, ties sharing a rank. */\n\t\tshowRank: { type: Boolean, default: false },\n\t\t/** Header of the rank column, already translated; the library default is \"Rank\". */\n\t\trankLabel: { type: String, default: '' },\n\t\t/** Tint the row ranked first. */\n\t\thighlightTopRank: { type: Boolean, default: false },\n\t\t/** Field on each row with a second line under its label, such as a price. */\n\t\trowSublabelKey: { type: String, default: '' },\n\t},\n\n\temits: ['cell-edit'],\n\tdata() {\n\t\treturn {\n\t\t\tediting: null, // { rowId, colKey }\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/** @return {string} The rank column header. */\n\t\tresolvedRankLabel() {\n\t\t\treturn this.rankLabel || t('nextcloud-vue', 'Rank')\n\t\t},\n\n\t\t/**\n\t\t * The rank of every row with a row total: highest total first, rows\n\t\t * with an equal total sharing a rank (1, 2, 2, 4).\n\t\t *\n\t\t * @return {Map<unknown, number>} Rank per row id.\n\t\t */\n\t\tranks() {\n\t\t\tconst totals = this.rows\n\t\t\t\t.map((row) => ({ id: row[this.rowIdKey], total: this.rowTotal(row) }))\n\t\t\t\t.filter((entry) => Number.isFinite(entry.total))\n\t\t\t\t.sort((a, b) => b.total - a.total)\n\t\t\tconst ranks = new Map()\n\t\t\ttotals.forEach((entry, index) => {\n\t\t\t\tconst previous = totals[index - 1]\n\t\t\t\tranks.set(entry.id, previous && previous.total === entry.total ? ranks.get(previous.id) : index + 1)\n\t\t\t})\n\t\t\treturn ranks\n\t\t},\n\n\t\t/**\n\t\t * The computed cells of every row, in order. A formula reads the row's\n\t\t * numbers by column key and the previous row's as `prev_<key>`, and sees\n\t\t * formula columns to its left. A formula without an answer has no entry\n\t\t * here, so the cell shows what the row itself holds.\n\t\t *\n\t\t * @return {Map<object, Record<string, number>>} Computed values per row.\n\t\t */\n\t\tformulaValues() {\n\t\t\tconst values = new Map()\n\t\t\tif (!this.columns.some((col) => col.formula)) {\n\t\t\t\treturn values\n\t\t\t}\n\t\t\tlet previous = {}\n\t\t\tfor (const row of this.rows) {\n\t\t\t\tconst vars = { ...previous }\n\t\t\t\tfor (const col of this.columns) {\n\t\t\t\t\tif (!col.formula && numberIn(row[col.key]) !== null) {\n\t\t\t\t\t\tvars[col.key] = numberIn(row[col.key])\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tconst computed = {}\n\t\t\t\tfor (const col of this.columns) {\n\t\t\t\t\tif (col.formula) {\n\t\t\t\t\t\tconst answer = evalFormula(col.formula, vars)\n\t\t\t\t\t\tif (answer !== null) {\n\t\t\t\t\t\t\tcomputed[col.key] = (ROUNDERS[col.round] ?? Number)(answer)\n\t\t\t\t\t\t\tvars[col.key] = computed[col.key]\n\t\t\t\t\t\t} else if (numberIn(row[col.key]) !== null) {\n\t\t\t\t\t\t\tvars[col.key] = numberIn(row[col.key])\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tvalues.set(row, computed)\n\t\t\t\tprevious = Object.fromEntries(Object.entries(vars).filter(([key]) => !key.startsWith('prev_')).map(([key, value]) => [`prev_${key}`, value]))\n\t\t\t}\n\t\t\treturn values\n\t\t},\n\n\t\t/**\n\t\t * Grand total (sum of every numeric cell). Shown in the\n\t\t * bottom-right corner when both totals are enabled.\n\t\t *\n\t\t * @return {number}\n\t\t */\n\t\tgrandTotal() {\n\t\t\tlet total = 0\n\t\t\tfor (const row of this.rows) {\n\t\t\t\tfor (const col of this.columns) {\n\t\t\t\t\tif (col.type === 'number') {\n\t\t\t\t\t\tconst v = Number(this.cellValue(row, col))\n\t\t\t\t\t\tif (Number.isFinite(v)) {\n\t\t\t\t\t\t\ttotal += v\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn total\n\t\t},\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Whether the given (row, col) is the active edit cell.\n\t\t *\n\t\t * @param {object} row Row record.\n\t\t * @param {object} col Column definition.\n\t\t * @return {boolean}\n\t\t */\n\t\tisEditing(row, col) {\n\t\t\treturn this.editing && this.editing.rowId === row[this.rowIdKey] && this.editing.colKey === col.key\n\t\t},\n\n\t\t/**\n\t\t * Effective read-only flag for a single cell.\n\t\t *\n\t\t * @param {object} row Row record.\n\t\t * @param {object} col Column definition.\n\t\t * @return {boolean}\n\t\t */\n\t\tisCellReadOnly(row, col) {\n\t\t\treturn Boolean(col.readOnly || col.formula)\n\t\t},\n\n\t\t/**\n\t\t * Whether a cell can be edited, and so takes keyboard focus.\n\t\t *\n\t\t * @param {object} row Row record.\n\t\t * @param {object} col Column definition.\n\t\t * @return {boolean}\n\t\t */\n\t\tisCellEditable(row, col) {\n\t\t\treturn !this.readOnly && !this.isCellReadOnly(row, col)\n\t\t},\n\n\t\t/**\n\t\t * Accessible name of a cell's input: its column and row.\n\t\t *\n\t\t * @param {object} row Row record.\n\t\t * @param {object} col Column definition.\n\t\t * @return {string} The label.\n\t\t */\n\t\tinputLabel(row, col) {\n\t\t\treturn t('nextcloud-vue', '{column}, {row}', {\n\t\t\t\tcolumn: col.label || col.key,\n\t\t\t\trow: row[this.rowLabelKey] ?? row[this.rowIdKey],\n\t\t\t}, undefined, { escape: false })\n\t\t},\n\n\t\t/**\n\t\t * Accessible name of an editable cell: its column, row and value.\n\t\t *\n\t\t * @param {object} row Row record.\n\t\t * @param {object} col Column definition.\n\t\t * @return {string} The label.\n\t\t */\n\t\tcellLabel(row, col) {\n\t\t\tconst value = this.formatCell(this.cellValue(row, col), col)\n\t\t\tconst vars = { cell: this.inputLabel(row, col), value: String(value) }\n\t\t\treturn value === ''\n\t\t\t\t? t('nextcloud-vue', '{cell}: empty', vars, undefined, { escape: false })\n\t\t\t\t: t('nextcloud-vue', '{cell}: {value}', vars, undefined, { escape: false })\n\t\t},\n\n\t\t/**\n\t\t * Enter or F2 on a focused cell starts editing it.\n\t\t *\n\t\t * @param {KeyboardEvent} event The key event.\n\t\t * @param {object} row Row record.\n\t\t * @param {object} col Column definition.\n\t\t * @return {void}\n\t\t */\n\t\tonCellKeydown(event, row, col) {\n\t\t\tif ((event.key === 'Enter' || event.key === 'F2') && this.isCellEditable(row, col)) {\n\t\t\t\tevent.preventDefault()\n\t\t\t\tthis.startEdit(row, col)\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Enter commits and Escape cancels the edit; both return focus to the cell.\n\t\t *\n\t\t * @param {KeyboardEvent} event The key event.\n\t\t * @param {object} row Row record.\n\t\t * @param {object} col Column definition.\n\t\t * @return {void}\n\t\t */\n\t\tonInputKeydown(event, row, col) {\n\t\t\tif (event.key === 'Enter') {\n\t\t\t\tevent.preventDefault()\n\t\t\t\tthis.commitEdit(row, col, event.target.value)\n\t\t\t\tthis.focusCell(row, col)\n\t\t\t} else if (event.key === 'Escape' || event.key === 'Esc') {\n\t\t\t\tevent.preventDefault()\n\t\t\t\tthis.cancelEdit()\n\t\t\t\tthis.focusCell(row, col)\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Move focus to a cell's value after the edit input is gone.\n\t\t *\n\t\t * @param {object} row Row record.\n\t\t * @param {object} col Column definition.\n\t\t * @return {void}\n\t\t */\n\t\tfocusCell(row, col) {\n\t\t\tconst rowId = String(row[this.rowIdKey])\n\t\t\tthis.$nextTick(() => {\n\t\t\t\tconst cell = Array.from(this.$el.querySelectorAll('.cn-data-matrix__cell'))\n\t\t\t\t\t.find((td) => td.dataset.rowId === rowId && td.dataset.colKey === col.key)\n\t\t\t\tcell?.querySelector('.cn-data-matrix__cell-value')?.focus()\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * Read the cell value from the row.\n\t\t *\n\t\t * @param {object} row Row record.\n\t\t * @param {object} col Column definition.\n\t\t * @return {unknown} The raw value.\n\t\t */\n\t\tcellValue(row, col) {\n\t\t\tif (col.formula && this.formulaValues.get(row)?.[col.key] !== undefined) {\n\t\t\t\treturn this.formulaValues.get(row)[col.key]\n\t\t\t}\n\t\t\treturn row[col.key]\n\t\t},\n\n\t\t/**\n\t\t * Format a cell value for display. Number columns get a\n\t\t * locale-formatted number; others go through the column's\n\t\t * `formatter` (if any) or are returned verbatim.\n\t\t *\n\t\t * @param {unknown} value The raw value.\n\t\t * @param {object} col Column definition.\n\t\t * @return {string} The display string.\n\t\t */\n\t\tformatCell(value, col) {\n\t\t\tif (value === undefined || value === null || value === '') {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tif (typeof col.formatter === 'function') {\n\t\t\t\treturn col.formatter(value)\n\t\t\t}\n\t\t\tif (col.type === 'number') {\n\t\t\t\tconst n = Number(value)\n\t\t\t\tif (!Number.isFinite(n)) {\n\t\t\t\t\treturn value\n\t\t\t\t}\n\t\t\t\treturn n.toLocaleString(userLocale())\n\t\t\t}\n\t\t\treturn value\n\t\t},\n\n\t\t/**\n\t\t * BEM modifier(s) for a cell — currently only the read-only\n\t\t * flag. Consumers extend via the `formatter` if they want\n\t\t * to swap to a styled component.\n\t\t *\n\t\t * @param {object} row Row record.\n\t\t * @param {object} col Column definition.\n\t\t * @return {object} Class binding.\n\t\t */\n\t\tcellClass(row, col) {\n\t\t\treturn {\n\t\t\t\t'cn-data-matrix__cell--read-only': this.readOnly || this.isCellReadOnly(row, col),\n\t\t\t\t'cn-data-matrix__cell--number': col.type === 'number',\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Start editing a cell.\n\t\t *\n\t\t * @param {object} row Row record.\n\t\t * @param {object} col Column definition.\n\t\t * @return {void}\n\t\t */\n\t\tstartEdit(row, col) {\n\t\t\tif (this.readOnly || this.isCellReadOnly(row, col)) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.editing = { rowId: row[this.rowIdKey], colKey: col.key }\n\t\t\tthis.$nextTick(() => {\n\t\t\t\tif (this.$refs.activeInput && this.$refs.activeInput[0]) {\n\t\t\t\t\tthis.$refs.activeInput[0].focus()\n\t\t\t\t\tthis.$refs.activeInput[0].select()\n\t\t\t\t} else if (this.$refs.activeInput && this.$refs.activeInput.focus) {\n\t\t\t\t\tthis.$refs.activeInput.focus()\n\t\t\t\t\tthis.$refs.activeInput.select()\n\t\t\t\t}\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * Commit an edit — coerces the value to the column type and\n\t\t * emits `@cell-edit`.\n\t\t *\n\t\t * @param {object} row Row record.\n\t\t * @param {object} col Column definition.\n\t\t * @param {string} raw The raw input string.\n\t\t * @return {void}\n\t\t */\n\t\tcommitEdit(row, col, raw) {\n\t\t\tif (!this.editing) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tlet value = raw\n\t\t\tif (col.type === 'number') {\n\t\t\t\tconst n = Number(raw)\n\t\t\t\tvalue = Number.isFinite(n) ? n : null\n\t\t\t}\n\t\t\tthis.editing = null\n\t\t\t/**\n\t\t\t * @event cell-edit Emitted on commit (blur or Enter).\n\t\t\t * Payload: `{rowId, colKey, value, row}`.\n\t\t\t * @type {object}\n\t\t\t */\n\t\t\tthis.$emit('cell-edit', { rowId: row[this.rowIdKey], colKey: col.key, value, row })\n\t\t},\n\n\t\t/**\n\t\t * Cancel the active edit (Esc).\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tcancelEdit() {\n\t\t\tthis.editing = null\n\t\t},\n\n\t\t/**\n\t\t * The weight shown beside a column label: `weightLabel`, else the\n\t\t * `weight` itself, or '' for an unweighted column.\n\t\t *\n\t\t * @param {object} col Column definition.\n\t\t * @return {string} The weight text.\n\t\t */\n\t\tweightText(col) {\n\t\t\tif (typeof col.weightLabel === 'string' && col.weightLabel !== '') {\n\t\t\t\treturn col.weightLabel\n\t\t\t}\n\t\t\treturn Number.isFinite(col.weight) ? String(col.weight) : ''\n\t\t},\n\n\t\t/**\n\t\t * Format a total with `totalsFractionDigits` when set.\n\t\t *\n\t\t * @param {number|null} value The total.\n\t\t * @return {string} The display string.\n\t\t */\n\t\tformatTotal(value) {\n\t\t\tif (!Number.isFinite(value)) {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tif (this.totalsFractionDigits === null) {\n\t\t\t\treturn this.formatCell(value, { type: 'number' })\n\t\t\t}\n\t\t\tconst digits = this.totalsFractionDigits\n\t\t\treturn value.toLocaleString(userLocale(), { minimumFractionDigits: digits, maximumFractionDigits: digits })\n\t\t},\n\n\t\t/**\n\t\t * Per-row total: the sum of every numeric column, or in `weighted`\n\t\t * mode the weighted mean over the weighted columns that hold a value\n\t\t * (null when none does).\n\t\t *\n\t\t * @param {object} row Row record.\n\t\t * @return {number|null}\n\t\t */\n\t\trowTotal(row) {\n\t\t\tif (this.rowTotalsMode === 'weighted') {\n\t\t\t\tlet weighted = 0\n\t\t\t\tlet weights = 0\n\t\t\t\tfor (const col of this.columns) {\n\t\t\t\t\tconst raw = this.cellValue(row, col)\n\t\t\t\t\tconst v = Number(raw)\n\t\t\t\t\tif (col.type === 'number' && Number.isFinite(col.weight) && col.weight > 0 && raw !== null && raw !== undefined && raw !== '' && Number.isFinite(v)) {\n\t\t\t\t\t\tweighted += v * col.weight\n\t\t\t\t\t\tweights += col.weight\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn weights > 0 ? weighted / weights : null\n\t\t\t}\n\t\t\tlet total = 0\n\t\t\tfor (const col of this.columns) {\n\t\t\t\tif (col.type === 'number') {\n\t\t\t\t\tconst v = Number(this.cellValue(row, col))\n\t\t\t\t\tif (Number.isFinite(v)) {\n\t\t\t\t\t\ttotal += v\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn total\n\t\t},\n\n\t\t/**\n\t\t * Per-column total — aggregate over all rows using the\n\t\t * column's `aggregate` setting (`sum` by default).\n\t\t *\n\t\t * @param {object} col Column definition.\n\t\t * @return {number}\n\t\t */\n\t\tcolumnTotal(col) {\n\t\t\tif (col.type !== 'number') {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tconst mode = col.aggregate || 'sum'\n\t\t\tif (mode === 'none') {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\t// Drop empty cells (null / undefined / '') BEFORE coercing —\n\t\t\t// `Number(null)` is `0`, which would otherwise be counted and\n\t\t\t// summed as a real zero value.\n\t\t\tconst values = this.rows\n\t\t\t\t.map((r) => this.cellValue(r, col))\n\t\t\t\t.filter((v) => v !== null && v !== undefined && v !== '')\n\t\t\t\t.map((v) => Number(v))\n\t\t\t\t.filter((v) => Number.isFinite(v))\n\t\t\tif (values.length === 0) {\n\t\t\t\treturn 0\n\t\t\t}\n\t\t\tif (mode === 'count') {\n\t\t\t\treturn values.length\n\t\t\t}\n\t\t\tif (mode === 'avg') {\n\t\t\t\treturn values.reduce((a, b) => a + b, 0) / values.length\n\t\t\t}\n\t\t\t// default: sum\n\t\t\treturn values.reduce((a, b) => a + b, 0)\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-data-matrix {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 8px;\n}\n\n.cn-data-matrix__title {\n\tmargin: 0;\n\tfont-size: 1.1em;\n}\n\n.cn-data-matrix__description {\n\tmargin: 4px 0 0;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-data-matrix__scroller {\n\toverflow-x: auto;\n\tborder: 1px solid var(--color-border);\n\tborder-radius: var(--border-radius);\n}\n\n.cn-data-matrix__table {\n\twidth: 100%;\n\tborder-collapse: collapse;\n\tfont-size: 0.95em;\n}\n\n.cn-data-matrix__col-header,\n.cn-data-matrix__row-header-corner,\n.cn-data-matrix__total-header {\n\tbackground: var(--color-background-hover);\n\ttext-align: left;\n\tpadding: 8px 10px;\n\tfont-weight: 600;\n\tborder-bottom: 1px solid var(--color-border);\n\tborder-right: 1px solid var(--color-border);\n}\n\n.cn-data-matrix__row-header {\n\tbackground: var(--color-background-hover);\n\ttext-align: left;\n\tpadding: 6px 10px;\n\tfont-weight: 500;\n\tborder-right: 1px solid var(--color-border);\n\tborder-bottom: 1px solid var(--color-border);\n\tmax-width: 200px;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n}\n\n.cn-data-matrix__cell {\n\tpadding: 0;\n\tborder-right: 1px solid var(--color-border);\n\tborder-bottom: 1px solid var(--color-border);\n\tmin-width: 80px;\n}\n\n.cn-data-matrix__cell--number {\n\ttext-align: right;\n}\n\n.cn-data-matrix__cell-value {\n\tdisplay: block;\n\tpadding: 6px 10px;\n\tcursor: cell;\n\tmin-height: 28px;\n}\n\n.cn-data-matrix__cell-value:focus-visible {\n\toutline: 2px solid var(--color-primary-element);\n\toutline-offset: -2px;\n}\n\n.cn-data-matrix__cell--read-only .cn-data-matrix__cell-value {\n\tcursor: default;\n\tbackground: var(--color-background-hover);\n}\n\n.cn-data-matrix__cell-input {\n\twidth: 100%;\n\tpadding: 5px 10px;\n\tborder: 1px solid var(--color-primary-element);\n\tbackground: var(--color-main-background);\n\toutline: none;\n\tfont: inherit;\n}\n\n.cn-data-matrix__totals-row .cn-data-matrix__total-cell,\n.cn-data-matrix__total-header {\n\tbackground: var(--color-background-darker, var(--color-background-hover));\n\tfont-weight: 600;\n\ttext-align: right;\n\tpadding: 6px 10px;\n}\n\n.cn-data-matrix__totals-label {\n\tbackground: var(--color-background-darker, var(--color-background-hover));\n\tfont-weight: 600;\n\tpadding: 6px 10px;\n\ttext-align: left;\n}\n\n.cn-data-matrix__grand-total {\n\tbackground: var(--color-primary-element-light);\n}\n\n.cn-data-matrix__weight {\n\tcolor: var(--color-text-maxcontrast);\n\tfont-weight: 400;\n\twhite-space: nowrap;\n}\n\n.cn-data-matrix__row-sublabel {\n\tdisplay: block;\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 0.85em;\n\tfont-weight: 400;\n}\n\n.cn-data-matrix__row--top > th,\n.cn-data-matrix__row--top > td {\n\tbackground: var(--color-primary-element-light);\n\tcolor: var(--color-primary-element-light-text);\n}\n\n.cn-data-matrix__empty {\n\tcolor: var(--color-text-maxcontrast);\n\tfont-style: italic;\n\tmargin: 16px 0;\n\ttext-align: center;\n}\n</style>\n"],"names":["_openBlock","_createElementBlock","_toDisplayString","_createElementVNode","_Fragment","_renderList","_createTextVNode","_normalizeClass"],"mappings":";;;AACM,EAAA,KAAK,EAAC,gBAAiB;AAAA,EAAA,aAAW,EAAC,gBAAgB;;;;AACnB,EAAA,KAAK,EAAC,wBAAwB;;;;AAChD,EAAA,KAAK,EAAC,uBAAuB;;;;AAGxB,EAAA,KAAK,EAAC,6BAA6B;;AAKrD,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,0BAA0B,GAAA;AAC7B,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,uBAAuB,GAAA;;;AAGZ,EAAA,KAAK,EAAC,mCAAmC;;;;AAQhC,EAAA,KAAK,EAAC,wBAAwB;;;;AAEnC,EAAA,KAAK,EAAC,8BAA8B;;;;AAGzC,EAAA,KAAK,EAAC,0DAA0D;;;;;AAehC,EAAA,KAAK,EAAC,8BAA8B;;;;;;;AA2B/D,EAAA,KAAK,EAAC,4BAA4B;;;;AAGvC,EAAA,KAAK,EAAC,sDAAsD;;;;AAIrD,EAAA,KAAK,EAAC,4B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;iBAZO,MAAS,CAAA,SAAA;kCAAnBA,kBAEI,CAAA,IAAA,EAFJ,WAEI,EAAAC,eAAA,CADA;;kCAEJD,kBAII,CAAAG,QAAA,EAAA,IAAA,EAAAC,UAAA,CAJc,MAAO,CAAA,OAAA,EAAA,CAAd,GAAI,KAAA;uCAAfJ,kBAII,CAAA,IAAA,EAAA;oBAHF,GAAG,EAAE,GAAG,CAAC,GAAG;AACb,oBAAA,KAAK,EAAC,4BAA4B;qCAC/B,QAAU,CAAA,UAAA,CAAC,QAAW,CAAA,WAAA,CAAC,GAAG,CAAA,EAAA,EAAA,IAAA,EAAA,QAAA,EAAA,CAAA,CAAA,EAAA,CAAA,YAAA,CAAA;;iBAEpB,MAAa,CAAA,aAAA;AAAvB,qBAAAD,SAAA,EAAA,EAAAC,kBAAA,CAEI,IAFJ,EAAA,WAEI,EADAC,eAAA,CAAA,QAAA,CAAA,WAAW,CAAC,QAAU,CAAA,UAAA,CAAA,CAAA,EAAA,CAAA,YAAA;;iBAEhB,MAAQ,CAAA,QAAA;AAAlB,qBAAAF,SAAA,EAAA,EAAAC,kBAAA,CAAwD,MAAxD,WAAwD,CAAA;;;;;;;AAMnD,IAAA,CAAA,MAAA,CAAA,IAAI,CAAC,MAAK,KAAA,CAAA;sBAAnBA,kBAEG,CAAA,GAAA,EAFH,WAEG,EAAAC,eAAA,CADC,MAAS,CAAA,UAAA,CAAA,EAAA,CAAA,YAAA;;;;;;;"}
|
package/dist/esm/l10n/en.json.js
CHANGED
|
@@ -2656,6 +2656,9 @@ var translations = {
|
|
|
2656
2656
|
"{elapsed} of {norm}": "{elapsed} of {norm}",
|
|
2657
2657
|
"Enter minutes, or minutes and seconds as 04:23.": "Enter minutes, or minutes and seconds as 04:23.",
|
|
2658
2658
|
Rank: "Rank",
|
|
2659
|
+
"{column}, {row}": "{column}, {row}",
|
|
2660
|
+
"{cell}: empty": "{cell}: empty",
|
|
2661
|
+
"{cell}: {value}": "{cell}: {value}",
|
|
2659
2662
|
"Keep this one": "Keep this one",
|
|
2660
2663
|
"Keep the server one": "Keep the server one",
|
|
2661
2664
|
"Conflict: which version do you keep?": "Conflict: which version do you keep?",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"en.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"en.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/esm/l10n/nl.json.js
CHANGED
|
@@ -2921,6 +2921,9 @@ var translations = {
|
|
|
2921
2921
|
"{elapsed} of {norm}": "{elapsed} van {norm}",
|
|
2922
2922
|
"Enter minutes, or minutes and seconds as 04:23.": "Vul minuten in, of minuten en seconden als 04:23.",
|
|
2923
2923
|
Rank: "Rang",
|
|
2924
|
+
"{column}, {row}": "{column}, {row}",
|
|
2925
|
+
"{cell}: empty": "{cell}: leeg",
|
|
2926
|
+
"{cell}: {value}": "{cell}: {value}",
|
|
2924
2927
|
"Keep this one": "Deze houden",
|
|
2925
2928
|
"Keep the server one": "Die van de server",
|
|
2926
2929
|
"Conflict: which version do you keep?": "Conflict: welke versie houdt u?",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nl.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"nl.json.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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