@conduction/nextcloud-vue 2.165.0 → 2.166.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 +7 -0
- package/dist/esm/components/CnActionButtons/CnActionButtons.vue2.js.map +1 -1
- package/dist/esm/components/CnActionButtons/CnActionButtons.vue3.js.map +1 -1
- package/dist/esm/components/CnAuditTrailCard/CnAuditTrailCard.vue.js +1 -1
- package/dist/esm/components/CnAuditTrailCard/CnAuditTrailCard.vue2.js +10 -0
- package/dist/esm/components/CnAuditTrailCard/CnAuditTrailCard.vue2.js.map +1 -1
- package/dist/esm/components/CnAuditTrailCard/CnAuditTrailCard.vue3.js +1 -1
- package/dist/esm/components/CnAuditTrailCard/CnAuditTrailCard.vue3.js.map +1 -1
- package/dist/esm/components/CnChipListManager/CnChipListManager.vue.js +1 -1
- package/dist/esm/components/CnChipListManager/CnChipListManager.vue2.js.map +1 -1
- package/dist/esm/components/CnChipListManager/CnChipListManager.vue3.js.map +1 -1
- package/dist/esm/components/CnDashboardGrid/CnDashboardGrid.vue.js +1 -1
- package/dist/esm/components/CnDashboardGrid/CnDashboardGrid.vue2.js +50 -7
- package/dist/esm/components/CnDashboardGrid/CnDashboardGrid.vue2.js.map +1 -1
- package/dist/esm/components/CnDashboardGrid/CnDashboardGrid.vue3.js.map +1 -1
- package/dist/esm/components/CnDataTable/CnDataTable.vue2.js +13 -0
- package/dist/esm/components/CnDataTable/CnDataTable.vue2.js.map +1 -1
- package/dist/esm/components/CnDataTable/CnDataTable.vue3.js +1 -0
- package/dist/esm/components/CnDataTable/CnDataTable.vue3.js.map +1 -1
- package/dist/esm/components/CnDetailPage/CnDetailPage.vue2.js +39 -4
- package/dist/esm/components/CnDetailPage/CnDetailPage.vue2.js.map +1 -1
- package/dist/esm/components/CnDetailPage/CnDetailPage.vue3.js +2 -1
- package/dist/esm/components/CnDetailPage/CnDetailPage.vue3.js.map +1 -1
- package/dist/esm/components/CnExpandableRow/CnExpandableRow.vue.js +1 -1
- package/dist/esm/components/CnExpandableRow/CnExpandableRow.vue2.js.map +1 -1
- package/dist/esm/components/CnExpandableRow/CnExpandableRow.vue3.js.map +1 -1
- package/dist/esm/components/CnFieldGroupsWidget/CnFieldGroupsWidget.vue.js +9 -0
- package/dist/esm/components/CnFieldGroupsWidget/CnFieldGroupsWidget.vue.js.map +1 -0
- package/dist/esm/components/CnFieldGroupsWidget/CnFieldGroupsWidget.vue2.js +232 -0
- package/dist/esm/components/CnFieldGroupsWidget/CnFieldGroupsWidget.vue2.js.map +1 -0
- package/dist/esm/components/CnFieldGroupsWidget/CnFieldGroupsWidget.vue3.js +61 -0
- package/dist/esm/components/CnFieldGroupsWidget/CnFieldGroupsWidget.vue3.js.map +1 -0
- package/dist/esm/components/CnFieldGroupsWidget/index.js +28 -0
- package/dist/esm/components/CnFieldGroupsWidget/index.js.map +1 -0
- package/dist/esm/components/CnFieldListWidget/CnFieldListWidget.vue.js +1 -1
- package/dist/esm/components/CnFieldListWidget/CnFieldListWidget.vue2.js +80 -6
- package/dist/esm/components/CnFieldListWidget/CnFieldListWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnFieldListWidget/CnFieldListWidget.vue3.js +361 -289
- package/dist/esm/components/CnFieldListWidget/CnFieldListWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnFlowDetail/CnFlowDetail.vue.js +1 -1
- package/dist/esm/components/CnFlowDetail/CnFlowDetail.vue2.js +9 -0
- package/dist/esm/components/CnFlowDetail/CnFlowDetail.vue2.js.map +1 -1
- package/dist/esm/components/CnFlowDetail/CnFlowDetail.vue3.js +2 -1
- package/dist/esm/components/CnFlowDetail/CnFlowDetail.vue3.js.map +1 -1
- package/dist/esm/components/CnFlowDetail/CnFlowRunSummary.vue.js +1 -1
- package/dist/esm/components/CnFlowDetail/CnFlowRunSummary.vue2.js +21 -0
- package/dist/esm/components/CnFlowDetail/CnFlowRunSummary.vue2.js.map +1 -1
- package/dist/esm/components/CnFlowDetail/CnFlowRunSummary.vue3.js +12 -2
- package/dist/esm/components/CnFlowDetail/CnFlowRunSummary.vue3.js.map +1 -1
- package/dist/esm/components/CnFlowsPage/CnFlowBoard.vue.js +1 -1
- package/dist/esm/components/CnFlowsPage/CnFlowBoard.vue2.js +17 -0
- package/dist/esm/components/CnFlowsPage/CnFlowBoard.vue2.js.map +1 -1
- package/dist/esm/components/CnFlowsPage/CnFlowBoard.vue3.js +6 -3
- package/dist/esm/components/CnFlowsPage/CnFlowBoard.vue3.js.map +1 -1
- package/dist/esm/components/CnGraphCanvas/CnGraphCanvas.vue2.js +33 -2
- package/dist/esm/components/CnGraphCanvas/CnGraphCanvas.vue2.js.map +1 -1
- package/dist/esm/components/CnGraphCanvas/CnGraphCanvas.vue3.js +2 -2
- package/dist/esm/components/CnGraphCanvas/CnGraphCanvas.vue3.js.map +1 -1
- package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js +83 -8
- package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js.map +1 -1
- package/dist/esm/components/CnIndexPage/CnIndexPage.vue3.js +2 -1
- package/dist/esm/components/CnIndexPage/CnIndexPage.vue3.js.map +1 -1
- package/dist/esm/components/CnObjectLinksWidget/CnObjectLinkDialog.vue.js +9 -0
- package/dist/esm/components/CnObjectLinksWidget/CnObjectLinkDialog.vue.js.map +1 -0
- package/dist/esm/components/CnObjectLinksWidget/CnObjectLinkDialog.vue2.js +187 -0
- package/dist/esm/components/CnObjectLinksWidget/CnObjectLinkDialog.vue2.js.map +1 -0
- package/dist/esm/components/CnObjectLinksWidget/CnObjectLinkDialog.vue3.js +106 -0
- package/dist/esm/components/CnObjectLinksWidget/CnObjectLinkDialog.vue3.js.map +1 -0
- package/dist/esm/components/CnObjectLinksWidget/CnObjectLinksWidget.vue.js +9 -0
- package/dist/esm/components/CnObjectLinksWidget/CnObjectLinksWidget.vue.js.map +1 -0
- package/dist/esm/components/CnObjectLinksWidget/CnObjectLinksWidget.vue2.js +421 -0
- package/dist/esm/components/CnObjectLinksWidget/CnObjectLinksWidget.vue2.js.map +1 -0
- package/dist/esm/components/CnObjectLinksWidget/CnObjectLinksWidget.vue3.js +131 -0
- package/dist/esm/components/CnObjectLinksWidget/CnObjectLinksWidget.vue3.js.map +1 -0
- package/dist/esm/components/CnObjectLinksWidget/index.js +29 -0
- package/dist/esm/components/CnObjectLinksWidget/index.js.map +1 -0
- package/dist/esm/components/CnObjectLinksWidget/objectLinks.js +22 -0
- package/dist/esm/components/CnObjectLinksWidget/objectLinks.js.map +1 -0
- package/dist/esm/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue.js +1 -1
- package/dist/esm/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue2.js +48 -13
- package/dist/esm/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue3.js +44 -20
- package/dist/esm/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnPagination/CnPagination.vue2.js +26 -0
- package/dist/esm/components/CnPagination/CnPagination.vue2.js.map +1 -1
- package/dist/esm/components/CnPagination/CnPagination.vue3.js +40 -37
- package/dist/esm/components/CnPagination/CnPagination.vue3.js.map +1 -1
- package/dist/esm/components/CnWidgetGrid/registerDashboardWidgets.js +2 -0
- package/dist/esm/components/CnWidgetGrid/registerDashboardWidgets.js.map +1 -1
- package/dist/esm/components/CnWidgetObjectTable/CnWidgetObjectTable.vue.js +1 -1
- package/dist/esm/components/CnWidgetObjectTable/CnWidgetObjectTable.vue2.js +4 -0
- package/dist/esm/components/CnWidgetObjectTable/CnWidgetObjectTable.vue2.js.map +1 -1
- package/dist/esm/components/CnWidgetObjectTable/CnWidgetObjectTable.vue3.js.map +1 -1
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/l10n/en.json.js +18 -1
- package/dist/esm/l10n/en.json.js.map +1 -1
- package/dist/esm/l10n/nl.json.js +18 -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 +635 -329
- package/dist/esm/utils/actionsDispatcher.js +9 -5
- package/dist/esm/utils/actionsDispatcher.js.map +1 -1
- package/dist/esm/utils/libraryWidgetKeys.js +2 -0
- package/dist/esm/utils/libraryWidgetKeys.js.map +1 -1
- package/dist/esm/utils/objectParties.js +68 -1
- package/dist/esm/utils/objectParties.js.map +1 -1
- package/dist/esm/utils/overlayInset.js +60 -0
- package/dist/esm/utils/overlayInset.js.map +1 -0
- package/dist/esm/utils/validateManifestV2.compiled.js +2 -2
- package/dist/esm/utils/validateManifestV2.compiled.js.map +1 -1
- package/dist/esm/utils/widgetDispatch.js +4 -1
- package/dist/esm/utils/widgetDispatch.js.map +1 -1
- package/dist/nextcloud-vue.cjs.js +8444 -6584
- package/dist/nextcloud-vue.cjs.js.map +2 -2
- package/dist/nextcloud-vue.css +635 -329
- package/l10n/en.json +18 -1
- package/l10n/nl.json +18 -1
- package/package.json +1 -1
- package/src/components/CnActionButtons/CnActionButtons.vue +7 -0
- package/src/components/CnAuditTrailCard/CnAuditTrailCard.vue +11 -1
- package/src/components/CnChipListManager/CnChipListManager.vue +4 -1
- package/src/components/CnDashboardGrid/CnDashboardGrid.vue +50 -7
- package/src/components/CnDataTable/CnDataTable.md +1 -0
- package/src/components/CnDataTable/CnDataTable.vue +14 -0
- package/src/components/CnDetailPage/CnDetailPage.md +1 -0
- package/src/components/CnDetailPage/CnDetailPage.vue +40 -4
- package/src/components/CnExpandableRow/CnExpandableRow.vue +7 -4
- package/src/components/CnFieldGroupsWidget/CnFieldGroupsWidget.vue +287 -0
- package/src/components/CnFieldGroupsWidget/index.js +27 -0
- package/src/components/CnFieldListWidget/CnFieldListWidget.vue +162 -7
- package/src/components/CnFlowDetail/CnFlowDetail.vue +10 -0
- package/src/components/CnFlowDetail/CnFlowRunSummary.vue +26 -1
- package/src/components/CnFlowsPage/CnFlowBoard.vue +90 -4
- package/src/components/CnGraphCanvas/CnGraphCanvas.vue +35 -4
- package/src/components/CnIndexPage/CnIndexPage.md +1 -1
- package/src/components/CnIndexPage/CnIndexPage.vue +83 -7
- package/src/components/CnObjectLinksWidget/CnObjectLinkDialog.vue +267 -0
- package/src/components/CnObjectLinksWidget/CnObjectLinksWidget.vue +532 -0
- package/src/components/CnObjectLinksWidget/index.js +28 -0
- package/src/components/CnObjectLinksWidget/objectLinks.js +19 -0
- package/src/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue +65 -15
- package/src/components/CnPagination/CnPagination.md +1 -0
- package/src/components/CnPagination/CnPagination.vue +27 -1
- package/src/components/CnWidgetGrid/registerDashboardWidgets.js +2 -0
- package/src/components/CnWidgetObjectTable/CnWidgetObjectTable.vue +4 -0
- package/src/components/index.js +2 -0
- package/src/css/dialog.css +25 -3
- package/src/css/index-page.css +22 -8
- package/src/css/look-board-detail.css +41 -0
- package/src/css/look-board-index.css +52 -1
- package/src/css/look-board.css +17 -0
- package/src/index.js +2 -0
- package/src/schemas/app-manifest-v2.schema.json +3 -3
- package/src/utils/actionsDispatcher.js +9 -5
- package/src/utils/libraryWidgetKeys.js +2 -0
- package/src/utils/objectParties.js +67 -0
- package/src/utils/overlayInset.js +57 -0
- package/src/utils/validateManifestV2.compiled.js +2 -2
- package/src/utils/widgetDispatch.js +4 -1
package/l10n/en.json
CHANGED
|
@@ -2413,6 +2413,7 @@
|
|
|
2413
2413
|
"Icon": "Icon",
|
|
2414
2414
|
"Shown when you point at the view in the menu.": "Shown when you point at the view in the menu.",
|
|
2415
2415
|
"No main contact yet": "No main contact yet",
|
|
2416
|
+
"No secrecy": "No secrecy",
|
|
2416
2417
|
"is": "is",
|
|
2417
2418
|
"is not": "is not",
|
|
2418
2419
|
"greater than": "greater than",
|
|
@@ -2576,7 +2577,23 @@
|
|
|
2576
2577
|
"The assistant could not answer.": "The assistant could not answer.",
|
|
2577
2578
|
"Untitled agent": "Untitled agent",
|
|
2578
2579
|
"Untitled conversation": "Untitled conversation",
|
|
2579
|
-
"Colleague": "Colleague"
|
|
2580
|
+
"Colleague": "Colleague",
|
|
2581
|
+
"A step configuration must be a JSON object.": "A step configuration must be a JSON object.",
|
|
2582
|
+
"A structured value, as JSON.": "A structured value, as JSON.",
|
|
2583
|
+
"Advanced: edit as JSON": "Advanced: edit as JSON",
|
|
2584
|
+
"Configuration (JSON)": "Configuration (JSON)",
|
|
2585
|
+
"For example 0 9 * * 1 — 09:00 every Monday.": "For example 0 9 * * 1 — 09:00 every Monday.",
|
|
2586
|
+
"GET": "GET",
|
|
2587
|
+
"Not valid JSON, so the configuration keeps its previous value.": "Not valid JSON, so the configuration keeps its previous value.",
|
|
2588
|
+
"Not valid JSON, so this option keeps its previous value.": "Not valid JSON, so this option keeps its previous value.",
|
|
2589
|
+
"Pick a user…": "Pick a user…",
|
|
2590
|
+
"Pick one…": "Pick one…",
|
|
2591
|
+
"Remove step": "Remove step",
|
|
2592
|
+
"Required.": "Required.",
|
|
2593
|
+
"Shown on the card. Leave empty to show the step type.": "Shown on the card. Leave empty to show the step type.",
|
|
2594
|
+
"The full configuration document. The fields above update along.": "The full configuration document. The fields above update along.",
|
|
2595
|
+
"This step has no options.": "This step has no options.",
|
|
2596
|
+
"{uid} (you)": "{uid} (you)"
|
|
2580
2597
|
},
|
|
2581
2598
|
"plurals": {
|
|
2582
2599
|
"{count} member": [
|
package/l10n/nl.json
CHANGED
|
@@ -2665,6 +2665,7 @@
|
|
|
2665
2665
|
"Icon": "Pictogram",
|
|
2666
2666
|
"Shown when you point at the view in the menu.": "Te zien als u in het menu op de weergave wijst.",
|
|
2667
2667
|
"No main contact yet": "Nog geen hoofdcontact",
|
|
2668
|
+
"No secrecy": "Geen geheimhouding",
|
|
2668
2669
|
"is": "is",
|
|
2669
2670
|
"is not": "is niet",
|
|
2670
2671
|
"greater than": "groter dan",
|
|
@@ -2841,7 +2842,23 @@
|
|
|
2841
2842
|
"The assistant could not answer.": "De assistent kon geen antwoord geven.",
|
|
2842
2843
|
"Untitled agent": "Assistent zonder naam",
|
|
2843
2844
|
"Untitled conversation": "Gesprek zonder titel",
|
|
2844
|
-
"Colleague": "Collega"
|
|
2845
|
+
"Colleague": "Collega",
|
|
2846
|
+
"A step configuration must be a JSON object.": "De instellingen van een stap moeten een JSON-object zijn.",
|
|
2847
|
+
"A structured value, as JSON.": "Een samengestelde waarde, als JSON.",
|
|
2848
|
+
"Advanced: edit as JSON": "Geavanceerd: bewerken als JSON",
|
|
2849
|
+
"Configuration (JSON)": "Instellingen (JSON)",
|
|
2850
|
+
"For example 0 9 * * 1 — 09:00 every Monday.": "Bijvoorbeeld 0 9 * * 1: elke maandag om 09:00.",
|
|
2851
|
+
"GET": "GET",
|
|
2852
|
+
"Not valid JSON, so the configuration keeps its previous value.": "Geen geldige JSON, dus de instellingen houden hun vorige waarde.",
|
|
2853
|
+
"Not valid JSON, so this option keeps its previous value.": "Geen geldige JSON, dus deze optie houdt haar vorige waarde.",
|
|
2854
|
+
"Pick a user…": "Kies een gebruiker…",
|
|
2855
|
+
"Pick one…": "Kies er een…",
|
|
2856
|
+
"Remove step": "Stap verwijderen",
|
|
2857
|
+
"Required.": "Verplicht.",
|
|
2858
|
+
"Shown on the card. Leave empty to show the step type.": "Staat op de kaart. Laat leeg om het soort stap te tonen.",
|
|
2859
|
+
"The full configuration document. The fields above update along.": "Alle instellingen in één document. De velden hierboven passen zich aan.",
|
|
2860
|
+
"This step has no options.": "Deze stap heeft geen opties.",
|
|
2861
|
+
"{uid} (you)": "{uid} (jij)"
|
|
2845
2862
|
},
|
|
2846
2863
|
"plurals": {
|
|
2847
2864
|
"{count} member": [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@conduction/nextcloud-vue",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.166.0",
|
|
4
4
|
"description": "Shared Vue component library for Conduction Nextcloud apps — complements @nextcloud/vue with higher-level components, OpenRegister integration, and NL Design System support",
|
|
5
5
|
"homepage": "https://github.com/ConductionNL/nextcloud-vue#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -703,6 +703,13 @@ export default {
|
|
|
703
703
|
handler() { this.evaluateVisibility() },
|
|
704
704
|
},
|
|
705
705
|
|
|
706
|
+
// A workspace condition (`{ workspace: "callActive" }`) follows the
|
|
707
|
+
// page's workspace, which a page control or a call may change after mount.
|
|
708
|
+
workspaceCtx: {
|
|
709
|
+
deep: true,
|
|
710
|
+
handler() { this.evaluateVisibility() },
|
|
711
|
+
},
|
|
712
|
+
|
|
706
713
|
// Push the menu-ready descriptors at a `display: "menu"` host. It fires
|
|
707
714
|
// immediately so the host has the list on first paint, and again on
|
|
708
715
|
// every change of visibility, toggle state or pending flag — the three
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
<p v-if="footnote" class="cn-audit-card__footnote" data-testid="cn-audit-trail-widget-footnote">
|
|
68
68
|
{{ footnote }}
|
|
69
69
|
</p>
|
|
70
|
-
<template v-if="shownEntries.length > maxDisplay" #footer>
|
|
70
|
+
<template v-if="offersShowAll && shownEntries.length > maxDisplay" #footer>
|
|
71
71
|
<button class="cn-audit-card__show-all" @click="$emit('show-all')">
|
|
72
72
|
{{ showAllLabel }} ({{ shownEntries.length }})
|
|
73
73
|
</button>
|
|
@@ -284,6 +284,16 @@ export default {
|
|
|
284
284
|
return this.title || t('nextcloud-vue', 'Audit trail')
|
|
285
285
|
},
|
|
286
286
|
|
|
287
|
+
/**
|
|
288
|
+
* Whether the host listens for `show-all`. The audit-trail widget binds
|
|
289
|
+
* no listener, and a button that does nothing is not offered.
|
|
290
|
+
*
|
|
291
|
+
* @return {boolean}
|
|
292
|
+
*/
|
|
293
|
+
offersShowAll() {
|
|
294
|
+
return typeof this.$.vnode.props?.onShowAll === 'function'
|
|
295
|
+
},
|
|
296
|
+
|
|
287
297
|
/**
|
|
288
298
|
* The entries without the excluded actions and actors, and without an
|
|
289
299
|
* update that changed nothing: a re-save whose `changed` holds no field
|
|
@@ -410,7 +410,7 @@ export default {
|
|
|
410
410
|
padding: 0 4px 0 12px;
|
|
411
411
|
border-radius: 15px;
|
|
412
412
|
background: var(--color-background-dark);
|
|
413
|
-
color: var(--color-main-text);
|
|
413
|
+
color: var(--cn-board-text-soft, var(--color-main-text));
|
|
414
414
|
font-size: 14px;
|
|
415
415
|
font-weight: 600;
|
|
416
416
|
}
|
|
@@ -477,6 +477,9 @@ export default {
|
|
|
477
477
|
.cn-chip-list__input {
|
|
478
478
|
width: 100%;
|
|
479
479
|
height: 40px;
|
|
480
|
+
/* The server forces text inputs to 34px through a :not() chain; a
|
|
481
|
+
min-height still wins. */
|
|
482
|
+
min-height: 40px;
|
|
480
483
|
margin: 0;
|
|
481
484
|
padding: 0 12px;
|
|
482
485
|
box-sizing: border-box;
|
|
@@ -923,6 +923,12 @@ export default {
|
|
|
923
923
|
const resize = grid.resizeToContent.bind(grid)
|
|
924
924
|
const growing = new Set()
|
|
925
925
|
grid.resizeToContent = (el) => {
|
|
926
|
+
if (this.pendingSizes) {
|
|
927
|
+
if (!this.pendingSizes.includes(el)) {
|
|
928
|
+
this.pendingSizes.push(el)
|
|
929
|
+
}
|
|
930
|
+
return
|
|
931
|
+
}
|
|
926
932
|
this.matchRowHeights()
|
|
927
933
|
this.resizeKeepingOrder(grid, resize, growing, el)
|
|
928
934
|
if (growing.size === 0) {
|
|
@@ -1557,22 +1563,58 @@ export default {
|
|
|
1557
1563
|
return nodes.find((n) => String(n.id) === String(id)) || null
|
|
1558
1564
|
},
|
|
1559
1565
|
|
|
1566
|
+
/**
|
|
1567
|
+
* Make the cards a layout change brings in GridStack widgets, in the
|
|
1568
|
+
* order given (row order), and size the size-to-content ones only once
|
|
1569
|
+
* all are placed, in the same order. GridStack sizes such a cell the
|
|
1570
|
+
* moment it is added, and a card added after it onto a cell that has
|
|
1571
|
+
* grown pushes that cell below itself: the in-call tile row on
|
|
1572
|
+
* PqWerkplekKlant ended under every column card.
|
|
1573
|
+
*
|
|
1574
|
+
* @spec openspec/changes/dashboard-layout-swap-keeps-order/specs/dashboard-grid/spec.md#requirement-cards-a-layout-change-adds-keep-their-authored-order
|
|
1575
|
+
* @param {Array<HTMLElement>} els The new cells, top to bottom.
|
|
1576
|
+
* @return {void}
|
|
1577
|
+
*/
|
|
1578
|
+
addWidgetsInOrder(els) {
|
|
1579
|
+
if (els.length === 0) {
|
|
1580
|
+
return
|
|
1581
|
+
}
|
|
1582
|
+
const grid = toRaw(this.grid)
|
|
1583
|
+
const queued = []
|
|
1584
|
+
this.pendingSizes = queued
|
|
1585
|
+
try {
|
|
1586
|
+
for (const el of els) {
|
|
1587
|
+
grid.makeWidget(el)
|
|
1588
|
+
}
|
|
1589
|
+
} finally {
|
|
1590
|
+
this.pendingSizes = null
|
|
1591
|
+
}
|
|
1592
|
+
for (const el of queued) {
|
|
1593
|
+
grid.resizeToContent(el)
|
|
1594
|
+
}
|
|
1595
|
+
},
|
|
1596
|
+
|
|
1560
1597
|
syncGridItems(newLayout) {
|
|
1561
1598
|
// Add new items, and re-adopt items whose backing DOM element was
|
|
1562
1599
|
// replaced. When a consumer's `itemKey` changes for an unchanged
|
|
1563
1600
|
// `id` (e.g. a style edit — the documented use of `itemKey`), Vue
|
|
1564
1601
|
// swaps the element. GridStack keeps tracking the old, now-detached
|
|
1565
1602
|
// element, leaving the new one unmanaged (no positioning/sizing) —
|
|
1566
|
-
// so re-register it against the new element.
|
|
1567
|
-
|
|
1568
|
-
|
|
1603
|
+
// so re-register it against the new element. New items are added
|
|
1604
|
+
// together, top to bottom (`addWidgetsInOrder`).
|
|
1605
|
+
this.$nextTick(() => {
|
|
1606
|
+
if (!this.grid || !this.$refs.gridContainer) {
|
|
1607
|
+
return
|
|
1608
|
+
}
|
|
1609
|
+
const added = []
|
|
1610
|
+
for (const item of this.itemsInRowOrder) {
|
|
1569
1611
|
const el = this.$refs.gridContainer.querySelector(`[gs-id="${item.id}"]`)
|
|
1570
1612
|
if (!el) {
|
|
1571
|
-
|
|
1613
|
+
continue
|
|
1572
1614
|
}
|
|
1573
1615
|
const node = this.grid.engine.nodes.find((n) => String(n.id) === String(item.id))
|
|
1574
1616
|
if (!node) {
|
|
1575
|
-
|
|
1617
|
+
added.push(el)
|
|
1576
1618
|
} else if (node.el === el) {
|
|
1577
1619
|
// The layout MOVED an item the grid already tracks: the
|
|
1578
1620
|
// page re-compacts its display layout when a widget's
|
|
@@ -1601,8 +1643,9 @@ export default {
|
|
|
1601
1643
|
this.grid.removeWidget(node.el, false, false)
|
|
1602
1644
|
this.grid.makeWidget(el)
|
|
1603
1645
|
}
|
|
1604
|
-
}
|
|
1605
|
-
|
|
1646
|
+
}
|
|
1647
|
+
this.addWidgetsInOrder(added)
|
|
1648
|
+
})
|
|
1606
1649
|
|
|
1607
1650
|
// Remove items no longer in layout
|
|
1608
1651
|
const ids = newLayout.map((i) => String(i.id))
|
|
@@ -211,6 +211,7 @@ export default {
|
|
|
211
211
|
| `filterable` | Boolean | `false` | Show a filter button in every header whose column can filter: enum, boolean, text, number, date and reference columns backed by a schema property. A column opts out with `filterable: false`. Applying a filter emits `column-filter`; the host owns the state and passes it back as `activeFilters`. `CnIndexPage` turns it on by default. |
|
|
212
212
|
| `activeFilters` | Object | `{}` | The active filter map, `{ paramKey: values[] }`: the same map the facet sidebar writes, so a header filter and a sidebar filter on one field show the same state. |
|
|
213
213
|
| `localHeaders` (`local-headers`) | Boolean | `false` | Sort and filter the `rows` the table holds from its own headers, in the browser: for a table that holds every row (a settings table read from an app endpoint) and has no host keeping the state. `sort` and `column-filter` still emit; `sortKey`, `sortKeys` and `activeFilters` are not read. |
|
|
214
|
+
| `framed` | Boolean | `false` | Frame a table that sits straight in a card, as the Pipelinq POS boards draw it: a 1px frame with an 8px radius, 18px outer cell insets and a rule under the head and every row but the last. Board look only; the Nextcloud look ignores it. |
|
|
214
215
|
| `filterSchema` | Object | `null` | The schema the header filters read instead of `schema`, for a page that filters through other fields than the rows' own (a named source's search fields). Null: the header filters read `schema`. |
|
|
215
216
|
| `filterChips` | Boolean | `true` | Draw the active header filters as removable chips above the table. A host that lists them itself (the index page's board Active line) turns this off, so a filter is not shown twice. |
|
|
216
217
|
| `filterRegister` | String | `''` | Register slug a reference column's filter searches in when the column names none. |
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
'cn-table-container--title-strong': isBoardLook && rowTitle === 'strong',
|
|
10
10
|
'cn-table-container--scrollable': scrollable,
|
|
11
11
|
'cn-table-container--borderless': borderless,
|
|
12
|
+
'cn-table-container--framed': framed,
|
|
12
13
|
'cn-table-container--fill': fillHeight,
|
|
13
14
|
}">
|
|
14
15
|
<!-- Optional card header (folded from the retired CnTableWidget): a title
|
|
@@ -926,6 +927,19 @@ export default {
|
|
|
926
927
|
default: false,
|
|
927
928
|
},
|
|
928
929
|
|
|
930
|
+
/**
|
|
931
|
+
* Frame a table that sits straight in a card, as the Pipelinq POS boards
|
|
932
|
+
* draw it (PqKassa "Aankoopgeschiedenis"): a 1px frame with an 8px
|
|
933
|
+
* radius, 18px outer cell insets and a rule under the head and every row
|
|
934
|
+
* but the last. Board look only; the Nextcloud look ignores it.
|
|
935
|
+
*
|
|
936
|
+
* @spec openspec/changes/data-table-framed/specs/data-table-framed/spec.md#requirement-a-data-table-in-a-card-can-be-framed
|
|
937
|
+
*/
|
|
938
|
+
framed: {
|
|
939
|
+
type: Boolean,
|
|
940
|
+
default: false,
|
|
941
|
+
},
|
|
942
|
+
|
|
929
943
|
/**
|
|
930
944
|
* Fill the height of the parent (a flex-column card / widget content
|
|
931
945
|
* area) so the optional `#footer` is pushed to the bottom instead of
|
|
@@ -380,6 +380,7 @@ The header carries the shared [CnActionsMenu](./cn-actions-menu.md) overflow (Re
|
|
|
380
380
|
| `editTitle` | String | `''` | Title of the record edit form, run through the host translate. Empty uses the Edit button's label. |
|
|
381
381
|
| `editSubtitle` | String | `''` | One line under the edit form's title, run through the host translate. Empty shows none. |
|
|
382
382
|
| `editConfirmLabel` | String | `''` | The edit form's save button, run through the host translate (manifest `config.editConfirmLabel`), such as "Save changes". Empty keeps the form's own label. |
|
|
383
|
+
| `editEyebrow` | String | `''` | One short line over the edit form's title (PqTicketBewerken "Bewerken · PQ-2026-0417"), run through the host translate. Like the title and subtitle it may name the record with `{field}` tokens. Empty shows none. |
|
|
383
384
|
| `showRequestFeature` | Boolean | `true` | Show the Request-a-feature item. Emits `@request-feature`; the default opens the forge's feature-request issue form (repo and forge injected by CnAppRoot) in a new tab, pre-filled with the page title and `surface: "detail:<id>"`. |
|
|
384
385
|
| `documentationUrl` | String | `''` | When set, adds a **Documentation** entry opening the link in a new tab. Empty hides it. |
|
|
385
386
|
| `documentationLabel` | String | `t('Documentation')` | Pre-translated Documentation label. |
|
|
@@ -1335,6 +1335,7 @@
|
|
|
1335
1335
|
:item="currentObject"
|
|
1336
1336
|
:register="register"
|
|
1337
1337
|
:dialogTitle="editFormTitle"
|
|
1338
|
+
:eyebrow="editFormEyebrow"
|
|
1338
1339
|
:subtitle="editFormSubtitle"
|
|
1339
1340
|
:confirmLabel="editFormConfirmLabel"
|
|
1340
1341
|
:excludeFields="excludeFields"
|
|
@@ -2502,6 +2503,16 @@ export default {
|
|
|
2502
2503
|
default: '',
|
|
2503
2504
|
},
|
|
2504
2505
|
|
|
2506
|
+
/**
|
|
2507
|
+
* One short line over the edit form's title (PqTicketBewerken "Bewerken ·
|
|
2508
|
+
* PQ-2026-0417"), run through the host translate. Like the title and
|
|
2509
|
+
* subtitle it may name the record with `{field}` tokens. Empty shows none.
|
|
2510
|
+
*/
|
|
2511
|
+
editEyebrow: {
|
|
2512
|
+
type: String,
|
|
2513
|
+
default: '',
|
|
2514
|
+
},
|
|
2515
|
+
|
|
2505
2516
|
/** The edit form's save button, run through the host translate. Empty keeps the form's own label. */
|
|
2506
2517
|
editConfirmLabel: {
|
|
2507
2518
|
type: String,
|
|
@@ -5020,14 +5031,22 @@ export default {
|
|
|
5020
5031
|
return this.editLabel ? this.effectiveTranslate(this.editLabel) : t('nextcloud-vue', 'Edit')
|
|
5021
5032
|
},
|
|
5022
5033
|
|
|
5023
|
-
/** @return {string} The edit form's title, translated; the Edit button's label when none is configured. */
|
|
5034
|
+
/** @return {string} The edit form's title, translated and filled from the record; the Edit button's label when none is configured. */
|
|
5024
5035
|
editFormTitle() {
|
|
5025
|
-
return this.editTitle ? this.
|
|
5036
|
+
return this.editTitle ? this.editFormHeaderText(this.editTitle) : this.editActionLabel
|
|
5026
5037
|
},
|
|
5027
5038
|
|
|
5028
|
-
/** @return {string} The edit form's subtitle, translated; empty when none is configured. */
|
|
5039
|
+
/** @return {string} The edit form's subtitle, translated and filled from the record; empty when none is configured. */
|
|
5029
5040
|
editFormSubtitle() {
|
|
5030
|
-
return this.editSubtitle ? this.
|
|
5041
|
+
return this.editSubtitle ? this.editFormHeaderText(this.editSubtitle) : ''
|
|
5042
|
+
},
|
|
5043
|
+
|
|
5044
|
+
/**
|
|
5045
|
+
* @return {string} The edit form's eyebrow, translated and filled from the record; empty when none is configured.
|
|
5046
|
+
* @spec openspec/changes/detail-edit-form-header-from-record/specs/detail-page/spec.md#requirement-the-edit-forms-header-can-name-the-record
|
|
5047
|
+
*/
|
|
5048
|
+
editFormEyebrow() {
|
|
5049
|
+
return this.editEyebrow ? this.editFormHeaderText(this.editEyebrow) : ''
|
|
5031
5050
|
},
|
|
5032
5051
|
|
|
5033
5052
|
/** @return {string} The edit form's save button, translated; empty keeps the form's own label. */
|
|
@@ -6236,6 +6255,23 @@ export default {
|
|
|
6236
6255
|
},
|
|
6237
6256
|
|
|
6238
6257
|
methods: {
|
|
6258
|
+
/**
|
|
6259
|
+
* A configured edit form title, subtitle or eyebrow, translated, with its
|
|
6260
|
+
* `{field}` tokens filled from the record as the header line fills them
|
|
6261
|
+
* (an enum value reads its label). Text without tokens stays as written.
|
|
6262
|
+
*
|
|
6263
|
+
* @spec openspec/changes/detail-edit-form-header-from-record/specs/detail-page/spec.md#requirement-the-edit-forms-header-can-name-the-record
|
|
6264
|
+
* @param {string} text The configured text.
|
|
6265
|
+
* @return {string} The text to show.
|
|
6266
|
+
*/
|
|
6267
|
+
editFormHeaderText(text) {
|
|
6268
|
+
const translated = this.effectiveTranslate(text)
|
|
6269
|
+
if (!/\{[^}]+\}/.test(translated)) {
|
|
6270
|
+
return translated
|
|
6271
|
+
}
|
|
6272
|
+
return resolveHeaderMeta(translated, this.resolvedObject, { schema: this.currentSchema, translate: this.effectiveTranslate })
|
|
6273
|
+
},
|
|
6274
|
+
|
|
6239
6275
|
/**
|
|
6240
6276
|
* Read the record's newest create or update audit entry into
|
|
6241
6277
|
* `lastChange`; a failed read leaves it null.
|
|
@@ -869,7 +869,9 @@ export default {
|
|
|
869
869
|
align-items: center;
|
|
870
870
|
}
|
|
871
871
|
|
|
872
|
-
|
|
872
|
+
/* With the wrapper class, so these outrank Nextcloud's plain-button rule
|
|
873
|
+
(`button:not(.button-vue,...)`, 0,2,1), which drew a grey 22px button. */
|
|
874
|
+
.cn-expandable-row__th .cn-expandable-row__sort {
|
|
873
875
|
display: inline-flex;
|
|
874
876
|
gap: 4px;
|
|
875
877
|
align-items: center;
|
|
@@ -877,6 +879,7 @@ export default {
|
|
|
877
879
|
margin: 0;
|
|
878
880
|
padding: 0;
|
|
879
881
|
border: 0;
|
|
882
|
+
border-radius: 0;
|
|
880
883
|
background: transparent;
|
|
881
884
|
color: inherit;
|
|
882
885
|
font: inherit;
|
|
@@ -902,7 +905,7 @@ export default {
|
|
|
902
905
|
display: inline-flex;
|
|
903
906
|
}
|
|
904
907
|
|
|
905
|
-
.cn-expandable-row__filter {
|
|
908
|
+
.cn-expandable-row__filter-anchor .cn-expandable-row__filter {
|
|
906
909
|
display: inline-flex;
|
|
907
910
|
align-items: center;
|
|
908
911
|
justify-content: center;
|
|
@@ -918,8 +921,8 @@ export default {
|
|
|
918
921
|
cursor: pointer;
|
|
919
922
|
}
|
|
920
923
|
|
|
921
|
-
.cn-expandable-row__filter:hover,
|
|
922
|
-
.cn-expandable-row__filter--active {
|
|
924
|
+
.cn-expandable-row__filter-anchor .cn-expandable-row__filter:hover,
|
|
925
|
+
.cn-expandable-row__filter-anchor .cn-expandable-row__filter--active {
|
|
923
926
|
background: var(--color-primary-element-light);
|
|
924
927
|
color: var(--color-primary-element-light-text, var(--color-primary-element));
|
|
925
928
|
}
|
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
- SPDX-FileCopyrightText: 2026 Conduction B.V.
|
|
3
|
+
- SPDX-License-Identifier: EUPL-1.2
|
|
4
|
+
-->
|
|
5
|
+
|
|
6
|
+
<template>
|
|
7
|
+
<div class="cn-field-groups-widget" data-testid="cn-field-groups-widget">
|
|
8
|
+
<CnFieldListWidget
|
|
9
|
+
v-for="(group, index) in groupContents"
|
|
10
|
+
:key="`${group.field}-${index}`"
|
|
11
|
+
:ref="(el) => setList(index, el)"
|
|
12
|
+
:content="group"
|
|
13
|
+
:objectData="objectData"
|
|
14
|
+
:objectId="objectId"
|
|
15
|
+
:register="register"
|
|
16
|
+
:schema="schema"
|
|
17
|
+
@header="onGroupHeader(index, $event)"
|
|
18
|
+
@saved="onSaved" />
|
|
19
|
+
<NcActions
|
|
20
|
+
v-if="!inTitle && menuItems.length > 0"
|
|
21
|
+
:menuName="addLabel"
|
|
22
|
+
:ariaLabel="addAriaLabel"
|
|
23
|
+
class="cn-field-groups-widget__add"
|
|
24
|
+
data-testid="cn-field-groups-add">
|
|
25
|
+
<template #icon>
|
|
26
|
+
<Plus :size="16" />
|
|
27
|
+
</template>
|
|
28
|
+
<NcActionButton
|
|
29
|
+
v-for="item in menuItems"
|
|
30
|
+
:key="item.key"
|
|
31
|
+
:data-testid="`cn-field-groups-add-${item.key}`"
|
|
32
|
+
@click="item.run">
|
|
33
|
+
{{ item.label }}
|
|
34
|
+
</NcActionButton>
|
|
35
|
+
</NcActions>
|
|
36
|
+
</div>
|
|
37
|
+
</template>
|
|
38
|
+
|
|
39
|
+
<script>
|
|
40
|
+
import { NcActionButton, NcActions } from '@nextcloud/vue'
|
|
41
|
+
import Plus from 'vue-material-design-icons/Plus.vue'
|
|
42
|
+
import CnFieldListWidget from '../CnFieldListWidget/CnFieldListWidget.vue'
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* CnFieldGroupsWidget: the `field-groups` widget: several list fields of the
|
|
46
|
+
* record in one card, each drawn as a field list in the pairs look (a label
|
|
47
|
+
* beside a value), with one "Add" that offers a choice of list. Board PqKlant
|
|
48
|
+
* "Contactkanalen": e-mail addresses, phone numbers and social profiles, one
|
|
49
|
+
* "Toevoegen" menu in the card's title row.
|
|
50
|
+
*
|
|
51
|
+
* Each group is a `field-list` content (`field`, `row`, `add`, `edit`,
|
|
52
|
+
* `remove`, `mirror`, `emptyLabel`, `emptyText`), so a group saves exactly as
|
|
53
|
+
* a field list does: one PATCH of its own field after re-reading the stored
|
|
54
|
+
* value, the server's refusal shown in its words.
|
|
55
|
+
*
|
|
56
|
+
* @spec openspec/changes/contact-side-cards-generic/specs/contact-side-cards-generic/spec.md#requirement-several-list-fields-share-one-card-and-one-add-menu
|
|
57
|
+
*/
|
|
58
|
+
export default {
|
|
59
|
+
name: 'CnFieldGroupsWidget',
|
|
60
|
+
|
|
61
|
+
components: { CnFieldListWidget, NcActionButton, NcActions, Plus },
|
|
62
|
+
|
|
63
|
+
inject: {
|
|
64
|
+
cnTranslate: { default: () => (key) => key },
|
|
65
|
+
},
|
|
66
|
+
|
|
67
|
+
props: {
|
|
68
|
+
/**
|
|
69
|
+
* The widget configuration.
|
|
70
|
+
*
|
|
71
|
+
* - `groups`: `[<field-list content>]`, drawn in order in the pairs look.
|
|
72
|
+
* - `add`: `{ label?, ariaLabel?, placement?: 'title' | 'footer' }`: the one Add, a menu with an
|
|
73
|
+
* item per group that has an `add` (the group's `add.label`). `title` reports it for the card's
|
|
74
|
+
* title row on the `header` event; `footer` (default) draws it under the groups.
|
|
75
|
+
* - `readOnly`: no add, edit or remove in any group.
|
|
76
|
+
* - `afterSave`: the field-list `afterSave` for every group that declares none.
|
|
77
|
+
*
|
|
78
|
+
* @type {object}
|
|
79
|
+
*/
|
|
80
|
+
content: {
|
|
81
|
+
type: Object,
|
|
82
|
+
default: () => ({}),
|
|
83
|
+
},
|
|
84
|
+
|
|
85
|
+
/** The current detail-page object. */
|
|
86
|
+
objectData: {
|
|
87
|
+
type: Object,
|
|
88
|
+
default: null,
|
|
89
|
+
},
|
|
90
|
+
|
|
91
|
+
/** The current object id. */
|
|
92
|
+
objectId: {
|
|
93
|
+
type: [String, Number],
|
|
94
|
+
default: '',
|
|
95
|
+
},
|
|
96
|
+
|
|
97
|
+
/** OpenRegister register slug of the surface. */
|
|
98
|
+
register: {
|
|
99
|
+
type: [String, Object],
|
|
100
|
+
default: '',
|
|
101
|
+
},
|
|
102
|
+
|
|
103
|
+
/** OpenRegister schema slug of the surface. */
|
|
104
|
+
schema: {
|
|
105
|
+
type: [String, Object],
|
|
106
|
+
default: '',
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
|
|
110
|
+
emits: ['header', 'saved'],
|
|
111
|
+
|
|
112
|
+
data() {
|
|
113
|
+
return {
|
|
114
|
+
/** The add action each group reported, by group index. */
|
|
115
|
+
groupActions: {},
|
|
116
|
+
/** The mounted field lists, by group index. */
|
|
117
|
+
lists: {},
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
|
|
121
|
+
computed: {
|
|
122
|
+
/**
|
|
123
|
+
* The groups as field-list contents: the pairs look, the add opened
|
|
124
|
+
* from this widget's menu, and the shared `readOnly` and `afterSave`.
|
|
125
|
+
*
|
|
126
|
+
* @return {Array<object>}
|
|
127
|
+
*/
|
|
128
|
+
groupContents() {
|
|
129
|
+
const groups = Array.isArray(this.content.groups) ? this.content.groups : []
|
|
130
|
+
return groups
|
|
131
|
+
.filter((group) => group && typeof group.field === 'string' && group.field !== '')
|
|
132
|
+
.map((group) => ({
|
|
133
|
+
...group,
|
|
134
|
+
variant: 'pairs',
|
|
135
|
+
readOnly: this.content.readOnly === true || group.readOnly === true,
|
|
136
|
+
afterSave: group.afterSave || this.content.afterSave,
|
|
137
|
+
add: group.add ? { ...group.add, trigger: 'button', placement: 'title' } : undefined,
|
|
138
|
+
}))
|
|
139
|
+
},
|
|
140
|
+
|
|
141
|
+
/** Whether the Add sits in the card's title row. */
|
|
142
|
+
inTitle() {
|
|
143
|
+
return this.content.add?.placement === 'title'
|
|
144
|
+
},
|
|
145
|
+
|
|
146
|
+
addLabel() {
|
|
147
|
+
return this.tr(this.content.add?.label || 'Add')
|
|
148
|
+
},
|
|
149
|
+
|
|
150
|
+
addAriaLabel() {
|
|
151
|
+
return this.tr(this.content.add?.ariaLabel || '') || this.addLabel
|
|
152
|
+
},
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* One item per group that can add: its label, and opening its form.
|
|
156
|
+
*
|
|
157
|
+
* @return {Array<{key: string, label: string, run: () => void}>}
|
|
158
|
+
*/
|
|
159
|
+
menuItems() {
|
|
160
|
+
return this.groupContents
|
|
161
|
+
.map((group, index) => ({ group, index, action: this.groupActions[index] }))
|
|
162
|
+
.filter(({ action }) => action)
|
|
163
|
+
.map(({ group, index, action }) => ({
|
|
164
|
+
key: `${group.field}-${index}`,
|
|
165
|
+
label: action.label,
|
|
166
|
+
run: () => this.openGroup(index),
|
|
167
|
+
}))
|
|
168
|
+
},
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* What the card's title row draws: one outlined Add with the menu.
|
|
172
|
+
*
|
|
173
|
+
* @return {{actions: Array<object>}}
|
|
174
|
+
*/
|
|
175
|
+
header() {
|
|
176
|
+
if (!this.inTitle || this.menuItems.length === 0) {
|
|
177
|
+
return { actions: [] }
|
|
178
|
+
}
|
|
179
|
+
return {
|
|
180
|
+
actions: [{
|
|
181
|
+
label: this.addLabel,
|
|
182
|
+
ariaLabel: this.addAriaLabel,
|
|
183
|
+
icon: 'Plus',
|
|
184
|
+
variant: 'secondary',
|
|
185
|
+
items: this.menuItems.map(({ label, run }) => ({ label, run })),
|
|
186
|
+
}],
|
|
187
|
+
}
|
|
188
|
+
},
|
|
189
|
+
},
|
|
190
|
+
|
|
191
|
+
watch: {
|
|
192
|
+
header: {
|
|
193
|
+
immediate: true,
|
|
194
|
+
handler(header) {
|
|
195
|
+
/**
|
|
196
|
+
* @event header The card's title-row actions, `{ actions }`, for the host to draw.
|
|
197
|
+
*/
|
|
198
|
+
this.$emit('header', header)
|
|
199
|
+
},
|
|
200
|
+
},
|
|
201
|
+
},
|
|
202
|
+
|
|
203
|
+
methods: {
|
|
204
|
+
/**
|
|
205
|
+
* Pass a group's save on.
|
|
206
|
+
*
|
|
207
|
+
* @param {{field: string, value: Array}} payload The group's field and the list it saved.
|
|
208
|
+
*/
|
|
209
|
+
onSaved(payload) {
|
|
210
|
+
/**
|
|
211
|
+
* @event saved One group's list was saved: one PATCH of its field succeeded.
|
|
212
|
+
* @type {{field: string, value: Array}}
|
|
213
|
+
*/
|
|
214
|
+
this.$emit('saved', payload)
|
|
215
|
+
},
|
|
216
|
+
|
|
217
|
+
tr(text) {
|
|
218
|
+
if (typeof text !== 'string' || text === '') {
|
|
219
|
+
return ''
|
|
220
|
+
}
|
|
221
|
+
return typeof this.cnTranslate === 'function' ? this.cnTranslate(text) : text
|
|
222
|
+
},
|
|
223
|
+
|
|
224
|
+
setList(index, el) {
|
|
225
|
+
if (el) {
|
|
226
|
+
this.lists[index] = el
|
|
227
|
+
} else {
|
|
228
|
+
delete this.lists[index]
|
|
229
|
+
}
|
|
230
|
+
},
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* Keep the add action a group reported (none on a read-only group).
|
|
234
|
+
*
|
|
235
|
+
* @param {number} index The group.
|
|
236
|
+
* @param {{actions?: Array}} header What the group reported.
|
|
237
|
+
* @return {void}
|
|
238
|
+
*/
|
|
239
|
+
onGroupHeader(index, header) {
|
|
240
|
+
const action = (header && Array.isArray(header.actions) ? header.actions : []).find((candidate) => candidate && candidate.add)
|
|
241
|
+
if (action) {
|
|
242
|
+
this.groupActions = { ...this.groupActions, [index]: action }
|
|
243
|
+
} else if (this.groupActions[index]) {
|
|
244
|
+
const rest = { ...this.groupActions }
|
|
245
|
+
delete rest[index]
|
|
246
|
+
this.groupActions = rest
|
|
247
|
+
}
|
|
248
|
+
},
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* Open one group's form and close the others.
|
|
252
|
+
*
|
|
253
|
+
* @param {number} index The group.
|
|
254
|
+
* @return {void}
|
|
255
|
+
*/
|
|
256
|
+
openGroup(index) {
|
|
257
|
+
for (const [key, list] of Object.entries(this.lists)) {
|
|
258
|
+
if (Number(key) !== index && list) {
|
|
259
|
+
list.adding = false
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
const list = this.lists[index]
|
|
263
|
+
if (list) {
|
|
264
|
+
list.adding = true
|
|
265
|
+
}
|
|
266
|
+
},
|
|
267
|
+
},
|
|
268
|
+
}
|
|
269
|
+
</script>
|
|
270
|
+
|
|
271
|
+
<style scoped>
|
|
272
|
+
.cn-field-groups-widget {
|
|
273
|
+
display: flex;
|
|
274
|
+
flex-direction: column;
|
|
275
|
+
align-items: stretch;
|
|
276
|
+
gap: 8px;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
/* One label column for every group, so the labels line up across the lists. */
|
|
280
|
+
.cn-field-groups-widget :deep(.cn-field-list-widget__pairs) {
|
|
281
|
+
grid-template-columns: 120px minmax(0, 1fr);
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
.cn-field-groups-widget__add {
|
|
285
|
+
align-self: flex-start;
|
|
286
|
+
}
|
|
287
|
+
</style>
|