@conduction/nextcloud-vue 2.56.0-beta.69 → 2.56.0-beta.70
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 +1 -1
- package/dist/esm/components/CnActionDialog/CnActionDialog.vue2.js +114 -11
- package/dist/esm/components/CnActionDialog/CnActionDialog.vue2.js.map +1 -1
- package/dist/esm/components/CnActionDialog/CnActionDialog.vue3.js +67 -17
- package/dist/esm/components/CnActionDialog/CnActionDialog.vue3.js.map +1 -1
- package/dist/esm/components/CnBlockListEditor/CnBlockListEditor.vue.js +9 -0
- package/dist/esm/components/CnBlockListEditor/CnBlockListEditor.vue.js.map +1 -0
- package/dist/esm/components/CnBlockListEditor/CnBlockListEditor.vue2.js +352 -0
- package/dist/esm/components/CnBlockListEditor/CnBlockListEditor.vue2.js.map +1 -0
- package/dist/esm/components/CnBlockListEditor/CnBlockListEditor.vue3.js +266 -0
- package/dist/esm/components/CnBlockListEditor/CnBlockListEditor.vue3.js.map +1 -0
- package/dist/esm/components/CnChecklistRunWidget/CnChecklistRunWidget.vue.js +1 -1
- package/dist/esm/components/CnChecklistRunWidget/CnChecklistRunWidget.vue2.js +257 -7
- package/dist/esm/components/CnChecklistRunWidget/CnChecklistRunWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnChecklistRunWidget/CnChecklistRunWidget.vue3.js +113 -59
- package/dist/esm/components/CnChecklistRunWidget/CnChecklistRunWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnChildRecordsField/CnChildRecordsField.vue.js +1 -1
- package/dist/esm/components/CnChildRecordsField/CnChildRecordsField.vue2.js +210 -5
- package/dist/esm/components/CnChildRecordsField/CnChildRecordsField.vue2.js.map +1 -1
- package/dist/esm/components/CnChildRecordsField/CnChildRecordsField.vue3.js +134 -46
- package/dist/esm/components/CnChildRecordsField/CnChildRecordsField.vue3.js.map +1 -1
- package/dist/esm/components/CnChoiceMatrix/CnChoiceMatrix.vue.js +9 -0
- package/dist/esm/components/CnChoiceMatrix/CnChoiceMatrix.vue.js.map +1 -0
- package/dist/esm/components/CnChoiceMatrix/CnChoiceMatrix.vue2.js +385 -0
- package/dist/esm/components/CnChoiceMatrix/CnChoiceMatrix.vue2.js.map +1 -0
- package/dist/esm/components/CnChoiceMatrix/CnChoiceMatrix.vue3.js +277 -0
- package/dist/esm/components/CnChoiceMatrix/CnChoiceMatrix.vue3.js.map +1 -0
- package/dist/esm/components/CnCountdownWidget/CnCountdownWidget.vue.js +1 -1
- package/dist/esm/components/CnCountdownWidget/CnCountdownWidget.vue2.js +175 -20
- package/dist/esm/components/CnCountdownWidget/CnCountdownWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnCountdownWidget/CnCountdownWidget.vue3.js +30 -8
- package/dist/esm/components/CnCountdownWidget/CnCountdownWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnCreateFormWidget/CnCreateFormWidget.vue.js +1 -1
- package/dist/esm/components/CnCreateFormWidget/CnCreateFormWidget.vue2.js +72 -6
- package/dist/esm/components/CnCreateFormWidget/CnCreateFormWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnCreateFormWidget/CnCreateFormWidget.vue3.js +48 -14
- package/dist/esm/components/CnCreateFormWidget/CnCreateFormWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnDataMatrix/CnDataMatrix.vue.js +1 -1
- package/dist/esm/components/CnDataMatrix/CnDataMatrix.vue2.js +162 -9
- package/dist/esm/components/CnDataMatrix/CnDataMatrix.vue2.js.map +1 -1
- package/dist/esm/components/CnDataMatrix/CnDataMatrix.vue3.js +63 -23
- package/dist/esm/components/CnDataMatrix/CnDataMatrix.vue3.js.map +1 -1
- package/dist/esm/components/CnDisplayScreen/CnDisplayScreen.vue.js +9 -0
- package/dist/esm/components/CnDisplayScreen/CnDisplayScreen.vue.js.map +1 -0
- package/dist/esm/components/CnDisplayScreen/CnDisplayScreen.vue2.js +175 -0
- package/dist/esm/components/CnDisplayScreen/CnDisplayScreen.vue2.js.map +1 -0
- package/dist/esm/components/CnDisplayScreen/CnDisplayScreen.vue3.js +114 -0
- package/dist/esm/components/CnDisplayScreen/CnDisplayScreen.vue3.js.map +1 -0
- package/dist/esm/components/CnDurationField/CnDurationField.vue.js +1 -1
- package/dist/esm/components/CnDurationField/CnDurationField.vue2.js +218 -4
- package/dist/esm/components/CnDurationField/CnDurationField.vue2.js.map +1 -1
- package/dist/esm/components/CnDurationField/CnDurationField.vue3.js +133 -44
- package/dist/esm/components/CnDurationField/CnDurationField.vue3.js.map +1 -1
- package/dist/esm/components/CnFormDialog/CnFormDialog.vue.js +1 -1
- package/dist/esm/components/CnFormDialog/CnFormDialog.vue2.js.map +1 -1
- package/dist/esm/components/CnFormDialog/CnFormDialog.vue3.js +5 -1
- package/dist/esm/components/CnFormDialog/CnFormDialog.vue3.js.map +1 -1
- package/dist/esm/components/CnGeoCaptureField/CnGeoCaptureField.vue.js +9 -0
- package/dist/esm/components/CnGeoCaptureField/CnGeoCaptureField.vue.js.map +1 -0
- package/dist/esm/components/CnGeoCaptureField/CnGeoCaptureField.vue2.js +113 -0
- package/dist/esm/components/CnGeoCaptureField/CnGeoCaptureField.vue2.js.map +1 -0
- package/dist/esm/components/CnGeoCaptureField/CnGeoCaptureField.vue3.js +43 -0
- package/dist/esm/components/CnGeoCaptureField/CnGeoCaptureField.vue3.js.map +1 -0
- package/dist/esm/components/CnMarkdownEditor/CnMarkdownEditor.vue.js +1 -1
- package/dist/esm/components/CnMarkdownEditor/CnMarkdownEditor.vue2.js +110 -1
- package/dist/esm/components/CnMarkdownEditor/CnMarkdownEditor.vue2.js.map +1 -1
- package/dist/esm/components/CnMarkdownEditor/CnMarkdownEditor.vue3.js +60 -18
- package/dist/esm/components/CnMarkdownEditor/CnMarkdownEditor.vue3.js.map +1 -1
- package/dist/esm/components/CnMenuTreeNode/CnMenuTreeNode.vue2.js +2 -2
- package/dist/esm/components/CnMenuTreeNode/CnMenuTreeNode.vue2.js.map +1 -1
- package/dist/esm/components/CnObjectKanban/CnObjectKanban.vue2.js +2 -2
- package/dist/esm/components/CnObjectKanban/CnObjectKanban.vue2.js.map +1 -1
- package/dist/esm/components/CnPageTreeNode/CnPageTreeNode.vue2.js +2 -2
- package/dist/esm/components/CnPageTreeNode/CnPageTreeNode.vue2.js.map +1 -1
- package/dist/esm/components/CnQrCode/CnQrCode.vue.js +9 -0
- package/dist/esm/components/CnQrCode/CnQrCode.vue.js.map +1 -0
- package/dist/esm/components/CnQrCode/CnQrCode.vue2.js +241 -0
- package/dist/esm/components/CnQrCode/CnQrCode.vue2.js.map +1 -0
- package/dist/esm/components/CnQrCode/CnQrCode.vue3.js +75 -0
- package/dist/esm/components/CnQrCode/CnQrCode.vue3.js.map +1 -0
- package/dist/esm/components/CnReadinessChecklist/CnReadinessChecklist.vue.js +1 -1
- package/dist/esm/components/CnReadinessChecklist/CnReadinessChecklist.vue2.js +34 -3
- package/dist/esm/components/CnReadinessChecklist/CnReadinessChecklist.vue2.js.map +1 -1
- package/dist/esm/components/CnReadinessChecklist/CnReadinessChecklist.vue3.js +81 -19
- package/dist/esm/components/CnReadinessChecklist/CnReadinessChecklist.vue3.js.map +1 -1
- package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue.js +1 -1
- package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue2.js +11 -0
- package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue3.js +112 -88
- package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnRevealField/CnRevealField.vue.js +9 -0
- package/dist/esm/components/CnRevealField/CnRevealField.vue.js.map +1 -0
- package/dist/esm/components/CnRevealField/CnRevealField.vue2.js +157 -0
- package/dist/esm/components/CnRevealField/CnRevealField.vue2.js.map +1 -0
- package/dist/esm/components/CnRevealField/CnRevealField.vue3.js +116 -0
- package/dist/esm/components/CnRevealField/CnRevealField.vue3.js.map +1 -0
- package/dist/esm/components/CnTextWidget/CnTextWidget.vue.js +1 -1
- package/dist/esm/components/CnTextWidget/CnTextWidget.vue2.js +43 -3
- package/dist/esm/components/CnTextWidget/CnTextWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnTextWidget/CnTextWidget.vue3.js +19 -12
- package/dist/esm/components/CnTextWidget/CnTextWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnTransferCard/CnTransferCard.vue.js +9 -0
- package/dist/esm/components/CnTransferCard/CnTransferCard.vue.js.map +1 -0
- package/dist/esm/components/CnTransferCard/CnTransferCard.vue2.js +87 -0
- package/dist/esm/components/CnTransferCard/CnTransferCard.vue2.js.map +1 -0
- package/dist/esm/components/CnTransferCard/CnTransferCard.vue3.js +126 -0
- package/dist/esm/components/CnTransferCard/CnTransferCard.vue3.js.map +1 -0
- package/dist/esm/components/CnTreeView/CnTreeNode.vue.js +1 -1
- package/dist/esm/components/CnTreeView/CnTreeNode.vue2.js +66 -1
- package/dist/esm/components/CnTreeView/CnTreeNode.vue2.js.map +1 -1
- package/dist/esm/components/CnTreeView/CnTreeNode.vue3.js +129 -29
- package/dist/esm/components/CnTreeView/CnTreeNode.vue3.js.map +1 -1
- package/dist/esm/components/CnTreeView/CnTreeView.vue.js +1 -1
- package/dist/esm/components/CnTreeView/CnTreeView.vue2.js +158 -6
- package/dist/esm/components/CnTreeView/CnTreeView.vue2.js.map +1 -1
- package/dist/esm/components/CnTreeView/CnTreeView.vue3.js +100 -39
- package/dist/esm/components/CnTreeView/CnTreeView.vue3.js.map +1 -1
- package/dist/esm/index.js +8 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/l10n/en.json.js +63 -1
- package/dist/esm/l10n/en.json.js.map +1 -1
- package/dist/esm/l10n/nl.json.js +63 -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 +1134 -499
- package/dist/esm/node_modules/vuedraggable/dist/vuedraggable.umd.js +2 -2
- package/dist/esm/utils/captureLocation.js +32 -0
- package/dist/esm/utils/captureLocation.js.map +1 -0
- package/dist/esm/utils/childRecordTotals.js +157 -0
- package/dist/esm/utils/childRecordTotals.js.map +1 -0
- package/dist/esm/utils/isoDuration.js +51 -1
- package/dist/esm/utils/isoDuration.js.map +1 -1
- package/dist/esm/utils/qr.js +649 -0
- package/dist/esm/utils/qr.js.map +1 -0
- package/dist/esm/utils/schema.js +3 -0
- package/dist/esm/utils/schema.js.map +1 -1
- package/dist/esm/utils/templateVariables.js +54 -0
- package/dist/esm/utils/templateVariables.js.map +1 -0
- package/dist/nextcloud-vue.cjs.js +20307 -14544
- package/dist/nextcloud-vue.cjs.js.map +2 -2
- package/dist/nextcloud-vue.css +1134 -499
- package/l10n/en.json +63 -1
- package/l10n/nl.json +63 -1
- package/package.json +1 -1
- package/src/components/CnActionDialog/CnActionDialog.vue +156 -9
- package/src/components/CnBlockListEditor/CnBlockListEditor.vue +615 -0
- package/src/components/CnBlockListEditor/index.js +9 -0
- package/src/components/CnChecklistRunWidget/CnChecklistRunWidget.vue +311 -10
- package/src/components/CnChildRecordsField/CnChildRecordsField.vue +306 -15
- package/src/components/CnChoiceMatrix/CnChoiceMatrix.vue +710 -0
- package/src/components/CnChoiceMatrix/index.js +9 -0
- package/src/components/CnCountdownWidget/CnCountdownWidget.vue +223 -28
- package/src/components/CnCreateFormWidget/CnCreateFormWidget.vue +97 -6
- package/src/components/CnDataMatrix/CnDataMatrix.vue +199 -13
- package/src/components/CnDisplayScreen/CnDisplayScreen.vue +308 -0
- package/src/components/CnDisplayScreen/index.js +9 -0
- package/src/components/CnDurationField/CnDurationField.vue +330 -5
- package/src/components/CnFormDialog/CnFormDialog.vue +4 -0
- package/src/components/CnGeoCaptureField/CnGeoCaptureField.vue +148 -0
- package/src/components/CnGeoCaptureField/index.js +9 -0
- package/src/components/CnMarkdownEditor/CnMarkdownEditor.vue +139 -1
- package/src/components/CnQrCode/CnQrCode.vue +321 -0
- package/src/components/CnQrCode/index.js +9 -0
- package/src/components/CnReadinessChecklist/CnReadinessChecklist.vue +80 -3
- package/src/components/CnRecordListWidget/CnRecordListWidget.vue +34 -1
- package/src/components/CnRevealField/CnRevealField.vue +273 -0
- package/src/components/CnRevealField/index.js +9 -0
- package/src/components/CnTextWidget/CnTextWidget.vue +62 -3
- package/src/components/CnTransferCard/CnTransferCard.vue +205 -0
- package/src/components/CnTransferCard/index.js +9 -0
- package/src/components/CnTreeView/CnTreeNode.vue +145 -2
- package/src/components/CnTreeView/CnTreeView.vue +210 -6
- package/src/components/index.js +7 -0
- package/src/index.js +8 -0
- package/src/utils/captureLocation.js +29 -0
- package/src/utils/childRecordTotals.js +153 -0
- package/src/utils/isoDuration.js +50 -0
- package/src/utils/qr.js +681 -0
- package/src/utils/schema.js +3 -0
- package/src/utils/templateVariables.js +51 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { translate } from '@nextcloud/l10n';
|
|
2
|
-
import
|
|
2
|
+
import Draggable from '../../node_modules/vuedraggable/dist/vuedraggable.umd.js';
|
|
3
3
|
import __sfc_main from './CnMenuTreeRow.vue.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -23,7 +23,7 @@ import __sfc_main from './CnMenuTreeRow.vue.js';
|
|
|
23
23
|
var script = {
|
|
24
24
|
name: 'CnMenuTreeNode',
|
|
25
25
|
|
|
26
|
-
components: { Draggable:
|
|
26
|
+
components: { Draggable: Draggable, CnMenuTreeRow: __sfc_main },
|
|
27
27
|
|
|
28
28
|
props: {
|
|
29
29
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CnMenuTreeNode.vue2.js","sources":["../../../../src/components/CnMenuTreeNode/CnMenuTreeNode.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n\n<template>\n\t<!-- `#item` + `item-key`: see the same note on CnPageTreeNode. vuedraggable@4\n\t renders the rows itself from this slot; a `v-for` in the default slot\n\t throws \"draggable element must have an item slot\". -->\n\t<Draggable v-model=\"tree\"\n\t\ttag=\"ul\"\n\t\tclass=\"cn-menu-tree\"\n\t\t:itemKey=\"keyOf\"\n\t\t:group=\"group\"\n\t\thandle=\".cn-menu-tree__handle\"\n\t\t:move=\"onMove\"\n\t\t@end=\"flatten\">\n\t\t<template #item=\"{ element: node }\">\n\t\t\t<li class=\"cn-menu-tree__node\">\n\t\t\t\t<CnMenuTreeRow :item=\"node.ref\"\n\t\t\t\t\t:pages=\"pages\"\n\t\t\t\t\t:canAddChild=\"maxDepth > 0\"\n\t\t\t\t\t@addChild=\"addChild(node)\"\n\t\t\t\t\t@remove=\"removeNode(node, null)\" />\n\n\t\t\t\t<!-- One level of children: a drop target on every top item. -->\n\t\t\t\t<Draggable v-if=\"maxDepth > 0\"\n\t\t\t\t\tv-model=\"node.children\"\n\t\t\t\t\ttag=\"ul\"\n\t\t\t\t\tclass=\"cn-menu-tree__children\"\n\t\t\t\t\t:class=\"{ 'cn-menu-tree__children--empty': !node.children.length }\"\n\t\t\t\t\t:itemKey=\"keyOf\"\n\t\t\t\t\t:group=\"group\"\n\t\t\t\t\thandle=\".cn-menu-tree__handle\"\n\t\t\t\t\t:move=\"onMove\"\n\t\t\t\t\t@end=\"flatten\">\n\t\t\t\t\t<template #item=\"{ element: child }\">\n\t\t\t\t\t\t<li class=\"cn-menu-tree__node\">\n\t\t\t\t\t\t\t<CnMenuTreeRow :item=\"child.ref\"\n\t\t\t\t\t\t\t\t:pages=\"pages\"\n\t\t\t\t\t\t\t\t:canAddChild=\"false\"\n\t\t\t\t\t\t\t\t@remove=\"removeNode(child, node)\" />\n\t\t\t\t\t\t</li>\n\t\t\t\t\t</template>\n\t\t\t\t</Draggable>\n\t\t\t</li>\n\t\t</template>\n\t</Draggable>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport draggable from 'vuedraggable'\nimport CnMenuTreeRow from './CnMenuTreeRow.vue'\n\n/**\n * CnMenuTreeNode — the menu editor's drag-and-drop tree (ADR-041).\n *\n * Renders the working manifest's `menu[]` (nested via each item's `children[]`)\n * as a two-level draggable tree: drag a row to reorder, or into / out of an item\n * to nest (one level — CnAppNav supports one). Each row (CnMenuTreeRow) edits its\n * icon / label / target page inline + Delete via a cog. Drag operates on a local\n * mirror (`tree`) of real item refs; after each drop the mirror is FLATTENED back\n * onto `menu[]` in place — `order` renumbered to match the visual order, the\n * top-level `section` marker set/cleared, and each item's `children[]` rebuilt —\n * so `diffManifest` sees the change. Field edits mutate the real refs directly.\n *\n * The top level is scoped by `section`, matched EXACTLY: the main-menu editor\n * shows `main` items, the settings-menu editor shows `section: \"settings\"`\n * items, and neither ever claims the other's — or an `integrations` entry,\n * which has no editor here at all and must survive both untouched. Flatten\n * preserves every section it does not own.\n */\nexport default {\n\tname: 'CnMenuTreeNode',\n\n\tcomponents: { Draggable: draggable, CnMenuTreeRow },\n\n\tprops: {\n\t\t/**\n\t\t * The working manifest's `menu[]` (top-level items; children live in each\n\t\t * item's `children[]`). Edited in place.\n\t\t *\n\t\t * @type {Array}\n\t\t */\n\t\tlist: {\n\t\t\ttype: Array,\n\t\t\trequired: true,\n\t\t},\n\n\t\t/** Maximum nesting depth that may gain children (CnAppNav supports one level). */\n\t\tmaxDepth: {\n\t\t\ttype: Number,\n\t\t\tdefault: 1,\n\t\t},\n\n\t\t/**\n\t\t * Selectable target pages as `{ value: routeName, label }` options,\n\t\t * forwarded to every row's Page picker.\n\t\t *\n\t\t * @type {Array<{value: string, label: string}>}\n\t\t */\n\t\tpages: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t\t/**\n\t\t * Which nav section this editor scopes to at the top level. An editor\n\t\t * shows — and on flatten rewrites — ONLY entries whose section matches\n\t\t * exactly; every other section is preserved untouched. `null` and\n\t\t * `\"main\"` both mean the main menu.\n\t\t *\n\t\t * @type {'main'|'settings'|'integrations'|null}\n\t\t */\n\t\tsection: {\n\t\t\ttype: String,\n\t\t\tdefault: null,\n\t\t\tvalidator: (v) => v === null || ['main', 'settings', 'integrations'].includes(v),\n\t\t},\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\t// Local nested mirror of the section's items (real refs); flattened\n\t\t\t// back to `list` after each drop.\n\t\t\ttree: this.buildTree(),\n\t\t\t// Per-section drag group (main + settings editors never inter-drag).\n\t\t\tgroup: 'cn-menu-' + (this.section || 'main'),\n\t\t\t// Guard against the watcher rebuilding mid-flatten.\n\t\t\tsuppressRebuild: false,\n\t\t}\n\t},\n\n\twatch: {\n\t\t// The prop's IDENTITY, for a host that swaps the array wholesale.\n\t\tlist: {\n\t\t\thandler: 'rebuild',\n\t\t\tdeep: false,\n\t\t},\n\n\t\t// ...and its LENGTH, for a host that pushes or splices in place. The\n\t\t// modal's \"Add menu item\" does exactly that — `list` IS the working\n\t\t// manifest's `menu[]`, so its reference never changes and the watcher\n\t\t// above never fired: the item was appended and never appeared.\n\t\t//\n\t\t// Length rather than `deep: true`, which would fire on every keystroke\n\t\t// in a row's field and rebuild the tree under the user. This\n\t\t// component's own mutations land in `flatten()`, which holds\n\t\t// `suppressRebuild` across the splice.\n\t\t'list.length': 'rebuild',\n\t\t// Bypasses `rebuild()`'s suppressRebuild guard deliberately: a section\n\t\t// switch is never concurrent with this component's own flatten() write\n\t\t// (that guard exists only for the list/list.length watchers above), and\n\t\t// the new section's tree must always be rebuilt regardless of the flag.\n\t\tsection() {\n\t\t\tthis.tree = this.buildTree()\n\t\t},\n\t},\n\n\tmethods: {\n\t\tt,\n\t\t/**\n\t\t * Re-seed the local tree from `list`, unless our own `flatten()` is\n\t\t * mid-write.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\trebuild() {\n\t\t\tif (this.suppressRebuild) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.tree = this.buildTree()\n\t\t},\n\n\t\t/**\n\t\t * Stable-ish v-for key for a node.\n\t\t *\n\t\t * @param {object} node The tree node.\n\t\t * @return {string}\n\t\t */\n\t\tkeyOf(node) {\n\t\t\treturn (node.ref && node.ref.id) || String(node._k || (node._k = Math.random()))\n\t\t},\n\n\t\t/**\n\t\t * The section this editor owns, normalised — an absent `section` prop\n\t\t * means the main menu.\n\t\t *\n\t\t * @return {string} 'main' | 'settings' | 'integrations'\n\t\t */\n\t\twantSection() {\n\t\t\treturn this.section || 'main'\n\t\t},\n\n\t\t/**\n\t\t * An entry's section, normalised the same way.\n\t\t *\n\t\t * This pair replaced a binary `(it.section === 'settings') === wantSettings`\n\t\t * test, which was correct only while exactly two sections existed. Once\n\t\t * `section: \"integrations\"` was added (ADR-110), an integrations entry\n\t\t * answered `false` to \"is settings\", so the MAIN editor claimed it — and\n\t\t * `flatten()` `delete`s the section marker on everything the main editor\n\t\t * claims. Opening the main-menu editor and saving would have quietly\n\t\t * converted every cross-app link back into a nav entry, undoing the\n\t\t * contract with no error and no diff the author asked for. Matching the\n\t\t * section exactly means an editor owns its own section and nothing else.\n\t\t *\n\t\t * @param {object} item The menu entry.\n\t\t * @return {string} The entry's normalised section.\n\t\t */\n\t\tsectionOf(item) {\n\t\t\treturn (item && item.section) || 'main'\n\t\t},\n\n\t\t/**\n\t\t * Order comparator: numeric `order` ascending, array index as tiebreak.\n\t\t *\n\t\t * @param {Array} arr The array being sorted (for index tiebreak).\n\t\t * @return {(a: object, b: object) => number} The comparator.\n\t\t */\n\t\tbyOrder(arr) {\n\t\t\treturn (a, b) => {\n\t\t\t\tconst oa = typeof a.order === 'number' ? a.order : arr.indexOf(a)\n\t\t\t\tconst ob = typeof b.order === 'number' ? b.order : arr.indexOf(b)\n\t\t\t\treturn oa - ob\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Build the nested mirror from `list`, scoped to this section and ordered.\n\t\t *\n\t\t * @return {Array<{ref: object, children: Array}>}\n\t\t */\n\t\tbuildTree() {\n\t\t\tconst list = Array.isArray(this.list) ? this.list : []\n\t\t\tconst want = this.wantSection()\n\t\t\tconst top = list\n\t\t\t\t.filter((it) => it && this.sectionOf(it) === want)\n\t\t\t\t.slice()\n\t\t\t\t.sort(this.byOrder(list))\n\t\t\treturn top.map((ref) => {\n\t\t\t\tconst kids = Array.isArray(ref.children) ? ref.children.slice().sort(this.byOrder(ref.children)) : []\n\t\t\t\treturn { ref, children: kids.map((c) => ({ ref: c, children: [] })) }\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * Flatten the mirror back onto `list` in place: renumber `order`, set/clear\n\t\t * the top-level `section` marker, rebuild each item's `children[]`, and\n\t\t * preserve the other section's items.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tflatten() {\n\t\t\tconst want = this.wantSection()\n\t\t\tconst others = this.list.filter((it) => it && this.sectionOf(it) !== want)\n\t\t\tconst mine = this.tree.map((node, i) => {\n\t\t\t\tconst ref = node.ref\n\t\t\t\tref.order = (i + 1) * 10\n\t\t\t\tif (want === 'main') {\n\t\t\t\t\tdelete ref.section\n\t\t\t\t} else {\n\t\t\t\t\tref.section = want\n\t\t\t\t}\n\t\t\t\tif (node.children.length) {\n\t\t\t\t\tref.children = node.children.map((cn, j) => {\n\t\t\t\t\t\tcn.ref.order = (j + 1) * 10\n\t\t\t\t\t\tdelete cn.ref.section\n\t\t\t\t\t\treturn cn.ref\n\t\t\t\t\t})\n\t\t\t\t} else {\n\t\t\t\t\tdelete ref.children\n\t\t\t\t}\n\t\t\t\treturn ref\n\t\t\t})\n\t\t\tconst next = want === 'main' ? [...mine, ...others] : [...others, ...mine]\n\t\t\tthis.suppressRebuild = true\n\t\t\t// In-place edit by design — `list` is the working manifest's menu[],\n\t\t\t// mutated by reference so diffManifest captures the reorder/nesting.\n\t\t\t// eslint-disable-next-line vue/no-mutating-props\n\t\t\tthis.list.splice(0, this.list.length, ...next)\n\t\t\tthis.$nextTick(() => {\n\t\t\t\tthis.suppressRebuild = false\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * vuedraggable guard: forbid dropping a node that HAS children into a\n\t\t * child list (would nest two levels deep).\n\t\t *\n\t\t * @param {object} evt The vuedraggable move event.\n\t\t * @return {boolean} False to veto.\n\t\t */\n\t\tonMove(evt) {\n\t\t\tconst dragged = evt.draggedContext && evt.draggedContext.element\n\t\t\tconst target = evt.relatedContext && evt.relatedContext.list\n\t\t\tconst intoChild = target && target !== this.tree\n\t\t\tif (intoChild && dragged && Array.isArray(dragged.children) && dragged.children.length) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\treturn true\n\t\t},\n\n\t\t/**\n\t\t * Generate a unique `menu-N` id not already used at any level of `list`.\n\t\t *\n\t\t * @return {string}\n\t\t */\n\t\tnextId() {\n\t\t\tconst ids = new Set()\n\t\t\tconst walk = (arr) => (arr || []).forEach((it) => {\n\t\t\t\tif (it) {\n\t\t\t\t\tids.add(it.id)\n\t\t\t\t\twalk(it.children)\n\t\t\t\t}\n\t\t\t})\n\t\t\twalk(this.list)\n\t\t\tlet n = ids.size + 1\n\t\t\twhile (ids.has(`menu-${n}`)) {\n\t\t\t\tn++\n\t\t\t}\n\t\t\treturn `menu-${n}`\n\t\t},\n\n\t\t/**\n\t\t * Append a blank child under a top node.\n\t\t *\n\t\t * @param {object} node The parent tree node.\n\t\t * @return {void}\n\t\t */\n\t\taddChild(node) {\n\t\t\tconst ref = { id: this.nextId(), label: '', icon: '', route: '' }\n\t\t\tnode.children.push({ ref, children: [] })\n\t\t\tthis.flatten()\n\t\t},\n\n\t\t/**\n\t\t * Remove a node. A removed top node's children are lifted to top level.\n\t\t *\n\t\t * @param {object} node The node to remove.\n\t\t * @param {object|null} parent The parent node, or null for a top node.\n\t\t * @return {void}\n\t\t */\n\t\tremoveNode(node, parent) {\n\t\t\tif (parent) {\n\t\t\t\tconst i = parent.children.indexOf(node)\n\t\t\t\tif (i !== -1) {\n\t\t\t\t\tparent.children.splice(i, 1)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconst i = this.tree.indexOf(node)\n\t\t\t\tif (i !== -1) {\n\t\t\t\t\tthis.tree.splice(i, 1, ...node.children)\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.flatten()\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-menu-tree {\n\tlist-style: none;\n\tmargin: 0;\n\tpadding: 0;\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 4px;\n}\n\n.cn-menu-tree__children {\n\tlist-style: none;\n\tmargin: 4px 0 0 28px;\n\tpadding: 0 0 0 8px;\n\tborder-left: 2px solid var(--color-border);\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 4px;\n}\n\n.cn-menu-tree__children--empty {\n\tmin-height: 10px;\n\tmargin-top: 0;\n\tborder-left-color: transparent;\n}\n\n.cn-menu-tree__node {\n\tlist-style: none;\n}\n</style>\n"],"names":["CnMenuTreeRow","t"],"mappings":";;;;AAuDA;;AAEC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAED,aAAe;AACd,CAAA,IAAI,EAAE,gBAAgB;;CAEtB,UAAU,EAAE,EAAE,SAAS,EAAE,SAAS,iBAAEA,YAAe;;AAEnD,CAAA,KAAK,EAAE;AACN;AACC;AACA;AACA;;;EAGD,IAAI,EAAE;GACL,IAAI,EAAE,KAAK;GACX,QAAQ,EAAE,IAAI;GACd;;AAED;AACA,EAAA,QAAQ,EAAE;GACT,IAAI,EAAE,MAAM;AACZ,GAAA,OAAO,EAAE,CAAC;GACV;;AAED;;AAEC;AACA;AACA;;AAED,EAAA,KAAK,EAAE;GACN,IAAI,EAAE,KAAK;AACX,GAAA,OAAO,EAAE,MAAM,EAAE;GACjB;;AAED;;;;;AAKC;AACA;;AAED,EAAA,OAAO,EAAE;GACR,IAAI,EAAE,MAAM;GACZ,OAAO,EAAE,IAAI;AACb,GAAA,SAAS,EAAE,CAAC,CAAC,KAAK,CAAE,KAAI,IAAG,IAAK,CAAC,MAAM,EAAE,UAAU,EAAE,cAAc,CAAC,CAAC,QAAQ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C,IAAI,EAAE;GACd,MAAM,GAAE,GAAI,EAAE,EAAE,EAAE,IAAI,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,EAAG,GAAA;AAChE,GAAA,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAA;GACxC,IAAI,CAAC,OAAO,GAAC;GACb;;AAED;;AAEC;AACA;;;;EAID,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE;GACxB,IAAI,MAAM,EAAE;AACX,IAAA,MAAM,IAAI,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAA;IACtC,IAAI,CAAE,KAAI,CAAC,CAAC,EAAE;KACb,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAA;AAC5B,KAAA;IACC,MAAK;IACN,MAAM,CAAA,GAAI,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAA;IAChC,IAAI,CAAE,KAAI,CAAC,CAAC,EAAE;AACb,KAAA,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,IAAI,CAAC,QAAQ,EAAA;AACxC,KAAA;AACD,IAAA;GACA,IAAI,CAAC,OAAO,GAAC;GACb;EACD;AACF;;;;"}
|
|
1
|
+
{"version":3,"file":"CnMenuTreeNode.vue2.js","sources":["../../../../src/components/CnMenuTreeNode/CnMenuTreeNode.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n\n<template>\n\t<!-- `#item` + `item-key`: see the same note on CnPageTreeNode. vuedraggable@4\n\t renders the rows itself from this slot; a `v-for` in the default slot\n\t throws \"draggable element must have an item slot\". -->\n\t<Draggable v-model=\"tree\"\n\t\ttag=\"ul\"\n\t\tclass=\"cn-menu-tree\"\n\t\t:itemKey=\"keyOf\"\n\t\t:group=\"group\"\n\t\thandle=\".cn-menu-tree__handle\"\n\t\t:move=\"onMove\"\n\t\t@end=\"flatten\">\n\t\t<template #item=\"{ element: node }\">\n\t\t\t<li class=\"cn-menu-tree__node\">\n\t\t\t\t<CnMenuTreeRow :item=\"node.ref\"\n\t\t\t\t\t:pages=\"pages\"\n\t\t\t\t\t:canAddChild=\"maxDepth > 0\"\n\t\t\t\t\t@addChild=\"addChild(node)\"\n\t\t\t\t\t@remove=\"removeNode(node, null)\" />\n\n\t\t\t\t<!-- One level of children: a drop target on every top item. -->\n\t\t\t\t<Draggable v-if=\"maxDepth > 0\"\n\t\t\t\t\tv-model=\"node.children\"\n\t\t\t\t\ttag=\"ul\"\n\t\t\t\t\tclass=\"cn-menu-tree__children\"\n\t\t\t\t\t:class=\"{ 'cn-menu-tree__children--empty': !node.children.length }\"\n\t\t\t\t\t:itemKey=\"keyOf\"\n\t\t\t\t\t:group=\"group\"\n\t\t\t\t\thandle=\".cn-menu-tree__handle\"\n\t\t\t\t\t:move=\"onMove\"\n\t\t\t\t\t@end=\"flatten\">\n\t\t\t\t\t<template #item=\"{ element: child }\">\n\t\t\t\t\t\t<li class=\"cn-menu-tree__node\">\n\t\t\t\t\t\t\t<CnMenuTreeRow :item=\"child.ref\"\n\t\t\t\t\t\t\t\t:pages=\"pages\"\n\t\t\t\t\t\t\t\t:canAddChild=\"false\"\n\t\t\t\t\t\t\t\t@remove=\"removeNode(child, node)\" />\n\t\t\t\t\t\t</li>\n\t\t\t\t\t</template>\n\t\t\t\t</Draggable>\n\t\t\t</li>\n\t\t</template>\n\t</Draggable>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport draggable from 'vuedraggable'\nimport CnMenuTreeRow from './CnMenuTreeRow.vue'\n\n/**\n * CnMenuTreeNode — the menu editor's drag-and-drop tree (ADR-041).\n *\n * Renders the working manifest's `menu[]` (nested via each item's `children[]`)\n * as a two-level draggable tree: drag a row to reorder, or into / out of an item\n * to nest (one level — CnAppNav supports one). Each row (CnMenuTreeRow) edits its\n * icon / label / target page inline + Delete via a cog. Drag operates on a local\n * mirror (`tree`) of real item refs; after each drop the mirror is FLATTENED back\n * onto `menu[]` in place — `order` renumbered to match the visual order, the\n * top-level `section` marker set/cleared, and each item's `children[]` rebuilt —\n * so `diffManifest` sees the change. Field edits mutate the real refs directly.\n *\n * The top level is scoped by `section`, matched EXACTLY: the main-menu editor\n * shows `main` items, the settings-menu editor shows `section: \"settings\"`\n * items, and neither ever claims the other's — or an `integrations` entry,\n * which has no editor here at all and must survive both untouched. Flatten\n * preserves every section it does not own.\n */\nexport default {\n\tname: 'CnMenuTreeNode',\n\n\tcomponents: { Draggable: draggable, CnMenuTreeRow },\n\n\tprops: {\n\t\t/**\n\t\t * The working manifest's `menu[]` (top-level items; children live in each\n\t\t * item's `children[]`). Edited in place.\n\t\t *\n\t\t * @type {Array}\n\t\t */\n\t\tlist: {\n\t\t\ttype: Array,\n\t\t\trequired: true,\n\t\t},\n\n\t\t/** Maximum nesting depth that may gain children (CnAppNav supports one level). */\n\t\tmaxDepth: {\n\t\t\ttype: Number,\n\t\t\tdefault: 1,\n\t\t},\n\n\t\t/**\n\t\t * Selectable target pages as `{ value: routeName, label }` options,\n\t\t * forwarded to every row's Page picker.\n\t\t *\n\t\t * @type {Array<{value: string, label: string}>}\n\t\t */\n\t\tpages: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t\t/**\n\t\t * Which nav section this editor scopes to at the top level. An editor\n\t\t * shows — and on flatten rewrites — ONLY entries whose section matches\n\t\t * exactly; every other section is preserved untouched. `null` and\n\t\t * `\"main\"` both mean the main menu.\n\t\t *\n\t\t * @type {'main'|'settings'|'integrations'|null}\n\t\t */\n\t\tsection: {\n\t\t\ttype: String,\n\t\t\tdefault: null,\n\t\t\tvalidator: (v) => v === null || ['main', 'settings', 'integrations'].includes(v),\n\t\t},\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\t// Local nested mirror of the section's items (real refs); flattened\n\t\t\t// back to `list` after each drop.\n\t\t\ttree: this.buildTree(),\n\t\t\t// Per-section drag group (main + settings editors never inter-drag).\n\t\t\tgroup: 'cn-menu-' + (this.section || 'main'),\n\t\t\t// Guard against the watcher rebuilding mid-flatten.\n\t\t\tsuppressRebuild: false,\n\t\t}\n\t},\n\n\twatch: {\n\t\t// The prop's IDENTITY, for a host that swaps the array wholesale.\n\t\tlist: {\n\t\t\thandler: 'rebuild',\n\t\t\tdeep: false,\n\t\t},\n\n\t\t// ...and its LENGTH, for a host that pushes or splices in place. The\n\t\t// modal's \"Add menu item\" does exactly that — `list` IS the working\n\t\t// manifest's `menu[]`, so its reference never changes and the watcher\n\t\t// above never fired: the item was appended and never appeared.\n\t\t//\n\t\t// Length rather than `deep: true`, which would fire on every keystroke\n\t\t// in a row's field and rebuild the tree under the user. This\n\t\t// component's own mutations land in `flatten()`, which holds\n\t\t// `suppressRebuild` across the splice.\n\t\t'list.length': 'rebuild',\n\t\t// Bypasses `rebuild()`'s suppressRebuild guard deliberately: a section\n\t\t// switch is never concurrent with this component's own flatten() write\n\t\t// (that guard exists only for the list/list.length watchers above), and\n\t\t// the new section's tree must always be rebuilt regardless of the flag.\n\t\tsection() {\n\t\t\tthis.tree = this.buildTree()\n\t\t},\n\t},\n\n\tmethods: {\n\t\tt,\n\t\t/**\n\t\t * Re-seed the local tree from `list`, unless our own `flatten()` is\n\t\t * mid-write.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\trebuild() {\n\t\t\tif (this.suppressRebuild) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.tree = this.buildTree()\n\t\t},\n\n\t\t/**\n\t\t * Stable-ish v-for key for a node.\n\t\t *\n\t\t * @param {object} node The tree node.\n\t\t * @return {string}\n\t\t */\n\t\tkeyOf(node) {\n\t\t\treturn (node.ref && node.ref.id) || String(node._k || (node._k = Math.random()))\n\t\t},\n\n\t\t/**\n\t\t * The section this editor owns, normalised — an absent `section` prop\n\t\t * means the main menu.\n\t\t *\n\t\t * @return {string} 'main' | 'settings' | 'integrations'\n\t\t */\n\t\twantSection() {\n\t\t\treturn this.section || 'main'\n\t\t},\n\n\t\t/**\n\t\t * An entry's section, normalised the same way.\n\t\t *\n\t\t * This pair replaced a binary `(it.section === 'settings') === wantSettings`\n\t\t * test, which was correct only while exactly two sections existed. Once\n\t\t * `section: \"integrations\"` was added (ADR-110), an integrations entry\n\t\t * answered `false` to \"is settings\", so the MAIN editor claimed it — and\n\t\t * `flatten()` `delete`s the section marker on everything the main editor\n\t\t * claims. Opening the main-menu editor and saving would have quietly\n\t\t * converted every cross-app link back into a nav entry, undoing the\n\t\t * contract with no error and no diff the author asked for. Matching the\n\t\t * section exactly means an editor owns its own section and nothing else.\n\t\t *\n\t\t * @param {object} item The menu entry.\n\t\t * @return {string} The entry's normalised section.\n\t\t */\n\t\tsectionOf(item) {\n\t\t\treturn (item && item.section) || 'main'\n\t\t},\n\n\t\t/**\n\t\t * Order comparator: numeric `order` ascending, array index as tiebreak.\n\t\t *\n\t\t * @param {Array} arr The array being sorted (for index tiebreak).\n\t\t * @return {(a: object, b: object) => number} The comparator.\n\t\t */\n\t\tbyOrder(arr) {\n\t\t\treturn (a, b) => {\n\t\t\t\tconst oa = typeof a.order === 'number' ? a.order : arr.indexOf(a)\n\t\t\t\tconst ob = typeof b.order === 'number' ? b.order : arr.indexOf(b)\n\t\t\t\treturn oa - ob\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Build the nested mirror from `list`, scoped to this section and ordered.\n\t\t *\n\t\t * @return {Array<{ref: object, children: Array}>}\n\t\t */\n\t\tbuildTree() {\n\t\t\tconst list = Array.isArray(this.list) ? this.list : []\n\t\t\tconst want = this.wantSection()\n\t\t\tconst top = list\n\t\t\t\t.filter((it) => it && this.sectionOf(it) === want)\n\t\t\t\t.slice()\n\t\t\t\t.sort(this.byOrder(list))\n\t\t\treturn top.map((ref) => {\n\t\t\t\tconst kids = Array.isArray(ref.children) ? ref.children.slice().sort(this.byOrder(ref.children)) : []\n\t\t\t\treturn { ref, children: kids.map((c) => ({ ref: c, children: [] })) }\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * Flatten the mirror back onto `list` in place: renumber `order`, set/clear\n\t\t * the top-level `section` marker, rebuild each item's `children[]`, and\n\t\t * preserve the other section's items.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tflatten() {\n\t\t\tconst want = this.wantSection()\n\t\t\tconst others = this.list.filter((it) => it && this.sectionOf(it) !== want)\n\t\t\tconst mine = this.tree.map((node, i) => {\n\t\t\t\tconst ref = node.ref\n\t\t\t\tref.order = (i + 1) * 10\n\t\t\t\tif (want === 'main') {\n\t\t\t\t\tdelete ref.section\n\t\t\t\t} else {\n\t\t\t\t\tref.section = want\n\t\t\t\t}\n\t\t\t\tif (node.children.length) {\n\t\t\t\t\tref.children = node.children.map((cn, j) => {\n\t\t\t\t\t\tcn.ref.order = (j + 1) * 10\n\t\t\t\t\t\tdelete cn.ref.section\n\t\t\t\t\t\treturn cn.ref\n\t\t\t\t\t})\n\t\t\t\t} else {\n\t\t\t\t\tdelete ref.children\n\t\t\t\t}\n\t\t\t\treturn ref\n\t\t\t})\n\t\t\tconst next = want === 'main' ? [...mine, ...others] : [...others, ...mine]\n\t\t\tthis.suppressRebuild = true\n\t\t\t// In-place edit by design — `list` is the working manifest's menu[],\n\t\t\t// mutated by reference so diffManifest captures the reorder/nesting.\n\t\t\t// eslint-disable-next-line vue/no-mutating-props\n\t\t\tthis.list.splice(0, this.list.length, ...next)\n\t\t\tthis.$nextTick(() => {\n\t\t\t\tthis.suppressRebuild = false\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * vuedraggable guard: forbid dropping a node that HAS children into a\n\t\t * child list (would nest two levels deep).\n\t\t *\n\t\t * @param {object} evt The vuedraggable move event.\n\t\t * @return {boolean} False to veto.\n\t\t */\n\t\tonMove(evt) {\n\t\t\tconst dragged = evt.draggedContext && evt.draggedContext.element\n\t\t\tconst target = evt.relatedContext && evt.relatedContext.list\n\t\t\tconst intoChild = target && target !== this.tree\n\t\t\tif (intoChild && dragged && Array.isArray(dragged.children) && dragged.children.length) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\treturn true\n\t\t},\n\n\t\t/**\n\t\t * Generate a unique `menu-N` id not already used at any level of `list`.\n\t\t *\n\t\t * @return {string}\n\t\t */\n\t\tnextId() {\n\t\t\tconst ids = new Set()\n\t\t\tconst walk = (arr) => (arr || []).forEach((it) => {\n\t\t\t\tif (it) {\n\t\t\t\t\tids.add(it.id)\n\t\t\t\t\twalk(it.children)\n\t\t\t\t}\n\t\t\t})\n\t\t\twalk(this.list)\n\t\t\tlet n = ids.size + 1\n\t\t\twhile (ids.has(`menu-${n}`)) {\n\t\t\t\tn++\n\t\t\t}\n\t\t\treturn `menu-${n}`\n\t\t},\n\n\t\t/**\n\t\t * Append a blank child under a top node.\n\t\t *\n\t\t * @param {object} node The parent tree node.\n\t\t * @return {void}\n\t\t */\n\t\taddChild(node) {\n\t\t\tconst ref = { id: this.nextId(), label: '', icon: '', route: '' }\n\t\t\tnode.children.push({ ref, children: [] })\n\t\t\tthis.flatten()\n\t\t},\n\n\t\t/**\n\t\t * Remove a node. A removed top node's children are lifted to top level.\n\t\t *\n\t\t * @param {object} node The node to remove.\n\t\t * @param {object|null} parent The parent node, or null for a top node.\n\t\t * @return {void}\n\t\t */\n\t\tremoveNode(node, parent) {\n\t\t\tif (parent) {\n\t\t\t\tconst i = parent.children.indexOf(node)\n\t\t\t\tif (i !== -1) {\n\t\t\t\t\tparent.children.splice(i, 1)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconst i = this.tree.indexOf(node)\n\t\t\t\tif (i !== -1) {\n\t\t\t\t\tthis.tree.splice(i, 1, ...node.children)\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.flatten()\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-menu-tree {\n\tlist-style: none;\n\tmargin: 0;\n\tpadding: 0;\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 4px;\n}\n\n.cn-menu-tree__children {\n\tlist-style: none;\n\tmargin: 4px 0 0 28px;\n\tpadding: 0 0 0 8px;\n\tborder-left: 2px solid var(--color-border);\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 4px;\n}\n\n.cn-menu-tree__children--empty {\n\tmin-height: 10px;\n\tmargin-top: 0;\n\tborder-left-color: transparent;\n}\n\n.cn-menu-tree__node {\n\tlist-style: none;\n}\n</style>\n"],"names":["draggable","CnMenuTreeRow","t"],"mappings":";;;;AAuDA;;AAEC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;;AAED,aAAe;AACd,CAAA,IAAI,EAAE,gBAAgB;;CAEtB,UAAU,EAAE,EAAE,SAAS,EAAEA,SAAS,iBAAEC,YAAe;;AAEnD,CAAA,KAAK,EAAE;AACN;AACC;AACA;AACA;;;EAGD,IAAI,EAAE;GACL,IAAI,EAAE,KAAK;GACX,QAAQ,EAAE,IAAI;GACd;;AAED;AACA,EAAA,QAAQ,EAAE;GACT,IAAI,EAAE,MAAM;AACZ,GAAA,OAAO,EAAE,CAAC;GACV;;AAED;;AAEC;AACA;AACA;;AAED,EAAA,KAAK,EAAE;GACN,IAAI,EAAE,KAAK;AACX,GAAA,OAAO,EAAE,MAAM,EAAE;GACjB;;AAED;;;;;AAKC;AACA;;AAED,EAAA,OAAO,EAAE;GACR,IAAI,EAAE,MAAM;GACZ,OAAO,EAAE,IAAI;AACb,GAAA,SAAS,EAAE,CAAC,CAAC,KAAK,CAAE,KAAI,IAAG,IAAK,CAAC,MAAM,EAAE,UAAU,EAAE,cAAc,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;GAChF;EACD;;AAED,CAAA,IAAI,GAAG;AACN,EAAA,OAAO;;;AAGN,GAAA,IAAI,EAAE,IAAI,CAAC,SAAS,EAAE;;AAEtB,GAAA,KAAK,EAAE,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AG,GAAA;AAChE,GAAA,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAA;GACxC,IAAI,CAAC,OAAO,GAAC;GACb;;AAED;;AAEC;AACA;;;;EAID,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE;GACxB,IAAI,MAAM,EAAE;AACX,IAAA,MAAM,IAAI,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAA;IACtC,IAAI,CAAE,KAAI,CAAC,CAAC,EAAE;KACb,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAA;AAC5B,KAAA;IACC,MAAK;IACN,MAAM,CAAA,GAAI,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAA;IAChC,IAAI,CAAE,KAAI,CAAC,CAAC,EAAE;AACb,KAAA,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,IAAI,CAAC,QAAQ,EAAA;AACxC,KAAA;AACD,IAAA;GACA,IAAI,CAAC,OAAO,GAAC;GACb;EACD;AACF;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { translate } from '@nextcloud/l10n';
|
|
2
2
|
import { NcButton, NcLoadingIcon } from '@nextcloud/vue';
|
|
3
|
-
import
|
|
3
|
+
import Draggable from '../../node_modules/vuedraggable/dist/vuedraggable.umd.js';
|
|
4
4
|
import ViewColumn from 'vue-material-design-icons/ViewColumn.vue';
|
|
5
5
|
import __sfc_main from '../CnEmptyContent/CnEmptyContent.vue.js';
|
|
6
6
|
import { normalizeLook } from '../../composables/useLook.js';
|
|
@@ -62,7 +62,7 @@ var script = {
|
|
|
62
62
|
name: 'CnObjectKanban',
|
|
63
63
|
|
|
64
64
|
components: {
|
|
65
|
-
Draggable:
|
|
65
|
+
Draggable: Draggable,
|
|
66
66
|
NcButton,
|
|
67
67
|
NcLoadingIcon,
|
|
68
68
|
CnEmptyContent: __sfc_main,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CnObjectKanban.vue2.js","sources":["../../../../src/components/CnObjectKanban/CnObjectKanban.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n\n<template>\n\t<div class=\"cn-object-kanban\">\n\t\t<div v-if=\"loading\" class=\"cn-object-kanban__loading\">\n\t\t\t<NcLoadingIcon :size=\"32\" />\n\t\t</div>\n\n\t\t<div v-else-if=\"localColumns.length === 0\" class=\"cn-object-kanban__empty\">\n\t\t\t<!-- @slot empty Custom empty state shown when there are no columns to render. -->\n\t\t\t<slot name=\"empty\">\n\t\t\t\t<CnEmptyContent :name=\"emptyText\">\n\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t<ViewColumn :size=\"64\" />\n\t\t\t\t\t</template>\n\t\t\t\t</CnEmptyContent>\n\t\t\t</slot>\n\t\t</div>\n\n\t\t<div v-else class=\"cn-object-kanban__board\" :class=\"{ 'cn-object-kanban__board--board': isBoardLook }\">\n\t\t\t<div\n\t\t\t\tv-for=\"column in localColumns\"\n\t\t\t\t:key=\"columnKey(column.value)\"\n\t\t\t\tclass=\"cn-object-kanban__column\">\n\t\t\t\t<div class=\"cn-object-kanban__column-header\">\n\t\t\t\t\t<!-- @slot column-header Override a column's header. -->\n\t\t\t\t\t<!-- @binding {object} column The column ({ value, cards, total, limit, offset }). -->\n\t\t\t\t\t<slot name=\"column-header\" :column=\"column\">\n\t\t\t\t\t\t<span class=\"cn-object-kanban__column-title\">{{ columnLabel(column) }}</span>\n\t\t\t\t\t\t<span class=\"cn-object-kanban__column-count\">{{ column.total }}</span>\n\t\t\t\t\t</slot>\n\t\t\t\t</div>\n\n\t\t\t\t<!-- `#item` + `item-key`: vuedraggable@4 (the Vue 3 build)\n\t\t\t\t renders the cards itself from this slot. A `v-for` in the\n\t\t\t\t default slot throws \"draggable element must have an item\n\t\t\t\t slot\" the moment the column paints. -->\n\t\t\t\t<Draggable\n\t\t\t\t\t:list=\"column.cards\"\n\t\t\t\t\ttag=\"div\"\n\t\t\t\t\tclass=\"cn-object-kanban__column-cards\"\n\t\t\t\t\t:itemKey=\"cardKey\"\n\t\t\t\t\tgroup=\"cn-object-kanban-cards\"\n\t\t\t\t\t:data-column-value=\"columnKey(column.value)\"\n\t\t\t\t\t@start=\"onDragStart(column)\"\n\t\t\t\t\t@change=\"onColumnChange($event, column)\">\n\t\t\t\t\t<template #item=\"{ element: card }\">\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclass=\"cn-object-kanban__card\"\n\t\t\t\t\t\t\t:class=\"{\n\t\t\t\t\t\t\t\t'cn-object-kanban__card--pending': isPending(card),\n\t\t\t\t\t\t\t\t'cn-object-kanban__card--overdue': dueState(card) === 'overdue',\n\t\t\t\t\t\t\t\t'cn-object-kanban__card--soon': dueState(card) === 'soon',\n\t\t\t\t\t\t\t}\">\n\t\t\t\t\t\t\t<!-- @slot card Fully replace the default card rendering. -->\n\t\t\t\t\t\t\t<!-- @binding {object} object The card's object. -->\n\t\t\t\t\t\t\t<!-- @binding {object} column The column the card currently sits in. -->\n\t\t\t\t\t\t\t<!-- @binding {string|null} dueState The card's due state under `dueRule`: `overdue`, `soon`, `ok`, or null without a rule. -->\n\t\t\t\t\t\t\t<slot\n\t\t\t\t\t\t\t\tname=\"card\"\n\t\t\t\t\t\t\t\t:object=\"card\"\n\t\t\t\t\t\t\t\t:column=\"column\"\n\t\t\t\t\t\t\t\t:dueState=\"dueState(card)\">\n\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\tv-if=\"dueLabel(card)\"\n\t\t\t\t\t\t\t\t\tclass=\"cn-object-kanban__due\"\n\t\t\t\t\t\t\t\t\t:class=\"`cn-object-kanban__due--${dueState(card)}`\"\n\t\t\t\t\t\t\t\t\tdata-testid=\"cn-kanban-due\">\n\t\t\t\t\t\t\t\t\t{{ dueLabel(card) }}\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t<div class=\"cn-object-kanban__card-title\" @click=\"onCardClick(card)\">\n\t\t\t\t\t\t\t\t\t{{ cardTitle(card) }}\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div v-if=\"cardFields.length\" class=\"cn-object-kanban__card-fields\">\n\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\tv-for=\"field in cardFields\"\n\t\t\t\t\t\t\t\t\t\t:key=\"field\"\n\t\t\t\t\t\t\t\t\t\tclass=\"cn-object-kanban__card-field\">\n\t\t\t\t\t\t\t\t\t\t<CnCellRenderer\n\t\t\t\t\t\t\t\t\t\t\t:value=\"card[field]\"\n\t\t\t\t\t\t\t\t\t\t\t:property=\"schemaProperty(field)\"\n\t\t\t\t\t\t\t\t\t\t\t:truncate=\"40\" />\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</slot>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</template>\n\t\t\t\t</Draggable>\n\n\t\t\t\t<div v-if=\"hasMore(column)\" class=\"cn-object-kanban__load-more\">\n\t\t\t\t\t<NcButton :disabled=\"isColumnLoading(column)\" @click=\"onLoadMore(column)\">\n\t\t\t\t\t\t<template v-if=\"isColumnLoading(column)\" #icon>\n\t\t\t\t\t\t\t<NcLoadingIcon :size=\"16\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t{{ loadMoreLabel }}\n\t\t\t\t\t</NcButton>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport { NcButton, NcLoadingIcon } from '@nextcloud/vue'\nimport draggable from 'vuedraggable'\nimport ViewColumn from 'vue-material-design-icons/ViewColumn.vue'\nimport CnEmptyContent from '../CnEmptyContent/CnEmptyContent.vue'\nimport { normalizeLook } from '../../composables/useLook.js'\nimport { dueStateForRow } from '../../utils/dueRule.js'\nimport { CnCellRenderer } from '../CnCellRenderer/index.js'\n\n/**\n * CnObjectKanban — Kanban board over a schema property's distinct values.\n *\n * Renders one column per distinct value of `groupByField` and paginates each\n * column's cards independently (\"load more\", never a whole column at once).\n * Column values/order come from (in precedence order) an explicit\n * `columnOrder`, the `groupByField` schema property's `enum`, or values\n * discovered from `objects` — mirroring OpenRegister's\n * `ViewPresentationService::deriveColumnValues()`.\n *\n * Two rendering modes:\n * - **Pre-built columns** — pass `columns` (the shape returned by\n * `GET /api/views/{id}/kanban`: `[{ value, cards, total, limit, offset }]`);\n * the host owns pagination and re-fetches on `load-more`.\n * - **Flat objects** — pass `objects` + `groupByField` (and optionally\n * `columnOrder`/`schema`); the component derives and paginates columns\n * locally.\n *\n * Dragging a card to another column does NOT write anything itself — there is\n * deliberately no bespoke \"move card\" endpoint (REQ-VIEW-KANBAN-03). The move\n * is applied optimistically to the local board and the component emits\n * `move`; the host performs the actual object PATCH/PUT through the existing\n * guarded write path and reports back:\n * - On success, nothing further is required (the optimistic move already\n * reflects it) — optionally call `resolveMove(id)` to clear the pending\n * visual state sooner.\n * - On a rejected (e.g. illegal lifecycle transition) write, call\n * `rejectMove(id, reason)` — the card snaps back to its origin column and\n * `move-rejected` fires with the reason for the host to surface.\n *\n * ```vue\n * <CnObjectKanban\n * :objects=\"objects\"\n * group-by-field=\"status\"\n * :column-order=\"['todo', 'doing', 'done']\"\n * :card-fields=\"['title', 'assignee']\"\n * :schema=\"schema\"\n * ref=\"kanban\"\n * @move=\"onMove\"\n * @load-more=\"fetchMoreCards\" />\n * ```\n * ```js\n * async onMove({ object, groupByField, fromValue, toValue }) {\n * try {\n * await patchObject(object.id, { [groupByField]: toValue })\n * } catch (e) {\n * this.$refs.kanban.rejectMove(object.id, e.message)\n * }\n * }\n * ```\n */\nexport default {\n\tname: 'CnObjectKanban',\n\n\tcomponents: {\n\t\tDraggable: draggable,\n\t\tNcButton,\n\t\tNcLoadingIcon,\n\t\tCnEmptyContent,\n\t\tViewColumn,\n\t\tCnCellRenderer,\n\t},\n\n\tinject: {\n\t\t/** The look the app is drawn in; the board look takes the board column tokens. */\n\t\tcnLook: { default: 'nextcloud' },\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * Flat objects to derive columns from (ignored when `columns` is set).\n\t\t *\n\t\t * @type {Array<object>}\n\t\t */\n\t\tobjects: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t\t/**\n\t\t * Pre-built columns, e.g. the response of `GET /api/views/{id}/kanban`.\n\t\t *\n\t\t * @type {Array<{value: string|number, cards: Array<object>, total: number, limit: number, offset: number}>|null}\n\t\t */\n\t\tcolumns: {\n\t\t\ttype: Array,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** The schema property whose distinct values become columns. */\n\t\tgroupByField: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\n\t\t/** Explicit column order. Takes precedence over the schema's enum order. */\n\t\tcolumnOrder: {\n\t\t\ttype: Array,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** Object fields rendered on each card (in order). */\n\t\tcardFields: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t\t/** Schema definition, used to resolve enum column order and card field types. */\n\t\tschema: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** Overall loading state (initial board fetch). */\n\t\tloading: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/** Column values currently loading more cards (drives the per-column spinner). */\n\t\tloadingColumns: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t\t/** Cards shown per column before \"load more\", in local (`objects`-driven) mode. */\n\t\tpageSize: {\n\t\t\ttype: Number,\n\t\t\tdefault: 20,\n\t\t},\n\n\t\t/** Object property used as each card's identity. */\n\t\trowKey: {\n\t\t\ttype: String,\n\t\t\tdefault: 'id',\n\t\t},\n\n\t\t/**\n\t\t * Marks late cards: `{ field, soonDays? }`. `field` is the dot-path to\n\t\t * a card's due date. A date before today gets an error edge and the\n\t\t * label \"Overdue\"; a date within `soonDays` (default 3) gets \"Due\n\t\t * soon\" in the warning colour. `null` (the default) marks nothing.\n\t\t *\n\t\t * The same rule shape the table's date cell uses, so a list and its\n\t\t * board agree on what late means.\n\t\t *\n\t\t * @type {{field: string, soonDays?: number}|null}\n\t\t */\n\t\tdueRule: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\t},\n\n\temits: ['card-click', 'load-more', 'move', 'move-rejected'],\n\n\tdata() {\n\t\treturn {\n\t\t\tlocalColumns: [],\n\t\t\t// column.value -> full unpaginated card list, local mode only.\n\t\t\tfullCardsByColumn: {},\n\t\t\t// Suppressed while a move is pending so the prop-driven rebuild\n\t\t\t// doesn't clobber the optimistic UI before the host's data catches up.\n\t\t\tsuppressRebuild: false,\n\t\t\t// objectId -> { fromValue, toValue, card, originIndex }\n\t\t\tpendingMoves: {},\n\t\t\tdragOriginValue: null,\n\t\t\t// The day late marking measures from.\n\t\t\ttoday: new Date(),\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/** @return {boolean} Whether the app takes the board look. */\n\t\tisBoardLook() {\n\t\t\treturn normalizeLook(this.cnLook) === 'board'\n\t\t},\n\n\t\temptyText() {\n\t\t\treturn t('nextcloud-vue', 'No columns to show')\n\t\t},\n\n\t\tloadMoreLabel() {\n\t\t\treturn t('nextcloud-vue', 'Load more')\n\t\t},\n\t},\n\n\twatch: {\n\t\tobjects: {\n\t\t\thandler() {\n\t\t\t\tif (!this.suppressRebuild) {\n\t\t\t\t\tthis.rebuild()\n\t\t\t\t}\n\t\t\t},\n\n\t\t\tdeep: false,\n\t\t},\n\n\t\tcolumns: {\n\t\t\thandler() {\n\t\t\t\tif (!this.suppressRebuild) {\n\t\t\t\t\tthis.rebuild()\n\t\t\t\t}\n\t\t\t},\n\n\t\t\tdeep: false,\n\t\t},\n\n\t\tgroupByField() {\n\t\t\tthis.rebuild()\n\t\t},\n\n\t\tcolumnOrder: {\n\t\t\thandler() {\n\t\t\t\tthis.rebuild()\n\t\t\t},\n\n\t\t\tdeep: true,\n\t\t},\n\t},\n\n\tcreated() {\n\t\tthis.rebuild()\n\t},\n\n\tmethods: {\n\t\tt,\n\n\t\t/**\n\t\t * A card's due state under `dueRule`.\n\t\t *\n\t\t * @param {object} card The card's row.\n\t\t * @return {'overdue'|'soon'|'ok'|null} The state, or null when no rule applies.\n\t\t * @spec openspec/changes/detail-action-model-and-case-surfaces/specs/detail-action-model/spec.md#requirement-late-marking-on-board-cards\n\t\t */\n\t\tdueState(card) {\n\t\t\treturn dueStateForRow(card, this.dueRule, this.today)\n\t\t},\n\n\t\t/**\n\t\t * The words a late card carries. Colour alone would not reach a reader\n\t\t * who cannot see it, or cannot tell red from amber.\n\t\t *\n\t\t * @param {object} card The card's row.\n\t\t * @return {string} \"Overdue\", \"Due soon\", or '' for a card that is fine.\n\t\t * @spec openspec/changes/detail-action-model-and-case-surfaces/specs/detail-action-model/spec.md#requirement-late-marking-on-board-cards\n\t\t */\n\t\tdueLabel(card) {\n\t\t\tconst state = this.dueState(card)\n\t\t\tif (state === 'overdue') {\n\t\t\t\treturn t('nextcloud-vue', 'Overdue')\n\t\t\t}\n\t\t\treturn state === 'soon' ? t('nextcloud-vue', 'Due soon') : ''\n\t\t},\n\n\t\t/**\n\t\t * Rebuild `localColumns` from either the `columns` prop (backend-paginated\n\t\t * mode) or `objects` + `groupByField` (locally-derived mode).\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\trebuild() {\n\t\t\tif (Array.isArray(this.columns)) {\n\t\t\t\tthis.localColumns = this.columns.map((column) => ({\n\t\t\t\t\tvalue: column.value,\n\t\t\t\t\tcards: Array.isArray(column.cards) ? [...column.cards] : [],\n\t\t\t\t\ttotal: typeof column.total === 'number' ? column.total : (column.cards || []).length,\n\t\t\t\t\tlimit: column.limit,\n\t\t\t\t\toffset: column.offset,\n\t\t\t\t}))\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tconst values = this.deriveColumnValues()\n\t\t\tconst fullByColumn = {}\n\t\t\tthis.localColumns = values.map((value) => {\n\t\t\t\tconst fullCards = this.objects.filter((object) => object && object[this.groupByField] === value)\n\t\t\t\tfullByColumn[this.columnKey(value)] = fullCards\n\t\t\t\treturn {\n\t\t\t\t\tvalue,\n\t\t\t\t\tcards: fullCards.slice(0, this.pageSize),\n\t\t\t\t\ttotal: fullCards.length,\n\t\t\t\t\tlimit: this.pageSize,\n\t\t\t\t\toffset: 0,\n\t\t\t\t}\n\t\t\t})\n\t\t\tthis.fullCardsByColumn = fullByColumn\n\t\t},\n\n\t\t/**\n\t\t * Derive the ordered column values: `columnOrder` > schema enum order >\n\t\t * distinct values observed in `objects`. Mirrors\n\t\t * `ViewPresentationService::deriveColumnValues()`.\n\t\t *\n\t\t * @return {Array<unknown>}\n\t\t */\n\t\tderiveColumnValues() {\n\t\t\tif (Array.isArray(this.columnOrder) && this.columnOrder.length > 0) {\n\t\t\t\treturn [...this.columnOrder]\n\t\t\t}\n\n\t\t\tconst enumValues = this.schema?.properties?.[this.groupByField]?.enum\n\t\t\tif (Array.isArray(enumValues) && enumValues.length > 0) {\n\t\t\t\treturn [...enumValues]\n\t\t\t}\n\n\t\t\treturn this.discoverDistinctValues()\n\t\t},\n\n\t\t/**\n\t\t * Distinct `groupByField` values observed in `objects`, in first-seen order.\n\t\t *\n\t\t * @return {Array<unknown>}\n\t\t */\n\t\tdiscoverDistinctValues() {\n\t\t\tconst seen = new Set()\n\t\t\tconst values = []\n\t\t\tfor (const object of this.objects) {\n\t\t\t\tconst value = object?.[this.groupByField]\n\t\t\t\tif (value !== undefined && value !== null && !seen.has(value)) {\n\t\t\t\t\tseen.add(value)\n\t\t\t\t\tvalues.push(value)\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn values\n\t\t},\n\n\t\t/**\n\t\t * Stable string key for a column value (used as a `:key` and as the\n\t\t * `fullCardsByColumn` index — object/array values are unlikely but guarded).\n\t\t *\n\t\t * @param {unknown} value The column value.\n\t\t * @return {string}\n\t\t */\n\t\tcolumnKey(value) {\n\t\t\treturn typeof value === 'string' || typeof value === 'number' ? String(value) : JSON.stringify(value)\n\t\t},\n\n\t\t/**\n\t\t * The card's identity, per `rowKey`.\n\t\t *\n\t\t * @param {object} card The card object.\n\t\t * @return {unknown}\n\t\t */\n\t\tcardKey(card) {\n\t\t\treturn card?.[this.rowKey]\n\t\t},\n\n\t\t/**\n\t\t * Display label for a column: its schema `oneOf[].title` when the\n\t\t * property declares per-value titles, otherwise the raw value.\n\t\t *\n\t\t * @param {object} column The column.\n\t\t * @return {string}\n\t\t */\n\t\tcolumnLabel(column) {\n\t\t\tconst oneOf = this.schema?.properties?.[this.groupByField]?.oneOf\n\t\t\tif (Array.isArray(oneOf)) {\n\t\t\t\tconst match = oneOf.find((entry) => entry?.const === column.value)\n\t\t\t\tif (match?.title) {\n\t\t\t\t\treturn match.title\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn String(column.value)\n\t\t},\n\n\t\t/**\n\t\t * Best-effort card title: the schema's configured name field, else\n\t\t * `title`/`name`/the row key.\n\t\t *\n\t\t * @param {object} card The card object.\n\t\t * @return {string}\n\t\t */\n\t\tcardTitle(card) {\n\t\t\tconst nameField = this.schema?.configuration?.objectNameField\n\t\t\tif (nameField && card[nameField]) {\n\t\t\t\treturn String(card[nameField])\n\t\t\t}\n\t\t\treturn String(card.title || card.name || card[this.rowKey] || '—')\n\t\t},\n\n\t\t/**\n\t\t * The schema property definition for a card field, if known.\n\t\t *\n\t\t * @param {string} field The field name.\n\t\t * @return {object|undefined}\n\t\t */\n\t\tschemaProperty(field) {\n\t\t\treturn this.schema?.properties?.[field]\n\t\t},\n\n\t\t/**\n\t\t * Whether a column has more cards to load: backend-paginated mode compares\n\t\t * `cards.length` to `total`; local mode compares to the full filtered set.\n\t\t *\n\t\t * @param {object} column The column.\n\t\t * @return {boolean}\n\t\t */\n\t\thasMore(column) {\n\t\t\tif (Array.isArray(this.columns)) {\n\t\t\t\treturn column.cards.length < column.total\n\t\t\t}\n\t\t\tconst full = this.fullCardsByColumn[this.columnKey(column.value)] || []\n\t\t\treturn column.cards.length < full.length\n\t\t},\n\n\t\t/**\n\t\t * Whether a column's \"load more\" is in flight.\n\t\t *\n\t\t * @param {object} column The column.\n\t\t * @return {boolean}\n\t\t */\n\t\tisColumnLoading(column) {\n\t\t\treturn this.loadingColumns.includes(column.value)\n\t\t},\n\n\t\t/**\n\t\t * Whether a card has an unresolved optimistic move.\n\t\t *\n\t\t * @param {object} card The card object.\n\t\t * @return {boolean}\n\t\t */\n\t\tisPending(card) {\n\t\t\treturn Object.hasOwn(this.pendingMoves, this.cardKey(card))\n\t\t},\n\n\t\t/**\n\t\t * Handle a column's \"load more\" click: local mode reveals the next page\n\t\t * from the already-fetched full set; backend-paginated mode only emits —\n\t\t * the host fetches the next page and passes updated `columns`.\n\t\t *\n\t\t * @param {object} column The column.\n\t\t * @return {void}\n\t\t */\n\t\tonLoadMore(column) {\n\t\t\tif (!Array.isArray(this.columns)) {\n\t\t\t\tconst full = this.fullCardsByColumn[this.columnKey(column.value)] || []\n\t\t\t\tcolumn.cards = full.slice(0, column.cards.length + this.pageSize)\n\t\t\t}\n\t\t\t/**\n\t\t\t * @event load-more Emitted when a column's \"load more\" is clicked.\n\t\t\t * @type {{ value: unknown, offset: number }}\n\t\t\t */\n\t\t\tthis.$emit('load-more', { value: column.value, offset: column.cards.length })\n\t\t},\n\n\t\t/**\n\t\t * Card click (ignored while the card is mid-drag).\n\t\t *\n\t\t * @param {object} card The card object.\n\t\t * @return {void}\n\t\t */\n\t\tonCardClick(card) {\n\t\t\t/**\n\t\t\t * @event card-click Emitted when a card is clicked (not dragged).\n\t\t\t * @type {object} The card's object.\n\t\t\t */\n\t\t\tthis.$emit('card-click', card)\n\t\t},\n\n\t\t/**\n\t\t * vuedraggable `@start` — remember which column a drag began in, since\n\t\t * `@change` on the destination column doesn't know the source.\n\t\t *\n\t\t * @param {object} column The column the drag started in.\n\t\t * @return {void}\n\t\t */\n\t\tonDragStart(column) {\n\t\t\tthis.dragOriginValue = column.value\n\t\t},\n\n\t\t/**\n\t\t * vuedraggable `@change` on a column's card list. Only the destination\n\t\t * column's `added` event carries the dropped object; a same-column\n\t\t * reorder (`moved`) or the source column's `removed` are no-ops here.\n\t\t *\n\t\t * @param {object} evt vuedraggable's change event.\n\t\t * @param {object} column The column the event fired on.\n\t\t * @return {void}\n\t\t */\n\t\tonColumnChange(evt, column) {\n\t\t\tif (!evt.added) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tconst card = evt.added.element\n\t\t\tconst fromValue = this.dragOriginValue\n\t\t\tconst toValue = column.value\n\t\t\tthis.dragOriginValue = null\n\n\t\t\tif (fromValue === toValue) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tthis.commitMove(card, fromValue, toValue, evt.added.newIndex)\n\t\t},\n\n\t\t/**\n\t\t * Record the pending move and emit it for the host to persist. The card\n\t\t * has already been moved optimistically by vuedraggable's v-model splice.\n\t\t *\n\t\t * @param {object} card The moved object.\n\t\t * @param {unknown} fromValue The origin column's value.\n\t\t * @param {unknown} toValue The destination column's value.\n\t\t * @param {number} originIndex The index the card is currently at in the destination column (used only for logging/debugging).\n\t\t * @return {void}\n\t\t */\n\t\tcommitMove(card, fromValue, toValue, originIndex) {\n\t\t\tconst id = this.cardKey(card)\n\t\t\tthis.suppressRebuild = true\n\t\t\tthis.pendingMoves = {\n\t\t\t\t...this.pendingMoves,\n\t\t\t\t[id]: { fromValue, toValue, card, originIndex },\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * @event move Emitted after a card is optimistically moved to another\n\t\t\t * column. The host performs the actual object write through the\n\t\t\t * existing guarded PATCH/PUT endpoint and calls `resolveMove`/\n\t\t\t * `rejectMove` on this component to confirm or roll back.\n\t\t\t * @type {{ object: object, groupByField: string, fromValue: unknown, toValue: unknown }}\n\t\t\t */\n\t\t\tthis.$emit('move', {\n\t\t\t\tobject: card,\n\t\t\t\tgroupByField: this.groupByField,\n\t\t\t\tfromValue,\n\t\t\t\ttoValue,\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * Confirm a pending move succeeded — clears its pending visual state.\n\t\t * The card already sits in the destination column (optimistic UI); no\n\t\t * further mutation is needed.\n\t\t *\n\t\t * @param {unknown} objectId The moved object's `rowKey` value.\n\t\t * @return {void}\n\t\t * @public\n\t\t */\n\t\tresolveMove(objectId) {\n\t\t\tthis.clearPending(objectId)\n\t\t},\n\n\t\t/**\n\t\t * Roll back a rejected move: the card returns to its origin column and\n\t\t * `move-rejected` fires with the server's reason.\n\t\t *\n\t\t * @param {unknown} objectId The moved object's `rowKey` value.\n\t\t * @param {string} [reason] The rejection reason (e.g. an illegal lifecycle\n\t\t * transition message) to surface to the user.\n\t\t * @return {void}\n\t\t * @public\n\t\t */\n\t\trejectMove(objectId, reason) {\n\t\t\tconst pending = this.pendingMoves[objectId]\n\t\t\tif (!pending) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tconst toColumn = this.localColumns.find((c) => c.value === pending.toValue)\n\t\t\tconst fromColumn = this.localColumns.find((c) => c.value === pending.fromValue)\n\n\t\t\tif (toColumn) {\n\t\t\t\tconst idx = toColumn.cards.findIndex((c) => this.cardKey(c) === objectId)\n\t\t\t\tif (idx !== -1) {\n\t\t\t\t\ttoColumn.cards.splice(idx, 1)\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (fromColumn) {\n\t\t\t\tfromColumn.cards.push(pending.card)\n\t\t\t}\n\n\t\t\tthis.clearPending(objectId)\n\n\t\t\t/**\n\t\t\t * @event move-rejected Emitted after `rejectMove()` rolls a card back\n\t\t\t * to its origin column.\n\t\t\t * @type {{ object: object, fromValue: unknown, toValue: unknown, reason: (string|undefined) }}\n\t\t\t */\n\t\t\tthis.$emit('move-rejected', {\n\t\t\t\tobject: pending.card,\n\t\t\t\tfromValue: pending.fromValue,\n\t\t\t\ttoValue: pending.toValue,\n\t\t\t\treason,\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * Remove a move from the pending map and, once none remain, allow\n\t\t * prop-driven rebuilds again.\n\t\t *\n\t\t * @param {unknown} objectId The moved object's `rowKey` value.\n\t\t * @return {void}\n\t\t */\n\t\tclearPending(objectId) {\n\t\t\tconst { [objectId]: _removed, ...rest } = this.pendingMoves\n\t\t\tthis.pendingMoves = rest\n\t\t\tif (Object.keys(rest).length === 0) {\n\t\t\t\tthis.suppressRebuild = false\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-object-kanban__loading,\n.cn-object-kanban__empty {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tpadding: 40px;\n}\n\n.cn-object-kanban__board {\n\tdisplay: flex;\n\tgap: 16px;\n\toverflow-x: auto;\n\tpadding-bottom: 8px;\n}\n\n.cn-object-kanban__column {\n\tdisplay: flex;\n\tflex-direction: column;\n\tflex: 0 0 280px;\n\tmin-width: 280px;\n\tbackground: var(--color-background-dark);\n\tborder-radius: var(--border-radius-large, 10px);\n\tpadding: 8px;\n}\n\n.cn-object-kanban__column-header {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: space-between;\n\tpadding: 8px;\n\tfont-weight: 600;\n}\n\n.cn-object-kanban__column-count {\n\tcolor: var(--color-text-maxcontrast);\n\tfont-weight: 400;\n}\n\n.cn-object-kanban__column-cards {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 8px;\n\tmin-height: 40px;\n}\n\n.cn-object-kanban__card {\n\tbackground: var(--color-main-background);\n\tborder: 1px solid var(--color-border);\n\tborder-radius: var(--border-radius, 8px);\n\tpadding: 10px;\n\tcursor: grab;\n\ttransition: opacity 0.15s ease;\n}\n\n.cn-object-kanban__card--pending {\n\topacity: 0.6;\n}\n\n/* A late card. The label carries the meaning; the edge helps a sighted\n reader find it. An inset shadow, so the card keeps its size. */\n.cn-object-kanban__card--overdue {\n\tborder-color: var(--color-error);\n\tbox-shadow: inset 3px 0 0 var(--color-error);\n}\n\n.cn-object-kanban__due {\n\tdisplay: block;\n\tfont-size: 0.85em;\n\tfont-weight: 700;\n}\n\n.cn-object-kanban__due--overdue {\n\tcolor: var(--color-error-text, var(--color-error));\n}\n\n.cn-object-kanban__due--soon {\n\tcolor: var(--color-warning-text, var(--color-main-text));\n\tfont-weight: 600;\n}\n\n.cn-object-kanban__card-title {\n\tfont-weight: 500;\n\tcursor: pointer;\n}\n\n.cn-object-kanban__card-fields {\n\tmargin-top: 6px;\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 2px;\n\tfont-size: 13px;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-object-kanban__load-more {\n\tdisplay: flex;\n\tjustify-content: center;\n\tpadding-top: 8px;\n}\n\n/* Board look (screens-kanban-parity): the same column tokens as CnBoardView. */\n.cn-object-kanban__board--board {\n\tgap: 16px;\n}\n\n.cn-object-kanban__board--board .cn-object-kanban__column {\n\tflex: 1 0 240px;\n\tmin-width: 240px;\n\tpadding: 12px;\n\tborder-radius: 12px;\n}\n\n.cn-object-kanban__board--board .cn-object-kanban__card {\n\tpadding: 14px;\n\tborder-radius: 10px;\n}\n</style>\n"],"names":["CnEmptyContent","CnCellRenderer","t"],"mappings":";;;;;;;;;AAmHA;AACC;AACA;AACA;AACA;;AAEA;;;AAGA;AACA;;AAEA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;;;;AAIA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;;;;;;;;AASA;;AAED,aAAe;AACd,CAAA,IAAI,EAAE,gBAAgB;;CAEtB,UAAU,EAAE;AACX,EAAA,SAAS,EAAE,SAAS;AACpB,EAAA,QAAQ;EACR,aAAa;AACb,kBAAAA,UAAc;EACd,UAAU;AACV,kBAAAC,YAAc;EACd;;AAED,CAAA,MAAM,EAAE;AACP;EACA,MAAM,EAAE,EAAE,OAAO,EAAE,WAAU,EAAG;EAChC;;AAED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,CAAC,YAAY,CAAC,QAAQ,EAAA;;AAE1B;;AAEC;AACA;;GAED,IAAI,CAAC,KAAK,CAAC,eAAe,EAAE;AAC3B,IAAA,MAAM,EAAE,OAAO,CAAC,IAAI;IACpB,SAAS,EAAE,OAAO,CAAC,SAAS;IAC5B,OAAO,EAAE,OAAO,CAAC,OAAO;AACxB,IAAA,MAAM;IACN,EAAA;GACD;;AAED;;;AAGC;;;;EAID,YAAY,CAAC,QAAQ,EAAE;GACtB,MAAM,EAAE,CAAC,QAAQ,GAAG,QAAQ,EAAE,GAAG,IAAK,EAAA,GAAI,IAAI,CAAC,aAAW;AAC1D,GAAA,IAAI,CAAC,eAAe,KAAG;AACvB,GAAA,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAO,KAAI,CAAC,EAAE;IACnC,IAAI,CAAC,kBAAkB,MAAI;AAC5B,IAAA;GACA;EACD;AACF;;;;"}
|
|
1
|
+
{"version":3,"file":"CnObjectKanban.vue2.js","sources":["../../../../src/components/CnObjectKanban/CnObjectKanban.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n\n<template>\n\t<div class=\"cn-object-kanban\">\n\t\t<div v-if=\"loading\" class=\"cn-object-kanban__loading\">\n\t\t\t<NcLoadingIcon :size=\"32\" />\n\t\t</div>\n\n\t\t<div v-else-if=\"localColumns.length === 0\" class=\"cn-object-kanban__empty\">\n\t\t\t<!-- @slot empty Custom empty state shown when there are no columns to render. -->\n\t\t\t<slot name=\"empty\">\n\t\t\t\t<CnEmptyContent :name=\"emptyText\">\n\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t<ViewColumn :size=\"64\" />\n\t\t\t\t\t</template>\n\t\t\t\t</CnEmptyContent>\n\t\t\t</slot>\n\t\t</div>\n\n\t\t<div v-else class=\"cn-object-kanban__board\" :class=\"{ 'cn-object-kanban__board--board': isBoardLook }\">\n\t\t\t<div\n\t\t\t\tv-for=\"column in localColumns\"\n\t\t\t\t:key=\"columnKey(column.value)\"\n\t\t\t\tclass=\"cn-object-kanban__column\">\n\t\t\t\t<div class=\"cn-object-kanban__column-header\">\n\t\t\t\t\t<!-- @slot column-header Override a column's header. -->\n\t\t\t\t\t<!-- @binding {object} column The column ({ value, cards, total, limit, offset }). -->\n\t\t\t\t\t<slot name=\"column-header\" :column=\"column\">\n\t\t\t\t\t\t<span class=\"cn-object-kanban__column-title\">{{ columnLabel(column) }}</span>\n\t\t\t\t\t\t<span class=\"cn-object-kanban__column-count\">{{ column.total }}</span>\n\t\t\t\t\t</slot>\n\t\t\t\t</div>\n\n\t\t\t\t<!-- `#item` + `item-key`: vuedraggable@4 (the Vue 3 build)\n\t\t\t\t renders the cards itself from this slot. A `v-for` in the\n\t\t\t\t default slot throws \"draggable element must have an item\n\t\t\t\t slot\" the moment the column paints. -->\n\t\t\t\t<Draggable\n\t\t\t\t\t:list=\"column.cards\"\n\t\t\t\t\ttag=\"div\"\n\t\t\t\t\tclass=\"cn-object-kanban__column-cards\"\n\t\t\t\t\t:itemKey=\"cardKey\"\n\t\t\t\t\tgroup=\"cn-object-kanban-cards\"\n\t\t\t\t\t:data-column-value=\"columnKey(column.value)\"\n\t\t\t\t\t@start=\"onDragStart(column)\"\n\t\t\t\t\t@change=\"onColumnChange($event, column)\">\n\t\t\t\t\t<template #item=\"{ element: card }\">\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclass=\"cn-object-kanban__card\"\n\t\t\t\t\t\t\t:class=\"{\n\t\t\t\t\t\t\t\t'cn-object-kanban__card--pending': isPending(card),\n\t\t\t\t\t\t\t\t'cn-object-kanban__card--overdue': dueState(card) === 'overdue',\n\t\t\t\t\t\t\t\t'cn-object-kanban__card--soon': dueState(card) === 'soon',\n\t\t\t\t\t\t\t}\">\n\t\t\t\t\t\t\t<!-- @slot card Fully replace the default card rendering. -->\n\t\t\t\t\t\t\t<!-- @binding {object} object The card's object. -->\n\t\t\t\t\t\t\t<!-- @binding {object} column The column the card currently sits in. -->\n\t\t\t\t\t\t\t<!-- @binding {string|null} dueState The card's due state under `dueRule`: `overdue`, `soon`, `ok`, or null without a rule. -->\n\t\t\t\t\t\t\t<slot\n\t\t\t\t\t\t\t\tname=\"card\"\n\t\t\t\t\t\t\t\t:object=\"card\"\n\t\t\t\t\t\t\t\t:column=\"column\"\n\t\t\t\t\t\t\t\t:dueState=\"dueState(card)\">\n\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\tv-if=\"dueLabel(card)\"\n\t\t\t\t\t\t\t\t\tclass=\"cn-object-kanban__due\"\n\t\t\t\t\t\t\t\t\t:class=\"`cn-object-kanban__due--${dueState(card)}`\"\n\t\t\t\t\t\t\t\t\tdata-testid=\"cn-kanban-due\">\n\t\t\t\t\t\t\t\t\t{{ dueLabel(card) }}\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t<div class=\"cn-object-kanban__card-title\" @click=\"onCardClick(card)\">\n\t\t\t\t\t\t\t\t\t{{ cardTitle(card) }}\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div v-if=\"cardFields.length\" class=\"cn-object-kanban__card-fields\">\n\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\tv-for=\"field in cardFields\"\n\t\t\t\t\t\t\t\t\t\t:key=\"field\"\n\t\t\t\t\t\t\t\t\t\tclass=\"cn-object-kanban__card-field\">\n\t\t\t\t\t\t\t\t\t\t<CnCellRenderer\n\t\t\t\t\t\t\t\t\t\t\t:value=\"card[field]\"\n\t\t\t\t\t\t\t\t\t\t\t:property=\"schemaProperty(field)\"\n\t\t\t\t\t\t\t\t\t\t\t:truncate=\"40\" />\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</slot>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</template>\n\t\t\t\t</Draggable>\n\n\t\t\t\t<div v-if=\"hasMore(column)\" class=\"cn-object-kanban__load-more\">\n\t\t\t\t\t<NcButton :disabled=\"isColumnLoading(column)\" @click=\"onLoadMore(column)\">\n\t\t\t\t\t\t<template v-if=\"isColumnLoading(column)\" #icon>\n\t\t\t\t\t\t\t<NcLoadingIcon :size=\"16\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t{{ loadMoreLabel }}\n\t\t\t\t\t</NcButton>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport { NcButton, NcLoadingIcon } from '@nextcloud/vue'\nimport draggable from 'vuedraggable'\nimport ViewColumn from 'vue-material-design-icons/ViewColumn.vue'\nimport CnEmptyContent from '../CnEmptyContent/CnEmptyContent.vue'\nimport { normalizeLook } from '../../composables/useLook.js'\nimport { dueStateForRow } from '../../utils/dueRule.js'\nimport { CnCellRenderer } from '../CnCellRenderer/index.js'\n\n/**\n * CnObjectKanban — Kanban board over a schema property's distinct values.\n *\n * Renders one column per distinct value of `groupByField` and paginates each\n * column's cards independently (\"load more\", never a whole column at once).\n * Column values/order come from (in precedence order) an explicit\n * `columnOrder`, the `groupByField` schema property's `enum`, or values\n * discovered from `objects` — mirroring OpenRegister's\n * `ViewPresentationService::deriveColumnValues()`.\n *\n * Two rendering modes:\n * - **Pre-built columns** — pass `columns` (the shape returned by\n * `GET /api/views/{id}/kanban`: `[{ value, cards, total, limit, offset }]`);\n * the host owns pagination and re-fetches on `load-more`.\n * - **Flat objects** — pass `objects` + `groupByField` (and optionally\n * `columnOrder`/`schema`); the component derives and paginates columns\n * locally.\n *\n * Dragging a card to another column does NOT write anything itself — there is\n * deliberately no bespoke \"move card\" endpoint (REQ-VIEW-KANBAN-03). The move\n * is applied optimistically to the local board and the component emits\n * `move`; the host performs the actual object PATCH/PUT through the existing\n * guarded write path and reports back:\n * - On success, nothing further is required (the optimistic move already\n * reflects it) — optionally call `resolveMove(id)` to clear the pending\n * visual state sooner.\n * - On a rejected (e.g. illegal lifecycle transition) write, call\n * `rejectMove(id, reason)` — the card snaps back to its origin column and\n * `move-rejected` fires with the reason for the host to surface.\n *\n * ```vue\n * <CnObjectKanban\n * :objects=\"objects\"\n * group-by-field=\"status\"\n * :column-order=\"['todo', 'doing', 'done']\"\n * :card-fields=\"['title', 'assignee']\"\n * :schema=\"schema\"\n * ref=\"kanban\"\n * @move=\"onMove\"\n * @load-more=\"fetchMoreCards\" />\n * ```\n * ```js\n * async onMove({ object, groupByField, fromValue, toValue }) {\n * try {\n * await patchObject(object.id, { [groupByField]: toValue })\n * } catch (e) {\n * this.$refs.kanban.rejectMove(object.id, e.message)\n * }\n * }\n * ```\n */\nexport default {\n\tname: 'CnObjectKanban',\n\n\tcomponents: {\n\t\tDraggable: draggable,\n\t\tNcButton,\n\t\tNcLoadingIcon,\n\t\tCnEmptyContent,\n\t\tViewColumn,\n\t\tCnCellRenderer,\n\t},\n\n\tinject: {\n\t\t/** The look the app is drawn in; the board look takes the board column tokens. */\n\t\tcnLook: { default: 'nextcloud' },\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * Flat objects to derive columns from (ignored when `columns` is set).\n\t\t *\n\t\t * @type {Array<object>}\n\t\t */\n\t\tobjects: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t\t/**\n\t\t * Pre-built columns, e.g. the response of `GET /api/views/{id}/kanban`.\n\t\t *\n\t\t * @type {Array<{value: string|number, cards: Array<object>, total: number, limit: number, offset: number}>|null}\n\t\t */\n\t\tcolumns: {\n\t\t\ttype: Array,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** The schema property whose distinct values become columns. */\n\t\tgroupByField: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\n\t\t/** Explicit column order. Takes precedence over the schema's enum order. */\n\t\tcolumnOrder: {\n\t\t\ttype: Array,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** Object fields rendered on each card (in order). */\n\t\tcardFields: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t\t/** Schema definition, used to resolve enum column order and card field types. */\n\t\tschema: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** Overall loading state (initial board fetch). */\n\t\tloading: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/** Column values currently loading more cards (drives the per-column spinner). */\n\t\tloadingColumns: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t\t/** Cards shown per column before \"load more\", in local (`objects`-driven) mode. */\n\t\tpageSize: {\n\t\t\ttype: Number,\n\t\t\tdefault: 20,\n\t\t},\n\n\t\t/** Object property used as each card's identity. */\n\t\trowKey: {\n\t\t\ttype: String,\n\t\t\tdefault: 'id',\n\t\t},\n\n\t\t/**\n\t\t * Marks late cards: `{ field, soonDays? }`. `field` is the dot-path to\n\t\t * a card's due date. A date before today gets an error edge and the\n\t\t * label \"Overdue\"; a date within `soonDays` (default 3) gets \"Due\n\t\t * soon\" in the warning colour. `null` (the default) marks nothing.\n\t\t *\n\t\t * The same rule shape the table's date cell uses, so a list and its\n\t\t * board agree on what late means.\n\t\t *\n\t\t * @type {{field: string, soonDays?: number}|null}\n\t\t */\n\t\tdueRule: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\t},\n\n\temits: ['card-click', 'load-more', 'move', 'move-rejected'],\n\n\tdata() {\n\t\treturn {\n\t\t\tlocalColumns: [],\n\t\t\t// column.value -> full unpaginated card list, local mode only.\n\t\t\tfullCardsByColumn: {},\n\t\t\t// Suppressed while a move is pending so the prop-driven rebuild\n\t\t\t// doesn't clobber the optimistic UI before the host's data catches up.\n\t\t\tsuppressRebuild: false,\n\t\t\t// objectId -> { fromValue, toValue, card, originIndex }\n\t\t\tpendingMoves: {},\n\t\t\tdragOriginValue: null,\n\t\t\t// The day late marking measures from.\n\t\t\ttoday: new Date(),\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/** @return {boolean} Whether the app takes the board look. */\n\t\tisBoardLook() {\n\t\t\treturn normalizeLook(this.cnLook) === 'board'\n\t\t},\n\n\t\temptyText() {\n\t\t\treturn t('nextcloud-vue', 'No columns to show')\n\t\t},\n\n\t\tloadMoreLabel() {\n\t\t\treturn t('nextcloud-vue', 'Load more')\n\t\t},\n\t},\n\n\twatch: {\n\t\tobjects: {\n\t\t\thandler() {\n\t\t\t\tif (!this.suppressRebuild) {\n\t\t\t\t\tthis.rebuild()\n\t\t\t\t}\n\t\t\t},\n\n\t\t\tdeep: false,\n\t\t},\n\n\t\tcolumns: {\n\t\t\thandler() {\n\t\t\t\tif (!this.suppressRebuild) {\n\t\t\t\t\tthis.rebuild()\n\t\t\t\t}\n\t\t\t},\n\n\t\t\tdeep: false,\n\t\t},\n\n\t\tgroupByField() {\n\t\t\tthis.rebuild()\n\t\t},\n\n\t\tcolumnOrder: {\n\t\t\thandler() {\n\t\t\t\tthis.rebuild()\n\t\t\t},\n\n\t\t\tdeep: true,\n\t\t},\n\t},\n\n\tcreated() {\n\t\tthis.rebuild()\n\t},\n\n\tmethods: {\n\t\tt,\n\n\t\t/**\n\t\t * A card's due state under `dueRule`.\n\t\t *\n\t\t * @param {object} card The card's row.\n\t\t * @return {'overdue'|'soon'|'ok'|null} The state, or null when no rule applies.\n\t\t * @spec openspec/changes/detail-action-model-and-case-surfaces/specs/detail-action-model/spec.md#requirement-late-marking-on-board-cards\n\t\t */\n\t\tdueState(card) {\n\t\t\treturn dueStateForRow(card, this.dueRule, this.today)\n\t\t},\n\n\t\t/**\n\t\t * The words a late card carries. Colour alone would not reach a reader\n\t\t * who cannot see it, or cannot tell red from amber.\n\t\t *\n\t\t * @param {object} card The card's row.\n\t\t * @return {string} \"Overdue\", \"Due soon\", or '' for a card that is fine.\n\t\t * @spec openspec/changes/detail-action-model-and-case-surfaces/specs/detail-action-model/spec.md#requirement-late-marking-on-board-cards\n\t\t */\n\t\tdueLabel(card) {\n\t\t\tconst state = this.dueState(card)\n\t\t\tif (state === 'overdue') {\n\t\t\t\treturn t('nextcloud-vue', 'Overdue')\n\t\t\t}\n\t\t\treturn state === 'soon' ? t('nextcloud-vue', 'Due soon') : ''\n\t\t},\n\n\t\t/**\n\t\t * Rebuild `localColumns` from either the `columns` prop (backend-paginated\n\t\t * mode) or `objects` + `groupByField` (locally-derived mode).\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\trebuild() {\n\t\t\tif (Array.isArray(this.columns)) {\n\t\t\t\tthis.localColumns = this.columns.map((column) => ({\n\t\t\t\t\tvalue: column.value,\n\t\t\t\t\tcards: Array.isArray(column.cards) ? [...column.cards] : [],\n\t\t\t\t\ttotal: typeof column.total === 'number' ? column.total : (column.cards || []).length,\n\t\t\t\t\tlimit: column.limit,\n\t\t\t\t\toffset: column.offset,\n\t\t\t\t}))\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tconst values = this.deriveColumnValues()\n\t\t\tconst fullByColumn = {}\n\t\t\tthis.localColumns = values.map((value) => {\n\t\t\t\tconst fullCards = this.objects.filter((object) => object && object[this.groupByField] === value)\n\t\t\t\tfullByColumn[this.columnKey(value)] = fullCards\n\t\t\t\treturn {\n\t\t\t\t\tvalue,\n\t\t\t\t\tcards: fullCards.slice(0, this.pageSize),\n\t\t\t\t\ttotal: fullCards.length,\n\t\t\t\t\tlimit: this.pageSize,\n\t\t\t\t\toffset: 0,\n\t\t\t\t}\n\t\t\t})\n\t\t\tthis.fullCardsByColumn = fullByColumn\n\t\t},\n\n\t\t/**\n\t\t * Derive the ordered column values: `columnOrder` > schema enum order >\n\t\t * distinct values observed in `objects`. Mirrors\n\t\t * `ViewPresentationService::deriveColumnValues()`.\n\t\t *\n\t\t * @return {Array<unknown>}\n\t\t */\n\t\tderiveColumnValues() {\n\t\t\tif (Array.isArray(this.columnOrder) && this.columnOrder.length > 0) {\n\t\t\t\treturn [...this.columnOrder]\n\t\t\t}\n\n\t\t\tconst enumValues = this.schema?.properties?.[this.groupByField]?.enum\n\t\t\tif (Array.isArray(enumValues) && enumValues.length > 0) {\n\t\t\t\treturn [...enumValues]\n\t\t\t}\n\n\t\t\treturn this.discoverDistinctValues()\n\t\t},\n\n\t\t/**\n\t\t * Distinct `groupByField` values observed in `objects`, in first-seen order.\n\t\t *\n\t\t * @return {Array<unknown>}\n\t\t */\n\t\tdiscoverDistinctValues() {\n\t\t\tconst seen = new Set()\n\t\t\tconst values = []\n\t\t\tfor (const object of this.objects) {\n\t\t\t\tconst value = object?.[this.groupByField]\n\t\t\t\tif (value !== undefined && value !== null && !seen.has(value)) {\n\t\t\t\t\tseen.add(value)\n\t\t\t\t\tvalues.push(value)\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn values\n\t\t},\n\n\t\t/**\n\t\t * Stable string key for a column value (used as a `:key` and as the\n\t\t * `fullCardsByColumn` index — object/array values are unlikely but guarded).\n\t\t *\n\t\t * @param {unknown} value The column value.\n\t\t * @return {string}\n\t\t */\n\t\tcolumnKey(value) {\n\t\t\treturn typeof value === 'string' || typeof value === 'number' ? String(value) : JSON.stringify(value)\n\t\t},\n\n\t\t/**\n\t\t * The card's identity, per `rowKey`.\n\t\t *\n\t\t * @param {object} card The card object.\n\t\t * @return {unknown}\n\t\t */\n\t\tcardKey(card) {\n\t\t\treturn card?.[this.rowKey]\n\t\t},\n\n\t\t/**\n\t\t * Display label for a column: its schema `oneOf[].title` when the\n\t\t * property declares per-value titles, otherwise the raw value.\n\t\t *\n\t\t * @param {object} column The column.\n\t\t * @return {string}\n\t\t */\n\t\tcolumnLabel(column) {\n\t\t\tconst oneOf = this.schema?.properties?.[this.groupByField]?.oneOf\n\t\t\tif (Array.isArray(oneOf)) {\n\t\t\t\tconst match = oneOf.find((entry) => entry?.const === column.value)\n\t\t\t\tif (match?.title) {\n\t\t\t\t\treturn match.title\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn String(column.value)\n\t\t},\n\n\t\t/**\n\t\t * Best-effort card title: the schema's configured name field, else\n\t\t * `title`/`name`/the row key.\n\t\t *\n\t\t * @param {object} card The card object.\n\t\t * @return {string}\n\t\t */\n\t\tcardTitle(card) {\n\t\t\tconst nameField = this.schema?.configuration?.objectNameField\n\t\t\tif (nameField && card[nameField]) {\n\t\t\t\treturn String(card[nameField])\n\t\t\t}\n\t\t\treturn String(card.title || card.name || card[this.rowKey] || '—')\n\t\t},\n\n\t\t/**\n\t\t * The schema property definition for a card field, if known.\n\t\t *\n\t\t * @param {string} field The field name.\n\t\t * @return {object|undefined}\n\t\t */\n\t\tschemaProperty(field) {\n\t\t\treturn this.schema?.properties?.[field]\n\t\t},\n\n\t\t/**\n\t\t * Whether a column has more cards to load: backend-paginated mode compares\n\t\t * `cards.length` to `total`; local mode compares to the full filtered set.\n\t\t *\n\t\t * @param {object} column The column.\n\t\t * @return {boolean}\n\t\t */\n\t\thasMore(column) {\n\t\t\tif (Array.isArray(this.columns)) {\n\t\t\t\treturn column.cards.length < column.total\n\t\t\t}\n\t\t\tconst full = this.fullCardsByColumn[this.columnKey(column.value)] || []\n\t\t\treturn column.cards.length < full.length\n\t\t},\n\n\t\t/**\n\t\t * Whether a column's \"load more\" is in flight.\n\t\t *\n\t\t * @param {object} column The column.\n\t\t * @return {boolean}\n\t\t */\n\t\tisColumnLoading(column) {\n\t\t\treturn this.loadingColumns.includes(column.value)\n\t\t},\n\n\t\t/**\n\t\t * Whether a card has an unresolved optimistic move.\n\t\t *\n\t\t * @param {object} card The card object.\n\t\t * @return {boolean}\n\t\t */\n\t\tisPending(card) {\n\t\t\treturn Object.hasOwn(this.pendingMoves, this.cardKey(card))\n\t\t},\n\n\t\t/**\n\t\t * Handle a column's \"load more\" click: local mode reveals the next page\n\t\t * from the already-fetched full set; backend-paginated mode only emits —\n\t\t * the host fetches the next page and passes updated `columns`.\n\t\t *\n\t\t * @param {object} column The column.\n\t\t * @return {void}\n\t\t */\n\t\tonLoadMore(column) {\n\t\t\tif (!Array.isArray(this.columns)) {\n\t\t\t\tconst full = this.fullCardsByColumn[this.columnKey(column.value)] || []\n\t\t\t\tcolumn.cards = full.slice(0, column.cards.length + this.pageSize)\n\t\t\t}\n\t\t\t/**\n\t\t\t * @event load-more Emitted when a column's \"load more\" is clicked.\n\t\t\t * @type {{ value: unknown, offset: number }}\n\t\t\t */\n\t\t\tthis.$emit('load-more', { value: column.value, offset: column.cards.length })\n\t\t},\n\n\t\t/**\n\t\t * Card click (ignored while the card is mid-drag).\n\t\t *\n\t\t * @param {object} card The card object.\n\t\t * @return {void}\n\t\t */\n\t\tonCardClick(card) {\n\t\t\t/**\n\t\t\t * @event card-click Emitted when a card is clicked (not dragged).\n\t\t\t * @type {object} The card's object.\n\t\t\t */\n\t\t\tthis.$emit('card-click', card)\n\t\t},\n\n\t\t/**\n\t\t * vuedraggable `@start` — remember which column a drag began in, since\n\t\t * `@change` on the destination column doesn't know the source.\n\t\t *\n\t\t * @param {object} column The column the drag started in.\n\t\t * @return {void}\n\t\t */\n\t\tonDragStart(column) {\n\t\t\tthis.dragOriginValue = column.value\n\t\t},\n\n\t\t/**\n\t\t * vuedraggable `@change` on a column's card list. Only the destination\n\t\t * column's `added` event carries the dropped object; a same-column\n\t\t * reorder (`moved`) or the source column's `removed` are no-ops here.\n\t\t *\n\t\t * @param {object} evt vuedraggable's change event.\n\t\t * @param {object} column The column the event fired on.\n\t\t * @return {void}\n\t\t */\n\t\tonColumnChange(evt, column) {\n\t\t\tif (!evt.added) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tconst card = evt.added.element\n\t\t\tconst fromValue = this.dragOriginValue\n\t\t\tconst toValue = column.value\n\t\t\tthis.dragOriginValue = null\n\n\t\t\tif (fromValue === toValue) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tthis.commitMove(card, fromValue, toValue, evt.added.newIndex)\n\t\t},\n\n\t\t/**\n\t\t * Record the pending move and emit it for the host to persist. The card\n\t\t * has already been moved optimistically by vuedraggable's v-model splice.\n\t\t *\n\t\t * @param {object} card The moved object.\n\t\t * @param {unknown} fromValue The origin column's value.\n\t\t * @param {unknown} toValue The destination column's value.\n\t\t * @param {number} originIndex The index the card is currently at in the destination column (used only for logging/debugging).\n\t\t * @return {void}\n\t\t */\n\t\tcommitMove(card, fromValue, toValue, originIndex) {\n\t\t\tconst id = this.cardKey(card)\n\t\t\tthis.suppressRebuild = true\n\t\t\tthis.pendingMoves = {\n\t\t\t\t...this.pendingMoves,\n\t\t\t\t[id]: { fromValue, toValue, card, originIndex },\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * @event move Emitted after a card is optimistically moved to another\n\t\t\t * column. The host performs the actual object write through the\n\t\t\t * existing guarded PATCH/PUT endpoint and calls `resolveMove`/\n\t\t\t * `rejectMove` on this component to confirm or roll back.\n\t\t\t * @type {{ object: object, groupByField: string, fromValue: unknown, toValue: unknown }}\n\t\t\t */\n\t\t\tthis.$emit('move', {\n\t\t\t\tobject: card,\n\t\t\t\tgroupByField: this.groupByField,\n\t\t\t\tfromValue,\n\t\t\t\ttoValue,\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * Confirm a pending move succeeded — clears its pending visual state.\n\t\t * The card already sits in the destination column (optimistic UI); no\n\t\t * further mutation is needed.\n\t\t *\n\t\t * @param {unknown} objectId The moved object's `rowKey` value.\n\t\t * @return {void}\n\t\t * @public\n\t\t */\n\t\tresolveMove(objectId) {\n\t\t\tthis.clearPending(objectId)\n\t\t},\n\n\t\t/**\n\t\t * Roll back a rejected move: the card returns to its origin column and\n\t\t * `move-rejected` fires with the server's reason.\n\t\t *\n\t\t * @param {unknown} objectId The moved object's `rowKey` value.\n\t\t * @param {string} [reason] The rejection reason (e.g. an illegal lifecycle\n\t\t * transition message) to surface to the user.\n\t\t * @return {void}\n\t\t * @public\n\t\t */\n\t\trejectMove(objectId, reason) {\n\t\t\tconst pending = this.pendingMoves[objectId]\n\t\t\tif (!pending) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tconst toColumn = this.localColumns.find((c) => c.value === pending.toValue)\n\t\t\tconst fromColumn = this.localColumns.find((c) => c.value === pending.fromValue)\n\n\t\t\tif (toColumn) {\n\t\t\t\tconst idx = toColumn.cards.findIndex((c) => this.cardKey(c) === objectId)\n\t\t\t\tif (idx !== -1) {\n\t\t\t\t\ttoColumn.cards.splice(idx, 1)\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (fromColumn) {\n\t\t\t\tfromColumn.cards.push(pending.card)\n\t\t\t}\n\n\t\t\tthis.clearPending(objectId)\n\n\t\t\t/**\n\t\t\t * @event move-rejected Emitted after `rejectMove()` rolls a card back\n\t\t\t * to its origin column.\n\t\t\t * @type {{ object: object, fromValue: unknown, toValue: unknown, reason: (string|undefined) }}\n\t\t\t */\n\t\t\tthis.$emit('move-rejected', {\n\t\t\t\tobject: pending.card,\n\t\t\t\tfromValue: pending.fromValue,\n\t\t\t\ttoValue: pending.toValue,\n\t\t\t\treason,\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * Remove a move from the pending map and, once none remain, allow\n\t\t * prop-driven rebuilds again.\n\t\t *\n\t\t * @param {unknown} objectId The moved object's `rowKey` value.\n\t\t * @return {void}\n\t\t */\n\t\tclearPending(objectId) {\n\t\t\tconst { [objectId]: _removed, ...rest } = this.pendingMoves\n\t\t\tthis.pendingMoves = rest\n\t\t\tif (Object.keys(rest).length === 0) {\n\t\t\t\tthis.suppressRebuild = false\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-object-kanban__loading,\n.cn-object-kanban__empty {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tpadding: 40px;\n}\n\n.cn-object-kanban__board {\n\tdisplay: flex;\n\tgap: 16px;\n\toverflow-x: auto;\n\tpadding-bottom: 8px;\n}\n\n.cn-object-kanban__column {\n\tdisplay: flex;\n\tflex-direction: column;\n\tflex: 0 0 280px;\n\tmin-width: 280px;\n\tbackground: var(--color-background-dark);\n\tborder-radius: var(--border-radius-large, 10px);\n\tpadding: 8px;\n}\n\n.cn-object-kanban__column-header {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: space-between;\n\tpadding: 8px;\n\tfont-weight: 600;\n}\n\n.cn-object-kanban__column-count {\n\tcolor: var(--color-text-maxcontrast);\n\tfont-weight: 400;\n}\n\n.cn-object-kanban__column-cards {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 8px;\n\tmin-height: 40px;\n}\n\n.cn-object-kanban__card {\n\tbackground: var(--color-main-background);\n\tborder: 1px solid var(--color-border);\n\tborder-radius: var(--border-radius, 8px);\n\tpadding: 10px;\n\tcursor: grab;\n\ttransition: opacity 0.15s ease;\n}\n\n.cn-object-kanban__card--pending {\n\topacity: 0.6;\n}\n\n/* A late card. The label carries the meaning; the edge helps a sighted\n reader find it. An inset shadow, so the card keeps its size. */\n.cn-object-kanban__card--overdue {\n\tborder-color: var(--color-error);\n\tbox-shadow: inset 3px 0 0 var(--color-error);\n}\n\n.cn-object-kanban__due {\n\tdisplay: block;\n\tfont-size: 0.85em;\n\tfont-weight: 700;\n}\n\n.cn-object-kanban__due--overdue {\n\tcolor: var(--color-error-text, var(--color-error));\n}\n\n.cn-object-kanban__due--soon {\n\tcolor: var(--color-warning-text, var(--color-main-text));\n\tfont-weight: 600;\n}\n\n.cn-object-kanban__card-title {\n\tfont-weight: 500;\n\tcursor: pointer;\n}\n\n.cn-object-kanban__card-fields {\n\tmargin-top: 6px;\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 2px;\n\tfont-size: 13px;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-object-kanban__load-more {\n\tdisplay: flex;\n\tjustify-content: center;\n\tpadding-top: 8px;\n}\n\n/* Board look (screens-kanban-parity): the same column tokens as CnBoardView. */\n.cn-object-kanban__board--board {\n\tgap: 16px;\n}\n\n.cn-object-kanban__board--board .cn-object-kanban__column {\n\tflex: 1 0 240px;\n\tmin-width: 240px;\n\tpadding: 12px;\n\tborder-radius: 12px;\n}\n\n.cn-object-kanban__board--board .cn-object-kanban__card {\n\tpadding: 14px;\n\tborder-radius: 10px;\n}\n</style>\n"],"names":["draggable","CnEmptyContent","CnCellRenderer","t"],"mappings":";;;;;;;;;AAmHA;AACC;AACA;AACA;AACA;;AAEA;;;AAGA;AACA;;AAEA;;;AAGA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;;;;AAIA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;;;;;;;;AASA;;AAED,aAAe;AACd,CAAA,IAAI,EAAE,gBAAgB;;CAEtB,UAAU,EAAE;AACX,EAAA,SAAS,EAAEA,SAAS;AACpB,EAAA,QAAQ;EACR,aAAa;AACb,kBAAAC,UAAc;EACd,UAAU;AACV,kBAAAC,YAAc;EACd;;AAED,CAAA,MAAM,EAAE;AACP;EACA,MAAM,EAAE,EAAE,OAAO,EAAE,WAAU,EAAG;EAChC;;AAED,CAAA,KAAK,EAAE;AACN;;AAEC;AACA;;AAED,EAAA,OAAO,EAAE;GACR,IAAI,EAAE,KAAK;AACX,GAAA,OAAO,EAAE,MAAM,EAAE;GACjB;;AAED;AACC;AACA;;;AAGD,EAAA,OAAO,EAAE;GACR,IAAI,EAAE,KAAK;GACX,OAAO,EAAE,IAAI;GACb;;;EAGD,YAAY,EAAE;GACb,IAAI,EAAE,MAAM;GACZ,QAAQ,EAAE,IAAI;GACd;;AAED;EACA,WAAW,EAAE;GACZ,IAAI,EAAE,KAAK;GACX,OAAO,EAAE,IAAI;GACb;;AAED;EACA,UAAU,EAAE;GACX,IAAI,EAAE,KAAK;AACX,GAAA,OAAO,EAAE,MAAM,EAAE;GACjB;;AAED;AACA,EAAA,MAAM,EAAE;GACP,IAAI,EAAE,MAAM;GACZ,OAAO,EAAE,IAAI;GACb;;AAED;AACA,EAAA,OAAO,EAAE;GACR,IAAI,EAAE,OAAO;GACb,OAAO,EAAE,KAAK;GACd;;AAED;AACA,EAAA,cAAc,EAAE;GACf,IAAI,EAAE,KAAK;AACX,GAAA,OAAO,EAAE,MAAM,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vuedraggable.umd.js';
|
|
3
3
|
import __sfc_main from './CnPageTreeRow.vue.js';
|
|
4
4
|
import { stripTrailingSlashes } from '../../utils/trailingSlashes.js';
|
|
5
5
|
|
|
@@ -26,7 +26,7 @@ const pageKeys = new WeakMap();
|
|
|
26
26
|
var script = {
|
|
27
27
|
name: 'CnPageTreeNode',
|
|
28
28
|
|
|
29
|
-
components: { Draggable:
|
|
29
|
+
components: { Draggable: Draggable, CnPageTreeRow: __sfc_main },
|
|
30
30
|
|
|
31
31
|
props: {
|
|
32
32
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CnPageTreeNode.vue2.js","sources":["../../../../src/components/CnPageTreeNode/CnPageTreeNode.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n\n<template>\n\t<!-- `#item` + `item-key`, NOT a `v-for` in the default slot. vuedraggable@4\n\t is the Vue 3 build and it renders rows ITSELF from this slot: the\n\t Vue 2 form throws \"draggable element must have an item slot\" outright\n\t (`computeNodes` in its source) and warns that the required `itemKey`\n\t is missing. `item-key` takes the same function the `:key` used to. -->\n\t<Draggable v-model=\"tree\"\n\t\ttag=\"ul\"\n\t\tclass=\"cn-page-tree\"\n\t\t:itemKey=\"(node) => nodeKey(node.ref)\"\n\t\t:group=\"group\"\n\t\thandle=\".cn-page-tree__handle\"\n\t\t:move=\"onMove\"\n\t\t@end=\"flatten\">\n\t\t<template #item=\"{ element: node }\">\n\t\t\t<li class=\"cn-page-tree__node\">\n\t\t\t\t<CnPageTreeRow :page=\"node.ref\"\n\t\t\t\t\t:canAddChild=\"maxDepth > 0\"\n\t\t\t\t\t@addChild=\"addChild(node)\"\n\t\t\t\t\t@rename=\"(id) => renamePage(node.ref, id)\"\n\t\t\t\t\t@remove=\"removeNode(node, null)\" />\n\n\t\t\t\t<!-- One level of children: a drop target on every top page so a\n\t\t\t\t row can be dragged IN (to nest) or OUT (to top level). -->\n\t\t\t\t<Draggable v-if=\"maxDepth > 0\"\n\t\t\t\t\tv-model=\"node.children\"\n\t\t\t\t\ttag=\"ul\"\n\t\t\t\t\tclass=\"cn-page-tree__children\"\n\t\t\t\t\t:class=\"{ 'cn-page-tree__children--empty': !node.children.length }\"\n\t\t\t\t\t:itemKey=\"(child) => nodeKey(child.ref)\"\n\t\t\t\t\t:group=\"group\"\n\t\t\t\t\thandle=\".cn-page-tree__handle\"\n\t\t\t\t\t:move=\"onMove\"\n\t\t\t\t\t@end=\"flatten\">\n\t\t\t\t\t<template #item=\"{ element: child }\">\n\t\t\t\t\t\t<li class=\"cn-page-tree__node\">\n\t\t\t\t\t\t\t<CnPageTreeRow :page=\"child.ref\"\n\t\t\t\t\t\t\t\t:canAddChild=\"false\"\n\t\t\t\t\t\t\t\t@rename=\"(id) => renamePage(child.ref, id)\"\n\t\t\t\t\t\t\t\t@remove=\"removeNode(child, node)\" />\n\t\t\t\t\t\t</li>\n\t\t\t\t\t</template>\n\t\t\t\t</Draggable>\n\t\t\t</li>\n\t\t</template>\n\t</Draggable>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport draggable from 'vuedraggable'\nimport CnPageTreeRow from './CnPageTreeRow.vue'\nimport { stripTrailingSlashes } from '../../utils/trailingSlashes.js'\n\n// Stable per-page-object render keys, independent of the mutable `id`. Keyed by\n// the page ref itself (a WeakMap, so removed pages are GC'd) so a slug rename —\n// which changes `id` in place — does NOT change the `<li>` key and therefore\n// does NOT tear down the row (which would close its inline settings panel).\nlet pageKeySeq = 0\nconst pageKeys = new WeakMap()\n\n/**\n * CnPageTreeNode — the pages editor's drag-and-drop tree (ADR-041).\n *\n * Renders the working manifest's FLAT `pages[]` (each page carrying an optional\n * `parent` id) as a two-level draggable tree: drag a row to reorder, or drag it\n * into / out of a page to nest (an index and its detail, one level deep). Each\n * row (CnPageTreeRow) edits its own fields inline + via a cog popover. Drag\n * operates on a local nested mirror (`tree`) of real page refs; after every drop\n * the mirror is FLATTENED back onto the flat `pages[]` in place — top nodes lose\n * `parent`, nested nodes get `parent = <top id>` — so `diffManifest` sees the\n * change and the manifest keeps its flat shape. Field edits mutate the real page\n * refs directly, independent of the mirror.\n */\nexport default {\n\tname: 'CnPageTreeNode',\n\n\tcomponents: { Draggable: draggable, CnPageTreeRow },\n\n\tprops: {\n\t\t/**\n\t\t * The full, flat `pages[]` array (the working manifest's). Edited in\n\t\t * place; the tree is derived from each page's `parent`.\n\t\t *\n\t\t * @type {Array}\n\t\t */\n\t\tlist: {\n\t\t\ttype: Array,\n\t\t\trequired: true,\n\t\t},\n\n\t\t/** Maximum nesting depth that may gain children (one level: index → detail). */\n\t\tmaxDepth: {\n\t\t\ttype: Number,\n\t\t\tdefault: 1,\n\t\t},\n\n\t\t/**\n\t\t * The working manifest's `menu[]`, used to re-point menu links (whose\n\t\t * `route` is a page id) when a page's slug is renamed. Optional — when\n\t\t * absent, only child `parent` references are cascaded.\n\t\t *\n\t\t * @type {Array}\n\t\t */\n\t\tmenu: {\n\t\t\ttype: Array,\n\t\t\tdefault: null,\n\t\t},\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\t// Local nested mirror of `list` (real page refs) that vuedraggable\n\t\t\t// reorders; flattened back to `list` after each drop.\n\t\t\ttree: this.buildTree(),\n\t\t\t// Shared drag group so rows move between the top list and child lists.\n\t\t\tgroup: 'cn-pages',\n\t\t\t// Guard against the `list` watcher rebuilding the tree during our own\n\t\t\t// flatten (which would discard the just-dropped arrangement).\n\t\t\tsuppressRebuild: false,\n\t\t}\n\t},\n\n\twatch: {\n\t\t// The prop's IDENTITY, for a host that swaps the array wholesale.\n\t\tlist: {\n\t\t\thandler: 'rebuild',\n\t\t\tdeep: false,\n\t\t},\n\n\t\t// ...and its LENGTH, for a host that pushes or splices in place. The\n\t\t// modal's \"Add page\" does exactly that — `list` IS the working\n\t\t// manifest's `pages[]`, so its reference never changes and the watcher\n\t\t// above never fired: the page was appended to the manifest and simply\n\t\t// never appeared.\n\t\t//\n\t\t// Length rather than `deep: true`, which would fire on every keystroke\n\t\t// in a row's Title/Route field and rebuild the tree under the user,\n\t\t// tearing down the row whose settings panel is open.\n\t\t//\n\t\t// This component's OWN mutations all land in `flatten()`, which holds\n\t\t// `suppressRebuild` across the splice, so they do not round-trip.\n\t\t'list.length': 'rebuild',\n\t},\n\n\tmethods: {\n\t\tt,\n\t\t/**\n\t\t * Re-seed the local tree from `list`, unless our own `flatten()` is\n\t\t * mid-write.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\trebuild() {\n\t\t\tif (this.suppressRebuild) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.tree = this.buildTree()\n\t\t},\n\n\t\t/**\n\t\t * Stable render key for a page's `<li>`, tied to the page object rather\n\t\t * than its `id`. Renaming a slug mutates `id` in place; keying by `id`\n\t\t * would change the key and tear the row down, closing its open settings\n\t\t * panel. Keyed by the ref (via WeakMap) so it survives renames and tree\n\t\t * rebuilds (which reuse the same page objects).\n\t\t *\n\t\t * @param {object} ref The page object.\n\t\t * @return {string} A stable key for this page.\n\t\t */\n\t\tnodeKey(ref) {\n\t\t\tlet key = pageKeys.get(ref)\n\t\t\tif (!key) {\n\t\t\t\tkey = `cn-page-${++pageKeySeq}`\n\t\t\t\tpageKeys.set(ref, key)\n\t\t\t}\n\t\t\treturn key\n\t\t},\n\n\t\t/**\n\t\t * Build the nested mirror from the flat `list`: top-level pages (no\n\t\t * `parent`) each carry their children (`parent === id`). Pages whose\n\t\t * `parent` doesn't resolve to a top page are surfaced as top (no orphans).\n\t\t *\n\t\t * @return {Array<{ref: object, children: Array}>}\n\t\t */\n\t\tbuildTree() {\n\t\t\tconst list = Array.isArray(this.list) ? this.list : []\n\t\t\tconst topIds = new Set(list.filter((p) => p && !p.parent).map((p) => p.id))\n\t\t\tconst childrenByParent = {}\n\t\t\tconst top = []\n\t\t\tfor (const p of list) {\n\t\t\t\tif (!p) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif (p.parent && topIds.has(p.parent)) {\n\t\t\t\t\t(childrenByParent[p.parent] || (childrenByParent[p.parent] = [])).push(p)\n\t\t\t\t} else {\n\t\t\t\t\ttop.push(p)\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn top.map((ref) => ({\n\t\t\t\tref,\n\t\t\t\tchildren: (childrenByParent[ref.id] || []).map((c) => ({ ref: c, children: [] })),\n\t\t\t}))\n\t\t},\n\n\t\t/**\n\t\t * Flatten the mirror back onto `list` in place: top nodes drop `parent`,\n\t\t * nested nodes get `parent = <top id>`, preserving array order.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tflatten() {\n\t\t\tconst flat = []\n\t\t\tfor (const node of this.tree) {\n\t\t\t\tif (node.ref.parent) {\n\t\t\t\t\tdelete node.ref.parent\n\t\t\t\t}\n\t\t\t\tflat.push(node.ref)\n\t\t\t\tfor (const child of node.children) {\n\t\t\t\t\tchild.ref.parent = node.ref.id\n\t\t\t\t\tflat.push(child.ref)\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.suppressRebuild = true\n\t\t\t// In-place edit by design — `list` is the working manifest's pages[],\n\t\t\t// mutated by reference so diffManifest captures the reorder/nesting.\n\t\t\t// eslint-disable-next-line vue/no-mutating-props\n\t\t\tthis.list.splice(0, this.list.length, ...flat)\n\t\t\tthis.$nextTick(() => {\n\t\t\t\tthis.suppressRebuild = false\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * vuedraggable guard: forbid dropping a node that HAS children into a\n\t\t * child list (that would nest two levels deep). `relatedContext.list` is\n\t\t * the destination array — anything other than the top `tree` is a child\n\t\t * list.\n\t\t *\n\t\t * @param {object} evt The vuedraggable move event.\n\t\t * @return {boolean} False to veto the move.\n\t\t */\n\t\tonMove(evt) {\n\t\t\tconst dragged = evt.draggedContext && evt.draggedContext.element\n\t\t\tconst target = evt.relatedContext && evt.relatedContext.list\n\t\t\tconst intoChild = target && target !== this.tree\n\t\t\tif (intoChild && dragged && Array.isArray(dragged.children) && dragged.children.length) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\treturn true\n\t\t},\n\n\t\t/**\n\t\t * Generate a unique `page-N` id not already used in `list`.\n\t\t *\n\t\t * @return {string}\n\t\t */\n\t\tnextId() {\n\t\t\tconst ids = new Set(this.list.map((p) => p && p.id))\n\t\t\tlet n = this.list.length + 1\n\t\t\twhile (ids.has(`page-${n}`)) {\n\t\t\t\tn++\n\t\t\t}\n\t\t\treturn `page-${n}`\n\t\t},\n\n\t\t/**\n\t\t * Rename a page's slug (its id). Cascades the new id to child pages'\n\t\t * `parent` and to any `menu[]` links whose `route` targets the old id, so\n\t\t * nesting and navigation keep working. No-op when the new id collides with\n\t\t * another page. The page id is the vue-router route name.\n\t\t *\n\t\t * @param {object} ref The page being renamed (mutated in place).\n\t\t * @param {string} newId The sanitised new id.\n\t\t * @return {void}\n\t\t */\n\t\trenamePage(ref, newId) {\n\t\t\tconst oldId = ref.id\n\t\t\tif (!newId || newId === oldId) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (this.list.some((p) => p && p.id === newId)) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tfor (const p of this.list) {\n\t\t\t\tif (p && p.parent === oldId) {\n\t\t\t\t\tp.parent = newId\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (Array.isArray(this.menu)) {\n\t\t\t\tconst walk = (items) => (items || []).forEach((it) => {\n\t\t\t\t\tif (!it) {\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t\tif (it.route === oldId) {\n\t\t\t\t\t\tit.route = newId\n\t\t\t\t\t}\n\t\t\t\t\twalk(it.children)\n\t\t\t\t})\n\t\t\t\twalk(this.menu)\n\t\t\t}\n\t\t\tref.id = newId\n\t\t\tthis.flatten()\n\t\t\tthis.tree = this.buildTree()\n\t\t},\n\n\t\t/**\n\t\t * Append a detail sub-page under a top node (route built from the parent).\n\t\t *\n\t\t * @param {object} node The parent tree node.\n\t\t * @return {void}\n\t\t */\n\t\taddChild(node) {\n\t\t\tconst base = stripTrailingSlashes(String(node.ref.route || ''))\n\t\t\tconst ref = { id: this.nextId(), parent: node.ref.id, type: 'detail', route: `${base}/:id`, title: '', config: {} }\n\t\t\tnode.children.push({ ref, children: [] })\n\t\t\tthis.flatten()\n\t\t},\n\n\t\t/**\n\t\t * Remove a node. A removed top node's children are lifted to top level so\n\t\t * none orphan.\n\t\t *\n\t\t * @param {object} node The node to remove.\n\t\t * @param {object|null} parent The parent node, or null for a top node.\n\t\t * @return {void}\n\t\t */\n\t\tremoveNode(node, parent) {\n\t\t\tif (parent) {\n\t\t\t\tconst i = parent.children.indexOf(node)\n\t\t\t\tif (i !== -1) {\n\t\t\t\t\tparent.children.splice(i, 1)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconst i = this.tree.indexOf(node)\n\t\t\t\tif (i !== -1) {\n\t\t\t\t\tthis.tree.splice(i, 1, ...node.children)\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.flatten()\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-page-tree {\n\tlist-style: none;\n\tmargin: 0;\n\tpadding: 0;\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 4px;\n}\n\n.cn-page-tree__children {\n\tlist-style: none;\n\tmargin: 4px 0 0 28px;\n\tpadding: 0 0 0 8px;\n\tborder-left: 2px solid var(--color-border);\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 4px;\n}\n\n/* Keep an empty child list as a visible drop target for nesting. */\n.cn-page-tree__children--empty {\n\tmin-height: 10px;\n\tmargin-top: 0;\n\tborder-left-color: transparent;\n}\n\n.cn-page-tree__node {\n\tlist-style: none;\n}\n</style>\n"],"names":["CnPageTreeRow","t"],"mappings":";;;;;AA2DA;AACA;AACA;AACA;AACA,IAAI,UAAS,GAAI,EAAA;AACjB,MAAM,WAAW,IAAI,OAAO,GAAC;;AAE7B;;AAEC;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;AAED,aAAe;AACd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AI,CAAC,OAAO,GAAC;GACb;EACD;AACF;;;;"}
|
|
1
|
+
{"version":3,"file":"CnPageTreeNode.vue2.js","sources":["../../../../src/components/CnPageTreeNode/CnPageTreeNode.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n\n<template>\n\t<!-- `#item` + `item-key`, NOT a `v-for` in the default slot. vuedraggable@4\n\t is the Vue 3 build and it renders rows ITSELF from this slot: the\n\t Vue 2 form throws \"draggable element must have an item slot\" outright\n\t (`computeNodes` in its source) and warns that the required `itemKey`\n\t is missing. `item-key` takes the same function the `:key` used to. -->\n\t<Draggable v-model=\"tree\"\n\t\ttag=\"ul\"\n\t\tclass=\"cn-page-tree\"\n\t\t:itemKey=\"(node) => nodeKey(node.ref)\"\n\t\t:group=\"group\"\n\t\thandle=\".cn-page-tree__handle\"\n\t\t:move=\"onMove\"\n\t\t@end=\"flatten\">\n\t\t<template #item=\"{ element: node }\">\n\t\t\t<li class=\"cn-page-tree__node\">\n\t\t\t\t<CnPageTreeRow :page=\"node.ref\"\n\t\t\t\t\t:canAddChild=\"maxDepth > 0\"\n\t\t\t\t\t@addChild=\"addChild(node)\"\n\t\t\t\t\t@rename=\"(id) => renamePage(node.ref, id)\"\n\t\t\t\t\t@remove=\"removeNode(node, null)\" />\n\n\t\t\t\t<!-- One level of children: a drop target on every top page so a\n\t\t\t\t row can be dragged IN (to nest) or OUT (to top level). -->\n\t\t\t\t<Draggable v-if=\"maxDepth > 0\"\n\t\t\t\t\tv-model=\"node.children\"\n\t\t\t\t\ttag=\"ul\"\n\t\t\t\t\tclass=\"cn-page-tree__children\"\n\t\t\t\t\t:class=\"{ 'cn-page-tree__children--empty': !node.children.length }\"\n\t\t\t\t\t:itemKey=\"(child) => nodeKey(child.ref)\"\n\t\t\t\t\t:group=\"group\"\n\t\t\t\t\thandle=\".cn-page-tree__handle\"\n\t\t\t\t\t:move=\"onMove\"\n\t\t\t\t\t@end=\"flatten\">\n\t\t\t\t\t<template #item=\"{ element: child }\">\n\t\t\t\t\t\t<li class=\"cn-page-tree__node\">\n\t\t\t\t\t\t\t<CnPageTreeRow :page=\"child.ref\"\n\t\t\t\t\t\t\t\t:canAddChild=\"false\"\n\t\t\t\t\t\t\t\t@rename=\"(id) => renamePage(child.ref, id)\"\n\t\t\t\t\t\t\t\t@remove=\"removeNode(child, node)\" />\n\t\t\t\t\t\t</li>\n\t\t\t\t\t</template>\n\t\t\t\t</Draggable>\n\t\t\t</li>\n\t\t</template>\n\t</Draggable>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport draggable from 'vuedraggable'\nimport CnPageTreeRow from './CnPageTreeRow.vue'\nimport { stripTrailingSlashes } from '../../utils/trailingSlashes.js'\n\n// Stable per-page-object render keys, independent of the mutable `id`. Keyed by\n// the page ref itself (a WeakMap, so removed pages are GC'd) so a slug rename —\n// which changes `id` in place — does NOT change the `<li>` key and therefore\n// does NOT tear down the row (which would close its inline settings panel).\nlet pageKeySeq = 0\nconst pageKeys = new WeakMap()\n\n/**\n * CnPageTreeNode — the pages editor's drag-and-drop tree (ADR-041).\n *\n * Renders the working manifest's FLAT `pages[]` (each page carrying an optional\n * `parent` id) as a two-level draggable tree: drag a row to reorder, or drag it\n * into / out of a page to nest (an index and its detail, one level deep). Each\n * row (CnPageTreeRow) edits its own fields inline + via a cog popover. Drag\n * operates on a local nested mirror (`tree`) of real page refs; after every drop\n * the mirror is FLATTENED back onto the flat `pages[]` in place — top nodes lose\n * `parent`, nested nodes get `parent = <top id>` — so `diffManifest` sees the\n * change and the manifest keeps its flat shape. Field edits mutate the real page\n * refs directly, independent of the mirror.\n */\nexport default {\n\tname: 'CnPageTreeNode',\n\n\tcomponents: { Draggable: draggable, CnPageTreeRow },\n\n\tprops: {\n\t\t/**\n\t\t * The full, flat `pages[]` array (the working manifest's). Edited in\n\t\t * place; the tree is derived from each page's `parent`.\n\t\t *\n\t\t * @type {Array}\n\t\t */\n\t\tlist: {\n\t\t\ttype: Array,\n\t\t\trequired: true,\n\t\t},\n\n\t\t/** Maximum nesting depth that may gain children (one level: index → detail). */\n\t\tmaxDepth: {\n\t\t\ttype: Number,\n\t\t\tdefault: 1,\n\t\t},\n\n\t\t/**\n\t\t * The working manifest's `menu[]`, used to re-point menu links (whose\n\t\t * `route` is a page id) when a page's slug is renamed. Optional — when\n\t\t * absent, only child `parent` references are cascaded.\n\t\t *\n\t\t * @type {Array}\n\t\t */\n\t\tmenu: {\n\t\t\ttype: Array,\n\t\t\tdefault: null,\n\t\t},\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\t// Local nested mirror of `list` (real page refs) that vuedraggable\n\t\t\t// reorders; flattened back to `list` after each drop.\n\t\t\ttree: this.buildTree(),\n\t\t\t// Shared drag group so rows move between the top list and child lists.\n\t\t\tgroup: 'cn-pages',\n\t\t\t// Guard against the `list` watcher rebuilding the tree during our own\n\t\t\t// flatten (which would discard the just-dropped arrangement).\n\t\t\tsuppressRebuild: false,\n\t\t}\n\t},\n\n\twatch: {\n\t\t// The prop's IDENTITY, for a host that swaps the array wholesale.\n\t\tlist: {\n\t\t\thandler: 'rebuild',\n\t\t\tdeep: false,\n\t\t},\n\n\t\t// ...and its LENGTH, for a host that pushes or splices in place. The\n\t\t// modal's \"Add page\" does exactly that — `list` IS the working\n\t\t// manifest's `pages[]`, so its reference never changes and the watcher\n\t\t// above never fired: the page was appended to the manifest and simply\n\t\t// never appeared.\n\t\t//\n\t\t// Length rather than `deep: true`, which would fire on every keystroke\n\t\t// in a row's Title/Route field and rebuild the tree under the user,\n\t\t// tearing down the row whose settings panel is open.\n\t\t//\n\t\t// This component's OWN mutations all land in `flatten()`, which holds\n\t\t// `suppressRebuild` across the splice, so they do not round-trip.\n\t\t'list.length': 'rebuild',\n\t},\n\n\tmethods: {\n\t\tt,\n\t\t/**\n\t\t * Re-seed the local tree from `list`, unless our own `flatten()` is\n\t\t * mid-write.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\trebuild() {\n\t\t\tif (this.suppressRebuild) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.tree = this.buildTree()\n\t\t},\n\n\t\t/**\n\t\t * Stable render key for a page's `<li>`, tied to the page object rather\n\t\t * than its `id`. Renaming a slug mutates `id` in place; keying by `id`\n\t\t * would change the key and tear the row down, closing its open settings\n\t\t * panel. Keyed by the ref (via WeakMap) so it survives renames and tree\n\t\t * rebuilds (which reuse the same page objects).\n\t\t *\n\t\t * @param {object} ref The page object.\n\t\t * @return {string} A stable key for this page.\n\t\t */\n\t\tnodeKey(ref) {\n\t\t\tlet key = pageKeys.get(ref)\n\t\t\tif (!key) {\n\t\t\t\tkey = `cn-page-${++pageKeySeq}`\n\t\t\t\tpageKeys.set(ref, key)\n\t\t\t}\n\t\t\treturn key\n\t\t},\n\n\t\t/**\n\t\t * Build the nested mirror from the flat `list`: top-level pages (no\n\t\t * `parent`) each carry their children (`parent === id`). Pages whose\n\t\t * `parent` doesn't resolve to a top page are surfaced as top (no orphans).\n\t\t *\n\t\t * @return {Array<{ref: object, children: Array}>}\n\t\t */\n\t\tbuildTree() {\n\t\t\tconst list = Array.isArray(this.list) ? this.list : []\n\t\t\tconst topIds = new Set(list.filter((p) => p && !p.parent).map((p) => p.id))\n\t\t\tconst childrenByParent = {}\n\t\t\tconst top = []\n\t\t\tfor (const p of list) {\n\t\t\t\tif (!p) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif (p.parent && topIds.has(p.parent)) {\n\t\t\t\t\t(childrenByParent[p.parent] || (childrenByParent[p.parent] = [])).push(p)\n\t\t\t\t} else {\n\t\t\t\t\ttop.push(p)\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn top.map((ref) => ({\n\t\t\t\tref,\n\t\t\t\tchildren: (childrenByParent[ref.id] || []).map((c) => ({ ref: c, children: [] })),\n\t\t\t}))\n\t\t},\n\n\t\t/**\n\t\t * Flatten the mirror back onto `list` in place: top nodes drop `parent`,\n\t\t * nested nodes get `parent = <top id>`, preserving array order.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tflatten() {\n\t\t\tconst flat = []\n\t\t\tfor (const node of this.tree) {\n\t\t\t\tif (node.ref.parent) {\n\t\t\t\t\tdelete node.ref.parent\n\t\t\t\t}\n\t\t\t\tflat.push(node.ref)\n\t\t\t\tfor (const child of node.children) {\n\t\t\t\t\tchild.ref.parent = node.ref.id\n\t\t\t\t\tflat.push(child.ref)\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.suppressRebuild = true\n\t\t\t// In-place edit by design — `list` is the working manifest's pages[],\n\t\t\t// mutated by reference so diffManifest captures the reorder/nesting.\n\t\t\t// eslint-disable-next-line vue/no-mutating-props\n\t\t\tthis.list.splice(0, this.list.length, ...flat)\n\t\t\tthis.$nextTick(() => {\n\t\t\t\tthis.suppressRebuild = false\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * vuedraggable guard: forbid dropping a node that HAS children into a\n\t\t * child list (that would nest two levels deep). `relatedContext.list` is\n\t\t * the destination array — anything other than the top `tree` is a child\n\t\t * list.\n\t\t *\n\t\t * @param {object} evt The vuedraggable move event.\n\t\t * @return {boolean} False to veto the move.\n\t\t */\n\t\tonMove(evt) {\n\t\t\tconst dragged = evt.draggedContext && evt.draggedContext.element\n\t\t\tconst target = evt.relatedContext && evt.relatedContext.list\n\t\t\tconst intoChild = target && target !== this.tree\n\t\t\tif (intoChild && dragged && Array.isArray(dragged.children) && dragged.children.length) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\treturn true\n\t\t},\n\n\t\t/**\n\t\t * Generate a unique `page-N` id not already used in `list`.\n\t\t *\n\t\t * @return {string}\n\t\t */\n\t\tnextId() {\n\t\t\tconst ids = new Set(this.list.map((p) => p && p.id))\n\t\t\tlet n = this.list.length + 1\n\t\t\twhile (ids.has(`page-${n}`)) {\n\t\t\t\tn++\n\t\t\t}\n\t\t\treturn `page-${n}`\n\t\t},\n\n\t\t/**\n\t\t * Rename a page's slug (its id). Cascades the new id to child pages'\n\t\t * `parent` and to any `menu[]` links whose `route` targets the old id, so\n\t\t * nesting and navigation keep working. No-op when the new id collides with\n\t\t * another page. The page id is the vue-router route name.\n\t\t *\n\t\t * @param {object} ref The page being renamed (mutated in place).\n\t\t * @param {string} newId The sanitised new id.\n\t\t * @return {void}\n\t\t */\n\t\trenamePage(ref, newId) {\n\t\t\tconst oldId = ref.id\n\t\t\tif (!newId || newId === oldId) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (this.list.some((p) => p && p.id === newId)) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tfor (const p of this.list) {\n\t\t\t\tif (p && p.parent === oldId) {\n\t\t\t\t\tp.parent = newId\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (Array.isArray(this.menu)) {\n\t\t\t\tconst walk = (items) => (items || []).forEach((it) => {\n\t\t\t\t\tif (!it) {\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t\tif (it.route === oldId) {\n\t\t\t\t\t\tit.route = newId\n\t\t\t\t\t}\n\t\t\t\t\twalk(it.children)\n\t\t\t\t})\n\t\t\t\twalk(this.menu)\n\t\t\t}\n\t\t\tref.id = newId\n\t\t\tthis.flatten()\n\t\t\tthis.tree = this.buildTree()\n\t\t},\n\n\t\t/**\n\t\t * Append a detail sub-page under a top node (route built from the parent).\n\t\t *\n\t\t * @param {object} node The parent tree node.\n\t\t * @return {void}\n\t\t */\n\t\taddChild(node) {\n\t\t\tconst base = stripTrailingSlashes(String(node.ref.route || ''))\n\t\t\tconst ref = { id: this.nextId(), parent: node.ref.id, type: 'detail', route: `${base}/:id`, title: '', config: {} }\n\t\t\tnode.children.push({ ref, children: [] })\n\t\t\tthis.flatten()\n\t\t},\n\n\t\t/**\n\t\t * Remove a node. A removed top node's children are lifted to top level so\n\t\t * none orphan.\n\t\t *\n\t\t * @param {object} node The node to remove.\n\t\t * @param {object|null} parent The parent node, or null for a top node.\n\t\t * @return {void}\n\t\t */\n\t\tremoveNode(node, parent) {\n\t\t\tif (parent) {\n\t\t\t\tconst i = parent.children.indexOf(node)\n\t\t\t\tif (i !== -1) {\n\t\t\t\t\tparent.children.splice(i, 1)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconst i = this.tree.indexOf(node)\n\t\t\t\tif (i !== -1) {\n\t\t\t\t\tthis.tree.splice(i, 1, ...node.children)\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.flatten()\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-page-tree {\n\tlist-style: none;\n\tmargin: 0;\n\tpadding: 0;\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 4px;\n}\n\n.cn-page-tree__children {\n\tlist-style: none;\n\tmargin: 4px 0 0 28px;\n\tpadding: 0 0 0 8px;\n\tborder-left: 2px solid var(--color-border);\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 4px;\n}\n\n/* Keep an empty child list as a visible drop target for nesting. */\n.cn-page-tree__children--empty {\n\tmin-height: 10px;\n\tmargin-top: 0;\n\tborder-left-color: transparent;\n}\n\n.cn-page-tree__node {\n\tlist-style: none;\n}\n</style>\n"],"names":["draggable","CnPageTreeRow","t"],"mappings":";;;;;AA2DA;AACA;AACA;AACA;AACA,IAAI,UAAS,GAAI,EAAA;AACjB,MAAM,WAAW,IAAI,OAAO,GAAC;;AAE7B;;AAEC;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;AAED,aAAe;AACd,CAAA,IAAI,EAAE,gBAAgB;;CAEtB,UAAU,EAAE,EAAE,SAAS,EAAEA,SAAS,iBAAEC,YAAe;;AAEnD,CAAA,KAAK,EAAE;AACN;;AAEC;AACA;;;EAGD,IAAI,EAAE;GACL,IAAI,EAAE,KAAK;GACX,QAAQ,EAAE,IAAI;GACd;;AAED;AACA,EAAA,QAAQ,EAAE;GACT,IAAI,EAAE,MAAM;AACZ,GAAA,OAAO,EAAE,CAAC;GACV;;AAED;;;;AAIC;;;EAGD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AAA;GAC9D,MAAM,GAAE,GAAI,EAAE,EAAE,EAAE,IAAI,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAG,GAAA;AAClH,GAAA,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAA;GACxC,IAAI,CAAC,OAAO,GAAC;GACb;;AAED;;;AAGC;AACA;;;;EAID,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE;GACxB,IAAI,MAAM,EAAE;AACX,IAAA,MAAM,IAAI,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAA;IACtC,IAAI,CAAE,KAAI,CAAC,CAAC,EAAE;KACb,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAA;AAC5B,KAAA;IACC,MAAK;IACN,MAAM,CAAA,GAAI,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAA;IAChC,IAAI,CAAE,KAAI,CAAC,CAAC,EAAE;AACb,KAAA,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,IAAI,CAAC,QAAQ,EAAA;AACxC,KAAA;AACD,IAAA;GACA,IAAI,CAAC,OAAO,GAAC;GACb;EACD;AACF;;;;"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import script from './CnQrCode.vue2.js';
|
|
2
|
+
import { render } from './CnQrCode.vue3.js';
|
|
3
|
+
|
|
4
|
+
script.render = render;
|
|
5
|
+
script.__scopeId = "data-v-0ddf7072";
|
|
6
|
+
const __sfc_main = script;
|
|
7
|
+
|
|
8
|
+
export { __sfc_main as default };
|
|
9
|
+
//# sourceMappingURL=CnQrCode.vue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CnQrCode.vue.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
|