@conduction/nextcloud-vue 2.56.0-beta.69 → 2.56.0-beta.70

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.
Files changed (180) hide show
  1. package/dist/esm/components/CnActionDialog/CnActionDialog.vue.js +1 -1
  2. package/dist/esm/components/CnActionDialog/CnActionDialog.vue2.js +114 -11
  3. package/dist/esm/components/CnActionDialog/CnActionDialog.vue2.js.map +1 -1
  4. package/dist/esm/components/CnActionDialog/CnActionDialog.vue3.js +67 -17
  5. package/dist/esm/components/CnActionDialog/CnActionDialog.vue3.js.map +1 -1
  6. package/dist/esm/components/CnBlockListEditor/CnBlockListEditor.vue.js +9 -0
  7. package/dist/esm/components/CnBlockListEditor/CnBlockListEditor.vue.js.map +1 -0
  8. package/dist/esm/components/CnBlockListEditor/CnBlockListEditor.vue2.js +352 -0
  9. package/dist/esm/components/CnBlockListEditor/CnBlockListEditor.vue2.js.map +1 -0
  10. package/dist/esm/components/CnBlockListEditor/CnBlockListEditor.vue3.js +266 -0
  11. package/dist/esm/components/CnBlockListEditor/CnBlockListEditor.vue3.js.map +1 -0
  12. package/dist/esm/components/CnChecklistRunWidget/CnChecklistRunWidget.vue.js +1 -1
  13. package/dist/esm/components/CnChecklistRunWidget/CnChecklistRunWidget.vue2.js +257 -7
  14. package/dist/esm/components/CnChecklistRunWidget/CnChecklistRunWidget.vue2.js.map +1 -1
  15. package/dist/esm/components/CnChecklistRunWidget/CnChecklistRunWidget.vue3.js +113 -59
  16. package/dist/esm/components/CnChecklistRunWidget/CnChecklistRunWidget.vue3.js.map +1 -1
  17. package/dist/esm/components/CnChildRecordsField/CnChildRecordsField.vue.js +1 -1
  18. package/dist/esm/components/CnChildRecordsField/CnChildRecordsField.vue2.js +210 -5
  19. package/dist/esm/components/CnChildRecordsField/CnChildRecordsField.vue2.js.map +1 -1
  20. package/dist/esm/components/CnChildRecordsField/CnChildRecordsField.vue3.js +134 -46
  21. package/dist/esm/components/CnChildRecordsField/CnChildRecordsField.vue3.js.map +1 -1
  22. package/dist/esm/components/CnChoiceMatrix/CnChoiceMatrix.vue.js +9 -0
  23. package/dist/esm/components/CnChoiceMatrix/CnChoiceMatrix.vue.js.map +1 -0
  24. package/dist/esm/components/CnChoiceMatrix/CnChoiceMatrix.vue2.js +385 -0
  25. package/dist/esm/components/CnChoiceMatrix/CnChoiceMatrix.vue2.js.map +1 -0
  26. package/dist/esm/components/CnChoiceMatrix/CnChoiceMatrix.vue3.js +277 -0
  27. package/dist/esm/components/CnChoiceMatrix/CnChoiceMatrix.vue3.js.map +1 -0
  28. package/dist/esm/components/CnCountdownWidget/CnCountdownWidget.vue.js +1 -1
  29. package/dist/esm/components/CnCountdownWidget/CnCountdownWidget.vue2.js +175 -20
  30. package/dist/esm/components/CnCountdownWidget/CnCountdownWidget.vue2.js.map +1 -1
  31. package/dist/esm/components/CnCountdownWidget/CnCountdownWidget.vue3.js +30 -8
  32. package/dist/esm/components/CnCountdownWidget/CnCountdownWidget.vue3.js.map +1 -1
  33. package/dist/esm/components/CnCreateFormWidget/CnCreateFormWidget.vue.js +1 -1
  34. package/dist/esm/components/CnCreateFormWidget/CnCreateFormWidget.vue2.js +72 -6
  35. package/dist/esm/components/CnCreateFormWidget/CnCreateFormWidget.vue2.js.map +1 -1
  36. package/dist/esm/components/CnCreateFormWidget/CnCreateFormWidget.vue3.js +48 -14
  37. package/dist/esm/components/CnCreateFormWidget/CnCreateFormWidget.vue3.js.map +1 -1
  38. package/dist/esm/components/CnDataMatrix/CnDataMatrix.vue.js +1 -1
  39. package/dist/esm/components/CnDataMatrix/CnDataMatrix.vue2.js +162 -9
  40. package/dist/esm/components/CnDataMatrix/CnDataMatrix.vue2.js.map +1 -1
  41. package/dist/esm/components/CnDataMatrix/CnDataMatrix.vue3.js +63 -23
  42. package/dist/esm/components/CnDataMatrix/CnDataMatrix.vue3.js.map +1 -1
  43. package/dist/esm/components/CnDisplayScreen/CnDisplayScreen.vue.js +9 -0
  44. package/dist/esm/components/CnDisplayScreen/CnDisplayScreen.vue.js.map +1 -0
  45. package/dist/esm/components/CnDisplayScreen/CnDisplayScreen.vue2.js +175 -0
  46. package/dist/esm/components/CnDisplayScreen/CnDisplayScreen.vue2.js.map +1 -0
  47. package/dist/esm/components/CnDisplayScreen/CnDisplayScreen.vue3.js +114 -0
  48. package/dist/esm/components/CnDisplayScreen/CnDisplayScreen.vue3.js.map +1 -0
  49. package/dist/esm/components/CnDurationField/CnDurationField.vue.js +1 -1
  50. package/dist/esm/components/CnDurationField/CnDurationField.vue2.js +218 -4
  51. package/dist/esm/components/CnDurationField/CnDurationField.vue2.js.map +1 -1
  52. package/dist/esm/components/CnDurationField/CnDurationField.vue3.js +133 -44
  53. package/dist/esm/components/CnDurationField/CnDurationField.vue3.js.map +1 -1
  54. package/dist/esm/components/CnFormDialog/CnFormDialog.vue.js +1 -1
  55. package/dist/esm/components/CnFormDialog/CnFormDialog.vue2.js.map +1 -1
  56. package/dist/esm/components/CnFormDialog/CnFormDialog.vue3.js +5 -1
  57. package/dist/esm/components/CnFormDialog/CnFormDialog.vue3.js.map +1 -1
  58. package/dist/esm/components/CnGeoCaptureField/CnGeoCaptureField.vue.js +9 -0
  59. package/dist/esm/components/CnGeoCaptureField/CnGeoCaptureField.vue.js.map +1 -0
  60. package/dist/esm/components/CnGeoCaptureField/CnGeoCaptureField.vue2.js +113 -0
  61. package/dist/esm/components/CnGeoCaptureField/CnGeoCaptureField.vue2.js.map +1 -0
  62. package/dist/esm/components/CnGeoCaptureField/CnGeoCaptureField.vue3.js +43 -0
  63. package/dist/esm/components/CnGeoCaptureField/CnGeoCaptureField.vue3.js.map +1 -0
  64. package/dist/esm/components/CnMarkdownEditor/CnMarkdownEditor.vue.js +1 -1
  65. package/dist/esm/components/CnMarkdownEditor/CnMarkdownEditor.vue2.js +110 -1
  66. package/dist/esm/components/CnMarkdownEditor/CnMarkdownEditor.vue2.js.map +1 -1
  67. package/dist/esm/components/CnMarkdownEditor/CnMarkdownEditor.vue3.js +60 -18
  68. package/dist/esm/components/CnMarkdownEditor/CnMarkdownEditor.vue3.js.map +1 -1
  69. package/dist/esm/components/CnMenuTreeNode/CnMenuTreeNode.vue2.js +2 -2
  70. package/dist/esm/components/CnMenuTreeNode/CnMenuTreeNode.vue2.js.map +1 -1
  71. package/dist/esm/components/CnObjectKanban/CnObjectKanban.vue2.js +2 -2
  72. package/dist/esm/components/CnObjectKanban/CnObjectKanban.vue2.js.map +1 -1
  73. package/dist/esm/components/CnPageTreeNode/CnPageTreeNode.vue2.js +2 -2
  74. package/dist/esm/components/CnPageTreeNode/CnPageTreeNode.vue2.js.map +1 -1
  75. package/dist/esm/components/CnQrCode/CnQrCode.vue.js +9 -0
  76. package/dist/esm/components/CnQrCode/CnQrCode.vue.js.map +1 -0
  77. package/dist/esm/components/CnQrCode/CnQrCode.vue2.js +241 -0
  78. package/dist/esm/components/CnQrCode/CnQrCode.vue2.js.map +1 -0
  79. package/dist/esm/components/CnQrCode/CnQrCode.vue3.js +75 -0
  80. package/dist/esm/components/CnQrCode/CnQrCode.vue3.js.map +1 -0
  81. package/dist/esm/components/CnReadinessChecklist/CnReadinessChecklist.vue.js +1 -1
  82. package/dist/esm/components/CnReadinessChecklist/CnReadinessChecklist.vue2.js +34 -3
  83. package/dist/esm/components/CnReadinessChecklist/CnReadinessChecklist.vue2.js.map +1 -1
  84. package/dist/esm/components/CnReadinessChecklist/CnReadinessChecklist.vue3.js +81 -19
  85. package/dist/esm/components/CnReadinessChecklist/CnReadinessChecklist.vue3.js.map +1 -1
  86. package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue.js +1 -1
  87. package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue2.js +11 -0
  88. package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue2.js.map +1 -1
  89. package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue3.js +112 -88
  90. package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue3.js.map +1 -1
  91. package/dist/esm/components/CnRevealField/CnRevealField.vue.js +9 -0
  92. package/dist/esm/components/CnRevealField/CnRevealField.vue.js.map +1 -0
  93. package/dist/esm/components/CnRevealField/CnRevealField.vue2.js +157 -0
  94. package/dist/esm/components/CnRevealField/CnRevealField.vue2.js.map +1 -0
  95. package/dist/esm/components/CnRevealField/CnRevealField.vue3.js +116 -0
  96. package/dist/esm/components/CnRevealField/CnRevealField.vue3.js.map +1 -0
  97. package/dist/esm/components/CnTextWidget/CnTextWidget.vue.js +1 -1
  98. package/dist/esm/components/CnTextWidget/CnTextWidget.vue2.js +43 -3
  99. package/dist/esm/components/CnTextWidget/CnTextWidget.vue2.js.map +1 -1
  100. package/dist/esm/components/CnTextWidget/CnTextWidget.vue3.js +19 -12
  101. package/dist/esm/components/CnTextWidget/CnTextWidget.vue3.js.map +1 -1
  102. package/dist/esm/components/CnTransferCard/CnTransferCard.vue.js +9 -0
  103. package/dist/esm/components/CnTransferCard/CnTransferCard.vue.js.map +1 -0
  104. package/dist/esm/components/CnTransferCard/CnTransferCard.vue2.js +87 -0
  105. package/dist/esm/components/CnTransferCard/CnTransferCard.vue2.js.map +1 -0
  106. package/dist/esm/components/CnTransferCard/CnTransferCard.vue3.js +126 -0
  107. package/dist/esm/components/CnTransferCard/CnTransferCard.vue3.js.map +1 -0
  108. package/dist/esm/components/CnTreeView/CnTreeNode.vue.js +1 -1
  109. package/dist/esm/components/CnTreeView/CnTreeNode.vue2.js +66 -1
  110. package/dist/esm/components/CnTreeView/CnTreeNode.vue2.js.map +1 -1
  111. package/dist/esm/components/CnTreeView/CnTreeNode.vue3.js +129 -29
  112. package/dist/esm/components/CnTreeView/CnTreeNode.vue3.js.map +1 -1
  113. package/dist/esm/components/CnTreeView/CnTreeView.vue.js +1 -1
  114. package/dist/esm/components/CnTreeView/CnTreeView.vue2.js +158 -6
  115. package/dist/esm/components/CnTreeView/CnTreeView.vue2.js.map +1 -1
  116. package/dist/esm/components/CnTreeView/CnTreeView.vue3.js +100 -39
  117. package/dist/esm/components/CnTreeView/CnTreeView.vue3.js.map +1 -1
  118. package/dist/esm/index.js +8 -0
  119. package/dist/esm/index.js.map +1 -1
  120. package/dist/esm/l10n/en.json.js +63 -1
  121. package/dist/esm/l10n/en.json.js.map +1 -1
  122. package/dist/esm/l10n/nl.json.js +63 -1
  123. package/dist/esm/l10n/nl.json.js.map +1 -1
  124. package/dist/esm/library-style.js +1 -1
  125. package/dist/esm/nextcloud-vue.css +1134 -499
  126. package/dist/esm/node_modules/vuedraggable/dist/vuedraggable.umd.js +2 -2
  127. package/dist/esm/utils/captureLocation.js +32 -0
  128. package/dist/esm/utils/captureLocation.js.map +1 -0
  129. package/dist/esm/utils/childRecordTotals.js +157 -0
  130. package/dist/esm/utils/childRecordTotals.js.map +1 -0
  131. package/dist/esm/utils/isoDuration.js +51 -1
  132. package/dist/esm/utils/isoDuration.js.map +1 -1
  133. package/dist/esm/utils/qr.js +649 -0
  134. package/dist/esm/utils/qr.js.map +1 -0
  135. package/dist/esm/utils/schema.js +3 -0
  136. package/dist/esm/utils/schema.js.map +1 -1
  137. package/dist/esm/utils/templateVariables.js +54 -0
  138. package/dist/esm/utils/templateVariables.js.map +1 -0
  139. package/dist/nextcloud-vue.cjs.js +20307 -14544
  140. package/dist/nextcloud-vue.cjs.js.map +2 -2
  141. package/dist/nextcloud-vue.css +1134 -499
  142. package/l10n/en.json +63 -1
  143. package/l10n/nl.json +63 -1
  144. package/package.json +1 -1
  145. package/src/components/CnActionDialog/CnActionDialog.vue +156 -9
  146. package/src/components/CnBlockListEditor/CnBlockListEditor.vue +615 -0
  147. package/src/components/CnBlockListEditor/index.js +9 -0
  148. package/src/components/CnChecklistRunWidget/CnChecklistRunWidget.vue +311 -10
  149. package/src/components/CnChildRecordsField/CnChildRecordsField.vue +306 -15
  150. package/src/components/CnChoiceMatrix/CnChoiceMatrix.vue +710 -0
  151. package/src/components/CnChoiceMatrix/index.js +9 -0
  152. package/src/components/CnCountdownWidget/CnCountdownWidget.vue +223 -28
  153. package/src/components/CnCreateFormWidget/CnCreateFormWidget.vue +97 -6
  154. package/src/components/CnDataMatrix/CnDataMatrix.vue +199 -13
  155. package/src/components/CnDisplayScreen/CnDisplayScreen.vue +308 -0
  156. package/src/components/CnDisplayScreen/index.js +9 -0
  157. package/src/components/CnDurationField/CnDurationField.vue +330 -5
  158. package/src/components/CnFormDialog/CnFormDialog.vue +4 -0
  159. package/src/components/CnGeoCaptureField/CnGeoCaptureField.vue +148 -0
  160. package/src/components/CnGeoCaptureField/index.js +9 -0
  161. package/src/components/CnMarkdownEditor/CnMarkdownEditor.vue +139 -1
  162. package/src/components/CnQrCode/CnQrCode.vue +321 -0
  163. package/src/components/CnQrCode/index.js +9 -0
  164. package/src/components/CnReadinessChecklist/CnReadinessChecklist.vue +80 -3
  165. package/src/components/CnRecordListWidget/CnRecordListWidget.vue +34 -1
  166. package/src/components/CnRevealField/CnRevealField.vue +273 -0
  167. package/src/components/CnRevealField/index.js +9 -0
  168. package/src/components/CnTextWidget/CnTextWidget.vue +62 -3
  169. package/src/components/CnTransferCard/CnTransferCard.vue +205 -0
  170. package/src/components/CnTransferCard/index.js +9 -0
  171. package/src/components/CnTreeView/CnTreeNode.vue +145 -2
  172. package/src/components/CnTreeView/CnTreeView.vue +210 -6
  173. package/src/components/index.js +7 -0
  174. package/src/index.js +8 -0
  175. package/src/utils/captureLocation.js +29 -0
  176. package/src/utils/childRecordTotals.js +153 -0
  177. package/src/utils/isoDuration.js +50 -0
  178. package/src/utils/qr.js +681 -0
  179. package/src/utils/schema.js +3 -0
  180. package/src/utils/templateVariables.js +51 -0
@@ -0,0 +1,385 @@
1
+ import { translate } from '@nextcloud/l10n';
2
+ import { NcButton, NcSelect } from '@nextcloud/vue';
3
+ import { userLocale } from '../../utils/userLocale.js';
4
+
5
+ let lastUid = 0;
6
+
7
+ /**
8
+ * CnChoiceMatrix: rows against columns, every cell one choice out of the same
9
+ * closed set (board DqZaaktypeVelden: fields against role and status, each
10
+ * cell hidden, required or read only). `CnDataMatrix` is the grid for free
11
+ * values, `CnActionAuthMatrix` the one for ticks.
12
+ *
13
+ * The value is a map `{ [rowId]: { [columnKey]: choiceValue } }`. A cell with
14
+ * no stored value shows `defaultValue`. A change emits the whole new map, so
15
+ * the host saves it or a single cell as it likes, and refusing a save is only
16
+ * a matter of not passing the new map back in.
17
+ *
18
+ * ```vue
19
+ * <CnChoiceMatrix
20
+ * row-header="Field"
21
+ * :rows="[{ id: 'costs', label: 'Building costs' }]"
22
+ * :columns="[{ key: 'intake', label: 'Intake', description: 'received' }]"
23
+ * :choices="[
24
+ * { value: 'hidden', label: 'Hidden', tone: 'muted' },
25
+ * { value: 'required', label: 'Required', tone: 'strong' },
26
+ * { value: 'readonly', label: 'Read only' },
27
+ * ]"
28
+ * :model-value="rights"
29
+ * default-value="readonly"
30
+ * @update:model-value="rights = $event" />
31
+ * ```
32
+ *
33
+ * With `pickPerRow` a row holds one pick rather than a value per column, as a
34
+ * rubric does (boards LqInleveringNakijken, LqLlInleveren): radio buttons per
35
+ * row, each with its text and points, and a running score. The value is then
36
+ * `{ [rowId]: optionKey }`. The options are the `columns`, or a row's own
37
+ * `options` when its levels differ.
38
+ *
39
+ * @event update:modelValue The whole new map after a cell changed.
40
+ * @event cell-change One changed cell: `{ rowId, columnKey, value, previous }`.
41
+ * @event score-change With `pickPerRow`, on mount and on every change: `{ score, max, complete }`.
42
+ *
43
+ * @spec openspec/changes/choice-matrix/specs/choice-matrix/spec.md
44
+ */
45
+ var script = {
46
+ name: 'CnChoiceMatrix',
47
+
48
+ components: { NcButton, NcSelect },
49
+
50
+ props: {
51
+ /**
52
+ * The rows: objects with an id (`rowIdKey`), a label (`rowLabelKey`) and an optional `readOnly`.
53
+ * With `pickPerRow` also `weight` and `options`: `{ key, label, description?, points? }`.
54
+ */
55
+ rows: { type: Array, default: () => [] },
56
+ /** The columns: `{ key, label, description?, readOnly?, points? }`. */
57
+ columns: { type: Array, default: () => [] },
58
+ /** The closed set every cell picks from: `{ value, label, tone? }`, `tone` being `muted` or `strong`. */
59
+ choices: { type: Array, default: () => [] },
60
+ /** The stored choices: `{ [rowId]: { [columnKey]: value } }`, or with `pickPerRow` `{ [rowId]: optionKey }`. */
61
+ modelValue: { type: Object, default: () => ({}) },
62
+ /** The choice value a cell shows while nothing is stored for it. */
63
+ defaultValue: { type: String, default: '' },
64
+ /** Key of a row's id. */
65
+ rowIdKey: { type: String, default: 'id' },
66
+ /** Key of a row's label. */
67
+ rowLabelKey: { type: String, default: 'label' },
68
+ /** Heading of the row column, already translated. */
69
+ rowHeader: { type: String, default: '' },
70
+ /** Title above the grid, already translated. */
71
+ title: { type: String, default: '' },
72
+ /** A line under the title, already translated. */
73
+ description: { type: String, default: '' },
74
+ /** Text when there are no rows or columns; the library default is "Nothing to set yet.". */
75
+ emptyLabel: { type: String, default: '' },
76
+ /** Draw every cell as text. */
77
+ readOnly: { type: Boolean, default: false },
78
+ /** A row holds one pick, drawn as radio buttons, rather than a choice per column. */
79
+ pickPerRow: { type: Boolean, default: false },
80
+ /** Show the score: `true` for the library's words, or a text with `{score}` and `{max}`, already translated. */
81
+ scoreLabel: { type: [Boolean, String], default: false },
82
+ /** The most a user can score; the sum of each row's highest points when null. */
83
+ scoreMax: { type: Number, default: null },
84
+ /** How picks add up: `sum` adds the points, `weighted` multiplies each by its row's `weight` first. */
85
+ scoreMode: { type: String, default: 'sum', validator: (value) => ['sum', 'weighted'].includes(value) },
86
+ /** A row's weight in words, already translated, with `{weight}`. */
87
+ weightTemplate: { type: String, default: '' },
88
+ /** Errors per row, already translated: `{ [rowId]: text }`. */
89
+ rowErrors: { type: Object, default: () => ({}) },
90
+ /** A Remove button per row; a row with `removable: false` keeps none. Ignored when `readOnly`. */
91
+ removableRows: { type: Boolean, default: false },
92
+ },
93
+
94
+ emits: ['update:modelValue', 'cell-change', 'score-change', 'remove-row'],
95
+
96
+ data() {
97
+ lastUid += 1;
98
+ return { uid: `cn-choice-matrix-${lastUid}`, status: '' }
99
+ },
100
+
101
+ computed: {
102
+ /** @return {boolean} Whether there is nothing to draw. */
103
+ /**
104
+ * @return {boolean} Whether any row shows a Remove button, which adds the actions column.
105
+ */
106
+ hasRemovable() {
107
+ return this.rows.some((row) => this.removable(row))
108
+ },
109
+
110
+ isEmpty() {
111
+ if (this.rows.length === 0) {
112
+ return true
113
+ }
114
+ return this.pickPerRow
115
+ ? this.rows.every((row) => this.optionsOf(row).length === 0)
116
+ : this.columns.length === 0
117
+ },
118
+
119
+ /** @return {{score: number, max: number, complete: boolean}} The running score. */
120
+ score() {
121
+ let score = 0;
122
+ let max = 0;
123
+ let complete = true;
124
+ for (const row of this.rows) {
125
+ const factor = this.scoreMode === 'weighted' ? (Number(row.weight) || 0) : 1;
126
+ const options = this.optionsOf(row);
127
+ const picked = options.find((option) => option.key === this.pickedKey(row));
128
+ max += Math.max(0, ...options.map((option) => Number(option.points) || 0)) * factor;
129
+ score += (Number(picked?.points) || 0) * factor;
130
+ complete = complete && (Boolean(picked) || Boolean(row.readOnly));
131
+ }
132
+ return { score, max: this.scoreMax ?? max, complete }
133
+ },
134
+
135
+ /** @return {string} The score in words, or ''. */
136
+ scoreLine() {
137
+ if (!this.scoreLabel) {
138
+ return ''
139
+ }
140
+ const score = this.formatNumber(this.score.score);
141
+ const max = this.formatNumber(this.score.max);
142
+ return typeof this.scoreLabel === 'string'
143
+ ? this.scoreLabel.replace('{score}', score).replace('{max}', max)
144
+ : translate('nextcloud-vue', 'Score: {score} of {max}', { score, max })
145
+ },
146
+ },
147
+
148
+ watch: {
149
+ score: {
150
+ immediate: true,
151
+ handler(next, previous) {
152
+ if (this.pickPerRow && JSON.stringify(next) !== JSON.stringify(previous)) {
153
+ this.$emit('score-change', next);
154
+ }
155
+ },
156
+ },
157
+ },
158
+
159
+ methods: {
160
+ t: translate,
161
+
162
+ /**
163
+ * @param {number} value A number.
164
+ * @return {string} The number in the user's locale, with at most two decimals.
165
+ */
166
+ formatNumber(value) {
167
+ return value.toLocaleString(userLocale(), { maximumFractionDigits: 2 })
168
+ },
169
+
170
+ /**
171
+ * @param {object} row A row.
172
+ * @return {object[]} What the row picks from: its own options, else the columns.
173
+ */
174
+ optionsOf(row) {
175
+ return Array.isArray(row.options) ? row.options : this.columns
176
+ },
177
+
178
+ /**
179
+ * @param {object} row A row.
180
+ * @return {string|undefined} The key of the option the row holds.
181
+ */
182
+ pickedKey(row) {
183
+ return this.modelValue?.[this.rowId(row)]
184
+ },
185
+
186
+ /**
187
+ * @param {object} row A row.
188
+ * @return {string} The row's weight in words, or ''.
189
+ */
190
+ weightText(row) {
191
+ if (row.weight === undefined || row.weight === null || row.weight === '') {
192
+ return ''
193
+ }
194
+ const weight = String(row.weight);
195
+ return this.weightTemplate
196
+ ? this.weightTemplate.replace('{weight}', weight)
197
+ : translate('nextcloud-vue', '(weight {weight})', { weight })
198
+ },
199
+
200
+ /**
201
+ * @param {object} option An option.
202
+ * @return {string} Its points in words, or ''.
203
+ */
204
+ pointsText(option) {
205
+ if (option.points === undefined || option.points === null) {
206
+ return ''
207
+ }
208
+ const points = this.formatNumber(Number(option.points));
209
+ return Number(option.points) === 1
210
+ ? translate('nextcloud-vue', '{points} point', { points })
211
+ : translate('nextcloud-vue', '{points} points', { points })
212
+ },
213
+
214
+ /**
215
+ * @param {object} row A row.
216
+ * @return {string} The row's error, or ''.
217
+ */
218
+ rowError(row) {
219
+ return this.rowErrors?.[this.rowId(row)] ?? ''
220
+ },
221
+
222
+ /**
223
+ * @param {object} row A row.
224
+ * @return {string} The id of the row's error line.
225
+ */
226
+ errorId(row) {
227
+ return `${this.uid}-error-${this.rowId(row)}`
228
+ },
229
+
230
+ /**
231
+ * Emit the new map for a picked option.
232
+ *
233
+ * @param {object} row A row.
234
+ * @param {object} option The picked option.
235
+ * @return {void}
236
+ */
237
+ pick(row, option) {
238
+ const rowId = this.rowId(row);
239
+ const previous = this.pickedKey(row);
240
+ this.$emit('update:modelValue', { ...this.modelValue, [rowId]: option.key });
241
+ this.$emit('cell-change', { rowId, columnKey: option.key, value: option.key, previous });
242
+ },
243
+
244
+ /**
245
+ * @param {object} row A row.
246
+ * @return {boolean} Whether the row shows a Remove button.
247
+ * @spec openspec/changes/choice-matrix-removable-rows/tasks.md#task-1
248
+ */
249
+ removable(row) {
250
+ return this.removableRows && !this.readOnly && row.removable !== false
251
+ },
252
+
253
+ /**
254
+ * @param {object} row A row.
255
+ * @return {string} The accessible name of its Remove button.
256
+ */
257
+ removeLabel(row) {
258
+ return translate('nextcloud-vue', 'Remove {row}', { row: String(row[this.rowLabelKey] ?? '') })
259
+ },
260
+
261
+ /**
262
+ * Remove a row: emit the map without it and `remove-row`, so the host
263
+ * drops it from `rows`, and say so to a screen reader.
264
+ *
265
+ * @param {object} row A row.
266
+ * @return {void}
267
+ * @spec openspec/changes/choice-matrix-removable-rows/tasks.md#task-1
268
+ */
269
+ removeRow(row) {
270
+ const rowId = this.rowId(row);
271
+ const next = { ...this.modelValue };
272
+ delete next[rowId];
273
+ this.$emit('update:modelValue', next);
274
+ this.$emit('remove-row', { rowId, row });
275
+ this.status = translate('nextcloud-vue', 'Removed {row}.', { row: String(row[this.rowLabelKey] ?? '') });
276
+ const index = this.rows.indexOf(row);
277
+ this.$nextTick(() => this.focusAfterRemove(index));
278
+ },
279
+
280
+ /**
281
+ * Keep the keyboard in the grid after a row is gone: the Remove button
282
+ * now at the removed row's place, else the last one, else the grid.
283
+ *
284
+ * @param {number} index Where the removed row was.
285
+ * @return {void}
286
+ */
287
+ focusAfterRemove(index) {
288
+ const buttons = this.$el.querySelectorAll('[data-testid^="cn-choice-matrix-remove-"]');
289
+ const target = buttons[Math.min(index, buttons.length - 1)] || this.$el;
290
+ target.focus();
291
+ },
292
+
293
+ /**
294
+ * @param {object} row A row.
295
+ * @return {string} The row's id as a string.
296
+ */
297
+ rowId(row) {
298
+ return String(row[this.rowIdKey])
299
+ },
300
+
301
+ /**
302
+ * @param {object} row A row.
303
+ * @param {object} column A column.
304
+ * @return {boolean} Whether this cell offers a choice.
305
+ */
306
+ editable(row, column) {
307
+ return !this.readOnly && !row.readOnly && !column.readOnly
308
+ },
309
+
310
+ /**
311
+ * @param {object} row A row.
312
+ * @param {object} column A column.
313
+ * @return {string} The stored value, else `defaultValue`.
314
+ */
315
+ valueOf(row, column) {
316
+ return this.modelValue?.[this.rowId(row)]?.[column.key] ?? this.defaultValue
317
+ },
318
+
319
+ /**
320
+ * @param {object} row A row.
321
+ * @param {object} column A column.
322
+ * @return {object|null} The choice the cell holds, null when it matches none.
323
+ */
324
+ choiceOf(row, column) {
325
+ const value = this.valueOf(row, column);
326
+ return this.choices.find((choice) => choice.value === value) ?? null
327
+ },
328
+
329
+ /**
330
+ * The cell as text. A stored value outside the set shows as it is, so
331
+ * it is seen rather than read as empty.
332
+ *
333
+ * @param {object} row A row.
334
+ * @param {object} column A column.
335
+ * @return {string} What a read-only cell says.
336
+ */
337
+ valueText(row, column) {
338
+ return this.choiceOf(row, column)?.label ?? String(this.valueOf(row, column))
339
+ },
340
+
341
+ /**
342
+ * @param {object} row A row.
343
+ * @param {object} column A column.
344
+ * @return {string} The class of the cell's tone, or ''.
345
+ */
346
+ toneClass(row, column) {
347
+ const tone = this.choiceOf(row, column)?.tone;
348
+ return tone ? `cn-choice-matrix__value--${tone}` : ''
349
+ },
350
+
351
+ /**
352
+ * @param {object} row A row.
353
+ * @param {object} column A column.
354
+ * @return {string} A name for the cell's control, naming both axes.
355
+ */
356
+ cellLabel(row, column) {
357
+ return `${row[this.rowLabelKey]}, ${column.label}`
358
+ },
359
+
360
+ /**
361
+ * Emit the new map for a picked choice. Picking what the cell already
362
+ * holds, or nothing, changes nothing.
363
+ *
364
+ * @param {object} row A row.
365
+ * @param {object} column A column.
366
+ * @param {object|null} choice The picked choice.
367
+ * @return {void}
368
+ */
369
+ setCell(row, column, choice) {
370
+ const previous = this.valueOf(row, column);
371
+ if (!choice || choice.value === previous) {
372
+ return
373
+ }
374
+ const rowId = this.rowId(row);
375
+ this.$emit('update:modelValue', {
376
+ ...this.modelValue,
377
+ [rowId]: { ...(this.modelValue?.[rowId] ?? {}), [column.key]: choice.value },
378
+ });
379
+ this.$emit('cell-change', { rowId, columnKey: column.key, value: choice.value, previous });
380
+ },
381
+ },
382
+ };
383
+
384
+ export { script as default };
385
+ //# sourceMappingURL=CnChoiceMatrix.vue2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CnChoiceMatrix.vue2.js","sources":["../../../../src/components/CnChoiceMatrix/CnChoiceMatrix.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n<template>\n\t<section class=\"cn-choice-matrix\" data-testid=\"cn-choice-matrix\" tabindex=\"-1\">\n\t\t<header v-if=\"title || description\" class=\"cn-choice-matrix__header\">\n\t\t\t<h3 v-if=\"title\" class=\"cn-choice-matrix__title\">\n\t\t\t\t{{ title }}\n\t\t\t</h3>\n\t\t\t<p v-if=\"description\" class=\"cn-choice-matrix__description\">\n\t\t\t\t{{ description }}\n\t\t\t</p>\n\t\t</header>\n\n\t\t<p v-if=\"isEmpty\"\n\t\t\tclass=\"cn-choice-matrix__empty\"\n\t\t\tdata-testid=\"cn-choice-matrix-empty\">\n\t\t\t{{ emptyLabel || t('nextcloud-vue', 'Nothing to set yet.') }}\n\t\t</p>\n\n\t\t<template v-else-if=\"pickPerRow\">\n\t\t\t<fieldset v-for=\"row in rows\"\n\t\t\t\t:key=\"rowId(row)\"\n\t\t\t\tclass=\"cn-choice-matrix__row\"\n\t\t\t\trole=\"radiogroup\"\n\t\t\t\t:aria-invalid=\"rowError(row) ? 'true' : undefined\"\n\t\t\t\t:aria-describedby=\"rowError(row) ? errorId(row) : undefined\"\n\t\t\t\t:data-testid=\"`cn-choice-matrix-row-${rowId(row)}`\">\n\t\t\t\t<legend class=\"cn-choice-matrix__legend\">\n\t\t\t\t\t{{ row[rowLabelKey] }}\n\t\t\t\t\t<span v-if=\"weightText(row)\" class=\"cn-choice-matrix__weight\">{{ weightText(row) }}</span>\n\t\t\t\t</legend>\n\t\t\t\t<div class=\"cn-choice-matrix__options\">\n\t\t\t\t\t<label v-for=\"option in optionsOf(row)\"\n\t\t\t\t\t\t:key=\"option.key\"\n\t\t\t\t\t\tclass=\"cn-choice-matrix__option\"\n\t\t\t\t\t\t:class=\"{ 'cn-choice-matrix__option--picked': pickedKey(row) === option.key }\">\n\t\t\t\t\t\t<input type=\"radio\"\n\t\t\t\t\t\t\t:name=\"`${uid}-${rowId(row)}`\"\n\t\t\t\t\t\t\t:value=\"option.key\"\n\t\t\t\t\t\t\t:checked=\"pickedKey(row) === option.key\"\n\t\t\t\t\t\t\t:disabled=\"readOnly || Boolean(row.readOnly)\"\n\t\t\t\t\t\t\t:data-testid=\"`cn-choice-matrix-option-${rowId(row)}-${option.key}`\"\n\t\t\t\t\t\t\t@change=\"pick(row, option)\">\n\t\t\t\t\t\t<span class=\"cn-choice-matrix__option-text\">\n\t\t\t\t\t\t\t<span>{{ option.label }}</span>\n\t\t\t\t\t\t\t<span v-if=\"option.description\" class=\"cn-choice-matrix__option-detail\">{{ option.description }}</span>\n\t\t\t\t\t\t\t<span v-if=\"pointsText(option)\" class=\"cn-choice-matrix__option-detail\">{{ pointsText(option) }}</span>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</label>\n\t\t\t\t</div>\n\t\t\t\t<p v-if=\"rowError(row)\"\n\t\t\t\t\t:id=\"errorId(row)\"\n\t\t\t\t\tclass=\"cn-choice-matrix__error\"\n\t\t\t\t\tdata-testid=\"cn-choice-matrix-row-error\">\n\t\t\t\t\t{{ rowError(row) }}\n\t\t\t\t</p>\n\t\t\t\t<NcButton v-if=\"removable(row)\"\n\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\tclass=\"cn-choice-matrix__remove\"\n\t\t\t\t\t:aria-label=\"removeLabel(row)\"\n\t\t\t\t\t:data-testid=\"`cn-choice-matrix-remove-${rowId(row)}`\"\n\t\t\t\t\t@click=\"removeRow(row)\">\n\t\t\t\t\t{{ t('nextcloud-vue', 'Remove') }}\n\t\t\t\t</NcButton>\n\t\t\t</fieldset>\n\t\t\t<div v-if=\"scoreLine || $slots.scoreNote\" class=\"cn-choice-matrix__score\" data-testid=\"cn-choice-matrix-score\">\n\t\t\t\t<strong role=\"status\">{{ scoreLine }}</strong>\n\t\t\t\t<!-- @slot scoreNote A remark beside the score. -->\n\t\t\t\t<slot name=\"scoreNote\" />\n\t\t\t</div>\n\t\t</template>\n\n\t\t<div v-else class=\"cn-choice-matrix__scroller\">\n\t\t\t<table class=\"cn-choice-matrix__table\">\n\t\t\t\t<caption v-if=\"title\" class=\"cn-choice-matrix__caption\">\n\t\t\t\t\t{{ title }}\n\t\t\t\t</caption>\n\t\t\t\t<thead>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th scope=\"col\" class=\"cn-choice-matrix__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=\"column in columns\"\n\t\t\t\t\t\t\t:key=\"column.key\"\n\t\t\t\t\t\t\tscope=\"col\"\n\t\t\t\t\t\t\tclass=\"cn-choice-matrix__col-header\"\n\t\t\t\t\t\t\t:data-testid=\"`cn-choice-matrix-col-${column.key}`\">\n\t\t\t\t\t\t\t<span>{{ column.label }}</span>\n\t\t\t\t\t\t\t<span v-if=\"column.description\" class=\"cn-choice-matrix__col-description\">{{ column.description }}</span>\n\t\t\t\t\t\t</th>\n\t\t\t\t\t\t<th v-if=\"hasRemovable\" scope=\"col\" class=\"cn-choice-matrix__actions\">\n\t\t\t\t\t\t\t<span class=\"cn-choice-matrix__sr\">{{ t('nextcloud-vue', 'Row actions') }}</span>\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\" :key=\"rowId(row)\">\n\t\t\t\t\t\t<th scope=\"row\" class=\"cn-choice-matrix__row-header\">\n\t\t\t\t\t\t\t{{ row[rowLabelKey] }}\n\t\t\t\t\t\t\t<span v-if=\"rowError(row)\" class=\"cn-choice-matrix__error\" data-testid=\"cn-choice-matrix-row-error\">{{ rowError(row) }}</span>\n\t\t\t\t\t\t</th>\n\t\t\t\t\t\t<td v-for=\"column in columns\"\n\t\t\t\t\t\t\t:key=\"column.key\"\n\t\t\t\t\t\t\tclass=\"cn-choice-matrix__cell\"\n\t\t\t\t\t\t\t:data-testid=\"`cn-choice-matrix-cell-${rowId(row)}-${column.key}`\">\n\t\t\t\t\t\t\t<NcSelect v-if=\"editable(row, column)\"\n\t\t\t\t\t\t\t\t:modelValue=\"choiceOf(row, column)\"\n\t\t\t\t\t\t\t\t:options=\"choices\"\n\t\t\t\t\t\t\t\t:clearable=\"false\"\n\t\t\t\t\t\t\t\t:searchable=\"false\"\n\t\t\t\t\t\t\t\t:ariaLabelCombobox=\"cellLabel(row, column)\"\n\t\t\t\t\t\t\t\tlabel=\"label\"\n\t\t\t\t\t\t\t\t@update:modelValue=\"(choice) => setCell(row, column, choice)\" />\n\t\t\t\t\t\t\t<span v-else\n\t\t\t\t\t\t\t\tclass=\"cn-choice-matrix__value\"\n\t\t\t\t\t\t\t\t:class=\"toneClass(row, column)\"\n\t\t\t\t\t\t\t\tdata-testid=\"cn-choice-matrix-value\">{{ valueText(row, column) }}</span>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td v-if=\"hasRemovable\" class=\"cn-choice-matrix__actions\">\n\t\t\t\t\t\t\t<NcButton v-if=\"removable(row)\"\n\t\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\t\t:aria-label=\"removeLabel(row)\"\n\t\t\t\t\t\t\t\t:data-testid=\"`cn-choice-matrix-remove-${rowId(row)}`\"\n\t\t\t\t\t\t\t\t@click=\"removeRow(row)\">\n\t\t\t\t\t\t\t\t{{ t('nextcloud-vue', 'Remove') }}\n\t\t\t\t\t\t\t</NcButton>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t</tbody>\n\t\t\t</table>\n\t\t</div>\n\t\t<p class=\"cn-choice-matrix__sr\" aria-live=\"polite\" data-testid=\"cn-choice-matrix-status\">\n\t\t\t{{ status }}\n\t\t</p>\n\t</section>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport { NcButton, NcSelect } from '@nextcloud/vue'\nimport { userLocale } from '../../utils/userLocale.js'\n\nlet lastUid = 0\n\n/**\n * CnChoiceMatrix: rows against columns, every cell one choice out of the same\n * closed set (board DqZaaktypeVelden: fields against role and status, each\n * cell hidden, required or read only). `CnDataMatrix` is the grid for free\n * values, `CnActionAuthMatrix` the one for ticks.\n *\n * The value is a map `{ [rowId]: { [columnKey]: choiceValue } }`. A cell with\n * no stored value shows `defaultValue`. A change emits the whole new map, so\n * the host saves it or a single cell as it likes, and refusing a save is only\n * a matter of not passing the new map back in.\n *\n * ```vue\n * <CnChoiceMatrix\n * row-header=\"Field\"\n * :rows=\"[{ id: 'costs', label: 'Building costs' }]\"\n * :columns=\"[{ key: 'intake', label: 'Intake', description: 'received' }]\"\n * :choices=\"[\n * { value: 'hidden', label: 'Hidden', tone: 'muted' },\n * { value: 'required', label: 'Required', tone: 'strong' },\n * { value: 'readonly', label: 'Read only' },\n * ]\"\n * :model-value=\"rights\"\n * default-value=\"readonly\"\n * @update:model-value=\"rights = $event\" />\n * ```\n *\n * With `pickPerRow` a row holds one pick rather than a value per column, as a\n * rubric does (boards LqInleveringNakijken, LqLlInleveren): radio buttons per\n * row, each with its text and points, and a running score. The value is then\n * `{ [rowId]: optionKey }`. The options are the `columns`, or a row's own\n * `options` when its levels differ.\n *\n * @event update:modelValue The whole new map after a cell changed.\n * @event cell-change One changed cell: `{ rowId, columnKey, value, previous }`.\n * @event score-change With `pickPerRow`, on mount and on every change: `{ score, max, complete }`.\n *\n * @spec openspec/changes/choice-matrix/specs/choice-matrix/spec.md\n */\nexport default {\n\tname: 'CnChoiceMatrix',\n\n\tcomponents: { NcButton, NcSelect },\n\n\tprops: {\n\t\t/**\n\t\t * The rows: objects with an id (`rowIdKey`), a label (`rowLabelKey`) and an optional `readOnly`.\n\t\t * With `pickPerRow` also `weight` and `options`: `{ key, label, description?, points? }`.\n\t\t */\n\t\trows: { type: Array, default: () => [] },\n\t\t/** The columns: `{ key, label, description?, readOnly?, points? }`. */\n\t\tcolumns: { type: Array, default: () => [] },\n\t\t/** The closed set every cell picks from: `{ value, label, tone? }`, `tone` being `muted` or `strong`. */\n\t\tchoices: { type: Array, default: () => [] },\n\t\t/** The stored choices: `{ [rowId]: { [columnKey]: value } }`, or with `pickPerRow` `{ [rowId]: optionKey }`. */\n\t\tmodelValue: { type: Object, default: () => ({}) },\n\t\t/** The choice value a cell shows while nothing is stored for it. */\n\t\tdefaultValue: { type: String, default: '' },\n\t\t/** Key of a row's id. */\n\t\trowIdKey: { type: String, default: 'id' },\n\t\t/** Key of a row's label. */\n\t\trowLabelKey: { type: String, default: 'label' },\n\t\t/** Heading of the row column, already translated. */\n\t\trowHeader: { type: String, default: '' },\n\t\t/** Title above the grid, already translated. */\n\t\ttitle: { type: String, default: '' },\n\t\t/** A line under the title, already translated. */\n\t\tdescription: { type: String, default: '' },\n\t\t/** Text when there are no rows or columns; the library default is \"Nothing to set yet.\". */\n\t\temptyLabel: { type: String, default: '' },\n\t\t/** Draw every cell as text. */\n\t\treadOnly: { type: Boolean, default: false },\n\t\t/** A row holds one pick, drawn as radio buttons, rather than a choice per column. */\n\t\tpickPerRow: { type: Boolean, default: false },\n\t\t/** Show the score: `true` for the library's words, or a text with `{score}` and `{max}`, already translated. */\n\t\tscoreLabel: { type: [Boolean, String], default: false },\n\t\t/** The most a user can score; the sum of each row's highest points when null. */\n\t\tscoreMax: { type: Number, default: null },\n\t\t/** How picks add up: `sum` adds the points, `weighted` multiplies each by its row's `weight` first. */\n\t\tscoreMode: { type: String, default: 'sum', validator: (value) => ['sum', 'weighted'].includes(value) },\n\t\t/** A row's weight in words, already translated, with `{weight}`. */\n\t\tweightTemplate: { type: String, default: '' },\n\t\t/** Errors per row, already translated: `{ [rowId]: text }`. */\n\t\trowErrors: { type: Object, default: () => ({}) },\n\t\t/** A Remove button per row; a row with `removable: false` keeps none. Ignored when `readOnly`. */\n\t\tremovableRows: { type: Boolean, default: false },\n\t},\n\n\temits: ['update:modelValue', 'cell-change', 'score-change', 'remove-row'],\n\n\tdata() {\n\t\tlastUid += 1\n\t\treturn { uid: `cn-choice-matrix-${lastUid}`, status: '' }\n\t},\n\n\tcomputed: {\n\t\t/** @return {boolean} Whether there is nothing to draw. */\n\t\t/**\n\t\t * @return {boolean} Whether any row shows a Remove button, which adds the actions column.\n\t\t */\n\t\thasRemovable() {\n\t\t\treturn this.rows.some((row) => this.removable(row))\n\t\t},\n\n\t\tisEmpty() {\n\t\t\tif (this.rows.length === 0) {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\treturn this.pickPerRow\n\t\t\t\t? this.rows.every((row) => this.optionsOf(row).length === 0)\n\t\t\t\t: this.columns.length === 0\n\t\t},\n\n\t\t/** @return {{score: number, max: number, complete: boolean}} The running score. */\n\t\tscore() {\n\t\t\tlet score = 0\n\t\t\tlet max = 0\n\t\t\tlet complete = true\n\t\t\tfor (const row of this.rows) {\n\t\t\t\tconst factor = this.scoreMode === 'weighted' ? (Number(row.weight) || 0) : 1\n\t\t\t\tconst options = this.optionsOf(row)\n\t\t\t\tconst picked = options.find((option) => option.key === this.pickedKey(row))\n\t\t\t\tmax += Math.max(0, ...options.map((option) => Number(option.points) || 0)) * factor\n\t\t\t\tscore += (Number(picked?.points) || 0) * factor\n\t\t\t\tcomplete = complete && (Boolean(picked) || Boolean(row.readOnly))\n\t\t\t}\n\t\t\treturn { score, max: this.scoreMax ?? max, complete }\n\t\t},\n\n\t\t/** @return {string} The score in words, or ''. */\n\t\tscoreLine() {\n\t\t\tif (!this.scoreLabel) {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tconst score = this.formatNumber(this.score.score)\n\t\t\tconst max = this.formatNumber(this.score.max)\n\t\t\treturn typeof this.scoreLabel === 'string'\n\t\t\t\t? this.scoreLabel.replace('{score}', score).replace('{max}', max)\n\t\t\t\t: t('nextcloud-vue', 'Score: {score} of {max}', { score, max })\n\t\t},\n\t},\n\n\twatch: {\n\t\tscore: {\n\t\t\timmediate: true,\n\t\t\thandler(next, previous) {\n\t\t\t\tif (this.pickPerRow && JSON.stringify(next) !== JSON.stringify(previous)) {\n\t\t\t\t\tthis.$emit('score-change', next)\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t},\n\n\tmethods: {\n\t\tt,\n\n\t\t/**\n\t\t * @param {number} value A number.\n\t\t * @return {string} The number in the user's locale, with at most two decimals.\n\t\t */\n\t\tformatNumber(value) {\n\t\t\treturn value.toLocaleString(userLocale(), { maximumFractionDigits: 2 })\n\t\t},\n\n\t\t/**\n\t\t * @param {object} row A row.\n\t\t * @return {object[]} What the row picks from: its own options, else the columns.\n\t\t */\n\t\toptionsOf(row) {\n\t\t\treturn Array.isArray(row.options) ? row.options : this.columns\n\t\t},\n\n\t\t/**\n\t\t * @param {object} row A row.\n\t\t * @return {string|undefined} The key of the option the row holds.\n\t\t */\n\t\tpickedKey(row) {\n\t\t\treturn this.modelValue?.[this.rowId(row)]\n\t\t},\n\n\t\t/**\n\t\t * @param {object} row A row.\n\t\t * @return {string} The row's weight in words, or ''.\n\t\t */\n\t\tweightText(row) {\n\t\t\tif (row.weight === undefined || row.weight === null || row.weight === '') {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tconst weight = String(row.weight)\n\t\t\treturn this.weightTemplate\n\t\t\t\t? this.weightTemplate.replace('{weight}', weight)\n\t\t\t\t: t('nextcloud-vue', '(weight {weight})', { weight })\n\t\t},\n\n\t\t/**\n\t\t * @param {object} option An option.\n\t\t * @return {string} Its points in words, or ''.\n\t\t */\n\t\tpointsText(option) {\n\t\t\tif (option.points === undefined || option.points === null) {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tconst points = this.formatNumber(Number(option.points))\n\t\t\treturn Number(option.points) === 1\n\t\t\t\t? t('nextcloud-vue', '{points} point', { points })\n\t\t\t\t: t('nextcloud-vue', '{points} points', { points })\n\t\t},\n\n\t\t/**\n\t\t * @param {object} row A row.\n\t\t * @return {string} The row's error, or ''.\n\t\t */\n\t\trowError(row) {\n\t\t\treturn this.rowErrors?.[this.rowId(row)] ?? ''\n\t\t},\n\n\t\t/**\n\t\t * @param {object} row A row.\n\t\t * @return {string} The id of the row's error line.\n\t\t */\n\t\terrorId(row) {\n\t\t\treturn `${this.uid}-error-${this.rowId(row)}`\n\t\t},\n\n\t\t/**\n\t\t * Emit the new map for a picked option.\n\t\t *\n\t\t * @param {object} row A row.\n\t\t * @param {object} option The picked option.\n\t\t * @return {void}\n\t\t */\n\t\tpick(row, option) {\n\t\t\tconst rowId = this.rowId(row)\n\t\t\tconst previous = this.pickedKey(row)\n\t\t\tthis.$emit('update:modelValue', { ...this.modelValue, [rowId]: option.key })\n\t\t\tthis.$emit('cell-change', { rowId, columnKey: option.key, value: option.key, previous })\n\t\t},\n\n\t\t/**\n\t\t * @param {object} row A row.\n\t\t * @return {boolean} Whether the row shows a Remove button.\n\t\t * @spec openspec/changes/choice-matrix-removable-rows/tasks.md#task-1\n\t\t */\n\t\tremovable(row) {\n\t\t\treturn this.removableRows && !this.readOnly && row.removable !== false\n\t\t},\n\n\t\t/**\n\t\t * @param {object} row A row.\n\t\t * @return {string} The accessible name of its Remove button.\n\t\t */\n\t\tremoveLabel(row) {\n\t\t\treturn t('nextcloud-vue', 'Remove {row}', { row: String(row[this.rowLabelKey] ?? '') })\n\t\t},\n\n\t\t/**\n\t\t * Remove a row: emit the map without it and `remove-row`, so the host\n\t\t * drops it from `rows`, and say so to a screen reader.\n\t\t *\n\t\t * @param {object} row A row.\n\t\t * @return {void}\n\t\t * @spec openspec/changes/choice-matrix-removable-rows/tasks.md#task-1\n\t\t */\n\t\tremoveRow(row) {\n\t\t\tconst rowId = this.rowId(row)\n\t\t\tconst next = { ...this.modelValue }\n\t\t\tdelete next[rowId]\n\t\t\tthis.$emit('update:modelValue', next)\n\t\t\tthis.$emit('remove-row', { rowId, row })\n\t\t\tthis.status = t('nextcloud-vue', 'Removed {row}.', { row: String(row[this.rowLabelKey] ?? '') })\n\t\t\tconst index = this.rows.indexOf(row)\n\t\t\tthis.$nextTick(() => this.focusAfterRemove(index))\n\t\t},\n\n\t\t/**\n\t\t * Keep the keyboard in the grid after a row is gone: the Remove button\n\t\t * now at the removed row's place, else the last one, else the grid.\n\t\t *\n\t\t * @param {number} index Where the removed row was.\n\t\t * @return {void}\n\t\t */\n\t\tfocusAfterRemove(index) {\n\t\t\tconst buttons = this.$el.querySelectorAll('[data-testid^=\"cn-choice-matrix-remove-\"]')\n\t\t\tconst target = buttons[Math.min(index, buttons.length - 1)] || this.$el\n\t\t\ttarget.focus()\n\t\t},\n\n\t\t/**\n\t\t * @param {object} row A row.\n\t\t * @return {string} The row's id as a string.\n\t\t */\n\t\trowId(row) {\n\t\t\treturn String(row[this.rowIdKey])\n\t\t},\n\n\t\t/**\n\t\t * @param {object} row A row.\n\t\t * @param {object} column A column.\n\t\t * @return {boolean} Whether this cell offers a choice.\n\t\t */\n\t\teditable(row, column) {\n\t\t\treturn !this.readOnly && !row.readOnly && !column.readOnly\n\t\t},\n\n\t\t/**\n\t\t * @param {object} row A row.\n\t\t * @param {object} column A column.\n\t\t * @return {string} The stored value, else `defaultValue`.\n\t\t */\n\t\tvalueOf(row, column) {\n\t\t\treturn this.modelValue?.[this.rowId(row)]?.[column.key] ?? this.defaultValue\n\t\t},\n\n\t\t/**\n\t\t * @param {object} row A row.\n\t\t * @param {object} column A column.\n\t\t * @return {object|null} The choice the cell holds, null when it matches none.\n\t\t */\n\t\tchoiceOf(row, column) {\n\t\t\tconst value = this.valueOf(row, column)\n\t\t\treturn this.choices.find((choice) => choice.value === value) ?? null\n\t\t},\n\n\t\t/**\n\t\t * The cell as text. A stored value outside the set shows as it is, so\n\t\t * it is seen rather than read as empty.\n\t\t *\n\t\t * @param {object} row A row.\n\t\t * @param {object} column A column.\n\t\t * @return {string} What a read-only cell says.\n\t\t */\n\t\tvalueText(row, column) {\n\t\t\treturn this.choiceOf(row, column)?.label ?? String(this.valueOf(row, column))\n\t\t},\n\n\t\t/**\n\t\t * @param {object} row A row.\n\t\t * @param {object} column A column.\n\t\t * @return {string} The class of the cell's tone, or ''.\n\t\t */\n\t\ttoneClass(row, column) {\n\t\t\tconst tone = this.choiceOf(row, column)?.tone\n\t\t\treturn tone ? `cn-choice-matrix__value--${tone}` : ''\n\t\t},\n\n\t\t/**\n\t\t * @param {object} row A row.\n\t\t * @param {object} column A column.\n\t\t * @return {string} A name for the cell's control, naming both axes.\n\t\t */\n\t\tcellLabel(row, column) {\n\t\t\treturn `${row[this.rowLabelKey]}, ${column.label}`\n\t\t},\n\n\t\t/**\n\t\t * Emit the new map for a picked choice. Picking what the cell already\n\t\t * holds, or nothing, changes nothing.\n\t\t *\n\t\t * @param {object} row A row.\n\t\t * @param {object} column A column.\n\t\t * @param {object|null} choice The picked choice.\n\t\t * @return {void}\n\t\t */\n\t\tsetCell(row, column, choice) {\n\t\t\tconst previous = this.valueOf(row, column)\n\t\t\tif (!choice || choice.value === previous) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst rowId = this.rowId(row)\n\t\t\tthis.$emit('update:modelValue', {\n\t\t\t\t...this.modelValue,\n\t\t\t\t[rowId]: { ...(this.modelValue?.[rowId] ?? {}), [column.key]: choice.value },\n\t\t\t})\n\t\t\tthis.$emit('cell-change', { rowId, columnKey: column.key, value: choice.value, previous })\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-choice-matrix {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 8px;\n}\n\n.cn-choice-matrix__title {\n\tfont-size: 1.1em;\n\tmargin: 0;\n}\n\n.cn-choice-matrix__description,\n.cn-choice-matrix__empty,\n.cn-choice-matrix__col-description {\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-choice-matrix__description,\n.cn-choice-matrix__empty {\n\tmargin: 0;\n}\n\n.cn-choice-matrix__row {\n\tborder: 0;\n\tborder-top: 1px solid var(--color-border);\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 8px;\n\tmargin: 0;\n\tmin-width: 0;\n\tpadding: 12px 0 0;\n}\n\n.cn-choice-matrix__legend {\n\tfont-weight: 600;\n\tpadding: 0;\n}\n\n.cn-choice-matrix__weight {\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 0.9em;\n\tfont-weight: normal;\n}\n\n.cn-choice-matrix__options {\n\tdisplay: grid;\n\tgap: 8px;\n\tgrid-template-columns: repeat(auto-fit, minmax(170px, 1fr));\n}\n\n.cn-choice-matrix__option {\n\talign-items: flex-start;\n\tborder: 1px solid var(--color-border);\n\tborder-radius: var(--border-radius-large);\n\tcursor: pointer;\n\tdisplay: flex;\n\tgap: 8px;\n\tpadding: 8px 12px;\n}\n\n.cn-choice-matrix__option--picked {\n\tbackground: var(--color-primary-element-light);\n\tborder-color: var(--color-primary-element);\n\tcolor: var(--color-primary-element-light-text);\n}\n\n.cn-choice-matrix__option input {\n\taccent-color: var(--color-primary-element);\n\tflex: none;\n\tmargin: 2px 0 0;\n}\n\n.cn-choice-matrix__option-text {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 2px;\n\tmin-width: 0;\n}\n\n.cn-choice-matrix__option-detail {\n\tfont-size: 0.9em;\n}\n\n.cn-choice-matrix__actions {\n\twidth: 1%;\n\twhite-space: nowrap;\n}\n\n.cn-choice-matrix__remove {\n\tmargin-top: 4px;\n}\n\n.cn-choice-matrix__sr {\n\tposition: absolute;\n\twidth: 1px;\n\theight: 1px;\n\toverflow: hidden;\n\tclip-path: inset(50%);\n\twhite-space: nowrap;\n}\n\n.cn-choice-matrix__error {\n\tcolor: var(--color-error-text, var(--color-error));\n\tdisplay: block;\n\tfont-weight: normal;\n\tmargin: 0;\n\twhite-space: normal;\n}\n\n.cn-choice-matrix__score {\n\talign-items: center;\n\tbackground: var(--color-background-hover);\n\tborder-radius: var(--border-radius-large);\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tgap: 8px 16px;\n\tjustify-content: space-between;\n\tpadding: 12px 16px;\n}\n\n.cn-choice-matrix__scroller {\n\tborder: 1px solid var(--color-border);\n\tborder-radius: var(--border-radius-large);\n\toverflow-x: auto;\n}\n\n.cn-choice-matrix__table {\n\tborder-collapse: collapse;\n\twidth: 100%;\n}\n\n.cn-choice-matrix__caption {\n\tblock-size: 1px;\n\tclip-path: inset(50%);\n\tinline-size: 1px;\n\toverflow: hidden;\n\tposition: absolute;\n\twhite-space: nowrap;\n}\n\n.cn-choice-matrix__corner,\n.cn-choice-matrix__col-header {\n\tbackground: var(--color-background-hover);\n\tborder-bottom: 1px solid var(--color-border);\n\tfont-weight: 600;\n\tpadding: 8px 12px;\n\ttext-align: start;\n\tvertical-align: top;\n}\n\n.cn-choice-matrix__col-header > span {\n\tdisplay: block;\n}\n\n.cn-choice-matrix__col-description {\n\tfont-size: 0.9em;\n\tfont-weight: normal;\n}\n\n.cn-choice-matrix__row-header {\n\tborder-bottom: 1px solid var(--color-border);\n\tfont-weight: 500;\n\tpadding: 6px 12px;\n\ttext-align: start;\n\twhite-space: nowrap;\n}\n\n.cn-choice-matrix__cell {\n\tborder-bottom: 1px solid var(--color-border);\n\tmin-width: 160px;\n\tpadding: 6px 12px;\n}\n\ntbody tr:last-child > * {\n\tborder-bottom: 0;\n}\n\n.cn-choice-matrix__value--muted {\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-choice-matrix__value--strong {\n\tfont-weight: 600;\n}\n</style>\n"],"names":["t"],"mappings":";;;;AAgJA,IAAI,OAAM,GAAI,EAAA;;AAEd;AACC;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAE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