@conduction/nextcloud-vue 2.56.0-beta.73 → 2.56.0-beta.74

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 (120) hide show
  1. package/dist/esm/components/CnActionDialog/CnActionDialog.vue.js +1 -1
  2. package/dist/esm/components/CnActionDialog/CnActionDialog.vue2.js +90 -7
  3. package/dist/esm/components/CnActionDialog/CnActionDialog.vue2.js.map +1 -1
  4. package/dist/esm/components/CnActionDialog/CnActionDialog.vue3.js +82 -79
  5. package/dist/esm/components/CnActionDialog/CnActionDialog.vue3.js.map +1 -1
  6. package/dist/esm/components/CnCardNotices/CnCardNotices.vue.js +1 -1
  7. package/dist/esm/components/CnCardNotices/CnCardNotices.vue2.js +45 -7
  8. package/dist/esm/components/CnCardNotices/CnCardNotices.vue2.js.map +1 -1
  9. package/dist/esm/components/CnCardNotices/CnCardNotices.vue3.js +1 -1
  10. package/dist/esm/components/CnCardNotices/CnCardNotices.vue3.js.map +1 -1
  11. package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue.js +1 -1
  12. package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue2.js +40 -1
  13. package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue2.js.map +1 -1
  14. package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue3.js +149 -109
  15. package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue3.js.map +1 -1
  16. package/dist/esm/components/CnFilesBrowser/filesBrowserColumns.js +10 -4
  17. package/dist/esm/components/CnFilesBrowser/filesBrowserColumns.js.map +1 -1
  18. package/dist/esm/components/CnGroupedCardsWidget/CnGroupedCardsWidget.vue.js +1 -1
  19. package/dist/esm/components/CnGroupedCardsWidget/CnGroupedCardsWidget.vue2.js +112 -1
  20. package/dist/esm/components/CnGroupedCardsWidget/CnGroupedCardsWidget.vue2.js.map +1 -1
  21. package/dist/esm/components/CnGroupedCardsWidget/CnGroupedCardsWidget.vue3.js +53 -18
  22. package/dist/esm/components/CnGroupedCardsWidget/CnGroupedCardsWidget.vue3.js.map +1 -1
  23. package/dist/esm/components/CnIndexPage/CnIndexHeaderMenu.vue2.js +3 -3
  24. package/dist/esm/components/CnIndexPage/CnIndexHeaderMenu.vue2.js.map +1 -1
  25. package/dist/esm/components/CnIndexPage/CnIndexHeaderMenu.vue3.js +108 -74
  26. package/dist/esm/components/CnIndexPage/CnIndexHeaderMenu.vue3.js.map +1 -1
  27. package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js +129 -8
  28. package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js.map +1 -1
  29. package/dist/esm/components/CnIndexPage/CnIndexPage.vue3.js +46 -36
  30. package/dist/esm/components/CnIndexPage/CnIndexPage.vue3.js.map +1 -1
  31. package/dist/esm/components/CnObjectDataWidget/CnObjectDataWidget.vue.js +1 -1
  32. package/dist/esm/components/CnObjectDataWidget/CnObjectDataWidget.vue2.js +56 -0
  33. package/dist/esm/components/CnObjectDataWidget/CnObjectDataWidget.vue2.js.map +1 -1
  34. package/dist/esm/components/CnObjectDataWidget/CnObjectDataWidget.vue3.js +185 -123
  35. package/dist/esm/components/CnObjectDataWidget/CnObjectDataWidget.vue3.js.map +1 -1
  36. package/dist/esm/components/CnObjectSidebar/CnFilesTab.vue.js +1 -1
  37. package/dist/esm/components/CnObjectSidebar/CnFilesTab.vue2.js +2 -0
  38. package/dist/esm/components/CnObjectSidebar/CnFilesTab.vue2.js.map +1 -1
  39. package/dist/esm/components/CnObjectSidebar/CnFilesTab.vue3.js +2 -1
  40. package/dist/esm/components/CnObjectSidebar/CnFilesTab.vue3.js.map +1 -1
  41. package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue.js +1 -1
  42. package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue2.js +197 -63
  43. package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue2.js.map +1 -1
  44. package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue3.js +244 -161
  45. package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue3.js.map +1 -1
  46. package/dist/esm/components/CnSearchPage/CnSearchPage.vue.js +1 -1
  47. package/dist/esm/components/CnSearchPage/CnSearchPage.vue2.js +39 -1
  48. package/dist/esm/components/CnSearchPage/CnSearchPage.vue2.js.map +1 -1
  49. package/dist/esm/components/CnSearchPage/CnSearchPage.vue3.js +12 -2
  50. package/dist/esm/components/CnSearchPage/CnSearchPage.vue3.js.map +1 -1
  51. package/dist/esm/components/CnStepper/CnStepper.vue.js +1 -1
  52. package/dist/esm/components/CnStepper/CnStepper.vue2.js.map +1 -1
  53. package/dist/esm/components/CnStepper/CnStepper.vue3.js.map +1 -1
  54. package/dist/esm/components/CnTaskFormFields/CnTaskFormFields.vue.js +1 -1
  55. package/dist/esm/components/CnTaskFormFields/CnTaskFormFields.vue2.js +51 -2
  56. package/dist/esm/components/CnTaskFormFields/CnTaskFormFields.vue2.js.map +1 -1
  57. package/dist/esm/components/CnTaskFormFields/CnTaskFormFields.vue3.js +49 -11
  58. package/dist/esm/components/CnTaskFormFields/CnTaskFormFields.vue3.js.map +1 -1
  59. package/dist/esm/components/CnTaskFormWidget/CnTaskFormWidget.vue.js +9 -0
  60. package/dist/esm/components/CnTaskFormWidget/CnTaskFormWidget.vue.js.map +1 -0
  61. package/dist/esm/components/CnTaskFormWidget/CnTaskFormWidget.vue2.js +328 -0
  62. package/dist/esm/components/CnTaskFormWidget/CnTaskFormWidget.vue2.js.map +1 -0
  63. package/dist/esm/components/CnTaskFormWidget/CnTaskFormWidget.vue3.js +85 -0
  64. package/dist/esm/components/CnTaskFormWidget/CnTaskFormWidget.vue3.js.map +1 -0
  65. package/dist/esm/components/CnTaskFormWidget/index.js +24 -0
  66. package/dist/esm/components/CnTaskFormWidget/index.js.map +1 -0
  67. package/dist/esm/components/CnTasksWidget/CnTasksWidget.vue.js +1 -1
  68. package/dist/esm/components/CnTasksWidget/CnTasksWidget.vue2.js +8 -2
  69. package/dist/esm/components/CnTasksWidget/CnTasksWidget.vue2.js.map +1 -1
  70. package/dist/esm/components/CnTasksWidget/CnTasksWidget.vue3.js +16 -3
  71. package/dist/esm/components/CnTasksWidget/CnTasksWidget.vue3.js.map +1 -1
  72. package/dist/esm/components/CnWidgetGrid/registerDashboardWidgets.js +1 -0
  73. package/dist/esm/components/CnWidgetGrid/registerDashboardWidgets.js.map +1 -1
  74. package/dist/esm/index.js +1 -0
  75. package/dist/esm/index.js.map +1 -1
  76. package/dist/esm/l10n/en.json.js +12 -0
  77. package/dist/esm/l10n/en.json.js.map +1 -1
  78. package/dist/esm/l10n/nl.json.js +12 -0
  79. package/dist/esm/l10n/nl.json.js.map +1 -1
  80. package/dist/esm/library-style.js +1 -1
  81. package/dist/esm/nextcloud-vue.css +637 -475
  82. package/dist/esm/utils/fieldPill.js +77 -0
  83. package/dist/esm/utils/fieldPill.js.map +1 -0
  84. package/dist/esm/utils/libraryWidgetKeys.js +1 -0
  85. package/dist/esm/utils/libraryWidgetKeys.js.map +1 -1
  86. package/dist/esm/utils/searchRefusal.js +35 -1
  87. package/dist/esm/utils/searchRefusal.js.map +1 -1
  88. package/dist/esm/utils/widgetDispatch.js +1 -1
  89. package/dist/esm/utils/widgetDispatch.js.map +1 -1
  90. package/dist/nextcloud-vue.cjs.js +7416 -5865
  91. package/dist/nextcloud-vue.cjs.js.map +2 -2
  92. package/dist/nextcloud-vue.css +637 -475
  93. package/l10n/en.json +12 -0
  94. package/l10n/nl.json +12 -0
  95. package/package.json +1 -1
  96. package/src/components/CnActionDialog/CnActionDialog.vue +116 -9
  97. package/src/components/CnCardNotices/CnCardNotices.vue +46 -8
  98. package/src/components/CnFilesBrowser/CnFilesBrowser.vue +61 -2
  99. package/src/components/CnFilesBrowser/filesBrowserColumns.js +10 -4
  100. package/src/components/CnGroupedCardsWidget/CnGroupedCardsWidget.vue +141 -1
  101. package/src/components/CnIndexPage/CnIndexHeaderMenu.vue +22 -4
  102. package/src/components/CnIndexPage/CnIndexPage.vue +143 -13
  103. package/src/components/CnObjectDataWidget/CnObjectDataWidget.vue +148 -4
  104. package/src/components/CnObjectSidebar/CnFilesTab.vue +3 -0
  105. package/src/components/CnRecordListWidget/CnRecordListWidget.vue +310 -66
  106. package/src/components/CnSearchPage/CnSearchPage.vue +50 -1
  107. package/src/components/CnStepper/CnStepper.vue +14 -5
  108. package/src/components/CnTaskFormFields/CnTaskFormFields.md +1 -0
  109. package/src/components/CnTaskFormFields/CnTaskFormFields.vue +89 -3
  110. package/src/components/CnTaskFormWidget/CnTaskFormWidget.vue +400 -0
  111. package/src/components/CnTaskFormWidget/index.js +23 -0
  112. package/src/components/CnTasksWidget/CnTasksWidget.vue +17 -3
  113. package/src/components/CnWidgetGrid/registerDashboardWidgets.js +1 -0
  114. package/src/components/index.js +1 -0
  115. package/src/css/index-page.css +6 -0
  116. package/src/index.js +1 -0
  117. package/src/utils/fieldPill.js +73 -0
  118. package/src/utils/libraryWidgetKeys.js +1 -0
  119. package/src/utils/searchRefusal.js +33 -0
  120. package/src/utils/widgetDispatch.js +1 -1
@@ -45,6 +45,12 @@
45
45
  {{ group.title }}
46
46
  </component>
47
47
  <span v-if="group.count" class="cn-grouped-cards__count" data-testid="cn-grouped-cards-count">{{ group.count }}</span>
48
+ <CnStatusBadge
49
+ v-if="group.pill"
50
+ :label="group.pill.label"
51
+ :variant="group.pill.variant"
52
+ size="small"
53
+ data-testid="cn-grouped-cards-group-pill" />
48
54
  </header>
49
55
  <p
50
56
  v-for="(line, lineIndex) in group.lines"
@@ -66,6 +72,15 @@
66
72
  <span class="cn-grouped-cards__item-title">{{ item.title }}</span>
67
73
  <span v-if="item.meta" class="cn-grouped-cards__item-meta">{{ item.meta }}</span>
68
74
  <span v-if="item.flag" class="cn-grouped-cards__item-flag" data-testid="cn-grouped-cards-flag">{{ item.flag }}</span>
75
+ <span v-if="item.date || item.pill" class="cn-grouped-cards__item-end">
76
+ <span v-if="item.date" class="cn-grouped-cards__item-date" data-testid="cn-grouped-cards-item-date">{{ item.date }}</span>
77
+ <CnStatusBadge
78
+ v-if="item.pill"
79
+ :label="item.pill.label"
80
+ :variant="item.pill.variant"
81
+ size="small"
82
+ data-testid="cn-grouped-cards-item-pill" />
83
+ </span>
69
84
  <CnActionButtons
70
85
  v-if="item.actions.length > 0"
71
86
  class="cn-grouped-cards__item-actions"
@@ -132,8 +147,10 @@
132
147
  import { translate as t } from '@nextcloud/l10n'
133
148
  import { NcButton, NcLoadingIcon, NcProgressBar } from '@nextcloud/vue'
134
149
  import { inject, ref } from 'vue'
150
+ import CnStatusBadge from '../CnStatusBadge/CnStatusBadge.vue'
135
151
  import { useEndpointSource } from '../../composables/useEndpointSource.js'
136
152
  import innerHeading from '../../mixins/innerHeading.js'
153
+ import { fieldPill } from '../../utils/fieldPill.js'
137
154
  import { fillTemplate, firstFilled } from '../../utils/fillTemplate.js'
138
155
  import { unwrapAppConfig } from '../../utils/formatMetric.js'
139
156
  import { languageMapText } from '../../utils/languageMapText.js'
@@ -206,7 +223,7 @@ function readable(row) {
206
223
  export default {
207
224
  name: 'CnGroupedCardsWidget',
208
225
 
209
- components: { CnActionButtons, NcButton, NcLoadingIcon, NcProgressBar },
226
+ components: { CnActionButtons, CnStatusBadge, NcButton, NcLoadingIcon, NcProgressBar },
210
227
 
211
228
  mixins: [innerHeading],
212
229
 
@@ -263,6 +280,17 @@ export default {
263
280
  * - `itemsPath` with `itemGroupField` reads the cards from one flat list of the payload instead of
264
281
  * from each group: a card belongs to the group whose `id` its `itemGroupField` names. Cards
265
282
  * naming no group gather under `ungroupedTitle`; without that title they are left out.
283
+ * - `groupPill` (a pill config as record-list's `pill`: `{ field, labels?, colorMap?, ... }`)
284
+ * draws a status pill beside the group's title, read from the group.
285
+ * - `itemPill` (the same shape, plus `overdueWhen` and `overdueLabel`) draws a pill at the
286
+ * card's end; while the local condition `overdueWhen` holds on the card, the pill reads
287
+ * `overdueLabel` in the error tone. `itemDate` is a template drawn before that pill
288
+ * (`"{targetDate|date}"`).
289
+ * - `headerSubtitle` is the line under the card title, reported to the host as `header`
290
+ * `{ subtitle }`: a template with `{groups}` and `{items}` (the numbers drawn), or
291
+ * `{ parts, separator?, suffix? }` where a part is such a template or `{ count: "groups" |
292
+ * "items", one, other }`; the parts join with `separator` (default ", "), and `suffix`
293
+ * follows after " · ".
266
294
  *
267
295
  * A language map (`{ nl, en }`) reads in the user's language, and a list
268
296
  * of plain values reads joined with ", ". Texts go through the app's
@@ -288,6 +316,8 @@ export default {
288
316
  },
289
317
  },
290
318
 
319
+ emits: ['header'],
320
+
291
321
  setup(props) {
292
322
  const objectCtxRaw = inject('cnObjectContext', null)
293
323
  const workspaceRaw = inject('cnWorkspaceContext', null)
@@ -366,6 +396,7 @@ export default {
366
396
  lines: this.linesOf(group, raw),
367
397
  count: this.countOf(items.length),
368
398
  items,
399
+ pill: this.groupPillOf(raw),
369
400
  action: this.groupActionFor(raw, index),
370
401
  progress: this.progressOf(raw, group),
371
402
  ...this.extraOf(raw),
@@ -416,6 +447,47 @@ export default {
416
447
  }
417
448
  },
418
449
 
450
+ /**
451
+ * The line under the card title (`content.headerSubtitle`), once the
452
+ * payload is read.
453
+ *
454
+ * @return {string} The line, '' without a declaration or a payload.
455
+ * @spec openspec/changes/grouped-cards-pills-and-counts/specs/grouped-cards-widget/spec.md#requirement-a-grouped-cards-card-can-say-its-counts-under-its-title
456
+ */
457
+ headerSubtitleText() {
458
+ const spec = this.content?.headerSubtitle
459
+ if (!spec || this.payload === null || this.payload === undefined || this.error) {
460
+ return ''
461
+ }
462
+ const counts = {
463
+ groups: this.groups.length,
464
+ items: this.groups.reduce((sum, group) => sum + group.items.length, 0),
465
+ }
466
+ const fillCounts = (text) => this.translate(text).replace(/\{groups\}/g, String(counts.groups)).replace(/\{items\}/g, String(counts.items))
467
+ if (typeof spec === 'string') {
468
+ return fillCounts(spec)
469
+ }
470
+ if (typeof spec !== 'object' || !Array.isArray(spec.parts)) {
471
+ return ''
472
+ }
473
+ const line = spec.parts
474
+ .map((part) => {
475
+ if (typeof part === 'string') {
476
+ return fillCounts(part)
477
+ }
478
+ if (part && typeof part === 'object' && (part.count === 'groups' || part.count === 'items')) {
479
+ const count = counts[part.count]
480
+ const template = count === 1 ? part.one : part.other
481
+ return typeof template === 'string' && template !== '' ? this.translate(template).replace(/\{count\}/g, String(count)) : ''
482
+ }
483
+ return ''
484
+ })
485
+ .filter((text) => text !== '')
486
+ .join(typeof spec.separator === 'string' ? spec.separator : ', ')
487
+ const suffix = typeof spec.suffix === 'string' && spec.suffix !== '' ? this.translate(spec.suffix) : ''
488
+ return [line, suffix].filter((text) => text !== '').join(' · ')
489
+ },
490
+
419
491
  /** @return {string} The heading above the groups, filled from the payload. */
420
492
  heading() {
421
493
  const template = this.content?.heading
@@ -449,7 +521,59 @@ export default {
449
521
  },
450
522
  },
451
523
 
524
+ watch: {
525
+ /**
526
+ * Report the counts line to the card around the widget.
527
+ *
528
+ * @param {string} subtitle The line, or ''.
529
+ */
530
+ headerSubtitleText: {
531
+ immediate: true,
532
+ /** @spec openspec/changes/grouped-cards-pills-and-counts/specs/grouped-cards-widget/spec.md#requirement-a-grouped-cards-card-can-say-its-counts-under-its-title */
533
+ handler(subtitle) {
534
+ if (this.content?.headerSubtitle) {
535
+ /**
536
+ * @event header The card header's line under the title.
537
+ * @type {{subtitle: string}}
538
+ */
539
+ this.$emit('header', { subtitle })
540
+ }
541
+ },
542
+ },
543
+ },
544
+
452
545
  methods: {
546
+ /**
547
+ * The status pill of a group (`content.groupPill`).
548
+ *
549
+ * @param {object} raw The group as read.
550
+ * @return {{label: string, variant: string}|null} The pill, or null.
551
+ * @spec openspec/changes/grouped-cards-pills-and-counts/specs/grouped-cards-widget/spec.md#requirement-groups-and-cards-can-carry-a-status-pill
552
+ */
553
+ groupPillOf(raw) {
554
+ const spec = this.content?.groupPill
555
+ return spec ? fieldPill(raw, spec, { translate: (text) => this.translate(text), fill: (template, row) => this.fill(template, readable(row)) }) : null
556
+ },
557
+
558
+ /**
559
+ * The status pill at a card's end (`content.itemPill`): `overdueLabel`
560
+ * in the error tone while `overdueWhen` holds on the card.
561
+ *
562
+ * @param {object} rawItem The card as read.
563
+ * @return {{label: string, variant: string}|null} The pill, or null.
564
+ * @spec openspec/changes/grouped-cards-pills-and-counts/specs/grouped-cards-widget/spec.md#requirement-groups-and-cards-can-carry-a-status-pill
565
+ */
566
+ itemPillOf(rawItem) {
567
+ const spec = this.content?.itemPill
568
+ if (!spec || typeof spec !== 'object') {
569
+ return null
570
+ }
571
+ if (spec.overdueWhen && typeof spec.overdueLabel === 'string' && spec.overdueLabel !== '' && evaluateVisibleWhenLocal(spec.overdueWhen, rawItem)) {
572
+ return { label: this.translate(spec.overdueLabel), variant: 'error' }
573
+ }
574
+ return fieldPill(rawItem, spec, { translate: (text) => this.translate(text), fill: (template, row) => this.fill(template, readable(row)) })
575
+ },
576
+
453
577
  /**
454
578
  * The `groupAction` for one group, with every `@group.<path>` token in
455
579
  * its strings read from that group, and its id made unique per group.
@@ -546,6 +670,8 @@ export default {
546
670
  title: this.fill(titleTemplate, item),
547
671
  meta: this.metaOf(item, rawItem, metaSpec),
548
672
  flag,
673
+ pill: spec.title ? null : this.itemPillOf(rawItem),
674
+ date: spec.title || !c.itemDate ? '' : this.fill(c.itemDate, item),
549
675
  actions: this.itemActionsFor(actions, rawItem, rawGroup, key),
550
676
  }
551
677
  })
@@ -852,6 +978,20 @@ export default {
852
978
  color: var(--color-main-text);
853
979
  }
854
980
 
981
+ .cn-grouped-cards__item-end {
982
+ display: flex;
983
+ align-items: center;
984
+ justify-content: flex-end;
985
+ gap: 8px;
986
+ align-self: flex-end;
987
+ }
988
+
989
+ .cn-grouped-cards__item-date {
990
+ color: var(--color-text-maxcontrast);
991
+ font-size: 13px;
992
+ white-space: nowrap;
993
+ }
994
+
855
995
  .cn-grouped-cards__item-flag {
856
996
  color: var(--color-text-error, var(--color-error-text, var(--color-error)));
857
997
  font-size: 13px;
@@ -16,7 +16,8 @@
16
16
  variant="secondary"
17
17
  :data-testid="`cn-index-header-button-${button.key}`">
18
18
  <template #icon>
19
- <DotsHorizontal :size="20" />
19
+ <CnIcon v-if="button.action === 'export' && button.icon" :name="button.icon" :size="20" />
20
+ <DotsHorizontal v-else :size="20" />
20
21
  </template>
21
22
  <!-- The menu's entries (`items` on the button; the page's header
22
23
  actions when it names none): a header action, a built-in by
@@ -33,6 +34,23 @@
33
34
  <NcActionSeparator
34
35
  v-else-if="entry.kind === 'separator'"
35
36
  :data-testid="`cn-index-header-menu-${entry.key}`" />
37
+ <!-- A muted line closing the menu (an Export menu's `note`). -->
38
+ <NcActionText
39
+ v-else-if="entry.kind === 'note'"
40
+ class="cn-index-header-menu__note"
41
+ :data-testid="`cn-index-header-menu-${entry.key}`">
42
+ {{ entry.label }}
43
+ </NcActionText>
44
+ <!-- An entry with a description: the label bold, the description
45
+ muted under it (an Export menu's formats). -->
46
+ <NcActionButton
47
+ v-else-if="entry.description"
48
+ :name="entry.label"
49
+ :closeAfterClick="true"
50
+ :data-testid="`cn-index-header-menu-${entry.key}`"
51
+ @click="entry.run()">
52
+ {{ entry.description }}
53
+ </NcActionButton>
36
54
  <NcActionLink
37
55
  v-else-if="entry.href"
38
56
  :href="entry.href"
@@ -76,17 +94,17 @@
76
94
  </template>
77
95
 
78
96
  <script>
79
- import { NcActionButton, NcActionCaption, NcActionLink, NcActions, NcActionSeparator } from '@nextcloud/vue'
97
+ import { NcActionButton, NcActionCaption, NcActionLink, NcActions, NcActionSeparator, NcActionText } from '@nextcloud/vue'
80
98
  import DotsHorizontal from 'vue-material-design-icons/DotsHorizontal.vue'
81
99
  import { CnIcon } from '../CnIcon/index.js'
82
100
 
83
101
  export default {
84
102
  name: 'CnIndexHeaderMenu',
85
103
 
86
- components: { CnIcon, DotsHorizontal, NcActionButton, NcActionCaption, NcActionLink, NcActions, NcActionSeparator },
104
+ components: { CnIcon, DotsHorizontal, NcActionButton, NcActionCaption, NcActionLink, NcActions, NcActionSeparator, NcActionText },
87
105
 
88
106
  props: {
89
- /** The resolved header button: `{ key, label }`. */
107
+ /** The resolved header button: `{ key, label, action?, icon? }`; an Export menu draws its icon. */
90
108
  button: {
91
109
  type: Object,
92
110
  required: true,
@@ -40,6 +40,11 @@
40
40
  :button="button"
41
41
  :entries="headerMenuEntries(button)"
42
42
  @linkClick="onHeaderMenuLinkClick" />
43
+ <!-- An Export with `menu`: one entry per format, and the note under them. -->
44
+ <CnIndexHeaderMenu
45
+ v-else-if="button.action === 'export' && button.exportMenu"
46
+ :button="button"
47
+ :entries="exportMenuEntries(button)" />
43
48
  <NcButton
44
49
  v-else
45
50
  :variant="button.variant"
@@ -666,6 +671,8 @@
666
671
  :nameField="massActionNameField"
667
672
  :size="formSize"
668
673
  :columns="formColumns"
674
+ :eyebrow="formHeaderText(formEyebrow)"
675
+ :subtitle="formHeaderText(formSubtitle)"
669
676
  :initialData="resolvedCreateDefaults"
670
677
  :draftAppId="draftAppId"
671
678
  :allowDraft="allowDraft && !rowFormTarget && (!editItem || editItem[draftField] === true)"
@@ -685,6 +692,8 @@
685
692
  :includeFields="rowFormTarget ? null : includeFields"
686
693
  :fieldOverrides="rowFormTarget ? {} : fieldOverrides"
687
694
  :nameField="massActionNameField"
695
+ :eyebrow="formHeaderText(formEyebrow)"
696
+ :subtitle="formHeaderText(formSubtitle)"
688
697
  :initialValues="resolvedCreateDefaults"
689
698
  @confirm="onFormConfirm"
690
699
  @close="closeFormDialog" />
@@ -800,19 +809,19 @@
800
809
 
801
810
  <!-- A search the server refused for its grammar: the term with the
802
811
  character it stopped at, the server's reason, and what to do. -->
803
- <div v-else-if="searchRefusal"
812
+ <div v-else-if="searchRefused && !searchRefusalAsNotice"
804
813
  class="cn-index-page__search-refusal"
805
814
  role="status"
806
815
  data-testid="cn-index-page-search-refusal">
807
816
  <NcNoteCard type="warning">
808
817
  <p class="cn-index-page__search-refusal-headline">
809
- {{ t('nextcloud-vue', 'This search could not be read from character {position}.', { position: searchRefusal.position }) }}
818
+ {{ t('nextcloud-vue', 'This search could not be read from character {position}.', { position: searchRefused.position }) }}
810
819
  </p>
811
820
  <p class="cn-index-page__search-refusal-term" data-testid="cn-index-page-search-refusal-term">
812
- <span>{{ searchRefusal.before }}</span><mark v-if="searchRefusal.at">{{ searchRefusal.at }}</mark><span>{{ searchRefusal.after }}</span>
821
+ <span>{{ searchRefused.before }}</span><mark v-if="searchRefused.at">{{ searchRefused.at }}</mark><span>{{ searchRefused.after }}</span>
813
822
  </p>
814
823
  <p class="cn-index-page__search-refusal-muted">
815
- {{ searchRefusal.message }}
824
+ {{ searchRefused.message }}
816
825
  </p>
817
826
  <p class="cn-index-page__search-refusal-muted">
818
827
  {{ searchRefusalHintText }}
@@ -821,7 +830,7 @@
821
830
  </div>
822
831
 
823
832
  <!-- Error state: the latest self-fetch failed (e.g. a search term the server rejects) -->
824
- <div v-else-if="selfFetchFailed || sourceFailed"
833
+ <div v-else-if="(selfFetchFailed && !searchRefusalAsNotice) || sourceFailed"
825
834
  class="cn-index-page__empty"
826
835
  role="status"
827
836
  data-testid="cn-index-page-fetch-error">
@@ -1505,7 +1514,7 @@ import { viewCriteriaSummary } from '../../utils/savedViewSummary.js'
1505
1514
  import { saveEdited } from '../../utils/saveEdited.js'
1506
1515
  import { columnsFromSchema, fieldsFromSchema, isGroupProp } from '../../utils/schema.js'
1507
1516
  import { resolveScopeLayout, resolveScopePresentation } from '../../utils/scopeListLayout.js'
1508
- import { readSearchRefusal } from '../../utils/searchRefusal.js'
1517
+ import { readSearchRefusal, searchRefusalNotice } from '../../utils/searchRefusal.js'
1509
1518
  import { orderToSortKeys } from '../../utils/sortOrder.js'
1510
1519
  import { annotateRows, filterSourceRows, pageSourceRows, rowsFromSourceBody } from '../../utils/sortSourceRows.js'
1511
1520
  import { stripTrailingSlashes } from '../../utils/trailingSlashes.js'
@@ -2410,6 +2419,18 @@ export default {
2410
2419
  default: null,
2411
2420
  },
2412
2421
 
2422
+ /**
2423
+ * Header buttons per view (manifest `config.headerButtonsByView`),
2424
+ * `{ table?, cards?, list?, board?, map? }`, each a list as
2425
+ * `headerButtons`: the board view reads "Downloaden" where the table
2426
+ * reads "Exporteren" with a menu (DqWerkbord, DqZaken). A view it does
2427
+ * not name keeps `headerButtons`; a scope's own buttons come first.
2428
+ */
2429
+ headerButtonsByView: {
2430
+ type: Object,
2431
+ default: null,
2432
+ },
2433
+
2413
2434
  /**
2414
2435
  * Text added to the count line after a middle dot while a quick filter
2415
2436
  * or lens is selected (manifest `config.countSuffixByFilter`),
@@ -3520,6 +3541,21 @@ export default {
3520
3541
  default: '',
3521
3542
  },
3522
3543
 
3544
+ /**
3545
+ * A refused search keeps the rows the list had and says so in an
3546
+ * alert above the list, under the search field (DqZaken): `{ title?,
3547
+ * after? }` (manifest `config.searchRefusal`), the title with
3548
+ * `{position}` ("Search term not understood at position {position}:")
3549
+ * and the line after the server's reason ("The list is not filtered;
3550
+ * adjust the term."). Unset, the refusal replaces the rows.
3551
+ *
3552
+ * @spec openspec/changes/search-refusal-notice/specs/index-search-refusal/spec.md#requirement-a-refused-search-can-keep-the-rows-and-say-so-under-the-search-field
3553
+ */
3554
+ searchRefusal: {
3555
+ type: Object,
3556
+ default: null,
3557
+ },
3558
+
3523
3559
  /** Accessible label for the loading spinner (NcLoadingIcon aria-label) */
3524
3560
  loadingText: {
3525
3561
  type: String,
@@ -3774,6 +3810,25 @@ export default {
3774
3810
  validator: (value) => value === 1 || value === 2,
3775
3811
  },
3776
3812
 
3813
+ /**
3814
+ * The small line above the built-in Add/Edit form's title (board
3815
+ * look). A string for both, or `{ create, edit }` per mode; either
3816
+ * goes through the host `cnTranslate`. Empty draws none.
3817
+ */
3818
+ formEyebrow: {
3819
+ type: [String, Object],
3820
+ default: '',
3821
+ },
3822
+
3823
+ /**
3824
+ * The muted line under the built-in Add/Edit form's title. Same
3825
+ * shape as `formEyebrow`.
3826
+ */
3827
+ formSubtitle: {
3828
+ type: [String, Object],
3829
+ default: '',
3830
+ },
3831
+
3777
3832
  /**
3778
3833
  * The app a form draft belongs to, forwarded to every form this page
3779
3834
  * opens as CnFormDialog's `draftAppId`, so what a user typed and did not
@@ -5069,9 +5124,16 @@ export default {
5069
5124
  /**
5070
5125
  * @return {Array<object>} The manifest's notices, then the ones this page's actions raised.
5071
5126
  * @spec openspec/changes/card-state-notices/specs/card-state-notices/spec.md#requirement-an-index-page-draws-its-notices-above-the-list
5127
+ * @spec openspec/changes/notice-text-from-endpoint/specs/card-state-notices/spec.md#requirement-an-index-page-notice-can-belong-to-saved-views
5072
5128
  */
5073
5129
  pageNotices() {
5074
- return [...(Array.isArray(this.notices) ? this.notices : []), ...this.runtimeNotices]
5130
+ const view = this.appliedSavedView
5131
+ const names = [this.appliedSavedViewId, ...(view ? [view.id, view.slug, view.uuid] : [])].filter((v) => v !== undefined && v !== null && v !== '').map(String)
5132
+ // `savedViews` keeps a notice to the saved views it names (DqTeamwachtrij).
5133
+ const declared = (Array.isArray(this.notices) ? this.notices : [])
5134
+ .filter((notice) => !notice || !Array.isArray(notice.savedViews) || notice.savedViews.some((id) => names.includes(String(id))))
5135
+ const refusal = this.searchRefusalAsNotice ? [searchRefusalNotice(this.searchRefused, this.searchRefusal, (text) => this.cnTranslate(text))] : []
5136
+ return [...refusal, ...declared, ...this.runtimeNotices]
5075
5137
  },
5076
5138
 
5077
5139
  /**
@@ -5372,10 +5434,21 @@ export default {
5372
5434
  * @spec openspec/changes/index-search-refusal/specs/index-search-refusal/spec.md#requirement-a-refused-search-is-said-where-it-was-typed
5373
5435
  * @return {object|null}
5374
5436
  */
5375
- searchRefusal() {
5437
+ searchRefused() {
5376
5438
  return this.selfFetchFailed ? readSearchRefusal(this.list.error.value, this.effectiveSearchValue) : null
5377
5439
  },
5378
5440
 
5441
+ /**
5442
+ * Whether a refused search keeps the rows and says so in a notice under
5443
+ * the search field (`searchRefusal` set), rather than in place of them.
5444
+ *
5445
+ * @spec openspec/changes/search-refusal-notice/specs/index-search-refusal/spec.md#requirement-a-refused-search-can-keep-the-rows-and-say-so-under-the-search-field
5446
+ * @return {boolean}
5447
+ */
5448
+ searchRefusalAsNotice() {
5449
+ return this.searchRefused !== null && !!this.searchRefusal && typeof this.searchRefusal === 'object'
5450
+ },
5451
+
5379
5452
  /**
5380
5453
  * Whether the named source sends the search term to its server.
5381
5454
  *
@@ -5462,7 +5535,11 @@ export default {
5462
5535
  return t('nextcloud-vue', 'Correct that character, or search for plain words. AND, OR and NOT work in capitals, and quotes make a phrase.')
5463
5536
  },
5464
5537
 
5465
- /** Rows: store collection in self-fetch mode, else the `objects` prop. */
5538
+ /**
5539
+ * Rows: store collection in self-fetch mode, else the `objects` prop.
5540
+ *
5541
+ * @spec openspec/changes/search-refusal-notice/specs/index-search-refusal/spec.md#requirement-a-refused-search-can-keep-the-rows-and-say-so-under-the-search-field
5542
+ */
5466
5543
  effectiveObjects() {
5467
5544
  if (this.isNamedSource) {
5468
5545
  const sortsRows = !!(this.namedSource && this.namedSource.sortsRows === true)
@@ -5477,7 +5554,7 @@ export default {
5477
5554
  if (this.sortSourceShown) {
5478
5555
  return this.sortSourceView.rows
5479
5556
  }
5480
- if (this.selfFetchFailed) {
5557
+ if (this.selfFetchFailed && !this.searchRefusalAsNotice) {
5481
5558
  return []
5482
5559
  }
5483
5560
  const rows = this.isSelfFetchMode ? (this.list.objects.value || []) : this.objects
@@ -7826,12 +7903,16 @@ export default {
7826
7903
  return this.refreshing || this.internalRefreshing
7827
7904
  },
7828
7905
 
7829
- /** Pagination: store pagination in self-fetch mode, else the `pagination` prop. */
7906
+ /**
7907
+ * Pagination: store pagination in self-fetch mode, else the `pagination` prop.
7908
+ *
7909
+ * @spec openspec/changes/search-refusal-notice/specs/index-search-refusal/spec.md#requirement-a-refused-search-can-keep-the-rows-and-say-so-under-the-search-field
7910
+ */
7830
7911
  effectivePagination() {
7831
7912
  if (this.sortSourceShown) {
7832
7913
  return this.sortSourceView.pagination
7833
7914
  }
7834
- if (this.selfFetchFailed) {
7915
+ if (this.selfFetchFailed && !this.searchRefusalAsNotice) {
7835
7916
  return { ...this.list.pagination.value, total: 0, page: 1, pages: 1 }
7836
7917
  }
7837
7918
  // A named source that reports its own total (the search source)
@@ -8502,6 +8583,7 @@ export default {
8502
8583
  * `CnRowActions` sees the same `{ handler: fn }` shape it does
8503
8584
  * for built-in defaults. Function-typed handlers (the existing
8504
8585
  * runtime path) pass through untouched.
8586
+ *
8505
8587
  * @spec openspec/changes/card-state-notices/specs/card-state-notices/spec.md#requirement-an-index-page-draws-its-notices-above-the-list
8506
8588
  */
8507
8589
  mergedActions() {
@@ -8771,10 +8853,15 @@ export default {
8771
8853
  * @spec openspec/changes/zuiddrecht-pixel-gaps-3/specs/zuiddrecht-pixel-gaps-3/spec.md#requirement-an-index-page-can-take-the-board-header
8772
8854
  * @spec openspec/changes/screens-index-header-buttons-parity/specs/index-list-board-look/spec.md#requirement-the-add-header-button-carries-a-plus
8773
8855
  * @spec openspec/changes/header-action-href/specs/header-action-href/spec.md#requirement-a-header-action-with-href-is-a-link-that-runs-and-emits-nothing
8856
+ * @spec openspec/changes/index-export-menu/specs/index-header/spec.md#requirement-header-buttons-can-differ-per-view
8774
8857
  * @return {Array<{key: string, label: string, action: string, variant: string, icon: string, format: string, link: ({href: string, target: (string|undefined)}|null)}>}
8775
8858
  */
8776
8859
  resolvedHeaderButtons() {
8777
- const headerButtons = this.presented('headerButtons')
8860
+ const byView = this.headerButtonsByView
8861
+ const ownForView = byView && typeof byView === 'object' && (this.activeScopePresentation || {}).headerButtons === undefined
8862
+ ? byView[this.currentViewMode]
8863
+ : undefined
8864
+ const headerButtons = Array.isArray(ownForView) ? ownForView : this.presented('headerButtons')
8778
8865
  const declared = Array.isArray(headerButtons) ? headerButtons : []
8779
8866
  const builtInActions = new Set(['add', 'export', 'import', 'refresh', 'save-view', 'actions-menu'])
8780
8867
  return declared
@@ -8831,6 +8918,10 @@ export default {
8831
8918
  ? button.items.filter((item) => (typeof item === 'string' && item !== '')
8832
8919
  || (item && typeof item === 'object' && typeof item.heading === 'string' && item.heading !== ''))
8833
8920
  : null,
8921
+ exportMenu: button.action === 'export' && Array.isArray(button.menu)
8922
+ ? button.menu.filter((entry) => entry && (entry.format === 'csv' || entry.format === 'excel') && typeof entry.label === 'string' && entry.label !== '')
8923
+ : null,
8924
+ note: typeof button.note === 'string' && button.note !== '' ? this.cnTranslate(button.note) : '',
8834
8925
  }
8835
8926
  })
8836
8927
  .filter((button) => button.label !== '')
@@ -10179,6 +10270,23 @@ export default {
10179
10270
  },
10180
10271
 
10181
10272
  methods: {
10273
+ /**
10274
+ * The eyebrow or subtitle of the built-in Add/Edit form: `value` as a
10275
+ * string, or its `create` / `edit` entry for the open mode. A row
10276
+ * action's own form (`rowFormTarget`) draws none.
10277
+ *
10278
+ * @param {string|object} value `formEyebrow` or `formSubtitle`.
10279
+ * @return {string} The translated text, or ''.
10280
+ * @spec openspec/changes/index-form-eyebrow-subtitle/specs/index-page/spec.md#requirement-an-index-pages-form-can-carry-an-eyebrow-and-a-subtitle
10281
+ */
10282
+ formHeaderText(value) {
10283
+ if (!value || this.rowFormTarget) {
10284
+ return ''
10285
+ }
10286
+ const text = typeof value === 'string' ? value : value[this.editItem ? 'edit' : 'create']
10287
+ return text ? this.cnTranslate(text) : ''
10288
+ },
10289
+
10182
10290
  /**
10183
10291
  * Show a notice above the list, replacing an earlier answer.
10184
10292
  *
@@ -11357,6 +11465,28 @@ export default {
11357
11465
  this.$emit('header-action', { action: entry.key, id: entry.key })
11358
11466
  },
11359
11467
 
11468
+ /**
11469
+ * The entries of an Export button's menu (`menu`): one per format,
11470
+ * its label bold and its description muted, each running the export
11471
+ * in that format; the button's `note` as a muted line after them.
11472
+ *
11473
+ * @param {object} button The resolved Export button.
11474
+ * @return {Array<object>} The menu entries.
11475
+ * @spec openspec/changes/index-export-menu/specs/index-header/spec.md#requirement-an-export-header-button-can-be-a-menu-of-formats
11476
+ */
11477
+ exportMenuEntries(button) {
11478
+ const entries = (button.exportMenu || []).map((entry) => ({
11479
+ key: `export-${entry.format}`,
11480
+ label: this.cnTranslate(entry.label),
11481
+ description: typeof entry.description === 'string' && entry.description !== '' ? this.cnTranslate(entry.description) : '',
11482
+ run: () => this.onHeaderButton({ ...button, format: entry.format }),
11483
+ }))
11484
+ if (button.note) {
11485
+ entries.push({ key: 'export-note', kind: 'note', label: button.note })
11486
+ }
11487
+ return entries
11488
+ },
11489
+
11360
11490
  /**
11361
11491
  * A header button was clicked: run its built-in action, or dispatch
11362
11492
  * it as the `headerActions` entry with that id. A button that is a