@conduction/nextcloud-vue 2.106.0 → 2.107.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.
- package/dist/esm/components/CnActionDialog/CnActionDialog.vue.js +9 -0
- package/dist/esm/components/CnActionDialog/CnActionDialog.vue.js.map +1 -0
- package/dist/esm/components/CnActionDialog/CnActionDialog.vue2.js +338 -0
- package/dist/esm/components/CnActionDialog/CnActionDialog.vue2.js.map +1 -0
- package/dist/esm/components/CnActionDialog/CnActionDialog.vue3.js +249 -0
- package/dist/esm/components/CnActionDialog/CnActionDialog.vue3.js.map +1 -0
- package/dist/esm/components/CnAdvancedFormDialog/CnPropertiesTab.vue2.js +2 -2
- package/dist/esm/components/CnAdvancedFormDialog/CnPropertiesTab.vue2.js.map +1 -1
- package/dist/esm/components/CnAppNav/CnAppNav.vue2.js.map +1 -1
- package/dist/esm/components/CnAppNav/CnAppNav.vue3.js +145 -138
- package/dist/esm/components/CnAppNav/CnAppNav.vue3.js.map +1 -1
- package/dist/esm/components/CnAppRoot/CnAppRoot.vue2.js +102 -2
- package/dist/esm/components/CnAppRoot/CnAppRoot.vue2.js.map +1 -1
- package/dist/esm/components/CnAppRoot/CnAppRoot.vue3.js.map +1 -1
- package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue.js +1 -1
- package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue2.js +83 -6
- package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue2.js.map +1 -1
- package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue3.js +4 -2
- package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue3.js.map +1 -1
- package/dist/esm/components/CnIcon/semanticIcons.js +2 -2
- package/dist/esm/components/CnIcon/semanticIcons.js.map +1 -1
- package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js +389 -20
- package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js.map +1 -1
- package/dist/esm/components/CnIndexPage/CnIndexPage.vue3.js +68 -35
- package/dist/esm/components/CnIndexPage/CnIndexPage.vue3.js.map +1 -1
- package/dist/esm/components/CnIndexPage/useSelfFetchList.js +22 -2
- package/dist/esm/components/CnIndexPage/useSelfFetchList.js.map +1 -1
- package/dist/esm/components/CnIndexSidebar/CnIndexSidebar.vue2.js +69 -5
- package/dist/esm/components/CnIndexSidebar/CnIndexSidebar.vue2.js.map +1 -1
- package/dist/esm/components/CnIndexSidebar/CnIndexSidebar.vue3.js +38 -5
- package/dist/esm/components/CnIndexSidebar/CnIndexSidebar.vue3.js.map +1 -1
- package/dist/esm/components/CnMapWidget/CnMapWidget.vue.js +1 -1
- package/dist/esm/components/CnMapWidget/CnMapWidget.vue2.js +7 -1
- package/dist/esm/components/CnMapWidget/CnMapWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnMapWidget/CnMapWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnPartyPicker/CnPartyPicker.vue.js +8 -0
- package/dist/esm/components/CnPartyPicker/CnPartyPicker.vue.js.map +1 -0
- package/dist/esm/components/CnPartyPicker/CnPartyPicker.vue2.js +297 -0
- package/dist/esm/components/CnPartyPicker/CnPartyPicker.vue2.js.map +1 -0
- package/dist/esm/components/CnPartyPicker/CnPartyPicker.vue3.js +24 -0
- package/dist/esm/components/CnPartyPicker/CnPartyPicker.vue3.js.map +1 -0
- package/dist/esm/components/CnSavedViewEditDialog/CnSavedViewEditDialog.vue.js +9 -0
- package/dist/esm/components/CnSavedViewEditDialog/CnSavedViewEditDialog.vue.js.map +1 -0
- package/dist/esm/components/CnSavedViewEditDialog/CnSavedViewEditDialog.vue2.js +95 -0
- package/dist/esm/components/CnSavedViewEditDialog/CnSavedViewEditDialog.vue2.js.map +1 -0
- package/dist/esm/components/CnSavedViewEditDialog/CnSavedViewEditDialog.vue3.js +123 -0
- package/dist/esm/components/CnSavedViewEditDialog/CnSavedViewEditDialog.vue3.js.map +1 -0
- package/dist/esm/components/CnSavedViewShareDialog/CnSavedViewShareDialog.vue.js +1 -1
- package/dist/esm/components/CnSavedViewShareDialog/CnSavedViewShareDialog.vue2.js +13 -5
- package/dist/esm/components/CnSavedViewShareDialog/CnSavedViewShareDialog.vue2.js.map +1 -1
- package/dist/esm/components/CnSavedViewShareDialog/CnSavedViewShareDialog.vue3.js +3 -1
- package/dist/esm/components/CnSavedViewShareDialog/CnSavedViewShareDialog.vue3.js.map +1 -1
- package/dist/esm/components/CnSavedViewShareFields/CnSavedViewShareFields.vue.js +1 -1
- package/dist/esm/components/CnSavedViewShareFields/CnSavedViewShareFields.vue2.js +49 -23
- package/dist/esm/components/CnSavedViewShareFields/CnSavedViewShareFields.vue2.js.map +1 -1
- package/dist/esm/components/CnSavedViewShareFields/CnSavedViewShareFields.vue3.js +74 -27
- package/dist/esm/components/CnSavedViewShareFields/CnSavedViewShareFields.vue3.js.map +1 -1
- package/dist/esm/components/CnSavedViewsControl/CnSavedViewsControl.vue.js +0 -1
- package/dist/esm/components/CnSavedViewsControl/CnSavedViewsControl.vue.js.map +1 -1
- package/dist/esm/components/CnSavedViewsControl/CnSavedViewsControl.vue2.js +18 -413
- package/dist/esm/components/CnSavedViewsControl/CnSavedViewsControl.vue2.js.map +1 -1
- package/dist/esm/components/CnSavedViewsControl/CnSavedViewsControl.vue3.js +27 -214
- package/dist/esm/components/CnSavedViewsControl/CnSavedViewsControl.vue3.js.map +1 -1
- package/dist/esm/components/CnSavedViewsPanel/CnSavedViewsPanel.vue.js +9 -0
- package/dist/esm/components/CnSavedViewsPanel/CnSavedViewsPanel.vue.js.map +1 -0
- package/dist/esm/components/CnSavedViewsPanel/CnSavedViewsPanel.vue2.js +190 -0
- package/dist/esm/components/CnSavedViewsPanel/CnSavedViewsPanel.vue2.js.map +1 -0
- package/dist/esm/components/CnSavedViewsPanel/CnSavedViewsPanel.vue3.js +270 -0
- package/dist/esm/components/CnSavedViewsPanel/CnSavedViewsPanel.vue3.js.map +1 -0
- package/dist/esm/index.js +4 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/l10n/en.json.js +56 -1
- package/dist/esm/l10n/en.json.js.map +1 -1
- package/dist/esm/l10n/nl.json.js +56 -1
- package/dist/esm/l10n/nl.json.js.map +1 -1
- package/dist/esm/library-style.js +1 -1
- package/dist/esm/mixins/savedViewsList.js +235 -0
- package/dist/esm/mixins/savedViewsList.js.map +1 -0
- package/dist/esm/nextcloud-vue.css +348 -108
- package/dist/esm/utils/actionsDispatcher.js +2 -2
- package/dist/esm/utils/actionsDispatcher.js.map +1 -1
- package/dist/esm/utils/builtInModals.js +39 -0
- package/dist/esm/utils/builtInModals.js.map +1 -0
- package/dist/esm/utils/mapMarkerColor.js +121 -0
- package/dist/esm/utils/mapMarkerColor.js.map +1 -0
- package/dist/esm/utils/mergeManifestDelta.js +4 -0
- package/dist/esm/utils/mergeManifestDelta.js.map +1 -1
- package/dist/esm/utils/savedViewHelpers.js +59 -7
- package/dist/esm/utils/savedViewHelpers.js.map +1 -1
- package/dist/esm/utils/savedViewMenu.js +154 -0
- package/dist/esm/utils/savedViewMenu.js.map +1 -0
- package/dist/esm/utils/searchGroupSharees.js +50 -15
- package/dist/esm/utils/searchGroupSharees.js.map +1 -1
- package/dist/esm/utils/validateManifestV2.compiled.js +3 -3
- package/dist/esm/utils/validateManifestV2.compiled.js.map +1 -1
- package/dist/nextcloud-vue.cjs.js +13351 -10855
- package/dist/nextcloud-vue.cjs.js.map +2 -2
- package/dist/nextcloud-vue.css +348 -108
- package/l10n/en.json +56 -1
- package/l10n/nl.json +56 -1
- package/package.json +1 -1
- package/src/components/CnActionDialog/CnActionDialog.vue +545 -0
- package/src/components/CnActionDialog/index.js +12 -0
- package/src/components/CnAppNav/CnAppNav.vue +17 -0
- package/src/components/CnAppRoot/CnAppRoot.vue +102 -2
- package/src/components/CnDashboardPage/CnDashboardPage.vue +86 -7
- package/src/components/CnIndexPage/CnIndexPage.vue +409 -23
- package/src/components/CnIndexPage/useSelfFetchList.js +21 -1
- package/src/components/CnIndexSidebar/CnIndexSidebar.md +2 -0
- package/src/components/CnIndexSidebar/CnIndexSidebar.vue +91 -1
- package/src/components/CnMapWidget/CnMapWidget.vue +16 -1
- package/src/components/CnPartyPicker/CnPartyPicker.vue +317 -0
- package/src/components/CnPartyPicker/index.js +11 -0
- package/src/components/CnSavedViewEditDialog/CnSavedViewEditDialog.vue +192 -0
- package/src/components/CnSavedViewEditDialog/index.js +11 -0
- package/src/components/CnSavedViewShareDialog/CnSavedViewShareDialog.vue +21 -6
- package/src/components/CnSavedViewShareFields/CnSavedViewShareFields.vue +130 -37
- package/src/components/CnSavedViewsControl/CnSavedViewsControl.vue +36 -599
- package/src/components/CnSavedViewsPanel/CnSavedViewsPanel.vue +459 -0
- package/src/components/CnSavedViewsPanel/index.js +11 -0
- package/src/components/index.js +4 -0
- package/src/css/index-page.css +16 -0
- package/src/css/look-board-index.css +5 -3
- package/src/css/look-board.css +18 -3
- package/src/index.js +4 -0
- package/src/mixins/savedViewsList.js +231 -0
- package/src/schemas/app-manifest-v2.schema.json +98 -3
- package/src/utils/actionsDispatcher.js +2 -2
- package/src/utils/builtInModals.js +35 -0
- package/src/utils/mapMarkerColor.js +117 -0
- package/src/utils/mergeManifestDelta.js +4 -0
- package/src/utils/savedViewHelpers.js +58 -6
- package/src/utils/savedViewMenu.js +150 -0
- package/src/utils/searchGroupSharees.js +49 -14
- package/src/utils/validateManifestV2.compiled.js +3 -3
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
import { translate } from '@nextcloud/l10n';
|
|
2
|
+
import { VIEW_GROUPS, buildViewTree, labelsInUse } from '../utils/buildViewTree.js';
|
|
3
|
+
import { viewAccess } from '../utils/savedViewHelpers.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* SPDX-FileCopyrightText: 2026 Conduction B.V.
|
|
7
|
+
* SPDX-License-Identifier: EUPL-1.2
|
|
8
|
+
*
|
|
9
|
+
* savedViewsList — what the saved-views panel and the toolbar chips share:
|
|
10
|
+
* the views as a tree with the defaults first, the sections, the labels,
|
|
11
|
+
* counts and access. Presentational only; the page owns fetching and writes.
|
|
12
|
+
*
|
|
13
|
+
* @spec openspec/changes/saved-views-manage-and-defaults/tasks.md#task-6
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
const savedViewsList = {
|
|
17
|
+
props: {
|
|
18
|
+
/** Views to list (View API objects from `GET /apps/openregister/api/views`, defaults included). */
|
|
19
|
+
views: {
|
|
20
|
+
type: Array,
|
|
21
|
+
default: () => [],
|
|
22
|
+
},
|
|
23
|
+
|
|
24
|
+
/** True while the parent is fetching the view list. */
|
|
25
|
+
loading: {
|
|
26
|
+
type: Boolean,
|
|
27
|
+
default: false,
|
|
28
|
+
},
|
|
29
|
+
|
|
30
|
+
/** The signed-in NC user id; a view without `@self.access` is the owner's when it matches. */
|
|
31
|
+
currentUserId: {
|
|
32
|
+
type: String,
|
|
33
|
+
default: '',
|
|
34
|
+
},
|
|
35
|
+
|
|
36
|
+
/** How deep the tree indents before it flattens (`savedViewTree.maxDepth`). */
|
|
37
|
+
maxDepth: {
|
|
38
|
+
type: Number,
|
|
39
|
+
default: 3,
|
|
40
|
+
},
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* How many records each view matches, keyed by view id (or slug). `null`
|
|
44
|
+
* shows no counts.
|
|
45
|
+
*
|
|
46
|
+
* @type {{[viewId: string]: number}|null}
|
|
47
|
+
*/
|
|
48
|
+
counts: {
|
|
49
|
+
type: Object,
|
|
50
|
+
default: null,
|
|
51
|
+
},
|
|
52
|
+
|
|
53
|
+
/** The id (or slug) of the applied view. */
|
|
54
|
+
selectedViewId: {
|
|
55
|
+
type: String,
|
|
56
|
+
default: '',
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
|
|
60
|
+
data() {
|
|
61
|
+
return {
|
|
62
|
+
/** The label currently filtering the list, or '' for all of them. */
|
|
63
|
+
labelFilter: '',
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
|
|
67
|
+
computed: {
|
|
68
|
+
/** @return {string} The seeded group name, for templates. */
|
|
69
|
+
SEEDED_GROUP() {
|
|
70
|
+
return VIEW_GROUPS.SEEDED
|
|
71
|
+
},
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* The views in tree order, defaults first, filtered by the active label.
|
|
75
|
+
*
|
|
76
|
+
* @return {Array<object>} Rows of `{ view, depth, group, orphaned }`.
|
|
77
|
+
*/
|
|
78
|
+
rows() {
|
|
79
|
+
return buildViewTree({ views: this.views, labelFilter: this.labelFilter, maxDepth: this.maxDepth })
|
|
80
|
+
},
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* The rows in their sections: one uncaptioned section when nothing is
|
|
84
|
+
* shared and nothing is a default, else Default views, My views and
|
|
85
|
+
* Shared with me.
|
|
86
|
+
*
|
|
87
|
+
* @return {Array<{key: string, label: string, rows: Array<object>}>} The sections.
|
|
88
|
+
* @spec openspec/changes/saved-views-shared-by-role/tasks.md#task-1
|
|
89
|
+
*/
|
|
90
|
+
sections() {
|
|
91
|
+
const shared = this.rows.filter((r) => r.group !== VIEW_GROUPS.SEEDED && this.accessOf(r) !== 'owner');
|
|
92
|
+
const seeded = this.rows.filter((r) => r.group === VIEW_GROUPS.SEEDED);
|
|
93
|
+
if (shared.length === 0 && seeded.length === 0) {
|
|
94
|
+
return [{ key: 'all', label: '', rows: this.rows }]
|
|
95
|
+
}
|
|
96
|
+
const mine = this.rows.filter((r) => r.group !== VIEW_GROUPS.SEEDED && this.accessOf(r) === 'owner');
|
|
97
|
+
return [
|
|
98
|
+
{ key: 'seeded', label: translate('nextcloud-vue', 'Default views'), rows: seeded },
|
|
99
|
+
{ key: 'mine', label: translate('nextcloud-vue', 'My views'), rows: mine },
|
|
100
|
+
{ key: 'shared', label: translate('nextcloud-vue', 'Shared with me'), rows: shared },
|
|
101
|
+
].filter((section) => section.rows.length > 0)
|
|
102
|
+
},
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* The labels in use, read from the UNFILTERED list so choosing one keeps
|
|
106
|
+
* the others on offer.
|
|
107
|
+
*
|
|
108
|
+
* @return {Array<string>} The labels.
|
|
109
|
+
*/
|
|
110
|
+
offeredLabels() {
|
|
111
|
+
return labelsInUse(this.views)
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
|
|
115
|
+
methods: {
|
|
116
|
+
t: translate,
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Whether a view is the applied one.
|
|
120
|
+
*
|
|
121
|
+
* @param {object} view The view.
|
|
122
|
+
* @return {boolean}
|
|
123
|
+
*/
|
|
124
|
+
isSelected(view) {
|
|
125
|
+
return this.selectedViewId !== '' && (this.selectedViewId === String(view.id) || this.selectedViewId === String(view.slug))
|
|
126
|
+
},
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* What the current user may do with a row's view.
|
|
130
|
+
*
|
|
131
|
+
* @param {object} row The row from buildViewTree().
|
|
132
|
+
* @return {'owner'|'write'|'read'} The access.
|
|
133
|
+
*/
|
|
134
|
+
accessOf(row) {
|
|
135
|
+
return viewAccess(row.view, this.currentUserId)
|
|
136
|
+
},
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* The people and groups a view is shared with, as text.
|
|
140
|
+
*
|
|
141
|
+
* @param {object} view The View API object.
|
|
142
|
+
* @return {string} The user and group ids, comma-separated; empty when none.
|
|
143
|
+
*/
|
|
144
|
+
groupsOf(view) {
|
|
145
|
+
return (Array.isArray(view.sharedWith) ? view.sharedWith : [])
|
|
146
|
+
.map((e) => e && (e.user || e.group))
|
|
147
|
+
.filter((g) => typeof g === 'string' && g !== '')
|
|
148
|
+
.join(', ')
|
|
149
|
+
},
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* The name a row shows, indented to its depth with figure spaces so a
|
|
153
|
+
* screen reader gets the same shape.
|
|
154
|
+
*
|
|
155
|
+
* @param {object} row The row from buildViewTree().
|
|
156
|
+
* @param {boolean} [withGroups] Append who the view is shared with.
|
|
157
|
+
* @return {string} The name.
|
|
158
|
+
*/
|
|
159
|
+
rowName(row, withGroups = false) {
|
|
160
|
+
const groups = withGroups ? this.groupsOf(row.view) : '';
|
|
161
|
+
return `${' '.repeat(row.depth * 2)}${this.nameWithCount(row.view)}${groups !== '' ? ` · ${groups}` : ''}`
|
|
162
|
+
},
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* The number of records a view matches, or null when none is known.
|
|
166
|
+
*
|
|
167
|
+
* @param {object} view The saved view.
|
|
168
|
+
* @return {number|null}
|
|
169
|
+
*/
|
|
170
|
+
countOf(view) {
|
|
171
|
+
const counts = this.counts || {};
|
|
172
|
+
let value = counts[view.id];
|
|
173
|
+
if (value === undefined || value === null) {
|
|
174
|
+
value = counts[view.slug];
|
|
175
|
+
}
|
|
176
|
+
if (value === undefined || value === null) {
|
|
177
|
+
value = view.count;
|
|
178
|
+
}
|
|
179
|
+
return (typeof value === 'number' && Number.isFinite(value)) ? value : null
|
|
180
|
+
},
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* A view's name, followed by its count when one is known.
|
|
184
|
+
*
|
|
185
|
+
* @param {object} view The saved view.
|
|
186
|
+
* @return {string}
|
|
187
|
+
*/
|
|
188
|
+
nameWithCount(view) {
|
|
189
|
+
const count = this.countOf(view);
|
|
190
|
+
return count === null ? view.name : `${view.name} (${count})`
|
|
191
|
+
},
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* What a row is called to somebody who cannot see the indentation: the
|
|
195
|
+
* level in words, and a note when its parent is out of reach.
|
|
196
|
+
*
|
|
197
|
+
* @param {object} row The row from buildViewTree().
|
|
198
|
+
* @return {string} The accessible label.
|
|
199
|
+
*/
|
|
200
|
+
rowLabel(row) {
|
|
201
|
+
const viewName = this.nameWithCount(row.view);
|
|
202
|
+
const name = row.depth === 0
|
|
203
|
+
? viewName
|
|
204
|
+
: translate('nextcloud-vue', '{name}, level {level}', { name: viewName, level: row.depth + 1 });
|
|
205
|
+
if (row.orphaned !== true) {
|
|
206
|
+
return name
|
|
207
|
+
}
|
|
208
|
+
return translate('nextcloud-vue', '{name}. Parts of this view come from one you cannot see.', { name })
|
|
209
|
+
},
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* The accessible label of a label filter entry.
|
|
213
|
+
*
|
|
214
|
+
* @param {string} label The label.
|
|
215
|
+
* @return {string}
|
|
216
|
+
*/
|
|
217
|
+
labelFilterLabel(label) {
|
|
218
|
+
return this.labelFilter === label
|
|
219
|
+
? translate('nextcloud-vue', 'Stop filtering on "{label}"', { label })
|
|
220
|
+
: translate('nextcloud-vue', 'Show only views labelled "{label}"', { label })
|
|
221
|
+
},
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* Turn a label filter on, or off when it is already on.
|
|
225
|
+
*
|
|
226
|
+
* @param {string} label The label.
|
|
227
|
+
*/
|
|
228
|
+
onLabelFilter(label) {
|
|
229
|
+
this.labelFilter = this.labelFilter === label ? '' : label;
|
|
230
|
+
},
|
|
231
|
+
},
|
|
232
|
+
};
|
|
233
|
+
|
|
234
|
+
export { savedViewsList };
|
|
235
|
+
//# sourceMappingURL=savedViewsList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"savedViewsList.js","sources":["../../../src/mixins/savedViewsList.js"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2026 Conduction B.V.\n * SPDX-License-Identifier: EUPL-1.2\n *\n * savedViewsList — what the saved-views panel and the toolbar chips share:\n * the views as a tree with the defaults first, the sections, the labels,\n * counts and access. Presentational only; the page owns fetching and writes.\n *\n * @spec openspec/changes/saved-views-manage-and-defaults/tasks.md#task-6\n */\nimport { translate as t } from '@nextcloud/l10n'\nimport { buildViewTree, labelsInUse, VIEW_GROUPS } from '../utils/buildViewTree.js'\nimport { viewAccess } from '../utils/savedViewHelpers.js'\n\nexport const savedViewsList = {\n\tprops: {\n\t\t/** Views to list (View API objects from `GET /apps/openregister/api/views`, defaults included). */\n\t\tviews: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t\t/** True while the parent is fetching the view list. */\n\t\tloading: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/** The signed-in NC user id; a view without `@self.access` is the owner's when it matches. */\n\t\tcurrentUserId: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** How deep the tree indents before it flattens (`savedViewTree.maxDepth`). */\n\t\tmaxDepth: {\n\t\t\ttype: Number,\n\t\t\tdefault: 3,\n\t\t},\n\n\t\t/**\n\t\t * How many records each view matches, keyed by view id (or slug). `null`\n\t\t * shows no counts.\n\t\t *\n\t\t * @type {{[viewId: string]: number}|null}\n\t\t */\n\t\tcounts: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** The id (or slug) of the applied view. */\n\t\tselectedViewId: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\t/** The label currently filtering the list, or '' for all of them. */\n\t\t\tlabelFilter: '',\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/** @return {string} The seeded group name, for templates. */\n\t\tSEEDED_GROUP() {\n\t\t\treturn VIEW_GROUPS.SEEDED\n\t\t},\n\n\t\t/**\n\t\t * The views in tree order, defaults first, filtered by the active label.\n\t\t *\n\t\t * @return {Array<object>} Rows of `{ view, depth, group, orphaned }`.\n\t\t */\n\t\trows() {\n\t\t\treturn buildViewTree({ views: this.views, labelFilter: this.labelFilter, maxDepth: this.maxDepth })\n\t\t},\n\n\t\t/**\n\t\t * The rows in their sections: one uncaptioned section when nothing is\n\t\t * shared and nothing is a default, else Default views, My views and\n\t\t * Shared with me.\n\t\t *\n\t\t * @return {Array<{key: string, label: string, rows: Array<object>}>} The sections.\n\t\t * @spec openspec/changes/saved-views-shared-by-role/tasks.md#task-1\n\t\t */\n\t\tsections() {\n\t\t\tconst shared = this.rows.filter((r) => r.group !== VIEW_GROUPS.SEEDED && this.accessOf(r) !== 'owner')\n\t\t\tconst seeded = this.rows.filter((r) => r.group === VIEW_GROUPS.SEEDED)\n\t\t\tif (shared.length === 0 && seeded.length === 0) {\n\t\t\t\treturn [{ key: 'all', label: '', rows: this.rows }]\n\t\t\t}\n\t\t\tconst mine = this.rows.filter((r) => r.group !== VIEW_GROUPS.SEEDED && this.accessOf(r) === 'owner')\n\t\t\treturn [\n\t\t\t\t{ key: 'seeded', label: t('nextcloud-vue', 'Default views'), rows: seeded },\n\t\t\t\t{ key: 'mine', label: t('nextcloud-vue', 'My views'), rows: mine },\n\t\t\t\t{ key: 'shared', label: t('nextcloud-vue', 'Shared with me'), rows: shared },\n\t\t\t].filter((section) => section.rows.length > 0)\n\t\t},\n\n\t\t/**\n\t\t * The labels in use, read from the UNFILTERED list so choosing one keeps\n\t\t * the others on offer.\n\t\t *\n\t\t * @return {Array<string>} The labels.\n\t\t */\n\t\tofferedLabels() {\n\t\t\treturn labelsInUse(this.views)\n\t\t},\n\t},\n\n\tmethods: {\n\t\tt,\n\n\t\t/**\n\t\t * Whether a view is the applied one.\n\t\t *\n\t\t * @param {object} view The view.\n\t\t * @return {boolean}\n\t\t */\n\t\tisSelected(view) {\n\t\t\treturn this.selectedViewId !== '' && (this.selectedViewId === String(view.id) || this.selectedViewId === String(view.slug))\n\t\t},\n\n\t\t/**\n\t\t * What the current user may do with a row's view.\n\t\t *\n\t\t * @param {object} row The row from buildViewTree().\n\t\t * @return {'owner'|'write'|'read'} The access.\n\t\t */\n\t\taccessOf(row) {\n\t\t\treturn viewAccess(row.view, this.currentUserId)\n\t\t},\n\n\t\t/**\n\t\t * The people and groups a view is shared with, as text.\n\t\t *\n\t\t * @param {object} view The View API object.\n\t\t * @return {string} The user and group ids, comma-separated; empty when none.\n\t\t */\n\t\tgroupsOf(view) {\n\t\t\treturn (Array.isArray(view.sharedWith) ? view.sharedWith : [])\n\t\t\t\t.map((e) => e && (e.user || e.group))\n\t\t\t\t.filter((g) => typeof g === 'string' && g !== '')\n\t\t\t\t.join(', ')\n\t\t},\n\n\t\t/**\n\t\t * The name a row shows, indented to its depth with figure spaces so a\n\t\t * screen reader gets the same shape.\n\t\t *\n\t\t * @param {object} row The row from buildViewTree().\n\t\t * @param {boolean} [withGroups] Append who the view is shared with.\n\t\t * @return {string} The name.\n\t\t */\n\t\trowName(row, withGroups = false) {\n\t\t\tconst groups = withGroups ? this.groupsOf(row.view) : ''\n\t\t\treturn `${' '.repeat(row.depth * 2)}${this.nameWithCount(row.view)}${groups !== '' ? ` · ${groups}` : ''}`\n\t\t},\n\n\t\t/**\n\t\t * The number of records a view matches, or null when none is known.\n\t\t *\n\t\t * @param {object} view The saved view.\n\t\t * @return {number|null}\n\t\t */\n\t\tcountOf(view) {\n\t\t\tconst counts = this.counts || {}\n\t\t\tlet value = counts[view.id]\n\t\t\tif (value === undefined || value === null) {\n\t\t\t\tvalue = counts[view.slug]\n\t\t\t}\n\t\t\tif (value === undefined || value === null) {\n\t\t\t\tvalue = view.count\n\t\t\t}\n\t\t\treturn (typeof value === 'number' && Number.isFinite(value)) ? value : null\n\t\t},\n\n\t\t/**\n\t\t * A view's name, followed by its count when one is known.\n\t\t *\n\t\t * @param {object} view The saved view.\n\t\t * @return {string}\n\t\t */\n\t\tnameWithCount(view) {\n\t\t\tconst count = this.countOf(view)\n\t\t\treturn count === null ? view.name : `${view.name} (${count})`\n\t\t},\n\n\t\t/**\n\t\t * What a row is called to somebody who cannot see the indentation: the\n\t\t * level in words, and a note when its parent is out of reach.\n\t\t *\n\t\t * @param {object} row The row from buildViewTree().\n\t\t * @return {string} The accessible label.\n\t\t */\n\t\trowLabel(row) {\n\t\t\tconst viewName = this.nameWithCount(row.view)\n\t\t\tconst name = row.depth === 0\n\t\t\t\t? viewName\n\t\t\t\t: t('nextcloud-vue', '{name}, level {level}', { name: viewName, level: row.depth + 1 })\n\t\t\tif (row.orphaned !== true) {\n\t\t\t\treturn name\n\t\t\t}\n\t\t\treturn t('nextcloud-vue', '{name}. Parts of this view come from one you cannot see.', { name })\n\t\t},\n\n\t\t/**\n\t\t * The accessible label of a label filter entry.\n\t\t *\n\t\t * @param {string} label The label.\n\t\t * @return {string}\n\t\t */\n\t\tlabelFilterLabel(label) {\n\t\t\treturn this.labelFilter === label\n\t\t\t\t? t('nextcloud-vue', 'Stop filtering on \"{label}\"', { label })\n\t\t\t\t: t('nextcloud-vue', 'Show only views labelled \"{label}\"', { label })\n\t\t},\n\n\t\t/**\n\t\t * Turn a label filter on, or off when it is already on.\n\t\t *\n\t\t * @param {string} label The label.\n\t\t */\n\t\tonLabelFilter(label) {\n\t\t\tthis.labelFilter = this.labelFilter === label ? '' : label\n\t\t},\n\t},\n}\n"],"names":["t"],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;AACY,MAAC,cAAc,GAAG;AAC9B,CAAC,KAAK,EAAE;AACR;AACA,EAAE,KAAK,EAAE;AACT,GAAG,IAAI,EAAE,KAAK;AACd,GAAG,OAAO,EAAE,MAAM,EAAE;AACpB,GAAG;AACH;AACA;AACA,EAAE,OAAO,EAAE;AACX,GAAG,IAAI,EAAE,OAAO;AAChB,GAAG,OAAO,EAAE,KAAK;AACjB,GAAG;AACH;AACA;AACA,EAAE,aAAa,EAAE;AACjB,GAAG,IAAI,EAAE,MAAM;AACf,GAAG,OAAO,EAAE,EAAE;AACd,GAAG;AACH;AACA;AACA,EAAE,QAAQ,EAAE;AACZ,GAAG,IAAI,EAAE,MAAM;AACf,GAAG,OAAO,EAAE,CAAC;AACb,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,MAAM,EAAE;AACV,GAAG,IAAI,EAAE,MAAM;AACf,GAAG,OAAO,EAAE,IAAI;AAChB,GAAG;AACH;AACA;AACA,EAAE,cAAc,EAAE;AAClB,GAAG,IAAI,EAAE,MAAM;AACf,GAAG,OAAO,EAAE,EAAE;AACd,GAAG;AACH,EAAE;AACF;AACA,CAAC,IAA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