@conduction/nextcloud-vue 2.169.0 → 2.171.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (174) hide show
  1. package/dist/esm/components/CnCellRenderer/CnCellRenderer.vue.js +1 -1
  2. package/dist/esm/components/CnCellRenderer/CnCellRenderer.vue2.js +7 -2
  3. package/dist/esm/components/CnCellRenderer/CnCellRenderer.vue2.js.map +1 -1
  4. package/dist/esm/components/CnCellRenderer/CnCellRenderer.vue3.js.map +1 -1
  5. package/dist/esm/components/CnConditionGroupEditor/CnConditionGroup.vue.js +9 -0
  6. package/dist/esm/components/CnConditionGroupEditor/CnConditionGroup.vue.js.map +1 -0
  7. package/dist/esm/components/CnConditionGroupEditor/CnConditionGroup.vue2.js +242 -0
  8. package/dist/esm/components/CnConditionGroupEditor/CnConditionGroup.vue2.js.map +1 -0
  9. package/dist/esm/components/CnConditionGroupEditor/CnConditionGroup.vue3.js +200 -0
  10. package/dist/esm/components/CnConditionGroupEditor/CnConditionGroup.vue3.js.map +1 -0
  11. package/dist/esm/components/CnConditionGroupEditor/CnConditionGroupEditor.vue.js +9 -0
  12. package/dist/esm/components/CnConditionGroupEditor/CnConditionGroupEditor.vue.js.map +1 -0
  13. package/dist/esm/components/CnConditionGroupEditor/CnConditionGroupEditor.vue2.js +186 -0
  14. package/dist/esm/components/CnConditionGroupEditor/CnConditionGroupEditor.vue2.js.map +1 -0
  15. package/dist/esm/components/CnConditionGroupEditor/CnConditionGroupEditor.vue3.js +24 -0
  16. package/dist/esm/components/CnConditionGroupEditor/CnConditionGroupEditor.vue3.js.map +1 -0
  17. package/dist/esm/components/CnConditionListEditor/CnConditionListEditor.vue.js +1 -1
  18. package/dist/esm/components/CnConditionListEditor/CnConditionListEditor.vue2.js +3 -15
  19. package/dist/esm/components/CnConditionListEditor/CnConditionListEditor.vue2.js.map +1 -1
  20. package/dist/esm/components/CnConditionListEditor/CnConditionListEditor.vue3.js +16 -61
  21. package/dist/esm/components/CnConditionListEditor/CnConditionListEditor.vue3.js.map +1 -1
  22. package/dist/esm/components/CnConditionListEditor/CnConditionRow.vue.js +9 -0
  23. package/dist/esm/components/CnConditionListEditor/CnConditionRow.vue.js.map +1 -0
  24. package/dist/esm/components/CnConditionListEditor/CnConditionRow.vue2.js +120 -0
  25. package/dist/esm/components/CnConditionListEditor/CnConditionRow.vue2.js.map +1 -0
  26. package/dist/esm/components/CnConditionListEditor/CnConditionRow.vue3.js +86 -0
  27. package/dist/esm/components/CnConditionListEditor/CnConditionRow.vue3.js.map +1 -0
  28. package/dist/esm/components/CnDashboardGrid/CnDashboardGrid.vue.js +1 -1
  29. package/dist/esm/components/CnDashboardGrid/CnDashboardGrid.vue2.js +88 -0
  30. package/dist/esm/components/CnDashboardGrid/CnDashboardGrid.vue2.js.map +1 -1
  31. package/dist/esm/components/CnDashboardGrid/CnDashboardGrid.vue3.js +4 -3
  32. package/dist/esm/components/CnDashboardGrid/CnDashboardGrid.vue3.js.map +1 -1
  33. package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue.js +1 -1
  34. package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue2.js +46 -3
  35. package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue2.js.map +1 -1
  36. package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue3.js +2 -1
  37. package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue3.js.map +1 -1
  38. package/dist/esm/components/CnDetailPage/CnDetailPage.vue2.js +1 -1
  39. package/dist/esm/components/CnDetailPage/CnDetailPage.vue2.js.map +1 -1
  40. package/dist/esm/components/CnDetailPage/CnDetailPage.vue3.js +9 -9
  41. package/dist/esm/components/CnDetailPage/CnDetailPage.vue3.js.map +1 -1
  42. package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHeaderItems.vue.js +1 -1
  43. package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHeaderItems.vue2.js.map +1 -1
  44. package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHeaderItems.vue3.js.map +1 -1
  45. package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHost.vue.js +1 -1
  46. package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHost.vue2.js +9 -3
  47. package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHost.vue2.js.map +1 -1
  48. package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHost.vue3.js.map +1 -1
  49. package/dist/esm/components/CnDialogActions/CnDialogActions.vue.js +8 -0
  50. package/dist/esm/components/CnDialogActions/CnDialogActions.vue.js.map +1 -0
  51. package/dist/esm/components/CnDialogActions/CnDialogActions.vue2.js +101 -0
  52. package/dist/esm/components/CnDialogActions/CnDialogActions.vue2.js.map +1 -0
  53. package/dist/esm/components/CnDialogActions/CnDialogActions.vue3.js +54 -0
  54. package/dist/esm/components/CnDialogActions/CnDialogActions.vue3.js.map +1 -0
  55. package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue.js +1 -1
  56. package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue2.js +14 -2
  57. package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue2.js.map +1 -1
  58. package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue3.js +1 -1
  59. package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue3.js.map +1 -1
  60. package/dist/esm/components/CnFilesBrowser/filesBrowser.js +21 -2
  61. package/dist/esm/components/CnFilesBrowser/filesBrowser.js.map +1 -1
  62. package/dist/esm/components/CnFlowsPage/CnFlowBoard.vue.js +1 -1
  63. package/dist/esm/components/CnFlowsPage/CnFlowBoard.vue2.js +7 -0
  64. package/dist/esm/components/CnFlowsPage/CnFlowBoard.vue2.js.map +1 -1
  65. package/dist/esm/components/CnFlowsPage/CnFlowBoard.vue3.js +2 -2
  66. package/dist/esm/components/CnFlowsPage/CnFlowBoard.vue3.js.map +1 -1
  67. package/dist/esm/components/CnFlowsPage/CnFlowEditorPage.vue2.js +11 -0
  68. package/dist/esm/components/CnFlowsPage/CnFlowEditorPage.vue2.js.map +1 -1
  69. package/dist/esm/components/CnFlowsPage/CnFlowEditorPage.vue3.js +2 -1
  70. package/dist/esm/components/CnFlowsPage/CnFlowEditorPage.vue3.js.map +1 -1
  71. package/dist/esm/components/CnLinkedWidget/CnLinkedWidget.vue.js +1 -1
  72. package/dist/esm/components/CnLinkedWidget/CnLinkedWidget.vue2.js.map +1 -1
  73. package/dist/esm/components/CnLinkedWidget/CnLinkedWidget.vue3.js.map +1 -1
  74. package/dist/esm/components/CnMassActionDialog/CnMassActionDialog.vue.js +9 -0
  75. package/dist/esm/components/CnMassActionDialog/CnMassActionDialog.vue.js.map +1 -0
  76. package/dist/esm/components/CnMassActionDialog/CnMassActionDialog.vue2.js +248 -0
  77. package/dist/esm/components/CnMassActionDialog/CnMassActionDialog.vue2.js.map +1 -0
  78. package/dist/esm/components/{CnMassDeleteDialog/CnMassDeleteDialog.vue3.js → CnMassActionDialog/CnMassActionDialog.vue3.js} +66 -52
  79. package/dist/esm/components/CnMassActionDialog/CnMassActionDialog.vue3.js.map +1 -0
  80. package/dist/esm/components/CnMassDeleteDialog/CnMassDeleteDialog.vue.js +0 -3
  81. package/dist/esm/components/CnMassDeleteDialog/CnMassDeleteDialog.vue.js.map +1 -1
  82. package/dist/esm/components/CnMassDeleteDialog/CnMassDeleteDialog.vue2.js +25 -121
  83. package/dist/esm/components/CnMassDeleteDialog/CnMassDeleteDialog.vue2.js.map +1 -1
  84. package/dist/esm/components/CnNotesCard/CnNotesCard.vue.js +1 -1
  85. package/dist/esm/components/CnNotesCard/CnNotesCard.vue2.js +11 -3
  86. package/dist/esm/components/CnNotesCard/CnNotesCard.vue2.js.map +1 -1
  87. package/dist/esm/components/CnNotesCard/CnNotesCard.vue3.js +1 -1
  88. package/dist/esm/components/CnNotesCard/CnNotesCard.vue3.js.map +1 -1
  89. package/dist/esm/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue.js +1 -1
  90. package/dist/esm/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue2.js +13 -6
  91. package/dist/esm/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue2.js.map +1 -1
  92. package/dist/esm/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue3.js.map +1 -1
  93. package/dist/esm/components/CnObjectSidebar/CnNotesTab.vue.js +1 -1
  94. package/dist/esm/components/CnObjectSidebar/CnNotesTab.vue2.js +21 -1
  95. package/dist/esm/components/CnObjectSidebar/CnNotesTab.vue2.js.map +1 -1
  96. package/dist/esm/components/CnObjectSidebar/CnNotesTab.vue3.js +2 -2
  97. package/dist/esm/components/CnObjectSidebar/CnNotesTab.vue3.js.map +1 -1
  98. package/dist/esm/components/CnTreeView/CnTreeNode.vue.js +1 -1
  99. package/dist/esm/components/CnTreeView/CnTreeNode.vue2.js.map +1 -1
  100. package/dist/esm/components/CnTreeView/CnTreeNode.vue3.js +23 -5
  101. package/dist/esm/components/CnTreeView/CnTreeNode.vue3.js.map +1 -1
  102. package/dist/esm/components/CnTreeView/CnTreeView.vue.js +1 -1
  103. package/dist/esm/components/CnTreeView/CnTreeView.vue2.js +3 -0
  104. package/dist/esm/components/CnTreeView/CnTreeView.vue2.js.map +1 -1
  105. package/dist/esm/components/CnTreeView/CnTreeView.vue3.js +14 -4
  106. package/dist/esm/components/CnTreeView/CnTreeView.vue3.js.map +1 -1
  107. package/dist/esm/dialogs/CnConfirmDialog.vue.js +1 -1
  108. package/dist/esm/dialogs/CnConfirmDialog.vue2.js.map +1 -1
  109. package/dist/esm/dialogs/CnConfirmDialog.vue3.js +5 -3
  110. package/dist/esm/dialogs/CnConfirmDialog.vue3.js.map +1 -1
  111. package/dist/esm/index.js +3 -0
  112. package/dist/esm/index.js.map +1 -1
  113. package/dist/esm/integrations/builtin/contacts/CnContactsTab.vue.js +1 -1
  114. package/dist/esm/integrations/builtin/contacts/CnContactsTab.vue2.js +14 -3
  115. package/dist/esm/integrations/builtin/contacts/CnContactsTab.vue2.js.map +1 -1
  116. package/dist/esm/integrations/builtin/contacts/CnContactsTab.vue3.js.map +1 -1
  117. package/dist/esm/l10n/en.json.js +16 -1
  118. package/dist/esm/l10n/en.json.js.map +1 -1
  119. package/dist/esm/l10n/nl.json.js +16 -1
  120. package/dist/esm/l10n/nl.json.js.map +1 -1
  121. package/dist/esm/library-style.js +1 -1
  122. package/dist/esm/nextcloud-vue.css +874 -496
  123. package/dist/esm/utils/noteThreads.js +14 -2
  124. package/dist/esm/utils/noteThreads.js.map +1 -1
  125. package/dist/esm/utils/objectParties.js +50 -5
  126. package/dist/esm/utils/objectParties.js.map +1 -1
  127. package/dist/nextcloud-vue.cjs.js +11549 -10100
  128. package/dist/nextcloud-vue.cjs.js.map +2 -2
  129. package/dist/nextcloud-vue.css +874 -496
  130. package/l10n/en.json +16 -1
  131. package/l10n/nl.json +16 -1
  132. package/package.json +1 -1
  133. package/scripts/.jsdoc-baselines.json +1 -1
  134. package/src/components/CnCellRenderer/CnCellRenderer.vue +7 -2
  135. package/src/components/CnConditionGroupEditor/CnConditionGroup.vue +528 -0
  136. package/src/components/CnConditionGroupEditor/CnConditionGroupEditor.vue +211 -0
  137. package/src/components/CnConditionGroupEditor/index.js +9 -0
  138. package/src/components/CnConditionListEditor/CnConditionListEditor.vue +15 -78
  139. package/src/components/CnConditionListEditor/CnConditionRow.vue +226 -0
  140. package/src/components/CnDashboardGrid/CnDashboardGrid.md +1 -0
  141. package/src/components/CnDashboardGrid/CnDashboardGrid.vue +100 -2
  142. package/src/components/CnDashboardPage/CnDashboardPage.vue +47 -3
  143. package/src/components/CnDetailPage/CnDetailPage.vue +8 -8
  144. package/src/components/CnDetailWidgetHost/CnDetailWidgetHeaderItems.vue +6 -0
  145. package/src/components/CnDetailWidgetHost/CnDetailWidgetHost.vue +9 -9
  146. package/src/components/CnDialogActions/CnDialogActions.vue +124 -0
  147. package/src/components/CnDialogActions/index.js +7 -0
  148. package/src/components/CnFilesBrowser/CnFilesBrowser.vue +15 -3
  149. package/src/components/CnFilesBrowser/filesBrowser.js +21 -2
  150. package/src/components/CnFlowsPage/CnFlowBoard.vue +10 -3
  151. package/src/components/CnFlowsPage/CnFlowEditorPage.vue +12 -0
  152. package/src/components/CnLinkedWidget/CnLinkedWidget.vue +7 -0
  153. package/src/components/CnMassActionDialog/CnMassActionDialog.vue +382 -0
  154. package/src/components/CnMassActionDialog/index.js +7 -0
  155. package/src/components/CnMassDeleteDialog/CnMassDeleteDialog.md +4 -0
  156. package/src/components/CnMassDeleteDialog/CnMassDeleteDialog.vue +25 -254
  157. package/src/components/CnNotesCard/CnNotesCard.vue +12 -4
  158. package/src/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue +14 -5
  159. package/src/components/CnObjectSidebar/CnNotesTab.vue +23 -3
  160. package/src/components/CnTreeView/CnTreeNode.vue +10 -1
  161. package/src/components/CnTreeView/CnTreeView.vue +9 -0
  162. package/src/components/index.js +3 -0
  163. package/src/css/context-menu.css +7 -0
  164. package/src/css/dialog.css +7 -5
  165. package/src/css/look-board-detail.css +120 -1
  166. package/src/css/look-board-index.css +21 -2
  167. package/src/css/look-board.css +55 -2
  168. package/src/dialogs/CnConfirmDialog.vue +3 -1
  169. package/src/index.js +3 -0
  170. package/src/integrations/builtin/contacts/CnContactsTab.vue +14 -3
  171. package/src/integrations/builtin/contacts/__tests__/CnContactsTabBoardRows.spec.js +17 -2
  172. package/src/utils/noteThreads.js +13 -1
  173. package/src/utils/objectParties.js +49 -4
  174. package/dist/esm/components/CnMassDeleteDialog/CnMassDeleteDialog.vue3.js.map +0 -1
@@ -0,0 +1,211 @@
1
+ <!--
2
+ - SPDX-FileCopyrightText: 2026 Conduction B.V.
3
+ - SPDX-License-Identifier: EUPL-1.2
4
+ -->
5
+
6
+ <template>
7
+ <div class="cn-condition-group-editor">
8
+ <CnConditionGroup
9
+ :node="tree"
10
+ :depth="0"
11
+ path="$"
12
+ :fields="fieldList"
13
+ :operatorsFor="operatorsFor"
14
+ :maxDepth="maxDepth"
15
+ :errors="errors"
16
+ :emptyText="emptyText"
17
+ @update:node="onUpdate" />
18
+ </div>
19
+ </template>
20
+
21
+ <script>
22
+ import CnConditionGroup from './CnConditionGroup.vue'
23
+ import { operatorLabel, operatorsForType } from '../CnConditionListEditor/conditionOperators.js'
24
+
25
+ /**
26
+ * A rule value as a group: a group keeps its shape with `type` upper-cased; a
27
+ * bare condition, a list of nodes, or `children` without a `type` read as an
28
+ * AND group of them; anything else reads as an empty AND group.
29
+ *
30
+ * @param {unknown} value The bound value.
31
+ * @return {{type: string, children: Array}} A detached group.
32
+ */
33
+ function toGroup(value) {
34
+ let copy
35
+ try {
36
+ copy = JSON.parse(JSON.stringify(value ?? null))
37
+ } catch {
38
+ copy = null
39
+ }
40
+ if (Array.isArray(copy)) {
41
+ return { type: 'AND', children: copy }
42
+ }
43
+ if (!copy || typeof copy !== 'object') {
44
+ return { type: 'AND', children: [] }
45
+ }
46
+ if (Array.isArray(copy.children)) {
47
+ return { ...copy, type: copy.type ? String(copy.type).toUpperCase() : 'AND' }
48
+ }
49
+ if ('field' in copy || 'operator' in copy) {
50
+ return { type: 'AND', children: [copy] }
51
+ }
52
+ return { type: 'AND', children: [] }
53
+ }
54
+
55
+ /**
56
+ * CnConditionGroupEditor - the conditions of a rule in groups: each group
57
+ * chooses whether all or any of its conditions must hold, and the root may
58
+ * hold inner groups ("this, and one of these"). Rows are CnConditionRow, the
59
+ * same field, operator and value row as CnConditionListEditor.
60
+ *
61
+ * v-model on `{ type: 'AND' | 'OR', children }`, where a child is a
62
+ * condition `{ field, operator, value }` or another group, in both dialects
63
+ * (`value`/`input` and `modelValue`/`update:modelValue`). Add group shows
64
+ * only on groups above `maxDepth`; a deeper tree still renders every level.
65
+ * A group of another type (NOT) shows as a locked row that can only be
66
+ * removed.
67
+ */
68
+ export default {
69
+ name: 'CnConditionGroupEditor',
70
+
71
+ components: { CnConditionGroup },
72
+
73
+ props: {
74
+ /**
75
+ * The group tree.
76
+ *
77
+ * @type {{type: string, children: Array}}
78
+ */
79
+ value: { type: [Object, Array], default: () => ({ type: 'AND', children: [] }) },
80
+ /**
81
+ * The same value under Vue 3's v-model name; wins over `value` when passed.
82
+ *
83
+ * @type {object}
84
+ */
85
+ modelValue: { type: [Object, Array], default: undefined },
86
+ /**
87
+ * The fields a condition may name: `{ id | value, label, type?, format?, options? }`.
88
+ * `type` number or integer types a number, `type` or `format` date picks a
89
+ * date, `type` boolean or `options` (`[{ id, label }]`) make the value a choice.
90
+ *
91
+ * @type {Array<object>}
92
+ */
93
+ fields: { type: Array, default: () => [] },
94
+ /**
95
+ * The operators, in the host's own names: a map from field type to
96
+ * `[{ value, label }]` (`default` for any other type), or a function
97
+ * `(field) => [{ value, label }]`. Without it, the operators of
98
+ * CnConditionListEditor are offered.
99
+ *
100
+ * @type {object|function(object): Array<{value: string, label: string}>}
101
+ */
102
+ operators: { type: [Object, Function], default: null },
103
+ /**
104
+ * The deepest level Add group may build; 1 lets the root hold groups
105
+ * of conditions.
106
+ *
107
+ * @type {number}
108
+ */
109
+ maxDepth: { type: Number, default: 1 },
110
+ /**
111
+ * Messages keyed by node path (`$.children[1].children[0]`), already
112
+ * translated, shown on that row or group.
113
+ *
114
+ * @type {object}
115
+ */
116
+ errors: { type: Object, default: () => ({}) },
117
+ /**
118
+ * What an empty root says, already translated.
119
+ *
120
+ * @type {string}
121
+ */
122
+ emptyText: { type: String, default: '' },
123
+ },
124
+
125
+ emits: ['input', 'update:modelValue'],
126
+
127
+ data() {
128
+ return {
129
+ tree: toGroup(this.modelValue !== undefined ? this.modelValue : this.value),
130
+ }
131
+ },
132
+
133
+ computed: {
134
+ fieldList() {
135
+ return this.fields.map((f) => ({ ...f, id: f.id ?? f.value }))
136
+ },
137
+ },
138
+
139
+ watch: {
140
+ value(next) {
141
+ if (this.modelValue === undefined) {
142
+ this.take(next)
143
+ }
144
+ },
145
+
146
+ modelValue(next) {
147
+ if (next !== undefined) {
148
+ this.take(next)
149
+ }
150
+ },
151
+ },
152
+
153
+ methods: {
154
+ take(next) {
155
+ const group = toGroup(next)
156
+ if (JSON.stringify(group) !== JSON.stringify(this.tree)) {
157
+ this.tree = group
158
+ }
159
+ },
160
+
161
+ /**
162
+ * The operator choices of a field, as `[{ id, label }]`.
163
+ *
164
+ * @param {object|undefined} field The field.
165
+ * @return {Array<{id: string, label: string}>} The choices.
166
+ */
167
+ operatorsFor(field) {
168
+ let list
169
+ if (typeof this.operators === 'function') {
170
+ list = this.operators(field)
171
+ } else if (this.operators) {
172
+ list = this.operators[field?.type] || this.operators.default || []
173
+ } else {
174
+ return operatorsForType(field?.type).map((id) => ({ id, label: operatorLabel(id) }))
175
+ }
176
+ return (list || []).map((o) => ({ id: o.id ?? o.value, label: o.label ?? String(o.id ?? o.value) }))
177
+ },
178
+
179
+ /**
180
+ * Keep the edited tree and tell the consumer, in both v-model dialects.
181
+ *
182
+ * @param {object} next The edited tree.
183
+ * @return {void}
184
+ */
185
+ onUpdate(next) {
186
+ this.tree = next
187
+ const copy = JSON.parse(JSON.stringify(next))
188
+ /**
189
+ * The tree changed.
190
+ *
191
+ * @event input
192
+ * @type {object}
193
+ */
194
+ this.$emit('input', copy)
195
+ /**
196
+ * The tree changed (Vue 3 v-model).
197
+ *
198
+ * @event update:modelValue
199
+ * @type {object}
200
+ */
201
+ this.$emit('update:modelValue', copy)
202
+ },
203
+ },
204
+ }
205
+ </script>
206
+
207
+ <style scoped>
208
+ .cn-condition-group-editor {
209
+ min-width: 0;
210
+ }
211
+ </style>
@@ -0,0 +1,9 @@
1
+ /**
2
+ * SPDX-FileCopyrightText: 2026 Conduction B.V.
3
+ * SPDX-License-Identifier: EUPL-1.2
4
+ */
5
+
6
+ import CnConditionGroupEditor from './CnConditionGroupEditor.vue'
7
+
8
+ export { CnConditionGroupEditor }
9
+ export default CnConditionGroupEditor
@@ -11,54 +11,20 @@
11
11
  <p v-if="rows.length === 0" class="cn-condition-list__empty">
12
12
  {{ emptyText || t('nextcloud-vue', 'No conditions: the rule always applies.') }}
13
13
  </p>
14
- <div
14
+ <CnConditionRow
15
15
  v-for="(row, i) in rows"
16
16
  :key="i"
17
- class="cn-condition-list__row">
18
- <NcSelect
19
- class="cn-condition-list__field"
20
- :modelValue="fieldOption(row.field)"
21
- :options="fieldOptions"
22
- label="label"
23
- :inputLabel="t('nextcloud-vue', 'Field')"
24
- :clearable="false"
25
- @update:modelValue="setField(i, $event)" />
26
- <NcSelect
27
- class="cn-condition-list__operator"
28
- :modelValue="operatorOption(row.operator)"
29
- :options="operatorOptions(row.field)"
30
- label="label"
31
- :inputLabel="t('nextcloud-vue', 'Operator')"
32
- :clearable="false"
33
- :disabled="!row.field"
34
- @update:modelValue="setOperator(i, $event)" />
35
- <template v-if="takesValue(row.operator)">
36
- <NcSelect
37
- v-if="valueOptions(row.field)"
38
- class="cn-condition-list__value"
39
- :modelValue="valueOption(row)"
40
- :options="valueOptions(row.field)"
41
- label="label"
42
- :inputLabel="t('nextcloud-vue', 'Value')"
43
- :clearable="false"
44
- @update:modelValue="setValue(i, $event ? $event.id : '')" />
45
- <NcTextField
46
- v-else
47
- class="cn-condition-list__value"
48
- :type="inputType(row.field)"
49
- :modelValue="row.value === undefined || row.value === null ? '' : String(row.value)"
50
- :label="t('nextcloud-vue', 'Value')"
51
- @update:modelValue="setValue(i, typedValue(row.field, $event))" />
52
- </template>
53
- <NcButton
54
- variant="tertiary"
55
- :aria-label="t('nextcloud-vue', 'Remove condition')"
56
- @click="remove(i)">
57
- <template #icon>
58
- <Close :size="18" />
59
- </template>
60
- </NcButton>
61
- </div>
17
+ class="cn-condition-list__row"
18
+ :condition="row"
19
+ :fieldOptions="fieldOptions"
20
+ :operatorOptions="operatorOptions(row.field)"
21
+ :valueOptions="valueOptions(row.field)"
22
+ :inputType="inputType(row.field)"
23
+ :showValue="takesValue(row.operator)"
24
+ @field="setField(i, $event)"
25
+ @operator="setOperator(i, $event)"
26
+ @value="setValue(i, valueOptions(row.field) ? $event : typedValue(row.field, $event))"
27
+ @remove="remove(i)" />
62
28
  <NcButton variant="tertiary" :disabled="fields.length === 0" @click="add">
63
29
  <template #icon>
64
30
  <Plus :size="18" />
@@ -70,9 +36,9 @@
70
36
 
71
37
  <script>
72
38
  import { translate as t } from '@nextcloud/l10n'
73
- import { NcButton, NcSelect, NcTextField } from '@nextcloud/vue'
74
- import Close from 'vue-material-design-icons/Close.vue'
39
+ import { NcButton } from '@nextcloud/vue'
75
40
  import Plus from 'vue-material-design-icons/Plus.vue'
41
+ import CnConditionRow from './CnConditionRow.vue'
76
42
  import { operatorLabel, operatorsForType, operatorTakesValue } from './conditionOperators.js'
77
43
 
78
44
  /**
@@ -88,7 +54,7 @@ import { operatorLabel, operatorsForType, operatorTakesValue } from './condition
88
54
  export default {
89
55
  name: 'CnConditionListEditor',
90
56
 
91
- components: { NcButton, NcSelect, NcTextField, Close, Plus },
57
+ components: { CnConditionRow, NcButton, Plus },
92
58
 
93
59
  props: {
94
60
  /**
@@ -181,18 +147,10 @@ export default {
181
147
  return this.fields.find((f) => f.id === id)
182
148
  },
183
149
 
184
- fieldOption(id) {
185
- return this.fieldOptions.find((o) => o.id === id) || null
186
- },
187
-
188
150
  operatorOptions(fieldId) {
189
151
  return operatorsForType(this.fieldOf(fieldId)?.type).map((id) => ({ id, label: operatorLabel(id) }))
190
152
  },
191
153
 
192
- operatorOption(operator) {
193
- return operator ? { id: operator, label: operatorLabel(operator) } : null
194
- },
195
-
196
154
  takesValue(operator) {
197
155
  return operatorTakesValue(operator)
198
156
  },
@@ -219,10 +177,6 @@ export default {
219
177
  return null
220
178
  },
221
179
 
222
- valueOption(row) {
223
- return (this.valueOptions(row.field) || []).find((o) => String(o.id) === String(row.value)) || null
224
- },
225
-
226
180
  inputType(fieldId) {
227
181
  const type = this.fieldOf(fieldId)?.type
228
182
  if (type === 'number' || type === 'integer') {
@@ -326,21 +280,4 @@ export default {
326
280
  color: var(--color-text-maxcontrast);
327
281
  margin: 0;
328
282
  }
329
-
330
- .cn-condition-list__row {
331
- display: grid;
332
- grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr) minmax(0, 1.6fr) auto;
333
- gap: 8px;
334
- align-items: end;
335
- }
336
-
337
- .cn-condition-list__row > :nth-child(3):last-child {
338
- grid-column: 4;
339
- }
340
-
341
- @media (max-width: 640px) {
342
- .cn-condition-list__row {
343
- grid-template-columns: minmax(0, 1fr) auto;
344
- }
345
- }
346
283
  </style>
@@ -0,0 +1,226 @@
1
+ <!--
2
+ - SPDX-FileCopyrightText: 2026 Conduction B.V.
3
+ - SPDX-License-Identifier: EUPL-1.2
4
+ -->
5
+
6
+ <template>
7
+ <div class="cn-condition-row" :class="{ 'cn-condition-row--error': !!error }">
8
+ <div class="cn-condition-row__controls">
9
+ <NcSelect
10
+ class="cn-condition-row__field"
11
+ :modelValue="fieldOption"
12
+ :options="fieldOptions"
13
+ label="label"
14
+ v-bind="selectLabel(labels.field)"
15
+ :clearable="false"
16
+ @update:modelValue="$emit('field', $event)" />
17
+ <NcSelect
18
+ class="cn-condition-row__operator"
19
+ :modelValue="operatorOption"
20
+ :options="operatorOptions"
21
+ label="label"
22
+ v-bind="selectLabel(labels.operator)"
23
+ :clearable="false"
24
+ :disabled="!condition.field"
25
+ @update:modelValue="$emit('operator', $event)" />
26
+ <template v-if="showValue">
27
+ <NcSelect
28
+ v-if="valueOptions"
29
+ class="cn-condition-row__value"
30
+ :modelValue="valueOption"
31
+ :options="valueOptions"
32
+ label="label"
33
+ v-bind="selectLabel(labels.value)"
34
+ :clearable="false"
35
+ :disabled="!condition.field"
36
+ @update:modelValue="$emit('value', $event ? $event.id : '')" />
37
+ <NcTextField
38
+ v-else
39
+ class="cn-condition-row__value"
40
+ :type="inputType"
41
+ :modelValue="textValue"
42
+ :label="labels.value"
43
+ :disabled="!condition.field"
44
+ @update:modelValue="$emit('value', $event)" />
45
+ </template>
46
+ <NcButton
47
+ class="cn-condition-row__remove"
48
+ variant="tertiary"
49
+ :aria-label="t('nextcloud-vue', 'Remove condition')"
50
+ :title="t('nextcloud-vue', 'Remove condition')"
51
+ @click="$emit('remove')">
52
+ <template #icon>
53
+ <!-- @slot The remove button's icon; a close cross by default. -->
54
+ <slot name="remove-icon">
55
+ <Close :size="18" />
56
+ </slot>
57
+ </template>
58
+ </NcButton>
59
+ </div>
60
+ <p v-if="error" class="cn-condition-row__error" role="alert">
61
+ {{ error }}
62
+ </p>
63
+ </div>
64
+ </template>
65
+
66
+ <script>
67
+ import { translate as t } from '@nextcloud/l10n'
68
+ import { NcButton, NcSelect, NcTextField } from '@nextcloud/vue'
69
+ import Close from 'vue-material-design-icons/Close.vue'
70
+
71
+ /**
72
+ * CnConditionRow - one condition as a row of field, operator and value, with
73
+ * a remove button. Shared by CnConditionListEditor and CnConditionGroupEditor;
74
+ * the editor owns the condition and decides the options, the row only draws
75
+ * them and reports what the user picked.
76
+ */
77
+ export default {
78
+ name: 'CnConditionRow',
79
+
80
+ components: { NcButton, NcSelect, NcTextField, Close },
81
+
82
+ props: {
83
+ /**
84
+ * The condition drawn.
85
+ *
86
+ * @type {{field: string, operator: string, value?: unknown}}
87
+ */
88
+ condition: { type: Object, required: true },
89
+ /**
90
+ * The field choices, `[{ id, label }]`.
91
+ *
92
+ * @type {Array<{id: string, label: string}>}
93
+ */
94
+ fieldOptions: { type: Array, default: () => [] },
95
+ /**
96
+ * The operator choices for the condition's field, `[{ id, label }]`.
97
+ *
98
+ * @type {Array<{id: string, label: string}>}
99
+ */
100
+ operatorOptions: { type: Array, default: () => [] },
101
+ /**
102
+ * The value choices, or null when the value is typed.
103
+ *
104
+ * @type {Array<{id: unknown, label: string}>|null}
105
+ */
106
+ valueOptions: { type: Array, default: null },
107
+ /**
108
+ * The input type of a typed value: text, number or date.
109
+ *
110
+ * @type {string}
111
+ */
112
+ inputType: { type: String, default: 'text' },
113
+ /**
114
+ * Whether the operator takes a value.
115
+ *
116
+ * @type {boolean}
117
+ */
118
+ showValue: { type: Boolean, default: true },
119
+ /**
120
+ * Keep the field, operator and value labels for screen readers only.
121
+ *
122
+ * @type {boolean}
123
+ */
124
+ hideLabels: { type: Boolean, default: false },
125
+ /**
126
+ * The labels of the three controls, already translated. Missing keys
127
+ * read Field, Operator and Value.
128
+ *
129
+ * @type {{field?: string, operator?: string, value?: string}}
130
+ */
131
+ controlLabels: { type: Object, default: () => ({}) },
132
+ /**
133
+ * A message shown under the row, already translated.
134
+ *
135
+ * @type {string}
136
+ */
137
+ error: { type: String, default: '' },
138
+ },
139
+
140
+ emits: ['field', 'operator', 'value', 'remove'],
141
+
142
+ computed: {
143
+ labels() {
144
+ return {
145
+ field: this.controlLabels.field || t('nextcloud-vue', 'Field'),
146
+ operator: this.controlLabels.operator || t('nextcloud-vue', 'Operator'),
147
+ value: this.controlLabels.value || t('nextcloud-vue', 'Value'),
148
+ }
149
+ },
150
+
151
+ fieldOption() {
152
+ return this.fieldOptions.find((o) => o.id === this.condition.field) || null
153
+ },
154
+
155
+ operatorOption() {
156
+ return this.operatorOptions.find((o) => o.id === this.condition.operator) || null
157
+ },
158
+
159
+ valueOption() {
160
+ return (this.valueOptions || []).find((o) => String(o.id) === String(this.condition.value)) || null
161
+ },
162
+
163
+ textValue() {
164
+ const value = this.condition.value
165
+ return value === undefined || value === null ? '' : String(value)
166
+ },
167
+ },
168
+
169
+ methods: {
170
+ t,
171
+
172
+ /**
173
+ * The label binding of a select: shown above it, or for screen
174
+ * readers only.
175
+ *
176
+ * @param {string} text The label.
177
+ * @return {object} The props.
178
+ */
179
+ selectLabel(text) {
180
+ return this.hideLabels ? { ariaLabelCombobox: text } : { inputLabel: text }
181
+ },
182
+ },
183
+ }
184
+ </script>
185
+
186
+ <style scoped>
187
+ .cn-condition-row {
188
+ min-width: 0;
189
+ }
190
+
191
+ .cn-condition-row__controls {
192
+ display: grid;
193
+ grid-template-columns: var(--cn-condition-row-columns, minmax(0, 2fr) minmax(0, 1.4fr) minmax(0, 1.6fr) auto);
194
+ gap: 8px;
195
+ align-items: var(--cn-condition-row-align, end);
196
+ }
197
+
198
+ .cn-condition-row__controls > :nth-child(3):last-child {
199
+ grid-column: 4;
200
+ }
201
+
202
+ .cn-condition-row__field,
203
+ .cn-condition-row__operator,
204
+ .cn-condition-row__value {
205
+ width: 100%;
206
+ min-width: 0;
207
+ margin: 0;
208
+ }
209
+
210
+ .cn-condition-row--error .cn-condition-row__controls :deep(input),
211
+ .cn-condition-row--error .cn-condition-row__controls :deep(.vs__dropdown-toggle) {
212
+ border-color: var(--color-border-error, var(--color-error));
213
+ }
214
+
215
+ .cn-condition-row__error {
216
+ margin: 4px 0 0;
217
+ color: var(--color-text-error, var(--color-error));
218
+ font-size: 0.9em;
219
+ }
220
+
221
+ @media (max-width: 640px) {
222
+ .cn-condition-row__controls {
223
+ grid-template-columns: minmax(0, 1fr) auto;
224
+ }
225
+ }
226
+ </style>
@@ -99,6 +99,7 @@ export default {
99
99
  | `editable` | Boolean | `false` | Enable drag and resize interactions |
100
100
  | `columns` | Number | `12` | Number of grid columns |
101
101
  | `cellHeight` | Number | `80` | Cell height in pixels |
102
+ | `columnWeights` | Array | `null` | Optional weights for the twelve-column grid's column groups, as `[{ span, weight }]` (e.g. three groups of 4 weighted 352/435/352). Applies only on the full twelve-column grid and not while editing; items on a side-column track are left alone. `null` keeps twelve equal shares. |
102
103
  | `margin` | Number | `12` | Gutter between grid items in pixels |
103
104
  | `minWidth` | Number | `2` | Minimum widget width in grid units |
104
105
  | `minHeight` | Number | `2` | Minimum widget height in grid units |