@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,382 @@
1
+ <template>
2
+ <CnDialog
3
+ :look="look"
4
+ :width="width"
5
+ defaultWidth="confirm"
6
+ :eyebrow="eyebrow"
7
+ :subtitle="subtitle"
8
+ :name="dialogTitle"
9
+ size="normal"
10
+ :noClose="loading"
11
+ @closing="$emit('close')">
12
+ <!-- Review phase -->
13
+ <div v-if="result === null"
14
+ class="cn-mass-delete__review"
15
+ data-testid="cn-modal"
16
+ :data-testid-modal="testidPrefix + '-dialog'"
17
+ data-testid-phase="review">
18
+ <template v-if="isBoardLook">
19
+ <p class="cn-dialog__sentence" :data-testid="testidPrefix + '-sentence'">
20
+ {{ sentenceParts[0] }}<strong class="cn-dialog__name">{{ countLabel }}</strong>{{ sentenceParts[1] }}
21
+ <template v-if="irreversible">
22
+ {{ irreversibleText }}
23
+ </template>
24
+ </p>
25
+ <p class="cn-dialog__note"
26
+ role="note"
27
+ :data-testid="testidPrefix + '-note'">
28
+ <AlertOutline :size="20" aria-hidden="true" />
29
+ <span>{{ warningText }}</span>
30
+ </p>
31
+ </template>
32
+ <NcNoteCard v-else type="warning">
33
+ {{ warningText }}
34
+ </NcNoteCard>
35
+
36
+ <div class="cn-mass-delete__list">
37
+ <div
38
+ v-for="item in localItems"
39
+ :key="item.id"
40
+ class="cn-mass-delete__item">
41
+ <span class="cn-mass-delete__item-name">
42
+ {{ getItemName(item) }}
43
+ </span>
44
+ <NcButton
45
+ variant="tertiary"
46
+ :aria-label="removeLabel"
47
+ @click="removeItem(item.id)">
48
+ <template #icon>
49
+ <Close :size="16" />
50
+ </template>
51
+ </NcButton>
52
+ </div>
53
+ </div>
54
+
55
+ <p v-if="localItems.length === 0" class="cn-mass-delete__empty">
56
+ {{ emptyText }}
57
+ </p>
58
+ <CnConfirmValueField v-if="confirmValue !== ''"
59
+ v-model="typedConfirmValue"
60
+ :value="confirmValue"
61
+ :label="confirmFieldLabel" />
62
+ </div>
63
+
64
+ <!-- Result phase -->
65
+ <div v-else
66
+ class="cn-mass-delete__result"
67
+ data-testid="cn-modal"
68
+ :data-testid-modal="testidPrefix + '-dialog'"
69
+ data-testid-phase="result">
70
+ <NcNoteCard v-if="result.success" type="success">
71
+ {{ successText }}
72
+ </NcNoteCard>
73
+ <NcNoteCard v-if="result.error" type="error">
74
+ {{ result.error }}
75
+ </NcNoteCard>
76
+ </div>
77
+
78
+ <template #actions>
79
+ <NcButton :disabled="loading" @click="$emit('close')">
80
+ {{ result === null ? cancelLabel : closeLabel }}
81
+ </NcButton>
82
+ <NcButton
83
+ v-if="result === null"
84
+ :variant="variant"
85
+ :class="{ 'cn-dialog__confirm-pending': confirmValuePending }"
86
+ :disabled="loading || localItems.length === 0 || confirmValuePending"
87
+ :aria-disabled="confirmValuePending ? 'true' : undefined"
88
+ :data-testid="testidPrefix + '-dialog-confirm'"
89
+ @click="executeConfirm">
90
+ <template v-if="loading || confirmIcon" #icon>
91
+ <NcLoadingIcon v-if="loading" :size="20" />
92
+ <CnIcon v-else-if="typeof confirmIcon === 'string'" :name="confirmIcon" :size="20" />
93
+ <component :is="confirmIcon" v-else :size="20" />
94
+ </template>
95
+ {{ confirmLabel }}
96
+ </NcButton>
97
+ </template>
98
+ </CnDialog>
99
+ </template>
100
+
101
+ <script>
102
+ import { translatePlural as n, translate as t } from '@nextcloud/l10n'
103
+ import { NcButton, NcLoadingIcon, NcNoteCard } from '@nextcloud/vue'
104
+ import AlertOutline from 'vue-material-design-icons/AlertOutline.vue'
105
+ import Close from 'vue-material-design-icons/Close.vue'
106
+ import CnConfirmValueField from '../CnConfirmValueField/CnConfirmValueField.vue'
107
+ import CnDialog from '../CnDialog/CnDialog.vue'
108
+ import { confirmValueMixin } from '../../mixins/confirmValue.js'
109
+ import { dialogBoardMixin } from '../../mixins/dialogBoard.js'
110
+ import { splitAroundPlaceholder } from '../../utils/dialogSentence.js'
111
+ import { CnIcon } from '../CnIcon/index.js'
112
+
113
+ /**
114
+ * CnMassActionDialog — two-phase confirmation dialog for one action on many
115
+ * items: publish, lock, validate, restore, delete.
116
+ *
117
+ * Phase 1 (review): shows the items the action applies to, each with a button
118
+ * that takes it off the list. Phase 2 (result): shows success or an error.
119
+ *
120
+ * The dialog does NOT perform the action itself. It emits `confirm` with the
121
+ * ids of the items still on the list; the parent performs the call and
122
+ * reports back through `setResult()` on a ref.
123
+ *
124
+ * ```vue
125
+ * <CnMassActionDialog
126
+ * v-if="showPublish"
127
+ * ref="publishDialog"
128
+ * :items="selectedObjects"
129
+ * :dialog-title="t('myapp', 'Publish objects')"
130
+ * :warning-text="t('myapp', 'The following objects will be published.')"
131
+ * :confirm-label="t('myapp', 'Publish')"
132
+ * confirm-icon="Publish"
133
+ * @confirm="onPublishConfirm"
134
+ * @close="showPublish = false" />
135
+ * ```
136
+ *
137
+ * // In methods:
138
+ * async onPublishConfirm(ids) {
139
+ * try {
140
+ * await store.massPublish(ids)
141
+ * this.$refs.publishDialog.setResult({ success: true })
142
+ * } catch (e) {
143
+ * this.$refs.publishDialog.setResult({ error: e.message })
144
+ * }
145
+ * }
146
+ *
147
+ * `CnMassDeleteDialog` is this dialog with the delete texts, the `error`
148
+ * variant and a trash icon as defaults.
149
+ *
150
+ * @event close Emitted when the dialog should be closed (cancel, close button, or auto-close after success).
151
+ */
152
+ export default {
153
+ name: 'CnMassActionDialog',
154
+
155
+ /** Prefix of the dialog's test ids: `<prefix>-dialog`, `<prefix>-dialog-confirm`, `<prefix>-sentence`, `<prefix>-note`. */
156
+ testidPrefix: 'cn-mass-action',
157
+
158
+ components: {
159
+ CnDialog,
160
+ NcButton,
161
+ NcNoteCard,
162
+ NcLoadingIcon,
163
+ CnIcon,
164
+ Close,
165
+ AlertOutline,
166
+ CnConfirmValueField,
167
+ },
168
+
169
+ mixins: [dialogBoardMixin, confirmValueMixin],
170
+
171
+ props: {
172
+ /** Items the action applies to. Each must have an `id` property. */
173
+ items: {
174
+ type: Array,
175
+ required: true,
176
+ },
177
+
178
+ /** Property name used for display (e.g., 'title', 'name') */
179
+ nameField: {
180
+ type: String,
181
+ default: 'title',
182
+ },
183
+
184
+ /** Optional function to format the item name. Receives the item, returns a string. Overrides nameField when provided. */
185
+ nameFormatter: {
186
+ type: Function,
187
+ default: null,
188
+ },
189
+
190
+ /** Dialog title */
191
+ dialogTitle: {
192
+ type: String,
193
+ default: () => t('nextcloud-vue', 'Confirm action'),
194
+ },
195
+
196
+ /** Warning text shown above the item list */
197
+ warningText: {
198
+ type: String,
199
+ default: () => t('nextcloud-vue', 'The action applies to the following items. Remove any items you want to leave out.'),
200
+ },
201
+
202
+ /** Text when all items removed from list */
203
+ emptyText: {
204
+ type: String,
205
+ default: () => t('nextcloud-vue', 'No items selected.'),
206
+ },
207
+
208
+ /** Success message */
209
+ successText: {
210
+ type: String,
211
+ default: () => t('nextcloud-vue', 'Done.'),
212
+ },
213
+
214
+ /** Label for the cancel button (visible before the action runs). */
215
+ cancelLabel: { type: String, default: () => t('nextcloud-vue', 'Cancel') },
216
+ /** Label for the close button (visible after the action completes). */
217
+ closeLabel: { type: String, default: () => t('nextcloud-vue', 'Close') },
218
+ /** Label for the primary button that confirms the action. */
219
+ confirmLabel: { type: String, default: () => t('nextcloud-vue', 'Confirm') },
220
+ /** Aria label for the per-row "remove from list" icon button. */
221
+ removeLabel: { type: String, default: () => t('nextcloud-vue', 'Remove from list') },
222
+
223
+ /**
224
+ * Visual variant of the primary button. Use `error` for a destructive
225
+ * action such as delete or purge.
226
+ */
227
+ variant: {
228
+ type: String,
229
+ default: 'primary',
230
+ validator: (v) => ['primary', 'error', 'warning', 'success'].includes(v),
231
+ },
232
+
233
+ /**
234
+ * Icon on the primary button: a CnIcon name (`Publish`) or an icon
235
+ * component. Empty draws none.
236
+ *
237
+ * @type {string|object}
238
+ */
239
+ confirmIcon: { type: [String, Object], default: '' },
240
+
241
+ /**
242
+ * Board look: the question above the list, with `{count}` where the
243
+ * bold item count goes.
244
+ */
245
+ sentence: {
246
+ type: String,
247
+ default: () => t('nextcloud-vue', 'Are you sure you want to continue with {count}?'),
248
+ },
249
+
250
+ /** Board look: end the sentence with "This action cannot be undone." */
251
+ irreversible: { type: Boolean, default: false },
252
+ },
253
+
254
+ emits: ['close', 'confirm'],
255
+
256
+ data() {
257
+ return {
258
+ localItems: [...this.items],
259
+ loading: false,
260
+ result: null,
261
+ closeTimeout: null,
262
+ }
263
+ },
264
+
265
+ computed: {
266
+ /** The board sentence around the bold item count. */
267
+ sentenceParts() {
268
+ return splitAroundPlaceholder(this.sentence, 'count')
269
+ },
270
+
271
+ /** Prefix of the test ids, set per preset. */
272
+ testidPrefix() {
273
+ return this.$options.testidPrefix
274
+ },
275
+
276
+ countLabel() {
277
+ return n('nextcloud-vue', '%n item', '%n items', this.localItems.length)
278
+ },
279
+
280
+ irreversibleText() {
281
+ return t('nextcloud-vue', 'This action cannot be undone.')
282
+ },
283
+ },
284
+
285
+ watch: {
286
+ items(val) {
287
+ this.localItems = [...val]
288
+ },
289
+ },
290
+
291
+ beforeUnmount() {
292
+ if (this.closeTimeout) {
293
+ clearTimeout(this.closeTimeout)
294
+ }
295
+ },
296
+
297
+ methods: {
298
+ getItemName(item) {
299
+ if (this.nameFormatter) {
300
+ return this.nameFormatter(item)
301
+ }
302
+ return item[this.nameField] || item.name || item.title || item.id
303
+ },
304
+
305
+ removeItem(id) {
306
+ this.localItems = this.localItems.filter((i) => i.id !== id)
307
+ },
308
+
309
+ executeConfirm() {
310
+ if (!this.confirmValueMatches) {
311
+ return
312
+ }
313
+ this.loading = true
314
+ const ids = this.localItems.map((i) => i.id)
315
+ /**
316
+ * Emitted when the user confirms the action. Payload: the ids of the items still on the list.
317
+ *
318
+ * @event confirm
319
+ * @type {Array<string|number>}
320
+ */
321
+ this.$emit('confirm', ids)
322
+ },
323
+
324
+ /**
325
+ * Set the result of the action. Call this from the parent
326
+ * after the API call completes.
327
+ *
328
+ * @param {{ success?: boolean, error?: string }} resultData - Result data to pass to the dialog
329
+ * @public
330
+ */
331
+ setResult(resultData) {
332
+ this.loading = false
333
+ this.result = resultData
334
+ if (resultData.success) {
335
+ this.closeTimeout = setTimeout(() => {
336
+ /**
337
+ * Emitted when the dialog should close: cancel, close button, or 2 seconds after a success.
338
+ *
339
+ * @event close
340
+ */
341
+ this.$emit('close')
342
+ }, 2000)
343
+ }
344
+ },
345
+ },
346
+ }
347
+ </script>
348
+
349
+ <style scoped>
350
+ /* Every preset keeps the cn-mass-delete class names: apps style against them. */
351
+ .cn-mass-delete__list {
352
+ max-height: 300px;
353
+ overflow-y: auto;
354
+ margin-top: 12px;
355
+ }
356
+
357
+ .cn-mass-delete__item {
358
+ display: flex;
359
+ align-items: center;
360
+ justify-content: space-between;
361
+ padding: 8px 12px;
362
+ border-bottom: 1px solid var(--color-border);
363
+ }
364
+
365
+ .cn-mass-delete__item:last-child {
366
+ border-bottom: none;
367
+ }
368
+
369
+ .cn-mass-delete__item-name {
370
+ font-weight: 500;
371
+ overflow: hidden;
372
+ text-overflow: ellipsis;
373
+ white-space: nowrap;
374
+ }
375
+
376
+ .cn-mass-delete__empty {
377
+ text-align: center;
378
+ color: var(--color-text-maxcontrast);
379
+ font-style: italic;
380
+ padding: 20px;
381
+ }
382
+ </style>
@@ -0,0 +1,7 @@
1
+ // SPDX-FileCopyrightText: 2026 Conduction B.V.
2
+ // SPDX-License-Identifier: EUPL-1.2
3
+
4
+ import CnMassActionDialog from './CnMassActionDialog.vue'
5
+
6
+ export default CnMassActionDialog
7
+ export { CnMassActionDialog }
@@ -54,3 +54,7 @@ All user-visible strings have props so they can be pre-translated by the consume
54
54
  ## Board look
55
55
 
56
56
  In the board look the sentence ends with "This action cannot be undone." unless you pass `:irreversible="false"`.
57
+
58
+ ## Other actions
59
+
60
+ This dialog is `CnMassActionDialog` with delete defaults. Pass `variant` (default `'error'`), `confirmIcon` (a CnIcon name or an icon component, default a trash can) and `sentence` to change them, or use `CnMassActionDialog` for an action that is not a delete.