@conduction/nextcloud-vue 0.1.0-beta.3 → 0.1.0-beta.5

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 (142) hide show
  1. package/README.md +226 -226
  2. package/dist/nextcloud-vue.cjs +67614 -0
  3. package/dist/nextcloud-vue.cjs.js +58386 -6112
  4. package/dist/nextcloud-vue.cjs.js.map +1 -1
  5. package/dist/nextcloud-vue.cjs.map +1 -0
  6. package/dist/nextcloud-vue.css +1819 -285
  7. package/dist/nextcloud-vue.esm.js +58342 -6088
  8. package/dist/nextcloud-vue.esm.js.map +1 -1
  9. package/package.json +82 -62
  10. package/src/components/CnActionsBar/CnActionsBar.vue +17 -7
  11. package/src/components/CnActionsBar/index.js +1 -1
  12. package/src/components/CnAdvancedFormDialog/CnAdvancedFormDialog.vue +579 -0
  13. package/src/components/CnAdvancedFormDialog/CnDataTab.vue +217 -0
  14. package/src/components/CnAdvancedFormDialog/CnMetadataTab.vue +121 -0
  15. package/src/components/CnAdvancedFormDialog/CnPropertiesTab.vue +418 -0
  16. package/src/components/CnAdvancedFormDialog/CnPropertyValueCell.vue +247 -0
  17. package/src/components/CnAdvancedFormDialog/index.js +1 -0
  18. package/src/components/CnCardGrid/CnCardGrid.vue +1 -1
  19. package/src/components/CnCardGrid/index.js +1 -1
  20. package/src/components/CnCellRenderer/index.js +1 -1
  21. package/src/components/CnChartWidget/CnChartWidget.vue +320 -0
  22. package/src/components/CnChartWidget/index.js +1 -0
  23. package/src/components/CnConfigurationCard/index.js +1 -1
  24. package/src/components/CnCopyDialog/CnCopyDialog.vue +250 -250
  25. package/src/components/CnDashboardGrid/CnDashboardGrid.vue +225 -0
  26. package/src/components/CnDashboardGrid/index.js +1 -0
  27. package/src/components/CnDashboardPage/CnDashboardPage.vue +390 -0
  28. package/src/components/CnDashboardPage/index.js +1 -0
  29. package/src/components/CnDataTable/CnDataTable.vue +1 -1
  30. package/src/components/CnDataTable/index.js +1 -1
  31. package/src/components/CnDeleteDialog/CnDeleteDialog.vue +170 -170
  32. package/src/components/CnDetailCard/CnDetailCard.vue +214 -0
  33. package/src/components/CnDetailCard/index.js +1 -0
  34. package/src/components/CnDetailPage/CnDetailPage.vue +285 -0
  35. package/src/components/CnDetailPage/index.js +1 -0
  36. package/src/components/CnFacetSidebar/CnFacetSidebar.vue +9 -1
  37. package/src/components/CnFacetSidebar/index.js +1 -1
  38. package/src/components/CnFilterBar/index.js +1 -1
  39. package/src/components/CnFormDialog/CnFormDialog.vue +302 -11
  40. package/src/components/CnIcon/index.js +1 -1
  41. package/src/components/CnIndexPage/CnIndexPage.vue +71 -3
  42. package/src/components/CnIndexPage/index.js +1 -1
  43. package/src/components/CnIndexSidebar/CnIndexSidebar.vue +121 -102
  44. package/src/components/CnIndexSidebar/index.js +1 -1
  45. package/src/components/CnItemCard/CnItemCard.vue +132 -0
  46. package/src/components/CnItemCard/index.js +1 -0
  47. package/src/components/CnKpiGrid/index.js +1 -1
  48. package/src/components/CnMassActionBar/index.js +1 -1
  49. package/src/components/CnMassCopyDialog/index.js +1 -1
  50. package/src/components/CnMassDeleteDialog/index.js +1 -1
  51. package/src/components/CnMassExportDialog/index.js +1 -1
  52. package/src/components/CnMassImportDialog/index.js +1 -1
  53. package/src/components/CnNoteCard/CnNoteCard.vue +149 -0
  54. package/src/components/CnNoteCard/index.js +1 -0
  55. package/src/components/CnNotesCard/CnNotesCard.vue +413 -0
  56. package/src/components/CnNotesCard/index.js +1 -0
  57. package/src/components/CnObjectCard/CnObjectCard.vue +1 -1
  58. package/src/components/CnObjectCard/index.js +1 -1
  59. package/src/components/CnObjectSidebar/CnObjectSidebar.vue +876 -0
  60. package/src/components/CnObjectSidebar/index.js +1 -0
  61. package/src/components/CnPageHeader/index.js +1 -1
  62. package/src/components/CnPagination/index.js +1 -1
  63. package/src/components/CnRegisterMapping/CnRegisterMapping.vue +792 -792
  64. package/src/components/CnRowActions/CnRowActions.vue +25 -3
  65. package/src/components/CnRowActions/index.js +1 -1
  66. package/src/components/CnSchemaFormDialog/CnSchemaConfigurationTab.vue +226 -0
  67. package/src/components/CnSchemaFormDialog/CnSchemaFormDialog.vue +787 -0
  68. package/src/components/CnSchemaFormDialog/CnSchemaPropertiesTab.vue +305 -0
  69. package/src/components/CnSchemaFormDialog/CnSchemaPropertyActions.vue +1398 -0
  70. package/src/components/CnSchemaFormDialog/CnSchemaSecurityTab.vue +236 -0
  71. package/src/components/CnSchemaFormDialog/index.js +1 -0
  72. package/src/components/CnSettingsCard/index.js +1 -1
  73. package/src/components/CnSettingsSection/index.js +1 -1
  74. package/src/components/CnStatsBlock/CnStatsBlock.vue +62 -8
  75. package/src/components/CnStatsBlock/index.js +1 -1
  76. package/src/components/CnStatusBadge/index.js +1 -1
  77. package/src/components/CnTabbedFormDialog/CnTabbedFormDialog.vue +540 -0
  78. package/src/components/CnTabbedFormDialog/index.js +1 -0
  79. package/src/components/CnTasksCard/CnTasksCard.vue +373 -0
  80. package/src/components/CnTasksCard/index.js +1 -0
  81. package/src/components/CnTileWidget/CnTileWidget.vue +159 -0
  82. package/src/components/CnTileWidget/index.js +1 -0
  83. package/src/components/CnTimelineStages/CnTimelineStages.vue +292 -0
  84. package/src/components/CnTimelineStages/index.js +1 -0
  85. package/src/components/CnUserActionMenu/CnUserActionMenu.vue +435 -0
  86. package/src/components/CnUserActionMenu/index.js +1 -0
  87. package/src/components/CnVersionInfoCard/index.js +1 -1
  88. package/src/components/CnWidgetRenderer/CnWidgetRenderer.vue +180 -0
  89. package/src/components/CnWidgetRenderer/index.js +1 -0
  90. package/src/components/CnWidgetWrapper/CnWidgetWrapper.vue +211 -0
  91. package/src/components/CnWidgetWrapper/index.js +1 -0
  92. package/src/components/index.js +43 -29
  93. package/src/composables/index.js +4 -3
  94. package/src/composables/useDashboardView.js +240 -0
  95. package/src/composables/useDetailView.js +289 -132
  96. package/src/composables/useListView.js +363 -362
  97. package/src/composables/useSubResource.js +142 -142
  98. package/src/constants/metadata.js +30 -30
  99. package/src/css/CnSchemaFormDialog.css +546 -0
  100. package/src/css/__sample_nextcloud_tokens.css +110 -0
  101. package/src/css/actions-bar.css +48 -48
  102. package/src/css/badge.css +51 -51
  103. package/src/css/card.css +128 -128
  104. package/src/css/dashboard.css +70 -0
  105. package/src/css/detail-page.css +168 -0
  106. package/src/css/detail.css +68 -68
  107. package/src/css/index-page.css +44 -32
  108. package/src/css/index-sidebar.css +193 -187
  109. package/src/css/index.css +16 -12
  110. package/src/css/layout.css +90 -90
  111. package/src/css/page-header.css +33 -33
  112. package/src/css/pagination.css +72 -72
  113. package/src/css/table.css +142 -142
  114. package/src/css/timeline-stages.css +218 -0
  115. package/src/css/utilities.css +46 -46
  116. package/src/index.js +72 -53
  117. package/src/store/createSubResourcePlugin.js +135 -135
  118. package/src/store/index.js +3 -3
  119. package/src/store/plugins/auditTrails.js +17 -17
  120. package/src/store/plugins/files.js +250 -186
  121. package/src/store/plugins/index.js +7 -5
  122. package/src/store/plugins/lifecycle.js +180 -180
  123. package/src/store/plugins/relations.js +68 -68
  124. package/src/store/plugins/search.js +372 -0
  125. package/src/store/plugins/selection.js +104 -0
  126. package/src/store/useObjectStore.js +829 -686
  127. package/src/types/auditTrail.d.ts +32 -32
  128. package/src/types/file.d.ts +23 -23
  129. package/src/types/index.d.ts +35 -35
  130. package/src/types/notification.d.ts +36 -36
  131. package/src/types/object.d.ts +40 -40
  132. package/src/types/organisation.d.ts +41 -41
  133. package/src/types/register.d.ts +25 -25
  134. package/src/types/schema.d.ts +39 -39
  135. package/src/types/shared.d.ts +79 -79
  136. package/src/types/source.d.ts +14 -14
  137. package/src/types/task.d.ts +31 -31
  138. package/src/utils/errors.js +96 -96
  139. package/src/utils/headers.js +68 -50
  140. package/src/utils/id.js +13 -0
  141. package/src/utils/index.js +3 -3
  142. package/src/utils/schema.js +422 -419
@@ -0,0 +1,413 @@
1
+ <!--
2
+ CnNotesCard — Inline notes card for detail pages.
3
+
4
+ Displays up to 5 recent notes with author, content, and timestamp.
5
+ Includes an add-note form and integrates CnUserActionMenu on author names.
6
+ Wraps CnDetailCard for consistent styling.
7
+ -->
8
+ <template>
9
+ <CnDetailCard :title="titleLabel" :icon="CommentTextOutline" :collapsible="collapsible">
10
+ <div class="cn-notes-card">
11
+ <!-- Add note input -->
12
+ <div class="cn-notes-card__add-form">
13
+ <textarea
14
+ v-model="newNoteText"
15
+ class="cn-notes-card__textarea"
16
+ :placeholder="addNotePlaceholder"
17
+ rows="2"
18
+ @keydown.enter.ctrl.prevent="submitNote"
19
+ @keydown.enter.meta.prevent="submitNote" />
20
+ <NcButton
21
+ type="primary"
22
+ :disabled="!newNoteText.trim() || noteSaving"
23
+ @click="submitNote">
24
+ <template #icon>
25
+ <Send :size="20" />
26
+ </template>
27
+ {{ addNoteLabel }}
28
+ </NcButton>
29
+ </div>
30
+
31
+ <!-- Loading state -->
32
+ <NcLoadingIcon v-if="loading" />
33
+
34
+ <!-- Empty state -->
35
+ <div v-else-if="allNotes.length === 0" class="cn-notes-card__empty">
36
+ {{ noNotesLabel }}
37
+ </div>
38
+
39
+ <!-- Notes list (last 5) -->
40
+ <div v-else class="cn-notes-card__list">
41
+ <div
42
+ v-for="note in displayedNotes"
43
+ :key="note.id"
44
+ class="cn-notes-card__note">
45
+ <div class="cn-notes-card__note-header">
46
+ <CnUserActionMenu
47
+ v-if="!isCurrentUser(note)"
48
+ :user-id="getNoteAuthorId(note)"
49
+ :display-name="getNoteAuthorName(note)">
50
+ <strong class="cn-notes-card__author">{{ getNoteAuthorName(note) }}</strong>
51
+ </CnUserActionMenu>
52
+ <strong v-else class="cn-notes-card__author cn-notes-card__author--self">
53
+ {{ getNoteAuthorName(note) }}
54
+ </strong>
55
+ <span class="cn-notes-card__time">{{ formatDate(note.creationDateTime || note.created) }}</span>
56
+ </div>
57
+ <p class="cn-notes-card__body">{{ note.message || note.content }}</p>
58
+ <NcButton
59
+ v-if="canDeleteNote(note)"
60
+ type="tertiary-no-background"
61
+ class="cn-notes-card__delete-btn"
62
+ :aria-label="deleteLabel"
63
+ @click="confirmDelete(note)">
64
+ <template #icon>
65
+ <Delete :size="16" />
66
+ </template>
67
+ </NcButton>
68
+ </div>
69
+ </div>
70
+ </div>
71
+
72
+ <!-- Footer: "Show all" link -->
73
+ <template v-if="allNotes.length > maxDisplay" #footer>
74
+ <button
75
+ class="cn-notes-card__show-all"
76
+ @click="$emit('show-all')">
77
+ {{ showAllLabel }} ({{ allNotes.length }})
78
+ </button>
79
+ </template>
80
+ </CnDetailCard>
81
+ </template>
82
+
83
+ <script>
84
+ import { NcButton, NcLoadingIcon } from '@nextcloud/vue'
85
+ import CommentTextOutline from 'vue-material-design-icons/CommentTextOutline.vue'
86
+ import Send from 'vue-material-design-icons/Send.vue'
87
+ import Delete from 'vue-material-design-icons/Delete.vue'
88
+
89
+ import CnDetailCard from '../CnDetailCard/CnDetailCard.vue'
90
+ import CnUserActionMenu from '../CnUserActionMenu/CnUserActionMenu.vue'
91
+ import { buildHeaders } from '../../utils/index.js'
92
+
93
+ /**
94
+ * CnNotesCard — Inline notes widget for detail pages.
95
+ *
96
+ * Shows up to 5 recent notes with add/delete functionality.
97
+ * Integrates CnUserActionMenu on author names for quick communication.
98
+ *
99
+ * @example Basic usage
100
+ * <CnNotesCard
101
+ * register-id="uuid-register"
102
+ * schema-id="uuid-schema"
103
+ * object-id="uuid-object" />
104
+ *
105
+ * @example With sidebar sync
106
+ * <CnNotesCard
107
+ * register-id="reg"
108
+ * schema-id="schema"
109
+ * object-id="obj"
110
+ * @note-added="refreshNotes"
111
+ * @note-deleted="refreshNotes"
112
+ * @show-all="openSidebarNotesTab" />
113
+ */
114
+ export default {
115
+ name: 'CnNotesCard',
116
+
117
+ components: {
118
+ CnDetailCard,
119
+ CnUserActionMenu,
120
+ NcButton,
121
+ NcLoadingIcon,
122
+ Send,
123
+ Delete,
124
+ },
125
+
126
+ props: {
127
+ /** OpenRegister register ID */
128
+ registerId: {
129
+ type: String,
130
+ required: true,
131
+ },
132
+ /** OpenRegister schema ID */
133
+ schemaId: {
134
+ type: String,
135
+ required: true,
136
+ },
137
+ /** Object UUID */
138
+ objectId: {
139
+ type: String,
140
+ required: true,
141
+ },
142
+ /** Base API URL for OpenRegister */
143
+ apiBase: {
144
+ type: String,
145
+ default: '/apps/openregister/api',
146
+ },
147
+ /** Maximum number of notes to display */
148
+ maxDisplay: {
149
+ type: Number,
150
+ default: 5,
151
+ },
152
+ /** Whether the card is collapsible */
153
+ collapsible: {
154
+ type: Boolean,
155
+ default: false,
156
+ },
157
+
158
+ // --- Pre-translated labels ---
159
+ titleLabel: { type: String, default: 'Notes' },
160
+ addNoteLabel: { type: String, default: 'Add note' },
161
+ addNotePlaceholder: { type: String, default: 'Write a note...' },
162
+ noNotesLabel: { type: String, default: 'No notes yet' },
163
+ showAllLabel: { type: String, default: 'Show all' },
164
+ deleteLabel: { type: String, default: 'Delete note' },
165
+ },
166
+
167
+ emits: ['note-added', 'note-deleted', 'show-all'],
168
+
169
+ data() {
170
+ return {
171
+ CommentTextOutline,
172
+ allNotes: [],
173
+ loading: false,
174
+ newNoteText: '',
175
+ noteSaving: false,
176
+ deleteConfirmId: null,
177
+ }
178
+ },
179
+
180
+ computed: {
181
+ displayedNotes() {
182
+ // Reverse chronological, limited to maxDisplay
183
+ const sorted = [...this.allNotes].sort((a, b) => {
184
+ const dateA = new Date(a.creationDateTime || a.created || 0)
185
+ const dateB = new Date(b.creationDateTime || b.created || 0)
186
+ return dateB - dateA
187
+ })
188
+ return sorted.slice(0, this.maxDisplay)
189
+ },
190
+ },
191
+
192
+ watch: {
193
+ objectId: {
194
+ immediate: true,
195
+ handler(newId) {
196
+ if (newId && this.registerId && this.schemaId) {
197
+ this.fetchNotes()
198
+ }
199
+ },
200
+ },
201
+ },
202
+
203
+ methods: {
204
+ getNoteAuthorId(note) {
205
+ return note.actorId || note.author || ''
206
+ },
207
+
208
+ getNoteAuthorName(note) {
209
+ return note.actorDisplayName || note.author || 'Unknown'
210
+ },
211
+
212
+ isCurrentUser(note) {
213
+ const authorId = this.getNoteAuthorId(note)
214
+ const currentUser = typeof OC !== 'undefined' ? OC?.currentUser : null
215
+ return authorId === currentUser
216
+ },
217
+
218
+ canDeleteNote(note) {
219
+ return this.isCurrentUser(note)
220
+ },
221
+
222
+ async fetchNotes() {
223
+ if (!this.registerId || !this.schemaId || !this.objectId) return
224
+ this.loading = true
225
+ try {
226
+ const url = `${this.apiBase}/objects/${this.registerId}/${this.schemaId}/${this.objectId}/notes`
227
+ const response = await fetch(url, { headers: buildHeaders() })
228
+ if (response.ok) {
229
+ const data = await response.json()
230
+ this.allNotes = data.results || data || []
231
+ }
232
+ } catch (err) {
233
+ console.error('CnNotesCard: Failed to fetch notes', err)
234
+ } finally {
235
+ this.loading = false
236
+ }
237
+ },
238
+
239
+ async submitNote() {
240
+ if (!this.newNoteText.trim() || this.noteSaving) return
241
+ this.noteSaving = true
242
+ try {
243
+ const url = `${this.apiBase}/objects/${this.registerId}/${this.schemaId}/${this.objectId}/notes`
244
+ const response = await fetch(url, {
245
+ method: 'POST',
246
+ headers: buildHeaders(),
247
+ body: JSON.stringify({ message: this.newNoteText.trim() }),
248
+ })
249
+ if (response.ok) {
250
+ this.newNoteText = ''
251
+ await this.fetchNotes()
252
+ this.$emit('note-added')
253
+ } else {
254
+ this.showError('Failed to add note')
255
+ }
256
+ } catch (err) {
257
+ console.error('CnNotesCard: Failed to add note', err)
258
+ this.showError('Failed to add note')
259
+ } finally {
260
+ this.noteSaving = false
261
+ }
262
+ },
263
+
264
+ async confirmDelete(note) {
265
+ // Simple inline confirmation — delete directly
266
+ try {
267
+ const url = `${this.apiBase}/objects/${this.registerId}/${this.schemaId}/${this.objectId}/notes/${note.id}`
268
+ const response = await fetch(url, {
269
+ method: 'DELETE',
270
+ headers: buildHeaders(),
271
+ })
272
+ if (response.ok) {
273
+ this.allNotes = this.allNotes.filter(n => n.id !== note.id)
274
+ this.$emit('note-deleted')
275
+ }
276
+ } catch (err) {
277
+ console.error('CnNotesCard: Failed to delete note', err)
278
+ }
279
+ },
280
+
281
+ formatDate(dateStr) {
282
+ if (!dateStr) return ''
283
+ try {
284
+ return new Date(dateStr).toLocaleString(undefined, {
285
+ year: 'numeric',
286
+ month: 'short',
287
+ day: 'numeric',
288
+ hour: '2-digit',
289
+ minute: '2-digit',
290
+ })
291
+ } catch {
292
+ return dateStr
293
+ }
294
+ },
295
+
296
+ showError(message) {
297
+ try {
298
+ // eslint-disable-next-line n/no-missing-import
299
+ import('@nextcloud/dialogs').then(({ showError }) => {
300
+ showError(message)
301
+ })
302
+ } catch {
303
+ console.error(message)
304
+ }
305
+ },
306
+ },
307
+ }
308
+ </script>
309
+
310
+ <style scoped>
311
+ .cn-notes-card__add-form {
312
+ margin-bottom: 12px;
313
+ }
314
+
315
+ .cn-notes-card__textarea {
316
+ width: 100%;
317
+ padding: 8px;
318
+ border: 1px solid var(--color-border);
319
+ border-radius: var(--border-radius);
320
+ resize: vertical;
321
+ font-family: inherit;
322
+ font-size: 13px;
323
+ margin-bottom: 8px;
324
+ background: var(--color-main-background);
325
+ color: var(--color-main-text);
326
+ box-sizing: border-box;
327
+ }
328
+
329
+ .cn-notes-card__textarea:focus {
330
+ border-color: var(--color-primary-element);
331
+ outline: none;
332
+ }
333
+
334
+ .cn-notes-card__empty {
335
+ text-align: center;
336
+ padding: 16px 12px;
337
+ color: var(--color-text-maxcontrast);
338
+ font-size: 13px;
339
+ }
340
+
341
+ .cn-notes-card__list {
342
+ display: flex;
343
+ flex-direction: column;
344
+ }
345
+
346
+ .cn-notes-card__note {
347
+ padding: 10px 0;
348
+ border-bottom: 1px solid var(--color-border);
349
+ position: relative;
350
+ }
351
+
352
+ .cn-notes-card__note:last-child {
353
+ border-bottom: none;
354
+ }
355
+
356
+ .cn-notes-card__note-header {
357
+ display: flex;
358
+ justify-content: space-between;
359
+ align-items: baseline;
360
+ margin-bottom: 4px;
361
+ }
362
+
363
+ .cn-notes-card__author {
364
+ font-size: 13px;
365
+ }
366
+
367
+ .cn-notes-card__author--self {
368
+ color: var(--color-main-text);
369
+ }
370
+
371
+ .cn-notes-card__time {
372
+ font-size: 11px;
373
+ color: var(--color-text-maxcontrast);
374
+ flex-shrink: 0;
375
+ margin-left: 8px;
376
+ }
377
+
378
+ .cn-notes-card__body {
379
+ font-size: 13px;
380
+ margin: 0;
381
+ white-space: pre-wrap;
382
+ word-break: break-word;
383
+ padding-right: 32px;
384
+ }
385
+
386
+ .cn-notes-card__delete-btn {
387
+ position: absolute;
388
+ top: 8px;
389
+ right: -4px;
390
+ opacity: 0;
391
+ transition: opacity 0.15s ease;
392
+ }
393
+
394
+ .cn-notes-card__note:hover .cn-notes-card__delete-btn {
395
+ opacity: 1;
396
+ }
397
+
398
+ .cn-notes-card__show-all {
399
+ background: none;
400
+ border: none;
401
+ color: var(--color-primary-element);
402
+ font-size: 13px;
403
+ font-weight: 500;
404
+ cursor: pointer;
405
+ padding: 0;
406
+ width: 100%;
407
+ text-align: center;
408
+ }
409
+
410
+ .cn-notes-card__show-all:hover {
411
+ text-decoration: underline;
412
+ }
413
+ </style>
@@ -0,0 +1 @@
1
+ export { default as CnNotesCard } from './CnNotesCard.vue'
@@ -14,7 +14,7 @@
14
14
  <div class="cn-object-card__content">
15
15
  <!-- Header: image + title -->
16
16
  <div class="cn-object-card__header">
17
- <img
17
+ <img
18
18
  v-if="imageUrl"
19
19
  :src="imageUrl"
20
20
  :alt="title"
@@ -1 +1 @@
1
- export { default as CnObjectCard } from './CnObjectCard.vue'
1
+ export { default as CnObjectCard } from './CnObjectCard.vue'