@conduction/nextcloud-vue 2.56.0-beta.30 → 2.56.0-beta.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (173) hide show
  1. package/dist/esm/components/CnActionsBar/CnActionsBar.vue2.js.map +1 -1
  2. package/dist/esm/components/CnActionsBar/CnActionsBar.vue3.js +3 -3
  3. package/dist/esm/components/CnActionsBar/CnActionsBar.vue3.js.map +1 -1
  4. package/dist/esm/components/CnAppRoot/CnAppRoot.vue2.js +80 -4
  5. package/dist/esm/components/CnAppRoot/CnAppRoot.vue2.js.map +1 -1
  6. package/dist/esm/components/CnAppRoot/CnAppRoot.vue3.js +95 -91
  7. package/dist/esm/components/CnAppRoot/CnAppRoot.vue3.js.map +1 -1
  8. package/dist/esm/components/CnBannerWidget/CnBannerWidget.vue2.js +85 -6
  9. package/dist/esm/components/CnBannerWidget/CnBannerWidget.vue2.js.map +1 -1
  10. package/dist/esm/components/CnBannerWidget/CnBannerWidget.vue3.js +1 -1
  11. package/dist/esm/components/CnBannerWidget/CnBannerWidget.vue3.js.map +1 -1
  12. package/dist/esm/components/CnCellRenderer/CnCellRenderer.vue2.js +4 -1
  13. package/dist/esm/components/CnCellRenderer/CnCellRenderer.vue2.js.map +1 -1
  14. package/dist/esm/components/CnCellRenderer/CnCellRenderer.vue3.js.map +1 -1
  15. package/dist/esm/components/CnConversationThread/CnConversationWidget.vue2.js +1 -1
  16. package/dist/esm/components/CnConversationThread/CnConversationWidget.vue2.js.map +1 -1
  17. package/dist/esm/components/CnConversationThread/CnConversationWidget.vue3.js.map +1 -1
  18. package/dist/esm/components/CnDashboardGrid/CnDashboardGrid.vue2.js +2 -2
  19. package/dist/esm/components/CnDashboardGrid/CnDashboardGrid.vue2.js.map +1 -1
  20. package/dist/esm/components/CnDashboardGrid/CnDashboardGrid.vue3.js.map +1 -1
  21. package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue2.js +40 -3
  22. package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue2.js.map +1 -1
  23. package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue3.js.map +1 -1
  24. package/dist/esm/components/CnDataTable/CnDataTable.vue2.js +19 -11
  25. package/dist/esm/components/CnDataTable/CnDataTable.vue2.js.map +1 -1
  26. package/dist/esm/components/CnDataTable/CnDataTable.vue3.js.map +1 -1
  27. package/dist/esm/components/CnDetailPage/CnDetailPage.vue2.js +43 -0
  28. package/dist/esm/components/CnDetailPage/CnDetailPage.vue2.js.map +1 -1
  29. package/dist/esm/components/CnDetailPage/CnDetailPage.vue3.js +1 -1
  30. package/dist/esm/components/CnDetailPage/CnDetailPage.vue3.js.map +1 -1
  31. package/dist/esm/components/CnDocumentReviewList/CnDocumentReviewWidget.vue2.js +1 -1
  32. package/dist/esm/components/CnDocumentReviewList/CnDocumentReviewWidget.vue2.js.map +1 -1
  33. package/dist/esm/components/CnDocumentReviewList/CnDocumentReviewWidget.vue3.js.map +1 -1
  34. package/dist/esm/components/CnFacetSidebar/CnFacetSidebar.vue2.js +7 -7
  35. package/dist/esm/components/CnFacetSidebar/CnFacetSidebar.vue2.js.map +1 -1
  36. package/dist/esm/components/CnFacetSidebar/CnFacetSidebar.vue3.js.map +1 -1
  37. package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue2.js +125 -0
  38. package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue2.js.map +1 -1
  39. package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue3.js.map +1 -1
  40. package/dist/esm/components/CnFieldListWidget/CnFieldListWidget.vue2.js +3 -2
  41. package/dist/esm/components/CnFieldListWidget/CnFieldListWidget.vue2.js.map +1 -1
  42. package/dist/esm/components/CnFieldListWidget/CnFieldListWidget.vue3.js.map +1 -1
  43. package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue2.js +302 -4
  44. package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue2.js.map +1 -1
  45. package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue3.js +417 -244
  46. package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue3.js.map +1 -1
  47. package/dist/esm/components/CnFilesBrowser/filesBrowser.js +101 -1
  48. package/dist/esm/components/CnFilesBrowser/filesBrowser.js.map +1 -1
  49. package/dist/esm/components/CnFilesBrowser/filesBrowserColumns.js +141 -1
  50. package/dist/esm/components/CnFilesBrowser/filesBrowserColumns.js.map +1 -1
  51. package/dist/esm/components/CnFormPage/CnFormPage.vue2.js +60 -0
  52. package/dist/esm/components/CnFormPage/CnFormPage.vue2.js.map +1 -1
  53. package/dist/esm/components/CnFormPage/CnFormPage.vue3.js +74 -49
  54. package/dist/esm/components/CnFormPage/CnFormPage.vue3.js.map +1 -1
  55. package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js +29 -1
  56. package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js.map +1 -1
  57. package/dist/esm/components/CnIndexPage/CnIndexPage.vue3.js +48 -4
  58. package/dist/esm/components/CnIndexPage/CnIndexPage.vue3.js.map +1 -1
  59. package/dist/esm/components/CnIndexSidebar/CnIndexSidebar.vue2.js +7 -7
  60. package/dist/esm/components/CnIndexSidebar/CnIndexSidebar.vue2.js.map +1 -1
  61. package/dist/esm/components/CnIndexSidebar/CnIndexSidebar.vue3.js.map +1 -1
  62. package/dist/esm/components/CnNextStepCard/CnNextStepWidget.vue2.js +1 -1
  63. package/dist/esm/components/CnNextStepCard/CnNextStepWidget.vue2.js.map +1 -1
  64. package/dist/esm/components/CnObjectListWidget/CnObjectListWidget.vue2.js +1 -1
  65. package/dist/esm/components/CnObjectListWidget/CnObjectListWidget.vue2.js.map +1 -1
  66. package/dist/esm/components/CnObjectListWidget/CnObjectListWidget.vue3.js.map +1 -1
  67. package/dist/esm/components/CnObjectSidebar/CnFilesTab.vue2.js +63 -1
  68. package/dist/esm/components/CnObjectSidebar/CnFilesTab.vue2.js.map +1 -1
  69. package/dist/esm/components/CnObjectSidebar/CnFilesTab.vue3.js +8 -1
  70. package/dist/esm/components/CnObjectSidebar/CnFilesTab.vue3.js.map +1 -1
  71. package/dist/esm/components/CnObjectSidebar/CnNotesTab.vue2.js +14 -0
  72. package/dist/esm/components/CnObjectSidebar/CnNotesTab.vue2.js.map +1 -1
  73. package/dist/esm/components/CnObjectSidebar/CnNotesTab.vue3.js +5 -1
  74. package/dist/esm/components/CnObjectSidebar/CnNotesTab.vue3.js.map +1 -1
  75. package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue2.js +13 -6
  76. package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue2.js.map +1 -1
  77. package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue3.js.map +1 -1
  78. package/dist/esm/components/CnStatsBlockWidget/CnStatsBlockWidget.vue2.js +84 -1
  79. package/dist/esm/components/CnStatsBlockWidget/CnStatsBlockWidget.vue2.js.map +1 -1
  80. package/dist/esm/components/CnStatsBlockWidget/CnStatsBlockWidget.vue3.js +85 -41
  81. package/dist/esm/components/CnStatsBlockWidget/CnStatsBlockWidget.vue3.js.map +1 -1
  82. package/dist/esm/components/CnWidgetObjectTable/CnWidgetObjectTable.vue2.js +7 -2
  83. package/dist/esm/components/CnWidgetObjectTable/CnWidgetObjectTable.vue2.js.map +1 -1
  84. package/dist/esm/components/CnWidgetObjectTable/CnWidgetObjectTable.vue3.js.map +1 -1
  85. package/dist/esm/components/CnWidgetObjectTable/dashboardRegistration.js +5 -0
  86. package/dist/esm/components/CnWidgetObjectTable/dashboardRegistration.js.map +1 -1
  87. package/dist/esm/components/CnWorkspaceFilterWidget/CnWorkspaceFilterWidget.vue2.js +197 -6
  88. package/dist/esm/components/CnWorkspaceFilterWidget/CnWorkspaceFilterWidget.vue2.js.map +1 -1
  89. package/dist/esm/components/CnWorkspaceFilterWidget/CnWorkspaceFilterWidget.vue3.js +94 -50
  90. package/dist/esm/components/CnWorkspaceFilterWidget/CnWorkspaceFilterWidget.vue3.js.map +1 -1
  91. package/dist/esm/composables/useListView.js +4 -4
  92. package/dist/esm/composables/useListView.js.map +1 -1
  93. package/dist/esm/index.js +10 -1
  94. package/dist/esm/index.js.map +1 -1
  95. package/dist/esm/l10n/en.json.js +8 -1
  96. package/dist/esm/l10n/en.json.js.map +1 -1
  97. package/dist/esm/l10n/nl.json.js +54 -1
  98. package/dist/esm/l10n/nl.json.js.map +1 -1
  99. package/dist/esm/nextcloud-vue.css +198 -8
  100. package/dist/esm/utils/facets.js +75 -3
  101. package/dist/esm/utils/facets.js.map +1 -1
  102. package/dist/esm/utils/fillTemplate.js +7 -1
  103. package/dist/esm/utils/fillTemplate.js.map +1 -1
  104. package/dist/esm/utils/pageControls.js +81 -0
  105. package/dist/esm/utils/pageControls.js.map +1 -0
  106. package/dist/esm/utils/personalLenses.js +40 -3
  107. package/dist/esm/utils/personalLenses.js.map +1 -1
  108. package/dist/esm/utils/resolveFilterTokens.js +1 -1
  109. package/dist/esm/utils/resolveFilterTokens.js.map +1 -1
  110. package/dist/esm/utils/resolveManifestTokens.js +2 -0
  111. package/dist/esm/utils/resolveManifestTokens.js.map +1 -1
  112. package/dist/esm/utils/sentinelTokens.js +19 -1
  113. package/dist/esm/utils/sentinelTokens.js.map +1 -1
  114. package/dist/esm/utils/userGroupsPeek.js +91 -0
  115. package/dist/esm/utils/userGroupsPeek.js.map +1 -0
  116. package/dist/esm/utils/validateManifestV2.compiled.js +3 -3
  117. package/dist/esm/utils/validateManifestV2.compiled.js.map +1 -1
  118. package/dist/esm/utils/visibleWhen.js +57 -5
  119. package/dist/esm/utils/visibleWhen.js.map +1 -1
  120. package/dist/esm/utils/widgetVisibility.js +4 -57
  121. package/dist/esm/utils/widgetVisibility.js.map +1 -1
  122. package/dist/nextcloud-vue.cjs.js +4309 -2233
  123. package/dist/nextcloud-vue.cjs.js.map +2 -2
  124. package/dist/nextcloud-vue.css +198 -8
  125. package/l10n/en.json +8 -1
  126. package/l10n/nl.json +54 -1
  127. package/package.json +2 -1
  128. package/scripts/check-docs-mdx.mjs +108 -0
  129. package/src/components/CnActionsBar/CnActionsBar.vue +6 -1
  130. package/src/components/CnAppRoot/CnAppRoot.md +4 -2
  131. package/src/components/CnAppRoot/CnAppRoot.vue +151 -59
  132. package/src/components/CnBannerWidget/CnBannerWidget.vue +112 -7
  133. package/src/components/CnCellRenderer/CnCellRenderer.vue +4 -1
  134. package/src/components/CnConversationThread/CnConversationWidget.vue +1 -1
  135. package/src/components/CnDashboardGrid/CnDashboardGrid.vue +2 -2
  136. package/src/components/CnDashboardPage/CnDashboardPage.vue +40 -3
  137. package/src/components/CnDataTable/CnDataTable.vue +19 -11
  138. package/src/components/CnDetailPage/CnDetailPage.vue +44 -1
  139. package/src/components/CnDocumentReviewList/CnDocumentReviewWidget.vue +1 -1
  140. package/src/components/CnFacetSidebar/CnFacetSidebar.vue +7 -7
  141. package/src/components/CnFactsWidget/CnFactsWidget.vue +125 -0
  142. package/src/components/CnFieldListWidget/CnFieldListWidget.vue +3 -2
  143. package/src/components/CnFilesBrowser/CnFilesBrowser.vue +588 -117
  144. package/src/components/CnFilesBrowser/filesBrowser.js +100 -0
  145. package/src/components/CnFilesBrowser/filesBrowserColumns.js +140 -0
  146. package/src/components/CnFormPage/CnFormPage.vue +81 -0
  147. package/src/components/CnIndexPage/CnIndexPage.vue +56 -3
  148. package/src/components/CnIndexSidebar/CnIndexSidebar.vue +7 -7
  149. package/src/components/CnNextStepCard/CnNextStepWidget.vue +1 -1
  150. package/src/components/CnObjectListWidget/CnObjectListWidget.vue +1 -1
  151. package/src/components/CnObjectSidebar/CnFilesTab.vue +70 -1
  152. package/src/components/CnObjectSidebar/CnNotesTab.vue +16 -0
  153. package/src/components/CnRecordListWidget/CnRecordListWidget.vue +13 -6
  154. package/src/components/CnStatsBlockWidget/CnStatsBlockWidget.vue +180 -3
  155. package/src/components/CnWidgetObjectTable/CnWidgetObjectTable.vue +7 -2
  156. package/src/components/CnWidgetObjectTable/dashboardRegistration.js +5 -0
  157. package/src/components/CnWorkspaceFilterWidget/CnWorkspaceFilterWidget.vue +281 -10
  158. package/src/components/index.js +8 -0
  159. package/src/composables/useListView.js +4 -4
  160. package/src/css/look-board-index.css +16 -8
  161. package/src/index.js +8 -0
  162. package/src/schemas/app-manifest-v2.schema.json +93 -9
  163. package/src/utils/facets.js +74 -2
  164. package/src/utils/fillTemplate.js +7 -1
  165. package/src/utils/pageControls.js +78 -0
  166. package/src/utils/personalLenses.js +39 -2
  167. package/src/utils/resolveFilterTokens.js +3 -1
  168. package/src/utils/resolveManifestTokens.js +2 -0
  169. package/src/utils/sentinelTokens.js +19 -1
  170. package/src/utils/userGroupsPeek.js +87 -0
  171. package/src/utils/validateManifestV2.compiled.js +3 -3
  172. package/src/utils/visibleWhen.js +56 -4
  173. package/src/utils/widgetVisibility.js +7 -56
@@ -1 +1 @@
1
- {"version":3,"file":"CnRecordListWidget.vue3.js","sources":["../../../../src/components/CnRecordListWidget/CnRecordListWidget.vue?vue&type=template&id=7073b362&lang.js"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n\n<template>\n\t<div\n\t\tclass=\"cn-record-list\"\n\t\t:class=\"`cn-record-list--${presentation}`\"\n\t\tdata-testid=\"cn-record-list\">\n\t\t<p v-if=\"error\" class=\"cn-record-list__error\" data-testid=\"cn-record-list-error\">\n\t\t\t{{ errorLabel }}\n\t\t</p>\n\t\t<div v-else-if=\"loading && rows.length === 0\" class=\"cn-record-list__loading\">\n\t\t\t<NcLoadingIcon :size=\"20\" :name=\"loadingLabel\" />\n\t\t</div>\n\t\t<p v-else-if=\"rows.length === 0\" class=\"cn-record-list__empty\" data-testid=\"cn-record-list-empty\">\n\t\t\t{{ emptyLabel }}\n\t\t</p>\n\t\t<ul v-else class=\"cn-record-list__list\">\n\t\t\t<li\n\t\t\t\tv-for=\"item in items\"\n\t\t\t\t:key=\"item.key\"\n\t\t\t\tclass=\"cn-record-list__item\"\n\t\t\t\tdata-testid=\"cn-record-list-item\">\n\t\t\t\t<!-- rows: title and meta, then the pill, the date and a chevron. -->\n\t\t\t\t<component\n\t\t\t\t\t:is=\"item.tag\"\n\t\t\t\t\tv-if=\"presentation === 'rows'\"\n\t\t\t\t\tclass=\"cn-record-list__row\"\n\t\t\t\t\t:class=\"{ 'cn-record-list__row--link': item.tag !== 'div' }\"\n\t\t\t\t\tv-bind=\"item.attrs\">\n\t\t\t\t\t<span class=\"cn-record-list__main\">\n\t\t\t\t\t\t<span v-if=\"item.title\" class=\"cn-record-list__title\">{{ item.title }}</span>\n\t\t\t\t\t\t<span v-if=\"item.meta\" class=\"cn-record-list__meta\">{{ item.meta }}</span>\n\t\t\t\t\t</span>\n\t\t\t\t\t<span v-if=\"item.pill || item.trailing\" class=\"cn-record-list__aside\">\n\t\t\t\t\t\t<CnStatusBadge\n\t\t\t\t\t\t\tv-if=\"item.pill\"\n\t\t\t\t\t\t\t:label=\"item.pill.label\"\n\t\t\t\t\t\t\t:variant=\"item.pill.variant\"\n\t\t\t\t\t\t\tsize=\"small\" />\n\t\t\t\t\t\t<span v-if=\"item.trailing\" class=\"cn-record-list__trailing\">{{ item.trailing }}</span>\n\t\t\t\t\t</span>\n\t\t\t\t\t<ChevronRight\n\t\t\t\t\t\tv-if=\"item.tag !== 'div'\"\n\t\t\t\t\t\tclass=\"cn-record-list__chevron\"\n\t\t\t\t\t\t:size=\"18\"\n\t\t\t\t\t\taria-hidden=\"true\" />\n\t\t\t\t</component>\n\n\t\t\t\t<!-- feed: a round icon, a meta line and the text. -->\n\t\t\t\t<div v-else-if=\"presentation === 'feed'\" class=\"cn-record-list__feed-row\">\n\t\t\t\t\t<span class=\"cn-record-list__feed-icon\" aria-hidden=\"true\">\n\t\t\t\t\t\t<CnIcon :name=\"item.icon\" :size=\"18\" />\n\t\t\t\t\t</span>\n\t\t\t\t\t<component :is=\"item.tag\" class=\"cn-record-list__main\" v-bind=\"item.attrs\">\n\t\t\t\t\t\t<span v-if=\"item.meta\" class=\"cn-record-list__meta\">{{ item.meta }}</span>\n\t\t\t\t\t\t<span v-if=\"item.text\" class=\"cn-record-list__text\">{{ item.text }}</span>\n\t\t\t\t\t</component>\n\t\t\t\t</div>\n\n\t\t\t\t<!-- inline: a label and the title, the title a link. -->\n\t\t\t\t<div v-else class=\"cn-record-list__inline-row\">\n\t\t\t\t\t<span v-if=\"item.label\" class=\"cn-record-list__label\">{{ item.label }}</span>\n\t\t\t\t\t<component :is=\"item.tag\" class=\"cn-record-list__inline-title\" v-bind=\"item.attrs\">\n\t\t\t\t\t\t{{ item.title }}\n\t\t\t\t\t</component>\n\t\t\t\t</div>\n\t\t\t</li>\n\t\t</ul>\n\t</div>\n</template>\n\n<script>\nimport { subscribe, unsubscribe } from '@nextcloud/event-bus'\nimport { translate as t } from '@nextcloud/l10n'\nimport { NcLoadingIcon } from '@nextcloud/vue'\nimport ChevronRight from 'vue-material-design-icons/ChevronRight.vue'\nimport CnIcon from '../CnIcon/CnIcon.vue'\nimport CnStatusBadge from '../CnStatusBadge/CnStatusBadge.vue'\nimport { isBadgeVariant } from '../../utils/badgeVariants.js'\nimport { fillTemplate, firstFilled } from '../../utils/fillTemplate.js'\nimport { readPath } from '../../utils/readPath.js'\nimport { dropOptionalUnresolved, hasUnresolvedTokens, resolveFilterTokens } from '../../utils/resolveFilterTokens.js'\n\nconst PAGE_REFRESH_CHANNEL = 'cn:page:refresh'\nconst PRESENTATIONS = ['rows', 'feed', 'inline']\n\n/**\n * Unwrap a value that may be a ref.\n *\n * @param {unknown} value The value.\n * @return {unknown} The plain value.\n */\nfunction unwrap(value) {\n\treturn value && typeof value === 'object' && 'value' in value ? value.value : value\n}\n\n/**\n * CnRecordListWidget — the objects of another schema that point at this\n * record, drawn as the boards draw them (screens-relation-pages).\n *\n * A person page lists its open cases (\"Verlichting fietspad Lindelaan,\n * 2026-0082 · Woo-verzoek, In behandeling, Termijn 1 nov\"), its latest contact\n * moments (an icon by channel, a meta line, the summary) and its relations\n * (\"Secretaris van Buurtvereniging Oost\"). Each is a list of another schema's\n * objects filtered on a reference to this record. The source keys are those of\n * `object-list` (`register`, `schema`, `filter` with the `@objectId` /\n * `@object.<field>` / `@workspace.<key>` tokens, `sort`, `limit`, `extend`,\n * `rowRoute`); what differs is the drawing: `presentation` is `rows`, `feed`\n * or `inline`, and each line is a template (`\"{identifier} · {caseTypeName}\"`,\n * `\"Termijn {deadline|date}\"`).\n *\n * A content-only catalog type: on a card surface the detail host draws the\n * titled card. The widget emits `header` with `{ link, note }` (the\n * `headerLink` and `headerNote` with `{total}` filled in) for that card's\n * header.\n */\nexport default {\n\tname: 'CnRecordListWidget',\n\n\tcomponents: { ChevronRight, CnIcon, CnStatusBadge, NcLoadingIcon },\n\n\tinject: {\n\t\t/** Detail-page object context (`{ objectId, object, register, schema }`). */\n\t\tcnObjectContext: { default: null },\n\t\t/** Page workspace bag, for `@workspace.<key>` tokens. */\n\t\tcnWorkspaceContext: { default: null },\n\t\t/** The host app's translate function. */\n\t\tcnTranslate: { default: () => (key) => key },\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * The list config: `{ register, schema, filter?, sort?, limit?, extend?,\n\t\t * presentation?, title?, meta?, text?, label?, pill?, trailing?, icon?,\n\t\t * rowRoute?, rowIdField?, headerLink?, headerNote?, emptyText?, errorText? }`.\n\t\t *\n\t\t * @type {object}\n\t\t */\n\t\tcontent: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({}),\n\t\t},\n\n\t\t/** The current record's id, for the `@objectId` token. */\n\t\tobjectId: {\n\t\t\ttype: [String, Number],\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** The current record, for `@object.<field>` tokens. */\n\t\tobjectData: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\t},\n\n\temits: ['header'],\n\n\tdata() {\n\t\treturn {\n\t\t\trows: [],\n\t\t\ttotal: 0,\n\t\t\tloading: false,\n\t\t\terror: false,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/** @return {string} `rows`, `feed` or `inline`. */\n\t\tpresentation() {\n\t\t\tconst value = this.content?.presentation\n\t\t\treturn PRESENTATIONS.includes(value) ? value : 'rows'\n\t\t},\n\n\t\t/** @return {object} The token context: record, id and workspace. */\n\t\ttokenCtx() {\n\t\t\tconst injected = unwrap(this.cnObjectContext) || {}\n\t\t\treturn {\n\t\t\t\t...injected,\n\t\t\t\tobjectId: this.objectId ?? injected.objectId ?? this.objectData?.id ?? null,\n\t\t\t\tobject: this.objectData || injected.object || null,\n\t\t\t\tworkspace: unwrap(this.cnWorkspaceContext) || {},\n\t\t\t}\n\t\t},\n\n\t\t/** @return {object} The filter with its tokens resolved. */\n\t\tresolvedFilter() {\n\t\t\tconst filter = this.content?.filter\n\t\t\treturn dropOptionalUnresolved(resolveFilterTokens(filter && typeof filter === 'object' ? filter : {}, this.tokenCtx))\n\t\t},\n\n\t\t/** @return {boolean} A required token (the record id, say) has no value yet. */\n\t\twaiting() {\n\t\t\treturn hasUnresolvedTokens(this.resolvedFilter)\n\t\t},\n\n\t\t/** @return {number} The fetch cap. */\n\t\tlimit() {\n\t\t\tconst value = Number(this.content?.limit)\n\t\t\treturn Number.isFinite(value) && value > 0 ? Math.floor(value) : 5\n\t\t},\n\n\t\t/** @return {string} What a fetch depends on; a change fetches again. */\n\t\trequestKey() {\n\t\t\tconst c = this.content || {}\n\t\t\treturn JSON.stringify([c.register, c.schema, this.resolvedFilter, c.sort, this.limit, c.extend, this.waiting])\n\t\t},\n\n\t\t/** @return {Array<object>} The rows ready to draw. */\n\t\titems() {\n\t\t\tconst c = this.content || {}\n\t\t\treturn this.rows.slice(0, this.limit).map((row, index) => {\n\t\t\t\tconst link = this.rowLink(row)\n\t\t\t\treturn {\n\t\t\t\t\tkey: (row && (row.id || row['@self']?.id)) || `row-${index}`,\n\t\t\t\t\ttag: link ? 'router-link' : 'div',\n\t\t\t\t\tattrs: link ? { to: link } : {},\n\t\t\t\t\ttitle: this.fill(c.title, row),\n\t\t\t\t\tmeta: this.fill(c.meta, row),\n\t\t\t\t\ttext: this.fill(c.text, row),\n\t\t\t\t\tlabel: this.fill(c.label, row),\n\t\t\t\t\ttrailing: c.trailing ? firstFilled(c.trailing, row, this.translate) : '',\n\t\t\t\t\tpill: this.pillOf(row),\n\t\t\t\t\ticon: this.iconOf(row),\n\t\t\t\t}\n\t\t\t})\n\t\t},\n\n\t\t/** @return {object|null} The header link with `{total}` filled and tokens resolved. */\n\t\theaderLink() {\n\t\t\tconst link = this.content?.headerLink\n\t\t\tif (!link || typeof link !== 'object' || typeof link.label !== 'string' || link.label === '') {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tconst resolved = { label: this.withTotal(link.label) }\n\t\t\tif (link.route) {\n\t\t\t\tresolved.route = link.route\n\t\t\t\tif (link.params && typeof link.params === 'object') {\n\t\t\t\t\tresolved.params = resolveFilterTokens(link.params, this.tokenCtx)\n\t\t\t\t}\n\t\t\t\tif (link.query && typeof link.query === 'object') {\n\t\t\t\t\tresolved.query = resolveFilterTokens(link.query, this.tokenCtx)\n\t\t\t\t}\n\t\t\t} else if (typeof link.href === 'string') {\n\t\t\t\tresolved.href = link.href\n\t\t\t}\n\t\t\treturn resolved\n\t\t},\n\n\t\t/** @return {string} The header note with `{total}` filled. */\n\t\theaderNote() {\n\t\t\tconst note = this.content?.headerNote\n\t\t\treturn typeof note === 'string' && note !== '' ? this.withTotal(note) : ''\n\t\t},\n\n\t\t/** @return {string} The empty line. */\n\t\temptyLabel() {\n\t\t\treturn this.content?.emptyText ? this.translate(this.content.emptyText) : t('nextcloud-vue', 'Nothing here yet')\n\t\t},\n\n\t\t/** @return {string} The error line. */\n\t\terrorLabel() {\n\t\t\treturn this.content?.errorText ? this.translate(this.content.errorText) : t('nextcloud-vue', 'This list could not be loaded.')\n\t\t},\n\n\t\t/** @return {string} The spinner's accessible name. */\n\t\tloadingLabel() {\n\t\t\treturn t('nextcloud-vue', 'Loading …')\n\t\t},\n\t},\n\n\twatch: {\n\t\trequestKey() {\n\t\t\tthis.fetchRows()\n\t\t},\n\t},\n\n\tmounted() {\n\t\tthis.onRefresh = () => this.fetchRows()\n\t\tsubscribe(PAGE_REFRESH_CHANNEL, this.onRefresh)\n\t\tthis.fetchRows()\n\t},\n\n\tbeforeUnmount() {\n\t\tunsubscribe(PAGE_REFRESH_CHANNEL, this.onRefresh)\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Translate a manifest string through the host app.\n\t\t *\n\t\t * @param {string} text The text.\n\t\t * @return {string} The translation.\n\t\t */\n\t\ttranslate(text) {\n\t\t\treturn typeof this.cnTranslate === 'function' ? this.cnTranslate(text) : text\n\t\t},\n\n\t\t/**\n\t\t * Fill a template from a row, after translating it.\n\t\t *\n\t\t * @param {string} template The template.\n\t\t * @param {object} row The row.\n\t\t * @return {string} The text, '' when a token is empty.\n\t\t */\n\t\tfill(template, row) {\n\t\t\treturn typeof template === 'string' && template !== '' ? fillTemplate(this.translate(template), row) : ''\n\t\t},\n\n\t\t/**\n\t\t * Replace `{total}` in a translated label.\n\t\t *\n\t\t * @param {string} label The label.\n\t\t * @return {string} The text.\n\t\t */\n\t\twithTotal(label) {\n\t\t\treturn this.translate(label).replace(/\\{total\\}/g, String(this.total))\n\t\t},\n\n\t\t/**\n\t\t * The route a row opens: `rowRoute` with the id at `rowIdField`.\n\t\t *\n\t\t * @param {object} row The row.\n\t\t * @return {object|null} The router location, or null.\n\t\t */\n\t\trowLink(row) {\n\t\t\tconst route = this.content?.rowRoute\n\t\t\tif (!route || !this.$router || !row) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tconst field = this.content?.rowIdField\n\t\t\tconst id = field ? readPath(row, field) : (row.id || row['@self']?.id)\n\t\t\tif (id === null || id === undefined || id === '' || typeof id === 'object') {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\treturn { name: route, params: { id: String(id) } }\n\t\t},\n\n\t\t/**\n\t\t * The row's pill: `{ field, labels?, colorMap?, variant? }`.\n\t\t *\n\t\t * @param {object} row The row.\n\t\t * @return {{label: string, variant: string}|null} The pill, or null.\n\t\t */\n\t\tpillOf(row) {\n\t\t\tconst pill = this.content?.pill\n\t\t\tif (!pill || typeof pill !== 'object' || !pill.field) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tconst raw = readPath(row, pill.field)\n\t\t\tif (raw === null || raw === undefined || raw === '' || typeof raw === 'object') {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tconst key = String(raw)\n\t\t\tconst labels = pill.labels && typeof pill.labels === 'object' ? pill.labels : {}\n\t\t\tconst map = pill.colorMap && typeof pill.colorMap === 'object' ? pill.colorMap : {}\n\t\t\tconst found = Object.keys(map).find((k) => k.toLowerCase() === key.toLowerCase())\n\t\t\tconst variant = found ? map[found] : pill.variant\n\t\t\treturn {\n\t\t\t\tlabel: labels[key] ? this.translate(labels[key]) : key,\n\t\t\t\tvariant: isBadgeVariant(variant) ? variant : 'default',\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * The feed icon: an icon name, or `{ field, map, default }`.\n\t\t *\n\t\t * @param {object} row The row.\n\t\t * @return {string} The MDI icon name.\n\t\t */\n\t\ticonOf(row) {\n\t\t\tconst icon = this.content?.icon\n\t\t\tif (typeof icon === 'string' && icon !== '') {\n\t\t\t\treturn icon\n\t\t\t}\n\t\t\tif (icon && typeof icon === 'object') {\n\t\t\t\tconst raw = icon.field ? readPath(row, icon.field) : undefined\n\t\t\t\tconst map = icon.map && typeof icon.map === 'object' ? icon.map : {}\n\t\t\t\tif (raw !== null && raw !== undefined && map[String(raw)]) {\n\t\t\t\t\treturn map[String(raw)]\n\t\t\t\t}\n\t\t\t\tif (typeof icon.default === 'string' && icon.default !== '') {\n\t\t\t\t\treturn icon.default\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn 'CircleSmall'\n\t\t},\n\n\t\t/** Tell the card around this list what its header shows. */\n\t\temitHeader() {\n\t\t\t/**\n\t\t\t * @event header Emitted after every read with the card header's parts.\n\t\t\t * @type {{link: (object|null), note: string}} The header link (resolved, with `{total}` filled) and the note.\n\t\t\t */\n\t\t\tthis.$emit('header', { link: this.headerLink, note: this.headerNote })\n\t\t},\n\n\t\t/**\n\t\t * Fetch the list. Sends nothing while a required token is unresolved\n\t\t * or the source is incomplete.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync fetchRows() {\n\t\t\tconst c = this.content || {}\n\t\t\tif (!c.register || !c.schema || this.waiting) {\n\t\t\t\tthis.rows = []\n\t\t\t\tthis.total = 0\n\t\t\t\tthis.error = false\n\t\t\t\tthis.emitHeader()\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.loading = true\n\t\t\tthis.error = false\n\t\t\ttry {\n\t\t\t\tconst [{ default: axios }, { generateUrl }] = await Promise.all([\n\t\t\t\t\timport('@nextcloud/axios'),\n\t\t\t\t\timport('@nextcloud/router'),\n\t\t\t\t])\n\t\t\t\tconst url = generateUrl('/apps/openregister/api/objects/{register}/{schema}', { register: c.register, schema: c.schema })\n\t\t\t\tconst params = { _limit: this.limit }\n\t\t\t\tif (c.sort && typeof c.sort === 'object' && c.sort.field) {\n\t\t\t\t\tparams[`_order[${c.sort.field}]`] = c.sort.dir === 'desc' ? 'desc' : 'asc'\n\t\t\t\t}\n\t\t\t\tif (Array.isArray(c.extend)) {\n\t\t\t\t\tconst extend = c.extend.filter((e) => typeof e === 'string' && e !== '')\n\t\t\t\t\tif (extend.length > 0) {\n\t\t\t\t\t\tparams._extend = extend\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfor (const [key, value] of Object.entries(this.resolvedFilter)) {\n\t\t\t\t\tif (value && typeof value === 'object' && !Array.isArray(value)) {\n\t\t\t\t\t\tfor (const [op, operand] of Object.entries(value)) {\n\t\t\t\t\t\t\tparams[`${key}[${op}]`] = operand\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (value !== '' && value !== null && value !== undefined) {\n\t\t\t\t\t\tparams[key] = value\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tconst response = await axios.get(url, { params })\n\t\t\t\tconst data = response && response.data ? response.data : {}\n\t\t\t\tthis.rows = Array.isArray(data.results) ? data.results : []\n\t\t\t\tthis.total = typeof data.total === 'number' ? data.total : this.rows.length\n\t\t\t} catch (e) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.warn('[CnRecordListWidget] failed to load objects:', e)\n\t\t\t\tthis.rows = []\n\t\t\t\tthis.total = 0\n\t\t\t\tthis.error = true\n\t\t\t} finally {\n\t\t\t\tthis.loading = false\n\t\t\t\tthis.emitHeader()\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-record-list__list {\n\tlist-style: none;\n\tmargin: 0;\n\tpadding: 0;\n}\n\n.cn-record-list__empty,\n.cn-record-list__error {\n\tcolor: var(--color-text-maxcontrast);\n\tmargin: 0;\n}\n\n.cn-record-list__loading {\n\tdisplay: flex;\n\tjustify-content: center;\n\tpadding: 8px 0;\n}\n\n/* rows */\n.cn-record-list--rows .cn-record-list__item + .cn-record-list__item {\n\tborder-top: 1px solid var(--color-border);\n}\n\n.cn-record-list__row {\n\talign-items: center;\n\tcolor: var(--color-main-text);\n\tdisplay: flex;\n\tgap: 16px;\n\tpadding: 12px 0;\n\ttext-decoration: none;\n}\n\n.cn-record-list__row--link:hover .cn-record-list__title,\n.cn-record-list__row--link:focus-visible .cn-record-list__title {\n\ttext-decoration: underline;\n}\n\n.cn-record-list__main {\n\tdisplay: flex;\n\tflex: 1 1 auto;\n\tflex-direction: column;\n\tgap: 2px;\n\tmin-width: 0;\n}\n\n.cn-record-list__title {\n\tfont-size: 15px;\n\tfont-weight: 700;\n}\n\n.cn-record-list__meta {\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 13px;\n}\n\n.cn-record-list__aside {\n\talign-items: center;\n\tdisplay: flex;\n\tflex: none;\n\tgap: 16px;\n}\n\n.cn-record-list__trailing {\n\tfont-size: 14px;\n\twhite-space: nowrap;\n}\n\n.cn-record-list__chevron {\n\tcolor: var(--color-text-maxcontrast);\n\tflex: none;\n}\n\n/* feed */\n.cn-record-list--feed .cn-record-list__item + .cn-record-list__item {\n\tborder-top: 1px solid var(--color-border);\n}\n\n.cn-record-list__feed-row {\n\talign-items: flex-start;\n\tdisplay: flex;\n\tgap: 14px;\n\tpadding: 12px 0;\n}\n\n.cn-record-list__feed-icon {\n\talign-items: center;\n\tbackground: var(--color-primary-element-light);\n\tborder-radius: 50%;\n\tcolor: var(--color-primary-element-light-text, var(--color-primary-element));\n\tdisplay: flex;\n\tflex: none;\n\theight: 36px;\n\tjustify-content: center;\n\twidth: 36px;\n}\n\n.cn-record-list__text {\n\tfont-size: 15px;\n}\n\n.cn-record-list--feed .cn-record-list__main {\n\tcolor: var(--color-main-text);\n\ttext-decoration: none;\n}\n\n/* inline */\n.cn-record-list__inline-row {\n\tpadding: 4px 0;\n}\n\n.cn-record-list__label {\n\tmargin-inline-end: 4px;\n}\n\n.cn-record-list__inline-title {\n\tcolor: var(--color-main-text);\n}\n\na.cn-record-list__inline-title {\n\tcolor: var(--color-primary-element);\n\ttext-decoration: underline;\n}\n</style>\n\n<style>\n/* In a narrow side column a row stacks: title, meta, then pill and date. */\n.cn-detail-page__side .cn-record-list__row {\n\talign-items: flex-start;\n\tflex-direction: column;\n\tgap: 6px;\n}\n\n.cn-detail-page__side .cn-record-list__row .cn-record-list__title {\n\tcolor: var(--color-primary-element);\n\ttext-decoration: underline;\n}\n\n.cn-detail-page__side .cn-record-list__chevron {\n\tdisplay: none;\n}\n</style>\n"],"names":["_normalizeClass","_createElementBlock","_toDisplayString","_openBlock","_createVNode","_createBlock","_resolveDynamicComponent","_mergeProps","_createElementVNode","_createTextVNode"],"mappings":";;;;AAeO,EAAA,KAAA,EAAA,uBAAA;AAAA,EAAA,aAAA,EAAA,sBAAA;;;;AAGF,EAAA,KAAA,EAAA,yBAAA;;;;AAGmB,EAAA,KAAA,EAAA,uBAAA;AAAA,EAAA,aAAA,EAAA,sBAAA;;;;AAGX,EAAA,KAAK,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;;;;;"}
1
+ {"version":3,"file":"CnRecordListWidget.vue3.js","sources":["../../../../src/components/CnRecordListWidget/CnRecordListWidget.vue?vue&type=template&id=7073b362&lang.js"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n\n<template>\n\t<div\n\t\tclass=\"cn-record-list\"\n\t\t:class=\"`cn-record-list--${presentation}`\"\n\t\tdata-testid=\"cn-record-list\">\n\t\t<p v-if=\"error\" class=\"cn-record-list__error\" data-testid=\"cn-record-list-error\">\n\t\t\t{{ errorLabel }}\n\t\t</p>\n\t\t<div v-else-if=\"loading && rows.length === 0\" class=\"cn-record-list__loading\">\n\t\t\t<NcLoadingIcon :size=\"20\" :name=\"loadingLabel\" />\n\t\t</div>\n\t\t<p v-else-if=\"rows.length === 0\" class=\"cn-record-list__empty\" data-testid=\"cn-record-list-empty\">\n\t\t\t{{ emptyLabel }}\n\t\t</p>\n\t\t<ul v-else class=\"cn-record-list__list\">\n\t\t\t<li\n\t\t\t\tv-for=\"item in items\"\n\t\t\t\t:key=\"item.key\"\n\t\t\t\tclass=\"cn-record-list__item\"\n\t\t\t\tdata-testid=\"cn-record-list-item\">\n\t\t\t\t<!-- rows: title and meta, then the pill, the date and a chevron. -->\n\t\t\t\t<component\n\t\t\t\t\t:is=\"item.tag\"\n\t\t\t\t\tv-if=\"presentation === 'rows'\"\n\t\t\t\t\tclass=\"cn-record-list__row\"\n\t\t\t\t\t:class=\"{ 'cn-record-list__row--link': item.tag !== 'div' }\"\n\t\t\t\t\tv-bind=\"item.attrs\">\n\t\t\t\t\t<span class=\"cn-record-list__main\">\n\t\t\t\t\t\t<span v-if=\"item.title\" class=\"cn-record-list__title\">{{ item.title }}</span>\n\t\t\t\t\t\t<span v-if=\"item.meta\" class=\"cn-record-list__meta\">{{ item.meta }}</span>\n\t\t\t\t\t</span>\n\t\t\t\t\t<span v-if=\"item.pill || item.trailing\" class=\"cn-record-list__aside\">\n\t\t\t\t\t\t<CnStatusBadge\n\t\t\t\t\t\t\tv-if=\"item.pill\"\n\t\t\t\t\t\t\t:label=\"item.pill.label\"\n\t\t\t\t\t\t\t:variant=\"item.pill.variant\"\n\t\t\t\t\t\t\tsize=\"small\" />\n\t\t\t\t\t\t<span v-if=\"item.trailing\" class=\"cn-record-list__trailing\">{{ item.trailing }}</span>\n\t\t\t\t\t</span>\n\t\t\t\t\t<ChevronRight\n\t\t\t\t\t\tv-if=\"item.tag !== 'div'\"\n\t\t\t\t\t\tclass=\"cn-record-list__chevron\"\n\t\t\t\t\t\t:size=\"18\"\n\t\t\t\t\t\taria-hidden=\"true\" />\n\t\t\t\t</component>\n\n\t\t\t\t<!-- feed: a round icon, a meta line and the text. -->\n\t\t\t\t<div v-else-if=\"presentation === 'feed'\" class=\"cn-record-list__feed-row\">\n\t\t\t\t\t<span class=\"cn-record-list__feed-icon\" aria-hidden=\"true\">\n\t\t\t\t\t\t<CnIcon :name=\"item.icon\" :size=\"18\" />\n\t\t\t\t\t</span>\n\t\t\t\t\t<component :is=\"item.tag\" class=\"cn-record-list__main\" v-bind=\"item.attrs\">\n\t\t\t\t\t\t<span v-if=\"item.meta\" class=\"cn-record-list__meta\">{{ item.meta }}</span>\n\t\t\t\t\t\t<span v-if=\"item.text\" class=\"cn-record-list__text\">{{ item.text }}</span>\n\t\t\t\t\t</component>\n\t\t\t\t</div>\n\n\t\t\t\t<!-- inline: a label and the title, the title a link. -->\n\t\t\t\t<div v-else class=\"cn-record-list__inline-row\">\n\t\t\t\t\t<span v-if=\"item.label\" class=\"cn-record-list__label\">{{ item.label }}</span>\n\t\t\t\t\t<component :is=\"item.tag\" class=\"cn-record-list__inline-title\" v-bind=\"item.attrs\">\n\t\t\t\t\t\t{{ item.title }}\n\t\t\t\t\t</component>\n\t\t\t\t</div>\n\t\t\t</li>\n\t\t</ul>\n\t</div>\n</template>\n\n<script>\nimport { subscribe, unsubscribe } from '@nextcloud/event-bus'\nimport { translate as t } from '@nextcloud/l10n'\nimport { NcLoadingIcon } from '@nextcloud/vue'\nimport ChevronRight from 'vue-material-design-icons/ChevronRight.vue'\nimport CnIcon from '../CnIcon/CnIcon.vue'\nimport CnStatusBadge from '../CnStatusBadge/CnStatusBadge.vue'\nimport { isBadgeVariant } from '../../utils/badgeVariants.js'\nimport { fillTemplate, firstFilled } from '../../utils/fillTemplate.js'\nimport { pageFilter, pageSort } from '../../utils/pageControls.js'\nimport { readPath } from '../../utils/readPath.js'\nimport { dropOptionalUnresolved, hasUnresolvedTokens, resolveFilterTokens } from '../../utils/resolveFilterTokens.js'\n\nconst PAGE_REFRESH_CHANNEL = 'cn:page:refresh'\nconst PRESENTATIONS = ['rows', 'feed', 'inline']\n\n/**\n * Unwrap a value that may be a ref.\n *\n * @param {unknown} value The value.\n * @return {unknown} The plain value.\n */\nfunction unwrap(value) {\n\treturn value && typeof value === 'object' && 'value' in value ? value.value : value\n}\n\n/**\n * CnRecordListWidget — the objects of another schema that point at this\n * record, drawn as the boards draw them (screens-relation-pages).\n *\n * A person page lists its open cases (\"Verlichting fietspad Lindelaan,\n * 2026-0082 · Woo-verzoek, In behandeling, Termijn 1 nov\"), its latest contact\n * moments (an icon by channel, a meta line, the summary) and its relations\n * (\"Secretaris van Buurtvereniging Oost\"). Each is a list of another schema's\n * objects filtered on a reference to this record. The source keys are those of\n * `object-list` (`register`, `schema`, `filter` with the `@objectId` /\n * `@object.<field>` / `@workspace.<key>` tokens, `sort`, `limit`, `extend`,\n * `rowRoute`, `pageControls`); what differs is the drawing: `presentation` is `rows`, `feed`\n * or `inline`, and each line is a template (`\"{identifier} · {caseTypeName}\"`,\n * `\"Termijn {deadline|date}\"`).\n *\n * A content-only catalog type: on a card surface the detail host draws the\n * titled card. The widget emits `header` with `{ link, note }` (the\n * `headerLink` and `headerNote` with `{total}` filled in) for that card's\n * header.\n */\nexport default {\n\tname: 'CnRecordListWidget',\n\n\tcomponents: { ChevronRight, CnIcon, CnStatusBadge, NcLoadingIcon },\n\n\tinject: {\n\t\t/** Detail-page object context (`{ objectId, object, register, schema }`). */\n\t\tcnObjectContext: { default: null },\n\t\t/** Page workspace bag, for `@workspace.<key>` tokens. */\n\t\tcnWorkspaceContext: { default: null },\n\t\t/** The host app's translate function. */\n\t\tcnTranslate: { default: () => (key) => key },\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * The list config: `{ register, schema, filter?, sort?, limit?, extend?,\n\t\t * presentation?, title?, meta?, text?, label?, pill?, trailing?, icon?,\n\t\t * rowRoute?, rowIdField?, headerLink?, headerNote?, emptyText?, errorText? }`.\n\t\t *\n\t\t * @type {object}\n\t\t */\n\t\tcontent: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({}),\n\t\t},\n\n\t\t/** The current record's id, for the `@objectId` token. */\n\t\tobjectId: {\n\t\t\ttype: [String, Number],\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** The current record, for `@object.<field>` tokens. */\n\t\tobjectData: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\t},\n\n\temits: ['header'],\n\n\tdata() {\n\t\treturn {\n\t\t\trows: [],\n\t\t\ttotal: 0,\n\t\t\tloading: false,\n\t\t\terror: false,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/** @return {string} `rows`, `feed` or `inline`. */\n\t\tpresentation() {\n\t\t\tconst value = this.content?.presentation\n\t\t\treturn PRESENTATIONS.includes(value) ? value : 'rows'\n\t\t},\n\n\t\t/** @return {object} The token context: record, id and workspace. */\n\t\ttokenCtx() {\n\t\t\tconst injected = unwrap(this.cnObjectContext) || {}\n\t\t\treturn {\n\t\t\t\t...injected,\n\t\t\t\tobjectId: this.objectId ?? injected.objectId ?? this.objectData?.id ?? null,\n\t\t\t\tobject: this.objectData || injected.object || null,\n\t\t\t\tworkspace: unwrap(this.cnWorkspaceContext) || {},\n\t\t\t}\n\t\t},\n\n\t\t/** @return {object} The filter with its tokens resolved. */\n\t\tresolvedFilter() {\n\t\t\tconst filter = pageFilter(this.content?.pageControls, this.tokenCtx.workspace, this.content?.filter)\n\t\t\treturn dropOptionalUnresolved(resolveFilterTokens(filter, this.tokenCtx))\n\t\t},\n\n\t\t/** @return {boolean} A required token (the record id, say) has no value yet. */\n\t\twaiting() {\n\t\t\treturn hasUnresolvedTokens(this.resolvedFilter)\n\t\t},\n\n\t\t/** @return {object|null} The sort: the page's sort control when the widget listens to one, else its own. */\n\t\teffectiveSort() {\n\t\t\treturn pageSort(this.content?.pageControls, this.tokenCtx.workspace, this.content?.sort)\n\t\t},\n\n\t\t/** @return {number} The fetch cap. */\n\t\tlimit() {\n\t\t\tconst value = Number(this.content?.limit)\n\t\t\treturn Number.isFinite(value) && value > 0 ? Math.floor(value) : 5\n\t\t},\n\n\t\t/** @return {string} What a fetch depends on; a change fetches again. */\n\t\trequestKey() {\n\t\t\tconst c = this.content || {}\n\t\t\treturn JSON.stringify([c.register, c.schema, this.resolvedFilter, this.effectiveSort, this.limit, c.extend, this.waiting])\n\t\t},\n\n\t\t/** @return {Array<object>} The rows ready to draw. */\n\t\titems() {\n\t\t\tconst c = this.content || {}\n\t\t\treturn this.rows.slice(0, this.limit).map((row, index) => {\n\t\t\t\tconst link = this.rowLink(row)\n\t\t\t\treturn {\n\t\t\t\t\tkey: (row && (row.id || row['@self']?.id)) || `row-${index}`,\n\t\t\t\t\ttag: link ? 'router-link' : 'div',\n\t\t\t\t\tattrs: link ? { to: link } : {},\n\t\t\t\t\ttitle: this.fill(c.title, row),\n\t\t\t\t\tmeta: this.fill(c.meta, row),\n\t\t\t\t\ttext: this.fill(c.text, row),\n\t\t\t\t\tlabel: this.fill(c.label, row),\n\t\t\t\t\ttrailing: c.trailing ? firstFilled(c.trailing, row, this.translate) : '',\n\t\t\t\t\tpill: this.pillOf(row),\n\t\t\t\t\ticon: this.iconOf(row),\n\t\t\t\t}\n\t\t\t})\n\t\t},\n\n\t\t/** @return {object|null} The header link with `{total}` filled and tokens resolved. */\n\t\theaderLink() {\n\t\t\tconst link = this.content?.headerLink\n\t\t\tif (!link || typeof link !== 'object' || typeof link.label !== 'string' || link.label === '') {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tconst resolved = { label: this.withTotal(link.label) }\n\t\t\tif (link.route) {\n\t\t\t\tresolved.route = link.route\n\t\t\t\tif (link.params && typeof link.params === 'object') {\n\t\t\t\t\tresolved.params = resolveFilterTokens(link.params, this.tokenCtx)\n\t\t\t\t}\n\t\t\t\tif (link.query && typeof link.query === 'object') {\n\t\t\t\t\tresolved.query = resolveFilterTokens(link.query, this.tokenCtx)\n\t\t\t\t}\n\t\t\t} else if (typeof link.href === 'string') {\n\t\t\t\tresolved.href = link.href\n\t\t\t}\n\t\t\treturn resolved\n\t\t},\n\n\t\t/** @return {string} The header note with `{total}` filled. */\n\t\theaderNote() {\n\t\t\tconst note = this.content?.headerNote\n\t\t\treturn typeof note === 'string' && note !== '' ? this.withTotal(note) : ''\n\t\t},\n\n\t\t/** @return {string} The empty line. */\n\t\temptyLabel() {\n\t\t\treturn this.content?.emptyText ? this.translate(this.content.emptyText) : t('nextcloud-vue', 'Nothing here yet')\n\t\t},\n\n\t\t/** @return {string} The error line. */\n\t\terrorLabel() {\n\t\t\treturn this.content?.errorText ? this.translate(this.content.errorText) : t('nextcloud-vue', 'This list could not be loaded.')\n\t\t},\n\n\t\t/** @return {string} The spinner's accessible name. */\n\t\tloadingLabel() {\n\t\t\treturn t('nextcloud-vue', 'Loading …')\n\t\t},\n\t},\n\n\twatch: {\n\t\trequestKey() {\n\t\t\tthis.fetchRows()\n\t\t},\n\t},\n\n\tmounted() {\n\t\tthis.onRefresh = () => this.fetchRows()\n\t\tsubscribe(PAGE_REFRESH_CHANNEL, this.onRefresh)\n\t\tthis.fetchRows()\n\t},\n\n\tbeforeUnmount() {\n\t\tunsubscribe(PAGE_REFRESH_CHANNEL, this.onRefresh)\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Translate a manifest string through the host app.\n\t\t *\n\t\t * @param {string} text The text.\n\t\t * @return {string} The translation.\n\t\t */\n\t\ttranslate(text) {\n\t\t\treturn typeof this.cnTranslate === 'function' ? this.cnTranslate(text) : text\n\t\t},\n\n\t\t/**\n\t\t * Fill a template from a row, after translating it.\n\t\t *\n\t\t * @param {string} template The template.\n\t\t * @param {object} row The row.\n\t\t * @return {string} The text, '' when a token is empty.\n\t\t */\n\t\tfill(template, row) {\n\t\t\treturn typeof template === 'string' && template !== '' ? fillTemplate(this.translate(template), row) : ''\n\t\t},\n\n\t\t/**\n\t\t * Replace `{total}` in a translated label.\n\t\t *\n\t\t * @param {string} label The label.\n\t\t * @return {string} The text.\n\t\t */\n\t\twithTotal(label) {\n\t\t\treturn this.translate(label).replace(/\\{total\\}/g, String(this.total))\n\t\t},\n\n\t\t/**\n\t\t * The route a row opens: `rowRoute` with the id at `rowIdField`.\n\t\t *\n\t\t * @param {object} row The row.\n\t\t * @return {object|null} The router location, or null.\n\t\t */\n\t\trowLink(row) {\n\t\t\tconst route = this.content?.rowRoute\n\t\t\tif (!route || !this.$router || !row) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tconst field = this.content?.rowIdField\n\t\t\tconst id = field ? readPath(row, field) : (row.id || row['@self']?.id)\n\t\t\tif (id === null || id === undefined || id === '' || typeof id === 'object') {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\treturn { name: route, params: { id: String(id) } }\n\t\t},\n\n\t\t/**\n\t\t * The row's pill: `{ field, labels?, colorMap?, variant? }`.\n\t\t *\n\t\t * @param {object} row The row.\n\t\t * @return {{label: string, variant: string}|null} The pill, or null.\n\t\t */\n\t\tpillOf(row) {\n\t\t\tconst pill = this.content?.pill\n\t\t\tif (!pill || typeof pill !== 'object' || !pill.field) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tconst raw = readPath(row, pill.field)\n\t\t\tif (raw === null || raw === undefined || raw === '' || typeof raw === 'object') {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tconst key = String(raw)\n\t\t\tconst labels = pill.labels && typeof pill.labels === 'object' ? pill.labels : {}\n\t\t\tconst map = pill.colorMap && typeof pill.colorMap === 'object' ? pill.colorMap : {}\n\t\t\tconst found = Object.keys(map).find((k) => k.toLowerCase() === key.toLowerCase())\n\t\t\tconst variant = found ? map[found] : pill.variant\n\t\t\treturn {\n\t\t\t\tlabel: labels[key] ? this.translate(labels[key]) : key,\n\t\t\t\tvariant: isBadgeVariant(variant) ? variant : 'default',\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * The feed icon: an icon name, or `{ field, map, default }`.\n\t\t *\n\t\t * @param {object} row The row.\n\t\t * @return {string} The MDI icon name.\n\t\t */\n\t\ticonOf(row) {\n\t\t\tconst icon = this.content?.icon\n\t\t\tif (typeof icon === 'string' && icon !== '') {\n\t\t\t\treturn icon\n\t\t\t}\n\t\t\tif (icon && typeof icon === 'object') {\n\t\t\t\tconst raw = icon.field ? readPath(row, icon.field) : undefined\n\t\t\t\tconst map = icon.map && typeof icon.map === 'object' ? icon.map : {}\n\t\t\t\tif (raw !== null && raw !== undefined && map[String(raw)]) {\n\t\t\t\t\treturn map[String(raw)]\n\t\t\t\t}\n\t\t\t\tif (typeof icon.default === 'string' && icon.default !== '') {\n\t\t\t\t\treturn icon.default\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn 'CircleSmall'\n\t\t},\n\n\t\t/** Tell the card around this list what its header shows. */\n\t\temitHeader() {\n\t\t\t/**\n\t\t\t * @event header Emitted after every read with the card header's parts.\n\t\t\t * @type {{link: (object|null), note: string}} The header link (resolved, with `{total}` filled) and the note.\n\t\t\t */\n\t\t\tthis.$emit('header', { link: this.headerLink, note: this.headerNote })\n\t\t},\n\n\t\t/**\n\t\t * Fetch the list. Sends nothing while a required token is unresolved\n\t\t * or the source is incomplete.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync fetchRows() {\n\t\t\tconst c = this.content || {}\n\t\t\tif (!c.register || !c.schema || this.waiting) {\n\t\t\t\tthis.rows = []\n\t\t\t\tthis.total = 0\n\t\t\t\tthis.error = false\n\t\t\t\tthis.emitHeader()\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.loading = true\n\t\t\tthis.error = false\n\t\t\ttry {\n\t\t\t\tconst [{ default: axios }, { generateUrl }] = await Promise.all([\n\t\t\t\t\timport('@nextcloud/axios'),\n\t\t\t\t\timport('@nextcloud/router'),\n\t\t\t\t])\n\t\t\t\tconst url = generateUrl('/apps/openregister/api/objects/{register}/{schema}', { register: c.register, schema: c.schema })\n\t\t\t\tconst params = { _limit: this.limit }\n\t\t\t\tconst sort = this.effectiveSort\n\t\t\t\tif (sort && typeof sort === 'object' && sort.field) {\n\t\t\t\t\tparams[`_order[${sort.field}]`] = sort.dir === 'desc' ? 'desc' : 'asc'\n\t\t\t\t}\n\t\t\t\tif (Array.isArray(c.extend)) {\n\t\t\t\t\tconst extend = c.extend.filter((e) => typeof e === 'string' && e !== '')\n\t\t\t\t\tif (extend.length > 0) {\n\t\t\t\t\t\tparams._extend = extend\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfor (const [key, value] of Object.entries(this.resolvedFilter)) {\n\t\t\t\t\tif (value && typeof value === 'object' && !Array.isArray(value)) {\n\t\t\t\t\t\tfor (const [op, operand] of Object.entries(value)) {\n\t\t\t\t\t\t\tparams[`${key}[${op}]`] = operand\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (value !== '' && value !== null && value !== undefined) {\n\t\t\t\t\t\tparams[key] = value\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tconst response = await axios.get(url, { params })\n\t\t\t\tconst data = response && response.data ? response.data : {}\n\t\t\t\tthis.rows = Array.isArray(data.results) ? data.results : []\n\t\t\t\tthis.total = typeof data.total === 'number' ? data.total : this.rows.length\n\t\t\t} catch (e) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.warn('[CnRecordListWidget] failed to load objects:', e)\n\t\t\t\tthis.rows = []\n\t\t\t\tthis.total = 0\n\t\t\t\tthis.error = true\n\t\t\t} finally {\n\t\t\t\tthis.loading = false\n\t\t\t\tthis.emitHeader()\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-record-list__list {\n\tlist-style: none;\n\tmargin: 0;\n\tpadding: 0;\n}\n\n.cn-record-list__empty,\n.cn-record-list__error {\n\tcolor: var(--color-text-maxcontrast);\n\tmargin: 0;\n}\n\n.cn-record-list__loading {\n\tdisplay: flex;\n\tjustify-content: center;\n\tpadding: 8px 0;\n}\n\n/* rows */\n.cn-record-list--rows .cn-record-list__item + .cn-record-list__item {\n\tborder-top: 1px solid var(--color-border);\n}\n\n.cn-record-list__row {\n\talign-items: center;\n\tcolor: var(--color-main-text);\n\tdisplay: flex;\n\tgap: 16px;\n\tpadding: 12px 0;\n\ttext-decoration: none;\n}\n\n.cn-record-list__row--link:hover .cn-record-list__title,\n.cn-record-list__row--link:focus-visible .cn-record-list__title {\n\ttext-decoration: underline;\n}\n\n.cn-record-list__main {\n\tdisplay: flex;\n\tflex: 1 1 auto;\n\tflex-direction: column;\n\tgap: 2px;\n\tmin-width: 0;\n}\n\n.cn-record-list__title {\n\tfont-size: 15px;\n\tfont-weight: 700;\n}\n\n.cn-record-list__meta {\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 13px;\n}\n\n.cn-record-list__aside {\n\talign-items: center;\n\tdisplay: flex;\n\tflex: none;\n\tgap: 16px;\n}\n\n.cn-record-list__trailing {\n\tfont-size: 14px;\n\twhite-space: nowrap;\n}\n\n.cn-record-list__chevron {\n\tcolor: var(--color-text-maxcontrast);\n\tflex: none;\n}\n\n/* feed */\n.cn-record-list--feed .cn-record-list__item + .cn-record-list__item {\n\tborder-top: 1px solid var(--color-border);\n}\n\n.cn-record-list__feed-row {\n\talign-items: flex-start;\n\tdisplay: flex;\n\tgap: 14px;\n\tpadding: 12px 0;\n}\n\n.cn-record-list__feed-icon {\n\talign-items: center;\n\tbackground: var(--color-primary-element-light);\n\tborder-radius: 50%;\n\tcolor: var(--color-primary-element-light-text, var(--color-primary-element));\n\tdisplay: flex;\n\tflex: none;\n\theight: 36px;\n\tjustify-content: center;\n\twidth: 36px;\n}\n\n.cn-record-list__text {\n\tfont-size: 15px;\n}\n\n.cn-record-list--feed .cn-record-list__main {\n\tcolor: var(--color-main-text);\n\ttext-decoration: none;\n}\n\n/* inline */\n.cn-record-list__inline-row {\n\tpadding: 4px 0;\n}\n\n.cn-record-list__label {\n\tmargin-inline-end: 4px;\n}\n\n.cn-record-list__inline-title {\n\tcolor: var(--color-main-text);\n}\n\na.cn-record-list__inline-title {\n\tcolor: var(--color-primary-element);\n\ttext-decoration: underline;\n}\n</style>\n\n<style>\n/* In a narrow side column a row stacks: title, meta, then pill and date. */\n.cn-detail-page__side .cn-record-list__row {\n\talign-items: flex-start;\n\tflex-direction: column;\n\tgap: 6px;\n}\n\n.cn-detail-page__side .cn-record-list__row .cn-record-list__title {\n\tcolor: var(--color-primary-element);\n\ttext-decoration: underline;\n}\n\n.cn-detail-page__side .cn-record-list__chevron {\n\tdisplay: none;\n}\n</style>\n"],"names":["_normalizeClass","_createElementBlock","_toDisplayString","_openBlock","_createVNode","_createBlock","_resolveDynamicComponent","_mergeProps","_createElementVNode","_createTextVNode"],"mappings":";;;;AAeO,EAAA,KAAA,EAAA,uBAAA;AAAA,EAAA,aAAA,EAAA,sBAAA;;;;AAGF,EAAA,KAAA,EAAA,yBAAA;;;;AAGmB,EAAA,KAAA,EAAA,uBAAA;AAAA,EAAA,aAAA,EAAA,sBAAA;;;;AAGX,EAAA,KAAK,EAAC,sBAAkB;;AAa1B,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,sBAAE,GAAA;;;AACG,EAAA,KAAA,EAAA,uBAAA;;;;AACO,EAAA,KAAC,EAAA,sBAAA;;;;AAET,EAAA,KAAA,EAAA,uBAAA;;;;AAMN,EAAA,KAAA,EAAA,0BAAA;;;;AAU8B,EAAA,KAAK,EAAC,0BAA0B;;;AACnE,EAAA,KAAM,EAAC,2BAA2B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A;8BAAD,IAAC,EAAA,IAAA,CAAA,IAAA;AAAA,8BAAA,IAAA,EAAA,EAAA;;;oDAKCE,8CAAA;6CAFX,MAAsD;AAAzC,8BAAA,CAAA,IAAG,CAAC,IAAI;AAArB,mCAAAH,SAAA,EAAA,EAAAF,kBAAA,CAAsD,MAAtD,EAAA,WAAsD,EAAAC,eAAA,CAAA,IAAA,CAAA,IAAA,CAAA,EAAA,CAAA,YAAA;;AAC1C,8BAAA,CAAA,IAAI,CAAC,IAAI;AAArB,mCAAAC,SAAA,EAAA,EAAAF,kBAAA,CAA4C,MAA5C,EAAA,WAA4C,EAAAC,eAAA,CAAA,IAAA,CAAA,IAAA,CAAA,EAAA,CAAA,YAAA;;;;;;AAK9C,yBAAAC,SAAA,EAAA,EAAAF,kBAAA,QAAA;AACG,0BAAA,CAAA,IAAA,CAAA,KAAA;AAAF,+BAAAE,SAAA,EAAA,EAAAF,kBAAA,CAAE,MAAF,EAAA,WAAE,EAAAC,eAAA,CAAA,IAAA,CAAA,KAAA,CAAA,EAAA,CAAA,YAAA;;AACF,2BAAAC,SAAA,EAAA,EAAAE,WAAA,wBAAC,CAAA,IAAA,CAAA,GAAA,CAAD,EAAAE,UAAA,GAAC,KAAA,EAAA,8BAAA,EAAA,EAAA,EAAA,OAAA,EAAA,IAAA,EAAA,EAAA,IAAA,CAAA,KAAA,CAAA,EAAA;6CACA,MAAA;AAAA,8BAAAE,eAAA,CAAAP,eAAA,CAAA,IAAA,CAAA,KAAA,CAAA,EAAA,CAAA,YAAA;;;;;;;;;;;;;"}
@@ -2,6 +2,7 @@ import { subscribe, unsubscribe } from '@nextcloud/event-bus';
2
2
  import __sfc_main from '../CnStatsBlock/CnStatsBlock.vue.js';
3
3
  import { useDataSource } from '../../composables/useDataSource.js';
4
4
  import { unwrapAppConfig, normalizeMetricFormat, formatMetricValue } from '../../utils/formatMetric.js';
5
+ import { resolveHref, followLinkClick } from '../../utils/linkNavigation.js';
5
6
  import { dropOptionalUnresolved, resolveFilterTokens, hasUnresolvedTokens } from '../../utils/resolveFilterTokens.js';
6
7
 
7
8
  /**
@@ -93,6 +94,8 @@ var script = {
93
94
  * currency (`currency`) and `@config.<key>` tokens in `format`.
94
95
  */
95
96
  cnAppConfig: { default: () => ({}) },
97
+ /** The host's label lookup (CnAppRoot provides it); identity without one. */
98
+ cnTranslate: { default: () => (key) => key },
96
99
  },
97
100
 
98
101
  props: {
@@ -190,7 +193,10 @@ var script = {
190
193
 
191
194
  /**
192
195
  * `stacked` gives every block the board look (see CnStatsBlock
193
- * `layout`). Empty (the default) keeps the KPI card.
196
+ * `layout`). `rows` draws the title and then one row per entry (or the
197
+ * single source): the label on the left, the number on the right, the
198
+ * label a link when the entry has a `route`. Empty (the default) keeps
199
+ * the KPI card.
194
200
  *
195
201
  * @spec openspec/changes/zuiddrecht-pixel-gaps-3/specs/zuiddrecht-pixel-gaps-3/spec.md#requirement-a-stats-block-can-take-the-stacked-board-look
196
202
  */
@@ -279,6 +285,52 @@ var script = {
279
285
  return Array.isArray(this.entries) && this.entries.length > 0
280
286
  },
281
287
 
288
+ /**
289
+ * Whether the widget draws label/number rows (`layout: "rows"`).
290
+ *
291
+ * @return {boolean}
292
+ */
293
+ isRows() {
294
+ return this.layout === 'rows'
295
+ },
296
+
297
+ /**
298
+ * The rows of the rows layout: one per entry, or a single row from the
299
+ * `dataSource` (labelled by `countLabel`). A row is `{ key, label,
300
+ * display, variant, route, href }`; `display` is the formatted value,
301
+ * a dash while it loads or when the count could not be read.
302
+ *
303
+ * @return {Array<object>}
304
+ */
305
+ rowViews() {
306
+ if (!this.hasEntries) {
307
+ const formatted = this.formattedSingle;
308
+ return [{
309
+ key: 'single',
310
+ label: this.tl(this.countLabel),
311
+ display: this.loading ? '\u2014' : (formatted !== null ? formatted : this.formatCount(this.resolvedCount)),
312
+ variant: this.variant || 'default',
313
+ route: this.route,
314
+ href: this.route ? resolveHref(this.route, this.$router) : '',
315
+ }]
316
+ }
317
+ return this.entryViews.map((view) => {
318
+ const resolved = view.resolved === true;
319
+ let display = '\u2014';
320
+ if (resolved) {
321
+ display = view.formatted !== null ? view.formatted : this.formatCount(view.count);
322
+ }
323
+ return {
324
+ key: view.key,
325
+ label: this.tl(view.entry.title || ''),
326
+ display,
327
+ variant: view.entry.variant || 'default',
328
+ route: view.route,
329
+ href: view.route ? resolveHref(view.route, this.$router) : '',
330
+ }
331
+ })
332
+ },
333
+
282
334
  /**
283
335
  * The unwrapped detail-page object context for token resolution, or
284
336
  * null on surfaces (dashboards) that don't provide one.
@@ -492,6 +544,37 @@ var script = {
492
544
  },
493
545
 
494
546
  methods: {
547
+ /**
548
+ * A manifest string through the host's label lookup.
549
+ *
550
+ * @param {string} text The text as written in the manifest.
551
+ * @return {string} The translated text.
552
+ */
553
+ tl(text) {
554
+ return typeof this.cnTranslate === 'function' ? this.cnTranslate(text) : text
555
+ },
556
+
557
+ /**
558
+ * A count in the user's locale.
559
+ *
560
+ * @param {number} count The count.
561
+ * @return {string} The localized count.
562
+ */
563
+ formatCount(count) {
564
+ return new Intl.NumberFormat().format(count)
565
+ },
566
+
567
+ /**
568
+ * Follow a row label's link in the router, leaving a modified click to the browser.
569
+ *
570
+ * @param {MouseEvent} event The click.
571
+ * @param {object} route The route location.
572
+ * @return {void}
573
+ */
574
+ onRowClick(event, route) {
575
+ followLinkClick(event, route, this.$router);
576
+ },
577
+
495
578
  /**
496
579
  * Re-query the tile's counts — the REST `/value` aggregation, the
497
580
  * per-entry counts of multi-entry mode, and the `dataSource` GraphQL
@@ -1 +1 @@
1
- {"version":3,"file":"CnStatsBlockWidget.vue2.js","sources":["../../../../src/components/CnStatsBlockWidget/CnStatsBlockWidget.vue"],"sourcesContent":["<!--\n CnStatsBlockWidget — Manifest-driven stats block.\n\n Thin wrapper around CnStatsBlock that pulls its count from a\n `dataSource` block on a dashboard widget definition. The\n dispatcher in CnDashboardPage mounts this when\n `widgetDef.type === 'stats-block'`.\n\n ADR-049 enrichment: an optional `entries[]` renders N related KPIs in one\n card, each entry self-fetching its own token-resolved count over the same\n REST /value aggregation. Exactly one of `dataSource` / `entries` must be\n provided; the single-`dataSource` path is unchanged.\n\n Static usage (no data fetching) is intentionally NOT supported —\n use CnStatsBlock directly when you already have a count number.\n-->\n<template>\n\t<div\n\t\tclass=\"cn-stats-block-widget\"\n\t\t:class=\"[iconClass, { 'cn-stats-block-widget--multi': hasEntries }]\">\n\t\t<!-- Multi-entry mode: one KPI per entry, all inside this widget card.\n\t\t An entry with hideWhenZero whose resolved count is 0 is omitted. -->\n\t\t<template v-if=\"hasEntries\">\n\t\t\t<CnStatsBlock\n\t\t\t\tv-for=\"view in entryViews\"\n\t\t\t\t:key=\"view.key\"\n\t\t\t\t:title=\"view.entry.title || ''\"\n\t\t\t\t:count=\"view.count\"\n\t\t\t\t:countLabel=\"view.entry.countLabel || ''\"\n\t\t\t\t:loading=\"view.loading\"\n\t\t\t\t:variant=\"view.entry.variant || 'default'\"\n\t\t\t\t:showZeroCount=\"showZeroCount\"\n\t\t\t\t:horizontal=\"horizontal\"\n\t\t\t\t:vertical=\"vertical\"\n\t\t\t\t:layout=\"layout\"\n\t\t\t\t:filled=\"filled\"\n\t\t\t\t:clickable=\"!!view.route\"\n\t\t\t\t:route=\"view.route || null\">\n\t\t\t\t<!-- An entry with a `format` (or `currency` / `currencyField`)\n\t\t\t\t shows its value formatted, money in its own currency. -->\n\t\t\t\t<template v-if=\"view.formatted !== null\" #value>\n\t\t\t\t\t{{ view.formatted }}\n\t\t\t\t</template>\n\t\t\t</CnStatsBlock>\n\t\t</template>\n\n\t\t<!-- Single-source mode (pre-existing interface, unchanged). -->\n\t\t<CnStatsBlock\n\t\t\tv-else\n\t\t\t:title=\"title\"\n\t\t\t:count=\"resolvedCount\"\n\t\t\t:countLabel=\"countLabel\"\n\t\t\t:loading=\"loading\"\n\t\t\t:variant=\"variant\"\n\t\t\t:showZeroCount=\"showZeroCount\"\n\t\t\t:horizontal=\"horizontal\"\n\t\t\t:vertical=\"vertical\"\n\t\t\t:layout=\"layout\"\n\t\t\t:filled=\"filled\"\n\t\t\t:clickable=\"!!route\"\n\t\t\t:route=\"route\">\n\t\t\t<template v-if=\"formattedSingle !== null\" #value>\n\t\t\t\t{{ formattedSingle }}\n\t\t\t</template>\n\t\t</CnStatsBlock>\n\t</div>\n</template>\n\n<script>\nimport { subscribe, unsubscribe } from '@nextcloud/event-bus'\nimport CnStatsBlock from '../CnStatsBlock/CnStatsBlock.vue'\nimport { useDataSource } from '../../composables/useDataSource.js'\nimport { formatMetricValue, normalizeMetricFormat, unwrapAppConfig } from '../../utils/formatMetric.js'\nimport { dropOptionalUnresolved, hasUnresolvedTokens, resolveFilterTokens } from '../../utils/resolveFilterTokens.js'\n\n// The canonical KPI scale (`--cn-kpi-*`) lives in one stylesheet. Imported\n// here as well as from css/index.css so the tokens resolve even when the\n// consuming app pulls in components individually.\nimport '../../css/kpi-card.css'\n\n/**\n * Event-bus channel the PAGE-level Refresh action broadcasts on\n * (CnDashboardPage / CnDetailPage pass it to their CnActionsMenu).\n */\nconst PAGE_REFRESH_BUS_CHANNEL = 'cn:page:refresh'\n\n/**\n * CnStatsBlockWidget — Stats-block dashboard widget.\n *\n * Reads a `dataSource` block (manifest shorthand or raw GraphQL)\n * and forwards the resolved count to CnStatsBlock. Loading state\n * propagates through; resolution errors fall back to count = 0\n * with an empty-state label so the dashboard doesn't blank.\n *\n * Multi-entry mode (ADR-049 / list-widget-enrichment): an `entries[]`\n * array renders N KPIs in one card. Each entry carries the same source\n * contract as a `type:\"stat\"` widget (`register`, `schema`, `metric`,\n * `field`, token-resolved `filter`) plus per-entry presentation\n * (`title`, `variant`, `countLabel`), an optional `route` deep link, and\n * `hideWhenZero` (the entry is omitted when its resolved count is 0).\n *\n * An entry formats its value with `format` (a style name such as\n * `\"currency\"`, or `{ style, currency, currencyField, decimals, prefix,\n * suffix }`), as a `type:\"stat\"` widget's `content.format` does. A money\n * value takes the currency from `currencyField` (a field of the detail\n * page's object, e.g. a contract's own `currency`), then `currency` (a code\n * or `@config.currency`), then the app's reporting currency, then EUR, and\n * is formatted in the user's locale. `currency` / `currencyField` may sit on\n * the entry itself and imply `format: \"currency\"`.\n * Exactly one of `dataSource` / `entries` must be provided — when\n * `entries` is absent, the single-`dataSource` path renders exactly as\n * before.\n *\n * Manifest example (decidesk dashboard):\n * ```json\n * {\n * \"id\": \"minutes-in-review\",\n * \"type\": \"stats-block\",\n * \"title\": \"Notulen ter goedkeuring\",\n * \"iconClass\": \"icon-file\",\n * \"props\": { \"countLabel\": \"notulen\", \"variant\": \"warning\" },\n * \"dataSource\": {\n * \"register\": \"decidesk\",\n * \"schema\": \"minutes\",\n * \"filter\": { \"lifecycle\": \"review\" },\n * \"aggregate\": \"count\"\n * }\n * }\n * ```\n *\n * Multi-entry example (a grouped retention card):\n * ```json\n * {\n * \"widgetKey\": \"stats-block\",\n * \"props\": {\n * \"entries\": [\n * { \"title\": \"Expiring soon\", \"register\": \"docudesk\", \"schema\": \"document\",\n * \"filter\": { \"retention\": { \"lt\": \"@today+30d\" } }, \"variant\": \"warning\",\n * \"route\": { \"name\": \"documents\" }, \"hideWhenZero\": true },\n * { \"title\": \"Archived\", \"register\": \"docudesk\", \"schema\": \"document\",\n * \"filter\": { \"status\": \"archived\" } }\n * ]\n * }\n * }\n * ```\n */\nexport default {\n\tname: 'CnStatsBlockWidget',\n\n\tcomponents: { CnStatsBlock },\n\n\tinject: {\n\t\t/**\n\t\t * Detail-page object context provided by CnDetailPage — enables\n\t\t * `@objectId` / `@object.<field>` tokens in an entry's `filter`.\n\t\t * Null on dashboards.\n\t\t */\n\t\tcnObjectContext: { default: null },\n\t\t/**\n\t\t * Page-level workspace context (reactive `ref({})`) provided by\n\t\t * CnDashboardPage — enables `@workspace.<key>` tokens in an entry's\n\t\t * `filter`. Null on pages that don't provide it.\n\t\t */\n\t\tcnWorkspaceContext: { default: null },\n\t\t/**\n\t\t * Page-level app config provided by the page — the reporting\n\t\t * currency (`currency`) and `@config.<key>` tokens in `format`.\n\t\t */\n\t\tcnAppConfig: { default: () => ({}) },\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * Manifest dataSource block. See `useDataSource`. Exactly one of\n\t\t * `dataSource` / `entries` must be provided — a stats-block widget\n\t\t * without any source has no count to render (flagged with a console\n\t\t * error at mount).\n\t\t *\n\t\t * @type {{\n\t\t * register?: string,\n\t\t * schema?: string,\n\t\t * filter?: object,\n\t\t * aggregate?: 'count',\n\t\t * graphql?: { query: string, variables?: object, selectors: object }\n\t\t * }}\n\t\t */\n\t\tdataSource: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * Multi-entry declarative sources (ADR-049). Each entry renders one\n\t\t * KPI within this widget's card and self-fetches its own count over\n\t\t * the REST /value aggregation: `{ title, register, schema, metric,\n\t\t * field, filter, route, variant, countLabel, hideWhenZero }`. Filter\n\t\t * values use the shared @-token grammar (`@today`, `@me`,\n\t\t * `@workspace.*`, `?`-optional clauses). An entry with `hideWhenZero`\n\t\t * is omitted when its resolved count is 0. Mutually exclusive with\n\t\t * `dataSource`; defaults to empty (single-source mode).\n\t\t *\n\t\t * @type {Array<object>}\n\t\t */\n\t\tentries: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t\t/**\n\t\t * How the single-source value is shown: a style name (`'currency'`,\n\t\t * `'number'`, `'percent'`, `'decimal'`, `'duration-hours'`) or\n\t\t * `{ style, currency, currencyField, decimals, prefix, suffix }`.\n\t\t * Empty (the default) shows the plain localized count. Entries carry\n\t\t * their own `format`.\n\t\t *\n\t\t * @type {string|object|null}\n\t\t */\n\t\tformat: {\n\t\t\ttype: [String, Object],\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** Block title (manifest `widgetDef.title`). */\n\t\ttitle: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** Label displayed next to the count. */\n\t\tcountLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** Color variant: default | primary | success | warning | error. */\n\t\tvariant: {\n\t\t\ttype: String,\n\t\t\tdefault: 'default',\n\t\t},\n\n\t\t/** Whether to show 0 as a real count instead of the empty label. */\n\t\tshowZeroCount: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true,\n\t\t},\n\n\t\t/**\n\t\t * Lay the icon left of the content. The canonical KPI card already\n\t\t * does this, so the prop is redundant and kept only for existing\n\t\t * callers.\n\t\t *\n\t\t * @deprecated since 2.25.0, the horizontal layout is the default.\n\t\t */\n\t\thorizontal: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/** Stack the icon above a centred number instead of beside it. */\n\t\tvertical: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * `stacked` gives every block the board look (see CnStatsBlock\n\t\t * `layout`). Empty (the default) keeps the KPI card.\n\t\t *\n\t\t * @spec openspec/changes/zuiddrecht-pixel-gaps-3/specs/zuiddrecht-pixel-gaps-3/spec.md#requirement-a-stats-block-can-take-the-stacked-board-look\n\t\t */\n\t\tlayout: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Draw each tile's own grey box. Off by default — the widget is\n\t\t * rendered inside a CnWidgetWrapper that already draws a card.\n\t\t */\n\t\tfilled: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * Vue-router location to navigate to on click. When set, the\n\t\t * inner CnStatsBlock renders as a `<router-link>`.\n\t\t *\n\t\t * @type {object|null}\n\t\t */\n\t\troute: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * Optional CSS class applied to the widget's outermost wrapping\n\t\t * `<div>`. Designed for Nextcloud core icon classes (`icon-link`,\n\t\t * `icon-mail`, `icon-history`, …) that ship with NC and render a\n\t\t * 16×16 glyph via background-image. When empty (the default), the\n\t\t * wrapper carries only the base `cn-stats-block-widget` class and\n\t\t * is visually invisible.\n\t\t *\n\t\t * The wrapping element is a `<div>` with no layout styles of its\n\t\t * own, so the rendered KPI tile keeps the same dimensions and\n\t\t * spacing it had before this prop was added.\n\t\t *\n\t\t * MDI icon names (e.g. `'Database'`) are NOT supported here — that\n\t\t * would require an async dynamic-import. Use `CnStatsBlock`\n\t\t * directly when you need an MDI Vue component icon.\n\t\t */\n\t\ticonClass: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\t},\n\n\tsetup(props) {\n\t\t// GraphQL count path is hidden from useDataSource when a plain\n\t\t// register+schema source is given — that case is served over REST\n\t\t// (fetchRest) against OpenRegister's /value aggregation, which is more\n\t\t// robust than the GraphQL count shorthand. Raw `graphql` still flows here.\n\t\tconst dsForGraphql = () => {\n\t\t\tconst ds = props.dataSource\n\t\t\tif (ds && ds.register && ds.schema && !ds.graphql) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\treturn ds\n\t\t}\n\t\tconst { data, loading, error, refetch } = useDataSource(dsForGraphql)\n\t\treturn { dsData: data, loading, error, dsRefetch: refetch }\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\trestCount: null,\n\t\t\t/** @type {Array<number|null>} Per-entry resolved counts (multi-entry mode; null = pending/failed). */\n\t\t\tentryCounts: [],\n\t\t\t/** @type {Array<boolean>} Per-entry fetch-in-flight flags (multi-entry mode). */\n\t\t\tentryFetching: [],\n\t\t\t/** Monotonic id used to discard a stale entries batch when `entries` changes mid-flight. */\n\t\t\tentriesRequestId: 0,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/**\n\t\t * Whether the widget runs in multi-entry mode (`entries[]` supplied).\n\t\t *\n\t\t * @return {boolean}\n\t\t */\n\t\thasEntries() {\n\t\t\treturn Array.isArray(this.entries) && this.entries.length > 0\n\t\t},\n\n\t\t/**\n\t\t * The unwrapped detail-page object context for token resolution, or\n\t\t * null on surfaces (dashboards) that don't provide one.\n\t\t *\n\t\t * @return {object|null}\n\t\t */\n\t\tobjectCtx() {\n\t\t\tconst c = this.cnObjectContext\n\t\t\tif (!c) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\treturn (typeof c === 'object' && 'value' in c) ? c.value : c\n\t\t},\n\n\t\t/**\n\t\t * The unwrapped workspace context bag (or null). Vue 2.7 inject may\n\t\t * hand back a raw ref; unwrap `.value` for token resolution.\n\t\t *\n\t\t * @return {object|null}\n\t\t */\n\t\tworkspaceCtx() {\n\t\t\tconst c = this.cnWorkspaceContext\n\t\t\tif (!c) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\treturn (typeof c === 'object' && 'value' in c) ? c.value : c\n\t\t},\n\n\t\t/**\n\t\t * The page-level app config map (reporting currency, `@config` keys).\n\t\t *\n\t\t * @return {object}\n\t\t */\n\t\tconfigCtx() {\n\t\t\treturn unwrapAppConfig(this.cnAppConfig)\n\t\t},\n\n\t\t/**\n\t\t * The detail page's object, or null on a dashboard. Its fields feed\n\t\t * an entry's `currencyField`.\n\t\t *\n\t\t * @return {object|null}\n\t\t */\n\t\tpageObject() {\n\t\t\tconst object = this.objectCtx && this.objectCtx.object\n\t\t\treturn object && typeof object === 'object' ? object : null\n\t\t},\n\n\t\t/**\n\t\t * The single-source value formatted per `format`, or null to keep\n\t\t * the plain count.\n\t\t *\n\t\t * @return {string|null}\n\t\t * @spec openspec/changes/stat-currency-from-object/specs/dashboard-page/spec.md#requirement-a-stats-block-entry-formats-its-value\n\t\t */\n\t\tformattedSingle() {\n\t\t\tconst fmt = normalizeMetricFormat({ format: this.format })\n\t\t\tif (!fmt || this.loading) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\treturn formatMetricValue(this.resolvedCount, fmt, this.configCtx, this.pageObject)\n\t\t},\n\n\t\t/**\n\t\t * Token-resolution context for entry filters, merged from the\n\t\t * detail-page object context and the page-level workspace bag.\n\t\t *\n\t\t * @return {object}\n\t\t */\n\t\ttokenCtx() {\n\t\t\tconst base = this.objectCtx ? { ...this.objectCtx } : {}\n\t\t\tbase.workspace = this.workspaceCtx || {}\n\t\t\treturn base\n\t\t},\n\n\t\t/**\n\t\t * Renderable view models for multi-entry mode: each entry paired with\n\t\t * its fetched count and loading flag, with `hideWhenZero` entries\n\t\t * whose resolved count is 0 omitted.\n\t\t *\n\t\t * @return {Array<{entry: object, key: string, count: number, loading: boolean, formatted: (string|null)}>}\n\t\t * @spec openspec/changes/stat-currency-from-object/specs/dashboard-page/spec.md#requirement-a-stats-block-entry-formats-its-value\n\t\t */\n\t\tentryViews() {\n\t\t\treturn (this.entries || [])\n\t\t\t\t.map((entry, i) => {\n\t\t\t\t\tconst raw = this.entryCounts[i]\n\t\t\t\t\tconst resolved = typeof raw === 'number'\n\t\t\t\t\tconst fmt = normalizeMetricFormat(entry)\n\t\t\t\t\treturn {\n\t\t\t\t\t\t// The value as the entry's `format` says, money in the\n\t\t\t\t\t\t// currency the entry names; null keeps the plain count.\n\t\t\t\t\t\tformatted: fmt && resolved ? formatMetricValue(raw, fmt, this.configCtx, this.pageObject) : null,\n\t\t\t\t\t\tentry: entry || {},\n\t\t\t\t\t\tkey: `${(entry && entry.register) || ''}/${(entry && entry.schema) || ''}/${i}`,\n\t\t\t\t\t\tcount: resolved ? raw : 0,\n\t\t\t\t\t\tloading: !!this.entryFetching[i],\n\t\t\t\t\t\tresolved,\n\t\t\t\t\t\t// Token-resolve the deep link the same way entry.filter\n\t\t\t\t\t\t// is resolved — `route.query: { case: \"@objectId\" }` must\n\t\t\t\t\t\t// land on the target pre-scoped, never as a literal token\n\t\t\t\t\t\t// (ADR-062; parity with object-list's viewAllQuery).\n\t\t\t\t\t\troute: this.resolveEntryRoute(entry && entry.route),\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\t.filter((view) => !(view.entry.hideWhenZero && view.resolved && view.count === 0))\n\t\t},\n\n\t\t/**\n\t\t * Stable signature of a REST-fetchable source (else null).\n\t\t *\n\t\t * @spec openspec/specs/dashboard-page/spec.md\n\t\t */\n\t\trestKey() {\n\t\t\tconst ds = this.dataSource || {}\n\t\t\tif (!ds.register || !ds.schema || ds.graphql) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\treturn JSON.stringify({\n\t\t\t\tregister: ds.register,\n\t\t\t\tschema: ds.schema,\n\t\t\t\tmetric: ds.metric || (ds.aggregate === 'count' ? 'count' : 'count'),\n\t\t\t\tfield: ds.field || '',\n\t\t\t\tfilter: ds.filter || {},\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * Stable signature of the multi-entry sources INCLUDING their\n\t\t * token-resolved filters, so the watcher refetches when page-level\n\t\t * state a `@workspace.*` token reads changes.\n\t\t *\n\t\t * @return {string|null}\n\t\t */\n\t\tentriesKey() {\n\t\t\tif (!this.hasEntries) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\treturn JSON.stringify(this.entries.map((entry) => ({\n\t\t\t\tregister: (entry && entry.register) || '',\n\t\t\t\tschema: (entry && entry.schema) || '',\n\t\t\t\tmetric: (entry && entry.metric) || 'count',\n\t\t\t\tfield: (entry && entry.field) || '',\n\t\t\t\tfilter: this.resolvedEntryFilter(entry),\n\t\t\t})))\n\t\t},\n\n\t\tresolvedCount() {\n\t\t\tif (typeof this.restCount === 'number') {\n\t\t\t\treturn this.restCount\n\t\t\t}\n\t\t\tconst value = this.dsData?.count\n\t\t\tif (typeof value === 'number') {\n\t\t\t\treturn value\n\t\t\t}\n\t\t\tif (typeof value === 'string') {\n\t\t\t\tconst parsed = Number(value)\n\t\t\t\treturn Number.isFinite(parsed) ? parsed : 0\n\t\t\t}\n\t\t\treturn 0\n\t\t},\n\t},\n\n\twatch: {\n\t\trestKey() {\n\t\t\tthis.fetchRest()\n\t\t},\n\n\t\tentriesKey() {\n\t\t\tthis.fetchEntries()\n\t\t},\n\t},\n\n\tcreated() {\n\t\t// \"Exactly one of dataSource / entries\" — a misconfigured widget\n\t\t// fails loudly (console error + no counts) instead of rendering an\n\t\t// ambiguous card. Vue 2 prop validators cannot see sibling props, so\n\t\t// the cross-prop rule lives here (and, for manifests, in\n\t\t// validateManifestV2's post-schema check).\n\t\tconst hasDataSource = !!this.dataSource\n\t\tif (hasDataSource === this.hasEntries) {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.error('[CnStatsBlockWidget] Exactly one of `dataSource` / `entries` must be provided.')\n\t\t}\n\t},\n\n\tmounted() {\n\t\tthis.fetchRest()\n\t\tthis.fetchEntries()\n\t\t// Page-level Refresh. This tile is now rendered inside CnWidgetWrapper\n\t\t// like every other widget (it went flat in 2026-08-30's KPI-card\n\t\t// change, so the wrapper is what draws its card), but it is registered\n\t\t// as a CARD widget and cards carry no per-widget Actions menu — so the\n\t\t// page action is still its only refresh affordance. It reached nothing\n\t\t// before this subscription: the counts come from `fetchRest` /\n\t\t// `fetchEntries` and the useDataSource GraphQL path, none of which\n\t\t// subscribe on their own. No widgetId to match: a page refresh\n\t\t// refreshes everything on the page.\n\t\tthis._onPageRefresh = (payload) => {\n\t\t\tconst done = this.refresh()\n\t\t\tpayload?.waitUntil?.(done)\n\t\t}\n\t\tsubscribe(PAGE_REFRESH_BUS_CHANNEL, this._onPageRefresh)\n\t},\n\n\tbeforeUnmount() {\n\t\tif (this._onPageRefresh) {\n\t\t\tunsubscribe(PAGE_REFRESH_BUS_CHANNEL, this._onPageRefresh)\n\t\t\tthis._onPageRefresh = null\n\t\t}\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Re-query the tile's counts — the REST `/value` aggregation, the\n\t\t * per-entry counts of multi-entry mode, and the `dataSource` GraphQL\n\t\t * path. Exposed as a ref-callable method for parity with the other data\n\t\t * widgets, and invoked by the page-level Refresh subscription.\n\t\t *\n\t\t * @return {Promise<unknown[]>} Settles when every re-query has.\n\t\t */\n\t\trefresh() {\n\t\t\treturn Promise.all([\n\t\t\t\ttypeof this.dsRefetch === 'function' ? this.dsRefetch() : null,\n\t\t\t\tthis.fetchRest(),\n\t\t\t\tthis.fetchEntries(),\n\t\t\t])\n\t\t},\n\n\t\t/**\n\t\t * An entry's `route` deep link with `@`-tokens in `query` / `params`\n\t\t * resolved against `tokenCtx` (same treatment as `entry.filter`), so\n\t\t * a KPI card can deep-link to an index pre-scoped to the current\n\t\t * object. Unresolved optional query clauses are dropped; a route\n\t\t * whose query still carries a REQUIRED unresolved token is returned\n\t\t * without that query entry resolution left as-is (router will show\n\t\t * the unfiltered index rather than a broken literal-token filter).\n\t\t *\n\t\t * @param {object|string|null} route The entry's route location.\n\t\t * @return {object|string|null} The token-resolved route.\n\t\t */\n\t\tresolveEntryRoute(route) {\n\t\t\tif (!route || typeof route !== 'object') {\n\t\t\t\treturn route || null\n\t\t\t}\n\t\t\tconst out = { ...route }\n\t\t\tif (out.query && typeof out.query === 'object') {\n\t\t\t\tout.query = dropOptionalUnresolved(resolveFilterTokens(out.query, this.tokenCtx))\n\t\t\t}\n\t\t\tif (out.params && typeof out.params === 'object') {\n\t\t\t\tout.params = resolveFilterTokens(out.params, this.tokenCtx)\n\t\t\t}\n\t\t\treturn out\n\t\t},\n\n\t\t/**\n\t\t * An entry's filter with every @-token resolved against `tokenCtx`\n\t\t * and UNRESOLVED OPTIONAL clauses (`@workspace.<key>?`) dropped.\n\t\t *\n\t\t * @param {object} entry The entry definition.\n\t\t * @return {object} The resolved filter map.\n\t\t */\n\t\tresolvedEntryFilter(entry) {\n\t\t\treturn dropOptionalUnresolved(resolveFilterTokens((entry && entry.filter) || {}, this.tokenCtx))\n\t\t},\n\n\t\t/**\n\t\t * Fetch one count/value over REST from OpenRegister's /value\n\t\t * aggregation. Shared by the single-`dataSource` path and the\n\t\t * per-entry multi-entry path. Lazily imports axios/router (the\n\t\t * library never hard-depends on them at module load).\n\t\t *\n\t\t * @param {{register: string, schema: string, metric?: string, aggregate?: string, field?: string}} src The source block.\n\t\t * @param {object} filter The ALREADY-RESOLVED filter map.\n\t\t * @return {Promise<number|null>} The value, or null on failure.\n\t\t */\n\t\tasync fetchValue(src, filter) {\n\t\t\ttry {\n\t\t\t\tconst [{ default: axios }, { generateUrl }] = await Promise.all([\n\t\t\t\t\timport('@nextcloud/axios'),\n\t\t\t\t\timport('@nextcloud/router'),\n\t\t\t\t])\n\t\t\t\tconst url = generateUrl(\n\t\t\t\t\t'/apps/openregister/api/objects/aggregations/{register}/{schema}/value',\n\t\t\t\t\t{ register: src.register, schema: src.schema },\n\t\t\t\t)\n\t\t\t\tconst params = { metric: src.metric || (src.aggregate === 'count' ? 'count' : 'count') }\n\t\t\t\tif (src.field) {\n\t\t\t\t\tparams.field = src.field\n\t\t\t\t}\n\t\t\t\tfor (const [k, v] of Object.entries(filter || {})) {\n\t\t\t\t\tif (v && typeof v === 'object') {\n\t\t\t\t\t\tfor (const [op, ov] of Object.entries(v)) {\n\t\t\t\t\t\t\tparams[`filter[${k}][${op}]`] = ov\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (v !== '' && v !== null && v !== undefined) {\n\t\t\t\t\t\tparams[`filter[${k}]`] = v\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tconst res = await axios.get(url, { params })\n\t\t\t\treturn Number(res?.data?.value ?? 0) || 0\n\t\t\t} catch {\n\t\t\t\treturn null\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Fetch the count/value over REST when the single `dataSource` is a\n\t\t * plain register+schema block (operator + dynamic tokens supported).\n\t\t * No-op for raw GraphQL or multi-entry mode. Delegates the request to\n\t\t * `fetchValue` (the per-entry refactor) — behaviour is unchanged.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync fetchRest() {\n\t\t\tconst ds = this.dataSource || {}\n\t\t\tif (!ds.register || !ds.schema || ds.graphql) {\n\t\t\t\tthis.restCount = null\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.restCount = await this.fetchValue(ds, resolveFilterTokens(ds.filter || {}))\n\t\t},\n\n\t\t/**\n\t\t * Fetch every entry's count in parallel (multi-entry mode). An entry\n\t\t * whose filter still carries an unresolved REQUIRED token (e.g.\n\t\t * `@workspace.selectedClient` with no selection) is skipped rather\n\t\t * than counted across the whole register. A monotonic request id\n\t\t * discards a stale batch when `entries` changes mid-flight.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync fetchEntries() {\n\t\t\tif (!this.hasEntries) {\n\t\t\t\tthis.entryCounts = []\n\t\t\t\tthis.entryFetching = []\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst id = ++this.entriesRequestId\n\t\t\tconst entries = this.entries\n\t\t\tthis.entryFetching = entries.map(() => true)\n\t\t\tconst counts = await Promise.all(entries.map(async (entry) => {\n\t\t\t\tif (!entry || !entry.register || !entry.schema) {\n\t\t\t\t\treturn null\n\t\t\t\t}\n\t\t\t\tconst filter = this.resolvedEntryFilter(entry)\n\t\t\t\tif (hasUnresolvedTokens(filter)) {\n\t\t\t\t\treturn null\n\t\t\t\t}\n\t\t\t\treturn this.fetchValue(entry, filter)\n\t\t\t}))\n\t\t\tif (id !== this.entriesRequestId) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.entryCounts = counts\n\t\t\tthis.entryFetching = entries.map(() => false)\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n/*\n * This widget draws no KPI of its own — every tile it shows is a CnStatsBlock,\n * so the canonical card in src/css/kpi-card.css is already what a reader sees.\n * All that is left here is how N of those tiles stack inside one widget, and\n * that spacing comes from the shared `--cn-kpi-stack-gap` so a multi-entry\n * widget and a CnStatsPanel stack of the same tiles are spaced identically.\n */\n/*\n * Fill the host cell rather than sizing to content.\n *\n * 🔴 WITHOUT THIS THE WIDGET COLLAPSES TO THE WIDTH OF ITS ICON, and the\n * number it exists to show is clipped to a sliver. Measured on a live\n * instance: a 282px `.cn-widget-wrapper__content` held a 20px widget, a 20px\n * `.cn-kpi-card` and a 0px `.cn-kpi-card__body`. 20px is the icon.\n *\n * The mechanism is a sizing cycle, which is why the KPI card's own CSS looks\n * correct in isolation and is. `.cn-widget-wrapper__content` is `display:\n * flex`, so this root is a flex ITEM and defaults to `flex: 0 1 auto` —\n * content-sized. Its content is `.cn-kpi-card { width: 100% }`, which resolves\n * against THIS element, which is resolving against its content. The card's\n * body carries `min-width: 0` (deliberately, so a long number can shrink\n * instead of overflowing), so the cycle settles with the body at zero and only\n * the icon's intrinsic width surviving.\n *\n * `flex: 1 1 auto` + `width: 100%` gives the card a definite width to resolve\n * against and breaks the cycle; `min-width: 0` keeps the shrink behaviour the\n * body's rule was written for.\n *\n * On the BASE class, not `--multi`: both the single-source and multi-entry\n * modes render this root, so both collapse. The bug was found on a\n * single-entry stats-block.\n */\n.cn-stats-block-widget {\n\tflex: 1 1 auto;\n\tmin-width: 0;\n\twidth: 100%;\n}\n\n.cn-stats-block-widget--multi {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: var(--cn-kpi-stack-gap, 12px);\n}\n</style>\n"],"names":["CnStatsBlock"],"mappings":";;;;;;AAgFA;;;;AAIA,MAAM,wBAAuB,GAAI,kBAAgB;;AAEjD;;AAEC;;;;;AAKA;;;;;AAKA;;AAEA;;AAEA;;;AAGA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;;AAGA;AACA;;;AAGA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;;AAEA;AACA;;;;AAIA;;AAED,aAAe;CACd,IAAI,EAAE,oBAAoB;;CAE1B,UAAU,EAAE,gBAAEA,UAAW,EAAG;;AAE5B,CAAA,MAAM,EAAE;AACP;;;AAGC;;AAED,EAAA,eAAe,EAAE,EAAE,OAAO,EAAE,IAAG,EAAG;AAClC;;;AAGC;;AAED,EAAA,kBAAkB,EAAE,EAAE,OAAO,EAAE,MAAM;AACrC;;;;AAIA,EAAA,WAAW,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,CAAA,EAAG;EACpC;;AAED,CAAA,KAAK,EAAE;AACN;;;;AAIC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;EAED,UAAU,EAAE;GACX,IAAI,EAAE,MAAM;GACZ,OAAO,EAAE,IAAI;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["../../../../src/components/CnStatsBlockWidget/CnStatsBlockWidget.vue"],"sourcesContent":["<!--\n CnStatsBlockWidget — Manifest-driven stats block.\n\n Thin wrapper around CnStatsBlock that pulls its count from a\n `dataSource` block on a dashboard widget definition. The\n dispatcher in CnDashboardPage mounts this when\n `widgetDef.type === 'stats-block'`.\n\n ADR-049 enrichment: an optional `entries[]` renders N related KPIs in one\n card, each entry self-fetching its own token-resolved count over the same\n REST /value aggregation. Exactly one of `dataSource` / `entries` must be\n provided; the single-`dataSource` path is unchanged.\n\n Static usage (no data fetching) is intentionally NOT supported —\n use CnStatsBlock directly when you already have a count number.\n-->\n<template>\n\t<div\n\t\tclass=\"cn-stats-block-widget\"\n\t\t:class=\"[iconClass, { 'cn-stats-block-widget--multi': hasEntries && !isRows, 'cn-stats-block-widget--rows': isRows }]\">\n\t\t<!-- Rows layout: a title and one label-left, number-right row per entry\n\t\t (the board's \"Mijn Zuiddrecht nu\" card). -->\n\t\t<template v-if=\"isRows\">\n\t\t\t<h2 v-if=\"title\" class=\"cn-stats-block-widget__rows-title\" data-testid=\"cn-stats-block-rows-title\">\n\t\t\t\t{{ tl(title) }}\n\t\t\t</h2>\n\t\t\t<dl class=\"cn-stats-block-widget__rows\" data-testid=\"cn-stats-block-rows\">\n\t\t\t\t<div\n\t\t\t\t\tv-for=\"view in rowViews\"\n\t\t\t\t\t:key=\"view.key\"\n\t\t\t\t\tclass=\"cn-stats-block-widget__row\"\n\t\t\t\t\tdata-testid=\"cn-stats-block-row\">\n\t\t\t\t\t<dt class=\"cn-stats-block-widget__row-label\">\n\t\t\t\t\t\t<a\n\t\t\t\t\t\t\tv-if=\"view.href\"\n\t\t\t\t\t\t\t:href=\"view.href\"\n\t\t\t\t\t\t\tdata-testid=\"cn-stats-block-row-link\"\n\t\t\t\t\t\t\t@click=\"onRowClick($event, view.route)\">{{ view.label }}</a>\n\t\t\t\t\t\t<template v-else>\n\t\t\t\t\t\t\t{{ view.label }}\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</dt>\n\t\t\t\t\t<dd\n\t\t\t\t\t\tclass=\"cn-stats-block-widget__row-value\"\n\t\t\t\t\t\t:class=\"'cn-stats-block-widget__row-value--' + view.variant\"\n\t\t\t\t\t\tdata-testid=\"cn-stats-block-row-value\">\n\t\t\t\t\t\t{{ view.display }}\n\t\t\t\t\t</dd>\n\t\t\t\t</div>\n\t\t\t</dl>\n\t\t</template>\n\n\t\t<!-- Multi-entry mode: one KPI per entry, all inside this widget card.\n\t\t An entry with hideWhenZero whose resolved count is 0 is omitted. -->\n\t\t<template v-else-if=\"hasEntries\">\n\t\t\t<CnStatsBlock\n\t\t\t\tv-for=\"view in entryViews\"\n\t\t\t\t:key=\"view.key\"\n\t\t\t\t:title=\"view.entry.title || ''\"\n\t\t\t\t:count=\"view.count\"\n\t\t\t\t:countLabel=\"view.entry.countLabel || ''\"\n\t\t\t\t:loading=\"view.loading\"\n\t\t\t\t:variant=\"view.entry.variant || 'default'\"\n\t\t\t\t:showZeroCount=\"showZeroCount\"\n\t\t\t\t:horizontal=\"horizontal\"\n\t\t\t\t:vertical=\"vertical\"\n\t\t\t\t:layout=\"layout\"\n\t\t\t\t:filled=\"filled\"\n\t\t\t\t:clickable=\"!!view.route\"\n\t\t\t\t:route=\"view.route || null\">\n\t\t\t\t<!-- An entry with a `format` (or `currency` / `currencyField`)\n\t\t\t\t shows its value formatted, money in its own currency. -->\n\t\t\t\t<template v-if=\"view.formatted !== null\" #value>\n\t\t\t\t\t{{ view.formatted }}\n\t\t\t\t</template>\n\t\t\t</CnStatsBlock>\n\t\t</template>\n\n\t\t<!-- Single-source mode (pre-existing interface, unchanged). -->\n\t\t<CnStatsBlock\n\t\t\tv-else\n\t\t\t:title=\"title\"\n\t\t\t:count=\"resolvedCount\"\n\t\t\t:countLabel=\"countLabel\"\n\t\t\t:loading=\"loading\"\n\t\t\t:variant=\"variant\"\n\t\t\t:showZeroCount=\"showZeroCount\"\n\t\t\t:horizontal=\"horizontal\"\n\t\t\t:vertical=\"vertical\"\n\t\t\t:layout=\"layout\"\n\t\t\t:filled=\"filled\"\n\t\t\t:clickable=\"!!route\"\n\t\t\t:route=\"route\">\n\t\t\t<template v-if=\"formattedSingle !== null\" #value>\n\t\t\t\t{{ formattedSingle }}\n\t\t\t</template>\n\t\t</CnStatsBlock>\n\t</div>\n</template>\n\n<script>\nimport { subscribe, unsubscribe } from '@nextcloud/event-bus'\nimport CnStatsBlock from '../CnStatsBlock/CnStatsBlock.vue'\nimport { useDataSource } from '../../composables/useDataSource.js'\nimport { formatMetricValue, normalizeMetricFormat, unwrapAppConfig } from '../../utils/formatMetric.js'\nimport { followLinkClick, resolveHref } from '../../utils/linkNavigation.js'\nimport { dropOptionalUnresolved, hasUnresolvedTokens, resolveFilterTokens } from '../../utils/resolveFilterTokens.js'\n\n// The canonical KPI scale (`--cn-kpi-*`) lives in one stylesheet. Imported\n// here as well as from css/index.css so the tokens resolve even when the\n// consuming app pulls in components individually.\nimport '../../css/kpi-card.css'\n\n/**\n * Event-bus channel the PAGE-level Refresh action broadcasts on\n * (CnDashboardPage / CnDetailPage pass it to their CnActionsMenu).\n */\nconst PAGE_REFRESH_BUS_CHANNEL = 'cn:page:refresh'\n\n/**\n * CnStatsBlockWidget — Stats-block dashboard widget.\n *\n * Reads a `dataSource` block (manifest shorthand or raw GraphQL)\n * and forwards the resolved count to CnStatsBlock. Loading state\n * propagates through; resolution errors fall back to count = 0\n * with an empty-state label so the dashboard doesn't blank.\n *\n * Multi-entry mode (ADR-049 / list-widget-enrichment): an `entries[]`\n * array renders N KPIs in one card. Each entry carries the same source\n * contract as a `type:\"stat\"` widget (`register`, `schema`, `metric`,\n * `field`, token-resolved `filter`) plus per-entry presentation\n * (`title`, `variant`, `countLabel`), an optional `route` deep link, and\n * `hideWhenZero` (the entry is omitted when its resolved count is 0).\n *\n * An entry formats its value with `format` (a style name such as\n * `\"currency\"`, or `{ style, currency, currencyField, decimals, prefix,\n * suffix }`), as a `type:\"stat\"` widget's `content.format` does. A money\n * value takes the currency from `currencyField` (a field of the detail\n * page's object, e.g. a contract's own `currency`), then `currency` (a code\n * or `@config.currency`), then the app's reporting currency, then EUR, and\n * is formatted in the user's locale. `currency` / `currencyField` may sit on\n * the entry itself and imply `format: \"currency\"`.\n * Exactly one of `dataSource` / `entries` must be provided — when\n * `entries` is absent, the single-`dataSource` path renders exactly as\n * before.\n *\n * Manifest example (decidesk dashboard):\n * ```json\n * {\n * \"id\": \"minutes-in-review\",\n * \"type\": \"stats-block\",\n * \"title\": \"Notulen ter goedkeuring\",\n * \"iconClass\": \"icon-file\",\n * \"props\": { \"countLabel\": \"notulen\", \"variant\": \"warning\" },\n * \"dataSource\": {\n * \"register\": \"decidesk\",\n * \"schema\": \"minutes\",\n * \"filter\": { \"lifecycle\": \"review\" },\n * \"aggregate\": \"count\"\n * }\n * }\n * ```\n *\n * Multi-entry example (a grouped retention card):\n * ```json\n * {\n * \"widgetKey\": \"stats-block\",\n * \"props\": {\n * \"entries\": [\n * { \"title\": \"Expiring soon\", \"register\": \"docudesk\", \"schema\": \"document\",\n * \"filter\": { \"retention\": { \"lt\": \"@today+30d\" } }, \"variant\": \"warning\",\n * \"route\": { \"name\": \"documents\" }, \"hideWhenZero\": true },\n * { \"title\": \"Archived\", \"register\": \"docudesk\", \"schema\": \"document\",\n * \"filter\": { \"status\": \"archived\" } }\n * ]\n * }\n * }\n * ```\n */\nexport default {\n\tname: 'CnStatsBlockWidget',\n\n\tcomponents: { CnStatsBlock },\n\n\tinject: {\n\t\t/**\n\t\t * Detail-page object context provided by CnDetailPage — enables\n\t\t * `@objectId` / `@object.<field>` tokens in an entry's `filter`.\n\t\t * Null on dashboards.\n\t\t */\n\t\tcnObjectContext: { default: null },\n\t\t/**\n\t\t * Page-level workspace context (reactive `ref({})`) provided by\n\t\t * CnDashboardPage — enables `@workspace.<key>` tokens in an entry's\n\t\t * `filter`. Null on pages that don't provide it.\n\t\t */\n\t\tcnWorkspaceContext: { default: null },\n\t\t/**\n\t\t * Page-level app config provided by the page — the reporting\n\t\t * currency (`currency`) and `@config.<key>` tokens in `format`.\n\t\t */\n\t\tcnAppConfig: { default: () => ({}) },\n\t\t/** The host's label lookup (CnAppRoot provides it); identity without one. */\n\t\tcnTranslate: { default: () => (key) => key },\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * Manifest dataSource block. See `useDataSource`. Exactly one of\n\t\t * `dataSource` / `entries` must be provided — a stats-block widget\n\t\t * without any source has no count to render (flagged with a console\n\t\t * error at mount).\n\t\t *\n\t\t * @type {{\n\t\t * register?: string,\n\t\t * schema?: string,\n\t\t * filter?: object,\n\t\t * aggregate?: 'count',\n\t\t * graphql?: { query: string, variables?: object, selectors: object }\n\t\t * }}\n\t\t */\n\t\tdataSource: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * Multi-entry declarative sources (ADR-049). Each entry renders one\n\t\t * KPI within this widget's card and self-fetches its own count over\n\t\t * the REST /value aggregation: `{ title, register, schema, metric,\n\t\t * field, filter, route, variant, countLabel, hideWhenZero }`. Filter\n\t\t * values use the shared @-token grammar (`@today`, `@me`,\n\t\t * `@workspace.*`, `?`-optional clauses). An entry with `hideWhenZero`\n\t\t * is omitted when its resolved count is 0. Mutually exclusive with\n\t\t * `dataSource`; defaults to empty (single-source mode).\n\t\t *\n\t\t * @type {Array<object>}\n\t\t */\n\t\tentries: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t\t/**\n\t\t * How the single-source value is shown: a style name (`'currency'`,\n\t\t * `'number'`, `'percent'`, `'decimal'`, `'duration-hours'`) or\n\t\t * `{ style, currency, currencyField, decimals, prefix, suffix }`.\n\t\t * Empty (the default) shows the plain localized count. Entries carry\n\t\t * their own `format`.\n\t\t *\n\t\t * @type {string|object|null}\n\t\t */\n\t\tformat: {\n\t\t\ttype: [String, Object],\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** Block title (manifest `widgetDef.title`). */\n\t\ttitle: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** Label displayed next to the count. */\n\t\tcountLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** Color variant: default | primary | success | warning | error. */\n\t\tvariant: {\n\t\t\ttype: String,\n\t\t\tdefault: 'default',\n\t\t},\n\n\t\t/** Whether to show 0 as a real count instead of the empty label. */\n\t\tshowZeroCount: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true,\n\t\t},\n\n\t\t/**\n\t\t * Lay the icon left of the content. The canonical KPI card already\n\t\t * does this, so the prop is redundant and kept only for existing\n\t\t * callers.\n\t\t *\n\t\t * @deprecated since 2.25.0, the horizontal layout is the default.\n\t\t */\n\t\thorizontal: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/** Stack the icon above a centred number instead of beside it. */\n\t\tvertical: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * `stacked` gives every block the board look (see CnStatsBlock\n\t\t * `layout`). `rows` draws the title and then one row per entry (or the\n\t\t * single source): the label on the left, the number on the right, the\n\t\t * label a link when the entry has a `route`. Empty (the default) keeps\n\t\t * the KPI card.\n\t\t *\n\t\t * @spec openspec/changes/zuiddrecht-pixel-gaps-3/specs/zuiddrecht-pixel-gaps-3/spec.md#requirement-a-stats-block-can-take-the-stacked-board-look\n\t\t */\n\t\tlayout: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Draw each tile's own grey box. Off by default — the widget is\n\t\t * rendered inside a CnWidgetWrapper that already draws a card.\n\t\t */\n\t\tfilled: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * Vue-router location to navigate to on click. When set, the\n\t\t * inner CnStatsBlock renders as a `<router-link>`.\n\t\t *\n\t\t * @type {object|null}\n\t\t */\n\t\troute: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * Optional CSS class applied to the widget's outermost wrapping\n\t\t * `<div>`. Designed for Nextcloud core icon classes (`icon-link`,\n\t\t * `icon-mail`, `icon-history`, …) that ship with NC and render a\n\t\t * 16×16 glyph via background-image. When empty (the default), the\n\t\t * wrapper carries only the base `cn-stats-block-widget` class and\n\t\t * is visually invisible.\n\t\t *\n\t\t * The wrapping element is a `<div>` with no layout styles of its\n\t\t * own, so the rendered KPI tile keeps the same dimensions and\n\t\t * spacing it had before this prop was added.\n\t\t *\n\t\t * MDI icon names (e.g. `'Database'`) are NOT supported here — that\n\t\t * would require an async dynamic-import. Use `CnStatsBlock`\n\t\t * directly when you need an MDI Vue component icon.\n\t\t */\n\t\ticonClass: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\t},\n\n\tsetup(props) {\n\t\t// GraphQL count path is hidden from useDataSource when a plain\n\t\t// register+schema source is given — that case is served over REST\n\t\t// (fetchRest) against OpenRegister's /value aggregation, which is more\n\t\t// robust than the GraphQL count shorthand. Raw `graphql` still flows here.\n\t\tconst dsForGraphql = () => {\n\t\t\tconst ds = props.dataSource\n\t\t\tif (ds && ds.register && ds.schema && !ds.graphql) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\treturn ds\n\t\t}\n\t\tconst { data, loading, error, refetch } = useDataSource(dsForGraphql)\n\t\treturn { dsData: data, loading, error, dsRefetch: refetch }\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\trestCount: null,\n\t\t\t/** @type {Array<number|null>} Per-entry resolved counts (multi-entry mode; null = pending/failed). */\n\t\t\tentryCounts: [],\n\t\t\t/** @type {Array<boolean>} Per-entry fetch-in-flight flags (multi-entry mode). */\n\t\t\tentryFetching: [],\n\t\t\t/** Monotonic id used to discard a stale entries batch when `entries` changes mid-flight. */\n\t\t\tentriesRequestId: 0,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/**\n\t\t * Whether the widget runs in multi-entry mode (`entries[]` supplied).\n\t\t *\n\t\t * @return {boolean}\n\t\t */\n\t\thasEntries() {\n\t\t\treturn Array.isArray(this.entries) && this.entries.length > 0\n\t\t},\n\n\t\t/**\n\t\t * Whether the widget draws label/number rows (`layout: \"rows\"`).\n\t\t *\n\t\t * @return {boolean}\n\t\t */\n\t\tisRows() {\n\t\t\treturn this.layout === 'rows'\n\t\t},\n\n\t\t/**\n\t\t * The rows of the rows layout: one per entry, or a single row from the\n\t\t * `dataSource` (labelled by `countLabel`). A row is `{ key, label,\n\t\t * display, variant, route, href }`; `display` is the formatted value,\n\t\t * a dash while it loads or when the count could not be read.\n\t\t *\n\t\t * @return {Array<object>}\n\t\t */\n\t\trowViews() {\n\t\t\tif (!this.hasEntries) {\n\t\t\t\tconst formatted = this.formattedSingle\n\t\t\t\treturn [{\n\t\t\t\t\tkey: 'single',\n\t\t\t\t\tlabel: this.tl(this.countLabel),\n\t\t\t\t\tdisplay: this.loading ? '\\u2014' : (formatted !== null ? formatted : this.formatCount(this.resolvedCount)),\n\t\t\t\t\tvariant: this.variant || 'default',\n\t\t\t\t\troute: this.route,\n\t\t\t\t\thref: this.route ? resolveHref(this.route, this.$router) : '',\n\t\t\t\t}]\n\t\t\t}\n\t\t\treturn this.entryViews.map((view) => {\n\t\t\t\tconst resolved = view.resolved === true\n\t\t\t\tlet display = '\\u2014'\n\t\t\t\tif (resolved) {\n\t\t\t\t\tdisplay = view.formatted !== null ? view.formatted : this.formatCount(view.count)\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\tkey: view.key,\n\t\t\t\t\tlabel: this.tl(view.entry.title || ''),\n\t\t\t\t\tdisplay,\n\t\t\t\t\tvariant: view.entry.variant || 'default',\n\t\t\t\t\troute: view.route,\n\t\t\t\t\thref: view.route ? resolveHref(view.route, this.$router) : '',\n\t\t\t\t}\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * The unwrapped detail-page object context for token resolution, or\n\t\t * null on surfaces (dashboards) that don't provide one.\n\t\t *\n\t\t * @return {object|null}\n\t\t */\n\t\tobjectCtx() {\n\t\t\tconst c = this.cnObjectContext\n\t\t\tif (!c) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\treturn (typeof c === 'object' && 'value' in c) ? c.value : c\n\t\t},\n\n\t\t/**\n\t\t * The unwrapped workspace context bag (or null). Vue 2.7 inject may\n\t\t * hand back a raw ref; unwrap `.value` for token resolution.\n\t\t *\n\t\t * @return {object|null}\n\t\t */\n\t\tworkspaceCtx() {\n\t\t\tconst c = this.cnWorkspaceContext\n\t\t\tif (!c) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\treturn (typeof c === 'object' && 'value' in c) ? c.value : c\n\t\t},\n\n\t\t/**\n\t\t * The page-level app config map (reporting currency, `@config` keys).\n\t\t *\n\t\t * @return {object}\n\t\t */\n\t\tconfigCtx() {\n\t\t\treturn unwrapAppConfig(this.cnAppConfig)\n\t\t},\n\n\t\t/**\n\t\t * The detail page's object, or null on a dashboard. Its fields feed\n\t\t * an entry's `currencyField`.\n\t\t *\n\t\t * @return {object|null}\n\t\t */\n\t\tpageObject() {\n\t\t\tconst object = this.objectCtx && this.objectCtx.object\n\t\t\treturn object && typeof object === 'object' ? object : null\n\t\t},\n\n\t\t/**\n\t\t * The single-source value formatted per `format`, or null to keep\n\t\t * the plain count.\n\t\t *\n\t\t * @return {string|null}\n\t\t * @spec openspec/changes/stat-currency-from-object/specs/dashboard-page/spec.md#requirement-a-stats-block-entry-formats-its-value\n\t\t */\n\t\tformattedSingle() {\n\t\t\tconst fmt = normalizeMetricFormat({ format: this.format })\n\t\t\tif (!fmt || this.loading) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\treturn formatMetricValue(this.resolvedCount, fmt, this.configCtx, this.pageObject)\n\t\t},\n\n\t\t/**\n\t\t * Token-resolution context for entry filters, merged from the\n\t\t * detail-page object context and the page-level workspace bag.\n\t\t *\n\t\t * @return {object}\n\t\t */\n\t\ttokenCtx() {\n\t\t\tconst base = this.objectCtx ? { ...this.objectCtx } : {}\n\t\t\tbase.workspace = this.workspaceCtx || {}\n\t\t\treturn base\n\t\t},\n\n\t\t/**\n\t\t * Renderable view models for multi-entry mode: each entry paired with\n\t\t * its fetched count and loading flag, with `hideWhenZero` entries\n\t\t * whose resolved count is 0 omitted.\n\t\t *\n\t\t * @return {Array<{entry: object, key: string, count: number, loading: boolean, formatted: (string|null)}>}\n\t\t * @spec openspec/changes/stat-currency-from-object/specs/dashboard-page/spec.md#requirement-a-stats-block-entry-formats-its-value\n\t\t */\n\t\tentryViews() {\n\t\t\treturn (this.entries || [])\n\t\t\t\t.map((entry, i) => {\n\t\t\t\t\tconst raw = this.entryCounts[i]\n\t\t\t\t\tconst resolved = typeof raw === 'number'\n\t\t\t\t\tconst fmt = normalizeMetricFormat(entry)\n\t\t\t\t\treturn {\n\t\t\t\t\t\t// The value as the entry's `format` says, money in the\n\t\t\t\t\t\t// currency the entry names; null keeps the plain count.\n\t\t\t\t\t\tformatted: fmt && resolved ? formatMetricValue(raw, fmt, this.configCtx, this.pageObject) : null,\n\t\t\t\t\t\tentry: entry || {},\n\t\t\t\t\t\tkey: `${(entry && entry.register) || ''}/${(entry && entry.schema) || ''}/${i}`,\n\t\t\t\t\t\tcount: resolved ? raw : 0,\n\t\t\t\t\t\tloading: !!this.entryFetching[i],\n\t\t\t\t\t\tresolved,\n\t\t\t\t\t\t// Token-resolve the deep link the same way entry.filter\n\t\t\t\t\t\t// is resolved — `route.query: { case: \"@objectId\" }` must\n\t\t\t\t\t\t// land on the target pre-scoped, never as a literal token\n\t\t\t\t\t\t// (ADR-062; parity with object-list's viewAllQuery).\n\t\t\t\t\t\troute: this.resolveEntryRoute(entry && entry.route),\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\t.filter((view) => !(view.entry.hideWhenZero && view.resolved && view.count === 0))\n\t\t},\n\n\t\t/**\n\t\t * Stable signature of a REST-fetchable source (else null).\n\t\t *\n\t\t * @spec openspec/specs/dashboard-page/spec.md\n\t\t */\n\t\trestKey() {\n\t\t\tconst ds = this.dataSource || {}\n\t\t\tif (!ds.register || !ds.schema || ds.graphql) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\treturn JSON.stringify({\n\t\t\t\tregister: ds.register,\n\t\t\t\tschema: ds.schema,\n\t\t\t\tmetric: ds.metric || (ds.aggregate === 'count' ? 'count' : 'count'),\n\t\t\t\tfield: ds.field || '',\n\t\t\t\tfilter: ds.filter || {},\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * Stable signature of the multi-entry sources INCLUDING their\n\t\t * token-resolved filters, so the watcher refetches when page-level\n\t\t * state a `@workspace.*` token reads changes.\n\t\t *\n\t\t * @return {string|null}\n\t\t */\n\t\tentriesKey() {\n\t\t\tif (!this.hasEntries) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\treturn JSON.stringify(this.entries.map((entry) => ({\n\t\t\t\tregister: (entry && entry.register) || '',\n\t\t\t\tschema: (entry && entry.schema) || '',\n\t\t\t\tmetric: (entry && entry.metric) || 'count',\n\t\t\t\tfield: (entry && entry.field) || '',\n\t\t\t\tfilter: this.resolvedEntryFilter(entry),\n\t\t\t})))\n\t\t},\n\n\t\tresolvedCount() {\n\t\t\tif (typeof this.restCount === 'number') {\n\t\t\t\treturn this.restCount\n\t\t\t}\n\t\t\tconst value = this.dsData?.count\n\t\t\tif (typeof value === 'number') {\n\t\t\t\treturn value\n\t\t\t}\n\t\t\tif (typeof value === 'string') {\n\t\t\t\tconst parsed = Number(value)\n\t\t\t\treturn Number.isFinite(parsed) ? parsed : 0\n\t\t\t}\n\t\t\treturn 0\n\t\t},\n\t},\n\n\twatch: {\n\t\trestKey() {\n\t\t\tthis.fetchRest()\n\t\t},\n\n\t\tentriesKey() {\n\t\t\tthis.fetchEntries()\n\t\t},\n\t},\n\n\tcreated() {\n\t\t// \"Exactly one of dataSource / entries\" — a misconfigured widget\n\t\t// fails loudly (console error + no counts) instead of rendering an\n\t\t// ambiguous card. Vue 2 prop validators cannot see sibling props, so\n\t\t// the cross-prop rule lives here (and, for manifests, in\n\t\t// validateManifestV2's post-schema check).\n\t\tconst hasDataSource = !!this.dataSource\n\t\tif (hasDataSource === this.hasEntries) {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.error('[CnStatsBlockWidget] Exactly one of `dataSource` / `entries` must be provided.')\n\t\t}\n\t},\n\n\tmounted() {\n\t\tthis.fetchRest()\n\t\tthis.fetchEntries()\n\t\t// Page-level Refresh. This tile is now rendered inside CnWidgetWrapper\n\t\t// like every other widget (it went flat in 2026-08-30's KPI-card\n\t\t// change, so the wrapper is what draws its card), but it is registered\n\t\t// as a CARD widget and cards carry no per-widget Actions menu — so the\n\t\t// page action is still its only refresh affordance. It reached nothing\n\t\t// before this subscription: the counts come from `fetchRest` /\n\t\t// `fetchEntries` and the useDataSource GraphQL path, none of which\n\t\t// subscribe on their own. No widgetId to match: a page refresh\n\t\t// refreshes everything on the page.\n\t\tthis._onPageRefresh = (payload) => {\n\t\t\tconst done = this.refresh()\n\t\t\tpayload?.waitUntil?.(done)\n\t\t}\n\t\tsubscribe(PAGE_REFRESH_BUS_CHANNEL, this._onPageRefresh)\n\t},\n\n\tbeforeUnmount() {\n\t\tif (this._onPageRefresh) {\n\t\t\tunsubscribe(PAGE_REFRESH_BUS_CHANNEL, this._onPageRefresh)\n\t\t\tthis._onPageRefresh = null\n\t\t}\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * A manifest string through the host's label lookup.\n\t\t *\n\t\t * @param {string} text The text as written in the manifest.\n\t\t * @return {string} The translated text.\n\t\t */\n\t\ttl(text) {\n\t\t\treturn typeof this.cnTranslate === 'function' ? this.cnTranslate(text) : text\n\t\t},\n\n\t\t/**\n\t\t * A count in the user's locale.\n\t\t *\n\t\t * @param {number} count The count.\n\t\t * @return {string} The localized count.\n\t\t */\n\t\tformatCount(count) {\n\t\t\treturn new Intl.NumberFormat().format(count)\n\t\t},\n\n\t\t/**\n\t\t * Follow a row label's link in the router, leaving a modified click to the browser.\n\t\t *\n\t\t * @param {MouseEvent} event The click.\n\t\t * @param {object} route The route location.\n\t\t * @return {void}\n\t\t */\n\t\tonRowClick(event, route) {\n\t\t\tfollowLinkClick(event, route, this.$router)\n\t\t},\n\n\t\t/**\n\t\t * Re-query the tile's counts — the REST `/value` aggregation, the\n\t\t * per-entry counts of multi-entry mode, and the `dataSource` GraphQL\n\t\t * path. Exposed as a ref-callable method for parity with the other data\n\t\t * widgets, and invoked by the page-level Refresh subscription.\n\t\t *\n\t\t * @return {Promise<unknown[]>} Settles when every re-query has.\n\t\t */\n\t\trefresh() {\n\t\t\treturn Promise.all([\n\t\t\t\ttypeof this.dsRefetch === 'function' ? this.dsRefetch() : null,\n\t\t\t\tthis.fetchRest(),\n\t\t\t\tthis.fetchEntries(),\n\t\t\t])\n\t\t},\n\n\t\t/**\n\t\t * An entry's `route` deep link with `@`-tokens in `query` / `params`\n\t\t * resolved against `tokenCtx` (same treatment as `entry.filter`), so\n\t\t * a KPI card can deep-link to an index pre-scoped to the current\n\t\t * object. Unresolved optional query clauses are dropped; a route\n\t\t * whose query still carries a REQUIRED unresolved token is returned\n\t\t * without that query entry resolution left as-is (router will show\n\t\t * the unfiltered index rather than a broken literal-token filter).\n\t\t *\n\t\t * @param {object|string|null} route The entry's route location.\n\t\t * @return {object|string|null} The token-resolved route.\n\t\t */\n\t\tresolveEntryRoute(route) {\n\t\t\tif (!route || typeof route !== 'object') {\n\t\t\t\treturn route || null\n\t\t\t}\n\t\t\tconst out = { ...route }\n\t\t\tif (out.query && typeof out.query === 'object') {\n\t\t\t\tout.query = dropOptionalUnresolved(resolveFilterTokens(out.query, this.tokenCtx))\n\t\t\t}\n\t\t\tif (out.params && typeof out.params === 'object') {\n\t\t\t\tout.params = resolveFilterTokens(out.params, this.tokenCtx)\n\t\t\t}\n\t\t\treturn out\n\t\t},\n\n\t\t/**\n\t\t * An entry's filter with every @-token resolved against `tokenCtx`\n\t\t * and UNRESOLVED OPTIONAL clauses (`@workspace.<key>?`) dropped.\n\t\t *\n\t\t * @param {object} entry The entry definition.\n\t\t * @return {object} The resolved filter map.\n\t\t */\n\t\tresolvedEntryFilter(entry) {\n\t\t\treturn dropOptionalUnresolved(resolveFilterTokens((entry && entry.filter) || {}, this.tokenCtx))\n\t\t},\n\n\t\t/**\n\t\t * Fetch one count/value over REST from OpenRegister's /value\n\t\t * aggregation. Shared by the single-`dataSource` path and the\n\t\t * per-entry multi-entry path. Lazily imports axios/router (the\n\t\t * library never hard-depends on them at module load).\n\t\t *\n\t\t * @param {{register: string, schema: string, metric?: string, aggregate?: string, field?: string}} src The source block.\n\t\t * @param {object} filter The ALREADY-RESOLVED filter map.\n\t\t * @return {Promise<number|null>} The value, or null on failure.\n\t\t */\n\t\tasync fetchValue(src, filter) {\n\t\t\ttry {\n\t\t\t\tconst [{ default: axios }, { generateUrl }] = await Promise.all([\n\t\t\t\t\timport('@nextcloud/axios'),\n\t\t\t\t\timport('@nextcloud/router'),\n\t\t\t\t])\n\t\t\t\tconst url = generateUrl(\n\t\t\t\t\t'/apps/openregister/api/objects/aggregations/{register}/{schema}/value',\n\t\t\t\t\t{ register: src.register, schema: src.schema },\n\t\t\t\t)\n\t\t\t\tconst params = { metric: src.metric || (src.aggregate === 'count' ? 'count' : 'count') }\n\t\t\t\tif (src.field) {\n\t\t\t\t\tparams.field = src.field\n\t\t\t\t}\n\t\t\t\tfor (const [k, v] of Object.entries(filter || {})) {\n\t\t\t\t\tif (v && typeof v === 'object') {\n\t\t\t\t\t\tfor (const [op, ov] of Object.entries(v)) {\n\t\t\t\t\t\t\tparams[`filter[${k}][${op}]`] = ov\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (v !== '' && v !== null && v !== undefined) {\n\t\t\t\t\t\tparams[`filter[${k}]`] = v\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tconst res = await axios.get(url, { params })\n\t\t\t\treturn Number(res?.data?.value ?? 0) || 0\n\t\t\t} catch {\n\t\t\t\treturn null\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Fetch the count/value over REST when the single `dataSource` is a\n\t\t * plain register+schema block (operator + dynamic tokens supported).\n\t\t * No-op for raw GraphQL or multi-entry mode. Delegates the request to\n\t\t * `fetchValue` (the per-entry refactor) — behaviour is unchanged.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync fetchRest() {\n\t\t\tconst ds = this.dataSource || {}\n\t\t\tif (!ds.register || !ds.schema || ds.graphql) {\n\t\t\t\tthis.restCount = null\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.restCount = await this.fetchValue(ds, resolveFilterTokens(ds.filter || {}))\n\t\t},\n\n\t\t/**\n\t\t * Fetch every entry's count in parallel (multi-entry mode). An entry\n\t\t * whose filter still carries an unresolved REQUIRED token (e.g.\n\t\t * `@workspace.selectedClient` with no selection) is skipped rather\n\t\t * than counted across the whole register. A monotonic request id\n\t\t * discards a stale batch when `entries` changes mid-flight.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync fetchEntries() {\n\t\t\tif (!this.hasEntries) {\n\t\t\t\tthis.entryCounts = []\n\t\t\t\tthis.entryFetching = []\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst id = ++this.entriesRequestId\n\t\t\tconst entries = this.entries\n\t\t\tthis.entryFetching = entries.map(() => true)\n\t\t\tconst counts = await Promise.all(entries.map(async (entry) => {\n\t\t\t\tif (!entry || !entry.register || !entry.schema) {\n\t\t\t\t\treturn null\n\t\t\t\t}\n\t\t\t\tconst filter = this.resolvedEntryFilter(entry)\n\t\t\t\tif (hasUnresolvedTokens(filter)) {\n\t\t\t\t\treturn null\n\t\t\t\t}\n\t\t\t\treturn this.fetchValue(entry, filter)\n\t\t\t}))\n\t\t\tif (id !== this.entriesRequestId) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.entryCounts = counts\n\t\t\tthis.entryFetching = entries.map(() => false)\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n/*\n * This widget draws no KPI of its own — every tile it shows is a CnStatsBlock,\n * so the canonical card in src/css/kpi-card.css is already what a reader sees.\n * All that is left here is how N of those tiles stack inside one widget, and\n * that spacing comes from the shared `--cn-kpi-stack-gap` so a multi-entry\n * widget and a CnStatsPanel stack of the same tiles are spaced identically.\n */\n/*\n * Fill the host cell rather than sizing to content.\n *\n * 🔴 WITHOUT THIS THE WIDGET COLLAPSES TO THE WIDTH OF ITS ICON, and the\n * number it exists to show is clipped to a sliver. Measured on a live\n * instance: a 282px `.cn-widget-wrapper__content` held a 20px widget, a 20px\n * `.cn-kpi-card` and a 0px `.cn-kpi-card__body`. 20px is the icon.\n *\n * The mechanism is a sizing cycle, which is why the KPI card's own CSS looks\n * correct in isolation and is. `.cn-widget-wrapper__content` is `display:\n * flex`, so this root is a flex ITEM and defaults to `flex: 0 1 auto` —\n * content-sized. Its content is `.cn-kpi-card { width: 100% }`, which resolves\n * against THIS element, which is resolving against its content. The card's\n * body carries `min-width: 0` (deliberately, so a long number can shrink\n * instead of overflowing), so the cycle settles with the body at zero and only\n * the icon's intrinsic width surviving.\n *\n * `flex: 1 1 auto` + `width: 100%` gives the card a definite width to resolve\n * against and breaks the cycle; `min-width: 0` keeps the shrink behaviour the\n * body's rule was written for.\n *\n * On the BASE class, not `--multi`: both the single-source and multi-entry\n * modes render this root, so both collapse. The bug was found on a\n * single-entry stats-block.\n */\n.cn-stats-block-widget {\n\tflex: 1 1 auto;\n\tmin-width: 0;\n\twidth: 100%;\n}\n\n.cn-stats-block-widget--multi {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: var(--cn-kpi-stack-gap, 12px);\n}\n\n/* Rows layout: the board's \"label left, number right\" card body. */\n.cn-stats-block-widget--rows {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 12px;\n\tbox-sizing: border-box;\n\tpadding: 20px 22px;\n}\n\n.cn-stats-block-widget__rows-title {\n\tmargin: 0;\n\tfont-size: 15px;\n\tfont-weight: 600;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-stats-block-widget__rows {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 8px;\n\tmargin: 0;\n\tfont-size: 14px;\n}\n\n.cn-stats-block-widget__row {\n\tdisplay: flex;\n\talign-items: baseline;\n\tjustify-content: space-between;\n\tgap: 16px;\n}\n\n.cn-stats-block-widget__row-label {\n\tmin-width: 0;\n\tmargin: 0;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n}\n\n.cn-stats-block-widget__row-value {\n\tflex: none;\n\tmargin: 0;\n\tfont-size: 17px;\n\tfont-weight: 700;\n\ttext-align: right;\n}\n\n.cn-stats-block-widget__row-value--success {\n\tcolor: var(--color-text-success, var(--color-success-text));\n}\n\n.cn-stats-block-widget__row-value--warning {\n\tcolor: var(--color-text-warning, var(--color-warning-text));\n}\n\n.cn-stats-block-widget__row-value--error {\n\tcolor: var(--color-text-error, var(--color-error-text));\n}\n\n.cn-stats-block-widget__row-value--primary {\n\tcolor: var(--color-primary-element);\n}\n</style>\n"],"names":["CnStatsBlock"],"mappings":";;;;;;;AAiHA;;;;AAIA,MAAM,wBAAuB,GAAI,kBAAgB;;AAEjD;;AAEC;;;;;AAKA;;;;;AAKA;;AAEA;;AAEA;;;AAGA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;;AAGA;AACA;;;AAGA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;;AAEA;AACA;;;;AAIA;;AAED,aAAe;CACd,IAAI,EAAE,oBAAoB;;CAE1B,UAAU,EAAE,gBAAEA,UAAW,EAAG;;AAE5B,CAAA,MAAM,EAAE;AACP;;;AAGC;;AAED,EAAA,eAAe,EAAE,EAAE,OAAO,EAAE,IAAG,EAAG;AAClC;;;AAGC;;AAED,EAAA,kBAAkB,EAAE,EAAE,OAAO,EAAE,MAAM;AACrC;;;;AAIA,EAAA,WAAW,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,CAAA,EAAG;AACp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;AACN,IAAA;AACA,GAAA,MAAM,EAAC,GAAI,EAAE,IAAI,CAAC,iBAAe;GACjC,MAAM,OAAM,GAAI,IAAI,CAAC,QAAM;AAC3B,GAAA,IAAI,CAAC,aAAc,GAAE,OAAO,CAAC,GAAG,CAAC,MAAM,IAAI,EAAA;GAC3C,MAAM,MAAK,GAAI,MAAM,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,KAAK,KAAK;AAC7D,IAAA,IAAI,CAAC,KAAM,IAAG,CAAC,KAAK,CAAC,QAAO,IAAK,CAAC,KAAK,CAAC,MAAM,EAAE;AAC/C,KAAA,OAAO,IAAG;AACX,KAAA;AACA,IAAA,MAAM,MAAO,GAAE,IAAI,CAAC,mBAAmB,CAAC,KAAK,EAAA;AAC7C,IAAA,IAAI,mBAAmB,CAAC,MAAM,CAAC,EAAE;AAChC,KAAA,OAAO,IAAG;AACX,KAAA;AACA,IAAA,OAAO,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,MAAM,CAAA;AACrC,IAAC,CAAC,EAAA;AACF,GAAA,IAAI,EAAC,KAAM,IAAI,CAAC,gBAAgB,EAAE;IACjC,MAAK;AACN,IAAA;GACA,IAAI,CAAC,WAAY,GAAE,OAAK;AACxB,GAAA,IAAI,CAAC,gBAAgB,OAAO,CAAC,GAAG,CAAC,MAAM,KAAK,EAAA;GAC5C;EACD;AACF;;;;"}
@@ -1,64 +1,108 @@
1
- import { resolveComponent, openBlock, createElementBlock, normalizeClass, Fragment, renderList, createBlock, createSlots, withCtx, createTextVNode, toDisplayString } from 'vue';
1
+ import { resolveComponent, openBlock, createElementBlock, normalizeClass, Fragment, toDisplayString, createCommentVNode, createElementVNode, renderList, createTextVNode, createBlock, createSlots, withCtx } from 'vue';
2
+
3
+ const _hoisted_1 = {
4
+ key: 0,
5
+ class: "cn-stats-block-widget__rows-title",
6
+ "data-testid": "cn-stats-block-rows-title"
7
+ };
8
+ const _hoisted_2 = {
9
+ class: "cn-stats-block-widget__rows",
10
+ "data-testid": "cn-stats-block-rows"
11
+ };
12
+ const _hoisted_3 = { class: "cn-stats-block-widget__row-label" };
13
+ const _hoisted_4 = ["href", "onClick"];
2
14
 
3
15
  function render(_ctx, _cache, $props, $setup, $data, $options) {
4
16
  const _component_CnStatsBlock = resolveComponent("CnStatsBlock");
5
17
 
6
18
  return (openBlock(), createElementBlock("div", {
7
- class: normalizeClass(["cn-stats-block-widget", [$props.iconClass, { 'cn-stats-block-widget--multi': $options.hasEntries }]])
19
+ class: normalizeClass(["cn-stats-block-widget", [$props.iconClass, { 'cn-stats-block-widget--multi': $options.hasEntries && !$options.isRows, 'cn-stats-block-widget--rows': $options.isRows }]])
8
20
  }, [
9
- ($options.hasEntries)
10
- ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList($options.entryViews, (view) => {
11
- return (openBlock(), createBlock(_component_CnStatsBlock, {
12
- key: view.key,
13
- title: view.entry.title || '',
14
- count: view.count,
15
- countLabel: view.entry.countLabel || '',
16
- loading: view.loading,
17
- variant: view.entry.variant || 'default',
21
+ ($options.isRows)
22
+ ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
23
+ ($props.title)
24
+ ? (openBlock(), createElementBlock("h2", _hoisted_1, toDisplayString($options.tl($props.title)), 1 /* TEXT */))
25
+ : createCommentVNode("v-if", true),
26
+ createElementVNode("dl", _hoisted_2, [
27
+ (openBlock(true), createElementBlock(Fragment, null, renderList($options.rowViews, (view) => {
28
+ return (openBlock(), createElementBlock("div", {
29
+ key: view.key,
30
+ class: "cn-stats-block-widget__row",
31
+ "data-testid": "cn-stats-block-row"
32
+ }, [
33
+ createElementVNode("dt", _hoisted_3, [
34
+ (view.href)
35
+ ? (openBlock(), createElementBlock("a", {
36
+ key: 0,
37
+ href: view.href,
38
+ "data-testid": "cn-stats-block-row-link",
39
+ onClick: $event => ($options.onRowClick($event, view.route))
40
+ }, toDisplayString(view.label), 9 /* TEXT, PROPS */, _hoisted_4))
41
+ : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
42
+ createTextVNode(toDisplayString(view.label), 1 /* TEXT */)
43
+ ], 64 /* STABLE_FRAGMENT */))
44
+ ]),
45
+ createElementVNode("dd", {
46
+ class: normalizeClass(["cn-stats-block-widget__row-value", 'cn-stats-block-widget__row-value--' + view.variant]),
47
+ "data-testid": "cn-stats-block-row-value"
48
+ }, toDisplayString(view.display), 3 /* TEXT, CLASS */)
49
+ ]))
50
+ }), 128 /* KEYED_FRAGMENT */))
51
+ ])
52
+ ], 64 /* STABLE_FRAGMENT */))
53
+ : ($options.hasEntries)
54
+ ? (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList($options.entryViews, (view) => {
55
+ return (openBlock(), createBlock(_component_CnStatsBlock, {
56
+ key: view.key,
57
+ title: view.entry.title || '',
58
+ count: view.count,
59
+ countLabel: view.entry.countLabel || '',
60
+ loading: view.loading,
61
+ variant: view.entry.variant || 'default',
62
+ showZeroCount: $props.showZeroCount,
63
+ horizontal: $props.horizontal,
64
+ vertical: $props.vertical,
65
+ layout: $props.layout,
66
+ filled: $props.filled,
67
+ clickable: !!view.route,
68
+ route: view.route || null
69
+ }, createSlots({ _: 2 /* DYNAMIC */ }, [
70
+ (view.formatted !== null)
71
+ ? {
72
+ name: "value",
73
+ fn: withCtx(() => [
74
+ createTextVNode(toDisplayString(view.formatted), 1 /* TEXT */)
75
+ ]),
76
+ key: "0"
77
+ }
78
+ : undefined
79
+ ]), 1032 /* PROPS, DYNAMIC_SLOTS */, ["title", "count", "countLabel", "loading", "variant", "showZeroCount", "horizontal", "vertical", "layout", "filled", "clickable", "route"]))
80
+ }), 128 /* KEYED_FRAGMENT */))
81
+ : (openBlock(), createBlock(_component_CnStatsBlock, {
82
+ key: 2,
83
+ title: $props.title,
84
+ count: $options.resolvedCount,
85
+ countLabel: $props.countLabel,
86
+ loading: $setup.loading,
87
+ variant: $props.variant,
18
88
  showZeroCount: $props.showZeroCount,
19
89
  horizontal: $props.horizontal,
20
90
  vertical: $props.vertical,
21
91
  layout: $props.layout,
22
92
  filled: $props.filled,
23
- clickable: !!view.route,
24
- route: view.route || null
93
+ clickable: !!$props.route,
94
+ route: $props.route
25
95
  }, createSlots({ _: 2 /* DYNAMIC */ }, [
26
- (view.formatted !== null)
96
+ ($options.formattedSingle !== null)
27
97
  ? {
28
98
  name: "value",
29
99
  fn: withCtx(() => [
30
- createTextVNode(toDisplayString(view.formatted), 1 /* TEXT */)
100
+ createTextVNode(toDisplayString($options.formattedSingle), 1 /* TEXT */)
31
101
  ]),
32
102
  key: "0"
33
103
  }
34
104
  : undefined
35
105
  ]), 1032 /* PROPS, DYNAMIC_SLOTS */, ["title", "count", "countLabel", "loading", "variant", "showZeroCount", "horizontal", "vertical", "layout", "filled", "clickable", "route"]))
36
- }), 128 /* KEYED_FRAGMENT */))
37
- : (openBlock(), createBlock(_component_CnStatsBlock, {
38
- key: 1,
39
- title: $props.title,
40
- count: $options.resolvedCount,
41
- countLabel: $props.countLabel,
42
- loading: $setup.loading,
43
- variant: $props.variant,
44
- showZeroCount: $props.showZeroCount,
45
- horizontal: $props.horizontal,
46
- vertical: $props.vertical,
47
- layout: $props.layout,
48
- filled: $props.filled,
49
- clickable: !!$props.route,
50
- route: $props.route
51
- }, createSlots({ _: 2 /* DYNAMIC */ }, [
52
- ($options.formattedSingle !== null)
53
- ? {
54
- name: "value",
55
- fn: withCtx(() => [
56
- createTextVNode(toDisplayString($options.formattedSingle), 1 /* TEXT */)
57
- ]),
58
- key: "0"
59
- }
60
- : undefined
61
- ]), 1032 /* PROPS, DYNAMIC_SLOTS */, ["title", "count", "countLabel", "loading", "variant", "showZeroCount", "horizontal", "vertical", "layout", "filled", "clickable", "route"]))
62
106
  ], 2 /* CLASS */))
63
107
  }
64
108