@conduction/nextcloud-vue 2.170.0 → 2.172.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 (163) hide show
  1. package/dist/esm/components/CnActionDialog/CnActionDialog.vue.js +1 -1
  2. package/dist/esm/components/CnActionDialog/CnActionDialog.vue2.js.map +1 -1
  3. package/dist/esm/components/CnActionDialog/CnActionDialog.vue3.js.map +1 -1
  4. package/dist/esm/components/CnChecklistRunWidget/CnChecklistRunWidget.vue.js +1 -1
  5. package/dist/esm/components/CnChecklistRunWidget/CnChecklistRunWidget.vue2.js +22 -3
  6. package/dist/esm/components/CnChecklistRunWidget/CnChecklistRunWidget.vue2.js.map +1 -1
  7. package/dist/esm/components/CnChecklistRunWidget/CnChecklistRunWidget.vue3.js.map +1 -1
  8. package/dist/esm/components/CnConditionGroupEditor/CnConditionGroup.vue.js +9 -0
  9. package/dist/esm/components/CnConditionGroupEditor/CnConditionGroup.vue.js.map +1 -0
  10. package/dist/esm/components/CnConditionGroupEditor/CnConditionGroup.vue2.js +242 -0
  11. package/dist/esm/components/CnConditionGroupEditor/CnConditionGroup.vue2.js.map +1 -0
  12. package/dist/esm/components/CnConditionGroupEditor/CnConditionGroup.vue3.js +200 -0
  13. package/dist/esm/components/CnConditionGroupEditor/CnConditionGroup.vue3.js.map +1 -0
  14. package/dist/esm/components/CnConditionGroupEditor/CnConditionGroupEditor.vue.js +9 -0
  15. package/dist/esm/components/CnConditionGroupEditor/CnConditionGroupEditor.vue.js.map +1 -0
  16. package/dist/esm/components/CnConditionGroupEditor/CnConditionGroupEditor.vue2.js +186 -0
  17. package/dist/esm/components/CnConditionGroupEditor/CnConditionGroupEditor.vue2.js.map +1 -0
  18. package/dist/esm/components/CnConditionGroupEditor/CnConditionGroupEditor.vue3.js +24 -0
  19. package/dist/esm/components/CnConditionGroupEditor/CnConditionGroupEditor.vue3.js.map +1 -0
  20. package/dist/esm/components/CnConditionListEditor/CnConditionListEditor.vue.js +1 -1
  21. package/dist/esm/components/CnConditionListEditor/CnConditionListEditor.vue2.js +3 -15
  22. package/dist/esm/components/CnConditionListEditor/CnConditionListEditor.vue2.js.map +1 -1
  23. package/dist/esm/components/CnConditionListEditor/CnConditionListEditor.vue3.js +16 -61
  24. package/dist/esm/components/CnConditionListEditor/CnConditionListEditor.vue3.js.map +1 -1
  25. package/dist/esm/components/CnConditionListEditor/CnConditionRow.vue.js +9 -0
  26. package/dist/esm/components/CnConditionListEditor/CnConditionRow.vue.js.map +1 -0
  27. package/dist/esm/components/CnConditionListEditor/CnConditionRow.vue2.js +120 -0
  28. package/dist/esm/components/CnConditionListEditor/CnConditionRow.vue2.js.map +1 -0
  29. package/dist/esm/components/CnConditionListEditor/CnConditionRow.vue3.js +86 -0
  30. package/dist/esm/components/CnConditionListEditor/CnConditionRow.vue3.js.map +1 -0
  31. package/dist/esm/components/CnDetailPage/CnDetailPage.vue2.js +1 -1
  32. package/dist/esm/components/CnDetailPage/CnDetailPage.vue2.js.map +1 -1
  33. package/dist/esm/components/CnDetailPage/CnDetailPage.vue3.js +9 -9
  34. package/dist/esm/components/CnDetailPage/CnDetailPage.vue3.js.map +1 -1
  35. package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHeaderItems.vue.js +1 -1
  36. package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHeaderItems.vue2.js.map +1 -1
  37. package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHeaderItems.vue3.js.map +1 -1
  38. package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHost.vue.js +1 -1
  39. package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHost.vue2.js.map +1 -1
  40. package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHost.vue3.js.map +1 -1
  41. package/dist/esm/components/CnDeviceFramesWidget/CnDeviceFramesWidget.vue.js +1 -1
  42. package/dist/esm/components/CnDeviceFramesWidget/CnDeviceFramesWidget.vue2.js +75 -4
  43. package/dist/esm/components/CnDeviceFramesWidget/CnDeviceFramesWidget.vue2.js.map +1 -1
  44. package/dist/esm/components/CnDeviceFramesWidget/CnDeviceFramesWidget.vue3.js.map +1 -1
  45. package/dist/esm/components/CnDialogActions/CnDialogActions.vue.js +8 -0
  46. package/dist/esm/components/CnDialogActions/CnDialogActions.vue.js.map +1 -0
  47. package/dist/esm/components/CnDialogActions/CnDialogActions.vue2.js +101 -0
  48. package/dist/esm/components/CnDialogActions/CnDialogActions.vue2.js.map +1 -0
  49. package/dist/esm/components/CnDialogActions/CnDialogActions.vue3.js +54 -0
  50. package/dist/esm/components/CnDialogActions/CnDialogActions.vue3.js.map +1 -0
  51. package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue.js +1 -1
  52. package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue2.js +7 -3
  53. package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue2.js.map +1 -1
  54. package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue3.js.map +1 -1
  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/CnObjectSidebar/CnNotesTab.vue.js +1 -1
  90. package/dist/esm/components/CnObjectSidebar/CnNotesTab.vue2.js +21 -1
  91. package/dist/esm/components/CnObjectSidebar/CnNotesTab.vue2.js.map +1 -1
  92. package/dist/esm/components/CnObjectSidebar/CnNotesTab.vue3.js +2 -2
  93. package/dist/esm/components/CnObjectSidebar/CnNotesTab.vue3.js.map +1 -1
  94. package/dist/esm/components/CnTreeView/CnTreeNode.vue.js +1 -1
  95. package/dist/esm/components/CnTreeView/CnTreeNode.vue2.js.map +1 -1
  96. package/dist/esm/components/CnTreeView/CnTreeNode.vue3.js +23 -5
  97. package/dist/esm/components/CnTreeView/CnTreeNode.vue3.js.map +1 -1
  98. package/dist/esm/components/CnTreeView/CnTreeView.vue.js +1 -1
  99. package/dist/esm/components/CnTreeView/CnTreeView.vue2.js +3 -0
  100. package/dist/esm/components/CnTreeView/CnTreeView.vue2.js.map +1 -1
  101. package/dist/esm/components/CnTreeView/CnTreeView.vue3.js +14 -4
  102. package/dist/esm/components/CnTreeView/CnTreeView.vue3.js.map +1 -1
  103. package/dist/esm/dialogs/CnConfirmDialog.vue.js +1 -1
  104. package/dist/esm/dialogs/CnConfirmDialog.vue2.js.map +1 -1
  105. package/dist/esm/dialogs/CnConfirmDialog.vue3.js +5 -3
  106. package/dist/esm/dialogs/CnConfirmDialog.vue3.js.map +1 -1
  107. package/dist/esm/index.js +3 -0
  108. package/dist/esm/index.js.map +1 -1
  109. package/dist/esm/l10n/en.json.js +16 -1
  110. package/dist/esm/l10n/en.json.js.map +1 -1
  111. package/dist/esm/l10n/nl.json.js +16 -1
  112. package/dist/esm/l10n/nl.json.js.map +1 -1
  113. package/dist/esm/library-style.js +1 -1
  114. package/dist/esm/nextcloud-vue.css +908 -464
  115. package/dist/esm/utils/builtInFormatters.js +19 -1
  116. package/dist/esm/utils/builtInFormatters.js.map +1 -1
  117. package/dist/esm/utils/noteThreads.js +14 -2
  118. package/dist/esm/utils/noteThreads.js.map +1 -1
  119. package/dist/nextcloud-vue.cjs.js +11435 -10084
  120. package/dist/nextcloud-vue.cjs.js.map +2 -2
  121. package/dist/nextcloud-vue.css +908 -464
  122. package/l10n/en.json +16 -1
  123. package/l10n/nl.json +16 -1
  124. package/package.json +1 -1
  125. package/scripts/.jsdoc-baselines.json +1 -1
  126. package/src/components/CnActionDialog/CnActionDialog.vue +4 -1
  127. package/src/components/CnChecklistRunWidget/CnChecklistRunWidget.vue +24 -3
  128. package/src/components/CnConditionGroupEditor/CnConditionGroup.vue +528 -0
  129. package/src/components/CnConditionGroupEditor/CnConditionGroupEditor.vue +211 -0
  130. package/src/components/CnConditionGroupEditor/index.js +9 -0
  131. package/src/components/CnConditionListEditor/CnConditionListEditor.vue +15 -78
  132. package/src/components/CnConditionListEditor/CnConditionRow.vue +226 -0
  133. package/src/components/CnDetailPage/CnDetailPage.vue +8 -8
  134. package/src/components/CnDetailWidgetHost/CnDetailWidgetHeaderItems.vue +6 -0
  135. package/src/components/CnDetailWidgetHost/CnDetailWidgetHost.vue +0 -6
  136. package/src/components/CnDeviceFramesWidget/CnDeviceFramesWidget.vue +75 -4
  137. package/src/components/CnDialogActions/CnDialogActions.vue +124 -0
  138. package/src/components/CnDialogActions/index.js +7 -0
  139. package/src/components/CnFactsWidget/CnFactsWidget.vue +7 -3
  140. package/src/components/CnFilesBrowser/CnFilesBrowser.vue +15 -3
  141. package/src/components/CnFilesBrowser/filesBrowser.js +21 -2
  142. package/src/components/CnFlowsPage/CnFlowBoard.vue +10 -3
  143. package/src/components/CnFlowsPage/CnFlowEditorPage.vue +12 -0
  144. package/src/components/CnLinkedWidget/CnLinkedWidget.vue +7 -0
  145. package/src/components/CnMassActionDialog/CnMassActionDialog.vue +382 -0
  146. package/src/components/CnMassActionDialog/index.js +7 -0
  147. package/src/components/CnMassDeleteDialog/CnMassDeleteDialog.md +4 -0
  148. package/src/components/CnMassDeleteDialog/CnMassDeleteDialog.vue +25 -254
  149. package/src/components/CnNotesCard/CnNotesCard.vue +12 -4
  150. package/src/components/CnObjectSidebar/CnNotesTab.vue +23 -3
  151. package/src/components/CnTreeView/CnTreeNode.vue +10 -1
  152. package/src/components/CnTreeView/CnTreeView.vue +9 -0
  153. package/src/components/index.js +3 -0
  154. package/src/css/context-menu.css +7 -0
  155. package/src/css/look-board-detail.css +220 -2
  156. package/src/css/look-board-index.css +7 -6
  157. package/src/css/look-board.css +43 -2
  158. package/src/css/patches.css +4 -1
  159. package/src/dialogs/CnConfirmDialog.vue +3 -1
  160. package/src/index.js +3 -0
  161. package/src/utils/builtInFormatters.js +18 -0
  162. package/src/utils/noteThreads.js +13 -1
  163. package/dist/esm/components/CnMassDeleteDialog/CnMassDeleteDialog.vue3.js.map +0 -1
@@ -50,6 +50,9 @@ import CloudCheckOutline from 'vue-material-design-icons/CloudCheckOutline.vue'
50
50
  import CloudOffOutline from 'vue-material-design-icons/CloudOffOutline.vue'
51
51
  import InformationOutline from 'vue-material-design-icons/InformationOutline.vue'
52
52
  import CnSectionsWidget from '../CnSectionsWidget/CnSectionsWidget.vue'
53
+ import { fetchReferenceObjects } from '../../utils/boardReferenceColumns.js'
54
+ import { readPath } from '../../utils/readPath.js'
55
+ import { hasUnresolvedTokens, resolveFilterTokens } from '../../utils/resolveFilterTokens.js'
53
56
 
54
57
  /** Counter for unique heading ids across instances. */
55
58
  let instanceCounter = 0
@@ -96,12 +99,16 @@ export default {
96
99
  /**
97
100
  * The widget configuration.
98
101
  *
99
- * - `frames` — `[{ key?, title, widgetIds? | sections?, status? }]`, in order. `widgetIds` names
102
+ * - `frames` — `[{ key?, title, titleFrom?, widgetIds? | sections?, status? }]`, in order. `widgetIds` names
100
103
  * widgets of the surface, stacked; `sections` takes the `sections` widget's entries instead.
104
+ * `titleFrom: { source: { register, schema, filter, sort? }, field }` titles the frame by that field of the
105
+ * first matching record, read under the reader's rights; `title` stays while none matches.
101
106
  * - `status` — the status line of every frame (a frame's own `status` wins): `{ text?, tone?,
102
107
  * followConnection?, onlineText?, offlineText? }`. With `followConnection` the line reads
103
108
  * `offlineText` while the device is offline and `onlineText` otherwise. `tone` is `warning`
104
- * (default while offline), `success` or `info`.
109
+ * (default while offline), `success` or `info`. With `syncedFrom: { source: { register, schema,
110
+ * filter }, field }` the newest value of that date field is the last synchronisation, and while
111
+ * offline the line reads `offlineSyncedText` with `{time}` as its time (`offlineText` without one).
105
112
  * - `width` — the frame width in pixels (default 350).
106
113
  * - `height` — the frame height in pixels (at least 400); what does not fit scrolls inside it. Without it the frame grows with its content.
107
114
  *
@@ -184,6 +191,8 @@ export default {
184
191
  return {
185
192
  uid: instanceCounter,
186
193
  online: typeof navigator === 'undefined' || navigator.onLine !== false,
194
+ readTitles: {},
195
+ syncedTime: '',
187
196
  }
188
197
  },
189
198
 
@@ -215,7 +224,7 @@ export default {
215
224
  : (Array.isArray(frame.widgetIds) ? frame.widgetIds : []).filter((id) => typeof id === 'string' && id !== '').map((widgetId) => ({ widgetId }))
216
225
  return {
217
226
  key: String(frame.key || `frame-${index}`).replace(/[^\w-]/g, '-'),
218
- title: this.tr(frame.title || ''),
227
+ title: this.readTitles[index] || this.tr(frame.title || ''),
219
228
  sections,
220
229
  status: this.statusOf(frame.status || this.content?.status || null),
221
230
  }
@@ -224,6 +233,7 @@ export default {
224
233
  },
225
234
 
226
235
  mounted() {
236
+ this.readSources()
227
237
  if (typeof window !== 'undefined') {
228
238
  window.addEventListener('online', this.onConnection)
229
239
  window.addEventListener('offline', this.onConnection)
@@ -263,13 +273,74 @@ export default {
263
273
  if (status.followConnection === true) {
264
274
  text = this.online ? status.onlineText : status.offlineText
265
275
  tone = tone || (this.online ? 'success' : 'warning')
276
+ if (!this.online && this.syncedTime && typeof status.offlineSyncedText === 'string' && status.offlineSyncedText !== '') {
277
+ return this.statusLine(this.tr(status.offlineSyncedText).replace('{time}', this.syncedTime), tone)
278
+ }
266
279
  }
267
280
  if (typeof text !== 'string' || text === '') {
268
281
  return null
269
282
  }
283
+ return this.statusLine(this.tr(text), tone)
284
+ },
285
+
286
+ /**
287
+ * A status line of a text and a tone.
288
+ *
289
+ * @param {string} text The translated text.
290
+ * @param {string} tone The tone.
291
+ * @return {{text: string, tone: string, icon: object}}
292
+ */
293
+ statusLine(text, tone) {
270
294
  const known = ['warning', 'success', 'info'].includes(tone) ? tone : 'info'
271
295
  const icon = known === 'warning' ? CloudOffOutline : (known === 'success' ? CloudCheckOutline : InformationOutline)
272
- return { text: this.tr(text), tone: known, icon: markRaw(icon) }
296
+ return { text, tone: known, icon: markRaw(icon) }
297
+ },
298
+
299
+ /**
300
+ * The first record of a `{ source: { register, schema, filter, sort? } }`, sorted by `sort` (or
301
+ * newest first by `orderBy`), under the reader's rights; null without one or while a token is unresolved.
302
+ *
303
+ * @param {object} spec The source spec.
304
+ * @param {string} [orderBy] A field to sort on, newest first, when the source names no sort.
305
+ * @return {Promise<object|null>}
306
+ */
307
+ async firstOf(spec, orderBy = '') {
308
+ const source = spec?.source
309
+ if (!source || typeof source !== 'object' || !source.register || !source.schema) {
310
+ return null
311
+ }
312
+ const filter = resolveFilterTokens(source.filter || {}, { objectId: this.objectId || null, object: this.objectData })
313
+ if (hasUnresolvedTokens(filter)) {
314
+ return null
315
+ }
316
+ const sort = source.sort?.field ? { [`_order[${source.sort.field}]`]: source.sort.dir === 'asc' ? 'asc' : 'desc' } : (orderBy ? { [`_order[${orderBy}]`]: 'desc' } : {})
317
+ try {
318
+ const rows = await fetchReferenceObjects({ register: source.register, schema: source.schema, filter: { ...filter, ...sort }, limit: 1 })
319
+ return Array.isArray(rows) && rows.length > 0 ? rows[0] : null
320
+ } catch {
321
+ return null
322
+ }
323
+ },
324
+
325
+ /** Read the frame titles (`titleFrom`) and the last synchronisation (`status.syncedFrom`). */
326
+ async readSources() {
327
+ const list = Array.isArray(this.content?.frames) ? this.content.frames.filter((frame) => frame && typeof frame === 'object') : []
328
+ const titles = {}
329
+ await Promise.all(list.map(async (frame, index) => {
330
+ if (!frame.titleFrom?.field) {
331
+ return
332
+ }
333
+ const value = readPath(await this.firstOf(frame.titleFrom), frame.titleFrom.field)
334
+ if (typeof value === 'string' && value !== '') {
335
+ titles[index] = value
336
+ }
337
+ }))
338
+ this.readTitles = titles
339
+ const synced = this.content?.status?.syncedFrom
340
+ if (synced?.field) {
341
+ const at = new Date(readPath(await this.firstOf(synced, synced.field), synced.field) ?? '')
342
+ this.syncedTime = Number.isNaN(at.getTime()) ? '' : `${String(at.getHours()).padStart(2, '0')}:${String(at.getMinutes()).padStart(2, '0')}`
343
+ }
273
344
  },
274
345
 
275
346
  /** Follow the browser's connection state. */
@@ -0,0 +1,124 @@
1
+ <!--
2
+ - SPDX-FileCopyrightText: 2026 Conduction B.V.
3
+ - SPDX-License-Identifier: EUPL-1.2
4
+ -->
5
+ <template>
6
+ <NcButton :disabled="saving" data-testid="cn-dialog-actions-cancel" @click="onCancel">
7
+ {{ cancelLabel }}
8
+ </NcButton>
9
+ <NcButton
10
+ :variant="variant"
11
+ :disabled="saving || !canSubmit"
12
+ data-testid="cn-dialog-actions-submit"
13
+ @click="onSubmit">
14
+ <template v-if="saving || confirmIcon" #icon>
15
+ <NcLoadingIcon
16
+ v-if="saving"
17
+ :size="20"
18
+ :name="t('nextcloud-vue', 'Loading …')" />
19
+ <CnIcon v-else :name="confirmIcon" :size="20" />
20
+ </template>
21
+ {{ confirmLabel }}
22
+ </NcButton>
23
+ </template>
24
+
25
+ <script>
26
+ import { translate as t } from '@nextcloud/l10n'
27
+ import { NcButton, NcLoadingIcon } from '@nextcloud/vue'
28
+ import { CnIcon } from '../CnIcon/index.js'
29
+
30
+ /**
31
+ * CnDialogActions — the footer of a hand-built dialog: a cancel button and a
32
+ * primary button that shows a loading icon while the dialog saves.
33
+ *
34
+ * Put it in the `#actions` slot of `CnDialog` (or `NcDialog`) when the dialog
35
+ * body is too custom for `CnFormDialog`. The component holds no state: the
36
+ * parent owns `saving` and `canSubmit` and does the work on `submit`.
37
+ *
38
+ * ```vue
39
+ * <CnDialog :name="t('myapp', 'Edit source')" default-width="form" @closing="close">
40
+ * <MySourceForm v-model="source" />
41
+ * <template #actions>
42
+ * <CnDialogActions
43
+ * :saving="saving"
44
+ * :can-submit="source.title !== ''"
45
+ * :confirm-label="editing ? t('myapp', 'Save') : t('myapp', 'Create')"
46
+ * @cancel="close"
47
+ * @submit="save" />
48
+ * </template>
49
+ * </CnDialog>
50
+ * ```
51
+ *
52
+ * The primary button is disabled while `saving` is true or `canSubmit` is
53
+ * false. While saving it draws a loading icon with an accessible name, so a
54
+ * screen-reader user hears that the save is running.
55
+ */
56
+ export default {
57
+ name: 'CnDialogActions',
58
+
59
+ components: {
60
+ CnIcon,
61
+ NcButton,
62
+ NcLoadingIcon,
63
+ },
64
+
65
+ props: {
66
+ /** Whether a save is in flight. Disables both buttons and draws a loading icon on the primary one. */
67
+ saving: {
68
+ type: Boolean,
69
+ default: false,
70
+ },
71
+
72
+ /** Whether the dialog holds enough to submit. False disables the primary button. */
73
+ canSubmit: {
74
+ type: Boolean,
75
+ default: true,
76
+ },
77
+
78
+ /** Label of the primary button. */
79
+ confirmLabel: {
80
+ type: String,
81
+ default: () => t('nextcloud-vue', 'Save'),
82
+ },
83
+
84
+ /** Label of the cancel button. */
85
+ cancelLabel: {
86
+ type: String,
87
+ default: () => t('nextcloud-vue', 'Cancel'),
88
+ },
89
+
90
+ /** Variant of the primary button. Use `error` for a destructive submit. */
91
+ variant: {
92
+ type: String,
93
+ default: 'primary',
94
+ validator: (v) => ['primary', 'secondary', 'error', 'warning', 'success'].includes(v),
95
+ },
96
+
97
+ /** A CnIcon name drawn on the primary button when it is not saving. Empty draws none. */
98
+ confirmIcon: {
99
+ type: String,
100
+ default: '',
101
+ },
102
+ },
103
+
104
+ emits: ['cancel', 'submit'],
105
+
106
+ methods: {
107
+ t,
108
+
109
+ onCancel() {
110
+ /**
111
+ * @event cancel Emitted when the cancel button is clicked.
112
+ */
113
+ this.$emit('cancel')
114
+ },
115
+
116
+ onSubmit() {
117
+ /**
118
+ * @event submit Emitted when the primary button is clicked while it is enabled.
119
+ */
120
+ this.$emit('submit')
121
+ },
122
+ },
123
+ }
124
+ </script>
@@ -0,0 +1,7 @@
1
+ // SPDX-FileCopyrightText: 2026 Conduction B.V.
2
+ // SPDX-License-Identifier: EUPL-1.2
3
+
4
+ import CnDialogActions from './CnDialogActions.vue'
5
+
6
+ export default CnDialogActions
7
+ export { CnDialogActions }
@@ -295,7 +295,7 @@ import { useRefLabels } from '../../composables/useRefLabels.js'
295
295
  import { dispatchAction } from '../../utils/actionsDispatcher.js'
296
296
  import { isBadgeVariant } from '../../utils/badgeVariants.js'
297
297
  import { formatBoardDate, formatTimeOfDay } from '../../utils/boardDate.js'
298
- import { formatTermDuration } from '../../utils/builtInFormatters.js'
298
+ import { formatPostcode, formatTermDuration } from '../../utils/builtInFormatters.js'
299
299
  import { conditionalLine } from '../../utils/conditionalLine.js'
300
300
  import { parseDateValue } from '../../utils/dateVariant.js'
301
301
  import { fetchListTotal } from '../../utils/fetchFilterCounts.js'
@@ -525,8 +525,8 @@ export default {
525
525
  * - `headerPill` — a status pill in the card header (reported through the `header` event): `{ path?, text?, map?, variant?, variantMap?, colorMap? }`, read from the record like a `pill` entry (DqBezwaar "Advies ontvangen"); nothing shows while the value is empty.
526
526
  * - `notice` — `{ text, variant? }`, a note band inside the card under the facts (`info` by default; `success`, `warning` or `error`); the text is translated.
527
527
  * - `footnote` — a plain muted line under the facts, without a band (DqZaakBesluiten "Na het ondertekenen ..."); the text is translated.
528
- * `format` is `text` (default), `date` (board short date), `date-long` (always with the year), `longdate` (the month written out, the year only outside this year: "3 oktober"), `longdatetime` (the month written out, the year and the time: "7 oktober 2026, 09:12"), `duration` (an ISO period in words, "4 weken"; `extendBy` names the extension period on the record: "4 weken, te verdagen met 2"), `year` ("2026"), `list` (an array joined by ", ", each item read at `itemPath` and written in `itemFormat`), `group` (a Nextcloud group by its display name), `bytes` (a size, "1.5 MB"), `number` (in the reader's language, `decimals` fraction digits when set), `months` (a number of months in words, whole years as years: 240 is "20 jaar") or `currency` (a money amount in the reader's language, "€ 1.234,50": the code in `currency`, else the record's `currencyField`, else the app's reporting currency, else EUR; `decimals` defaults to 2).
529
- * `format` is `text` (default), `today-time` (a moment today as "10:24", another day as its board date), `date` (board short date), `date-long` (always with the year), `longdate` (the month written out, the year only outside this year: "3 oktober"), `duration` (an ISO period in words, "4 weken"; `extendBy` names the extension period on the record: "4 weken, te verdagen met 2"), `year` ("2026"), `list` (an array joined by ", ", each item read at `itemPath` and written in `itemFormat`), `group` (a Nextcloud group by its display name), `bytes` (a size, "1.5 MB"), `number` (in the reader's language, `decimals` fraction digits when set), `months` (a number of months in words, whole years as years: 240 is "20 jaar") or `currency` (a money amount in the reader's language, "€ 1.234,50": the code in `currency`, else the record's `currencyField`, else the app's reporting currency, else EUR; `decimals` defaults to 2).
528
+ * `format` is `text` (default), `date` (board short date), `date-long` (always with the year), `longdate` (the month written out, the year only outside this year: "3 oktober"), `longdatetime` (the month written out, the year and the time: "7 oktober 2026, 09:12"), `duration` (an ISO period in words, "4 weken"; `extendBy` names the extension period on the record: "4 weken, te verdagen met 2"), `year` ("2026"), `postcode` (a Dutch postcode with its space, "2999 AA"), `list` (an array joined by ", ", each item read at `itemPath` and written in `itemFormat`), `group` (a Nextcloud group by its display name), `bytes` (a size, "1.5 MB"), `number` (in the reader's language, `decimals` fraction digits when set), `months` (a number of months in words, whole years as years: 240 is "20 jaar") or `currency` (a money amount in the reader's language, "€ 1.234,50": the code in `currency`, else the record's `currencyField`, else the app's reporting currency, else EUR; `decimals` defaults to 2).
529
+ * `format` is `text` (default), `today-time` (a moment today as "10:24", another day as its board date), `date` (board short date), `date-long` (always with the year), `longdate` (the month written out, the year only outside this year: "3 oktober"), `duration` (an ISO period in words, "4 weken"; `extendBy` names the extension period on the record: "4 weken, te verdagen met 2"), `year` ("2026"), `postcode` (a Dutch postcode with its space, "2999 AA"), `list` (an array joined by ", ", each item read at `itemPath` and written in `itemFormat`), `group` (a Nextcloud group by its display name), `bytes` (a size, "1.5 MB"), `number` (in the reader's language, `decimals` fraction digits when set), `months` (a number of months in words, whole years as years: 240 is "20 jaar") or `currency` (a money amount in the reader's language, "€ 1.234,50": the code in `currency`, else the record's `currencyField`, else the app's reporting currency, else EUR; `decimals` defaults to 2).
530
530
  * `map` turns a raw value into a label (translated). `parts` (on a `line`) lists paths, or `{ path, label?, format? }`, joined by `separator` (default " · "); empty parts are dropped.
531
531
  * - `source` — `{ register, schema, id }` or `{ url }`; omitted = the current object. `{ register, schema, filter, sort? }` without `id` reads the first object that matches `filter` in `sort` order (`{ field, dir }`): the latest count of a shift. An entry with `from: "object"` reads the current object even then (a client card that also shows the ticket's channel).
532
532
  * - `endpointSource` — `{ url, method?, params?, responsePath? }`, the block a stat or chart takes: the facts read an app endpoint, shared and cached like those.
@@ -2242,6 +2242,10 @@ export default {
2242
2242
  const end = Date.UTC(today.getFullYear(), today.getMonth(), today.getDate())
2243
2243
  return String(Math.max(0, Math.round((end - start) / 86400000)))
2244
2244
  }
2245
+ // A Dutch postcode with its space: "2999AA" as "2999 AA".
2246
+ if (format === 'postcode') {
2247
+ return formatPostcode(raw)
2248
+ }
2245
2249
  if (format === 'year') {
2246
2250
  const date = parseDateValue(raw)
2247
2251
  return date === null ? '' : String(date.getFullYear())
@@ -409,7 +409,7 @@
409
409
  <td class="cn-files-browser__col-actions" @click.stop @auxclick.stop>
410
410
  <!-- The host's one visible button on a file ("Beoordelen"),
411
411
  primary while the row still asks for it. -->
412
- <NcButton v-if="rowButton && !isFolder(node) && hostActionApplies(rowButton, node)"
412
+ <NcButton v-if="rowButtonApplies(node)"
413
413
  :variant="rowButtonPrimary(node) ? 'primary' : 'secondary'"
414
414
  class="cn-files-browser__row-button"
415
415
  :aria-label="t('nextcloud-vue', '{action}: {name}', { action: hostLabel(rowButton), name: node.basename })"
@@ -2301,6 +2301,20 @@ export default {
2301
2301
  return list.some((v) => String(v).toLowerCase() === String(value).toLowerCase())
2302
2302
  },
2303
2303
 
2304
+ /**
2305
+ * Whether the row button is drawn on a file: never on a folder, and
2306
+ * only where its `when` and `visibleIf` (row included) hold.
2307
+ *
2308
+ * @param {object} node The file.
2309
+ * @return {boolean}
2310
+ */
2311
+ rowButtonApplies(node) {
2312
+ if (!this.rowButton || this.isFolder(node)) {
2313
+ return false
2314
+ }
2315
+ return hostActionApplies(this.rowButton, node, this.rowValueOf(node))
2316
+ },
2317
+
2304
2318
  /**
2305
2319
  * Whether a file's row button is the primary one: the row-data field
2306
2320
  * `primaryWhen.key` holds one of `primaryWhen.values`.
@@ -2320,8 +2334,6 @@ export default {
2320
2334
  return when.values.some((v) => String(v).toLowerCase() === String(raw).toLowerCase())
2321
2335
  },
2322
2336
 
2323
- hostActionApplies,
2324
-
2325
2337
  /**
2326
2338
  * Re-read the folder once after a burst of change signals. One upload
2327
2339
  * of ten files answers ten `files:node:created`, and one PROPFIND
@@ -9,6 +9,7 @@
9
9
  */
10
10
  import axios from '@nextcloud/axios'
11
11
  import { generateUrl } from '@nextcloud/router'
12
+ import { conditionHolds } from '../../utils/fieldCondition.js'
12
13
  import { stripTrailingSlashes } from '../../utils/trailingSlashes.js'
13
14
 
14
15
  /**
@@ -280,6 +281,23 @@ export function indexRowData(data, { path = '', key = 'fileId' } = {}) {
280
281
  return byId
281
282
  }
282
283
 
284
+ /**
285
+ * Whether one field of a file's row meets its `visibleIf.row` entry: a plain
286
+ * value is compared strictly, an object is a predicate of a form field
287
+ * condition (`equals`, `in`, `notEmpty` and the rest).
288
+ *
289
+ * @param {string} key The row field.
290
+ * @param {unknown} wanted The value, or the predicate.
291
+ * @param {unknown} value What the row holds.
292
+ * @return {boolean} True when the field meets it.
293
+ */
294
+ function rowFieldMatches(key, wanted, value) {
295
+ if (wanted !== null && typeof wanted === 'object' && !Array.isArray(wanted)) {
296
+ return conditionHolds({ ...wanted, field: key }, { [key]: value }, key)
297
+ }
298
+ return value === wanted
299
+ }
300
+
283
301
  /**
284
302
  * Whether a host row action is offered on a file, by its `visibleIf`.
285
303
  *
@@ -287,7 +305,8 @@ export function indexRowData(data, { path = '', key = 'fileId' } = {}) {
287
305
  * allowed); `visibleIf.mime` lists mime types, where one ending in `/` or
288
306
  * `/*` names the whole family; `visibleIf.row` maps fields of the host's row
289
307
  * for the file to the value each must have (compared strictly, so `true` is
290
- * not `"true"`). Every condition named must hold. An action without
308
+ * not `"true"`), or to a predicate of a form field condition such as
309
+ * `{ notEmpty: true }` or `{ in: [...] }`. Every condition named must hold. An action without
291
310
  * `visibleIf` is offered on every file, as before. An action with `when` is
292
311
  * offered only while `when` is `true`.
293
312
  *
@@ -333,7 +352,7 @@ export function hostActionApplies(action, node, rowValue = null) {
333
352
  if (typeof rowValue !== 'function') {
334
353
  return false
335
354
  }
336
- const holds = Object.entries(condition.row).every(([key, wanted]) => rowValue(key) === wanted)
355
+ const holds = Object.entries(condition.row).every(([key, wanted]) => rowFieldMatches(key, wanted, rowValue(key)))
337
356
  if (!holds) {
338
357
  return false
339
358
  }
@@ -15,9 +15,9 @@
15
15
  <div class="cn-flow-board" :class="{ 'cn-flow-board--with-palette': showPalette, 'cn-flow-board--canvas': canvasLayout, 'cn-flow-board--run': store.inRunView }" data-testid="flow-board">
16
16
  <header class="cn-flow-board__header">
17
17
  <div class="cn-flow-board__heading">
18
- <h2 class="cn-flow-board__title" data-testid="flow-board-title">
18
+ <h1 class="cn-flow-board__title" data-testid="flow-board-title">
19
19
  {{ titleText }}
20
- </h2>
20
+ </h1>
21
21
  </div>
22
22
  <div v-if="!store.inRunView || canvasLayout" class="cn-flow-board__actions">
23
23
  <template v-if="!store.inRunView">
@@ -39,7 +39,7 @@
39
39
  data-testid="flow-board-enabled-switch"
40
40
  @click="onEnabledChange(store.flow.enabled === false)" />
41
41
  <span :id="toggleLabelId" class="cn-flow-board__toggle-label">
42
- {{ store.flow.enabled !== false ? t('nextcloud-vue', 'Active') : t('nextcloud-vue', 'Paused') }}
42
+ {{ toggleLabel === 'fixed' || store.flow.enabled !== false ? t('nextcloud-vue', 'Active') : t('nextcloud-vue', 'Paused') }}
43
43
  </span>
44
44
  </span>
45
45
  <NcButton :disabled="store.checking || !store.nodes.length"
@@ -639,6 +639,13 @@ export default {
639
639
  * over the canvas. `cards` (default) keeps the DqFlow grid.
640
640
  */
641
641
  layout: { type: String, default: 'cards' },
642
+
643
+ /**
644
+ * How the Active switch is named. `state` (default) names it after
645
+ * the flow's state, Active or Paused (PqFlow). `fixed` always names
646
+ * it Active and lets the switch show whether the flow runs (DqFlow).
647
+ */
648
+ toggleLabel: { type: String, default: 'state' },
642
649
  },
643
650
 
644
651
  emits: ['save', 'run', 'retried'],
@@ -13,6 +13,7 @@
13
13
  :paletteGroups="translatedPaletteGroups"
14
14
  :flowDirection="flowDirection"
15
15
  :layout="layout"
16
+ :toggleLabel="toggleLabel"
16
17
  :nodeLook="nodeLook"
17
18
  :notice="notice ? cnTranslate(notice) : ''"
18
19
  :saveAsVersion="saveAsVersion"
@@ -261,6 +262,17 @@ export default {
261
262
  type: String,
262
263
  default: 'cards',
263
264
  },
265
+
266
+ /**
267
+ * Board look: how the Active switch is named. `state` names it
268
+ * Active or Paused after the flow; `fixed` always names it Active
269
+ * and the switch shows the state (DqFlow). Manifest key
270
+ * `config.toggleLabel`.
271
+ */
272
+ toggleLabel: {
273
+ type: String,
274
+ default: 'state',
275
+ },
264
276
  },
265
277
 
266
278
  /**
@@ -400,6 +400,13 @@ button.cn-linked-widget__link {
400
400
  text-decoration: underline;
401
401
  }
402
402
 
403
+ /* The class twice: Nextcloud's `button:not(.button-vue, ...)` rule (0,2,1)
404
+ gives every button a 3px margin that a single scoped class cannot take back. */
405
+ button.cn-linked-widget__link.cn-linked-widget__link,
406
+ .cn-linked-widget__action.cn-linked-widget__action {
407
+ margin: 0;
408
+ }
409
+
403
410
  .cn-linked-widget__empty {
404
411
  color: var(--color-text-maxcontrast);
405
412
  font-size: 13px;