@conduction/nextcloud-vue 2.171.0 → 2.173.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/components/CnActionDialog/CnActionDialog.vue.js +1 -1
- package/dist/esm/components/CnActionDialog/CnActionDialog.vue2.js.map +1 -1
- package/dist/esm/components/CnActionDialog/CnActionDialog.vue3.js.map +1 -1
- package/dist/esm/components/CnAiCompanion/CnAiChatWidget.vue2.js +3 -2
- package/dist/esm/components/CnAiCompanion/CnAiChatWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnAiCompanion/CnAiChatWidget.vue3.js +2 -1
- package/dist/esm/components/CnAiCompanion/CnAiChatWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnAiCompanion/CnAiCompanion.vue2.js +39 -0
- package/dist/esm/components/CnAiCompanion/CnAiCompanion.vue2.js.map +1 -1
- package/dist/esm/components/CnAiCompanion/CnAiCompanion.vue3.js.map +1 -1
- package/dist/esm/components/CnChecklistRunWidget/CnChecklistRunWidget.vue.js +1 -1
- package/dist/esm/components/CnChecklistRunWidget/CnChecklistRunWidget.vue2.js +22 -3
- package/dist/esm/components/CnChecklistRunWidget/CnChecklistRunWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnChecklistRunWidget/CnChecklistRunWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnDashboardGrid/CnDashboardGrid.vue.js +1 -1
- package/dist/esm/components/CnDashboardGrid/CnDashboardGrid.vue2.js.map +1 -1
- package/dist/esm/components/CnDashboardGrid/CnDashboardGrid.vue3.js.map +1 -1
- package/dist/esm/components/CnDeviceFramesWidget/CnDeviceFramesWidget.vue.js +1 -1
- package/dist/esm/components/CnDeviceFramesWidget/CnDeviceFramesWidget.vue2.js +75 -4
- package/dist/esm/components/CnDeviceFramesWidget/CnDeviceFramesWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnDeviceFramesWidget/CnDeviceFramesWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue.js +1 -1
- package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue2.js +7 -3
- package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue.js +1 -1
- package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue2.js +34 -4
- package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue2.js.map +1 -1
- package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue3.js +42 -34
- package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue3.js.map +1 -1
- package/dist/esm/components/CnFlowsPage/CnFlowBoard.vue.js +1 -1
- package/dist/esm/components/CnFlowsPage/CnFlowBoard.vue2.js +21 -6
- package/dist/esm/components/CnFlowsPage/CnFlowBoard.vue2.js.map +1 -1
- package/dist/esm/components/CnFlowsPage/CnFlowBoard.vue3.js.map +1 -1
- package/dist/esm/components/CnTreeView/CnTreeNode.vue.js +1 -1
- package/dist/esm/components/CnTreeView/CnTreeNode.vue2.js +54 -4
- package/dist/esm/components/CnTreeView/CnTreeNode.vue2.js.map +1 -1
- package/dist/esm/components/CnTreeView/CnTreeNode.vue3.js +32 -26
- 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 +28 -4
- package/dist/esm/components/CnTreeView/CnTreeView.vue2.js.map +1 -1
- package/dist/esm/components/CnTreeView/CnTreeView.vue3.js +4 -1
- package/dist/esm/components/CnTreeView/CnTreeView.vue3.js.map +1 -1
- package/dist/esm/composables/aiChatConfig.js +13 -1
- package/dist/esm/composables/aiChatConfig.js.map +1 -1
- package/dist/esm/composables/useAiChatStream.js +53 -1
- package/dist/esm/composables/useAiChatStream.js.map +1 -1
- package/dist/esm/library-style.js +1 -1
- package/dist/esm/nextcloud-vue.css +745 -403
- package/dist/esm/utils/builtInFormatters.js +19 -1
- package/dist/esm/utils/builtInFormatters.js.map +1 -1
- package/dist/nextcloud-vue.cjs.js +919 -569
- package/dist/nextcloud-vue.cjs.js.map +2 -2
- package/dist/nextcloud-vue.css +745 -403
- package/package.json +1 -1
- package/src/components/CnActionDialog/CnActionDialog.vue +4 -1
- package/src/components/CnAiCompanion/CnAiChatWidget.md +1 -0
- package/src/components/CnAiCompanion/CnAiChatWidget.vue +4 -2
- package/src/components/CnAiCompanion/CnAiCompanion.md +1 -0
- package/src/components/CnAiCompanion/CnAiCompanion.vue +39 -0
- package/src/components/CnChecklistRunWidget/CnChecklistRunWidget.vue +24 -3
- package/src/components/CnDashboardGrid/CnDashboardGrid.vue +5 -2
- package/src/components/CnDeviceFramesWidget/CnDeviceFramesWidget.vue +75 -4
- package/src/components/CnFactsWidget/CnFactsWidget.vue +7 -3
- package/src/components/CnFilesBrowser/CnFilesBrowser.vue +45 -4
- package/src/components/CnFlowsPage/CnFlowBoard.vue +27 -6
- package/src/components/CnTreeView/CnTreeNode.vue +69 -6
- package/src/components/CnTreeView/CnTreeView.vue +31 -4
- package/src/composables/aiChatConfig.js +12 -0
- package/src/composables/useAiChatStream.js +53 -0
- package/src/css/look-board-detail.css +200 -6
- package/src/css/look-board-index.css +7 -6
- package/src/css/look-board.css +118 -0
- package/src/css/patches.css +4 -1
- package/src/utils/builtInFormatters.js +18 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CnDashboardGrid.vue3.js","sources":["../../../../src/components/CnDashboardGrid/CnDashboardGrid.vue?vue&type=template&id=4ef4b904&lang.js"],"sourcesContent":["<!--\n CnDashboardGrid — GridStack-powered drag-and-drop dashboard grid.\n\n Renders widgets in a configurable grid layout. Supports drag, resize,\n and dynamic item addition/removal. Emits layout changes for persistence.\n\n Accessibility: every grid item is an ARIA `group` with an accessible name\n and — in edit mode — a tab stop, so the pointer-only GridStack drag/resize\n gestures have a full keyboard equivalent (WCAG 2.1 SC 2.1.1). Keyboard\n moves are routed through `GridStack.update()`, i.e. the exact same engine\n call drag/resize ends in, so collision handling, persistence and the\n `layout-change` emission are byte-identical between the two input modes.\n-->\n<template>\n\t<div ref=\"gridContainer\"\n\t\tclass=\"cn-dashboard-grid\"\n\t\t:class=\"{ 'cn-dashboard-grid--side-column': sideColumnStyle !== null, 'cn-dashboard-grid--weighted': columnBounds !== null, 'cn-dashboard-grid--fill': filling }\"\n\t\t:style=\"sideColumnStyle\">\n\t\t<!--\n\t\t\tKeyboard instructions, referenced by every grid item through\n\t\t\t`aria-describedby`. Rendered once (not per item) so a screen\n\t\t\treader user hears the key map on the first item they land on\n\t\t\twithout it being duplicated N times in the accessibility tree.\n\t\t-->\n\t\t<p\n\t\t\tv-if=\"keyboardActive\"\n\t\t\t:id=\"keyboardHelpDomId\"\n\t\t\tclass=\"cn-dashboard-grid__sr-only\">\n\t\t\t{{ keyboardHelpText }}\n\t\t</p>\n\n\t\t<div class=\"grid-stack\" :style=\"fillGridStyle\">\n\t\t\t<div\n\t\t\t\tv-for=\"item in itemsInRowOrder\"\n\t\t\t\t:key=\"resolveItemKey(item)\"\n\t\t\t\tclass=\"grid-stack-item\"\n\t\t\t\t:class=\"{ 'cn-dashboard-grid__item--fit': sizeToContentAttr(item) !== undefined, 'cn-dashboard-grid__item--same-height': sharesRowHeight(item) }\"\n\t\t\t\trole=\"group\"\n\t\t\t\t:aria-label=\"resolveItemLabel(item, layout.indexOf(item))\"\n\t\t\t\t:aria-describedby=\"itemDescribedBy\"\n\t\t\t\t:tabindex=\"itemTabindex\"\n\t\t\t\t:gs-id=\"item.id\"\n\t\t\t\t:gs-x=\"item.gridX\"\n\t\t\t\t:gs-y=\"scaledRow(item.gridY)\"\n\t\t\t\t:gs-w=\"item.gridWidth\"\n\t\t\t\t:gs-h=\"scaledRow(item.gridHeight)\"\n\t\t\t\t:gs-min-w=\"minWidth\"\n\t\t\t\t:gs-min-h=\"minRows(item)\"\n\t\t\t\t:gs-size-to-content=\"sizeToContentAttr(item)\"\n\t\t\t\t:data-cn-track=\"item.track === 'main' || item.track === 'side' ? item.track : undefined\"\n\t\t\t\t:data-cn-weighted=\"weightStyle(item) ? '' : undefined\"\n\t\t\t\t:data-cn-widget-id=\"item.widgetId || undefined\"\n\t\t\t\t:gs-locked=\"item.clear === true && !editable ? 'true' : undefined\"\n\t\t\t\t:style=\"itemStyle(item)\"\n\t\t\t\t@keydown=\"onItemKeydown($event, item)\">\n\t\t\t\t<div class=\"grid-stack-item-content\">\n\t\t\t\t\t<slot name=\"widget\" :item=\"item\">\n\t\t\t\t\t\t<!-- Default: render nothing; CnDashboardPage provides content -->\n\t\t\t\t\t</slot>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\n\t\t<!--\n\t\t\tPolite live region for keyboard move/resize feedback. A sighted\n\t\t\tuser sees the widget slide; a screen-reader user needs the new\n\t\t\tcoordinates spoken, otherwise the arrow keys are silent.\n\t\t-->\n\t\t<p\n\t\t\tclass=\"cn-dashboard-grid__sr-only\"\n\t\t\trole=\"status\"\n\t\t\taria-live=\"polite\"\n\t\t\taria-atomic=\"true\">\n\t\t\t{{ announcement }}\n\t\t</p>\n\t</div>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport { GridStack } from 'gridstack'\nimport { toRaw } from 'vue'\nimport { planClearRows, planGrowth, planSameHeights } from '../../utils/gridStack.js'\n// `gridstack` is a peerDependency (see package.json), not bundled — this\n// component's JS and the consumer's GridStack stylesheet MUST come from the\n// exact same installed copy, because GridStack's JS writes layout state\n// (e.g. the `--gs-column-width` CSS custom property) that only its OWN\n// matching CSS reads. Baking a copy of `gridstack/dist/gridstack.min.css`\n// into this library's build (as a previous version did) freezes it at\n// nc-vue's build-time version, which can silently drift from whatever the\n// consumer's peer-installed copy actually is — the exact mismatch that once\n// made every grid item render at 0px width. So nc-vue ships NO GridStack\n// CSS of its own: the consumer MUST install `gridstack` themselves and\n// import `gridstack/dist/gridstack.min.css` (or their preferred GridStack\n// stylesheet) from that same copy.\n\n/**\n * Monotonic counter backing the per-instance DOM ids (the shared\n * `aria-describedby` help text). Module-level so two grids on one page\n * never collide — the same pattern CnCommandPalette uses.\n */\nlet domIdCounter = 0\n\n/**\n * Pixel offset applied to the grid item's top-left corner when synthesising\n * the `contextmenu` coordinates for a keyboard activation. Nudging the anchor\n * inside the item keeps consumer menus (which position at `clientX/clientY`)\n * visually attached to the widget instead of straddling its border.\n */\nconst MENU_ANCHOR_OFFSET = 8\n\n/**\n * How many GridStack rows a layout row is drawn as on a grid with\n * size-to-content cells (`wantsRowSplit`): 80px rows become 1px rows, so a\n * cell sized to its content ends less than 1px under it. On 4px rows each\n * stacked card could end up to 4px low, and the rounding added up down a\n * column (r33 DqHandhaving \"De overtreding\" y +6).\n *\n * @spec openspec/changes/fit-cells-on-4px-rows/specs/fit-cells-on-4px-rows/spec.md#requirement-a-size-to-content-cell-ends-within-4px-of-its-content\n */\nconst ROW_SPLIT = 80\n\n/**\n * Whether a layout holds a size-to-content cell (`sizeToContent` true or a\n * positive row maximum).\n *\n * @param {Array<object>} layout The layout items.\n * @return {boolean} True when one does.\n */\nfunction hasFitCell(layout) {\n\treturn Array.isArray(layout) && layout.some((item) => item\n\t\t&& (item.sizeToContent === true || (Number.isFinite(item.sizeToContent) && item.sizeToContent > 0)))\n}\n\n/**\n * The row tracks of a grid that fills its height (`fillHeight`): `auto` for\n * a row whose items all set `fitRows`, or that no item covers, and an equal\n * share of the free height (`minmax(0, 1fr)`) for every other row.\n *\n * @spec openspec/changes/lpvandaag-start-page/specs/lpvandaag-start-page/spec.md#requirement-a-dashboard-can-fill-the-height-below-the-top-bar\n * @param {Array<object>} layout The layout items.\n * @return {string[]} One track per layout row.\n */\nexport function fillRowTracks(layout) {\n\tconst items = Array.isArray(layout) ? layout.filter(Boolean) : []\n\tconst top = (item) => (Number.isFinite(item.gridY) ? item.gridY : 0)\n\tconst height = (item) => (Number.isFinite(item.gridHeight) ? item.gridHeight : 1)\n\tconst rows = items.reduce((max, item) => Math.max(max, top(item) + height(item)), 0)\n\tconst tracks = []\n\tfor (let row = 0; row < rows; row++) {\n\t\tconst covering = items.filter((item) => row >= top(item) && row < top(item) + height(item))\n\t\tconst fits = covering.every((item) => item.fitRows === true)\n\t\ttracks.push(fits ? 'auto' : 'minmax(0, 1fr)')\n\t}\n\treturn tracks\n}\n\n/**\n * CnDashboardGrid — Low-level grid layout engine powered by GridStack.\n *\n * Manages the drag-and-drop grid, syncs positions, and emits layout\n * changes. Does NOT handle widget rendering — that's done by the parent\n * via the `#widget` scoped slot.\n *\n * ```vue\n * <CnDashboardGrid\n * :layout=\"placements\"\n * :editable=\"isEditing\"\n * @layout-change=\"onLayoutChange\">\n * <template #widget=\"{ item }\">\n * <MyWidget :config=\"item\" />\n * </template>\n * </CnDashboardGrid>\n * ```\n *\n * ### Keyboard operation\n *\n * With `keyboardRepositioning` on (the default) and `editable` true, each\n * grid item is a tab stop. With an item focused:\n *\n * | Key | Action |\n * | --- | ------ |\n * | `ArrowLeft` / `ArrowRight` | move one column left / right |\n * | `ArrowUp` / `ArrowDown` | move one row up / down |\n * | `Shift` + `ArrowLeft` / `ArrowRight` | shrink / grow width by one column |\n * | `Shift` + `ArrowUp` / `ArrowDown` | shrink / grow height by one row |\n * | `Home` / `End` | jump to the first / last column of the current row |\n * | `Enter` / `Space` | activate the item — see `item-activate` |\n *\n * Keys are only honoured when the grid item itself holds focus, so\n * interactive content rendered inside the `#widget` slot keeps its own\n * key handling untouched.\n */\nexport default {\n\tname: 'CnDashboardGrid',\n\n\tprops: {\n\t\t/** Array of layout items: { id, gridX, gridY, gridWidth, gridHeight, ...extra } */\n\t\tlayout: {\n\t\t\ttype: Array,\n\t\t\trequired: true,\n\t\t},\n\n\t\t/** Whether drag and resize are enabled */\n\t\teditable: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/** Number of grid columns */\n\t\tcolumns: {\n\t\t\ttype: Number,\n\t\t\tdefault: 12,\n\t\t},\n\n\t\t/** Cell height in pixels */\n\t\tcellHeight: {\n\t\t\ttype: Number,\n\t\t\tdefault: 80,\n\t\t},\n\n\t\t/** Grid margin in pixels */\n\t\tmargin: {\n\t\t\ttype: Number,\n\t\t\tdefault: 12,\n\t\t},\n\n\t\t/**\n\t\t * Margin under each item in pixels, in place of `margin` on that side\n\t\t * only; null keeps `margin` on every side.\n\t\t */\n\t\tmarginBottom: {\n\t\t\ttype: Number,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** Minimum widget width in grid units */\n\t\tminWidth: {\n\t\t\ttype: Number,\n\t\t\tdefault: 2,\n\t\t},\n\n\t\t/** Minimum widget height in grid units */\n\t\tminHeight: {\n\t\t\ttype: Number,\n\t\t\tdefault: 2,\n\t\t},\n\n\t\t/**\n\t\t * GridStack v12 responsive `columnOpts` bag (breakpoints + reflow\n\t\t * layout). When set, the grid reflows column count across screen sizes.\n\t\t * Build it with `getDashboardColumnOpts()`. Default `null` = fixed\n\t\t * `columns`, no responsive reflow (backwards-compatible).\n\t\t *\n\t\t * @type {object|null}\n\t\t */\n\t\tcolumnOpts: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * When set, `cellHeight` is mirrored into this CSS custom property on\n\t\t * the document root at init (e.g. `'--app-cell-height'`), so app CSS can\n\t\t * align to the grid geometry. Default `null` = no CSS var written.\n\t\t *\n\t\t * @type {string|null}\n\t\t */\n\t\tcellHeightCssVar: {\n\t\t\ttype: String,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * Optional `(item) => string|number` to derive each item's render key.\n\t\t * Use it to force a re-render when an item changes in a way its `id`\n\t\t * doesn't capture (e.g. style edits — return `${item.id}:${item.updatedAt}`).\n\t\t * Default `null` = key on `item.id`.\n\t\t *\n\t\t * @type {((item: object) => (string|number))|null}\n\t\t */\n\t\titemKey: {\n\t\t\ttype: Function,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * Whether grid items are keyboard-operable: focusable in edit mode and\n\t\t * repositionable/resizable with the arrow keys (WCAG 2.1 SC 2.1.1 —\n\t\t * the keyboard equivalent of the pointer-only GridStack drag). Turning\n\t\t * it off leaves the items non-focusable and drag-only. Default `true`.\n\t\t */\n\t\tkeyboardRepositioning: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true,\n\t\t},\n\n\t\t/**\n\t\t * Optional `(item, index) => string` returning the accessible name for\n\t\t * a grid item. Use it when the layout items don't carry a human-readable\n\t\t * field (the built-in fallback walks `title` → `name` → `label` →\n\t\t * `widgetTitle` → `widgetId`, then a positional \"Widget N\"). The returned\n\t\t * string is used verbatim — no coordinates are appended.\n\t\t *\n\t\t * @type {((item: object, index: number) => string)|null}\n\t\t */\n\t\titemLabel: {\n\t\t\ttype: Function,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * Whether a keyboard activation (`Enter` / `Space` on a focused grid\n\t\t * item) also dispatches a bubbling `contextmenu` event from inside the\n\t\t * item, so consumers that open a per-widget menu on right-click get the\n\t\t * keyboard path for free — mirroring what browsers do for the `Menu`\n\t\t * key. Set `false` to rely purely on the `item-activate` event.\n\t\t * Default `true`.\n\t\t */\n\t\tactivateOpensContextMenu: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true,\n\t\t},\n\n\t\t/**\n\t\t * GridStack's `float`. True (the default) keeps every item on the row\n\t\t * it was placed on, with empty rows above it if need be. False packs\n\t\t * items upward, so a size-to-content cell that shrinks, or a widget\n\t\t * that is not shown, closes its gap instead of leaving a band.\n\t\t *\n\t\t * @spec openspec/changes/zuiddrecht-pixel-gaps-3/specs/zuiddrecht-pixel-gaps-3/spec.md#requirement-a-dashboard-closes-the-gap-a-shrinking-or-hidden-widget-leaves\n\t\t */\n\t\tfloat: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true,\n\t\t},\n\n\t\t/**\n\t\t * A side column of a fixed width: `{ width, from? }`. The layout items\n\t\t * that say which track they are on (`track: \"main\"` or `\"side\"`) are\n\t\t * drawn on two scales: from column `from` (8 by default) on at `width`\n\t\t * px (the card, not counting the item margins), the columns before it\n\t\t * sharing the rest, so the side cards keep their width on any screen\n\t\t * (DqMijnWerk). Items without a track keep the twelve shares, so a row\n\t\t * of four tiles stays four equal tiles. Only on the full twelve-column\n\t\t * grid and not while editing; GridStack keeps the twelve columns\n\t\t * underneath.\n\t\t *\n\t\t * @spec openspec/changes/dashboard-side-column-width/specs/dashboard-side-column-width/spec.md#requirement-a-dashboard-can-draw-its-side-column-at-a-fixed-width\n\t\t */\n\t\tsideColumn: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * Weights for groups of the twelve columns: `[{ span, weight }]`, the\n\t\t * spans adding up to 12. Each group takes its weight's share of the\n\t\t * width, split evenly over its columns, so three groups of four can be\n\t\t * drawn 332 / 415 / 332 (PqWerkplekKlant in a call). Items on a\n\t\t * `sideColumn` track keep that column. Only on the full twelve-column\n\t\t * grid and not while editing; GridStack keeps the twelve columns\n\t\t * underneath.\n\t\t *\n\t\t * @spec openspec/changes/dashboard-column-weights/specs/dashboard-column-weights/spec.md#requirement-a-dashboard-can-weigh-its-column-groups\n\t\t */\n\t\tcolumnWeights: {\n\t\t\ttype: Array,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * Fill the height the host gives the grid instead of growing with\n\t\t * the content: in view mode the layout rows divide the grid's own\n\t\t * height, so the page around it does not scroll. A row whose items\n\t\t * all set `fitRows: true` takes the height of its content; every\n\t\t * other row takes an equal share of what is left. A widget that is\n\t\t * taller than its share scrolls inside its own cell. The host gives\n\t\t * the grid a definite height (a flex child with `min-height: 0`, say).\n\t\t * Edit mode, and a grid narrower than `fillMinWidth`, keep the\n\t\t * GridStack grid of `cellHeight` rows.\n\t\t *\n\t\t * @spec openspec/changes/lpvandaag-start-page/specs/lpvandaag-start-page/spec.md#requirement-a-dashboard-can-fill-the-height-below-the-top-bar\n\t\t */\n\t\tfillHeight: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * The narrowest grid, in pixels, that `fillHeight` still fills.\n\t\t * Narrower, the cards take their `cellHeight` rows (and GridStack's\n\t\t * `columnOpts` reflow) and the page scrolls.\n\t\t *\n\t\t * @spec openspec/changes/lpvandaag-start-page/specs/lpvandaag-start-page/spec.md#requirement-a-dashboard-can-fill-the-height-below-the-top-bar\n\t\t */\n\t\tfillMinWidth: {\n\t\t\ttype: Number,\n\t\t\tdefault: 960,\n\t\t},\n\t},\n\n\temits: [\n\t\t/**\n\t\t * Fired whenever the grid geometry changed — by drag, by resize, or by\n\t\t * a keyboard nudge. Payload is the full `layout` array with the moved\n\t\t * items' `gridX`/`gridY`/`gridWidth`/`gridHeight` updated.\n\t\t */\n\t\t'layout-change',\n\t\t/**\n\t\t * Fired when the user activates a focused grid item with `Enter` or\n\t\t * `Space`. Payload `{ item, element, clientX, clientY }` — the layout\n\t\t * item, its DOM element, and viewport coordinates anchored to the\n\t\t * item's top-left corner so a consumer menu can position itself the\n\t\t * same way it does for a right-click.\n\t\t */\n\t\t'item-activate',\n\t],\n\n\tdata() {\n\t\treturn {\n\t\t\tgrid: null,\n\t\t\tcontentObserver: null,\n\t\t\t/** True while the grid moves an item to where the layout put it. */\n\t\t\tapplyingLayout: false,\n\t\t\tdomId: `cn-dashboard-grid-${++domIdCounter}`,\n\t\t\t/** Text currently held in the polite live region. */\n\t\t\tannouncement: '',\n\t\t\t/**\n\t\t\t * Whether a `columnOpts` breakpoint is currently in force. Mirrored\n\t\t\t * from the engine by `syncInteractivity` because `isReflowed()` reads\n\t\t\t * `grid.getColumn()` imperatively, and a computed cannot re-evaluate\n\t\t\t * on that.\n\t\t\t */\n\t\t\treflowed: false,\n\t\t\t/**\n\t\t\t * How many GridStack rows one layout row is drawn as: 1, or\n\t\t\t * ROW_SPLIT while `wantsRowSplit` holds. Set before the first render,\n\t\t\t * since GridStack reads the items' places from their attributes,\n\t\t\t * and again when the grid is rebuilt.\n\t\t\t */\n\t\t\trowSplit: (!this.editable && !this.float && hasFitCell(this.layout)) ? ROW_SPLIT : 1,\n\t\t\t/** The grid's width in pixels, measured for `fillHeight`. */\n\t\t\tcontainerWidth: 0,\n\t\t\tsizeObserver: null,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/**\n\t\t * The CSS variables that draw the side column at its width, or null\n\t\t * when the grid keeps its twelve shares.\n\t\t *\n\t\t * @return {object|null}\n\t\t */\n\t\t/**\n\t\t * The left edge of each of the twelve columns and the right edge of\n\t\t * the last, as fractions of the grid's width, from `columnWeights`;\n\t\t * null when the grid keeps its twelve shares.\n\t\t *\n\t\t * @spec openspec/changes/dashboard-column-weights/specs/dashboard-column-weights/spec.md#requirement-a-dashboard-can-weigh-its-column-groups\n\t\t * @return {number[]|null}\n\t\t */\n\t\tcolumnBounds() {\n\t\t\tconst groups = this.columnWeights\n\t\t\tif (this.editable || !Array.isArray(groups) || groups.length === 0) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tconst perColumn = []\n\t\t\tfor (const group of groups) {\n\t\t\t\tconst span = Number(group?.span)\n\t\t\t\tconst weight = Number(group?.weight)\n\t\t\t\tif (!Number.isInteger(span) || span < 1 || !Number.isFinite(weight) || weight <= 0) {\n\t\t\t\t\treturn null\n\t\t\t\t}\n\t\t\t\tfor (let i = 0; i < span; i++) {\n\t\t\t\t\tperColumn.push(weight / span)\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (perColumn.length !== 12) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tconst total = perColumn.reduce((sum, w) => sum + w, 0)\n\t\t\tconst bounds = [0]\n\t\t\tfor (const w of perColumn) {\n\t\t\t\tbounds.push(bounds[bounds.length - 1] + w / total)\n\t\t\t}\n\t\t\treturn bounds\n\t\t},\n\n\t\tsideColumnStyle() {\n\t\t\tconst width = Number(this.sideColumn?.width)\n\t\t\tif (this.editable || !Number.isFinite(width) || width <= 0) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tconst from = Math.floor(Number(this.sideColumn?.from ?? 8))\n\t\t\tconst split = Number.isFinite(from) && from > 0 && from < 12 ? from : 8\n\t\t\treturn {\n\t\t\t\t'--cn-side-width': `${width}px`,\n\t\t\t\t'--cn-side-from': String(split),\n\t\t\t\t'--cn-side-span': String(12 - split),\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Whether the grid fills its height now (`fillHeight`): in view mode,\n\t\t * on a grid at least `fillMinWidth` wide.\n\t\t *\n\t\t * @spec openspec/changes/lpvandaag-start-page/specs/lpvandaag-start-page/spec.md#requirement-a-dashboard-can-fill-the-height-below-the-top-bar\n\t\t * @return {boolean}\n\t\t */\n\t\tfilling() {\n\t\t\treturn this.fillHeight && !this.editable && this.containerWidth >= this.fillMinWidth\n\t\t},\n\n\t\t/**\n\t\t * The inline style of the grid element while it fills its height.\n\t\t *\n\t\t * @spec openspec/changes/lpvandaag-start-page/specs/lpvandaag-start-page/spec.md#requirement-a-dashboard-can-fill-the-height-below-the-top-bar\n\t\t * @return {object|null}\n\t\t */\n\t\tfillGridStyle() {\n\t\t\tif (!this.filling) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tgridTemplateColumns: `repeat(${this.columns}, minmax(0, 1fr))`,\n\t\t\t\tgridTemplateRows: fillRowTracks(this.layout).join(' '),\n\t\t\t\t'--cn-fill-margin': `${this.margin}px`,\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * The layout's items top to bottom, then left to right: the order the\n\t\t * items are in the page, so GridStack places them in that order.\n\t\t *\n\t\t * GridStack sizes a size-to-content cell while it adds the items, one\n\t\t * at a time, and an item it adds onto a cell that has already grown\n\t\t * moves itself below whatever it then collides with. In the layout's\n\t\t * own order a card declared after the lists (pipelinq's full-width\n\t\t * \"client in focus\" card) was added last, so when the banner above\n\t\t * it grew it skipped past the stat tiles AND the lists and landed at\n\t\t * the bottom. Added top to bottom, every card lands under the one\n\t\t * above it. It is also the order a screen reader and the Tab key\n\t\t * follow. An item without a row or column sorts after the items\n\t\t * that have one, in the layout's order.\n\t\t *\n\t\t * @spec openspec/changes/dashboard-growth-keeps-order/specs/dashboard-grid/spec.md#requirement-a-growing-cell-keeps-the-order-of-the-cards-under-it\n\t\t * @return {Array<object>} The items in row order.\n\t\t */\n\t\titemsInRowOrder() {\n\t\t\tconst items = Array.isArray(this.layout) ? [...this.layout] : []\n\t\t\tconst at = (value) => (Number.isFinite(value) ? value : Number.MAX_SAFE_INTEGER)\n\t\t\treturn items.sort((a, b) => (at(a.gridY) - at(b.gridY)) || (at(a.gridX) - at(b.gridX)))\n\t\t},\n\n\t\t/**\n\t\t * Whether the grid draws each layout row as ROW_SPLIT finer rows. A\n\t\t * size-to-content cell can only be a whole number of rows tall, so on\n\t\t * 80px rows it kept up to a row of empty space under its content and\n\t\t * a packing grid (`float: false`) could not close it (pipelinq and\n\t\t * dossiq Mijn werk, decidiq Mijn acties). Split into 4px rows the\n\t\t * cell ends within 4px of its content and the widgets below move up.\n\t\t *\n\t\t * Only in view mode, only on a packing grid with a size-to-content\n\t\t * cell: every other grid is built exactly as before. Item positions\n\t\t * and sizes scale with the rows, so every widget keeps its pixel\n\t\t * place and size until a cell shrinks; the layout itself, what edit\n\t\t * mode shows and what `layout-change` reports, stays in layout rows.\n\t\t *\n\t\t * @spec openspec/changes/dashboard-fit-cells-close-up/specs/dashboard-grid/spec.md#requirement-a-size-to-content-cell-ends-at-its-content\n\t\t * @return {boolean} True to split the rows.\n\t\t */\n\t\twantsRowSplit() {\n\t\t\treturn !this.editable && !this.float && hasFitCell(this.layout)\n\t\t},\n\n\t\t/**\n\t\t * @return {boolean} Whether the keyboard lane is live — items are\n\t\t * focusable and the arrow keys reposition. Requires the opt-in prop,\n\t\t * edit mode (a read-only dashboard has nothing to move, so adding N tab\n\t\t * stops there would be pure noise), and a grid that is not reflowed,\n\t\t * which is where a move cannot be kept and so must not be offered.\n\t\t */\n\t\tkeyboardActive() {\n\t\t\treturn this.keyboardRepositioning && this.editable && !this.reflowed\n\t\t},\n\n\t\t/**\n\t\t * @return {number|null} `0` when grid items should be tab stops,\n\t\t * otherwise `null` so the attribute is omitted entirely.\n\t\t */\n\t\titemTabindex() {\n\t\t\treturn this.keyboardActive ? 0 : null\n\t\t},\n\n\t\t/**\n\t\t * @return {string} DOM id of the shared keyboard-instructions element.\n\t\t */\n\t\tkeyboardHelpDomId() {\n\t\t\treturn `${this.domId}-keyboard-help`\n\t\t},\n\n\t\t/**\n\t\t * @return {string|null} `aria-describedby` target for each grid item —\n\t\t * the instructions element while the keyboard lane is live, `null`\n\t\t * otherwise (a dangling id reference is an axe violation).\n\t\t */\n\t\titemDescribedBy() {\n\t\t\treturn this.keyboardActive ? this.keyboardHelpDomId : null\n\t\t},\n\n\t\t/**\n\t\t * @return {string} The spoken key map for the keyboard lane.\n\t\t */\n\t\tkeyboardHelpText() {\n\t\t\treturn t(\n\t\t\t\t'nextcloud-vue',\n\t\t\t\t'Use the arrow keys to move this widget one cell. Hold Shift and use the arrow keys to resize it. Press Home or End to jump to the first or last column. Press Enter to open the widget menu.',\n\t\t\t)\n\t\t},\n\n\t\t/**\n\t\t * @return {number} The column count currently in force. With responsive\n\t\t * `columnOpts` GridStack reflows to fewer columns on small screens, so\n\t\t * clamping must read the live value rather than the `columns` prop.\n\t\t */\n\t\teffectiveColumns() {\n\t\t\tif (this.grid && typeof this.grid.getColumn === 'function') {\n\t\t\t\tconst live = this.grid.getColumn()\n\t\t\t\tif (Number.isFinite(live) && live > 0) {\n\t\t\t\t\treturn live\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this.columns\n\t\t},\n\t},\n\n\twatch: {\n\t\teditable() {\n\t\t\tthis.syncInteractivity()\n\t\t},\n\n\t\tfilling(fills) {\n\t\t\tif (fills) {\n\t\t\t\tthis.disconnectContentObserver()\n\t\t\t\tif (this.grid) {\n\t\t\t\t\tthis.grid.destroy(false)\n\t\t\t\t\tthis.grid = null\n\t\t\t\t}\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.$nextTick(() => {\n\t\t\t\tif (this.grid || !this.$refs.gridContainer) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tthis.applyItemAttributes()\n\t\t\t\tthis.initGrid()\n\t\t\t\tthis.observeContentSizes()\n\t\t\t})\n\t\t},\n\n\t\twantsRowSplit(wants) {\n\t\t\tif (this.grid && (wants ? ROW_SPLIT : 1) !== this.rowSplit) {\n\t\t\t\tthis.rebuildGrid()\n\t\t\t}\n\t\t},\n\n\t\tlayout: {\n\t\t\tdeep: true,\n\t\t\thandler(newLayout) {\n\t\t\t\tif (this.grid) {\n\t\t\t\t\tthis.syncGridItems(newLayout)\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t},\n\n\tmounted() {\n\t\tthis.observeContainerWidth()\n\t\tif (this.filling) {\n\t\t\treturn\n\t\t}\n\t\tthis.initGrid()\n\t\tthis.$nextTick(() => this.observeContentSizes())\n\t},\n\n\tbeforeUnmount() {\n\t\tif (this.sizeObserver) {\n\t\t\tthis.sizeObserver.disconnect()\n\t\t\tthis.sizeObserver = null\n\t\t}\n\t\tthis.disconnectContentObserver()\n\t\tif (this.grid) {\n\t\t\tthis.grid.destroy(false)\n\t\t}\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Derive the v-for render key for a layout item, honouring the optional\n\t\t * `itemKey` prop and falling back to `item.id`.\n\t\t *\n\t\t * @param {object} item the layout item.\n\t\t * @return {string|number} the render key.\n\t\t */\n\t\tresolveItemKey(item) {\n\t\t\treturn this.itemKey ? this.itemKey(item) : item.id\n\t\t},\n\n\t\t/**\n\t\t * The `gs-size-to-content` attribute for a layout item, or `undefined` to\n\t\t * leave the item on its authored `gridHeight`.\n\t\t *\n\t\t * A widget that decides AT RUNTIME it has nothing to show — a banner whose\n\t\t * condition is false, a list that came back empty — still costs its whole\n\t\t * authored row, because the row is reserved from the layout before the\n\t\t * component renders and the engine positions items absolutely, so no CSS\n\t\t * can reclaim it. `sizeToContent` hands the row's height to the content, so\n\t\t * an empty widget collapses and the grid closes up behind it.\n\t\t *\n\t\t * Opt-in per item: it makes `gridHeight` advisory for that widget, which is\n\t\t * wrong for anything with a deliberate size (a map, a chart) and right for\n\t\t * anything whose height is whatever it turned out to have.\n\t\t *\n\t\t * @param {object} item the layout item.\n\t\t * @return {string|undefined} `'true'`, a row maximum as a string, or undefined.\n\t\t */\n\t\tsizeToContentAttr(item) {\n\t\t\tconst v = item && item.sizeToContent\n\t\t\tif (v === true) {\n\t\t\t\treturn 'true'\n\t\t\t}\n\t\t\t// A number is GridStack's \"size to content, but never taller than N rows\" (a maximum).\n\t\t\tif (Number.isFinite(v) && v > 0) {\n\t\t\t\treturn String(v * this.rowSplit)\n\t\t\t}\n\t\t\treturn undefined\n\t\t},\n\n\t\t/**\n\t\t * A layout row coordinate or height in GridStack rows (`rowSplit`).\n\t\t *\n\t\t * @spec openspec/changes/dashboard-fit-cells-close-up/specs/dashboard-grid/spec.md#requirement-a-size-to-content-cell-ends-at-its-content\n\t\t * @param {number|undefined} value The value in layout rows.\n\t\t * @return {number|undefined} The value in grid rows, or undefined when none is set.\n\t\t */\n\t\tscaledRow(value) {\n\t\t\treturn Number.isFinite(value) ? value * this.rowSplit : undefined\n\t\t},\n\n\t\t/**\n\t\t * The smallest height an item may take, in grid rows: `minHeight`\n\t\t * layout rows, except for a size-to-content cell on split rows, which\n\t\t * may shrink to its content down to one grid row. The minimum is for\n\t\t * resizing by hand, and that only happens on whole rows in edit mode.\n\t\t *\n\t\t * @spec openspec/changes/dashboard-fit-cells-close-up/specs/dashboard-grid/spec.md#requirement-a-size-to-content-cell-ends-at-its-content\n\t\t * @param {object} item The layout item.\n\t\t * @return {number} The minimum height in grid rows.\n\t\t */\n\t\tminRows(item) {\n\t\t\tif (this.rowSplit !== 1 && this.sizeToContentAttr(item) !== undefined) {\n\t\t\t\treturn 1\n\t\t\t}\n\t\t\treturn this.minHeight * this.rowSplit\n\t\t},\n\n\t\t/**\n\t\t * Build the grid again with the row split `wantsRowSplit` asks for, as\n\t\t * edit mode turns on or off: the items go back to their layout places in\n\t\t * the new rows, and the size-to-content cells are measured again.\n\t\t *\n\t\t * @spec openspec/changes/dashboard-fit-cells-close-up/specs/dashboard-grid/spec.md#requirement-a-size-to-content-cell-ends-at-its-content\n\t\t * @return {void}\n\t\t */\n\t\trebuildGrid() {\n\t\t\tthis.disconnectContentObserver()\n\t\t\tthis.grid.destroy(false)\n\t\t\tthis.grid = null\n\t\t\tthis.rowSplit = this.wantsRowSplit ? ROW_SPLIT : 1\n\t\t\tthis.$nextTick(() => {\n\t\t\t\tif (!this.$refs.gridContainer) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\t// GridStack wrote its own places onto the items; put the layout's back.\n\t\t\t\tthis.applyItemAttributes()\n\t\t\t\tthis.initGrid()\n\t\t\t\tthis.observeContentSizes()\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * Build the accessible name for a grid item. A custom `itemLabel` wins\n\t\t * outright; otherwise the first human-readable field on the item is used\n\t\t * and, while the keyboard lane is live, the current grid coordinates are\n\t\t * appended — without them a screen-reader user tabbing through an edit-mode\n\t\t * dashboard has no way to tell where anything sits.\n\t\t *\n\t\t * @param {object} item the layout item.\n\t\t * @param {number} index the item's index in `layout`, used for the\n\t\t * last-resort positional name.\n\t\t * @return {string} the accessible name.\n\t\t */\n\t\t/**\n\t\t * Write every item's place and size onto its element as the `gs-*`\n\t\t * attributes GridStack reads when it starts, in the current row split.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tapplyItemAttributes() {\n\t\t\tfor (const item of this.layout) {\n\t\t\t\tconst el = this.$refs.gridContainer.querySelector(`[gs-id=\"${item.id}\"]`)\n\t\t\t\tif (!el) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tfor (const [name, value] of [['gs-x', item.gridX], ['gs-w', item.gridWidth], ['gs-y', this.scaledRow(item.gridY)], ['gs-h', this.scaledRow(item.gridHeight)], ['gs-min-h', this.minRows(item)], ['gs-size-to-content', this.sizeToContentAttr(item)]]) {\n\t\t\t\t\tif (value === undefined || value === null) {\n\t\t\t\t\t\tel.removeAttribute(name)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tel.setAttribute(name, String(value))\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Follow the grid's width, which decides whether `fillHeight` fills.\n\t\t *\n\t\t * @spec openspec/changes/lpvandaag-start-page/specs/lpvandaag-start-page/spec.md#requirement-a-dashboard-can-fill-the-height-below-the-top-bar\n\t\t * @return {void}\n\t\t */\n\t\tobserveContainerWidth() {\n\t\t\tconst container = this.$refs.gridContainer\n\t\t\tif (!this.fillHeight || !container) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.containerWidth = container.clientWidth\n\t\t\tif (typeof ResizeObserver === 'undefined') {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.sizeObserver = new ResizeObserver(() => {\n\t\t\t\tthis.containerWidth = container.clientWidth\n\t\t\t})\n\t\t\tthis.sizeObserver.observe(container)\n\t\t},\n\n\t\t/**\n\t\t * The inline style that places an item on the filled grid.\n\t\t *\n\t\t * @spec openspec/changes/lpvandaag-start-page/specs/lpvandaag-start-page/spec.md#requirement-a-dashboard-can-fill-the-height-below-the-top-bar\n\t\t * @param {object} item The layout item.\n\t\t * @return {object}\n\t\t */\n\t\tfillItemStyle(item) {\n\t\t\tconst x = Number.isFinite(item.gridX) ? item.gridX : 0\n\t\t\tconst y = Number.isFinite(item.gridY) ? item.gridY : 0\n\t\t\tconst w = Number.isFinite(item.gridWidth) ? item.gridWidth : this.minWidth\n\t\t\tconst h = Number.isFinite(item.gridHeight) ? item.gridHeight : this.minHeight\n\t\t\treturn {\n\t\t\t\tgridColumn: `${x + 1} / span ${w}`,\n\t\t\t\tgridRow: `${y + 1} / span ${h}`,\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * The left and width fractions of an item on weighted columns, or\n\t\t * null when the grid keeps its twelve shares or the item is on a\n\t\t * side-column track.\n\t\t *\n\t\t * @spec openspec/changes/dashboard-column-weights/specs/dashboard-column-weights/spec.md#requirement-a-dashboard-can-weigh-its-column-groups\n\t\t * @param {object} item The layout item.\n\t\t * @return {object|null}\n\t\t */\n\t\tweightStyle(item) {\n\t\t\tconst bounds = this.columnBounds\n\t\t\tif (bounds === null || (this.sideColumnStyle !== null && (item.track === 'main' || item.track === 'side'))) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tconst x = Math.min(Math.max(Number.isFinite(item.gridX) ? item.gridX : 0, 0), 12)\n\t\t\tconst w = Number.isFinite(item.gridWidth) ? item.gridWidth : this.minWidth\n\t\t\tconst end = Math.min(Math.max(x + w, x), 12)\n\t\t\treturn {\n\t\t\t\t'--cn-weight-left': String(bounds[x]),\n\t\t\t\t'--cn-weight-width': String(bounds[end] - bounds[x]),\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * The inline style of an item: its place on a filled grid, or its\n\t\t * place on weighted columns.\n\t\t *\n\t\t * @param {object} item The layout item.\n\t\t * @return {object|undefined}\n\t\t */\n\t\titemStyle(item) {\n\t\t\tif (this.filling) {\n\t\t\t\treturn this.fillItemStyle(item)\n\t\t\t}\n\t\t\treturn this.weightStyle(item) || undefined\n\t\t},\n\n\t\tresolveItemLabel(item, index) {\n\t\t\tif (this.itemLabel) {\n\t\t\t\treturn String(this.itemLabel(item, index) ?? '')\n\t\t\t}\n\n\t\t\tconst base = item.title\n\t\t\t\t|| item.name\n\t\t\t\t|| item.label\n\t\t\t\t|| item.widgetTitle\n\t\t\t\t|| item.widgetId\n\t\t\t\t|| t('nextcloud-vue', 'Widget {number}', { number: index + 1 })\n\n\t\t\tif (!this.keyboardActive) {\n\t\t\t\treturn String(base)\n\t\t\t}\n\n\t\t\t// Report the rectangle exactly as the reactive `layout` prop states\n\t\t\t// it — unclamped, so the spoken coordinates always match the\n\t\t\t// rendered `gs-*` attributes — and read from the prop (not the\n\t\t\t// GridStack node) so the name re-renders when a move round-trips\n\t\t\t// back through `layout-change`; engine-node mutations are invisible\n\t\t\t// to Vue's reactivity.\n\t\t\tconst rect = {\n\t\t\t\tx: Number.isFinite(item.gridX) ? item.gridX : 0,\n\t\t\t\ty: Number.isFinite(item.gridY) ? item.gridY : 0,\n\t\t\t\tw: Number.isFinite(item.gridWidth) ? item.gridWidth : this.minWidth,\n\t\t\t\th: Number.isFinite(item.gridHeight) ? item.gridHeight : this.minHeight,\n\t\t\t}\n\t\t\treturn t(\n\t\t\t\t'nextcloud-vue',\n\t\t\t\t'{label}, column {column} of {columns}, row {row}, {width} columns wide, {height} rows tall',\n\t\t\t\t{\n\t\t\t\t\tlabel: String(base),\n\t\t\t\t\tcolumn: rect.x + 1,\n\t\t\t\t\tcolumns: this.effectiveColumns,\n\t\t\t\t\trow: rect.y + 1,\n\t\t\t\t\twidth: rect.w,\n\t\t\t\t\theight: rect.h,\n\t\t\t\t},\n\t\t\t)\n\t\t},\n\n\t\t/**\n\t\t * Build the GridStack grid on the rendered items, install the growth\n\t\t * wrapper (`keepOrderOnGrowth`) and listen for its changes.\n\t\t *\n\t\t * @spec openspec/changes/dashboard-growth-keeps-order/specs/dashboard-grid/spec.md#requirement-a-growing-cell-keeps-the-order-of-the-cards-under-it\n\t\t * @return {void}\n\t\t */\n\t\tinitGrid() {\n\t\t\tif (this.cellHeightCssVar && typeof document !== 'undefined' && document.documentElement) {\n\t\t\t\tdocument.documentElement.style.setProperty(this.cellHeightCssVar, `${this.cellHeight}px`)\n\t\t\t}\n\t\t\tconst el = this.$refs.gridContainer.querySelector('.grid-stack')\n\t\t\tthis.grid = GridStack.init({\n\t\t\t\tcolumn: this.columns,\n\t\t\t\tcellHeight: this.cellHeight / this.rowSplit,\n\t\t\t\tmargin: this.margin,\n\t\t\t\t...(this.marginBottom !== null ? { marginBottom: this.marginBottom } : {}),\n\t\t\t\tfloat: this.float,\n\t\t\t\tanimate: true,\n\t\t\t\tdisableDrag: !this.editable,\n\t\t\t\tdisableResize: !this.editable,\n\t\t\t\tremovable: false,\n\t\t\t\t...(this.columnOpts ? { columnOpts: this.columnOpts } : {}),\n\t\t\t}, el)\n\t\t\tthis.keepOrderOnGrowth()\n\t\t\tthis.matchRowHeights()\n\t\t\tthis.placeClearRows()\n\n\t\t\tthis.grid.on('change', (_event, items) => {\n\t\t\t\tthis.handleGridChange(items)\n\t\t\t})\n\n\t\t\t// A grid that mounts already narrow is reflowed before anyone touches\n\t\t\t// it, so the handles have to be judged here and not only on a later\n\t\t\t// change.\n\t\t\tthis.syncInteractivity()\n\t\t},\n\n\t\t/**\n\t\t * Let a size-to-content cell that grows push the cards under it down in\n\t\t * their order. GridStack resolves that collision itself, but not in\n\t\t * order: when pipelinq's banner grew from two rows to three, the\n\t\t * full-width card under the stat tiles landed below the lists, also\n\t\t * with `float: false`. Every grow after the grid is built, whether\n\t\t * GridStack measures it on resize or this grid's content observer asks\n\t\t * for it, now first moves the cards the growth reaches down by the\n\t\t * growth (`planGrowth`), bottom-most first, and only then grows the\n\t\t * cell, so GridStack has no collision left to resolve. The wrapper is\n\t\t * installed after `GridStack.init` has already measured the cells on\n\t\t * load; the order on load comes from adding the items in row order\n\t\t * (`itemsInRowOrder`). A cell that shrinks is left to GridStack as\n\t\t * before.\n\t\t *\n\t\t * The grid is read raw: through Vue's proxy `engine.nodes` holds proxies\n\t\t * while `el.gridstackNode` is the plain node, so the growing cell would\n\t\t * not be recognised among the nodes and would be moved down by its own\n\t\t * growth. Moving a cell makes GridStack measure it again, so a cell the\n\t\t * wrapper is already growing goes straight to GridStack.\n\t\t *\n\t\t * @spec openspec/changes/dashboard-growth-keeps-order/specs/dashboard-grid/spec.md#requirement-a-growing-cell-keeps-the-order-of-the-cards-under-it\n\t\t * @return {void}\n\t\t */\n\t\tkeepOrderOnGrowth() {\n\t\t\tconst grid = toRaw(this.grid)\n\t\t\tif (!grid || typeof grid.resizeToContent !== 'function' || typeof grid.update !== 'function') {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst resize = grid.resizeToContent.bind(grid)\n\t\t\tconst growing = new Set()\n\t\t\tgrid.resizeToContent = (el) => {\n\t\t\t\tif (this.pendingSizes) {\n\t\t\t\t\tif (!this.pendingSizes.includes(el)) {\n\t\t\t\t\t\tthis.pendingSizes.push(el)\n\t\t\t\t\t}\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tthis.matchRowHeights()\n\t\t\t\tthis.resizeKeepingOrder(grid, resize, growing, el)\n\t\t\t\tif (growing.size === 0) {\n\t\t\t\t\tthis.placeClearRows()\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * One `resizeToContent` with the cards under a growing cell moved down\n\t\t * first (`keepOrderOnGrowth`).\n\t\t *\n\t\t * @param {object} grid The raw GridStack.\n\t\t * @param {function(HTMLElement): void} resize GridStack's own resizeToContent.\n\t\t * @param {Set<HTMLElement>} growing The cells being grown now.\n\t\t * @param {HTMLElement} el The cell.\n\t\t * @return {void}\n\t\t */\n\t\tresizeKeepingOrder(grid, resize, growing, el) {\n\t\t\tif (growing.has(el)) {\n\t\t\t\tresize(el)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst node = el && el.gridstackNode\n\t\t\tconst nodes = grid.engine && Array.isArray(grid.engine.nodes) ? grid.engine.nodes : null\n\t\t\tconst rows = node && nodes ? this.contentRows(el, node) : null\n\t\t\tconst plan = rows ? planGrowth(nodes, node, rows) : []\n\t\t\tif (plan.length === 0) {\n\t\t\t\tresize(el)\n\t\t\t\treturn\n\t\t\t}\n\t\t\t// Inside a batch the moves are not packed until the cell has grown.\n\t\t\tconst batching = Boolean(grid.engine.batchMode)\n\t\t\tgrowing.add(el)\n\t\t\ttry {\n\t\t\t\tif (!batching) {\n\t\t\t\t\tgrid.batchUpdate()\n\t\t\t\t}\n\t\t\t\tfor (const step of plan) {\n\t\t\t\t\tgrid.update(step.node.el, { y: step.y })\n\t\t\t\t}\n\t\t\t\tresize(el)\n\t\t\t\tif (!batching) {\n\t\t\t\t\tgrid.batchUpdate(false)\n\t\t\t\t}\n\t\t\t} finally {\n\t\t\t\tgrowing.delete(el)\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Whether a layout item takes part in its row's shared height\n\t\t * (`sameHeight`). A size-to-content card stretches to the tallest; a card\n\t\t * of fixed height is not stretched but counts as the height to reach.\n\t\t *\n\t\t * @spec openspec/changes/dashboard-row-same-height/specs/dashboard-grid/spec.md\n\t\t * @param {object} item The layout item.\n\t\t * @return {boolean} True when it does.\n\t\t */\n\t\tsharesRowHeight(item) {\n\t\t\treturn item?.sameHeight === true\n\t\t},\n\n\t\t/**\n\t\t * Stretch the shorter `sameHeight` cards of each layout row to the\n\t\t * tallest of them (`planSameHeights`), with a min-height on the widget\n\t\t * the cell measures, so GridStack sizes the cells alike and the next row\n\t\t * starts level, as the boards draw a row of cards (DqProcesanalyse).\n\t\t * Each pass measures the content again without the stretch, so a row\n\t\t * shrinks with its content. Edit mode and a reflowed (stacked) grid keep\n\t\t * every card at its own height.\n\t\t *\n\t\t * @spec openspec/changes/dashboard-row-same-height/specs/dashboard-grid/spec.md\n\t\t * @return {void}\n\t\t */\n\t\tmatchRowHeights() {\n\t\t\tconst container = this.$el && typeof this.$el.querySelectorAll === 'function' ? this.$el : null\n\t\t\tif (!container || this.matchingRowHeights) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst byId = new Map(this.layout.map((item) => [String(item.id), item]))\n\t\t\tconst cards = []\n\t\t\tfor (const cell of container.querySelectorAll('.grid-stack-item.cn-dashboard-grid__item--same-height')) {\n\t\t\t\tconst item = byId.get(String(cell.getAttribute('gs-id')))\n\t\t\t\tconst child = cell.querySelector('.grid-stack-item-content')?.firstElementChild\n\t\t\t\tif (item && child) {\n\t\t\t\t\tcards.push({ child, row: item.gridY ?? 0, fit: this.sizeToContentAttr(item) !== undefined })\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (cards.length === 0) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.matchingRowHeights = true\n\t\t\ttry {\n\t\t\t\tfor (const card of cards) {\n\t\t\t\t\tif (card.fit) {\n\t\t\t\t\t\tcard.child.style.minHeight = ''\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (this.editable || this.reflowed) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tconst heights = planSameHeights(cards.map((card) => ({ row: card.row, height: card.child.getBoundingClientRect().height })))\n\t\t\t\tcards.forEach((card, index) => {\n\t\t\t\t\tif (card.fit && heights[index] !== null) {\n\t\t\t\t\t\tcard.child.style.minHeight = `${heights[index]}px`\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t} finally {\n\t\t\t\tthis.matchingRowHeights = false\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Put every `clear` layout item below the cards of the earlier rows\n\t\t * (`planClearRows`), in one batch. Runs after the grid is built and after\n\t\t * each cell is measured to its content; a move made here that measures a\n\t\t * cell again does not start another round.\n\t\t *\n\t\t * @spec openspec/changes/dashboard-clear-row/specs/dashboard-grid/spec.md\n\t\t * @return {void}\n\t\t */\n\t\tplaceClearRows() {\n\t\t\tconst grid = this.grid ? toRaw(this.grid) : null\n\t\t\tif (this.placingClearRows || !grid || !grid.engine || !Array.isArray(grid.engine.nodes) || typeof grid.update !== 'function') {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst byId = new Map(this.layout.map((item) => [String(item.id), item]))\n\t\t\tconst nodes = grid.engine.nodes.map((n) => {\n\t\t\t\tconst item = byId.get(String(n.id))\n\t\t\t\treturn Object.assign(Object.create(null), { node: n, x: n.x, y: n.y, w: n.w, h: n.h, row: item ? this.scaledRow(item.gridY ?? 0) : 0, clear: !this.editable && item?.clear === true })\n\t\t\t})\n\t\t\tconst plan = planClearRows(nodes)\n\t\t\tif (plan.length === 0) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst batching = Boolean(grid.engine.batchMode)\n\t\t\tthis.placingClearRows = true\n\t\t\ttry {\n\t\t\t\tif (!batching && typeof grid.batchUpdate === 'function') {\n\t\t\t\t\tgrid.batchUpdate()\n\t\t\t\t}\n\t\t\t\tfor (const step of plan) {\n\t\t\t\t\tgrid.update(step.node.node.el, { y: step.y })\n\t\t\t\t}\n\t\t\t\tif (!batching && typeof grid.batchUpdate === 'function') {\n\t\t\t\t\tgrid.batchUpdate(false)\n\t\t\t\t}\n\t\t\t} finally {\n\t\t\t\tthis.placingClearRows = false\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * The rows a size-to-content cell needs for its content, measured the\n\t\t * way GridStack's `resizeToContent` measures it (the content's first\n\t\t * child, plus the cell's own padding), within its size-to-content row\n\t\t * maximum and its minimum and maximum height.\n\t\t *\n\t\t * @spec openspec/changes/dashboard-growth-keeps-order/specs/dashboard-grid/spec.md#requirement-a-growing-cell-keeps-the-order-of-the-cards-under-it\n\t\t * @param {HTMLElement} el The cell.\n\t\t * @param {object} node Its GridStack node.\n\t\t * @return {number|null} The rows, or null when it cannot be measured.\n\t\t */\n\t\tcontentRows(el, node) {\n\t\t\tconst cell = this.grid.getCellHeight(true)\n\t\t\tconst item = el.querySelector('.grid-stack-item-content')\n\t\t\tconst child = item && item.firstElementChild\n\t\t\tif (!el.clientHeight || !cell || !child || !Number.isFinite(node.h)) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tconst padding = el.clientHeight - item.clientHeight\n\t\t\tconst itemHeight = node.h * cell - padding\n\t\t\tconst wanted = child.getBoundingClientRect().height || itemHeight\n\t\t\tlet rows = Math.ceil((node.h * cell + wanted - itemHeight) / cell)\n\t\t\tif (Number.isInteger(node.sizeToContent) && rows > node.sizeToContent) {\n\t\t\t\trows = node.sizeToContent\n\t\t\t}\n\t\t\tif (node.minH && rows < node.minH) {\n\t\t\t\trows = node.minH\n\t\t\t} else if (node.maxH && rows > node.maxH) {\n\t\t\t\trows = node.maxH\n\t\t\t}\n\t\t\treturn rows\n\t\t},\n\n\t\t/**\n\t\t * Keep both editing lanes in step with whether an edit could actually be\n\t\t * kept: the pointer's handles, and — through `reflowed` feeding\n\t\t * `keyboardActive` — the tab stops, the help text and the arrow keys.\n\t\t *\n\t\t * A reflowed grid drops every `change` it receives, for the reason\n\t\t * `handleGridChange` gives. Leaving either lane live there offers an edit\n\t\t * that silently snaps back, which is the same class of surprise as\n\t\t * persisting the reflow — pointed the other way, and harder to explain\n\t\t * because the author did everything right. It is worse on the keyboard,\n\t\t * where the move is also announced as done. The affordance has to say what\n\t\t * the grid will do at this width, not what edit mode does at the authored\n\t\t * one.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tsyncInteractivity() {\n\t\t\t// Ahead of the engine guard: the keyboard lane reads this whether or\n\t\t\t// not the engine can be enabled.\n\t\t\tthis.reflowed = this.isReflowed()\n\t\t\tif (!this.grid || typeof this.grid.enable !== 'function') {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (this.editable && !this.reflowed) {\n\t\t\t\tthis.grid.enable()\n\t\t\t} else {\n\t\t\t\tthis.grid.disable()\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Whether the grid is currently rescaled to a column count other than the\n\t\t * authored one, i.e. a `columnOpts` breakpoint is in force.\n\t\t *\n\t\t * The authored count is `columnOpts.columnMax` when there is one, not the\n\t\t * `columns` prop: GridStack widens to `columnMax` above the top breakpoint,\n\t\t * so a consumer whose two disagree is at its widest, not reflowed.\n\t\t *\n\t\t * @return {boolean} True while a responsive reflow is active.\n\t\t */\n\t\tisReflowed() {\n\t\t\tif (!this.grid || typeof this.grid.getColumn !== 'function') {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tconst authored = Number.isFinite(this.columnOpts?.columnMax) ? this.columnOpts.columnMax : this.columns\n\t\t\tconst live = this.grid.getColumn()\n\t\t\treturn Number.isFinite(live) && live > 0 && live !== authored\n\t\t},\n\n\t\thandleGridChange(items) {\n\t\t\t// The rescale that crossed a breakpoint arrives here as a `change`, so\n\t\t\t// this is also where the handles are re-judged in both directions:\n\t\t\t// switched off as the grid narrows, and back on as it widens.\n\t\t\tthis.syncInteractivity()\n\n\t\t\tif (this.applyingLayout) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// GridStack fires `change` for its own responsive rescale too, and at a\n\t\t\t// 12 → 1 breakpoint every item reads `gridX: 0, gridWidth: 1`. Emitting\n\t\t\t// that has the host persist the reflow AS the authored layout, which\n\t\t\t// widening back does not undo. A move made while reflowed is the same\n\t\t\t// rescaled geometry, so it is dropped for the same reason.\n\t\t\tif (this.isReflowed()) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\t// A grid on split rows is a view-mode grid: what changes in it is\n\t\t\t// packing and size-to-content measuring, never a user's\n\t\t\t// arrangement, and it is not reported as one.\n\t\t\tif (this.rowSplit !== 1) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (!items || items.length === 0) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tconst updated = this.layout.map((item) => {\n\t\t\t\tconst gridItem = items.find((gi) => String(gi.id) === String(item.id))\n\t\t\t\tif (gridItem) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...item,\n\t\t\t\t\t\tgridX: gridItem.x,\n\t\t\t\t\t\tgridY: gridItem.y,\n\t\t\t\t\t\tgridWidth: gridItem.w,\n\t\t\t\t\t\tgridHeight: gridItem.h,\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn item\n\t\t\t})\n\n\t\t\tthis.$emit('layout-change', updated)\n\t\t},\n\n\t\t/**\n\t\t * Keydown handler bound to every grid item.\n\t\t *\n\t\t * Only reacts when the grid item element itself is the event target:\n\t\t * a button, input or menu rendered inside the `#widget` slot must keep\n\t\t * its own arrow/Enter semantics, and a grid that swallowed them would\n\t\t * be a worse a11y regression than the one this handler fixes.\n\t\t *\n\t\t * @param {KeyboardEvent} event the keydown event.\n\t\t * @param {object} item the layout item the key was pressed on.\n\t\t * @return {void}\n\t\t */\n\t\tonItemKeydown(event, item) {\n\t\t\tif (!this.keyboardRepositioning) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (event.target !== event.currentTarget) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (event.altKey || event.ctrlKey || event.metaKey) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tif (event.key === 'Enter' || event.key === ' ' || event.key === 'Spacebar') {\n\t\t\t\tevent.preventDefault()\n\t\t\t\tthis.activateItem(item, event.currentTarget)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// Repositioning only, and only where it can be kept — an item that\n\t\t\t// still holds focus from before a reflow keeps its Enter, but its\n\t\t\t// arrow keys stop moving something that would snap back.\n\t\t\tif (!this.keyboardActive) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tconst handled = this.applyKey(event.key, event.shiftKey, item)\n\t\t\tif (handled) {\n\t\t\t\t// Arrows would otherwise scroll the dashboard out from under\n\t\t\t\t// the widget the user is moving.\n\t\t\t\tevent.preventDefault()\n\t\t\t\tevent.stopPropagation()\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Translate one repositioning key into a geometry change.\n\t\t *\n\t\t * @param {string} key the `KeyboardEvent.key` value.\n\t\t * @param {boolean} shift whether Shift was held (resize instead of move).\n\t\t * @param {object} item the layout item being operated on.\n\t\t * @return {boolean} `true` when the key belongs to the grid and the\n\t\t * default action must be suppressed.\n\t\t */\n\t\tapplyKey(key, shift, item) {\n\t\t\tconst rect = this.currentRect(item)\n\n\t\t\tswitch (key) {\n\t\t\t\tcase 'ArrowLeft':\n\t\t\t\t\treturn shift\n\t\t\t\t\t\t? this.applyGeometry(item, { w: rect.w - 1 }, 'resize')\n\t\t\t\t\t\t: this.applyGeometry(item, { x: rect.x - 1 }, 'move')\n\t\t\t\tcase 'ArrowRight':\n\t\t\t\t\treturn shift\n\t\t\t\t\t\t? this.applyGeometry(item, { w: rect.w + 1 }, 'resize')\n\t\t\t\t\t\t: this.applyGeometry(item, { x: rect.x + 1 }, 'move')\n\t\t\t\tcase 'ArrowUp':\n\t\t\t\t\treturn shift\n\t\t\t\t\t\t? this.applyGeometry(item, { h: rect.h - 1 }, 'resize')\n\t\t\t\t\t\t: this.applyGeometry(item, { y: rect.y - 1 }, 'move')\n\t\t\t\tcase 'ArrowDown':\n\t\t\t\t\treturn shift\n\t\t\t\t\t\t? this.applyGeometry(item, { h: rect.h + 1 }, 'resize')\n\t\t\t\t\t\t: this.applyGeometry(item, { y: rect.y + 1 }, 'move')\n\t\t\t\tcase 'Home':\n\t\t\t\t\treturn this.applyGeometry(item, { x: 0 }, 'move')\n\t\t\t\tcase 'End':\n\t\t\t\t\treturn this.applyGeometry(item, { x: this.effectiveColumns - rect.w }, 'move')\n\t\t\t\tdefault:\n\t\t\t\t\treturn false\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Read an item's live rectangle. The GridStack node is preferred over\n\t\t * the `layout` prop because a drag that has not yet round-tripped\n\t\t * through the consumer's persistence leaves the prop momentarily stale,\n\t\t * and a keyboard nudge must continue from where the widget actually is.\n\t\t *\n\t\t * @param {object} item the layout item.\n\t\t * @return {{x: number, y: number, w: number, h: number}} the rectangle\n\t\t * in grid units.\n\t\t */\n\t\tcurrentRect(item) {\n\t\t\tconst node = this.gridNode(item.id)\n\t\t\tif (node && Number.isFinite(node.x) && Number.isFinite(node.y)) {\n\t\t\t\treturn {\n\t\t\t\t\tx: node.x,\n\t\t\t\t\ty: node.y,\n\t\t\t\t\tw: Number.isFinite(node.w) ? node.w : this.minWidth,\n\t\t\t\t\th: Number.isFinite(node.h) ? node.h : this.minHeight,\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tx: Number.isFinite(item.gridX) ? item.gridX : 0,\n\t\t\t\ty: Number.isFinite(item.gridY) ? item.gridY : 0,\n\t\t\t\tw: Number.isFinite(item.gridWidth) ? item.gridWidth : this.minWidth,\n\t\t\t\th: Number.isFinite(item.gridHeight) ? item.gridHeight : this.minHeight,\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Clamp a candidate rectangle to the grid's bounds and the configured\n\t\t * minimum widget size, so a held-down arrow key parks the widget at the\n\t\t * edge instead of pushing it into negative coordinates.\n\t\t *\n\t\t * @param {{x: number, y: number, w: number, h: number}} rect the candidate.\n\t\t * @return {{x: number, y: number, w: number, h: number}} the clamped rectangle.\n\t\t */\n\t\tclampRect(rect) {\n\t\t\tconst cols = this.effectiveColumns\n\t\t\tconst w = Math.min(Math.max(rect.w, this.minWidth), cols)\n\t\t\tconst h = Math.max(rect.h, this.minHeight)\n\t\t\treturn {\n\t\t\t\tx: Math.min(Math.max(rect.x, 0), Math.max(cols - w, 0)),\n\t\t\t\ty: Math.max(rect.y, 0),\n\t\t\t\tw,\n\t\t\t\th,\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Apply a partial geometry change to an item.\n\t\t *\n\t\t * The change is pushed through `GridStack.update()` — the very call the\n\t\t * drag/resize handlers end in — so collision resolution, the `change`\n\t\t * event and therefore the `layout-change` emission and the consumer's\n\t\t * persistence are identical for keyboard and pointer. There is\n\t\t * deliberately no second, direct-to-`layout` update path.\n\t\t *\n\t\t * @param {object} item the layout item to move or resize.\n\t\t * @param {{x?: number, y?: number, w?: number, h?: number}} patch the\n\t\t * requested change, merged over the item's current rectangle.\n\t\t * @param {'move'|'resize'} kind which announcement to speak.\n\t\t * @return {boolean} `true` when the key was consumed — including when\n\t\t * the widget was already at the edge, because the arrow still belongs\n\t\t * to the grid and must not scroll the page.\n\t\t */\n\t\tapplyGeometry(item, patch, kind) {\n\t\t\tconst el = this.itemElement(item.id)\n\t\t\tif (!el || !this.grid || typeof this.grid.update !== 'function') {\n\t\t\t\treturn false\n\t\t\t}\n\n\t\t\tconst current = this.currentRect(item)\n\t\t\tconst next = this.clampRect({ ...current, ...patch })\n\n\t\t\tif (next.x === current.x && next.y === current.y\n\t\t\t\t&& next.w === current.w && next.h === current.h) {\n\t\t\t\tthis.announce(t('nextcloud-vue', '{label} cannot move further in that direction', {\n\t\t\t\t\tlabel: this.announcementLabel(item),\n\t\t\t\t}))\n\t\t\t\treturn true\n\t\t\t}\n\n\t\t\tthis.grid.update(el, next)\n\n\t\t\tthis.announce(kind === 'resize'\n\t\t\t\t? t('nextcloud-vue', '{label} resized to {width} columns by {height} rows', {\n\t\t\t\t\t\tlabel: this.announcementLabel(item),\n\t\t\t\t\t\twidth: next.w,\n\t\t\t\t\t\theight: next.h,\n\t\t\t\t\t})\n\t\t\t\t: t('nextcloud-vue', '{label} moved to column {column}, row {row}', {\n\t\t\t\t\t\tlabel: this.announcementLabel(item),\n\t\t\t\t\t\tcolumn: next.x + 1,\n\t\t\t\t\t\trow: next.y + 1,\n\t\t\t\t\t}))\n\n\t\t\treturn true\n\t\t},\n\n\t\t/**\n\t\t * The short, coordinate-free name used inside live-region sentences —\n\t\t * the full `aria-label` already carries the coordinates and repeating\n\t\t * them would make every announcement unlistenable.\n\t\t *\n\t\t * @param {object} item the layout item.\n\t\t * @return {string} the short name.\n\t\t */\n\t\tannouncementLabel(item) {\n\t\t\treturn String(item.title\n\t\t\t\t|| item.name\n\t\t\t\t|| item.label\n\t\t\t\t|| item.widgetTitle\n\t\t\t\t|| item.widgetId\n\t\t\t\t|| t('nextcloud-vue', 'Widget'))\n\t\t},\n\n\t\t/**\n\t\t * Push text into the polite live region. The region is cleared first so\n\t\t * two identical consecutive announcements (e.g. two failed nudges at the\n\t\t * grid edge) are both spoken — assistive tech ignores a re-render that\n\t\t * leaves the text unchanged.\n\t\t *\n\t\t * @param {string} text the message to announce.\n\t\t * @return {void}\n\t\t */\n\t\tannounce(text) {\n\t\t\tthis.announcement = ''\n\t\t\tthis.$nextTick(() => {\n\t\t\t\tthis.announcement = text\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * Handle `Enter` / `Space` on a focused grid item: tell the consumer via\n\t\t * `item-activate`, and — unless opted out — synthesise the `contextmenu`\n\t\t * event a right-click would have produced, anchored to the item, so\n\t\t * pointer-only widget menus become keyboard-reachable without the\n\t\t * consumer wiring anything new. The synthetic event is dispatched from\n\t\t * inside the item's content so it bubbles through the slot's own root\n\t\t * element (where such handlers live) and on up.\n\t\t *\n\t\t * @param {object} item the layout item being activated.\n\t\t * @param {HTMLElement} el the grid item element.\n\t\t * @return {void}\n\t\t */\n\t\tactivateItem(item, el) {\n\t\t\tconst rect = typeof el.getBoundingClientRect === 'function'\n\t\t\t\t? el.getBoundingClientRect()\n\t\t\t\t: { left: 0, top: 0 }\n\t\t\tconst clientX = Math.round((rect.left || 0) + MENU_ANCHOR_OFFSET)\n\t\t\tconst clientY = Math.round((rect.top || 0) + MENU_ANCHOR_OFFSET)\n\n\t\t\tthis.$emit('item-activate', { item, element: el, clientX, clientY })\n\n\t\t\tif (this.activateOpensContextMenu) {\n\t\t\t\tthis.dispatchContextMenu(el, clientX, clientY)\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Dispatch a bubbling, cancelable `contextmenu` MouseEvent from inside a\n\t\t * grid item.\n\t\t *\n\t\t * @param {HTMLElement} el the grid item element.\n\t\t * @param {number} clientX viewport x for the menu anchor.\n\t\t * @param {number} clientY viewport y for the menu anchor.\n\t\t * @return {void}\n\t\t */\n\t\tdispatchContextMenu(el, clientX, clientY) {\n\t\t\tif (typeof MouseEvent !== 'function') {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst content = el.querySelector('.grid-stack-item-content')\n\t\t\tconst target = (content && content.firstElementChild) || content || el\n\t\t\ttarget.dispatchEvent(new MouseEvent('contextmenu', {\n\t\t\t\tbubbles: true,\n\t\t\t\tcancelable: true,\n\t\t\t\tclientX,\n\t\t\t\tclientY,\n\t\t\t\tbutton: 2,\n\t\t\t}))\n\t\t},\n\n\t\t/**\n\t\t * Look up a grid item's DOM element by its layout id.\n\t\t *\n\t\t * @param {string|number} id the layout item id.\n\t\t * @return {HTMLElement|null} the element, or `null` when not rendered.\n\t\t */\n\t\titemElement(id) {\n\t\t\tconst container = this.$refs.gridContainer\n\t\t\tif (!container) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\treturn container.querySelector(`[gs-id=\"${id}\"]`)\n\t\t},\n\n\t\t/**\n\t\t * Look up the GridStack engine node backing a layout item.\n\t\t *\n\t\t * @param {string|number} id the layout item id.\n\t\t * @return {object|null} the node, or `null` when GridStack isn't tracking it.\n\t\t */\n\t\t/**\n\t\t * Re-measure a `sizeToContent` item when its content changes height.\n\t\t * GridStack watches only the grid element, so a widget that loaded its data\n\t\t * in `mounted()` keeps the height its empty state had.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tobserveContentSizes() {\n\t\t\tthis.disconnectContentObserver()\n\t\t\tif (typeof ResizeObserver === 'undefined' || !this.$refs.gridContainer) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tthis.contentObserver = new ResizeObserver((entries) => {\n\t\t\t\tconst cells = new Set()\n\t\t\t\tfor (const entry of entries) {\n\t\t\t\t\tconst cell = entry.target.closest('.grid-stack-item')\n\t\t\t\t\tif (cell) {\n\t\t\t\t\t\tcells.add(cell)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (cells.size === 0) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\t// A frame later, not inline: `resizeToContent` resizes the cell the\n\t\t\t\t// observed child sits in, and a child that stretches to its parent\n\t\t\t\t// grows with it. Resizing from inside the callback makes that the\n\t\t\t\t// classic ResizeObserver loop (\"undelivered notifications\"); deferred,\n\t\t\t\t// it is an ordinary second pass that settles.\n\t\t\t\trequestAnimationFrame(() => {\n\t\t\t\t\tif (!this.contentObserver || !this.grid || typeof this.grid.resizeToContent !== 'function') {\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t\tfor (const cell of cells) {\n\t\t\t\t\t\tthis.grid.resizeToContent(cell)\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t})\n\n\t\t\tconst cells = this.$refs.gridContainer.querySelectorAll('.grid-stack-item[gs-size-to-content]')\n\t\t\tfor (const cell of cells) {\n\t\t\t\tconst measured = cell.querySelector('.grid-stack-item-content')?.firstElementChild\n\t\t\t\tif (measured) {\n\t\t\t\t\tthis.contentObserver.observe(measured)\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Drop the content observer, on unmount or before rebuilding it.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tdisconnectContentObserver() {\n\t\t\tif (this.contentObserver) {\n\t\t\t\tthis.contentObserver.disconnect()\n\t\t\t\tthis.contentObserver = null\n\t\t\t}\n\t\t},\n\n\t\tgridNode(id) {\n\t\t\tconst nodes = this.grid && this.grid.engine && this.grid.engine.nodes\n\t\t\tif (!Array.isArray(nodes)) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\treturn nodes.find((n) => String(n.id) === String(id)) || null\n\t\t},\n\n\t\t/**\n\t\t * Make the cards a layout change brings in GridStack widgets, in the\n\t\t * order given (row order), and size the size-to-content ones only once\n\t\t * all are placed, in the same order. GridStack sizes such a cell the\n\t\t * moment it is added, and a card added after it onto a cell that has\n\t\t * grown pushes that cell below itself: the in-call tile row on\n\t\t * PqWerkplekKlant ended under every column card.\n\t\t *\n\t\t * @spec openspec/changes/dashboard-layout-swap-keeps-order/specs/dashboard-grid/spec.md#requirement-cards-a-layout-change-adds-keep-their-authored-order\n\t\t * @param {Array<HTMLElement>} els The new cells, top to bottom.\n\t\t * @return {void}\n\t\t */\n\t\taddWidgetsInOrder(els) {\n\t\t\tif (els.length === 0) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst grid = toRaw(this.grid)\n\t\t\tconst queued = []\n\t\t\tthis.pendingSizes = queued\n\t\t\ttry {\n\t\t\t\tfor (const el of els) {\n\t\t\t\t\tgrid.makeWidget(el)\n\t\t\t\t}\n\t\t\t} finally {\n\t\t\t\tthis.pendingSizes = null\n\t\t\t}\n\t\t\tfor (const el of queued) {\n\t\t\t\tgrid.resizeToContent(el)\n\t\t\t}\n\t\t},\n\n\t\tsyncGridItems(newLayout) {\n\t\t\t// Add new items, and re-adopt items whose backing DOM element was\n\t\t\t// replaced. When a consumer's `itemKey` changes for an unchanged\n\t\t\t// `id` (e.g. a style edit — the documented use of `itemKey`), Vue\n\t\t\t// swaps the element. GridStack keeps tracking the old, now-detached\n\t\t\t// element, leaving the new one unmanaged (no positioning/sizing) —\n\t\t\t// so re-register it against the new element. New items are added\n\t\t\t// together, top to bottom (`addWidgetsInOrder`).\n\t\t\tthis.$nextTick(() => {\n\t\t\t\tif (!this.grid || !this.$refs.gridContainer) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tconst added = []\n\t\t\t\tfor (const item of this.itemsInRowOrder) {\n\t\t\t\t\tconst el = this.$refs.gridContainer.querySelector(`[gs-id=\"${item.id}\"]`)\n\t\t\t\t\tif (!el) {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tconst node = this.grid.engine.nodes.find((n) => String(n.id) === String(item.id))\n\t\t\t\t\tif (!node) {\n\t\t\t\t\t\tadded.push(el)\n\t\t\t\t\t} else if (node.el === el) {\n\t\t\t\t\t\t// The layout MOVED an item the grid already tracks: the\n\t\t\t\t\t\t// page re-compacts its display layout when a widget's\n\t\t\t\t\t\t// condition hides it, and the item below was given a new\n\t\t\t\t\t\t// gridY that never reached GridStack, so a band stayed\n\t\t\t\t\t\t// where the hidden widget had been. A drag reports the\n\t\t\t\t\t\t// grid's own position back, which matches and does\n\t\t\t\t\t\t// nothing here.\n\t\t\t\t\t\tconst x = item.gridX ?? node.x\n\t\t\t\t\t\tconst y = Number.isFinite(item.gridY) ? item.gridY * this.rowSplit : node.y\n\t\t\t\t\t\tif (x !== node.x || y !== node.y) {\n\t\t\t\t\t\t\t// The layout said where it goes; GridStack's `change`\n\t\t\t\t\t\t\t// for it is not a user's arrangement and is not\n\t\t\t\t\t\t\t// reported back (it would write the display-only\n\t\t\t\t\t\t\t// compaction into the authored layout).\n\t\t\t\t\t\t\tthis.applyingLayout = true\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tthis.grid.update(el, { x, y })\n\t\t\t\t\t\t\t} finally {\n\t\t\t\t\t\t\t\tthis.applyingLayout = false\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Drop the stale node without touching its detached DOM,\n\t\t\t\t\t\t// then adopt the new element so GridStack sizes/places it.\n\t\t\t\t\t\tthis.grid.removeWidget(node.el, false, false)\n\t\t\t\t\t\tthis.grid.makeWidget(el)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis.addWidgetsInOrder(added)\n\t\t\t})\n\n\t\t\t// Remove items no longer in layout\n\t\t\tconst ids = newLayout.map((i) => String(i.id))\n\t\t\tconst toRemove = this.grid.engine.nodes.filter((n) => !ids.includes(String(n.id)))\n\t\t\tfor (const node of toRemove) {\n\t\t\t\tconst el = this.$refs.gridContainer.querySelector(`[gs-id=\"${node.id}\"]`)\n\t\t\t\tif (el) {\n\t\t\t\t\tthis.grid.removeWidget(el, false)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Elements were added or replaced, so the observer's are stale.\n\t\t\tthis.$nextTick(() => this.observeContentSizes())\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-dashboard-grid {\n\twidth: 100%;\n\tmin-height: 200px;\n}\n\n.grid-stack {\n\tbackground: transparent;\n}\n\n/* `fillHeight`: the layout rows divide the grid's height (CSS grid instead of\n GridStack's absolute rows). GridStack may have left its inline places on the\n items, hence !important. Each cell scrolls what does not fit in it. */\n.cn-dashboard-grid--fill {\n\theight: 100%;\n\tmin-height: 0;\n}\n\n.cn-dashboard-grid--fill > .grid-stack {\n\tdisplay: grid;\n\theight: 100% !important;\n\tmin-height: 0 !important;\n}\n\n.cn-dashboard-grid--fill > .grid-stack > .grid-stack-item {\n\tposition: relative !important;\n\tinset: auto !important;\n\twidth: auto !important;\n\theight: auto !important;\n\tmin-width: 0;\n\tmin-height: 0;\n\tbox-sizing: border-box;\n\tpadding: var(--cn-fill-margin, 0);\n}\n\n.cn-dashboard-grid--fill > .grid-stack > .grid-stack-item > .grid-stack-item-content {\n\tposition: relative !important;\n\tinset: auto !important;\n\theight: 100%;\n\toverflow: hidden auto;\n}\n\n/* `sideColumn`: an item on a track has its left edge and width follow its\n column on two scales, the columns before `--cn-side-from` sharing what the side column\n leaves, the columns after it sharing the side column's fixed width (the\n card plus its two item margins). GridStack writes `--gs-x` and `--gs-w` on\n every item and its own left and width inline, hence !important. */\n.cn-dashboard-grid--side-column > .grid-stack.gs-12:not(.grid-stack-rtl) > .grid-stack-item[data-cn-track] {\n\t--cn-side-cell: calc(var(--cn-side-width) + var(--gs-item-margin-left, 0px) + var(--gs-item-margin-right, 0px));\n\t--cn-main-col: calc((100% - var(--cn-side-cell)) / var(--cn-side-from));\n\t--cn-side-col: calc(var(--cn-side-cell) / var(--cn-side-span));\n\t/* stylelint-disable-next-line csstools/use-logical -- GridStack places a left-to-right item by `left`. */\n\tleft: calc(min(var(--gs-x), var(--cn-side-from)) * var(--cn-main-col) + max(var(--gs-x) - var(--cn-side-from), 0) * var(--cn-side-col)) !important;\n\twidth: calc((min(var(--gs-x) + var(--gs-w), var(--cn-side-from)) - min(var(--gs-x), var(--cn-side-from))) * var(--cn-main-col) + (max(var(--gs-x) + var(--gs-w) - var(--cn-side-from), 0) - max(var(--gs-x) - var(--cn-side-from), 0)) * var(--cn-side-col)) !important;\n}\n\n/* `columnWeights`: an item's left edge and width follow the weighted columns\n it spans, as fractions of the grid. GridStack writes its own left and width\n inline, hence !important. */\n.cn-dashboard-grid--weighted > .grid-stack.gs-12:not(.grid-stack-rtl) > .grid-stack-item[data-cn-weighted] {\n\t/* stylelint-disable-next-line csstools/use-logical -- GridStack places a left-to-right item by `left`. */\n\tleft: calc(var(--cn-weight-left) * 100%) !important;\n\twidth: calc(var(--cn-weight-width) * 100%) !important;\n}\n\n/* Screen-reader-only text: the keyboard key map and the live region. Kept in\n the layout (not `display: none`) so assistive tech still reads it. */\n.cn-dashboard-grid__sr-only {\n\tposition: absolute;\n\twidth: 1px;\n\theight: 1px;\n\tpadding: 0;\n\tmargin: -1px;\n\toverflow: hidden;\n\tclip-path: inset(50%);\n\twhite-space: nowrap;\n\tborder: 0;\n}\n\n/* Grid items become tab stops in edit mode — give them a visible focus ring\n that satisfies WCAG 2.1 SC 2.4.7 without relying on the widget's own\n styling. `outline-offset` keeps the ring outside the rounded card. */\n.grid-stack-item:focus-visible {\n\toutline: 2px solid var(--color-primary-element, #0082c9);\n\toutline-offset: 2px;\n\tborder-radius: var(--border-radius-container-large, 16px);\n}\n\n/* A stretched `sameHeight` card keeps its content at the top, as the boards\n draw a row of cards, not centred in the extra height. */\n.cn-dashboard-grid__item--same-height > :deep(.grid-stack-item-content > * > .cn-widget-wrapper__content) {\n\tjustify-content: flex-start;\n}\n\n/* A size-to-content cell (`sizeToContent`) is measured by GridStack from the\n content's first child, and a widget wrapper there filled the cell\n (`height: 100%`), so the measure returned the cell's own height and the\n cell never shrank: \"Waiting for me\" stayed a tall card around one row. In\n such a cell the child takes its own height. A cell without the key keeps\n the filling child. */\n.cn-dashboard-grid__item--fit > :deep(.grid-stack-item-content > *) {\n\theight: auto;\n}\n\n:deep(.grid-stack-item-content) {\n\tbackground: var(--color-main-background);\n\tborder: none;\n\tbox-shadow: none;\n\toverflow: hidden;\n}\n\n:deep(.grid-stack-item-content:has(.cn-widget-wrapper--borderless)) {\n\tbackground: transparent;\n}\n\n:deep(.grid-stack-placeholder > .placeholder-content) {\n\tbackground: var(--color-primary-element-light);\n\tborder: 2px dashed var(--color-primary-element);\n\tborder-radius: var(--border-radius-large);\n}\n</style>\n"],"names":["_createElementBlock","_createElementVNode","_Fragment","_renderList","_normalizeClass","_normalizeStyle","_renderSlot"],"mappings":";;;;AAoEG,MAAA,UAAA,GAAA,EAAA,KAAA,EAAA,yBAAA,GAAA;;;;;;;;;uBAzCAA;AAAG,IAAA,G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,EAAE,IAAI,CAAC,SAAS;AACpB,UAAA,MAAI,EAAE,QAAA,CAAA,SAAA,CAAA,IAAA,CAAA,UAAA,CAAA;AACN,UAAA,UAAI,EAAA,MAAA,CAAA,QAAA;UACJ,UAAG,EAAA,QAAA,CAAA,OAAA,CAAA,IAAA,CAAA;UACH,oBAAE,EAAA,QAAA,CAAA,iBAAA,CAAA,IAAA,CAAA;;AAEF,UAAA,kBAAA,EAAA,QAAA,CAAA,WAAA,CAAA,IAAA,SAAA,SAAA;AACA,UAAA,mBAAiB,EAAE,IAAI,CAAC,QAAQ,IAAI,SAAS;AAC7C,UAAA,WAAS,EAAG,IAAG,CAAC,KAAK,KAAc,IAAA,IAAA,CAAA,MAAA,CAAA,QAAQ,YAAY,SAAI;UAC3D,KAAK,EAAAC,cAAA,CAAE,QAAS,CAAA,SAAA,KAAK,CAAA,CAAA;AACtB,UAAA,SAAA,EAAA,MAAA,KAAA,QAAA,CAAA,aAAA,CAAA,MAAA,EAAA,IAAA,CAAA,CAAA;;AACD,UAAAJ,kBAAA,CAIO,OAJP,UAIO,EAAA;YAHLK,UAEO,CAAA,IAAA,CAAA,MAAA,EAAA,QAAA,EAAA,EAFc,IAAI,EAAE,IAAI,EAAA,CAAA;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"CnDashboardGrid.vue3.js","sources":["../../../../src/components/CnDashboardGrid/CnDashboardGrid.vue?vue&type=template&id=e21b7108&lang.js"],"sourcesContent":["<!--\n CnDashboardGrid — GridStack-powered drag-and-drop dashboard grid.\n\n Renders widgets in a configurable grid layout. Supports drag, resize,\n and dynamic item addition/removal. Emits layout changes for persistence.\n\n Accessibility: every grid item is an ARIA `group` with an accessible name\n and — in edit mode — a tab stop, so the pointer-only GridStack drag/resize\n gestures have a full keyboard equivalent (WCAG 2.1 SC 2.1.1). Keyboard\n moves are routed through `GridStack.update()`, i.e. the exact same engine\n call drag/resize ends in, so collision handling, persistence and the\n `layout-change` emission are byte-identical between the two input modes.\n-->\n<template>\n\t<div ref=\"gridContainer\"\n\t\tclass=\"cn-dashboard-grid\"\n\t\t:class=\"{ 'cn-dashboard-grid--side-column': sideColumnStyle !== null, 'cn-dashboard-grid--weighted': columnBounds !== null, 'cn-dashboard-grid--fill': filling }\"\n\t\t:style=\"sideColumnStyle\">\n\t\t<!--\n\t\t\tKeyboard instructions, referenced by every grid item through\n\t\t\t`aria-describedby`. Rendered once (not per item) so a screen\n\t\t\treader user hears the key map on the first item they land on\n\t\t\twithout it being duplicated N times in the accessibility tree.\n\t\t-->\n\t\t<p\n\t\t\tv-if=\"keyboardActive\"\n\t\t\t:id=\"keyboardHelpDomId\"\n\t\t\tclass=\"cn-dashboard-grid__sr-only\">\n\t\t\t{{ keyboardHelpText }}\n\t\t</p>\n\n\t\t<div class=\"grid-stack\" :style=\"fillGridStyle\">\n\t\t\t<div\n\t\t\t\tv-for=\"item in itemsInRowOrder\"\n\t\t\t\t:key=\"resolveItemKey(item)\"\n\t\t\t\tclass=\"grid-stack-item\"\n\t\t\t\t:class=\"{ 'cn-dashboard-grid__item--fit': sizeToContentAttr(item) !== undefined, 'cn-dashboard-grid__item--same-height': sharesRowHeight(item) }\"\n\t\t\t\trole=\"group\"\n\t\t\t\t:aria-label=\"resolveItemLabel(item, layout.indexOf(item))\"\n\t\t\t\t:aria-describedby=\"itemDescribedBy\"\n\t\t\t\t:tabindex=\"itemTabindex\"\n\t\t\t\t:gs-id=\"item.id\"\n\t\t\t\t:gs-x=\"item.gridX\"\n\t\t\t\t:gs-y=\"scaledRow(item.gridY)\"\n\t\t\t\t:gs-w=\"item.gridWidth\"\n\t\t\t\t:gs-h=\"scaledRow(item.gridHeight)\"\n\t\t\t\t:gs-min-w=\"minWidth\"\n\t\t\t\t:gs-min-h=\"minRows(item)\"\n\t\t\t\t:gs-size-to-content=\"sizeToContentAttr(item)\"\n\t\t\t\t:data-cn-track=\"item.track === 'main' || item.track === 'side' ? item.track : undefined\"\n\t\t\t\t:data-cn-weighted=\"weightStyle(item) ? '' : undefined\"\n\t\t\t\t:data-cn-widget-id=\"item.widgetId || undefined\"\n\t\t\t\t:gs-locked=\"item.clear === true && !editable ? 'true' : undefined\"\n\t\t\t\t:style=\"itemStyle(item)\"\n\t\t\t\t@keydown=\"onItemKeydown($event, item)\">\n\t\t\t\t<div class=\"grid-stack-item-content\">\n\t\t\t\t\t<slot name=\"widget\" :item=\"item\">\n\t\t\t\t\t\t<!-- Default: render nothing; CnDashboardPage provides content -->\n\t\t\t\t\t</slot>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\n\t\t<!--\n\t\t\tPolite live region for keyboard move/resize feedback. A sighted\n\t\t\tuser sees the widget slide; a screen-reader user needs the new\n\t\t\tcoordinates spoken, otherwise the arrow keys are silent.\n\t\t-->\n\t\t<p\n\t\t\tclass=\"cn-dashboard-grid__sr-only\"\n\t\t\trole=\"status\"\n\t\t\taria-live=\"polite\"\n\t\t\taria-atomic=\"true\">\n\t\t\t{{ announcement }}\n\t\t</p>\n\t</div>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport { GridStack } from 'gridstack'\nimport { toRaw } from 'vue'\nimport { planClearRows, planGrowth, planSameHeights } from '../../utils/gridStack.js'\n// `gridstack` is a peerDependency (see package.json), not bundled — this\n// component's JS and the consumer's GridStack stylesheet MUST come from the\n// exact same installed copy, because GridStack's JS writes layout state\n// (e.g. the `--gs-column-width` CSS custom property) that only its OWN\n// matching CSS reads. Baking a copy of `gridstack/dist/gridstack.min.css`\n// into this library's build (as a previous version did) freezes it at\n// nc-vue's build-time version, which can silently drift from whatever the\n// consumer's peer-installed copy actually is — the exact mismatch that once\n// made every grid item render at 0px width. So nc-vue ships NO GridStack\n// CSS of its own: the consumer MUST install `gridstack` themselves and\n// import `gridstack/dist/gridstack.min.css` (or their preferred GridStack\n// stylesheet) from that same copy.\n\n/**\n * Monotonic counter backing the per-instance DOM ids (the shared\n * `aria-describedby` help text). Module-level so two grids on one page\n * never collide — the same pattern CnCommandPalette uses.\n */\nlet domIdCounter = 0\n\n/**\n * Pixel offset applied to the grid item's top-left corner when synthesising\n * the `contextmenu` coordinates for a keyboard activation. Nudging the anchor\n * inside the item keeps consumer menus (which position at `clientX/clientY`)\n * visually attached to the widget instead of straddling its border.\n */\nconst MENU_ANCHOR_OFFSET = 8\n\n/**\n * How many GridStack rows a layout row is drawn as on a grid with\n * size-to-content cells (`wantsRowSplit`): 80px rows become 1px rows, so a\n * cell sized to its content ends less than 1px under it. On 4px rows each\n * stacked card could end up to 4px low, and the rounding added up down a\n * column (r33 DqHandhaving \"De overtreding\" y +6).\n *\n * @spec openspec/changes/fit-cells-on-4px-rows/specs/fit-cells-on-4px-rows/spec.md#requirement-a-size-to-content-cell-ends-within-4px-of-its-content\n */\nconst ROW_SPLIT = 80\n\n/**\n * Whether a layout holds a size-to-content cell (`sizeToContent` true or a\n * positive row maximum).\n *\n * @param {Array<object>} layout The layout items.\n * @return {boolean} True when one does.\n */\nfunction hasFitCell(layout) {\n\treturn Array.isArray(layout) && layout.some((item) => item\n\t\t&& (item.sizeToContent === true || (Number.isFinite(item.sizeToContent) && item.sizeToContent > 0)))\n}\n\n/**\n * The row tracks of a grid that fills its height (`fillHeight`): `auto` for\n * a row whose items all set `fitRows`, or that no item covers, and an equal\n * share of the free height (`minmax(0, 1fr)`) for every other row.\n *\n * @spec openspec/changes/lpvandaag-start-page/specs/lpvandaag-start-page/spec.md#requirement-a-dashboard-can-fill-the-height-below-the-top-bar\n * @param {Array<object>} layout The layout items.\n * @return {string[]} One track per layout row.\n */\nexport function fillRowTracks(layout) {\n\tconst items = Array.isArray(layout) ? layout.filter(Boolean) : []\n\tconst top = (item) => (Number.isFinite(item.gridY) ? item.gridY : 0)\n\tconst height = (item) => (Number.isFinite(item.gridHeight) ? item.gridHeight : 1)\n\tconst rows = items.reduce((max, item) => Math.max(max, top(item) + height(item)), 0)\n\tconst tracks = []\n\tfor (let row = 0; row < rows; row++) {\n\t\tconst covering = items.filter((item) => row >= top(item) && row < top(item) + height(item))\n\t\tconst fits = covering.every((item) => item.fitRows === true)\n\t\ttracks.push(fits ? 'auto' : 'minmax(0, 1fr)')\n\t}\n\treturn tracks\n}\n\n/**\n * CnDashboardGrid — Low-level grid layout engine powered by GridStack.\n *\n * Manages the drag-and-drop grid, syncs positions, and emits layout\n * changes. Does NOT handle widget rendering — that's done by the parent\n * via the `#widget` scoped slot.\n *\n * ```vue\n * <CnDashboardGrid\n * :layout=\"placements\"\n * :editable=\"isEditing\"\n * @layout-change=\"onLayoutChange\">\n * <template #widget=\"{ item }\">\n * <MyWidget :config=\"item\" />\n * </template>\n * </CnDashboardGrid>\n * ```\n *\n * ### Keyboard operation\n *\n * With `keyboardRepositioning` on (the default) and `editable` true, each\n * grid item is a tab stop. With an item focused:\n *\n * | Key | Action |\n * | --- | ------ |\n * | `ArrowLeft` / `ArrowRight` | move one column left / right |\n * | `ArrowUp` / `ArrowDown` | move one row up / down |\n * | `Shift` + `ArrowLeft` / `ArrowRight` | shrink / grow width by one column |\n * | `Shift` + `ArrowUp` / `ArrowDown` | shrink / grow height by one row |\n * | `Home` / `End` | jump to the first / last column of the current row |\n * | `Enter` / `Space` | activate the item — see `item-activate` |\n *\n * Keys are only honoured when the grid item itself holds focus, so\n * interactive content rendered inside the `#widget` slot keeps its own\n * key handling untouched.\n */\nexport default {\n\tname: 'CnDashboardGrid',\n\n\tprops: {\n\t\t/** Array of layout items: { id, gridX, gridY, gridWidth, gridHeight, ...extra } */\n\t\tlayout: {\n\t\t\ttype: Array,\n\t\t\trequired: true,\n\t\t},\n\n\t\t/** Whether drag and resize are enabled */\n\t\teditable: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/** Number of grid columns */\n\t\tcolumns: {\n\t\t\ttype: Number,\n\t\t\tdefault: 12,\n\t\t},\n\n\t\t/** Cell height in pixels */\n\t\tcellHeight: {\n\t\t\ttype: Number,\n\t\t\tdefault: 80,\n\t\t},\n\n\t\t/** Grid margin in pixels */\n\t\tmargin: {\n\t\t\ttype: Number,\n\t\t\tdefault: 12,\n\t\t},\n\n\t\t/**\n\t\t * Margin under each item in pixels, in place of `margin` on that side\n\t\t * only; null keeps `margin` on every side.\n\t\t */\n\t\tmarginBottom: {\n\t\t\ttype: Number,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** Minimum widget width in grid units */\n\t\tminWidth: {\n\t\t\ttype: Number,\n\t\t\tdefault: 2,\n\t\t},\n\n\t\t/** Minimum widget height in grid units */\n\t\tminHeight: {\n\t\t\ttype: Number,\n\t\t\tdefault: 2,\n\t\t},\n\n\t\t/**\n\t\t * GridStack v12 responsive `columnOpts` bag (breakpoints + reflow\n\t\t * layout). When set, the grid reflows column count across screen sizes.\n\t\t * Build it with `getDashboardColumnOpts()`. Default `null` = fixed\n\t\t * `columns`, no responsive reflow (backwards-compatible).\n\t\t *\n\t\t * @type {object|null}\n\t\t */\n\t\tcolumnOpts: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * When set, `cellHeight` is mirrored into this CSS custom property on\n\t\t * the document root at init (e.g. `'--app-cell-height'`), so app CSS can\n\t\t * align to the grid geometry. Default `null` = no CSS var written.\n\t\t *\n\t\t * @type {string|null}\n\t\t */\n\t\tcellHeightCssVar: {\n\t\t\ttype: String,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * Optional `(item) => string|number` to derive each item's render key.\n\t\t * Use it to force a re-render when an item changes in a way its `id`\n\t\t * doesn't capture (e.g. style edits — return `${item.id}:${item.updatedAt}`).\n\t\t * Default `null` = key on `item.id`.\n\t\t *\n\t\t * @type {((item: object) => (string|number))|null}\n\t\t */\n\t\titemKey: {\n\t\t\ttype: Function,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * Whether grid items are keyboard-operable: focusable in edit mode and\n\t\t * repositionable/resizable with the arrow keys (WCAG 2.1 SC 2.1.1 —\n\t\t * the keyboard equivalent of the pointer-only GridStack drag). Turning\n\t\t * it off leaves the items non-focusable and drag-only. Default `true`.\n\t\t */\n\t\tkeyboardRepositioning: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true,\n\t\t},\n\n\t\t/**\n\t\t * Optional `(item, index) => string` returning the accessible name for\n\t\t * a grid item. Use it when the layout items don't carry a human-readable\n\t\t * field (the built-in fallback walks `title` → `name` → `label` →\n\t\t * `widgetTitle` → `widgetId`, then a positional \"Widget N\"). The returned\n\t\t * string is used verbatim — no coordinates are appended.\n\t\t *\n\t\t * @type {((item: object, index: number) => string)|null}\n\t\t */\n\t\titemLabel: {\n\t\t\ttype: Function,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * Whether a keyboard activation (`Enter` / `Space` on a focused grid\n\t\t * item) also dispatches a bubbling `contextmenu` event from inside the\n\t\t * item, so consumers that open a per-widget menu on right-click get the\n\t\t * keyboard path for free — mirroring what browsers do for the `Menu`\n\t\t * key. Set `false` to rely purely on the `item-activate` event.\n\t\t * Default `true`.\n\t\t */\n\t\tactivateOpensContextMenu: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true,\n\t\t},\n\n\t\t/**\n\t\t * GridStack's `float`. True (the default) keeps every item on the row\n\t\t * it was placed on, with empty rows above it if need be. False packs\n\t\t * items upward, so a size-to-content cell that shrinks, or a widget\n\t\t * that is not shown, closes its gap instead of leaving a band.\n\t\t *\n\t\t * @spec openspec/changes/zuiddrecht-pixel-gaps-3/specs/zuiddrecht-pixel-gaps-3/spec.md#requirement-a-dashboard-closes-the-gap-a-shrinking-or-hidden-widget-leaves\n\t\t */\n\t\tfloat: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true,\n\t\t},\n\n\t\t/**\n\t\t * A side column of a fixed width: `{ width, from? }`. The layout items\n\t\t * that say which track they are on (`track: \"main\"` or `\"side\"`) are\n\t\t * drawn on two scales: from column `from` (8 by default) on at `width`\n\t\t * px (the card, not counting the item margins), the columns before it\n\t\t * sharing the rest, so the side cards keep their width on any screen\n\t\t * (DqMijnWerk). Items without a track keep the twelve shares, so a row\n\t\t * of four tiles stays four equal tiles. Only on the full twelve-column\n\t\t * grid and not while editing; GridStack keeps the twelve columns\n\t\t * underneath.\n\t\t *\n\t\t * @spec openspec/changes/dashboard-side-column-width/specs/dashboard-side-column-width/spec.md#requirement-a-dashboard-can-draw-its-side-column-at-a-fixed-width\n\t\t */\n\t\tsideColumn: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * Weights for groups of the twelve columns: `[{ span, weight }]`, the\n\t\t * spans adding up to 12. Each group takes its weight's share of the\n\t\t * width, split evenly over its columns, so three groups of four can be\n\t\t * drawn 332 / 415 / 332 (PqWerkplekKlant in a call). Items on a\n\t\t * `sideColumn` track keep that column. Only on the full twelve-column\n\t\t * grid and not while editing; GridStack keeps the twelve columns\n\t\t * underneath.\n\t\t *\n\t\t * @spec openspec/changes/dashboard-column-weights/specs/dashboard-column-weights/spec.md#requirement-a-dashboard-can-weigh-its-column-groups\n\t\t */\n\t\tcolumnWeights: {\n\t\t\ttype: Array,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * Fill the height the host gives the grid instead of growing with\n\t\t * the content: in view mode the layout rows divide the grid's own\n\t\t * height, so the page around it does not scroll. A row whose items\n\t\t * all set `fitRows: true` takes the height of its content; every\n\t\t * other row takes an equal share of what is left. A widget that is\n\t\t * taller than its share scrolls inside its own cell. The host gives\n\t\t * the grid a definite height (a flex child with `min-height: 0`, say).\n\t\t * Edit mode, and a grid narrower than `fillMinWidth`, keep the\n\t\t * GridStack grid of `cellHeight` rows.\n\t\t *\n\t\t * @spec openspec/changes/lpvandaag-start-page/specs/lpvandaag-start-page/spec.md#requirement-a-dashboard-can-fill-the-height-below-the-top-bar\n\t\t */\n\t\tfillHeight: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * The narrowest grid, in pixels, that `fillHeight` still fills.\n\t\t * Narrower, the cards take their `cellHeight` rows (and GridStack's\n\t\t * `columnOpts` reflow) and the page scrolls.\n\t\t *\n\t\t * @spec openspec/changes/lpvandaag-start-page/specs/lpvandaag-start-page/spec.md#requirement-a-dashboard-can-fill-the-height-below-the-top-bar\n\t\t */\n\t\tfillMinWidth: {\n\t\t\ttype: Number,\n\t\t\tdefault: 960,\n\t\t},\n\t},\n\n\temits: [\n\t\t/**\n\t\t * Fired whenever the grid geometry changed — by drag, by resize, or by\n\t\t * a keyboard nudge. Payload is the full `layout` array with the moved\n\t\t * items' `gridX`/`gridY`/`gridWidth`/`gridHeight` updated.\n\t\t */\n\t\t'layout-change',\n\t\t/**\n\t\t * Fired when the user activates a focused grid item with `Enter` or\n\t\t * `Space`. Payload `{ item, element, clientX, clientY }` — the layout\n\t\t * item, its DOM element, and viewport coordinates anchored to the\n\t\t * item's top-left corner so a consumer menu can position itself the\n\t\t * same way it does for a right-click.\n\t\t */\n\t\t'item-activate',\n\t],\n\n\tdata() {\n\t\treturn {\n\t\t\tgrid: null,\n\t\t\tcontentObserver: null,\n\t\t\t/** True while the grid moves an item to where the layout put it. */\n\t\t\tapplyingLayout: false,\n\t\t\tdomId: `cn-dashboard-grid-${++domIdCounter}`,\n\t\t\t/** Text currently held in the polite live region. */\n\t\t\tannouncement: '',\n\t\t\t/**\n\t\t\t * Whether a `columnOpts` breakpoint is currently in force. Mirrored\n\t\t\t * from the engine by `syncInteractivity` because `isReflowed()` reads\n\t\t\t * `grid.getColumn()` imperatively, and a computed cannot re-evaluate\n\t\t\t * on that.\n\t\t\t */\n\t\t\treflowed: false,\n\t\t\t/**\n\t\t\t * How many GridStack rows one layout row is drawn as: 1, or\n\t\t\t * ROW_SPLIT while `wantsRowSplit` holds. Set before the first render,\n\t\t\t * since GridStack reads the items' places from their attributes,\n\t\t\t * and again when the grid is rebuilt.\n\t\t\t */\n\t\t\trowSplit: (!this.editable && !this.float && hasFitCell(this.layout)) ? ROW_SPLIT : 1,\n\t\t\t/** The grid's width in pixels, measured for `fillHeight`. */\n\t\t\tcontainerWidth: 0,\n\t\t\tsizeObserver: null,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/**\n\t\t * The CSS variables that draw the side column at its width, or null\n\t\t * when the grid keeps its twelve shares.\n\t\t *\n\t\t * @return {object|null}\n\t\t */\n\t\t/**\n\t\t * The left edge of each of the twelve columns and the right edge of\n\t\t * the last, as fractions of the grid's width, from `columnWeights`;\n\t\t * null when the grid keeps its twelve shares.\n\t\t *\n\t\t * @spec openspec/changes/dashboard-column-weights/specs/dashboard-column-weights/spec.md#requirement-a-dashboard-can-weigh-its-column-groups\n\t\t * @return {number[]|null}\n\t\t */\n\t\tcolumnBounds() {\n\t\t\tconst groups = this.columnWeights\n\t\t\tif (this.editable || !Array.isArray(groups) || groups.length === 0) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tconst perColumn = []\n\t\t\tfor (const group of groups) {\n\t\t\t\tconst span = Number(group?.span)\n\t\t\t\tconst weight = Number(group?.weight)\n\t\t\t\tif (!Number.isInteger(span) || span < 1 || !Number.isFinite(weight) || weight <= 0) {\n\t\t\t\t\treturn null\n\t\t\t\t}\n\t\t\t\tfor (let i = 0; i < span; i++) {\n\t\t\t\t\tperColumn.push(weight / span)\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (perColumn.length !== 12) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tconst total = perColumn.reduce((sum, w) => sum + w, 0)\n\t\t\tconst bounds = [0]\n\t\t\tfor (const w of perColumn) {\n\t\t\t\tbounds.push(bounds[bounds.length - 1] + w / total)\n\t\t\t}\n\t\t\treturn bounds\n\t\t},\n\n\t\tsideColumnStyle() {\n\t\t\tconst width = Number(this.sideColumn?.width)\n\t\t\tif (this.editable || !Number.isFinite(width) || width <= 0) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tconst from = Math.floor(Number(this.sideColumn?.from ?? 8))\n\t\t\tconst split = Number.isFinite(from) && from > 0 && from < 12 ? from : 8\n\t\t\treturn {\n\t\t\t\t'--cn-side-width': `${width}px`,\n\t\t\t\t'--cn-side-from': String(split),\n\t\t\t\t'--cn-side-span': String(12 - split),\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Whether the grid fills its height now (`fillHeight`): in view mode,\n\t\t * on a grid at least `fillMinWidth` wide.\n\t\t *\n\t\t * @spec openspec/changes/lpvandaag-start-page/specs/lpvandaag-start-page/spec.md#requirement-a-dashboard-can-fill-the-height-below-the-top-bar\n\t\t * @return {boolean}\n\t\t */\n\t\tfilling() {\n\t\t\treturn this.fillHeight && !this.editable && this.containerWidth >= this.fillMinWidth\n\t\t},\n\n\t\t/**\n\t\t * The inline style of the grid element while it fills its height.\n\t\t *\n\t\t * @spec openspec/changes/lpvandaag-start-page/specs/lpvandaag-start-page/spec.md#requirement-a-dashboard-can-fill-the-height-below-the-top-bar\n\t\t * @return {object|null}\n\t\t */\n\t\tfillGridStyle() {\n\t\t\tif (!this.filling) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tgridTemplateColumns: `repeat(${this.columns}, minmax(0, 1fr))`,\n\t\t\t\tgridTemplateRows: fillRowTracks(this.layout).join(' '),\n\t\t\t\t'--cn-fill-margin': `${this.margin}px`,\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * The layout's items top to bottom, then left to right: the order the\n\t\t * items are in the page, so GridStack places them in that order.\n\t\t *\n\t\t * GridStack sizes a size-to-content cell while it adds the items, one\n\t\t * at a time, and an item it adds onto a cell that has already grown\n\t\t * moves itself below whatever it then collides with. In the layout's\n\t\t * own order a card declared after the lists (pipelinq's full-width\n\t\t * \"client in focus\" card) was added last, so when the banner above\n\t\t * it grew it skipped past the stat tiles AND the lists and landed at\n\t\t * the bottom. Added top to bottom, every card lands under the one\n\t\t * above it. It is also the order a screen reader and the Tab key\n\t\t * follow. An item without a row or column sorts after the items\n\t\t * that have one, in the layout's order.\n\t\t *\n\t\t * @spec openspec/changes/dashboard-growth-keeps-order/specs/dashboard-grid/spec.md#requirement-a-growing-cell-keeps-the-order-of-the-cards-under-it\n\t\t * @return {Array<object>} The items in row order.\n\t\t */\n\t\titemsInRowOrder() {\n\t\t\tconst items = Array.isArray(this.layout) ? [...this.layout] : []\n\t\t\tconst at = (value) => (Number.isFinite(value) ? value : Number.MAX_SAFE_INTEGER)\n\t\t\treturn items.sort((a, b) => (at(a.gridY) - at(b.gridY)) || (at(a.gridX) - at(b.gridX)))\n\t\t},\n\n\t\t/**\n\t\t * Whether the grid draws each layout row as ROW_SPLIT finer rows. A\n\t\t * size-to-content cell can only be a whole number of rows tall, so on\n\t\t * 80px rows it kept up to a row of empty space under its content and\n\t\t * a packing grid (`float: false`) could not close it (pipelinq and\n\t\t * dossiq Mijn werk, decidiq Mijn acties). Split into 4px rows the\n\t\t * cell ends within 4px of its content and the widgets below move up.\n\t\t *\n\t\t * Only in view mode, only on a packing grid with a size-to-content\n\t\t * cell: every other grid is built exactly as before. Item positions\n\t\t * and sizes scale with the rows, so every widget keeps its pixel\n\t\t * place and size until a cell shrinks; the layout itself, what edit\n\t\t * mode shows and what `layout-change` reports, stays in layout rows.\n\t\t *\n\t\t * @spec openspec/changes/dashboard-fit-cells-close-up/specs/dashboard-grid/spec.md#requirement-a-size-to-content-cell-ends-at-its-content\n\t\t * @return {boolean} True to split the rows.\n\t\t */\n\t\twantsRowSplit() {\n\t\t\treturn !this.editable && !this.float && hasFitCell(this.layout)\n\t\t},\n\n\t\t/**\n\t\t * @return {boolean} Whether the keyboard lane is live — items are\n\t\t * focusable and the arrow keys reposition. Requires the opt-in prop,\n\t\t * edit mode (a read-only dashboard has nothing to move, so adding N tab\n\t\t * stops there would be pure noise), and a grid that is not reflowed,\n\t\t * which is where a move cannot be kept and so must not be offered.\n\t\t */\n\t\tkeyboardActive() {\n\t\t\treturn this.keyboardRepositioning && this.editable && !this.reflowed\n\t\t},\n\n\t\t/**\n\t\t * @return {number|null} `0` when grid items should be tab stops,\n\t\t * otherwise `null` so the attribute is omitted entirely.\n\t\t */\n\t\titemTabindex() {\n\t\t\treturn this.keyboardActive ? 0 : null\n\t\t},\n\n\t\t/**\n\t\t * @return {string} DOM id of the shared keyboard-instructions element.\n\t\t */\n\t\tkeyboardHelpDomId() {\n\t\t\treturn `${this.domId}-keyboard-help`\n\t\t},\n\n\t\t/**\n\t\t * @return {string|null} `aria-describedby` target for each grid item —\n\t\t * the instructions element while the keyboard lane is live, `null`\n\t\t * otherwise (a dangling id reference is an axe violation).\n\t\t */\n\t\titemDescribedBy() {\n\t\t\treturn this.keyboardActive ? this.keyboardHelpDomId : null\n\t\t},\n\n\t\t/**\n\t\t * @return {string} The spoken key map for the keyboard lane.\n\t\t */\n\t\tkeyboardHelpText() {\n\t\t\treturn t(\n\t\t\t\t'nextcloud-vue',\n\t\t\t\t'Use the arrow keys to move this widget one cell. Hold Shift and use the arrow keys to resize it. Press Home or End to jump to the first or last column. Press Enter to open the widget menu.',\n\t\t\t)\n\t\t},\n\n\t\t/**\n\t\t * @return {number} The column count currently in force. With responsive\n\t\t * `columnOpts` GridStack reflows to fewer columns on small screens, so\n\t\t * clamping must read the live value rather than the `columns` prop.\n\t\t */\n\t\teffectiveColumns() {\n\t\t\tif (this.grid && typeof this.grid.getColumn === 'function') {\n\t\t\t\tconst live = this.grid.getColumn()\n\t\t\t\tif (Number.isFinite(live) && live > 0) {\n\t\t\t\t\treturn live\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this.columns\n\t\t},\n\t},\n\n\twatch: {\n\t\teditable() {\n\t\t\tthis.syncInteractivity()\n\t\t},\n\n\t\tfilling(fills) {\n\t\t\tif (fills) {\n\t\t\t\tthis.disconnectContentObserver()\n\t\t\t\tif (this.grid) {\n\t\t\t\t\tthis.grid.destroy(false)\n\t\t\t\t\tthis.grid = null\n\t\t\t\t}\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.$nextTick(() => {\n\t\t\t\tif (this.grid || !this.$refs.gridContainer) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tthis.applyItemAttributes()\n\t\t\t\tthis.initGrid()\n\t\t\t\tthis.observeContentSizes()\n\t\t\t})\n\t\t},\n\n\t\twantsRowSplit(wants) {\n\t\t\tif (this.grid && (wants ? ROW_SPLIT : 1) !== this.rowSplit) {\n\t\t\t\tthis.rebuildGrid()\n\t\t\t}\n\t\t},\n\n\t\tlayout: {\n\t\t\tdeep: true,\n\t\t\thandler(newLayout) {\n\t\t\t\tif (this.grid) {\n\t\t\t\t\tthis.syncGridItems(newLayout)\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\t},\n\n\tmounted() {\n\t\tthis.observeContainerWidth()\n\t\tif (this.filling) {\n\t\t\treturn\n\t\t}\n\t\tthis.initGrid()\n\t\tthis.$nextTick(() => this.observeContentSizes())\n\t},\n\n\tbeforeUnmount() {\n\t\tif (this.sizeObserver) {\n\t\t\tthis.sizeObserver.disconnect()\n\t\t\tthis.sizeObserver = null\n\t\t}\n\t\tthis.disconnectContentObserver()\n\t\tif (this.grid) {\n\t\t\tthis.grid.destroy(false)\n\t\t}\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Derive the v-for render key for a layout item, honouring the optional\n\t\t * `itemKey` prop and falling back to `item.id`.\n\t\t *\n\t\t * @param {object} item the layout item.\n\t\t * @return {string|number} the render key.\n\t\t */\n\t\tresolveItemKey(item) {\n\t\t\treturn this.itemKey ? this.itemKey(item) : item.id\n\t\t},\n\n\t\t/**\n\t\t * The `gs-size-to-content` attribute for a layout item, or `undefined` to\n\t\t * leave the item on its authored `gridHeight`.\n\t\t *\n\t\t * A widget that decides AT RUNTIME it has nothing to show — a banner whose\n\t\t * condition is false, a list that came back empty — still costs its whole\n\t\t * authored row, because the row is reserved from the layout before the\n\t\t * component renders and the engine positions items absolutely, so no CSS\n\t\t * can reclaim it. `sizeToContent` hands the row's height to the content, so\n\t\t * an empty widget collapses and the grid closes up behind it.\n\t\t *\n\t\t * Opt-in per item: it makes `gridHeight` advisory for that widget, which is\n\t\t * wrong for anything with a deliberate size (a map, a chart) and right for\n\t\t * anything whose height is whatever it turned out to have.\n\t\t *\n\t\t * @param {object} item the layout item.\n\t\t * @return {string|undefined} `'true'`, a row maximum as a string, or undefined.\n\t\t */\n\t\tsizeToContentAttr(item) {\n\t\t\tconst v = item && item.sizeToContent\n\t\t\tif (v === true) {\n\t\t\t\treturn 'true'\n\t\t\t}\n\t\t\t// A number is GridStack's \"size to content, but never taller than N rows\" (a maximum).\n\t\t\tif (Number.isFinite(v) && v > 0) {\n\t\t\t\treturn String(v * this.rowSplit)\n\t\t\t}\n\t\t\treturn undefined\n\t\t},\n\n\t\t/**\n\t\t * A layout row coordinate or height in GridStack rows (`rowSplit`).\n\t\t *\n\t\t * @spec openspec/changes/dashboard-fit-cells-close-up/specs/dashboard-grid/spec.md#requirement-a-size-to-content-cell-ends-at-its-content\n\t\t * @param {number|undefined} value The value in layout rows.\n\t\t * @return {number|undefined} The value in grid rows, or undefined when none is set.\n\t\t */\n\t\tscaledRow(value) {\n\t\t\treturn Number.isFinite(value) ? value * this.rowSplit : undefined\n\t\t},\n\n\t\t/**\n\t\t * The smallest height an item may take, in grid rows: `minHeight`\n\t\t * layout rows, except for a size-to-content cell on split rows, which\n\t\t * may shrink to its content down to one grid row. The minimum is for\n\t\t * resizing by hand, and that only happens on whole rows in edit mode.\n\t\t *\n\t\t * @spec openspec/changes/dashboard-fit-cells-close-up/specs/dashboard-grid/spec.md#requirement-a-size-to-content-cell-ends-at-its-content\n\t\t * @param {object} item The layout item.\n\t\t * @return {number} The minimum height in grid rows.\n\t\t */\n\t\tminRows(item) {\n\t\t\tif (this.rowSplit !== 1 && this.sizeToContentAttr(item) !== undefined) {\n\t\t\t\treturn 1\n\t\t\t}\n\t\t\treturn this.minHeight * this.rowSplit\n\t\t},\n\n\t\t/**\n\t\t * Build the grid again with the row split `wantsRowSplit` asks for, as\n\t\t * edit mode turns on or off: the items go back to their layout places in\n\t\t * the new rows, and the size-to-content cells are measured again.\n\t\t *\n\t\t * @spec openspec/changes/dashboard-fit-cells-close-up/specs/dashboard-grid/spec.md#requirement-a-size-to-content-cell-ends-at-its-content\n\t\t * @return {void}\n\t\t */\n\t\trebuildGrid() {\n\t\t\tthis.disconnectContentObserver()\n\t\t\tthis.grid.destroy(false)\n\t\t\tthis.grid = null\n\t\t\tthis.rowSplit = this.wantsRowSplit ? ROW_SPLIT : 1\n\t\t\tthis.$nextTick(() => {\n\t\t\t\tif (!this.$refs.gridContainer) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\t// GridStack wrote its own places onto the items; put the layout's back.\n\t\t\t\tthis.applyItemAttributes()\n\t\t\t\tthis.initGrid()\n\t\t\t\tthis.observeContentSizes()\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * Build the accessible name for a grid item. A custom `itemLabel` wins\n\t\t * outright; otherwise the first human-readable field on the item is used\n\t\t * and, while the keyboard lane is live, the current grid coordinates are\n\t\t * appended — without them a screen-reader user tabbing through an edit-mode\n\t\t * dashboard has no way to tell where anything sits.\n\t\t *\n\t\t * @param {object} item the layout item.\n\t\t * @param {number} index the item's index in `layout`, used for the\n\t\t * last-resort positional name.\n\t\t * @return {string} the accessible name.\n\t\t */\n\t\t/**\n\t\t * Write every item's place and size onto its element as the `gs-*`\n\t\t * attributes GridStack reads when it starts, in the current row split.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tapplyItemAttributes() {\n\t\t\tfor (const item of this.layout) {\n\t\t\t\tconst el = this.$refs.gridContainer.querySelector(`[gs-id=\"${item.id}\"]`)\n\t\t\t\tif (!el) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tfor (const [name, value] of [['gs-x', item.gridX], ['gs-w', item.gridWidth], ['gs-y', this.scaledRow(item.gridY)], ['gs-h', this.scaledRow(item.gridHeight)], ['gs-min-h', this.minRows(item)], ['gs-size-to-content', this.sizeToContentAttr(item)]]) {\n\t\t\t\t\tif (value === undefined || value === null) {\n\t\t\t\t\t\tel.removeAttribute(name)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tel.setAttribute(name, String(value))\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Follow the grid's width, which decides whether `fillHeight` fills.\n\t\t *\n\t\t * @spec openspec/changes/lpvandaag-start-page/specs/lpvandaag-start-page/spec.md#requirement-a-dashboard-can-fill-the-height-below-the-top-bar\n\t\t * @return {void}\n\t\t */\n\t\tobserveContainerWidth() {\n\t\t\tconst container = this.$refs.gridContainer\n\t\t\tif (!this.fillHeight || !container) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.containerWidth = container.clientWidth\n\t\t\tif (typeof ResizeObserver === 'undefined') {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.sizeObserver = new ResizeObserver(() => {\n\t\t\t\tthis.containerWidth = container.clientWidth\n\t\t\t})\n\t\t\tthis.sizeObserver.observe(container)\n\t\t},\n\n\t\t/**\n\t\t * The inline style that places an item on the filled grid.\n\t\t *\n\t\t * @spec openspec/changes/lpvandaag-start-page/specs/lpvandaag-start-page/spec.md#requirement-a-dashboard-can-fill-the-height-below-the-top-bar\n\t\t * @param {object} item The layout item.\n\t\t * @return {object}\n\t\t */\n\t\tfillItemStyle(item) {\n\t\t\tconst x = Number.isFinite(item.gridX) ? item.gridX : 0\n\t\t\tconst y = Number.isFinite(item.gridY) ? item.gridY : 0\n\t\t\tconst w = Number.isFinite(item.gridWidth) ? item.gridWidth : this.minWidth\n\t\t\tconst h = Number.isFinite(item.gridHeight) ? item.gridHeight : this.minHeight\n\t\t\treturn {\n\t\t\t\tgridColumn: `${x + 1} / span ${w}`,\n\t\t\t\tgridRow: `${y + 1} / span ${h}`,\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * The left and width fractions of an item on weighted columns, or\n\t\t * null when the grid keeps its twelve shares or the item is on a\n\t\t * side-column track.\n\t\t *\n\t\t * @spec openspec/changes/dashboard-column-weights/specs/dashboard-column-weights/spec.md#requirement-a-dashboard-can-weigh-its-column-groups\n\t\t * @param {object} item The layout item.\n\t\t * @return {object|null}\n\t\t */\n\t\tweightStyle(item) {\n\t\t\tconst bounds = this.columnBounds\n\t\t\tif (bounds === null || (this.sideColumnStyle !== null && (item.track === 'main' || item.track === 'side'))) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tconst x = Math.min(Math.max(Number.isFinite(item.gridX) ? item.gridX : 0, 0), 12)\n\t\t\tconst w = Number.isFinite(item.gridWidth) ? item.gridWidth : this.minWidth\n\t\t\tconst end = Math.min(Math.max(x + w, x), 12)\n\t\t\treturn {\n\t\t\t\t'--cn-weight-left': String(bounds[x]),\n\t\t\t\t'--cn-weight-width': String(bounds[end] - bounds[x]),\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * The inline style of an item: its place on a filled grid, or its\n\t\t * place on weighted columns.\n\t\t *\n\t\t * @param {object} item The layout item.\n\t\t * @return {object|undefined}\n\t\t */\n\t\titemStyle(item) {\n\t\t\tif (this.filling) {\n\t\t\t\treturn this.fillItemStyle(item)\n\t\t\t}\n\t\t\treturn this.weightStyle(item) || undefined\n\t\t},\n\n\t\tresolveItemLabel(item, index) {\n\t\t\tif (this.itemLabel) {\n\t\t\t\treturn String(this.itemLabel(item, index) ?? '')\n\t\t\t}\n\n\t\t\tconst base = item.title\n\t\t\t\t|| item.name\n\t\t\t\t|| item.label\n\t\t\t\t|| item.widgetTitle\n\t\t\t\t|| item.widgetId\n\t\t\t\t|| t('nextcloud-vue', 'Widget {number}', { number: index + 1 })\n\n\t\t\tif (!this.keyboardActive) {\n\t\t\t\treturn String(base)\n\t\t\t}\n\n\t\t\t// Report the rectangle exactly as the reactive `layout` prop states\n\t\t\t// it — unclamped, so the spoken coordinates always match the\n\t\t\t// rendered `gs-*` attributes — and read from the prop (not the\n\t\t\t// GridStack node) so the name re-renders when a move round-trips\n\t\t\t// back through `layout-change`; engine-node mutations are invisible\n\t\t\t// to Vue's reactivity.\n\t\t\tconst rect = {\n\t\t\t\tx: Number.isFinite(item.gridX) ? item.gridX : 0,\n\t\t\t\ty: Number.isFinite(item.gridY) ? item.gridY : 0,\n\t\t\t\tw: Number.isFinite(item.gridWidth) ? item.gridWidth : this.minWidth,\n\t\t\t\th: Number.isFinite(item.gridHeight) ? item.gridHeight : this.minHeight,\n\t\t\t}\n\t\t\treturn t(\n\t\t\t\t'nextcloud-vue',\n\t\t\t\t'{label}, column {column} of {columns}, row {row}, {width} columns wide, {height} rows tall',\n\t\t\t\t{\n\t\t\t\t\tlabel: String(base),\n\t\t\t\t\tcolumn: rect.x + 1,\n\t\t\t\t\tcolumns: this.effectiveColumns,\n\t\t\t\t\trow: rect.y + 1,\n\t\t\t\t\twidth: rect.w,\n\t\t\t\t\theight: rect.h,\n\t\t\t\t},\n\t\t\t)\n\t\t},\n\n\t\t/**\n\t\t * Build the GridStack grid on the rendered items, install the growth\n\t\t * wrapper (`keepOrderOnGrowth`) and listen for its changes.\n\t\t *\n\t\t * @spec openspec/changes/dashboard-growth-keeps-order/specs/dashboard-grid/spec.md#requirement-a-growing-cell-keeps-the-order-of-the-cards-under-it\n\t\t * @return {void}\n\t\t */\n\t\tinitGrid() {\n\t\t\tif (this.cellHeightCssVar && typeof document !== 'undefined' && document.documentElement) {\n\t\t\t\tdocument.documentElement.style.setProperty(this.cellHeightCssVar, `${this.cellHeight}px`)\n\t\t\t}\n\t\t\tconst el = this.$refs.gridContainer.querySelector('.grid-stack')\n\t\t\tthis.grid = GridStack.init({\n\t\t\t\tcolumn: this.columns,\n\t\t\t\tcellHeight: this.cellHeight / this.rowSplit,\n\t\t\t\tmargin: this.margin,\n\t\t\t\t...(this.marginBottom !== null ? { marginBottom: this.marginBottom } : {}),\n\t\t\t\tfloat: this.float,\n\t\t\t\tanimate: true,\n\t\t\t\tdisableDrag: !this.editable,\n\t\t\t\tdisableResize: !this.editable,\n\t\t\t\tremovable: false,\n\t\t\t\t...(this.columnOpts ? { columnOpts: this.columnOpts } : {}),\n\t\t\t}, el)\n\t\t\tthis.keepOrderOnGrowth()\n\t\t\tthis.matchRowHeights()\n\t\t\tthis.placeClearRows()\n\n\t\t\tthis.grid.on('change', (_event, items) => {\n\t\t\t\tthis.handleGridChange(items)\n\t\t\t})\n\n\t\t\t// A grid that mounts already narrow is reflowed before anyone touches\n\t\t\t// it, so the handles have to be judged here and not only on a later\n\t\t\t// change.\n\t\t\tthis.syncInteractivity()\n\t\t},\n\n\t\t/**\n\t\t * Let a size-to-content cell that grows push the cards under it down in\n\t\t * their order. GridStack resolves that collision itself, but not in\n\t\t * order: when pipelinq's banner grew from two rows to three, the\n\t\t * full-width card under the stat tiles landed below the lists, also\n\t\t * with `float: false`. Every grow after the grid is built, whether\n\t\t * GridStack measures it on resize or this grid's content observer asks\n\t\t * for it, now first moves the cards the growth reaches down by the\n\t\t * growth (`planGrowth`), bottom-most first, and only then grows the\n\t\t * cell, so GridStack has no collision left to resolve. The wrapper is\n\t\t * installed after `GridStack.init` has already measured the cells on\n\t\t * load; the order on load comes from adding the items in row order\n\t\t * (`itemsInRowOrder`). A cell that shrinks is left to GridStack as\n\t\t * before.\n\t\t *\n\t\t * The grid is read raw: through Vue's proxy `engine.nodes` holds proxies\n\t\t * while `el.gridstackNode` is the plain node, so the growing cell would\n\t\t * not be recognised among the nodes and would be moved down by its own\n\t\t * growth. Moving a cell makes GridStack measure it again, so a cell the\n\t\t * wrapper is already growing goes straight to GridStack.\n\t\t *\n\t\t * @spec openspec/changes/dashboard-growth-keeps-order/specs/dashboard-grid/spec.md#requirement-a-growing-cell-keeps-the-order-of-the-cards-under-it\n\t\t * @return {void}\n\t\t */\n\t\tkeepOrderOnGrowth() {\n\t\t\tconst grid = toRaw(this.grid)\n\t\t\tif (!grid || typeof grid.resizeToContent !== 'function' || typeof grid.update !== 'function') {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst resize = grid.resizeToContent.bind(grid)\n\t\t\tconst growing = new Set()\n\t\t\tgrid.resizeToContent = (el) => {\n\t\t\t\tif (this.pendingSizes) {\n\t\t\t\t\tif (!this.pendingSizes.includes(el)) {\n\t\t\t\t\t\tthis.pendingSizes.push(el)\n\t\t\t\t\t}\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tthis.matchRowHeights()\n\t\t\t\tthis.resizeKeepingOrder(grid, resize, growing, el)\n\t\t\t\tif (growing.size === 0) {\n\t\t\t\t\tthis.placeClearRows()\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * One `resizeToContent` with the cards under a growing cell moved down\n\t\t * first (`keepOrderOnGrowth`).\n\t\t *\n\t\t * @param {object} grid The raw GridStack.\n\t\t * @param {function(HTMLElement): void} resize GridStack's own resizeToContent.\n\t\t * @param {Set<HTMLElement>} growing The cells being grown now.\n\t\t * @param {HTMLElement} el The cell.\n\t\t * @return {void}\n\t\t */\n\t\tresizeKeepingOrder(grid, resize, growing, el) {\n\t\t\tif (growing.has(el)) {\n\t\t\t\tresize(el)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst node = el && el.gridstackNode\n\t\t\tconst nodes = grid.engine && Array.isArray(grid.engine.nodes) ? grid.engine.nodes : null\n\t\t\tconst rows = node && nodes ? this.contentRows(el, node) : null\n\t\t\tconst plan = rows ? planGrowth(nodes, node, rows) : []\n\t\t\tif (plan.length === 0) {\n\t\t\t\tresize(el)\n\t\t\t\treturn\n\t\t\t}\n\t\t\t// Inside a batch the moves are not packed until the cell has grown.\n\t\t\tconst batching = Boolean(grid.engine.batchMode)\n\t\t\tgrowing.add(el)\n\t\t\ttry {\n\t\t\t\tif (!batching) {\n\t\t\t\t\tgrid.batchUpdate()\n\t\t\t\t}\n\t\t\t\tfor (const step of plan) {\n\t\t\t\t\tgrid.update(step.node.el, { y: step.y })\n\t\t\t\t}\n\t\t\t\tresize(el)\n\t\t\t\tif (!batching) {\n\t\t\t\t\tgrid.batchUpdate(false)\n\t\t\t\t}\n\t\t\t} finally {\n\t\t\t\tgrowing.delete(el)\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Whether a layout item takes part in its row's shared height\n\t\t * (`sameHeight`). A size-to-content card stretches to the tallest; a card\n\t\t * of fixed height is not stretched but counts as the height to reach.\n\t\t *\n\t\t * @spec openspec/changes/dashboard-row-same-height/specs/dashboard-grid/spec.md\n\t\t * @param {object} item The layout item.\n\t\t * @return {boolean} True when it does.\n\t\t */\n\t\tsharesRowHeight(item) {\n\t\t\treturn item?.sameHeight === true\n\t\t},\n\n\t\t/**\n\t\t * Stretch the shorter `sameHeight` cards of each layout row to the\n\t\t * tallest of them (`planSameHeights`), with a min-height on the widget\n\t\t * the cell measures, so GridStack sizes the cells alike and the next row\n\t\t * starts level, as the boards draw a row of cards (DqProcesanalyse).\n\t\t * Each pass measures the content again without the stretch, so a row\n\t\t * shrinks with its content. Edit mode and a reflowed (stacked) grid keep\n\t\t * every card at its own height.\n\t\t *\n\t\t * @spec openspec/changes/dashboard-row-same-height/specs/dashboard-grid/spec.md\n\t\t * @return {void}\n\t\t */\n\t\tmatchRowHeights() {\n\t\t\tconst container = this.$el && typeof this.$el.querySelectorAll === 'function' ? this.$el : null\n\t\t\tif (!container || this.matchingRowHeights) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst byId = new Map(this.layout.map((item) => [String(item.id), item]))\n\t\t\tconst cards = []\n\t\t\tfor (const cell of container.querySelectorAll('.grid-stack-item.cn-dashboard-grid__item--same-height')) {\n\t\t\t\tconst item = byId.get(String(cell.getAttribute('gs-id')))\n\t\t\t\tconst child = cell.querySelector('.grid-stack-item-content')?.firstElementChild\n\t\t\t\tif (item && child) {\n\t\t\t\t\tcards.push({ child, row: item.gridY ?? 0, fit: this.sizeToContentAttr(item) !== undefined })\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (cards.length === 0) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.matchingRowHeights = true\n\t\t\ttry {\n\t\t\t\tfor (const card of cards) {\n\t\t\t\t\tif (card.fit) {\n\t\t\t\t\t\tcard.child.style.minHeight = ''\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (this.editable || this.reflowed) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tconst heights = planSameHeights(cards.map((card) => ({ row: card.row, height: card.child.getBoundingClientRect().height })))\n\t\t\t\tcards.forEach((card, index) => {\n\t\t\t\t\tif (card.fit && heights[index] !== null) {\n\t\t\t\t\t\tcard.child.style.minHeight = `${heights[index]}px`\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t} finally {\n\t\t\t\tthis.matchingRowHeights = false\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Put every `clear` layout item below the cards of the earlier rows\n\t\t * (`planClearRows`), in one batch. Runs after the grid is built and after\n\t\t * each cell is measured to its content; a move made here that measures a\n\t\t * cell again does not start another round.\n\t\t *\n\t\t * @spec openspec/changes/dashboard-clear-row/specs/dashboard-grid/spec.md\n\t\t * @return {void}\n\t\t */\n\t\tplaceClearRows() {\n\t\t\tconst grid = this.grid ? toRaw(this.grid) : null\n\t\t\tif (this.placingClearRows || !grid || !grid.engine || !Array.isArray(grid.engine.nodes) || typeof grid.update !== 'function') {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst byId = new Map(this.layout.map((item) => [String(item.id), item]))\n\t\t\tconst nodes = grid.engine.nodes.map((n) => {\n\t\t\t\tconst item = byId.get(String(n.id))\n\t\t\t\treturn Object.assign(Object.create(null), { node: n, x: n.x, y: n.y, w: n.w, h: n.h, row: item ? this.scaledRow(item.gridY ?? 0) : 0, clear: !this.editable && item?.clear === true })\n\t\t\t})\n\t\t\tconst plan = planClearRows(nodes)\n\t\t\tif (plan.length === 0) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst batching = Boolean(grid.engine.batchMode)\n\t\t\tthis.placingClearRows = true\n\t\t\ttry {\n\t\t\t\tif (!batching && typeof grid.batchUpdate === 'function') {\n\t\t\t\t\tgrid.batchUpdate()\n\t\t\t\t}\n\t\t\t\tfor (const step of plan) {\n\t\t\t\t\tgrid.update(step.node.node.el, { y: step.y })\n\t\t\t\t}\n\t\t\t\tif (!batching && typeof grid.batchUpdate === 'function') {\n\t\t\t\t\tgrid.batchUpdate(false)\n\t\t\t\t}\n\t\t\t} finally {\n\t\t\t\tthis.placingClearRows = false\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * The rows a size-to-content cell needs for its content, measured the\n\t\t * way GridStack's `resizeToContent` measures it (the content's first\n\t\t * child, plus the cell's own padding), within its size-to-content row\n\t\t * maximum and its minimum and maximum height.\n\t\t *\n\t\t * @spec openspec/changes/dashboard-growth-keeps-order/specs/dashboard-grid/spec.md#requirement-a-growing-cell-keeps-the-order-of-the-cards-under-it\n\t\t * @param {HTMLElement} el The cell.\n\t\t * @param {object} node Its GridStack node.\n\t\t * @return {number|null} The rows, or null when it cannot be measured.\n\t\t */\n\t\tcontentRows(el, node) {\n\t\t\tconst cell = this.grid.getCellHeight(true)\n\t\t\tconst item = el.querySelector('.grid-stack-item-content')\n\t\t\tconst child = item && item.firstElementChild\n\t\t\tif (!el.clientHeight || !cell || !child || !Number.isFinite(node.h)) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tconst padding = el.clientHeight - item.clientHeight\n\t\t\tconst itemHeight = node.h * cell - padding\n\t\t\tconst wanted = child.getBoundingClientRect().height || itemHeight\n\t\t\tlet rows = Math.ceil((node.h * cell + wanted - itemHeight) / cell)\n\t\t\tif (Number.isInteger(node.sizeToContent) && rows > node.sizeToContent) {\n\t\t\t\trows = node.sizeToContent\n\t\t\t}\n\t\t\tif (node.minH && rows < node.minH) {\n\t\t\t\trows = node.minH\n\t\t\t} else if (node.maxH && rows > node.maxH) {\n\t\t\t\trows = node.maxH\n\t\t\t}\n\t\t\treturn rows\n\t\t},\n\n\t\t/**\n\t\t * Keep both editing lanes in step with whether an edit could actually be\n\t\t * kept: the pointer's handles, and — through `reflowed` feeding\n\t\t * `keyboardActive` — the tab stops, the help text and the arrow keys.\n\t\t *\n\t\t * A reflowed grid drops every `change` it receives, for the reason\n\t\t * `handleGridChange` gives. Leaving either lane live there offers an edit\n\t\t * that silently snaps back, which is the same class of surprise as\n\t\t * persisting the reflow — pointed the other way, and harder to explain\n\t\t * because the author did everything right. It is worse on the keyboard,\n\t\t * where the move is also announced as done. The affordance has to say what\n\t\t * the grid will do at this width, not what edit mode does at the authored\n\t\t * one.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tsyncInteractivity() {\n\t\t\t// Ahead of the engine guard: the keyboard lane reads this whether or\n\t\t\t// not the engine can be enabled.\n\t\t\tthis.reflowed = this.isReflowed()\n\t\t\tif (!this.grid || typeof this.grid.enable !== 'function') {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (this.editable && !this.reflowed) {\n\t\t\t\tthis.grid.enable()\n\t\t\t} else {\n\t\t\t\tthis.grid.disable()\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Whether the grid is currently rescaled to a column count other than the\n\t\t * authored one, i.e. a `columnOpts` breakpoint is in force.\n\t\t *\n\t\t * The authored count is `columnOpts.columnMax` when there is one, not the\n\t\t * `columns` prop: GridStack widens to `columnMax` above the top breakpoint,\n\t\t * so a consumer whose two disagree is at its widest, not reflowed.\n\t\t *\n\t\t * @return {boolean} True while a responsive reflow is active.\n\t\t */\n\t\tisReflowed() {\n\t\t\tif (!this.grid || typeof this.grid.getColumn !== 'function') {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tconst authored = Number.isFinite(this.columnOpts?.columnMax) ? this.columnOpts.columnMax : this.columns\n\t\t\tconst live = this.grid.getColumn()\n\t\t\treturn Number.isFinite(live) && live > 0 && live !== authored\n\t\t},\n\n\t\thandleGridChange(items) {\n\t\t\t// The rescale that crossed a breakpoint arrives here as a `change`, so\n\t\t\t// this is also where the handles are re-judged in both directions:\n\t\t\t// switched off as the grid narrows, and back on as it widens.\n\t\t\tthis.syncInteractivity()\n\n\t\t\tif (this.applyingLayout) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// GridStack fires `change` for its own responsive rescale too, and at a\n\t\t\t// 12 → 1 breakpoint every item reads `gridX: 0, gridWidth: 1`. Emitting\n\t\t\t// that has the host persist the reflow AS the authored layout, which\n\t\t\t// widening back does not undo. A move made while reflowed is the same\n\t\t\t// rescaled geometry, so it is dropped for the same reason.\n\t\t\tif (this.isReflowed()) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\t// A grid on split rows is a view-mode grid: what changes in it is\n\t\t\t// packing and size-to-content measuring, never a user's\n\t\t\t// arrangement, and it is not reported as one.\n\t\t\tif (this.rowSplit !== 1) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (!items || items.length === 0) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tconst updated = this.layout.map((item) => {\n\t\t\t\tconst gridItem = items.find((gi) => String(gi.id) === String(item.id))\n\t\t\t\tif (gridItem) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...item,\n\t\t\t\t\t\tgridX: gridItem.x,\n\t\t\t\t\t\tgridY: gridItem.y,\n\t\t\t\t\t\tgridWidth: gridItem.w,\n\t\t\t\t\t\tgridHeight: gridItem.h,\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn item\n\t\t\t})\n\n\t\t\tthis.$emit('layout-change', updated)\n\t\t},\n\n\t\t/**\n\t\t * Keydown handler bound to every grid item.\n\t\t *\n\t\t * Only reacts when the grid item element itself is the event target:\n\t\t * a button, input or menu rendered inside the `#widget` slot must keep\n\t\t * its own arrow/Enter semantics, and a grid that swallowed them would\n\t\t * be a worse a11y regression than the one this handler fixes.\n\t\t *\n\t\t * @param {KeyboardEvent} event the keydown event.\n\t\t * @param {object} item the layout item the key was pressed on.\n\t\t * @return {void}\n\t\t */\n\t\tonItemKeydown(event, item) {\n\t\t\tif (!this.keyboardRepositioning) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (event.target !== event.currentTarget) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (event.altKey || event.ctrlKey || event.metaKey) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tif (event.key === 'Enter' || event.key === ' ' || event.key === 'Spacebar') {\n\t\t\t\tevent.preventDefault()\n\t\t\t\tthis.activateItem(item, event.currentTarget)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// Repositioning only, and only where it can be kept — an item that\n\t\t\t// still holds focus from before a reflow keeps its Enter, but its\n\t\t\t// arrow keys stop moving something that would snap back.\n\t\t\tif (!this.keyboardActive) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tconst handled = this.applyKey(event.key, event.shiftKey, item)\n\t\t\tif (handled) {\n\t\t\t\t// Arrows would otherwise scroll the dashboard out from under\n\t\t\t\t// the widget the user is moving.\n\t\t\t\tevent.preventDefault()\n\t\t\t\tevent.stopPropagation()\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Translate one repositioning key into a geometry change.\n\t\t *\n\t\t * @param {string} key the `KeyboardEvent.key` value.\n\t\t * @param {boolean} shift whether Shift was held (resize instead of move).\n\t\t * @param {object} item the layout item being operated on.\n\t\t * @return {boolean} `true` when the key belongs to the grid and the\n\t\t * default action must be suppressed.\n\t\t */\n\t\tapplyKey(key, shift, item) {\n\t\t\tconst rect = this.currentRect(item)\n\n\t\t\tswitch (key) {\n\t\t\t\tcase 'ArrowLeft':\n\t\t\t\t\treturn shift\n\t\t\t\t\t\t? this.applyGeometry(item, { w: rect.w - 1 }, 'resize')\n\t\t\t\t\t\t: this.applyGeometry(item, { x: rect.x - 1 }, 'move')\n\t\t\t\tcase 'ArrowRight':\n\t\t\t\t\treturn shift\n\t\t\t\t\t\t? this.applyGeometry(item, { w: rect.w + 1 }, 'resize')\n\t\t\t\t\t\t: this.applyGeometry(item, { x: rect.x + 1 }, 'move')\n\t\t\t\tcase 'ArrowUp':\n\t\t\t\t\treturn shift\n\t\t\t\t\t\t? this.applyGeometry(item, { h: rect.h - 1 }, 'resize')\n\t\t\t\t\t\t: this.applyGeometry(item, { y: rect.y - 1 }, 'move')\n\t\t\t\tcase 'ArrowDown':\n\t\t\t\t\treturn shift\n\t\t\t\t\t\t? this.applyGeometry(item, { h: rect.h + 1 }, 'resize')\n\t\t\t\t\t\t: this.applyGeometry(item, { y: rect.y + 1 }, 'move')\n\t\t\t\tcase 'Home':\n\t\t\t\t\treturn this.applyGeometry(item, { x: 0 }, 'move')\n\t\t\t\tcase 'End':\n\t\t\t\t\treturn this.applyGeometry(item, { x: this.effectiveColumns - rect.w }, 'move')\n\t\t\t\tdefault:\n\t\t\t\t\treturn false\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Read an item's live rectangle. The GridStack node is preferred over\n\t\t * the `layout` prop because a drag that has not yet round-tripped\n\t\t * through the consumer's persistence leaves the prop momentarily stale,\n\t\t * and a keyboard nudge must continue from where the widget actually is.\n\t\t *\n\t\t * @param {object} item the layout item.\n\t\t * @return {{x: number, y: number, w: number, h: number}} the rectangle\n\t\t * in grid units.\n\t\t */\n\t\tcurrentRect(item) {\n\t\t\tconst node = this.gridNode(item.id)\n\t\t\tif (node && Number.isFinite(node.x) && Number.isFinite(node.y)) {\n\t\t\t\treturn {\n\t\t\t\t\tx: node.x,\n\t\t\t\t\ty: node.y,\n\t\t\t\t\tw: Number.isFinite(node.w) ? node.w : this.minWidth,\n\t\t\t\t\th: Number.isFinite(node.h) ? node.h : this.minHeight,\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tx: Number.isFinite(item.gridX) ? item.gridX : 0,\n\t\t\t\ty: Number.isFinite(item.gridY) ? item.gridY : 0,\n\t\t\t\tw: Number.isFinite(item.gridWidth) ? item.gridWidth : this.minWidth,\n\t\t\t\th: Number.isFinite(item.gridHeight) ? item.gridHeight : this.minHeight,\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Clamp a candidate rectangle to the grid's bounds and the configured\n\t\t * minimum widget size, so a held-down arrow key parks the widget at the\n\t\t * edge instead of pushing it into negative coordinates.\n\t\t *\n\t\t * @param {{x: number, y: number, w: number, h: number}} rect the candidate.\n\t\t * @return {{x: number, y: number, w: number, h: number}} the clamped rectangle.\n\t\t */\n\t\tclampRect(rect) {\n\t\t\tconst cols = this.effectiveColumns\n\t\t\tconst w = Math.min(Math.max(rect.w, this.minWidth), cols)\n\t\t\tconst h = Math.max(rect.h, this.minHeight)\n\t\t\treturn {\n\t\t\t\tx: Math.min(Math.max(rect.x, 0), Math.max(cols - w, 0)),\n\t\t\t\ty: Math.max(rect.y, 0),\n\t\t\t\tw,\n\t\t\t\th,\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Apply a partial geometry change to an item.\n\t\t *\n\t\t * The change is pushed through `GridStack.update()` — the very call the\n\t\t * drag/resize handlers end in — so collision resolution, the `change`\n\t\t * event and therefore the `layout-change` emission and the consumer's\n\t\t * persistence are identical for keyboard and pointer. There is\n\t\t * deliberately no second, direct-to-`layout` update path.\n\t\t *\n\t\t * @param {object} item the layout item to move or resize.\n\t\t * @param {{x?: number, y?: number, w?: number, h?: number}} patch the\n\t\t * requested change, merged over the item's current rectangle.\n\t\t * @param {'move'|'resize'} kind which announcement to speak.\n\t\t * @return {boolean} `true` when the key was consumed — including when\n\t\t * the widget was already at the edge, because the arrow still belongs\n\t\t * to the grid and must not scroll the page.\n\t\t */\n\t\tapplyGeometry(item, patch, kind) {\n\t\t\tconst el = this.itemElement(item.id)\n\t\t\tif (!el || !this.grid || typeof this.grid.update !== 'function') {\n\t\t\t\treturn false\n\t\t\t}\n\n\t\t\tconst current = this.currentRect(item)\n\t\t\tconst next = this.clampRect({ ...current, ...patch })\n\n\t\t\tif (next.x === current.x && next.y === current.y\n\t\t\t\t&& next.w === current.w && next.h === current.h) {\n\t\t\t\tthis.announce(t('nextcloud-vue', '{label} cannot move further in that direction', {\n\t\t\t\t\tlabel: this.announcementLabel(item),\n\t\t\t\t}))\n\t\t\t\treturn true\n\t\t\t}\n\n\t\t\tthis.grid.update(el, next)\n\n\t\t\tthis.announce(kind === 'resize'\n\t\t\t\t? t('nextcloud-vue', '{label} resized to {width} columns by {height} rows', {\n\t\t\t\t\t\tlabel: this.announcementLabel(item),\n\t\t\t\t\t\twidth: next.w,\n\t\t\t\t\t\theight: next.h,\n\t\t\t\t\t})\n\t\t\t\t: t('nextcloud-vue', '{label} moved to column {column}, row {row}', {\n\t\t\t\t\t\tlabel: this.announcementLabel(item),\n\t\t\t\t\t\tcolumn: next.x + 1,\n\t\t\t\t\t\trow: next.y + 1,\n\t\t\t\t\t}))\n\n\t\t\treturn true\n\t\t},\n\n\t\t/**\n\t\t * The short, coordinate-free name used inside live-region sentences —\n\t\t * the full `aria-label` already carries the coordinates and repeating\n\t\t * them would make every announcement unlistenable.\n\t\t *\n\t\t * @param {object} item the layout item.\n\t\t * @return {string} the short name.\n\t\t */\n\t\tannouncementLabel(item) {\n\t\t\treturn String(item.title\n\t\t\t\t|| item.name\n\t\t\t\t|| item.label\n\t\t\t\t|| item.widgetTitle\n\t\t\t\t|| item.widgetId\n\t\t\t\t|| t('nextcloud-vue', 'Widget'))\n\t\t},\n\n\t\t/**\n\t\t * Push text into the polite live region. The region is cleared first so\n\t\t * two identical consecutive announcements (e.g. two failed nudges at the\n\t\t * grid edge) are both spoken — assistive tech ignores a re-render that\n\t\t * leaves the text unchanged.\n\t\t *\n\t\t * @param {string} text the message to announce.\n\t\t * @return {void}\n\t\t */\n\t\tannounce(text) {\n\t\t\tthis.announcement = ''\n\t\t\tthis.$nextTick(() => {\n\t\t\t\tthis.announcement = text\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * Handle `Enter` / `Space` on a focused grid item: tell the consumer via\n\t\t * `item-activate`, and — unless opted out — synthesise the `contextmenu`\n\t\t * event a right-click would have produced, anchored to the item, so\n\t\t * pointer-only widget menus become keyboard-reachable without the\n\t\t * consumer wiring anything new. The synthetic event is dispatched from\n\t\t * inside the item's content so it bubbles through the slot's own root\n\t\t * element (where such handlers live) and on up.\n\t\t *\n\t\t * @param {object} item the layout item being activated.\n\t\t * @param {HTMLElement} el the grid item element.\n\t\t * @return {void}\n\t\t */\n\t\tactivateItem(item, el) {\n\t\t\tconst rect = typeof el.getBoundingClientRect === 'function'\n\t\t\t\t? el.getBoundingClientRect()\n\t\t\t\t: { left: 0, top: 0 }\n\t\t\tconst clientX = Math.round((rect.left || 0) + MENU_ANCHOR_OFFSET)\n\t\t\tconst clientY = Math.round((rect.top || 0) + MENU_ANCHOR_OFFSET)\n\n\t\t\tthis.$emit('item-activate', { item, element: el, clientX, clientY })\n\n\t\t\tif (this.activateOpensContextMenu) {\n\t\t\t\tthis.dispatchContextMenu(el, clientX, clientY)\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Dispatch a bubbling, cancelable `contextmenu` MouseEvent from inside a\n\t\t * grid item.\n\t\t *\n\t\t * @param {HTMLElement} el the grid item element.\n\t\t * @param {number} clientX viewport x for the menu anchor.\n\t\t * @param {number} clientY viewport y for the menu anchor.\n\t\t * @return {void}\n\t\t */\n\t\tdispatchContextMenu(el, clientX, clientY) {\n\t\t\tif (typeof MouseEvent !== 'function') {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst content = el.querySelector('.grid-stack-item-content')\n\t\t\tconst target = (content && content.firstElementChild) || content || el\n\t\t\ttarget.dispatchEvent(new MouseEvent('contextmenu', {\n\t\t\t\tbubbles: true,\n\t\t\t\tcancelable: true,\n\t\t\t\tclientX,\n\t\t\t\tclientY,\n\t\t\t\tbutton: 2,\n\t\t\t}))\n\t\t},\n\n\t\t/**\n\t\t * Look up a grid item's DOM element by its layout id.\n\t\t *\n\t\t * @param {string|number} id the layout item id.\n\t\t * @return {HTMLElement|null} the element, or `null` when not rendered.\n\t\t */\n\t\titemElement(id) {\n\t\t\tconst container = this.$refs.gridContainer\n\t\t\tif (!container) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\treturn container.querySelector(`[gs-id=\"${id}\"]`)\n\t\t},\n\n\t\t/**\n\t\t * Look up the GridStack engine node backing a layout item.\n\t\t *\n\t\t * @param {string|number} id the layout item id.\n\t\t * @return {object|null} the node, or `null` when GridStack isn't tracking it.\n\t\t */\n\t\t/**\n\t\t * Re-measure a `sizeToContent` item when its content changes height.\n\t\t * GridStack watches only the grid element, so a widget that loaded its data\n\t\t * in `mounted()` keeps the height its empty state had.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tobserveContentSizes() {\n\t\t\tthis.disconnectContentObserver()\n\t\t\tif (typeof ResizeObserver === 'undefined' || !this.$refs.gridContainer) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tthis.contentObserver = new ResizeObserver((entries) => {\n\t\t\t\tconst cells = new Set()\n\t\t\t\tfor (const entry of entries) {\n\t\t\t\t\tconst cell = entry.target.closest('.grid-stack-item')\n\t\t\t\t\tif (cell) {\n\t\t\t\t\t\tcells.add(cell)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (cells.size === 0) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\t// A frame later, not inline: `resizeToContent` resizes the cell the\n\t\t\t\t// observed child sits in, and a child that stretches to its parent\n\t\t\t\t// grows with it. Resizing from inside the callback makes that the\n\t\t\t\t// classic ResizeObserver loop (\"undelivered notifications\"); deferred,\n\t\t\t\t// it is an ordinary second pass that settles.\n\t\t\t\trequestAnimationFrame(() => {\n\t\t\t\t\tif (!this.contentObserver || !this.grid || typeof this.grid.resizeToContent !== 'function') {\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t\tfor (const cell of cells) {\n\t\t\t\t\t\tthis.grid.resizeToContent(cell)\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t})\n\n\t\t\tconst cells = this.$refs.gridContainer.querySelectorAll('.grid-stack-item[gs-size-to-content]')\n\t\t\tfor (const cell of cells) {\n\t\t\t\tconst measured = cell.querySelector('.grid-stack-item-content')?.firstElementChild\n\t\t\t\tif (measured) {\n\t\t\t\t\tthis.contentObserver.observe(measured)\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Drop the content observer, on unmount or before rebuilding it.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tdisconnectContentObserver() {\n\t\t\tif (this.contentObserver) {\n\t\t\t\tthis.contentObserver.disconnect()\n\t\t\t\tthis.contentObserver = null\n\t\t\t}\n\t\t},\n\n\t\tgridNode(id) {\n\t\t\tconst nodes = this.grid && this.grid.engine && this.grid.engine.nodes\n\t\t\tif (!Array.isArray(nodes)) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\treturn nodes.find((n) => String(n.id) === String(id)) || null\n\t\t},\n\n\t\t/**\n\t\t * Make the cards a layout change brings in GridStack widgets, in the\n\t\t * order given (row order), and size the size-to-content ones only once\n\t\t * all are placed, in the same order. GridStack sizes such a cell the\n\t\t * moment it is added, and a card added after it onto a cell that has\n\t\t * grown pushes that cell below itself: the in-call tile row on\n\t\t * PqWerkplekKlant ended under every column card.\n\t\t *\n\t\t * @spec openspec/changes/dashboard-layout-swap-keeps-order/specs/dashboard-grid/spec.md#requirement-cards-a-layout-change-adds-keep-their-authored-order\n\t\t * @param {Array<HTMLElement>} els The new cells, top to bottom.\n\t\t * @return {void}\n\t\t */\n\t\taddWidgetsInOrder(els) {\n\t\t\tif (els.length === 0) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst grid = toRaw(this.grid)\n\t\t\tconst queued = []\n\t\t\tthis.pendingSizes = queued\n\t\t\ttry {\n\t\t\t\tfor (const el of els) {\n\t\t\t\t\tgrid.makeWidget(el)\n\t\t\t\t}\n\t\t\t} finally {\n\t\t\t\tthis.pendingSizes = null\n\t\t\t}\n\t\t\tfor (const el of queued) {\n\t\t\t\tgrid.resizeToContent(el)\n\t\t\t}\n\t\t},\n\n\t\tsyncGridItems(newLayout) {\n\t\t\t// Add new items, and re-adopt items whose backing DOM element was\n\t\t\t// replaced. When a consumer's `itemKey` changes for an unchanged\n\t\t\t// `id` (e.g. a style edit — the documented use of `itemKey`), Vue\n\t\t\t// swaps the element. GridStack keeps tracking the old, now-detached\n\t\t\t// element, leaving the new one unmanaged (no positioning/sizing) —\n\t\t\t// so re-register it against the new element. New items are added\n\t\t\t// together, top to bottom (`addWidgetsInOrder`).\n\t\t\tthis.$nextTick(() => {\n\t\t\t\tif (!this.grid || !this.$refs.gridContainer) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tconst added = []\n\t\t\t\tfor (const item of this.itemsInRowOrder) {\n\t\t\t\t\tconst el = this.$refs.gridContainer.querySelector(`[gs-id=\"${item.id}\"]`)\n\t\t\t\t\tif (!el) {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tconst node = this.grid.engine.nodes.find((n) => String(n.id) === String(item.id))\n\t\t\t\t\tif (!node) {\n\t\t\t\t\t\tadded.push(el)\n\t\t\t\t\t} else if (node.el === el) {\n\t\t\t\t\t\t// The layout MOVED an item the grid already tracks: the\n\t\t\t\t\t\t// page re-compacts its display layout when a widget's\n\t\t\t\t\t\t// condition hides it, and the item below was given a new\n\t\t\t\t\t\t// gridY that never reached GridStack, so a band stayed\n\t\t\t\t\t\t// where the hidden widget had been. A drag reports the\n\t\t\t\t\t\t// grid's own position back, which matches and does\n\t\t\t\t\t\t// nothing here.\n\t\t\t\t\t\tconst x = item.gridX ?? node.x\n\t\t\t\t\t\tconst y = Number.isFinite(item.gridY) ? item.gridY * this.rowSplit : node.y\n\t\t\t\t\t\tif (x !== node.x || y !== node.y) {\n\t\t\t\t\t\t\t// The layout said where it goes; GridStack's `change`\n\t\t\t\t\t\t\t// for it is not a user's arrangement and is not\n\t\t\t\t\t\t\t// reported back (it would write the display-only\n\t\t\t\t\t\t\t// compaction into the authored layout).\n\t\t\t\t\t\t\tthis.applyingLayout = true\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tthis.grid.update(el, { x, y })\n\t\t\t\t\t\t\t} finally {\n\t\t\t\t\t\t\t\tthis.applyingLayout = false\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Drop the stale node without touching its detached DOM,\n\t\t\t\t\t\t// then adopt the new element so GridStack sizes/places it.\n\t\t\t\t\t\tthis.grid.removeWidget(node.el, false, false)\n\t\t\t\t\t\tthis.grid.makeWidget(el)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis.addWidgetsInOrder(added)\n\t\t\t})\n\n\t\t\t// Remove items no longer in layout\n\t\t\tconst ids = newLayout.map((i) => String(i.id))\n\t\t\tconst toRemove = this.grid.engine.nodes.filter((n) => !ids.includes(String(n.id)))\n\t\t\tfor (const node of toRemove) {\n\t\t\t\tconst el = this.$refs.gridContainer.querySelector(`[gs-id=\"${node.id}\"]`)\n\t\t\t\tif (el) {\n\t\t\t\t\tthis.grid.removeWidget(el, false)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Elements were added or replaced, so the observer's are stale.\n\t\t\tthis.$nextTick(() => this.observeContentSizes())\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-dashboard-grid {\n\twidth: 100%;\n\tmin-height: 200px;\n}\n\n.grid-stack {\n\tbackground: transparent;\n}\n\n/* `fillHeight`: the layout rows divide the grid's height (CSS grid instead of\n GridStack's absolute rows). GridStack may have left its inline places on the\n items, hence !important. Each cell scrolls what does not fit in it. */\n.cn-dashboard-grid--fill {\n\theight: 100%;\n\tmin-height: 0;\n}\n\n.cn-dashboard-grid--fill > .grid-stack {\n\tdisplay: grid;\n\theight: 100% !important;\n\tmin-height: 0 !important;\n}\n\n.cn-dashboard-grid--fill > .grid-stack > .grid-stack-item {\n\tposition: relative !important;\n\tinset: auto !important;\n\twidth: auto !important;\n\theight: auto !important;\n\tmin-width: 0;\n\tmin-height: 0;\n\tbox-sizing: border-box;\n\tpadding: var(--cn-fill-margin, 0);\n}\n\n.cn-dashboard-grid--fill > .grid-stack > .grid-stack-item > .grid-stack-item-content {\n\tposition: relative !important;\n\tinset: auto !important;\n\theight: 100%;\n\toverflow: hidden auto;\n}\n\n/* `sideColumn`: an item on a track has its left edge and width follow its\n column on two scales, the columns before `--cn-side-from` sharing what the side column\n leaves, the columns after it sharing the side column's fixed width (the\n card plus its two item margins). GridStack writes `--gs-x` and `--gs-w` on\n every item and its own left and width inline, hence !important. */\n.cn-dashboard-grid--side-column > .grid-stack.gs-12:not(.grid-stack-rtl) > .grid-stack-item[data-cn-track] {\n\t--cn-side-cell: calc(var(--cn-side-width) + var(--gs-item-margin-left, 0px) + var(--gs-item-margin-right, 0px));\n\t--cn-main-col: calc((100% - var(--cn-side-cell)) / var(--cn-side-from));\n\t--cn-side-col: calc(var(--cn-side-cell) / var(--cn-side-span));\n\t/* stylelint-disable-next-line csstools/use-logical -- GridStack places a left-to-right item by `left`. */\n\tleft: calc(min(var(--gs-x), var(--cn-side-from)) * var(--cn-main-col) + max(var(--gs-x) - var(--cn-side-from), 0) * var(--cn-side-col)) !important;\n\twidth: calc((min(var(--gs-x) + var(--gs-w), var(--cn-side-from)) - min(var(--gs-x), var(--cn-side-from))) * var(--cn-main-col) + (max(var(--gs-x) + var(--gs-w) - var(--cn-side-from), 0) - max(var(--gs-x) - var(--cn-side-from), 0)) * var(--cn-side-col)) !important;\n}\n\n/* `columnWeights`: an item's left edge and width follow the weighted columns\n it spans, as fractions of the grid. GridStack writes its own left and width\n inline, hence !important. */\n.cn-dashboard-grid--weighted > .grid-stack.gs-12:not(.grid-stack-rtl) > .grid-stack-item[data-cn-weighted] {\n\t/* stylelint-disable-next-line csstools/use-logical -- GridStack places a left-to-right item by `left`. */\n\tleft: calc(var(--cn-weight-left) * 100%) !important;\n\twidth: calc(var(--cn-weight-width) * 100%) !important;\n}\n\n/* Screen-reader-only text: the keyboard key map and the live region. Kept in\n the layout (not `display: none`) so assistive tech still reads it. */\n.cn-dashboard-grid__sr-only {\n\tposition: absolute;\n\twidth: 1px;\n\theight: 1px;\n\tpadding: 0;\n\tmargin: -1px;\n\toverflow: hidden;\n\tclip-path: inset(50%);\n\twhite-space: nowrap;\n\tborder: 0;\n}\n\n/* Grid items become tab stops in edit mode — give them a visible focus ring\n that satisfies WCAG 2.1 SC 2.4.7 without relying on the widget's own\n styling. `outline-offset` keeps the ring outside the rounded card. */\n.grid-stack-item:focus-visible {\n\toutline: 2px solid var(--color-primary-element, #0082c9);\n\toutline-offset: 2px;\n\tborder-radius: var(--border-radius-container-large, 16px);\n}\n\n/* A stretched `sameHeight` card keeps its content at the top, as the boards\n draw a row of cards, not centred in the extra height. `.grid-stack-item`\n outranks the dashboard page's centring of a fitted card, which is as\n strong and loads later (DqProcesanalyse stat tiles).\n @spec openspec/changes/same-height-fit-card-content-top/specs/dashboard-grid/spec.md#requirement-a-stretched-fitted-card-keeps-its-content-at-the-top */\n.cn-dashboard-grid__item--same-height.grid-stack-item > :deep(.grid-stack-item-content > * > .cn-widget-wrapper__content) {\n\tjustify-content: flex-start;\n}\n\n/* A size-to-content cell (`sizeToContent`) is measured by GridStack from the\n content's first child, and a widget wrapper there filled the cell\n (`height: 100%`), so the measure returned the cell's own height and the\n cell never shrank: \"Waiting for me\" stayed a tall card around one row. In\n such a cell the child takes its own height. A cell without the key keeps\n the filling child. */\n.cn-dashboard-grid__item--fit > :deep(.grid-stack-item-content > *) {\n\theight: auto;\n}\n\n:deep(.grid-stack-item-content) {\n\tbackground: var(--color-main-background);\n\tborder: none;\n\tbox-shadow: none;\n\toverflow: hidden;\n}\n\n:deep(.grid-stack-item-content:has(.cn-widget-wrapper--borderless)) {\n\tbackground: transparent;\n}\n\n:deep(.grid-stack-placeholder > .placeholder-content) {\n\tbackground: var(--color-primary-element-light);\n\tborder: 2px dashed var(--color-primary-element);\n\tborder-radius: var(--border-radius-large);\n}\n</style>\n"],"names":["_createElementBlock","_createElementVNode","_Fragment","_renderList","_normalizeClass","_normalizeStyle","_renderSlot"],"mappings":";;;;AAoEG,MAAA,UAAA,GAAA,EAAA,KAAA,EAAA,yBAAA,GAAA;;;;;;;;;uBAzCAA;AAAG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A;gBACtB,EAAE,IAAI,CAAC,SAAS;AACpB,UAAA,MAAI,EAAE,QAAA,CAAA,SAAA,CAAA,IAAA,CAAA,UAAA,CAAA;AACN,UAAA,UAAI,EAAA,MAAA,CAAA,QAAA;UACJ,UAAG,EAAA,QAAA,CAAA,OAAA,CAAA,IAAA,CAAA;UACH,oBAAE,EAAA,QAAA,CAAA,iBAAA,CAAA,IAAA,CAAA;;AAEF,UAAA,kBAAA,EAAA,QAAA,CAAA,WAAA,CAAA,IAAA,SAAA,SAAA;AACA,UAAA,mBAAiB,EAAE,IAAI,CAAC,QAAQ,IAAI,SAAS;AAC7C,UAAA,WAAS,EAAG,IAAG,CAAC,KAAK,KAAc,IAAA,IAAA,CAAA,MAAA,CAAA,QAAQ,YAAY,SAAI;UAC3D,KAAK,EAAAC,cAAA,CAAE,QAAS,CAAA,SAAA,KAAK,CAAA,CAAA;AACtB,UAAA,SAAA,EAAA,MAAA,KAAA,QAAA,CAAA,aAAA,CAAA,MAAA,EAAA,IAAA,CAAA,CAAA;;AACD,UAAAJ,kBAAA,CAIO,OAJP,UAIO,EAAA;YAHLK,UAEO,CAAA,IAAA,CAAA,MAAA,EAAA,QAAA,EAAA,EAFc,IAAI,EAAE,IAAI,EAAA,CAAA;;;;;;;;;;;"}
|
|
@@ -2,7 +2,7 @@ import script from './CnDeviceFramesWidget.vue2.js';
|
|
|
2
2
|
import { render } from './CnDeviceFramesWidget.vue3.js';
|
|
3
3
|
|
|
4
4
|
script.render = render;
|
|
5
|
-
script.__scopeId = "data-v-
|
|
5
|
+
script.__scopeId = "data-v-41a3b42e";
|
|
6
6
|
const __sfc_main = script;
|
|
7
7
|
|
|
8
8
|
export { __sfc_main as default };
|
|
@@ -3,6 +3,9 @@ import CloudCheckOutline from 'vue-material-design-icons/CloudCheckOutline.vue';
|
|
|
3
3
|
import CloudOffOutline from 'vue-material-design-icons/CloudOffOutline.vue';
|
|
4
4
|
import InformationOutline from 'vue-material-design-icons/InformationOutline.vue';
|
|
5
5
|
import __sfc_main from '../CnSectionsWidget/CnSectionsWidget.vue.js';
|
|
6
|
+
import { fetchReferenceObjects } from '../../utils/boardReferenceColumns.js';
|
|
7
|
+
import { readPath } from '../../utils/readPath.js';
|
|
8
|
+
import { resolveFilterTokens, hasUnresolvedTokens } from '../../utils/resolveFilterTokens.js';
|
|
6
9
|
|
|
7
10
|
/** Counter for unique heading ids across instances. */
|
|
8
11
|
let instanceCounter = 0;
|
|
@@ -49,12 +52,16 @@ var script = {
|
|
|
49
52
|
/**
|
|
50
53
|
* The widget configuration.
|
|
51
54
|
*
|
|
52
|
-
* - `frames` — `[{ key?, title, widgetIds? | sections?, status? }]`, in order. `widgetIds` names
|
|
55
|
+
* - `frames` — `[{ key?, title, titleFrom?, widgetIds? | sections?, status? }]`, in order. `widgetIds` names
|
|
53
56
|
* widgets of the surface, stacked; `sections` takes the `sections` widget's entries instead.
|
|
57
|
+
* `titleFrom: { source: { register, schema, filter, sort? }, field }` titles the frame by that field of the
|
|
58
|
+
* first matching record, read under the reader's rights; `title` stays while none matches.
|
|
54
59
|
* - `status` — the status line of every frame (a frame's own `status` wins): `{ text?, tone?,
|
|
55
60
|
* followConnection?, onlineText?, offlineText? }`. With `followConnection` the line reads
|
|
56
61
|
* `offlineText` while the device is offline and `onlineText` otherwise. `tone` is `warning`
|
|
57
|
-
* (default while offline), `success` or `info`.
|
|
62
|
+
* (default while offline), `success` or `info`. With `syncedFrom: { source: { register, schema,
|
|
63
|
+
* filter }, field }` the newest value of that date field is the last synchronisation, and while
|
|
64
|
+
* offline the line reads `offlineSyncedText` with `{time}` as its time (`offlineText` without one).
|
|
58
65
|
* - `width` — the frame width in pixels (default 350).
|
|
59
66
|
* - `height` — the frame height in pixels (at least 400); what does not fit scrolls inside it. Without it the frame grows with its content.
|
|
60
67
|
*
|
|
@@ -137,6 +144,8 @@ var script = {
|
|
|
137
144
|
return {
|
|
138
145
|
uid: instanceCounter,
|
|
139
146
|
online: typeof navigator === 'undefined' || navigator.onLine !== false,
|
|
147
|
+
readTitles: {},
|
|
148
|
+
syncedTime: '',
|
|
140
149
|
}
|
|
141
150
|
},
|
|
142
151
|
|
|
@@ -168,7 +177,7 @@ var script = {
|
|
|
168
177
|
: (Array.isArray(frame.widgetIds) ? frame.widgetIds : []).filter((id) => typeof id === 'string' && id !== '').map((widgetId) => ({ widgetId }));
|
|
169
178
|
return {
|
|
170
179
|
key: String(frame.key || `frame-${index}`).replace(/[^\w-]/g, '-'),
|
|
171
|
-
title: this.tr(frame.title || ''),
|
|
180
|
+
title: this.readTitles[index] || this.tr(frame.title || ''),
|
|
172
181
|
sections,
|
|
173
182
|
status: this.statusOf(frame.status || this.content?.status || null),
|
|
174
183
|
}
|
|
@@ -177,6 +186,7 @@ var script = {
|
|
|
177
186
|
},
|
|
178
187
|
|
|
179
188
|
mounted() {
|
|
189
|
+
this.readSources();
|
|
180
190
|
if (typeof window !== 'undefined') {
|
|
181
191
|
window.addEventListener('online', this.onConnection);
|
|
182
192
|
window.addEventListener('offline', this.onConnection);
|
|
@@ -216,13 +226,74 @@ var script = {
|
|
|
216
226
|
if (status.followConnection === true) {
|
|
217
227
|
text = this.online ? status.onlineText : status.offlineText;
|
|
218
228
|
tone = tone || (this.online ? 'success' : 'warning');
|
|
229
|
+
if (!this.online && this.syncedTime && typeof status.offlineSyncedText === 'string' && status.offlineSyncedText !== '') {
|
|
230
|
+
return this.statusLine(this.tr(status.offlineSyncedText).replace('{time}', this.syncedTime), tone)
|
|
231
|
+
}
|
|
219
232
|
}
|
|
220
233
|
if (typeof text !== 'string' || text === '') {
|
|
221
234
|
return null
|
|
222
235
|
}
|
|
236
|
+
return this.statusLine(this.tr(text), tone)
|
|
237
|
+
},
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* A status line of a text and a tone.
|
|
241
|
+
*
|
|
242
|
+
* @param {string} text The translated text.
|
|
243
|
+
* @param {string} tone The tone.
|
|
244
|
+
* @return {{text: string, tone: string, icon: object}}
|
|
245
|
+
*/
|
|
246
|
+
statusLine(text, tone) {
|
|
223
247
|
const known = ['warning', 'success', 'info'].includes(tone) ? tone : 'info';
|
|
224
248
|
const icon = known === 'warning' ? CloudOffOutline : (known === 'success' ? CloudCheckOutline : InformationOutline);
|
|
225
|
-
return { text
|
|
249
|
+
return { text, tone: known, icon: markRaw(icon) }
|
|
250
|
+
},
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* The first record of a `{ source: { register, schema, filter, sort? } }`, sorted by `sort` (or
|
|
254
|
+
* newest first by `orderBy`), under the reader's rights; null without one or while a token is unresolved.
|
|
255
|
+
*
|
|
256
|
+
* @param {object} spec The source spec.
|
|
257
|
+
* @param {string} [orderBy] A field to sort on, newest first, when the source names no sort.
|
|
258
|
+
* @return {Promise<object|null>}
|
|
259
|
+
*/
|
|
260
|
+
async firstOf(spec, orderBy = '') {
|
|
261
|
+
const source = spec?.source;
|
|
262
|
+
if (!source || typeof source !== 'object' || !source.register || !source.schema) {
|
|
263
|
+
return null
|
|
264
|
+
}
|
|
265
|
+
const filter = resolveFilterTokens(source.filter || {}, { objectId: this.objectId || null, object: this.objectData });
|
|
266
|
+
if (hasUnresolvedTokens(filter)) {
|
|
267
|
+
return null
|
|
268
|
+
}
|
|
269
|
+
const sort = source.sort?.field ? { [`_order[${source.sort.field}]`]: source.sort.dir === 'asc' ? 'asc' : 'desc' } : (orderBy ? { [`_order[${orderBy}]`]: 'desc' } : {});
|
|
270
|
+
try {
|
|
271
|
+
const rows = await fetchReferenceObjects({ register: source.register, schema: source.schema, filter: { ...filter, ...sort }, limit: 1 });
|
|
272
|
+
return Array.isArray(rows) && rows.length > 0 ? rows[0] : null
|
|
273
|
+
} catch {
|
|
274
|
+
return null
|
|
275
|
+
}
|
|
276
|
+
},
|
|
277
|
+
|
|
278
|
+
/** Read the frame titles (`titleFrom`) and the last synchronisation (`status.syncedFrom`). */
|
|
279
|
+
async readSources() {
|
|
280
|
+
const list = Array.isArray(this.content?.frames) ? this.content.frames.filter((frame) => frame && typeof frame === 'object') : [];
|
|
281
|
+
const titles = {};
|
|
282
|
+
await Promise.all(list.map(async (frame, index) => {
|
|
283
|
+
if (!frame.titleFrom?.field) {
|
|
284
|
+
return
|
|
285
|
+
}
|
|
286
|
+
const value = readPath(await this.firstOf(frame.titleFrom), frame.titleFrom.field);
|
|
287
|
+
if (typeof value === 'string' && value !== '') {
|
|
288
|
+
titles[index] = value;
|
|
289
|
+
}
|
|
290
|
+
}));
|
|
291
|
+
this.readTitles = titles;
|
|
292
|
+
const synced = this.content?.status?.syncedFrom;
|
|
293
|
+
if (synced?.field) {
|
|
294
|
+
const at = new Date(readPath(await this.firstOf(synced, synced.field), synced.field) ?? '');
|
|
295
|
+
this.syncedTime = Number.isNaN(at.getTime()) ? '' : `${String(at.getHours()).padStart(2, '0')}:${String(at.getMinutes()).padStart(2, '0')}`;
|
|
296
|
+
}
|
|
226
297
|
},
|
|
227
298
|
|
|
228
299
|
/** Follow the browser's connection state. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CnDeviceFramesWidget.vue2.js","sources":["../../../../src/components/CnDeviceFramesWidget/CnDeviceFramesWidget.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-device-frames-widget\" data-testid=\"cn-device-frames-widget\">\n\t\t<section\n\t\t\tv-for=\"frame in frames\"\n\t\t\t:key=\"frame.key\"\n\t\t\tclass=\"cn-device-frames-widget__frame\"\n\t\t\t:style=\"frameStyle\"\n\t\t\t:aria-labelledby=\"headingId(frame.key)\"\n\t\t\t:data-testid=\"`cn-device-frame-${frame.key}`\">\n\t\t\t<header class=\"cn-device-frames-widget__head\">\n\t\t\t\t<span\n\t\t\t\t\tv-if=\"frame.status\"\n\t\t\t\t\tclass=\"cn-device-frames-widget__status\"\n\t\t\t\t\t:class=\"`cn-device-frames-widget__status--${frame.status.tone}`\"\n\t\t\t\t\tdata-testid=\"cn-device-frame-status\">\n\t\t\t\t\t<component :is=\"frame.status.icon\" :size=\"16\" aria-hidden=\"true\" />\n\t\t\t\t\t{{ frame.status.text }}\n\t\t\t\t</span>\n\t\t\t\t<h3 :id=\"headingId(frame.key)\" class=\"cn-device-frames-widget__title\">\n\t\t\t\t\t{{ frame.title }}\n\t\t\t\t</h3>\n\t\t\t</header>\n\t\t\t<div class=\"cn-device-frames-widget__body\">\n\t\t\t\t<CnSectionsWidget\n\t\t\t\t\t:content=\"{ sections: frame.sections, cards: false, dividers: false, gap: 12, hideEmpty: true }\"\n\t\t\t\t\t:availableWidgets=\"availableWidgets\"\n\t\t\t\t\t:objectId=\"objectId\"\n\t\t\t\t\t:objectData=\"objectData\"\n\t\t\t\t\t:objectType=\"objectType\"\n\t\t\t\t\t:schemaObject=\"schemaObject\"\n\t\t\t\t\t:register=\"register\"\n\t\t\t\t\t:schema=\"schema\"\n\t\t\t\t\t:store=\"store\"\n\t\t\t\t\t:surface=\"surface\"\n\t\t\t\t\t:integrationContext=\"integrationContext\"\n\t\t\t\t\t:cnRegistry=\"cnRegistry\" />\n\t\t\t</div>\n\t\t</section>\n\t</div>\n</template>\n\n<script>\nimport { markRaw } from 'vue'\nimport CloudCheckOutline from 'vue-material-design-icons/CloudCheckOutline.vue'\nimport CloudOffOutline from 'vue-material-design-icons/CloudOffOutline.vue'\nimport InformationOutline from 'vue-material-design-icons/InformationOutline.vue'\nimport CnSectionsWidget from '../CnSectionsWidget/CnSectionsWidget.vue'\n\n/** Counter for unique heading ids across instances. */\nlet instanceCounter = 0\n\n/**\n * CnDeviceFramesWidget - the `device-frames` widget: several small pages side\n * by side, each in a phone frame with its own header (board DqInspectie,\n * \"Inspectie in het veld\": the day offline, a checklist question with a\n * photo, and the sync queue).\n *\n * Each frame stacks widgets of the surface as plain sections, 12px apart\n * without a rule, under a header with the frame's title and an optional\n * status line. The status can follow the connection (\"Offline · synced at\n * 07:42\" while the device is offline). The frames wrap onto the next row\n * when the page is narrower, and a frame takes the full width on a phone.\n *\n * ```json\n * {\n * \"type\": \"device-frames\",\n * \"content\": {\n * \"width\": 350,\n * \"status\": { \"followConnection\": true, \"offlineText\": \"Offline · synced at 07:42\", \"onlineText\": \"Online\" },\n * \"frames\": [\n * { \"key\": \"today\", \"title\": \"Today\", \"widgetIds\": [\"today-runs\", \"offline-note\"] },\n * { \"key\": \"question\", \"title\": \"Kerkplein 7\", \"widgetIds\": [\"checklist-run\"] },\n * { \"key\": \"sync\", \"title\": \"Synchronise\", \"widgetIds\": [\"sync-queue\"] }\n * ]\n * }\n * }\n * ```\n *\n * @spec openspec/changes/device-frames-widget/specs/device-frames-widget/spec.md#requirement-a-page-can-show-several-small-pages-as-phone-frames\n */\nexport default {\n\tname: 'CnDeviceFramesWidget',\n\n\tcomponents: { CnSectionsWidget },\n\n\tinject: {\n\t\tcnTranslate: { default: () => (key) => key },\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * The widget configuration.\n\t\t *\n\t\t * - `frames` — `[{ key?, title, widgetIds? | sections?, status? }]`, in order. `widgetIds` names\n\t\t * widgets of the surface, stacked; `sections` takes the `sections` widget's entries instead.\n\t\t * - `status` — the status line of every frame (a frame's own `status` wins): `{ text?, tone?,\n\t\t * followConnection?, onlineText?, offlineText? }`. With `followConnection` the line reads\n\t\t * `offlineText` while the device is offline and `onlineText` otherwise. `tone` is `warning`\n\t\t * (default while offline), `success` or `info`.\n\t\t * - `width` — the frame width in pixels (default 350).\n\t\t * - `height` — the frame height in pixels (at least 400); what does not fit scrolls inside it. Without it the frame grows with its content.\n\t\t *\n\t\t * @type {{frames?: Array<object>, status?: object, width?: number}}\n\t\t */\n\t\tcontent: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({}),\n\t\t},\n\n\t\t/** Sibling widget definitions on the surface, for `widgetIds`. */\n\t\tavailableWidgets: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t\t/** The bound record's id, forwarded to the children. */\n\t\tobjectId: {\n\t\t\ttype: [String, Number],\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The loaded record, forwarded to the children. */\n\t\tobjectData: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** The resolved object-type slug. */\n\t\tobjectType: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The resolved JSON Schema object. */\n\t\tschemaObject: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** OpenRegister register slug of the surface. */\n\t\tregister: {\n\t\t\ttype: [String, Object],\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** OpenRegister schema slug of the surface. */\n\t\tschema: {\n\t\t\ttype: [String, Object],\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The effective object store. */\n\t\tstore: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** Rendering surface forwarded to the children. */\n\t\tsurface: {\n\t\t\ttype: String,\n\t\t\tdefault: 'app-dashboard',\n\t\t},\n\n\t\t/** Object context forwarded to integration children. */\n\t\tintegrationContext: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** The consumer's component registry, for custom child widget types. */\n\t\tcnRegistry: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({}),\n\t\t},\n\t},\n\n\tdata() {\n\t\tinstanceCounter += 1\n\t\treturn {\n\t\t\tuid: instanceCounter,\n\t\t\tonline: typeof navigator === 'undefined' || navigator.onLine !== false,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/** @return {object} The frame width. */\n\t\tframeStyle() {\n\t\t\tconst width = Number(this.content?.width)\n\t\t\tconst height = Number(this.content?.height)\n\t\t\tconst style = { '--cn-device-frame-width': `${Number.isFinite(width) && width >= 240 ? width : 350}px` }\n\t\t\tif (Number.isFinite(height) && height >= 400) {\n\t\t\t\tstyle['--cn-device-frame-height'] = `${height}px`\n\t\t\t}\n\t\t\treturn style\n\t\t},\n\n\t\t/**\n\t\t * The frames to draw: a key, a translated title, the sections and the\n\t\t * status line.\n\t\t *\n\t\t * @return {Array<{key: string, title: string, sections: Array<object>, status: object|null}>}\n\t\t */\n\t\tframes() {\n\t\t\tconst list = Array.isArray(this.content?.frames) ? this.content.frames : []\n\t\t\treturn list\n\t\t\t\t.filter((frame) => frame && typeof frame === 'object')\n\t\t\t\t.map((frame, index) => {\n\t\t\t\t\tconst sections = Array.isArray(frame.sections)\n\t\t\t\t\t\t? frame.sections\n\t\t\t\t\t\t: (Array.isArray(frame.widgetIds) ? frame.widgetIds : []).filter((id) => typeof id === 'string' && id !== '').map((widgetId) => ({ widgetId }))\n\t\t\t\t\treturn {\n\t\t\t\t\t\tkey: String(frame.key || `frame-${index}`).replace(/[^\\w-]/g, '-'),\n\t\t\t\t\t\ttitle: this.tr(frame.title || ''),\n\t\t\t\t\t\tsections,\n\t\t\t\t\t\tstatus: this.statusOf(frame.status || this.content?.status || null),\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t},\n\t},\n\n\tmounted() {\n\t\tif (typeof window !== 'undefined') {\n\t\t\twindow.addEventListener('online', this.onConnection)\n\t\t\twindow.addEventListener('offline', this.onConnection)\n\t\t}\n\t},\n\n\tbeforeUnmount() {\n\t\tif (typeof window !== 'undefined') {\n\t\t\twindow.removeEventListener('online', this.onConnection)\n\t\t\twindow.removeEventListener('offline', this.onConnection)\n\t\t}\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Translate through the app's translate.\n\t\t *\n\t\t * @param {string} key The source string.\n\t\t * @return {string}\n\t\t */\n\t\ttr(key) {\n\t\t\treturn key && typeof this.cnTranslate === 'function' ? this.cnTranslate(key) : (key || '')\n\t\t},\n\n\t\t/**\n\t\t * The status line of a frame, or null.\n\t\t *\n\t\t * @param {object|null} status The configured status.\n\t\t * @return {{text: string, tone: string, icon: object}|null}\n\t\t */\n\t\tstatusOf(status) {\n\t\t\tif (!status || typeof status !== 'object') {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tlet text = status.text\n\t\t\tlet tone = status.tone\n\t\t\tif (status.followConnection === true) {\n\t\t\t\ttext = this.online ? status.onlineText : status.offlineText\n\t\t\t\ttone = tone || (this.online ? 'success' : 'warning')\n\t\t\t}\n\t\t\tif (typeof text !== 'string' || text === '') {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tconst known = ['warning', 'success', 'info'].includes(tone) ? tone : 'info'\n\t\t\tconst icon = known === 'warning' ? CloudOffOutline : (known === 'success' ? CloudCheckOutline : InformationOutline)\n\t\t\treturn { text: this.tr(text), tone: known, icon: markRaw(icon) }\n\t\t},\n\n\t\t/** Follow the browser's connection state. */\n\t\tonConnection() {\n\t\t\tthis.online = typeof navigator === 'undefined' || navigator.onLine !== false\n\t\t},\n\n\t\t/**\n\t\t * The id of a frame's heading.\n\t\t *\n\t\t * @param {string} key The frame key.\n\t\t * @return {string}\n\t\t */\n\t\theadingId(key) {\n\t\t\treturn `cn-device-frame-${this.uid}-${key}`\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-device-frames-widget {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\talign-items: flex-start;\n\tgap: 20px;\n}\n\n.cn-device-frames-widget__frame {\n\tdisplay: flex;\n\tflex: none;\n\tflex-direction: column;\n\twidth: var(--cn-device-frame-width, 350px);\n\tmax-width: 100%;\n\tmin-height: 600px;\n\theight: var(--cn-device-frame-height, auto);\n\tbox-sizing: border-box;\n\toverflow: hidden;\n\tborder: 10px solid var(--color-main-text);\n\tborder-radius: 36px;\n\tbackground: var(--color-background-hover);\n}\n\n.cn-device-frames-widget__head {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 6px;\n\tpadding: 14px 18px 10px;\n\tborder-bottom: 1px solid var(--color-border);\n\tbackground: var(--color-main-background);\n}\n\n.cn-device-frames-widget__status {\n\tdisplay: inline-flex;\n\talign-items: center;\n\tgap: 6px;\n\tfont-size: 13px;\n\tfont-weight: 600;\n\tline-height: normal;\n}\n\n.cn-device-frames-widget__status--warning {\n\tcolor: var(--color-warning-text, var(--color-main-text));\n}\n\n.cn-device-frames-widget__status--success {\n\tcolor: var(--color-success-text, var(--color-main-text));\n}\n\n.cn-device-frames-widget__status--info {\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-device-frames-widget__title {\n\tmargin: 0;\n\tfont-size: 20px;\n\tfont-weight: 700;\n\tline-height: 1.2;\n}\n\n.cn-device-frames-widget__body {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 12px;\n\tpadding: 14px;\n}\n\n/* `height` (DqInspectie: 700) makes every frame a phone of that height;\n what does not fit scrolls inside the screen. */\n.cn-device-frames-widget__frame[style*='--cn-device-frame-height'] .cn-device-frames-widget__body {\n\tflex: 1 1 auto;\n\tmin-height: 0;\n\toverflow-y: auto;\n}\n\n/* On a phone the frame is the screen: no bezel, the full width. */\n@media (max-width: 640px) {\n\t.cn-device-frames-widget__frame {\n\t\twidth: 100%;\n\t\tmin-height: 0;\n\t\tborder-width: 0;\n\t\tborder-radius: var(--cn-board-card-radius, 12px);\n\t}\n}\n</style>\n"],"names":["CnSectionsWidget"],"mappings":";;;;;;AAqDA;AACA,IAAI,kBAAkB,EAAA;;AAEtB;AACC;;;;AAIA;;;;;;AAMA;AACA;;;;;;;AAOA;AACA;AACA;;;;AAIA;AACA;AACA;;AAED,aAAe;CACd,IAAI,EAAE,sBAAsB;;CAE5B,UAAU,EAAE,oBAAEA,UAAe,EAAG;;AAEhC,CAAA,MAAM,EAAE;AACP,EAAA,WAAW,EAAE,EAAE,OAAO,EAAE,MAAM,CAAC,GAAG,KAAK,KAAK;EAC5C;;AAED,CAAA,KAAK,EAAE;AACN;;AAEC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;AAGD,EAAA,OAAO,EAAE;GACR,IAAI,EAAE,MAAM;AACZ,GAAA,OAAO,EAAE,OAAO,EAAE,CAAC;GACnB;;;AAGD,EAAA,gBAAgB,EAAE;GACjB,I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,KAAG;AACrB,GAAA,IAAI,OAAO,MAAM,CAAC,KAAG;AACrB,GAAA,IAAI,MAAM,CAAC,gBAAe,KAAM,IAAI,EAAE;IACrC,IAAK,GAAE,IAAI,CAAC,MAAO,GAAE,MAAM,CAAC,UAAW,GAAE,MAAM,CAAC,YAAU;AAC1D,IAAA,IAAG,GAAI,IAAK,KAAI,IAAI,CAAC,MAAK,GAAI,YAAY,SAAS,EAAA;AACpD,IAAA;AACA,GAAA,IAAI,OAAO,IAAG,KAAM,QAAO,IAAK,SAAS,EAAE,EAAE;AAC5C,IAAA,OAAO,IAAG;AACX,IAAA;AACA,GAAA,MAAM,KAAM,GAAE,CAAC,SAAS,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAE,GAAE,IAAG,GAAI,OAAK;GAC1E,MAAM,OAAO,UAAU,SAAQ,GAAI,mBAAmB,UAAU,YAAY,iBAAgB,GAAI,kBAAkB,EAAA;GAClH,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,CAAE,EAAA;GAC/D;;AAED;AACA,EAAA,YAAY,GAAG;AACd,GAAA,IAAI,CAAC,MAAK,GAAI,OAAO,SAAU,KAAI,WAAU,IAAK,SAAS,CAAC,MAAO,KAAI,MAAI;GAC3E;;AAED;;AAEC;;AAEA;;AAED,EAAA,SAAS,CAAC,GAAG,EAAE;AACd,GAAA,OAAO,CAAC,gBAAgB,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,CAAA;GAC1C;EACD;AACF;;;;"}
|
|
1
|
+
{"version":3,"file":"CnDeviceFramesWidget.vue2.js","sources":["../../../../src/components/CnDeviceFramesWidget/CnDeviceFramesWidget.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-device-frames-widget\" data-testid=\"cn-device-frames-widget\">\n\t\t<section\n\t\t\tv-for=\"frame in frames\"\n\t\t\t:key=\"frame.key\"\n\t\t\tclass=\"cn-device-frames-widget__frame\"\n\t\t\t:style=\"frameStyle\"\n\t\t\t:aria-labelledby=\"headingId(frame.key)\"\n\t\t\t:data-testid=\"`cn-device-frame-${frame.key}`\">\n\t\t\t<header class=\"cn-device-frames-widget__head\">\n\t\t\t\t<span\n\t\t\t\t\tv-if=\"frame.status\"\n\t\t\t\t\tclass=\"cn-device-frames-widget__status\"\n\t\t\t\t\t:class=\"`cn-device-frames-widget__status--${frame.status.tone}`\"\n\t\t\t\t\tdata-testid=\"cn-device-frame-status\">\n\t\t\t\t\t<component :is=\"frame.status.icon\" :size=\"16\" aria-hidden=\"true\" />\n\t\t\t\t\t{{ frame.status.text }}\n\t\t\t\t</span>\n\t\t\t\t<h3 :id=\"headingId(frame.key)\" class=\"cn-device-frames-widget__title\">\n\t\t\t\t\t{{ frame.title }}\n\t\t\t\t</h3>\n\t\t\t</header>\n\t\t\t<div class=\"cn-device-frames-widget__body\">\n\t\t\t\t<CnSectionsWidget\n\t\t\t\t\t:content=\"{ sections: frame.sections, cards: false, dividers: false, gap: 12, hideEmpty: true }\"\n\t\t\t\t\t:availableWidgets=\"availableWidgets\"\n\t\t\t\t\t:objectId=\"objectId\"\n\t\t\t\t\t:objectData=\"objectData\"\n\t\t\t\t\t:objectType=\"objectType\"\n\t\t\t\t\t:schemaObject=\"schemaObject\"\n\t\t\t\t\t:register=\"register\"\n\t\t\t\t\t:schema=\"schema\"\n\t\t\t\t\t:store=\"store\"\n\t\t\t\t\t:surface=\"surface\"\n\t\t\t\t\t:integrationContext=\"integrationContext\"\n\t\t\t\t\t:cnRegistry=\"cnRegistry\" />\n\t\t\t</div>\n\t\t</section>\n\t</div>\n</template>\n\n<script>\nimport { markRaw } from 'vue'\nimport CloudCheckOutline from 'vue-material-design-icons/CloudCheckOutline.vue'\nimport CloudOffOutline from 'vue-material-design-icons/CloudOffOutline.vue'\nimport InformationOutline from 'vue-material-design-icons/InformationOutline.vue'\nimport CnSectionsWidget from '../CnSectionsWidget/CnSectionsWidget.vue'\nimport { fetchReferenceObjects } from '../../utils/boardReferenceColumns.js'\nimport { readPath } from '../../utils/readPath.js'\nimport { hasUnresolvedTokens, resolveFilterTokens } from '../../utils/resolveFilterTokens.js'\n\n/** Counter for unique heading ids across instances. */\nlet instanceCounter = 0\n\n/**\n * CnDeviceFramesWidget - the `device-frames` widget: several small pages side\n * by side, each in a phone frame with its own header (board DqInspectie,\n * \"Inspectie in het veld\": the day offline, a checklist question with a\n * photo, and the sync queue).\n *\n * Each frame stacks widgets of the surface as plain sections, 12px apart\n * without a rule, under a header with the frame's title and an optional\n * status line. The status can follow the connection (\"Offline · synced at\n * 07:42\" while the device is offline). The frames wrap onto the next row\n * when the page is narrower, and a frame takes the full width on a phone.\n *\n * ```json\n * {\n * \"type\": \"device-frames\",\n * \"content\": {\n * \"width\": 350,\n * \"status\": { \"followConnection\": true, \"offlineText\": \"Offline · synced at 07:42\", \"onlineText\": \"Online\" },\n * \"frames\": [\n * { \"key\": \"today\", \"title\": \"Today\", \"widgetIds\": [\"today-runs\", \"offline-note\"] },\n * { \"key\": \"question\", \"title\": \"Kerkplein 7\", \"widgetIds\": [\"checklist-run\"] },\n * { \"key\": \"sync\", \"title\": \"Synchronise\", \"widgetIds\": [\"sync-queue\"] }\n * ]\n * }\n * }\n * ```\n *\n * @spec openspec/changes/device-frames-widget/specs/device-frames-widget/spec.md#requirement-a-page-can-show-several-small-pages-as-phone-frames\n */\nexport default {\n\tname: 'CnDeviceFramesWidget',\n\n\tcomponents: { CnSectionsWidget },\n\n\tinject: {\n\t\tcnTranslate: { default: () => (key) => key },\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * The widget configuration.\n\t\t *\n\t\t * - `frames` — `[{ key?, title, titleFrom?, widgetIds? | sections?, status? }]`, in order. `widgetIds` names\n\t\t * widgets of the surface, stacked; `sections` takes the `sections` widget's entries instead.\n\t\t * `titleFrom: { source: { register, schema, filter, sort? }, field }` titles the frame by that field of the\n\t\t * first matching record, read under the reader's rights; `title` stays while none matches.\n\t\t * - `status` — the status line of every frame (a frame's own `status` wins): `{ text?, tone?,\n\t\t * followConnection?, onlineText?, offlineText? }`. With `followConnection` the line reads\n\t\t * `offlineText` while the device is offline and `onlineText` otherwise. `tone` is `warning`\n\t\t * (default while offline), `success` or `info`. With `syncedFrom: { source: { register, schema,\n\t\t * filter }, field }` the newest value of that date field is the last synchronisation, and while\n\t\t * offline the line reads `offlineSyncedText` with `{time}` as its time (`offlineText` without one).\n\t\t * - `width` — the frame width in pixels (default 350).\n\t\t * - `height` — the frame height in pixels (at least 400); what does not fit scrolls inside it. Without it the frame grows with its content.\n\t\t *\n\t\t * @type {{frames?: Array<object>, status?: object, width?: number}}\n\t\t */\n\t\tcontent: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({}),\n\t\t},\n\n\t\t/** Sibling widget definitions on the surface, for `widgetIds`. */\n\t\tavailableWidgets: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t\t/** The bound record's id, forwarded to the children. */\n\t\tobjectId: {\n\t\t\ttype: [String, Number],\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The loaded record, forwarded to the children. */\n\t\tobjectData: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** The resolved object-type slug. */\n\t\tobjectType: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The resolved JSON Schema object. */\n\t\tschemaObject: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** OpenRegister register slug of the surface. */\n\t\tregister: {\n\t\t\ttype: [String, Object],\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** OpenRegister schema slug of the surface. */\n\t\tschema: {\n\t\t\ttype: [String, Object],\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The effective object store. */\n\t\tstore: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** Rendering surface forwarded to the children. */\n\t\tsurface: {\n\t\t\ttype: String,\n\t\t\tdefault: 'app-dashboard',\n\t\t},\n\n\t\t/** Object context forwarded to integration children. */\n\t\tintegrationContext: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** The consumer's component registry, for custom child widget types. */\n\t\tcnRegistry: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({}),\n\t\t},\n\t},\n\n\tdata() {\n\t\tinstanceCounter += 1\n\t\treturn {\n\t\t\tuid: instanceCounter,\n\t\t\tonline: typeof navigator === 'undefined' || navigator.onLine !== false,\n\t\t\treadTitles: {},\n\t\t\tsyncedTime: '',\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/** @return {object} The frame width. */\n\t\tframeStyle() {\n\t\t\tconst width = Number(this.content?.width)\n\t\t\tconst height = Number(this.content?.height)\n\t\t\tconst style = { '--cn-device-frame-width': `${Number.isFinite(width) && width >= 240 ? width : 350}px` }\n\t\t\tif (Number.isFinite(height) && height >= 400) {\n\t\t\t\tstyle['--cn-device-frame-height'] = `${height}px`\n\t\t\t}\n\t\t\treturn style\n\t\t},\n\n\t\t/**\n\t\t * The frames to draw: a key, a translated title, the sections and the\n\t\t * status line.\n\t\t *\n\t\t * @return {Array<{key: string, title: string, sections: Array<object>, status: object|null}>}\n\t\t */\n\t\tframes() {\n\t\t\tconst list = Array.isArray(this.content?.frames) ? this.content.frames : []\n\t\t\treturn list\n\t\t\t\t.filter((frame) => frame && typeof frame === 'object')\n\t\t\t\t.map((frame, index) => {\n\t\t\t\t\tconst sections = Array.isArray(frame.sections)\n\t\t\t\t\t\t? frame.sections\n\t\t\t\t\t\t: (Array.isArray(frame.widgetIds) ? frame.widgetIds : []).filter((id) => typeof id === 'string' && id !== '').map((widgetId) => ({ widgetId }))\n\t\t\t\t\treturn {\n\t\t\t\t\t\tkey: String(frame.key || `frame-${index}`).replace(/[^\\w-]/g, '-'),\n\t\t\t\t\t\ttitle: this.readTitles[index] || this.tr(frame.title || ''),\n\t\t\t\t\t\tsections,\n\t\t\t\t\t\tstatus: this.statusOf(frame.status || this.content?.status || null),\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t},\n\t},\n\n\tmounted() {\n\t\tthis.readSources()\n\t\tif (typeof window !== 'undefined') {\n\t\t\twindow.addEventListener('online', this.onConnection)\n\t\t\twindow.addEventListener('offline', this.onConnection)\n\t\t}\n\t},\n\n\tbeforeUnmount() {\n\t\tif (typeof window !== 'undefined') {\n\t\t\twindow.removeEventListener('online', this.onConnection)\n\t\t\twindow.removeEventListener('offline', this.onConnection)\n\t\t}\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Translate through the app's translate.\n\t\t *\n\t\t * @param {string} key The source string.\n\t\t * @return {string}\n\t\t */\n\t\ttr(key) {\n\t\t\treturn key && typeof this.cnTranslate === 'function' ? this.cnTranslate(key) : (key || '')\n\t\t},\n\n\t\t/**\n\t\t * The status line of a frame, or null.\n\t\t *\n\t\t * @param {object|null} status The configured status.\n\t\t * @return {{text: string, tone: string, icon: object}|null}\n\t\t */\n\t\tstatusOf(status) {\n\t\t\tif (!status || typeof status !== 'object') {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tlet text = status.text\n\t\t\tlet tone = status.tone\n\t\t\tif (status.followConnection === true) {\n\t\t\t\ttext = this.online ? status.onlineText : status.offlineText\n\t\t\t\ttone = tone || (this.online ? 'success' : 'warning')\n\t\t\t\tif (!this.online && this.syncedTime && typeof status.offlineSyncedText === 'string' && status.offlineSyncedText !== '') {\n\t\t\t\t\treturn this.statusLine(this.tr(status.offlineSyncedText).replace('{time}', this.syncedTime), tone)\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (typeof text !== 'string' || text === '') {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\treturn this.statusLine(this.tr(text), tone)\n\t\t},\n\n\t\t/**\n\t\t * A status line of a text and a tone.\n\t\t *\n\t\t * @param {string} text The translated text.\n\t\t * @param {string} tone The tone.\n\t\t * @return {{text: string, tone: string, icon: object}}\n\t\t */\n\t\tstatusLine(text, tone) {\n\t\t\tconst known = ['warning', 'success', 'info'].includes(tone) ? tone : 'info'\n\t\t\tconst icon = known === 'warning' ? CloudOffOutline : (known === 'success' ? CloudCheckOutline : InformationOutline)\n\t\t\treturn { text, tone: known, icon: markRaw(icon) }\n\t\t},\n\n\t\t/**\n\t\t * The first record of a `{ source: { register, schema, filter, sort? } }`, sorted by `sort` (or\n\t\t * newest first by `orderBy`), under the reader's rights; null without one or while a token is unresolved.\n\t\t *\n\t\t * @param {object} spec The source spec.\n\t\t * @param {string} [orderBy] A field to sort on, newest first, when the source names no sort.\n\t\t * @return {Promise<object|null>}\n\t\t */\n\t\tasync firstOf(spec, orderBy = '') {\n\t\t\tconst source = spec?.source\n\t\t\tif (!source || typeof source !== 'object' || !source.register || !source.schema) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tconst filter = resolveFilterTokens(source.filter || {}, { objectId: this.objectId || null, object: this.objectData })\n\t\t\tif (hasUnresolvedTokens(filter)) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tconst sort = source.sort?.field ? { [`_order[${source.sort.field}]`]: source.sort.dir === 'asc' ? 'asc' : 'desc' } : (orderBy ? { [`_order[${orderBy}]`]: 'desc' } : {})\n\t\t\ttry {\n\t\t\t\tconst rows = await fetchReferenceObjects({ register: source.register, schema: source.schema, filter: { ...filter, ...sort }, limit: 1 })\n\t\t\t\treturn Array.isArray(rows) && rows.length > 0 ? rows[0] : null\n\t\t\t} catch {\n\t\t\t\treturn null\n\t\t\t}\n\t\t},\n\n\t\t/** Read the frame titles (`titleFrom`) and the last synchronisation (`status.syncedFrom`). */\n\t\tasync readSources() {\n\t\t\tconst list = Array.isArray(this.content?.frames) ? this.content.frames.filter((frame) => frame && typeof frame === 'object') : []\n\t\t\tconst titles = {}\n\t\t\tawait Promise.all(list.map(async (frame, index) => {\n\t\t\t\tif (!frame.titleFrom?.field) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tconst value = readPath(await this.firstOf(frame.titleFrom), frame.titleFrom.field)\n\t\t\t\tif (typeof value === 'string' && value !== '') {\n\t\t\t\t\ttitles[index] = value\n\t\t\t\t}\n\t\t\t}))\n\t\t\tthis.readTitles = titles\n\t\t\tconst synced = this.content?.status?.syncedFrom\n\t\t\tif (synced?.field) {\n\t\t\t\tconst at = new Date(readPath(await this.firstOf(synced, synced.field), synced.field) ?? '')\n\t\t\t\tthis.syncedTime = Number.isNaN(at.getTime()) ? '' : `${String(at.getHours()).padStart(2, '0')}:${String(at.getMinutes()).padStart(2, '0')}`\n\t\t\t}\n\t\t},\n\n\t\t/** Follow the browser's connection state. */\n\t\tonConnection() {\n\t\t\tthis.online = typeof navigator === 'undefined' || navigator.onLine !== false\n\t\t},\n\n\t\t/**\n\t\t * The id of a frame's heading.\n\t\t *\n\t\t * @param {string} key The frame key.\n\t\t * @return {string}\n\t\t */\n\t\theadingId(key) {\n\t\t\treturn `cn-device-frame-${this.uid}-${key}`\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-device-frames-widget {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\talign-items: flex-start;\n\tgap: 20px;\n}\n\n.cn-device-frames-widget__frame {\n\tdisplay: flex;\n\tflex: none;\n\tflex-direction: column;\n\twidth: var(--cn-device-frame-width, 350px);\n\tmax-width: 100%;\n\tmin-height: 600px;\n\theight: var(--cn-device-frame-height, auto);\n\tbox-sizing: border-box;\n\toverflow: hidden;\n\tborder: 10px solid var(--color-main-text);\n\tborder-radius: 36px;\n\tbackground: var(--color-background-hover);\n}\n\n.cn-device-frames-widget__head {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 6px;\n\tpadding: 14px 18px 10px;\n\tborder-bottom: 1px solid var(--color-border);\n\tbackground: var(--color-main-background);\n}\n\n.cn-device-frames-widget__status {\n\tdisplay: inline-flex;\n\talign-items: center;\n\tgap: 6px;\n\tfont-size: 13px;\n\tfont-weight: 600;\n\tline-height: normal;\n}\n\n.cn-device-frames-widget__status--warning {\n\tcolor: var(--color-warning-text, var(--color-main-text));\n}\n\n.cn-device-frames-widget__status--success {\n\tcolor: var(--color-success-text, var(--color-main-text));\n}\n\n.cn-device-frames-widget__status--info {\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-device-frames-widget__title {\n\tmargin: 0;\n\tfont-size: 20px;\n\tfont-weight: 700;\n\tline-height: 1.2;\n}\n\n.cn-device-frames-widget__body {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 12px;\n\tpadding: 14px;\n}\n\n/* `height` (DqInspectie: 700) makes every frame a phone of that height;\n what does not fit scrolls inside the screen. */\n.cn-device-frames-widget__frame[style*='--cn-device-frame-height'] .cn-device-frames-widget__body {\n\tflex: 1 1 auto;\n\tmin-height: 0;\n\toverflow-y: auto;\n}\n\n/* On a phone the frame is the screen: no bezel, the full width. */\n@media (max-width: 640px) {\n\t.cn-device-frames-widget__frame {\n\t\twidth: 100%;\n\t\tmin-height: 0;\n\t\tborder-width: 0;\n\t\tborder-radius: var(--cn-board-card-radius, 12px);\n\t}\n}\n</style>\n"],"names":["CnSectionsWidget"],"mappings":";;;;;;;;;AAwDA;AACA,IAAI,kBAAkB,EAAA;;AAEtB;AACC;;;;AAIA;;;;;;AAMA;AACA;;;;;;;AAOA;AACA;AACA;;;;AAIA;AACA;AACA;;AAED,aAAe;CACd,IAAI,EAAE,sBAAsB;;CAE5B,UAAU,EAAE,oBAAEA,UAAe,EAAG;;AAEhC,CAAA,MAAM,EAAE;AACP,EAAA,WAAW,EAAE,EAAE,OAAO,EAAE,MAAM,CAAC,GAAG,KAAK,KAAK;EAC5C;;AAED,CAAA,KAAK,EAAE;AACN;;AAEC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;AAGD,EA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