@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.
@@ -55493,32 +55493,32 @@ button.cn-object-calendar__overflow[data-v-e1c69ee2] {
55493
55493
  }
55494
55494
 
55495
55495
 
55496
- .cn-data-matrix[data-v-401dc886] {
55496
+ .cn-data-matrix[data-v-7c401d14] {
55497
55497
  display: flex;
55498
55498
  flex-direction: column;
55499
55499
  gap: 8px;
55500
55500
  }
55501
- .cn-data-matrix__title[data-v-401dc886] {
55501
+ .cn-data-matrix__title[data-v-7c401d14] {
55502
55502
  margin: 0;
55503
55503
  font-size: 1.1em;
55504
55504
  }
55505
- .cn-data-matrix__description[data-v-401dc886] {
55505
+ .cn-data-matrix__description[data-v-7c401d14] {
55506
55506
  margin: 4px 0 0;
55507
55507
  color: var(--color-text-maxcontrast);
55508
55508
  }
55509
- .cn-data-matrix__scroller[data-v-401dc886] {
55509
+ .cn-data-matrix__scroller[data-v-7c401d14] {
55510
55510
  overflow-x: auto;
55511
55511
  border: 1px solid var(--color-border);
55512
55512
  border-radius: var(--border-radius);
55513
55513
  }
55514
- .cn-data-matrix__table[data-v-401dc886] {
55514
+ .cn-data-matrix__table[data-v-7c401d14] {
55515
55515
  width: 100%;
55516
55516
  border-collapse: collapse;
55517
55517
  font-size: 0.95em;
55518
55518
  }
55519
- .cn-data-matrix__col-header[data-v-401dc886],
55520
- .cn-data-matrix__row-header-corner[data-v-401dc886],
55521
- .cn-data-matrix__total-header[data-v-401dc886] {
55519
+ .cn-data-matrix__col-header[data-v-7c401d14],
55520
+ .cn-data-matrix__row-header-corner[data-v-7c401d14],
55521
+ .cn-data-matrix__total-header[data-v-7c401d14] {
55522
55522
  background: var(--color-background-hover);
55523
55523
  text-align: left;
55524
55524
  padding: 8px 10px;
@@ -55526,7 +55526,7 @@ button.cn-object-calendar__overflow[data-v-e1c69ee2] {
55526
55526
  border-bottom: 1px solid var(--color-border);
55527
55527
  border-right: 1px solid var(--color-border);
55528
55528
  }
55529
- .cn-data-matrix__row-header[data-v-401dc886] {
55529
+ .cn-data-matrix__row-header[data-v-7c401d14] {
55530
55530
  background: var(--color-background-hover);
55531
55531
  text-align: left;
55532
55532
  padding: 6px 10px;
@@ -55538,26 +55538,30 @@ button.cn-object-calendar__overflow[data-v-e1c69ee2] {
55538
55538
  text-overflow: ellipsis;
55539
55539
  white-space: nowrap;
55540
55540
  }
55541
- .cn-data-matrix__cell[data-v-401dc886] {
55541
+ .cn-data-matrix__cell[data-v-7c401d14] {
55542
55542
  padding: 0;
55543
55543
  border-right: 1px solid var(--color-border);
55544
55544
  border-bottom: 1px solid var(--color-border);
55545
55545
  min-width: 80px;
55546
55546
  }
55547
- .cn-data-matrix__cell--number[data-v-401dc886] {
55547
+ .cn-data-matrix__cell--number[data-v-7c401d14] {
55548
55548
  text-align: right;
55549
55549
  }
55550
- .cn-data-matrix__cell-value[data-v-401dc886] {
55550
+ .cn-data-matrix__cell-value[data-v-7c401d14] {
55551
55551
  display: block;
55552
55552
  padding: 6px 10px;
55553
55553
  cursor: cell;
55554
55554
  min-height: 28px;
55555
55555
  }
55556
- .cn-data-matrix__cell--read-only .cn-data-matrix__cell-value[data-v-401dc886] {
55556
+ .cn-data-matrix__cell-value[data-v-7c401d14]:focus-visible {
55557
+ outline: 2px solid var(--color-primary-element);
55558
+ outline-offset: -2px;
55559
+ }
55560
+ .cn-data-matrix__cell--read-only .cn-data-matrix__cell-value[data-v-7c401d14] {
55557
55561
  cursor: default;
55558
55562
  background: var(--color-background-hover);
55559
55563
  }
55560
- .cn-data-matrix__cell-input[data-v-401dc886] {
55564
+ .cn-data-matrix__cell-input[data-v-7c401d14] {
55561
55565
  width: 100%;
55562
55566
  padding: 5px 10px;
55563
55567
  border: 1px solid var(--color-primary-element);
@@ -55565,39 +55569,39 @@ button.cn-object-calendar__overflow[data-v-e1c69ee2] {
55565
55569
  outline: none;
55566
55570
  font: inherit;
55567
55571
  }
55568
- .cn-data-matrix__totals-row .cn-data-matrix__total-cell[data-v-401dc886],
55569
- .cn-data-matrix__total-header[data-v-401dc886] {
55572
+ .cn-data-matrix__totals-row .cn-data-matrix__total-cell[data-v-7c401d14],
55573
+ .cn-data-matrix__total-header[data-v-7c401d14] {
55570
55574
  background: var(--color-background-darker, var(--color-background-hover));
55571
55575
  font-weight: 600;
55572
55576
  text-align: right;
55573
55577
  padding: 6px 10px;
55574
55578
  }
55575
- .cn-data-matrix__totals-label[data-v-401dc886] {
55579
+ .cn-data-matrix__totals-label[data-v-7c401d14] {
55576
55580
  background: var(--color-background-darker, var(--color-background-hover));
55577
55581
  font-weight: 600;
55578
55582
  padding: 6px 10px;
55579
55583
  text-align: left;
55580
55584
  }
55581
- .cn-data-matrix__grand-total[data-v-401dc886] {
55585
+ .cn-data-matrix__grand-total[data-v-7c401d14] {
55582
55586
  background: var(--color-primary-element-light);
55583
55587
  }
55584
- .cn-data-matrix__weight[data-v-401dc886] {
55588
+ .cn-data-matrix__weight[data-v-7c401d14] {
55585
55589
  color: var(--color-text-maxcontrast);
55586
55590
  font-weight: 400;
55587
55591
  white-space: nowrap;
55588
55592
  }
55589
- .cn-data-matrix__row-sublabel[data-v-401dc886] {
55593
+ .cn-data-matrix__row-sublabel[data-v-7c401d14] {
55590
55594
  display: block;
55591
55595
  color: var(--color-text-maxcontrast);
55592
55596
  font-size: 0.85em;
55593
55597
  font-weight: 400;
55594
55598
  }
55595
- .cn-data-matrix__row--top > th[data-v-401dc886],
55596
- .cn-data-matrix__row--top > td[data-v-401dc886] {
55599
+ .cn-data-matrix__row--top > th[data-v-7c401d14],
55600
+ .cn-data-matrix__row--top > td[data-v-7c401d14] {
55597
55601
  background: var(--color-primary-element-light);
55598
55602
  color: var(--color-primary-element-light-text);
55599
55603
  }
55600
- .cn-data-matrix__empty[data-v-401dc886] {
55604
+ .cn-data-matrix__empty[data-v-7c401d14] {
55601
55605
  color: var(--color-text-maxcontrast);
55602
55606
  font-style: italic;
55603
55607
  margin: 16px 0;
@@ -3898,6 +3898,9 @@ var translations$s = {
3898
3898
  "{elapsed} of {norm}": "{elapsed} of {norm}",
3899
3899
  "Enter minutes, or minutes and seconds as 04:23.": "Enter minutes, or minutes and seconds as 04:23.",
3900
3900
  Rank: "Rank",
3901
+ "{column}, {row}": "{column}, {row}",
3902
+ "{cell}: empty": "{cell}: empty",
3903
+ "{cell}: {value}": "{cell}: {value}",
3901
3904
  "Keep this one": "Keep this one",
3902
3905
  "Keep the server one": "Keep the server one",
3903
3906
  "Conflict: which version do you keep?": "Conflict: which version do you keep?",
@@ -7240,6 +7243,9 @@ var translations$c = {
7240
7243
  "{elapsed} of {norm}": "{elapsed} van {norm}",
7241
7244
  "Enter minutes, or minutes and seconds as 04:23.": "Vul minuten in, of minuten en seconden als 04:23.",
7242
7245
  Rank: "Rang",
7246
+ "{column}, {row}": "{column}, {row}",
7247
+ "{cell}: empty": "{cell}: leeg",
7248
+ "{cell}: {value}": "{cell}: {value}",
7243
7249
  "Keep this one": "Deze houden",
7244
7250
  "Keep the server one": "Die van de server",
7245
7251
  "Conflict: which version do you keep?": "Conflict: welke versie houdt u?",
@@ -372077,7 +372083,8 @@ function numberIn(raw) {
372077
372083
 
372078
372084
  /**
372079
372085
  * CnDataMatrix — Inline-edit data grid for matrix-shaped data
372080
- * (rows × columns). Each cell is click-to-edit; commits emit
372086
+ * (rows × columns). Each cell is click-to-edit, and keyboard editable:
372087
+ * Tab reaches it, Enter or F2 opens it, Enter commits, Escape cancels. Commits emit
372081
372088
  * `@cell-edit({ rowId, colKey, value })` so the parent can persist.
372082
372089
  * Optional row / column / grand totals computed from the live data
372083
372090
  * with the column's `aggregate` setting (`sum` by default).
@@ -372289,6 +372296,97 @@ var script$2B = {
372289
372296
  return Boolean(col.readOnly || col.formula)
372290
372297
  },
372291
372298
 
372299
+ /**
372300
+ * Whether a cell can be edited, and so takes keyboard focus.
372301
+ *
372302
+ * @param {object} row Row record.
372303
+ * @param {object} col Column definition.
372304
+ * @return {boolean}
372305
+ */
372306
+ isCellEditable(row, col) {
372307
+ return !this.readOnly && !this.isCellReadOnly(row, col)
372308
+ },
372309
+
372310
+ /**
372311
+ * Accessible name of a cell's input: its column and row.
372312
+ *
372313
+ * @param {object} row Row record.
372314
+ * @param {object} col Column definition.
372315
+ * @return {string} The label.
372316
+ */
372317
+ inputLabel(row, col) {
372318
+ return l10n.translate('nextcloud-vue', '{column}, {row}', {
372319
+ column: col.label || col.key,
372320
+ row: row[this.rowLabelKey] ?? row[this.rowIdKey],
372321
+ }, undefined, { escape: false })
372322
+ },
372323
+
372324
+ /**
372325
+ * Accessible name of an editable cell: its column, row and value.
372326
+ *
372327
+ * @param {object} row Row record.
372328
+ * @param {object} col Column definition.
372329
+ * @return {string} The label.
372330
+ */
372331
+ cellLabel(row, col) {
372332
+ const value = this.formatCell(this.cellValue(row, col), col);
372333
+ const vars = { cell: this.inputLabel(row, col), value: String(value) };
372334
+ return value === ''
372335
+ ? l10n.translate('nextcloud-vue', '{cell}: empty', vars, undefined, { escape: false })
372336
+ : l10n.translate('nextcloud-vue', '{cell}: {value}', vars, undefined, { escape: false })
372337
+ },
372338
+
372339
+ /**
372340
+ * Enter or F2 on a focused cell starts editing it.
372341
+ *
372342
+ * @param {KeyboardEvent} event The key event.
372343
+ * @param {object} row Row record.
372344
+ * @param {object} col Column definition.
372345
+ * @return {void}
372346
+ */
372347
+ onCellKeydown(event, row, col) {
372348
+ if ((event.key === 'Enter' || event.key === 'F2') && this.isCellEditable(row, col)) {
372349
+ event.preventDefault();
372350
+ this.startEdit(row, col);
372351
+ }
372352
+ },
372353
+
372354
+ /**
372355
+ * Enter commits and Escape cancels the edit; both return focus to the cell.
372356
+ *
372357
+ * @param {KeyboardEvent} event The key event.
372358
+ * @param {object} row Row record.
372359
+ * @param {object} col Column definition.
372360
+ * @return {void}
372361
+ */
372362
+ onInputKeydown(event, row, col) {
372363
+ if (event.key === 'Enter') {
372364
+ event.preventDefault();
372365
+ this.commitEdit(row, col, event.target.value);
372366
+ this.focusCell(row, col);
372367
+ } else if (event.key === 'Escape' || event.key === 'Esc') {
372368
+ event.preventDefault();
372369
+ this.cancelEdit();
372370
+ this.focusCell(row, col);
372371
+ }
372372
+ },
372373
+
372374
+ /**
372375
+ * Move focus to a cell's value after the edit input is gone.
372376
+ *
372377
+ * @param {object} row Row record.
372378
+ * @param {object} col Column definition.
372379
+ * @return {void}
372380
+ */
372381
+ focusCell(row, col) {
372382
+ const rowId = String(row[this.rowIdKey]);
372383
+ this.$nextTick(() => {
372384
+ const cell = Array.from(this.$el.querySelectorAll('.cn-data-matrix__cell'))
372385
+ .find((td) => td.dataset.rowId === rowId && td.dataset.colKey === col.key);
372386
+ cell?.querySelector('.cn-data-matrix__cell-value')?.focus();
372387
+ });
372388
+ },
372389
+
372292
372390
  /**
372293
372391
  * Read the cell value from the row.
372294
372392
  *
@@ -372547,8 +372645,8 @@ const _hoisted_12$Y = {
372547
372645
  class: "cn-data-matrix__row-sublabel"
372548
372646
  };
372549
372647
  const _hoisted_13$P = ["data-row-id", "data-col-key"];
372550
- const _hoisted_14$O = ["value", "disabled", "onBlur", "onKeydown"];
372551
- const _hoisted_15$K = ["onClick"];
372648
+ const _hoisted_14$O = ["value", "aria-label", "disabled", "onBlur", "onKeydown"];
372649
+ const _hoisted_15$K = ["tabindex", "role", "aria-label", "onClick", "onKeydown"];
372552
372650
  const _hoisted_16$F = {
372553
372651
  key: 1,
372554
372652
  class: "cn-data-matrix__total-cell"
@@ -372651,18 +372749,20 @@ function render$2A(_ctx, _cache, $props, $setup, $data, $options) {
372651
372749
  type: "text",
372652
372750
  class: "cn-data-matrix__cell-input",
372653
372751
  value: $options.cellValue(row, col),
372752
+ "aria-label": $options.inputLabel(row, col),
372654
372753
  disabled: $props.readOnly || $options.isCellReadOnly(row, col),
372655
372754
  onBlur: $event => ($options.commitEdit(row, col, $event.target.value)),
372656
- onKeydown: [
372657
- vue$1.withKeys($event => ($options.commitEdit(row, col, $event.target.value)), ["enter"]),
372658
- _cache[0] || (_cache[0] = vue$1.withKeys((...args) => ($options.cancelEdit && $options.cancelEdit(...args)), ["esc"]))
372659
- ]
372755
+ onKeydown: $event => ($options.onInputKeydown($event, row, col))
372660
372756
  }, null, 40 /* PROPS, NEED_HYDRATION */, _hoisted_14$O))
372661
372757
  : (vue$1.openBlock(), vue$1.createElementBlock("span", {
372662
372758
  key: 1,
372663
372759
  class: "cn-data-matrix__cell-value",
372664
- onClick: $event => ($options.startEdit(row, col))
372665
- }, vue$1.toDisplayString($options.formatCell($options.cellValue(row, col), col)), 9 /* TEXT, PROPS */, _hoisted_15$K))
372760
+ tabindex: $options.isCellEditable(row, col) ? 0 : null,
372761
+ role: $options.isCellEditable(row, col) ? 'button' : null,
372762
+ "aria-label": $options.isCellEditable(row, col) ? $options.cellLabel(row, col) : null,
372763
+ onClick: $event => ($options.startEdit(row, col)),
372764
+ onKeydown: $event => ($options.onCellKeydown($event, row, col))
372765
+ }, vue$1.toDisplayString($options.formatCell($options.cellValue(row, col), col)), 41 /* TEXT, PROPS, NEED_HYDRATION */, _hoisted_15$K))
372666
372766
  ], 10 /* CLASS, PROPS */, _hoisted_13$P))
372667
372767
  }), 128 /* KEYED_FRAGMENT */)),
372668
372768
  ($props.showRowTotals)
@@ -372702,7 +372802,7 @@ function render$2A(_ctx, _cache, $props, $setup, $data, $options) {
372702
372802
  }
372703
372803
 
372704
372804
  script$2B.render = render$2A;
372705
- script$2B.__scopeId = "data-v-401dc886";
372805
+ script$2B.__scopeId = "data-v-7c401d14";
372706
372806
  const __sfc_main$2B = script$2B;
372707
372807
 
372708
372808
  /**
@@ -1,4 +1,4 @@
1
1
  [diffend] Oversized file quarantined before diffing.
2
2
  name: package/dist/nextcloud-vue.cjs.js.map
3
- size: 53013669 bytes
4
- sha256: 1d84cb5f6a0b8f92011059b929d3425b80b169c6089a51048e117c3c5e34ae4e
3
+ size: 53023152 bytes
4
+ sha256: 59a26ada59936d4f416ba118a3b584f4612c8d3a8a25fbc2c65ed6597e8d831a
@@ -55493,32 +55493,32 @@ button.cn-object-calendar__overflow[data-v-e1c69ee2] {
55493
55493
  }
55494
55494
 
55495
55495
 
55496
- .cn-data-matrix[data-v-401dc886] {
55496
+ .cn-data-matrix[data-v-7c401d14] {
55497
55497
  display: flex;
55498
55498
  flex-direction: column;
55499
55499
  gap: 8px;
55500
55500
  }
55501
- .cn-data-matrix__title[data-v-401dc886] {
55501
+ .cn-data-matrix__title[data-v-7c401d14] {
55502
55502
  margin: 0;
55503
55503
  font-size: 1.1em;
55504
55504
  }
55505
- .cn-data-matrix__description[data-v-401dc886] {
55505
+ .cn-data-matrix__description[data-v-7c401d14] {
55506
55506
  margin: 4px 0 0;
55507
55507
  color: var(--color-text-maxcontrast);
55508
55508
  }
55509
- .cn-data-matrix__scroller[data-v-401dc886] {
55509
+ .cn-data-matrix__scroller[data-v-7c401d14] {
55510
55510
  overflow-x: auto;
55511
55511
  border: 1px solid var(--color-border);
55512
55512
  border-radius: var(--border-radius);
55513
55513
  }
55514
- .cn-data-matrix__table[data-v-401dc886] {
55514
+ .cn-data-matrix__table[data-v-7c401d14] {
55515
55515
  width: 100%;
55516
55516
  border-collapse: collapse;
55517
55517
  font-size: 0.95em;
55518
55518
  }
55519
- .cn-data-matrix__col-header[data-v-401dc886],
55520
- .cn-data-matrix__row-header-corner[data-v-401dc886],
55521
- .cn-data-matrix__total-header[data-v-401dc886] {
55519
+ .cn-data-matrix__col-header[data-v-7c401d14],
55520
+ .cn-data-matrix__row-header-corner[data-v-7c401d14],
55521
+ .cn-data-matrix__total-header[data-v-7c401d14] {
55522
55522
  background: var(--color-background-hover);
55523
55523
  text-align: left;
55524
55524
  padding: 8px 10px;
@@ -55526,7 +55526,7 @@ button.cn-object-calendar__overflow[data-v-e1c69ee2] {
55526
55526
  border-bottom: 1px solid var(--color-border);
55527
55527
  border-right: 1px solid var(--color-border);
55528
55528
  }
55529
- .cn-data-matrix__row-header[data-v-401dc886] {
55529
+ .cn-data-matrix__row-header[data-v-7c401d14] {
55530
55530
  background: var(--color-background-hover);
55531
55531
  text-align: left;
55532
55532
  padding: 6px 10px;
@@ -55538,26 +55538,30 @@ button.cn-object-calendar__overflow[data-v-e1c69ee2] {
55538
55538
  text-overflow: ellipsis;
55539
55539
  white-space: nowrap;
55540
55540
  }
55541
- .cn-data-matrix__cell[data-v-401dc886] {
55541
+ .cn-data-matrix__cell[data-v-7c401d14] {
55542
55542
  padding: 0;
55543
55543
  border-right: 1px solid var(--color-border);
55544
55544
  border-bottom: 1px solid var(--color-border);
55545
55545
  min-width: 80px;
55546
55546
  }
55547
- .cn-data-matrix__cell--number[data-v-401dc886] {
55547
+ .cn-data-matrix__cell--number[data-v-7c401d14] {
55548
55548
  text-align: right;
55549
55549
  }
55550
- .cn-data-matrix__cell-value[data-v-401dc886] {
55550
+ .cn-data-matrix__cell-value[data-v-7c401d14] {
55551
55551
  display: block;
55552
55552
  padding: 6px 10px;
55553
55553
  cursor: cell;
55554
55554
  min-height: 28px;
55555
55555
  }
55556
- .cn-data-matrix__cell--read-only .cn-data-matrix__cell-value[data-v-401dc886] {
55556
+ .cn-data-matrix__cell-value[data-v-7c401d14]:focus-visible {
55557
+ outline: 2px solid var(--color-primary-element);
55558
+ outline-offset: -2px;
55559
+ }
55560
+ .cn-data-matrix__cell--read-only .cn-data-matrix__cell-value[data-v-7c401d14] {
55557
55561
  cursor: default;
55558
55562
  background: var(--color-background-hover);
55559
55563
  }
55560
- .cn-data-matrix__cell-input[data-v-401dc886] {
55564
+ .cn-data-matrix__cell-input[data-v-7c401d14] {
55561
55565
  width: 100%;
55562
55566
  padding: 5px 10px;
55563
55567
  border: 1px solid var(--color-primary-element);
@@ -55565,39 +55569,39 @@ button.cn-object-calendar__overflow[data-v-e1c69ee2] {
55565
55569
  outline: none;
55566
55570
  font: inherit;
55567
55571
  }
55568
- .cn-data-matrix__totals-row .cn-data-matrix__total-cell[data-v-401dc886],
55569
- .cn-data-matrix__total-header[data-v-401dc886] {
55572
+ .cn-data-matrix__totals-row .cn-data-matrix__total-cell[data-v-7c401d14],
55573
+ .cn-data-matrix__total-header[data-v-7c401d14] {
55570
55574
  background: var(--color-background-darker, var(--color-background-hover));
55571
55575
  font-weight: 600;
55572
55576
  text-align: right;
55573
55577
  padding: 6px 10px;
55574
55578
  }
55575
- .cn-data-matrix__totals-label[data-v-401dc886] {
55579
+ .cn-data-matrix__totals-label[data-v-7c401d14] {
55576
55580
  background: var(--color-background-darker, var(--color-background-hover));
55577
55581
  font-weight: 600;
55578
55582
  padding: 6px 10px;
55579
55583
  text-align: left;
55580
55584
  }
55581
- .cn-data-matrix__grand-total[data-v-401dc886] {
55585
+ .cn-data-matrix__grand-total[data-v-7c401d14] {
55582
55586
  background: var(--color-primary-element-light);
55583
55587
  }
55584
- .cn-data-matrix__weight[data-v-401dc886] {
55588
+ .cn-data-matrix__weight[data-v-7c401d14] {
55585
55589
  color: var(--color-text-maxcontrast);
55586
55590
  font-weight: 400;
55587
55591
  white-space: nowrap;
55588
55592
  }
55589
- .cn-data-matrix__row-sublabel[data-v-401dc886] {
55593
+ .cn-data-matrix__row-sublabel[data-v-7c401d14] {
55590
55594
  display: block;
55591
55595
  color: var(--color-text-maxcontrast);
55592
55596
  font-size: 0.85em;
55593
55597
  font-weight: 400;
55594
55598
  }
55595
- .cn-data-matrix__row--top > th[data-v-401dc886],
55596
- .cn-data-matrix__row--top > td[data-v-401dc886] {
55599
+ .cn-data-matrix__row--top > th[data-v-7c401d14],
55600
+ .cn-data-matrix__row--top > td[data-v-7c401d14] {
55597
55601
  background: var(--color-primary-element-light);
55598
55602
  color: var(--color-primary-element-light-text);
55599
55603
  }
55600
- .cn-data-matrix__empty[data-v-401dc886] {
55604
+ .cn-data-matrix__empty[data-v-7c401d14] {
55601
55605
  color: var(--color-text-maxcontrast);
55602
55606
  font-style: italic;
55603
55607
  margin: 16px 0;
package/l10n/en.json CHANGED
@@ -2657,6 +2657,9 @@
2657
2657
  "{elapsed} of {norm}": "{elapsed} of {norm}",
2658
2658
  "Enter minutes, or minutes and seconds as 04:23.": "Enter minutes, or minutes and seconds as 04:23.",
2659
2659
  "Rank": "Rank",
2660
+ "{column}, {row}": "{column}, {row}",
2661
+ "{cell}: empty": "{cell}: empty",
2662
+ "{cell}: {value}": "{cell}: {value}",
2660
2663
  "Keep this one": "Keep this one",
2661
2664
  "Keep the server one": "Keep the server one",
2662
2665
  "Conflict: which version do you keep?": "Conflict: which version do you keep?",
package/l10n/nl.json CHANGED
@@ -2922,6 +2922,9 @@
2922
2922
  "{elapsed} of {norm}": "{elapsed} van {norm}",
2923
2923
  "Enter minutes, or minutes and seconds as 04:23.": "Vul minuten in, of minuten en seconden als 04:23.",
2924
2924
  "Rank": "Rang",
2925
+ "{column}, {row}": "{column}, {row}",
2926
+ "{cell}: empty": "{cell}: leeg",
2927
+ "{cell}: {value}": "{cell}: {value}",
2925
2928
  "Keep this one": "Deze houden",
2926
2929
  "Keep the server one": "Die van de server",
2927
2930
  "Conflict: which version do you keep?": "Conflict: welke versie houdt u?",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@conduction/nextcloud-vue",
3
- "version": "2.56.0-beta.71",
3
+ "version": "2.56.0-beta.72",
4
4
  "description": "Shared Vue component library for Conduction Nextcloud apps — complements @nextcloud/vue with higher-level components, OpenRegister integration, and NL Design System support",
5
5
  "homepage": "https://github.com/ConductionNL/nextcloud-vue#readme",
6
6
  "bugs": {
@@ -54,13 +54,17 @@
54
54
  type="text"
55
55
  class="cn-data-matrix__cell-input"
56
56
  :value="cellValue(row, col)"
57
+ :aria-label="inputLabel(row, col)"
57
58
  :disabled="readOnly || isCellReadOnly(row, col)"
58
59
  @blur="commitEdit(row, col, $event.target.value)"
59
- @keydown.enter="commitEdit(row, col, $event.target.value)"
60
- @keydown.esc="cancelEdit">
60
+ @keydown="onInputKeydown($event, row, col)">
61
61
  <span v-else
62
62
  class="cn-data-matrix__cell-value"
63
- @click="startEdit(row, col)">
63
+ :tabindex="isCellEditable(row, col) ? 0 : null"
64
+ :role="isCellEditable(row, col) ? 'button' : null"
65
+ :aria-label="isCellEditable(row, col) ? cellLabel(row, col) : null"
66
+ @click="startEdit(row, col)"
67
+ @keydown="onCellKeydown($event, row, col)">
64
68
  {{ formatCell(cellValue(row, col), col) }}
65
69
  </span>
66
70
  </td>
@@ -114,7 +118,8 @@ function numberIn(raw) {
114
118
 
115
119
  /**
116
120
  * CnDataMatrix — Inline-edit data grid for matrix-shaped data
117
- * (rows × columns). Each cell is click-to-edit; commits emit
121
+ * (rows × columns). Each cell is click-to-edit, and keyboard editable:
122
+ * Tab reaches it, Enter or F2 opens it, Enter commits, Escape cancels. Commits emit
118
123
  * `@cell-edit({ rowId, colKey, value })` so the parent can persist.
119
124
  * Optional row / column / grand totals computed from the live data
120
125
  * with the column's `aggregate` setting (`sum` by default).
@@ -326,6 +331,97 @@ export default {
326
331
  return Boolean(col.readOnly || col.formula)
327
332
  },
328
333
 
334
+ /**
335
+ * Whether a cell can be edited, and so takes keyboard focus.
336
+ *
337
+ * @param {object} row Row record.
338
+ * @param {object} col Column definition.
339
+ * @return {boolean}
340
+ */
341
+ isCellEditable(row, col) {
342
+ return !this.readOnly && !this.isCellReadOnly(row, col)
343
+ },
344
+
345
+ /**
346
+ * Accessible name of a cell's input: its column and row.
347
+ *
348
+ * @param {object} row Row record.
349
+ * @param {object} col Column definition.
350
+ * @return {string} The label.
351
+ */
352
+ inputLabel(row, col) {
353
+ return t('nextcloud-vue', '{column}, {row}', {
354
+ column: col.label || col.key,
355
+ row: row[this.rowLabelKey] ?? row[this.rowIdKey],
356
+ }, undefined, { escape: false })
357
+ },
358
+
359
+ /**
360
+ * Accessible name of an editable cell: its column, row and value.
361
+ *
362
+ * @param {object} row Row record.
363
+ * @param {object} col Column definition.
364
+ * @return {string} The label.
365
+ */
366
+ cellLabel(row, col) {
367
+ const value = this.formatCell(this.cellValue(row, col), col)
368
+ const vars = { cell: this.inputLabel(row, col), value: String(value) }
369
+ return value === ''
370
+ ? t('nextcloud-vue', '{cell}: empty', vars, undefined, { escape: false })
371
+ : t('nextcloud-vue', '{cell}: {value}', vars, undefined, { escape: false })
372
+ },
373
+
374
+ /**
375
+ * Enter or F2 on a focused cell starts editing it.
376
+ *
377
+ * @param {KeyboardEvent} event The key event.
378
+ * @param {object} row Row record.
379
+ * @param {object} col Column definition.
380
+ * @return {void}
381
+ */
382
+ onCellKeydown(event, row, col) {
383
+ if ((event.key === 'Enter' || event.key === 'F2') && this.isCellEditable(row, col)) {
384
+ event.preventDefault()
385
+ this.startEdit(row, col)
386
+ }
387
+ },
388
+
389
+ /**
390
+ * Enter commits and Escape cancels the edit; both return focus to the cell.
391
+ *
392
+ * @param {KeyboardEvent} event The key event.
393
+ * @param {object} row Row record.
394
+ * @param {object} col Column definition.
395
+ * @return {void}
396
+ */
397
+ onInputKeydown(event, row, col) {
398
+ if (event.key === 'Enter') {
399
+ event.preventDefault()
400
+ this.commitEdit(row, col, event.target.value)
401
+ this.focusCell(row, col)
402
+ } else if (event.key === 'Escape' || event.key === 'Esc') {
403
+ event.preventDefault()
404
+ this.cancelEdit()
405
+ this.focusCell(row, col)
406
+ }
407
+ },
408
+
409
+ /**
410
+ * Move focus to a cell's value after the edit input is gone.
411
+ *
412
+ * @param {object} row Row record.
413
+ * @param {object} col Column definition.
414
+ * @return {void}
415
+ */
416
+ focusCell(row, col) {
417
+ const rowId = String(row[this.rowIdKey])
418
+ this.$nextTick(() => {
419
+ const cell = Array.from(this.$el.querySelectorAll('.cn-data-matrix__cell'))
420
+ .find((td) => td.dataset.rowId === rowId && td.dataset.colKey === col.key)
421
+ cell?.querySelector('.cn-data-matrix__cell-value')?.focus()
422
+ })
423
+ },
424
+
329
425
  /**
330
426
  * Read the cell value from the row.
331
427
  *
@@ -616,6 +712,11 @@ export default {
616
712
  min-height: 28px;
617
713
  }
618
714
 
715
+ .cn-data-matrix__cell-value:focus-visible {
716
+ outline: 2px solid var(--color-primary-element);
717
+ outline-offset: -2px;
718
+ }
719
+
619
720
  .cn-data-matrix__cell--read-only .cn-data-matrix__cell-value {
620
721
  cursor: default;
621
722
  background: var(--color-background-hover);