@conduction/nextcloud-vue 0.1.0-beta.3 → 0.1.0-beta.4
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.
- package/README.md +226 -226
- package/dist/nextcloud-vue.cjs.js +60455 -8755
- package/dist/nextcloud-vue.cjs.js.map +1 -1
- package/dist/nextcloud-vue.css +2062 -528
- package/dist/nextcloud-vue.esm.js +60411 -8731
- package/dist/nextcloud-vue.esm.js.map +1 -1
- package/package.json +75 -62
- package/src/components/CnActionsBar/CnActionsBar.vue +235 -225
- package/src/components/CnActionsBar/index.js +1 -1
- package/src/components/CnAdvancedFormDialog/CnAdvancedFormDialog.vue +579 -0
- package/src/components/CnAdvancedFormDialog/CnDataTab.vue +217 -0
- package/src/components/CnAdvancedFormDialog/CnMetadataTab.vue +121 -0
- package/src/components/CnAdvancedFormDialog/CnPropertiesTab.vue +418 -0
- package/src/components/CnAdvancedFormDialog/CnPropertyValueCell.vue +247 -0
- package/src/components/CnAdvancedFormDialog/index.js +1 -0
- package/src/components/CnCardGrid/CnCardGrid.vue +152 -152
- package/src/components/CnCardGrid/index.js +1 -1
- package/src/components/CnCellRenderer/CnCellRenderer.vue +132 -132
- package/src/components/CnCellRenderer/index.js +1 -1
- package/src/components/CnChartWidget/CnChartWidget.vue +320 -0
- package/src/components/CnChartWidget/index.js +1 -0
- package/src/components/CnConfigurationCard/CnConfigurationCard.vue +77 -77
- package/src/components/CnConfigurationCard/index.js +1 -1
- package/src/components/CnDashboardGrid/CnDashboardGrid.vue +225 -0
- package/src/components/CnDashboardGrid/index.js +1 -0
- package/src/components/CnDashboardPage/CnDashboardPage.vue +390 -0
- package/src/components/CnDashboardPage/index.js +1 -0
- package/src/components/CnDataTable/CnDataTable.vue +349 -349
- package/src/components/CnDataTable/index.js +1 -1
- package/src/components/CnDetailCard/CnDetailCard.vue +214 -0
- package/src/components/CnDetailCard/index.js +1 -0
- package/src/components/CnDetailPage/CnDetailPage.vue +281 -0
- package/src/components/CnDetailPage/index.js +1 -0
- package/src/components/CnFacetSidebar/CnFacetSidebar.vue +231 -223
- package/src/components/CnFacetSidebar/index.js +1 -1
- package/src/components/CnFilterBar/CnFilterBar.vue +152 -152
- package/src/components/CnFilterBar/index.js +1 -1
- package/src/components/CnIcon/CnIcon.vue +89 -89
- package/src/components/CnIcon/index.js +1 -1
- package/src/components/CnIndexPage/CnIndexPage.vue +874 -816
- package/src/components/CnIndexPage/index.js +1 -1
- package/src/components/CnIndexSidebar/CnIndexSidebar.vue +503 -484
- package/src/components/CnIndexSidebar/index.js +1 -1
- package/src/components/CnItemCard/CnItemCard.vue +132 -0
- package/src/components/CnItemCard/index.js +1 -0
- package/src/components/CnKpiGrid/CnKpiGrid.vue +89 -89
- package/src/components/CnKpiGrid/index.js +1 -1
- package/src/components/CnMassActionBar/CnMassActionBar.vue +160 -160
- package/src/components/CnMassActionBar/index.js +1 -1
- package/src/components/CnMassCopyDialog/CnMassCopyDialog.vue +320 -320
- package/src/components/CnMassCopyDialog/index.js +1 -1
- package/src/components/CnMassDeleteDialog/CnMassDeleteDialog.vue +238 -238
- package/src/components/CnMassDeleteDialog/index.js +1 -1
- package/src/components/CnMassExportDialog/CnMassExportDialog.vue +190 -190
- package/src/components/CnMassExportDialog/index.js +1 -1
- package/src/components/CnMassImportDialog/CnMassImportDialog.vue +491 -491
- package/src/components/CnMassImportDialog/index.js +1 -1
- package/src/components/CnNoteCard/CnNoteCard.vue +149 -0
- package/src/components/CnNoteCard/index.js +1 -0
- package/src/components/CnNotesCard/CnNotesCard.vue +413 -0
- package/src/components/CnNotesCard/index.js +1 -0
- package/src/components/CnObjectCard/CnObjectCard.vue +292 -292
- package/src/components/CnObjectCard/index.js +1 -1
- package/src/components/CnObjectSidebar/CnObjectSidebar.vue +876 -0
- package/src/components/CnObjectSidebar/index.js +1 -0
- package/src/components/CnPageHeader/CnPageHeader.vue +57 -57
- package/src/components/CnPageHeader/index.js +1 -1
- package/src/components/CnPagination/CnPagination.vue +252 -252
- package/src/components/CnPagination/index.js +1 -1
- package/src/components/CnRowActions/CnRowActions.vue +73 -73
- package/src/components/CnRowActions/index.js +1 -1
- package/src/components/CnSchemaFormDialog/CnSchemaConfigurationTab.vue +226 -0
- package/src/components/CnSchemaFormDialog/CnSchemaFormDialog.vue +787 -0
- package/src/components/CnSchemaFormDialog/CnSchemaPropertiesTab.vue +305 -0
- package/src/components/CnSchemaFormDialog/CnSchemaPropertyActions.vue +1398 -0
- package/src/components/CnSchemaFormDialog/CnSchemaSecurityTab.vue +236 -0
- package/src/components/CnSchemaFormDialog/index.js +1 -0
- package/src/components/CnSettingsCard/CnSettingsCard.vue +92 -92
- package/src/components/CnSettingsCard/index.js +1 -1
- package/src/components/CnSettingsSection/CnSettingsSection.vue +266 -266
- package/src/components/CnSettingsSection/index.js +1 -1
- package/src/components/CnStatsBlock/CnStatsBlock.vue +420 -366
- package/src/components/CnStatsBlock/index.js +1 -1
- package/src/components/CnStatusBadge/CnStatusBadge.vue +77 -77
- package/src/components/CnStatusBadge/index.js +1 -1
- package/src/components/CnTabbedFormDialog/CnTabbedFormDialog.vue +540 -0
- package/src/components/CnTabbedFormDialog/index.js +1 -0
- package/src/components/CnTasksCard/CnTasksCard.vue +373 -0
- package/src/components/CnTasksCard/index.js +1 -0
- package/src/components/CnTileWidget/CnTileWidget.vue +159 -0
- package/src/components/CnTileWidget/index.js +1 -0
- package/src/components/CnTimelineStages/CnTimelineStages.vue +292 -0
- package/src/components/CnTimelineStages/index.js +1 -0
- package/src/components/CnUserActionMenu/CnUserActionMenu.vue +435 -0
- package/src/components/CnUserActionMenu/index.js +1 -0
- package/src/components/CnVersionInfoCard/CnVersionInfoCard.vue +312 -312
- package/src/components/CnVersionInfoCard/index.js +1 -1
- package/src/components/CnWidgetRenderer/CnWidgetRenderer.vue +180 -0
- package/src/components/CnWidgetRenderer/index.js +1 -0
- package/src/components/CnWidgetWrapper/CnWidgetWrapper.vue +211 -0
- package/src/components/CnWidgetWrapper/index.js +1 -0
- package/src/components/index.js +43 -29
- package/src/composables/index.js +4 -3
- package/src/composables/useDashboardView.js +240 -0
- package/src/composables/useDetailView.js +289 -132
- package/src/composables/useListView.js +363 -362
- package/src/composables/useSubResource.js +142 -142
- package/src/constants/metadata.js +30 -30
- package/src/css/CnSchemaFormDialog.css +546 -0
- package/src/css/__sample_nextcloud_tokens.css +110 -0
- package/src/css/actions-bar.css +48 -48
- package/src/css/badge.css +51 -51
- package/src/css/card.css +128 -128
- package/src/css/dashboard.css +70 -0
- package/src/css/detail-page.css +168 -0
- package/src/css/detail.css +68 -68
- package/src/css/index-page.css +44 -32
- package/src/css/index-sidebar.css +193 -187
- package/src/css/index.css +16 -12
- package/src/css/layout.css +90 -90
- package/src/css/page-header.css +33 -33
- package/src/css/pagination.css +72 -72
- package/src/css/table.css +142 -142
- package/src/css/timeline-stages.css +218 -0
- package/src/css/utilities.css +46 -46
- package/src/index.js +72 -53
- package/src/store/createSubResourcePlugin.js +135 -135
- package/src/store/index.js +3 -3
- package/src/store/plugins/auditTrails.js +17 -17
- package/src/store/plugins/files.js +250 -186
- package/src/store/plugins/index.js +7 -5
- package/src/store/plugins/lifecycle.js +180 -180
- package/src/store/plugins/relations.js +68 -68
- package/src/store/plugins/search.js +372 -0
- package/src/store/plugins/selection.js +104 -0
- package/src/store/useObjectStore.js +829 -686
- package/src/types/auditTrail.d.ts +32 -32
- package/src/types/file.d.ts +23 -23
- package/src/types/index.d.ts +35 -35
- package/src/types/notification.d.ts +36 -36
- package/src/types/object.d.ts +40 -40
- package/src/types/organisation.d.ts +41 -41
- package/src/types/register.d.ts +25 -25
- package/src/types/schema.d.ts +39 -39
- package/src/types/shared.d.ts +79 -79
- package/src/types/source.d.ts +14 -14
- package/src/types/task.d.ts +31 -31
- package/src/utils/errors.js +96 -96
- package/src/utils/headers.js +68 -50
- package/src/utils/id.js +13 -0
- package/src/utils/index.js +3 -3
- package/src/utils/schema.js +422 -419
|
@@ -1,484 +1,503 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<NcAppSidebar
|
|
3
|
-
:name="resolvedName"
|
|
4
|
-
:title="resolvedName"
|
|
5
|
-
:subname="resolvedSubname"
|
|
6
|
-
:open.sync="internalOpen"
|
|
7
|
-
:active="internalActiveTab"
|
|
8
|
-
:compact="!!resolvedIcon"
|
|
9
|
-
@close="$emit('update:open', false)"
|
|
10
|
-
@update:active="onTabChange">
|
|
11
|
-
<!-- Schema icon in sidebar header -->
|
|
12
|
-
<template v-if="resolvedIcon" #header>
|
|
13
|
-
<div class="cn-index-sidebar__header-icon">
|
|
14
|
-
<CnIcon :name="resolvedIcon" :size="32" />
|
|
15
|
-
</div>
|
|
16
|
-
</template>
|
|
17
|
-
|
|
18
|
-
<!-- Search Tab -->
|
|
19
|
-
<NcAppSidebarTab
|
|
20
|
-
id="search-tab"
|
|
21
|
-
:name="searchTabLabel"
|
|
22
|
-
:order="1">
|
|
23
|
-
<template #icon>
|
|
24
|
-
<Magnify :size="20" />
|
|
25
|
-
</template>
|
|
26
|
-
|
|
27
|
-
<div class="cn-index-
|
|
28
|
-
<
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
<
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
import {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
*
|
|
175
|
-
*
|
|
176
|
-
*
|
|
177
|
-
*
|
|
178
|
-
*
|
|
179
|
-
*
|
|
180
|
-
*
|
|
181
|
-
*
|
|
182
|
-
*
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
schema
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
if (this.
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
return
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
},
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
this
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
}
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<NcAppSidebar
|
|
3
|
+
:name="resolvedName"
|
|
4
|
+
:title="resolvedName"
|
|
5
|
+
:subname="resolvedSubname"
|
|
6
|
+
:open.sync="internalOpen"
|
|
7
|
+
:active="internalActiveTab"
|
|
8
|
+
:compact="!!resolvedIcon"
|
|
9
|
+
@close="$emit('update:open', false)"
|
|
10
|
+
@update:active="onTabChange">
|
|
11
|
+
<!-- Schema icon in sidebar header -->
|
|
12
|
+
<template v-if="resolvedIcon" #header>
|
|
13
|
+
<div class="cn-index-sidebar__header-icon">
|
|
14
|
+
<CnIcon :name="resolvedIcon" :size="32" />
|
|
15
|
+
</div>
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
<!-- Search Tab -->
|
|
19
|
+
<NcAppSidebarTab
|
|
20
|
+
id="search-tab"
|
|
21
|
+
:name="searchTabLabel"
|
|
22
|
+
:order="1">
|
|
23
|
+
<template #icon>
|
|
24
|
+
<Magnify :size="20" />
|
|
25
|
+
</template>
|
|
26
|
+
|
|
27
|
+
<div class="cn-index-sidebar__tab-content">
|
|
28
|
+
<div v-if="$slots['search-above']" class="cn-index-sidebar__section">
|
|
29
|
+
<slot name="search-above" />
|
|
30
|
+
</div>
|
|
31
|
+
|
|
32
|
+
<div class="cn-index-sidebar__section">
|
|
33
|
+
<h3>{{ searchLabel }}</h3>
|
|
34
|
+
<NcTextField
|
|
35
|
+
:value="searchValue"
|
|
36
|
+
:placeholder="searchPlaceholder"
|
|
37
|
+
:label="searchLabel"
|
|
38
|
+
@update:value="$emit('search', $event)" />
|
|
39
|
+
</div>
|
|
40
|
+
|
|
41
|
+
<div v-if="schemaFilters.length > 0" class="cn-index-sidebar__section">
|
|
42
|
+
<h3>{{ filtersLabel }}</h3>
|
|
43
|
+
<div
|
|
44
|
+
v-for="filter in schemaFilters"
|
|
45
|
+
:key="filter.key"
|
|
46
|
+
class="cn-index-sidebar__filter-group">
|
|
47
|
+
<div class="cn-index-sidebar__filter-header">
|
|
48
|
+
<span class="cn-index-sidebar__filter-label">{{ filter.label }}</span>
|
|
49
|
+
<NcPopover v-if="filter.description" popup-role="dialog">
|
|
50
|
+
<template #trigger>
|
|
51
|
+
<NcButton
|
|
52
|
+
type="tertiary-no-background"
|
|
53
|
+
:aria-label="filter.label + ' info'"
|
|
54
|
+
class="cn-index-sidebar__info-btn">
|
|
55
|
+
<template #icon>
|
|
56
|
+
<InformationOutline :size="16" />
|
|
57
|
+
</template>
|
|
58
|
+
</NcButton>
|
|
59
|
+
</template>
|
|
60
|
+
<p class="cn-index-sidebar__filter-description">{{ filter.description }}</p>
|
|
61
|
+
</NcPopover>
|
|
62
|
+
</div>
|
|
63
|
+
<NcSelect
|
|
64
|
+
class="cn-index-sidebar__select"
|
|
65
|
+
:value="getSelectedFilterOptions(filter)"
|
|
66
|
+
:options="getFilterOptions(filter)"
|
|
67
|
+
placeholder="Select..."
|
|
68
|
+
:input-label="filter.label"
|
|
69
|
+
:multiple="true"
|
|
70
|
+
:clearable="true"
|
|
71
|
+
@input="onFilterChange(filter.key, $event)" />
|
|
72
|
+
</div>
|
|
73
|
+
</div>
|
|
74
|
+
|
|
75
|
+
<slot name="search-extra" />
|
|
76
|
+
</div>
|
|
77
|
+
</NcAppSidebarTab>
|
|
78
|
+
|
|
79
|
+
<!-- Columns Tab -->
|
|
80
|
+
<NcAppSidebarTab
|
|
81
|
+
id="columns-tab"
|
|
82
|
+
:name="columnsTabLabel"
|
|
83
|
+
:order="2">
|
|
84
|
+
<template #icon>
|
|
85
|
+
<FormatColumns :size="20" />
|
|
86
|
+
</template>
|
|
87
|
+
|
|
88
|
+
<div class="cn-index-sidebar__tab-content">
|
|
89
|
+
<div class="cn-sidebar-columns">
|
|
90
|
+
<h3>{{ columnsHeading }}</h3>
|
|
91
|
+
<p class="cn-sidebar-columns__description">{{ columnsDescription }}</p>
|
|
92
|
+
|
|
93
|
+
<template v-if="allColumns.length > 0 || allGroups.length > 0">
|
|
94
|
+
<!-- Schema properties group (collapsible) -->
|
|
95
|
+
<div v-if="allColumns.length > 0" class="cn-sidebar-columns__group cn-sidebar-columns__group--collapsible">
|
|
96
|
+
<div class="cn-sidebar-columns__group-header" @click="propertiesExpanded = !propertiesExpanded">
|
|
97
|
+
<ChevronDown v-if="propertiesExpanded" :size="20" />
|
|
98
|
+
<ChevronRight v-else :size="20" />
|
|
99
|
+
<h4>{{ resolvedPropertiesLabel }}</h4>
|
|
100
|
+
<NcCheckboxRadioSwitch
|
|
101
|
+
:checked="isGroupAllVisible(allColumns)"
|
|
102
|
+
class="cn-sidebar-columns__select-all"
|
|
103
|
+
@click.native.stop
|
|
104
|
+
@update:checked="toggleGroupAll(allColumns)">
|
|
105
|
+
All
|
|
106
|
+
</NcCheckboxRadioSwitch>
|
|
107
|
+
</div>
|
|
108
|
+
<div v-if="propertiesExpanded" class="cn-sidebar-columns__group-content">
|
|
109
|
+
<NcCheckboxRadioSwitch
|
|
110
|
+
v-for="col in allColumns"
|
|
111
|
+
:key="col.key"
|
|
112
|
+
:checked="isColumnVisible(col.key)"
|
|
113
|
+
@update:checked="toggleColumn(col.key)">
|
|
114
|
+
{{ col.label }}
|
|
115
|
+
</NcCheckboxRadioSwitch>
|
|
116
|
+
</div>
|
|
117
|
+
</div>
|
|
118
|
+
|
|
119
|
+
<!-- Extra column groups (built-in Metadata + external) -->
|
|
120
|
+
<div
|
|
121
|
+
v-for="group in allGroups"
|
|
122
|
+
:key="group.id"
|
|
123
|
+
class="cn-sidebar-columns__group cn-sidebar-columns__group--collapsible">
|
|
124
|
+
<div class="cn-sidebar-columns__group-header" @click="toggleGroup(group.id)">
|
|
125
|
+
<ChevronDown v-if="expandedGroups[group.id]" :size="20" />
|
|
126
|
+
<ChevronRight v-else :size="20" />
|
|
127
|
+
<h4>{{ group.label }}</h4>
|
|
128
|
+
<NcCheckboxRadioSwitch
|
|
129
|
+
:checked="isGroupAllVisible(group.columns)"
|
|
130
|
+
class="cn-sidebar-columns__select-all"
|
|
131
|
+
@click.native.stop
|
|
132
|
+
@update:checked="toggleGroupAll(group.columns)">
|
|
133
|
+
All
|
|
134
|
+
</NcCheckboxRadioSwitch>
|
|
135
|
+
</div>
|
|
136
|
+
<div v-if="expandedGroups[group.id]" class="cn-sidebar-columns__group-content">
|
|
137
|
+
<NcCheckboxRadioSwitch
|
|
138
|
+
v-for="col in group.columns"
|
|
139
|
+
:key="col.key"
|
|
140
|
+
:checked="isColumnVisible(col.key)"
|
|
141
|
+
@update:checked="toggleColumn(col.key)">
|
|
142
|
+
{{ col.label }}
|
|
143
|
+
</NcCheckboxRadioSwitch>
|
|
144
|
+
</div>
|
|
145
|
+
</div>
|
|
146
|
+
</template>
|
|
147
|
+
|
|
148
|
+
<p v-else class="cn-sidebar-columns__empty">
|
|
149
|
+
No columns available. Provide a schema to auto-generate columns.
|
|
150
|
+
</p>
|
|
151
|
+
</div>
|
|
152
|
+
|
|
153
|
+
<slot name="columns-extra" />
|
|
154
|
+
</div>
|
|
155
|
+
</NcAppSidebarTab>
|
|
156
|
+
|
|
157
|
+
<!-- Extra tabs injected by the consumer -->
|
|
158
|
+
<slot name="tabs" />
|
|
159
|
+
</NcAppSidebar>
|
|
160
|
+
</template>
|
|
161
|
+
|
|
162
|
+
<script>
|
|
163
|
+
import { NcAppSidebar, NcAppSidebarTab, NcTextField, NcSelect, NcCheckboxRadioSwitch, NcPopover, NcButton } from '@nextcloud/vue'
|
|
164
|
+
import Magnify from 'vue-material-design-icons/Magnify.vue'
|
|
165
|
+
import FormatColumns from 'vue-material-design-icons/FormatColumns.vue'
|
|
166
|
+
import ChevronDown from 'vue-material-design-icons/ChevronDown.vue'
|
|
167
|
+
import ChevronRight from 'vue-material-design-icons/ChevronRight.vue'
|
|
168
|
+
import InformationOutline from 'vue-material-design-icons/InformationOutline.vue'
|
|
169
|
+
import { CnIcon } from '../CnIcon/index.js'
|
|
170
|
+
import { columnsFromSchema, filtersFromSchema } from '../../utils/schema.js'
|
|
171
|
+
import { METADATA_COLUMNS } from '../../constants/metadata.js'
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* CnIndexSidebar — Reusable NcAppSidebar wrapper with Search + Columns tabs.
|
|
175
|
+
*
|
|
176
|
+
* Designed to be schema-driven: pass a schema and the sidebar auto-generates
|
|
177
|
+
* search filters, column visibility controls, and the standard Metadata group.
|
|
178
|
+
* Title and properties group label are derived from schema.title by default.
|
|
179
|
+
*
|
|
180
|
+
* Must be rendered at the App.vue level as a sibling of NcAppContent.
|
|
181
|
+
* Use provide/inject to connect it to page components.
|
|
182
|
+
*
|
|
183
|
+
* @example
|
|
184
|
+
* <!-- Minimal usage — schema drives everything -->
|
|
185
|
+
* <CnIndexSidebar
|
|
186
|
+
* :schema="schema"
|
|
187
|
+
* :visible-columns="visibleCols"
|
|
188
|
+
* :search-value="search"
|
|
189
|
+
* @search="onSearch"
|
|
190
|
+
* @columns-change="onColumnsChange" />
|
|
191
|
+
*
|
|
192
|
+
* @slot search-above - Content rendered above the search field in the Search tab (e.g. hints, quick actions).
|
|
193
|
+
* @slot search-extra - Content rendered below the search field and filters in the Search tab (e.g. saved searches).
|
|
194
|
+
*/
|
|
195
|
+
export default {
|
|
196
|
+
name: 'CnIndexSidebar',
|
|
197
|
+
|
|
198
|
+
components: {
|
|
199
|
+
NcAppSidebar,
|
|
200
|
+
NcAppSidebarTab,
|
|
201
|
+
NcTextField,
|
|
202
|
+
NcSelect,
|
|
203
|
+
NcCheckboxRadioSwitch,
|
|
204
|
+
NcPopover,
|
|
205
|
+
NcButton,
|
|
206
|
+
CnIcon,
|
|
207
|
+
Magnify,
|
|
208
|
+
FormatColumns,
|
|
209
|
+
ChevronDown,
|
|
210
|
+
ChevronRight,
|
|
211
|
+
InformationOutline,
|
|
212
|
+
},
|
|
213
|
+
|
|
214
|
+
props: {
|
|
215
|
+
/** Sidebar title. Defaults to schema.title when not set. */
|
|
216
|
+
title: {
|
|
217
|
+
type: String,
|
|
218
|
+
default: '',
|
|
219
|
+
},
|
|
220
|
+
/** MDI icon name or emoji. Defaults to schema.icon when not set. */
|
|
221
|
+
icon: {
|
|
222
|
+
type: String,
|
|
223
|
+
default: '',
|
|
224
|
+
},
|
|
225
|
+
/** Schema object for auto-generating filters, columns, and labels */
|
|
226
|
+
schema: {
|
|
227
|
+
type: Object,
|
|
228
|
+
default: null,
|
|
229
|
+
},
|
|
230
|
+
/** Array of currently visible column keys */
|
|
231
|
+
visibleColumns: {
|
|
232
|
+
type: Array,
|
|
233
|
+
default: null,
|
|
234
|
+
},
|
|
235
|
+
/** Current search term */
|
|
236
|
+
searchValue: {
|
|
237
|
+
type: String,
|
|
238
|
+
default: '',
|
|
239
|
+
},
|
|
240
|
+
/** Whether sidebar is open */
|
|
241
|
+
open: {
|
|
242
|
+
type: Boolean,
|
|
243
|
+
default: true,
|
|
244
|
+
},
|
|
245
|
+
/** Current active facet filters: { fieldName: [values] } */
|
|
246
|
+
activeFilters: {
|
|
247
|
+
type: Object,
|
|
248
|
+
default: () => ({}),
|
|
249
|
+
},
|
|
250
|
+
/** Live facet data from API: { fieldName: { values: [{value, count}] } } */
|
|
251
|
+
facetData: {
|
|
252
|
+
type: Object,
|
|
253
|
+
default: () => ({}),
|
|
254
|
+
},
|
|
255
|
+
/**
|
|
256
|
+
* Additional column groups beyond schema properties and the built-in Metadata.
|
|
257
|
+
* Each group: { id: string, label: string, columns: Array<{key, label}>, expanded?: boolean }
|
|
258
|
+
*/
|
|
259
|
+
columnGroups: {
|
|
260
|
+
type: Array,
|
|
261
|
+
default: () => [],
|
|
262
|
+
},
|
|
263
|
+
/** Whether to include the built-in Metadata column group */
|
|
264
|
+
showMetadata: {
|
|
265
|
+
type: Boolean,
|
|
266
|
+
default: true,
|
|
267
|
+
},
|
|
268
|
+
/** Search input placeholder */
|
|
269
|
+
searchPlaceholder: {
|
|
270
|
+
type: String,
|
|
271
|
+
default: 'Type to search...',
|
|
272
|
+
},
|
|
273
|
+
/** Search tab label */
|
|
274
|
+
searchTabLabel: {
|
|
275
|
+
type: String,
|
|
276
|
+
default: 'Search',
|
|
277
|
+
},
|
|
278
|
+
/** Columns tab label */
|
|
279
|
+
columnsTabLabel: {
|
|
280
|
+
type: String,
|
|
281
|
+
default: 'Columns',
|
|
282
|
+
},
|
|
283
|
+
/** Search section heading */
|
|
284
|
+
searchLabel: {
|
|
285
|
+
type: String,
|
|
286
|
+
default: 'Search',
|
|
287
|
+
},
|
|
288
|
+
/** Filters section heading */
|
|
289
|
+
filtersLabel: {
|
|
290
|
+
type: String,
|
|
291
|
+
default: 'Filters',
|
|
292
|
+
},
|
|
293
|
+
/** Columns section heading */
|
|
294
|
+
columnsHeading: {
|
|
295
|
+
type: String,
|
|
296
|
+
default: 'Column Visibility',
|
|
297
|
+
},
|
|
298
|
+
/** Columns section description */
|
|
299
|
+
columnsDescription: {
|
|
300
|
+
type: String,
|
|
301
|
+
default: 'Select which columns to display in the table',
|
|
302
|
+
},
|
|
303
|
+
/** Override label for the schema properties group. Defaults to schema.title. */
|
|
304
|
+
propertiesGroupLabel: {
|
|
305
|
+
type: String,
|
|
306
|
+
default: '',
|
|
307
|
+
},
|
|
308
|
+
/**
|
|
309
|
+
* ID of the tab that should be active when the sidebar opens.
|
|
310
|
+
* Built-in IDs are 'search-tab' and 'columns-tab'.
|
|
311
|
+
* Use the id you set on your custom NcAppSidebarTab for custom tabs.
|
|
312
|
+
*/
|
|
313
|
+
defaultTab: {
|
|
314
|
+
type: String,
|
|
315
|
+
default: 'search-tab',
|
|
316
|
+
},
|
|
317
|
+
/**
|
|
318
|
+
* Whether the current user is an admin.
|
|
319
|
+
* When false, schema properties with `adminOnly: true` are hidden from filters.
|
|
320
|
+
*/
|
|
321
|
+
userIsAdmin: {
|
|
322
|
+
type: Boolean,
|
|
323
|
+
default: true,
|
|
324
|
+
},
|
|
325
|
+
},
|
|
326
|
+
|
|
327
|
+
data() {
|
|
328
|
+
return {
|
|
329
|
+
internalOpen: this.open,
|
|
330
|
+
internalActiveTab: this.defaultTab,
|
|
331
|
+
propertiesExpanded: true,
|
|
332
|
+
expandedGroups: {},
|
|
333
|
+
}
|
|
334
|
+
},
|
|
335
|
+
|
|
336
|
+
computed: {
|
|
337
|
+
/** Resolved icon — explicit prop overrides schema.icon */
|
|
338
|
+
resolvedIcon() {
|
|
339
|
+
return this.icon || this.schema?.icon || ''
|
|
340
|
+
},
|
|
341
|
+
|
|
342
|
+
/** Sidebar name — schema title, shown as the h2 header */
|
|
343
|
+
resolvedName() {
|
|
344
|
+
if (this.title) return this.title
|
|
345
|
+
return this.schema?.title || 'Search'
|
|
346
|
+
},
|
|
347
|
+
|
|
348
|
+
/** Sidebar subname — schema description, shown below the name */
|
|
349
|
+
resolvedSubname() {
|
|
350
|
+
return this.schema?.description || ''
|
|
351
|
+
},
|
|
352
|
+
|
|
353
|
+
/** Properties group label — derived from schema.title if not explicitly set */
|
|
354
|
+
resolvedPropertiesLabel() {
|
|
355
|
+
if (this.propertiesGroupLabel) return this.propertiesGroupLabel
|
|
356
|
+
return this.schema?.title || 'Properties'
|
|
357
|
+
},
|
|
358
|
+
|
|
359
|
+
/** All available columns from schema */
|
|
360
|
+
allColumns() {
|
|
361
|
+
if (!this.schema) return []
|
|
362
|
+
return columnsFromSchema(this.schema, {})
|
|
363
|
+
},
|
|
364
|
+
|
|
365
|
+
/** Filter definitions from schema (facetable properties, respecting RBAC) */
|
|
366
|
+
schemaFilters() {
|
|
367
|
+
if (!this.schema) return []
|
|
368
|
+
return filtersFromSchema(this.schema, { isAdmin: this.userIsAdmin })
|
|
369
|
+
},
|
|
370
|
+
|
|
371
|
+
/** Combined column groups: built-in Metadata + external groups */
|
|
372
|
+
allGroups() {
|
|
373
|
+
const groups = []
|
|
374
|
+
if (this.showMetadata && this.schema) {
|
|
375
|
+
groups.push({
|
|
376
|
+
id: 'metadata',
|
|
377
|
+
label: 'Metadata',
|
|
378
|
+
columns: METADATA_COLUMNS,
|
|
379
|
+
expanded: true,
|
|
380
|
+
})
|
|
381
|
+
}
|
|
382
|
+
return [...groups, ...this.columnGroups]
|
|
383
|
+
},
|
|
384
|
+
|
|
385
|
+
/** All column keys across schema properties and all groups */
|
|
386
|
+
allColumnKeys() {
|
|
387
|
+
return [
|
|
388
|
+
...this.allColumns.map((c) => c.key),
|
|
389
|
+
...this.allGroups.flatMap((g) => g.columns.map((c) => c.key)),
|
|
390
|
+
]
|
|
391
|
+
},
|
|
392
|
+
},
|
|
393
|
+
|
|
394
|
+
watch: {
|
|
395
|
+
open(val) {
|
|
396
|
+
this.internalOpen = val
|
|
397
|
+
},
|
|
398
|
+
internalOpen(val) {
|
|
399
|
+
this.$emit('update:open', val)
|
|
400
|
+
},
|
|
401
|
+
defaultTab(val) {
|
|
402
|
+
this.internalActiveTab = val
|
|
403
|
+
},
|
|
404
|
+
allGroups: {
|
|
405
|
+
immediate: true,
|
|
406
|
+
handler(groups) {
|
|
407
|
+
for (const group of groups) {
|
|
408
|
+
if (!(group.id in this.expandedGroups)) {
|
|
409
|
+
this.$set(this.expandedGroups, group.id, group.expanded !== false)
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
},
|
|
413
|
+
},
|
|
414
|
+
},
|
|
415
|
+
|
|
416
|
+
methods: {
|
|
417
|
+
/** Handle tab change from NcAppSidebar */
|
|
418
|
+
onTabChange(tabId) {
|
|
419
|
+
this.internalActiveTab = tabId
|
|
420
|
+
this.$emit('tab-change', tabId)
|
|
421
|
+
},
|
|
422
|
+
|
|
423
|
+
/** Check if a column is currently visible */
|
|
424
|
+
isColumnVisible(key) {
|
|
425
|
+
if (this.visibleColumns === null) return true
|
|
426
|
+
return this.visibleColumns.includes(key)
|
|
427
|
+
},
|
|
428
|
+
|
|
429
|
+
/** Check if all columns in a group are visible */
|
|
430
|
+
isGroupAllVisible(columns) {
|
|
431
|
+
return columns.every((col) => this.isColumnVisible(col.key))
|
|
432
|
+
},
|
|
433
|
+
|
|
434
|
+
/** Toggle a single column's visibility */
|
|
435
|
+
toggleColumn(key) {
|
|
436
|
+
let newVisible
|
|
437
|
+
if (this.visibleColumns === null) {
|
|
438
|
+
newVisible = this.allColumnKeys.filter((k) => k !== key)
|
|
439
|
+
} else if (this.isColumnVisible(key)) {
|
|
440
|
+
newVisible = this.visibleColumns.filter((k) => k !== key)
|
|
441
|
+
} else {
|
|
442
|
+
newVisible = [...this.visibleColumns, key]
|
|
443
|
+
}
|
|
444
|
+
this.$emit('columns-change', newVisible)
|
|
445
|
+
},
|
|
446
|
+
|
|
447
|
+
/** Select or deselect all columns in a group */
|
|
448
|
+
toggleGroupAll(columns) {
|
|
449
|
+
const groupKeys = columns.map((c) => c.key)
|
|
450
|
+
const allVisible = this.isGroupAllVisible(columns)
|
|
451
|
+
|
|
452
|
+
let newVisible
|
|
453
|
+
if (this.visibleColumns === null) {
|
|
454
|
+
// Currently all visible — deselect this group
|
|
455
|
+
newVisible = this.allColumnKeys.filter((k) => !groupKeys.includes(k))
|
|
456
|
+
} else if (allVisible) {
|
|
457
|
+
// All in group visible — deselect them
|
|
458
|
+
newVisible = this.visibleColumns.filter((k) => !groupKeys.includes(k))
|
|
459
|
+
} else {
|
|
460
|
+
// Not all visible — select them all
|
|
461
|
+
const current = new Set(this.visibleColumns)
|
|
462
|
+
groupKeys.forEach((k) => current.add(k))
|
|
463
|
+
newVisible = [...current]
|
|
464
|
+
}
|
|
465
|
+
this.$emit('columns-change', newVisible)
|
|
466
|
+
},
|
|
467
|
+
|
|
468
|
+
/** Toggle a group's expanded state */
|
|
469
|
+
toggleGroup(groupId) {
|
|
470
|
+
this.$set(this.expandedGroups, groupId, !this.expandedGroups[groupId])
|
|
471
|
+
},
|
|
472
|
+
|
|
473
|
+
/** Get filter options for a filter definition */
|
|
474
|
+
getFilterOptions(filter) {
|
|
475
|
+
const facet = this.facetData[filter.key]
|
|
476
|
+
if (facet?.values?.length > 0) {
|
|
477
|
+
return facet.values.map((v) => ({
|
|
478
|
+
id: v.value,
|
|
479
|
+
label: v.count !== undefined ? `${v.value} (${v.count})` : String(v.value),
|
|
480
|
+
}))
|
|
481
|
+
}
|
|
482
|
+
return filter.options || []
|
|
483
|
+
},
|
|
484
|
+
|
|
485
|
+
/** Get currently selected options for a filter */
|
|
486
|
+
getSelectedFilterOptions(filter) {
|
|
487
|
+
const value = this.activeFilters[filter.key]
|
|
488
|
+
if (!value) return []
|
|
489
|
+
const values = Array.isArray(value) ? value : [value]
|
|
490
|
+
const options = this.getFilterOptions(filter)
|
|
491
|
+
return values.map((v) => options.find((o) => o.id === v) || { id: v, label: String(v) })
|
|
492
|
+
},
|
|
493
|
+
|
|
494
|
+
/** Handle filter select change */
|
|
495
|
+
onFilterChange(key, selected) {
|
|
496
|
+
const values = selected ? selected.map((o) => o.id) : []
|
|
497
|
+
this.$emit('filter-change', { key, values })
|
|
498
|
+
},
|
|
499
|
+
},
|
|
500
|
+
}
|
|
501
|
+
</script>
|
|
502
|
+
|
|
503
|
+
<!-- Styles in css/index-sidebar.css -->
|