@conduction/nextcloud-vue 2.132.0 → 2.134.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/CnActionButtons/CnActionButtons.vue.js +1 -1
- package/dist/esm/components/CnActionButtons/CnActionButtons.vue2.js +14 -0
- package/dist/esm/components/CnActionButtons/CnActionButtons.vue2.js.map +1 -1
- package/dist/esm/components/CnActionButtons/CnActionButtons.vue3.js +5 -4
- package/dist/esm/components/CnActionButtons/CnActionButtons.vue3.js.map +1 -1
- package/dist/esm/components/CnConditionListEditor/CnConditionListEditor.vue.js +9 -0
- package/dist/esm/components/CnConditionListEditor/CnConditionListEditor.vue.js.map +1 -0
- package/dist/esm/components/CnConditionListEditor/CnConditionListEditor.vue2.js +237 -0
- package/dist/esm/components/CnConditionListEditor/CnConditionListEditor.vue2.js.map +1 -0
- package/dist/esm/components/CnConditionListEditor/CnConditionListEditor.vue3.js +103 -0
- package/dist/esm/components/CnConditionListEditor/CnConditionListEditor.vue3.js.map +1 -0
- package/dist/esm/components/CnConditionListEditor/conditionOperators.js +121 -0
- package/dist/esm/components/CnConditionListEditor/conditionOperators.js.map +1 -0
- package/dist/esm/components/CnDetailPage/CnDetailPage.vue2.js +12 -0
- package/dist/esm/components/CnDetailPage/CnDetailPage.vue2.js.map +1 -1
- package/dist/esm/components/CnDetailPage/CnDetailPage.vue3.js +1 -1
- package/dist/esm/components/CnDetailPage/CnDetailPage.vue3.js.map +1 -1
- package/dist/esm/components/CnFieldListWidget/CnFieldListWidget.vue.js +1 -1
- package/dist/esm/components/CnFieldListWidget/CnFieldListWidget.vue2.js +85 -10
- package/dist/esm/components/CnFieldListWidget/CnFieldListWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnFieldListWidget/CnFieldListWidget.vue3.js +60 -36
- package/dist/esm/components/CnFieldListWidget/CnFieldListWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js +8 -1
- package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js.map +1 -1
- package/dist/esm/components/CnIndexPage/CnIndexPage.vue3.js.map +1 -1
- package/dist/esm/components/CnIntegrationWidget/CnIntegrationWidget.vue.js +1 -1
- package/dist/esm/components/CnIntegrationWidget/CnIntegrationWidget.vue2.js +10 -0
- package/dist/esm/components/CnIntegrationWidget/CnIntegrationWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnIntegrationWidget/CnIntegrationWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnNcWidgetWidget/CnNcWidgetWidget.vue.js +1 -1
- package/dist/esm/components/CnNcWidgetWidget/CnNcWidgetWidget.vue2.js +46 -7
- package/dist/esm/components/CnNcWidgetWidget/CnNcWidgetWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnNcWidgetWidget/CnNcWidgetWidget.vue3.js +1 -1
- package/dist/esm/components/CnNcWidgetWidget/CnNcWidgetWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue.js +1 -1
- package/dist/esm/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue2.js +258 -6
- package/dist/esm/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue3.js +283 -131
- package/dist/esm/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue.js +1 -1
- package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue2.js +42 -2
- package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnTabsWidget/CnTabsWidget.vue.js +1 -1
- package/dist/esm/components/CnTabsWidget/CnTabsWidget.vue2.js +1 -1
- package/dist/esm/components/CnTabsWidget/CnTabsWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnTabsWidget/CnTabsWidget.vue3.js.map +1 -1
- package/dist/esm/dialogs/CnPartyAddDialog.vue.js +9 -0
- package/dist/esm/dialogs/CnPartyAddDialog.vue.js.map +1 -0
- package/dist/esm/dialogs/CnPartyAddDialog.vue2.js +184 -0
- package/dist/esm/dialogs/CnPartyAddDialog.vue2.js.map +1 -0
- package/dist/esm/dialogs/CnPartyAddDialog.vue3.js +168 -0
- package/dist/esm/dialogs/CnPartyAddDialog.vue3.js.map +1 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/l10n/en.json.js +27 -1
- package/dist/esm/l10n/en.json.js.map +1 -1
- package/dist/esm/l10n/nl.json.js +27 -1
- package/dist/esm/l10n/nl.json.js.map +1 -1
- package/dist/esm/library-style.js +1 -1
- package/dist/esm/nextcloud-vue.css +353 -217
- package/dist/esm/store/plugins/liveUpdates.js +13 -4
- package/dist/esm/store/plugins/liveUpdates.js.map +1 -1
- package/dist/esm/store/useObjectStore.js +28 -5
- package/dist/esm/store/useObjectStore.js.map +1 -1
- package/dist/esm/utils/detailActionModel.js +6 -0
- package/dist/esm/utils/detailActionModel.js.map +1 -1
- package/dist/esm/utils/listLenses.js +20 -1
- package/dist/esm/utils/listLenses.js.map +1 -1
- package/dist/esm/utils/objectParties.js +79 -1
- package/dist/esm/utils/objectParties.js.map +1 -1
- package/dist/esm/utils/objectRows.js +59 -0
- package/dist/esm/utils/objectRows.js.map +1 -0
- 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 +7460 -5803
- package/dist/nextcloud-vue.cjs.js.map +2 -2
- package/dist/nextcloud-vue.css +353 -217
- package/l10n/en.json +27 -1
- package/l10n/nl.json +27 -1
- package/package.json +1 -1
- package/src/components/CnActionButtons/CnActionButtons.vue +15 -0
- package/src/components/CnConditionListEditor/CnConditionListEditor.vue +346 -0
- package/src/components/CnConditionListEditor/conditionOperators.js +126 -0
- package/src/components/CnConditionListEditor/index.js +17 -0
- package/src/components/CnDetailPage/CnDetailPage.md +1 -0
- package/src/components/CnDetailPage/CnDetailPage.vue +13 -1
- package/src/components/CnFieldListWidget/CnFieldListWidget.vue +105 -12
- package/src/components/CnIndexPage/CnIndexPage.vue +8 -1
- package/src/components/CnIntegrationWidget/CnIntegrationWidget.vue +10 -0
- package/src/components/CnNcWidgetWidget/CnNcWidgetWidget.vue +47 -8
- package/src/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue +401 -3
- package/src/components/CnRecordListWidget/CnRecordListWidget.vue +42 -2
- package/src/components/CnTabsWidget/CnTabsWidget.vue +1 -1
- package/src/components/index.js +1 -0
- package/src/css/look-board-index.css +6 -0
- package/src/css/look-board.css +35 -7
- package/src/dialogs/CnPartyAddDialog.vue +309 -0
- package/src/index.js +2 -0
- package/src/schemas/app-manifest-v2.schema.json +17 -1
- package/src/store/plugins/liveUpdates.js +13 -4
- package/src/store/useObjectStore.js +28 -5
- package/src/utils/detailActionModel.js +6 -0
- package/src/utils/listLenses.js +20 -1
- package/src/utils/objectParties.js +78 -0
- package/src/utils/objectRows.js +55 -0
- package/src/utils/validateManifestV2.compiled.js +3 -3
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
import { translate as t } from '@nextcloud/l10n'
|
|
16
|
+
import { readPath } from './readPath.js'
|
|
16
17
|
|
|
17
18
|
/**
|
|
18
19
|
* What a role is called: the app's own word (`roleLabels`), else the label
|
|
@@ -174,3 +175,80 @@ export function documentsOfParty(documents, identifier, fields = {}) {
|
|
|
174
175
|
export function kindCode(kind) {
|
|
175
176
|
return String(kind?.code || kind?.key || '')
|
|
176
177
|
}
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Write a value at a dotted path, creating the objects on the way.
|
|
181
|
+
*
|
|
182
|
+
* @param {object} target The object written into.
|
|
183
|
+
* @param {string} path The dotted path (`name.surname`).
|
|
184
|
+
* @param {unknown} value The value.
|
|
185
|
+
* @return {void}
|
|
186
|
+
*/
|
|
187
|
+
function writePath(target, path, value) {
|
|
188
|
+
const keys = String(path).split('.').filter((key) => key !== '')
|
|
189
|
+
let node = target
|
|
190
|
+
keys.slice(0, -1).forEach((key) => {
|
|
191
|
+
if (!node[key] || typeof node[key] !== 'object') {
|
|
192
|
+
node[key] = {}
|
|
193
|
+
}
|
|
194
|
+
node = node[key]
|
|
195
|
+
})
|
|
196
|
+
if (keys.length > 0) {
|
|
197
|
+
node[keys[keys.length - 1]] = value
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* The record a new party is saved as, from the fields a host declares.
|
|
203
|
+
*
|
|
204
|
+
* Each field `{ key, path?, address? }` writes its trimmed value at `path`
|
|
205
|
+
* (default `key`); a field with `address: { path, kind, type }` instead adds
|
|
206
|
+
* `{ kind, type, value }` to the list at that path, the shape OpenRegister's
|
|
207
|
+
* party model reads as the party's addresses. `compose` names the paths a
|
|
208
|
+
* derived field joins with a space, skipping the empty ones
|
|
209
|
+
* (`{ displayName: ["name.givenNames", "name.namePrefix", "name.surname"] }`).
|
|
210
|
+
* A field of `type: "integer"` is saved as a number when it reads as one.
|
|
211
|
+
* An empty value is left out.
|
|
212
|
+
*
|
|
213
|
+
* @param {{fields?: Array<object>, compose?: Record<string, Array<string>>}} create The declaration.
|
|
214
|
+
* @param {Record<string, string>} values The values by field key.
|
|
215
|
+
* @return {object} The record.
|
|
216
|
+
* @spec openspec/changes/object-parties-manage/specs/record-widgets/spec.md#requirement-the-parties-widget-can-add-and-remove-parties
|
|
217
|
+
*/
|
|
218
|
+
export function newPartyRecord(create, values) {
|
|
219
|
+
const record = {}
|
|
220
|
+
for (const field of Array.isArray(create?.fields) ? create.fields : []) {
|
|
221
|
+
const value = String(values?.[field?.key] ?? '').trim()
|
|
222
|
+
if (!field || !field.key || value === '') {
|
|
223
|
+
continue
|
|
224
|
+
}
|
|
225
|
+
if (field.address && field.address.path) {
|
|
226
|
+
const list = readPath(record, field.address.path)
|
|
227
|
+
const entry = { kind: field.address.kind || 'correspondence', type: field.address.type || 'email', value }
|
|
228
|
+
writePath(record, field.address.path, [...(Array.isArray(list) ? list : []), entry])
|
|
229
|
+
continue
|
|
230
|
+
}
|
|
231
|
+
writePath(record, field.path || field.key, field.type === 'integer' && /^-?\d+$/.test(value) ? Number(value) : value)
|
|
232
|
+
}
|
|
233
|
+
for (const [target, paths] of Object.entries(create?.compose && typeof create.compose === 'object' ? create.compose : {})) {
|
|
234
|
+
const joined = (Array.isArray(paths) ? paths : [])
|
|
235
|
+
.map((path) => String(readPath(record, path) ?? '').trim())
|
|
236
|
+
.filter((part) => part !== '')
|
|
237
|
+
.join(' ')
|
|
238
|
+
if (joined !== '') {
|
|
239
|
+
writePath(record, target, joined)
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
return record
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
* The uuid a create answered with: `id`, `uuid` or `@self.id`.
|
|
247
|
+
*
|
|
248
|
+
* @param {object} saved The saved object.
|
|
249
|
+
* @return {string} The uuid, or ''.
|
|
250
|
+
* @spec openspec/changes/object-parties-manage/specs/record-widgets/spec.md#requirement-the-parties-widget-can-add-and-remove-parties
|
|
251
|
+
*/
|
|
252
|
+
export function savedUuid(saved) {
|
|
253
|
+
return String(saved?.['@self']?.id || saved?.uuid || saved?.id || '')
|
|
254
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SPDX-FileCopyrightText: 2026 Conduction B.V.
|
|
3
|
+
* SPDX-License-Identifier: EUPL-1.2
|
|
4
|
+
*
|
|
5
|
+
* The rows a record holds in one of its fields, as `objectRows` names them:
|
|
6
|
+
* `{ path, where?, valuePath? }`. The list at `path`, narrowed to the entry
|
|
7
|
+
* matching `where` when set (`{ name: "onderzoeksstappen" }` in a case's
|
|
8
|
+
* answers), its `valuePath` taken; a JSON string is decoded. Anything that is
|
|
9
|
+
* not a list of objects is no rows. The record is read as the page read it, so
|
|
10
|
+
* its own read rules already decided what is in it.
|
|
11
|
+
*
|
|
12
|
+
* @spec openspec/changes/record-list-object-rows/specs/record-list/spec.md#requirement-a-record-list-can-list-rows-the-page-record-holds
|
|
13
|
+
*/
|
|
14
|
+
import { readPath } from './readPath.js'
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Whether a declaration names rows on a record.
|
|
18
|
+
*
|
|
19
|
+
* @param {unknown} spec The declaration.
|
|
20
|
+
* @return {boolean}
|
|
21
|
+
*/
|
|
22
|
+
export function isObjectRowsSpec(spec) {
|
|
23
|
+
return Boolean(spec && typeof spec === 'object' && typeof spec.path === 'string' && spec.path !== '')
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* The rows a record holds where `spec` points.
|
|
28
|
+
*
|
|
29
|
+
* @param {object|null} object The record.
|
|
30
|
+
* @param {{path: string, where?: object, valuePath?: string}} spec The declaration.
|
|
31
|
+
* @return {Array<object>} The rows.
|
|
32
|
+
*/
|
|
33
|
+
export function objectRowsOf(object, spec) {
|
|
34
|
+
if (!object || typeof object !== 'object' || !isObjectRowsSpec(spec)) {
|
|
35
|
+
return []
|
|
36
|
+
}
|
|
37
|
+
const valuePath = typeof spec.valuePath === 'string' && spec.valuePath !== '' ? spec.valuePath : ''
|
|
38
|
+
let value = readPath(object, spec.path)
|
|
39
|
+
if (spec.where && typeof spec.where === 'object') {
|
|
40
|
+
const entries = Array.isArray(value) ? value : []
|
|
41
|
+
const match = entries.find((entry) => entry && typeof entry === 'object'
|
|
42
|
+
&& Object.entries(spec.where).every(([key, wanted]) => entry[key] === wanted))
|
|
43
|
+
value = match && valuePath ? readPath(match, valuePath) : match
|
|
44
|
+
} else if (valuePath) {
|
|
45
|
+
value = readPath(value, valuePath)
|
|
46
|
+
}
|
|
47
|
+
if (typeof value === 'string') {
|
|
48
|
+
try {
|
|
49
|
+
value = JSON.parse(value)
|
|
50
|
+
} catch {
|
|
51
|
+
value = undefined
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return Array.isArray(value) ? value.filter((row) => row && typeof row === 'object' && !Array.isArray(row)) : []
|
|
55
|
+
}
|