@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.
Files changed (107) hide show
  1. package/dist/esm/components/CnActionButtons/CnActionButtons.vue.js +1 -1
  2. package/dist/esm/components/CnActionButtons/CnActionButtons.vue2.js +14 -0
  3. package/dist/esm/components/CnActionButtons/CnActionButtons.vue2.js.map +1 -1
  4. package/dist/esm/components/CnActionButtons/CnActionButtons.vue3.js +5 -4
  5. package/dist/esm/components/CnActionButtons/CnActionButtons.vue3.js.map +1 -1
  6. package/dist/esm/components/CnConditionListEditor/CnConditionListEditor.vue.js +9 -0
  7. package/dist/esm/components/CnConditionListEditor/CnConditionListEditor.vue.js.map +1 -0
  8. package/dist/esm/components/CnConditionListEditor/CnConditionListEditor.vue2.js +237 -0
  9. package/dist/esm/components/CnConditionListEditor/CnConditionListEditor.vue2.js.map +1 -0
  10. package/dist/esm/components/CnConditionListEditor/CnConditionListEditor.vue3.js +103 -0
  11. package/dist/esm/components/CnConditionListEditor/CnConditionListEditor.vue3.js.map +1 -0
  12. package/dist/esm/components/CnConditionListEditor/conditionOperators.js +121 -0
  13. package/dist/esm/components/CnConditionListEditor/conditionOperators.js.map +1 -0
  14. package/dist/esm/components/CnDetailPage/CnDetailPage.vue2.js +12 -0
  15. package/dist/esm/components/CnDetailPage/CnDetailPage.vue2.js.map +1 -1
  16. package/dist/esm/components/CnDetailPage/CnDetailPage.vue3.js +1 -1
  17. package/dist/esm/components/CnDetailPage/CnDetailPage.vue3.js.map +1 -1
  18. package/dist/esm/components/CnFieldListWidget/CnFieldListWidget.vue.js +1 -1
  19. package/dist/esm/components/CnFieldListWidget/CnFieldListWidget.vue2.js +85 -10
  20. package/dist/esm/components/CnFieldListWidget/CnFieldListWidget.vue2.js.map +1 -1
  21. package/dist/esm/components/CnFieldListWidget/CnFieldListWidget.vue3.js +60 -36
  22. package/dist/esm/components/CnFieldListWidget/CnFieldListWidget.vue3.js.map +1 -1
  23. package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js +8 -1
  24. package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js.map +1 -1
  25. package/dist/esm/components/CnIndexPage/CnIndexPage.vue3.js.map +1 -1
  26. package/dist/esm/components/CnIntegrationWidget/CnIntegrationWidget.vue.js +1 -1
  27. package/dist/esm/components/CnIntegrationWidget/CnIntegrationWidget.vue2.js +10 -0
  28. package/dist/esm/components/CnIntegrationWidget/CnIntegrationWidget.vue2.js.map +1 -1
  29. package/dist/esm/components/CnIntegrationWidget/CnIntegrationWidget.vue3.js.map +1 -1
  30. package/dist/esm/components/CnNcWidgetWidget/CnNcWidgetWidget.vue.js +1 -1
  31. package/dist/esm/components/CnNcWidgetWidget/CnNcWidgetWidget.vue2.js +46 -7
  32. package/dist/esm/components/CnNcWidgetWidget/CnNcWidgetWidget.vue2.js.map +1 -1
  33. package/dist/esm/components/CnNcWidgetWidget/CnNcWidgetWidget.vue3.js +1 -1
  34. package/dist/esm/components/CnNcWidgetWidget/CnNcWidgetWidget.vue3.js.map +1 -1
  35. package/dist/esm/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue.js +1 -1
  36. package/dist/esm/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue2.js +258 -6
  37. package/dist/esm/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue2.js.map +1 -1
  38. package/dist/esm/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue3.js +283 -131
  39. package/dist/esm/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue3.js.map +1 -1
  40. package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue.js +1 -1
  41. package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue2.js +42 -2
  42. package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue2.js.map +1 -1
  43. package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue3.js.map +1 -1
  44. package/dist/esm/components/CnTabsWidget/CnTabsWidget.vue.js +1 -1
  45. package/dist/esm/components/CnTabsWidget/CnTabsWidget.vue2.js +1 -1
  46. package/dist/esm/components/CnTabsWidget/CnTabsWidget.vue2.js.map +1 -1
  47. package/dist/esm/components/CnTabsWidget/CnTabsWidget.vue3.js.map +1 -1
  48. package/dist/esm/dialogs/CnPartyAddDialog.vue.js +9 -0
  49. package/dist/esm/dialogs/CnPartyAddDialog.vue.js.map +1 -0
  50. package/dist/esm/dialogs/CnPartyAddDialog.vue2.js +184 -0
  51. package/dist/esm/dialogs/CnPartyAddDialog.vue2.js.map +1 -0
  52. package/dist/esm/dialogs/CnPartyAddDialog.vue3.js +168 -0
  53. package/dist/esm/dialogs/CnPartyAddDialog.vue3.js.map +1 -0
  54. package/dist/esm/index.js +2 -0
  55. package/dist/esm/index.js.map +1 -1
  56. package/dist/esm/l10n/en.json.js +27 -1
  57. package/dist/esm/l10n/en.json.js.map +1 -1
  58. package/dist/esm/l10n/nl.json.js +27 -1
  59. package/dist/esm/l10n/nl.json.js.map +1 -1
  60. package/dist/esm/library-style.js +1 -1
  61. package/dist/esm/nextcloud-vue.css +353 -217
  62. package/dist/esm/store/plugins/liveUpdates.js +13 -4
  63. package/dist/esm/store/plugins/liveUpdates.js.map +1 -1
  64. package/dist/esm/store/useObjectStore.js +28 -5
  65. package/dist/esm/store/useObjectStore.js.map +1 -1
  66. package/dist/esm/utils/detailActionModel.js +6 -0
  67. package/dist/esm/utils/detailActionModel.js.map +1 -1
  68. package/dist/esm/utils/listLenses.js +20 -1
  69. package/dist/esm/utils/listLenses.js.map +1 -1
  70. package/dist/esm/utils/objectParties.js +79 -1
  71. package/dist/esm/utils/objectParties.js.map +1 -1
  72. package/dist/esm/utils/objectRows.js +59 -0
  73. package/dist/esm/utils/objectRows.js.map +1 -0
  74. package/dist/esm/utils/validateManifestV2.compiled.js +3 -3
  75. package/dist/esm/utils/validateManifestV2.compiled.js.map +1 -1
  76. package/dist/nextcloud-vue.cjs.js +7460 -5803
  77. package/dist/nextcloud-vue.cjs.js.map +2 -2
  78. package/dist/nextcloud-vue.css +353 -217
  79. package/l10n/en.json +27 -1
  80. package/l10n/nl.json +27 -1
  81. package/package.json +1 -1
  82. package/src/components/CnActionButtons/CnActionButtons.vue +15 -0
  83. package/src/components/CnConditionListEditor/CnConditionListEditor.vue +346 -0
  84. package/src/components/CnConditionListEditor/conditionOperators.js +126 -0
  85. package/src/components/CnConditionListEditor/index.js +17 -0
  86. package/src/components/CnDetailPage/CnDetailPage.md +1 -0
  87. package/src/components/CnDetailPage/CnDetailPage.vue +13 -1
  88. package/src/components/CnFieldListWidget/CnFieldListWidget.vue +105 -12
  89. package/src/components/CnIndexPage/CnIndexPage.vue +8 -1
  90. package/src/components/CnIntegrationWidget/CnIntegrationWidget.vue +10 -0
  91. package/src/components/CnNcWidgetWidget/CnNcWidgetWidget.vue +47 -8
  92. package/src/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue +401 -3
  93. package/src/components/CnRecordListWidget/CnRecordListWidget.vue +42 -2
  94. package/src/components/CnTabsWidget/CnTabsWidget.vue +1 -1
  95. package/src/components/index.js +1 -0
  96. package/src/css/look-board-index.css +6 -0
  97. package/src/css/look-board.css +35 -7
  98. package/src/dialogs/CnPartyAddDialog.vue +309 -0
  99. package/src/index.js +2 -0
  100. package/src/schemas/app-manifest-v2.schema.json +17 -1
  101. package/src/store/plugins/liveUpdates.js +13 -4
  102. package/src/store/useObjectStore.js +28 -5
  103. package/src/utils/detailActionModel.js +6 -0
  104. package/src/utils/listLenses.js +20 -1
  105. package/src/utils/objectParties.js +78 -0
  106. package/src/utils/objectRows.js +55 -0
  107. 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
+ }