@conduction/nextcloud-vue 2.83.0 → 2.85.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (246) hide show
  1. package/dist/esm/components/CnAdminSettingsShell/CnAdminSettingsShell.vue.js +1 -1
  2. package/dist/esm/components/CnAdminSettingsShell/CnAdminSettingsShell.vue2.js +131 -3
  3. package/dist/esm/components/CnAdminSettingsShell/CnAdminSettingsShell.vue2.js.map +1 -1
  4. package/dist/esm/components/CnAdminSettingsShell/CnAdminSettingsShell.vue3.js +54 -18
  5. package/dist/esm/components/CnAdminSettingsShell/CnAdminSettingsShell.vue3.js.map +1 -1
  6. package/dist/esm/components/CnAuditTrailCard/CnAuditTrailCard.vue.js +1 -1
  7. package/dist/esm/components/CnAuditTrailCard/CnAuditTrailCard.vue2.js +1 -1
  8. package/dist/esm/components/CnAuditTrailCard/CnAuditTrailCard.vue2.js.map +1 -1
  9. package/dist/esm/components/CnAuditTrailCard/CnAuditTrailCard.vue3.js.map +1 -1
  10. package/dist/esm/components/CnBoardView/CnBoardView.vue.js +1 -1
  11. package/dist/esm/components/CnBoardView/CnBoardView.vue2.js +232 -4
  12. package/dist/esm/components/CnBoardView/CnBoardView.vue2.js.map +1 -1
  13. package/dist/esm/components/CnBoardView/CnBoardView.vue3.js +95 -51
  14. package/dist/esm/components/CnBoardView/CnBoardView.vue3.js.map +1 -1
  15. package/dist/esm/components/CnBodySections/CnBodySections.vue.js +1 -1
  16. package/dist/esm/components/CnBodySections/CnBodySections.vue2.js +22 -1
  17. package/dist/esm/components/CnBodySections/CnBodySections.vue2.js.map +1 -1
  18. package/dist/esm/components/CnBodySections/CnBodySections.vue3.js.map +1 -1
  19. package/dist/esm/components/CnCountdownWidget/CnCountdownWidget.vue.js +1 -1
  20. package/dist/esm/components/CnCountdownWidget/CnCountdownWidget.vue2.js +47 -4
  21. package/dist/esm/components/CnCountdownWidget/CnCountdownWidget.vue2.js.map +1 -1
  22. package/dist/esm/components/CnCountdownWidget/CnCountdownWidget.vue3.js.map +1 -1
  23. package/dist/esm/components/CnDashboardGrid/CnDashboardGrid.vue.js +1 -1
  24. package/dist/esm/components/CnDashboardGrid/CnDashboardGrid.vue2.js +239 -3
  25. package/dist/esm/components/CnDashboardGrid/CnDashboardGrid.vue2.js.map +1 -1
  26. package/dist/esm/components/CnDashboardGrid/CnDashboardGrid.vue3.js +5 -5
  27. package/dist/esm/components/CnDashboardGrid/CnDashboardGrid.vue3.js.map +1 -1
  28. package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue.js +1 -1
  29. package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue2.js +50 -0
  30. package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue2.js.map +1 -1
  31. package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue3.js +22 -12
  32. package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue3.js.map +1 -1
  33. package/dist/esm/components/CnDeltaWidget/CnDeltaWidget.vue.js +1 -1
  34. package/dist/esm/components/CnDeltaWidget/CnDeltaWidget.vue2.js +1 -1
  35. package/dist/esm/components/CnDeltaWidget/CnDeltaWidget.vue2.js.map +1 -1
  36. package/dist/esm/components/CnDeltaWidget/CnDeltaWidget.vue3.js.map +1 -1
  37. package/dist/esm/components/CnDetailPage/CnDetailPage.vue2.js +226 -8
  38. package/dist/esm/components/CnDetailPage/CnDetailPage.vue2.js.map +1 -1
  39. package/dist/esm/components/CnDetailPage/CnDetailPage.vue3.js.map +1 -1
  40. package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHost.vue.js +1 -1
  41. package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHost.vue2.js +3 -1
  42. package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHost.vue2.js.map +1 -1
  43. package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHost.vue3.js.map +1 -1
  44. package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue.js +1 -1
  45. package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue2.js +18 -5
  46. package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue2.js.map +1 -1
  47. package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue3.js.map +1 -1
  48. package/dist/esm/components/CnFieldListWidget/CnFieldListWidget.vue.js +1 -1
  49. package/dist/esm/components/CnFieldListWidget/CnFieldListWidget.vue2.js +38 -1
  50. package/dist/esm/components/CnFieldListWidget/CnFieldListWidget.vue2.js.map +1 -1
  51. package/dist/esm/components/CnFieldListWidget/CnFieldListWidget.vue3.js +45 -5
  52. package/dist/esm/components/CnFieldListWidget/CnFieldListWidget.vue3.js.map +1 -1
  53. package/dist/esm/components/CnGaugeWidget/CnGaugeWidget.vue.js +1 -1
  54. package/dist/esm/components/CnGaugeWidget/CnGaugeWidget.vue2.js +1 -1
  55. package/dist/esm/components/CnGaugeWidget/CnGaugeWidget.vue2.js.map +1 -1
  56. package/dist/esm/components/CnGaugeWidget/CnGaugeWidget.vue3.js.map +1 -1
  57. package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js +548 -77
  58. package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js.map +1 -1
  59. package/dist/esm/components/CnIndexPage/CnIndexPage.vue3.js +191 -82
  60. package/dist/esm/components/CnIndexPage/CnIndexPage.vue3.js.map +1 -1
  61. package/dist/esm/components/CnIndexPage/useSelfFetchList.js +11 -2
  62. package/dist/esm/components/CnIndexPage/useSelfFetchList.js.map +1 -1
  63. package/dist/esm/components/CnInteractionFormWidget/CnInteractionFormWidget.vue2.js +29 -6
  64. package/dist/esm/components/CnInteractionFormWidget/CnInteractionFormWidget.vue2.js.map +1 -1
  65. package/dist/esm/components/CnInteractionFormWidget/CnInteractionFormWidget.vue3.js.map +1 -1
  66. package/dist/esm/components/CnObjectDataWidget/CnObjectDataWidget.vue.js +1 -1
  67. package/dist/esm/components/CnObjectDataWidget/CnObjectDataWidget.vue2.js +126 -2
  68. package/dist/esm/components/CnObjectDataWidget/CnObjectDataWidget.vue2.js.map +1 -1
  69. package/dist/esm/components/CnObjectDataWidget/CnObjectDataWidget.vue3.js +24 -2
  70. package/dist/esm/components/CnObjectDataWidget/CnObjectDataWidget.vue3.js.map +1 -1
  71. package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue.js +1 -1
  72. package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue2.js +106 -3
  73. package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue2.js.map +1 -1
  74. package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue3.js.map +1 -1
  75. package/dist/esm/components/CnRegisterMapping/CnRegisterMapping.vue.js +1 -1
  76. package/dist/esm/components/CnRegisterMapping/CnRegisterMapping.vue2.js +67 -5
  77. package/dist/esm/components/CnRegisterMapping/CnRegisterMapping.vue2.js.map +1 -1
  78. package/dist/esm/components/CnRegisterMapping/CnRegisterMapping.vue3.js +181 -124
  79. package/dist/esm/components/CnRegisterMapping/CnRegisterMapping.vue3.js.map +1 -1
  80. package/dist/esm/components/CnReportsPage/CnReportsPage.vue.js +1 -1
  81. package/dist/esm/components/CnReportsPage/CnReportsPage.vue2.js +135 -2
  82. package/dist/esm/components/CnReportsPage/CnReportsPage.vue2.js.map +1 -1
  83. package/dist/esm/components/CnReportsPage/CnReportsPage.vue3.js +95 -43
  84. package/dist/esm/components/CnReportsPage/CnReportsPage.vue3.js.map +1 -1
  85. package/dist/esm/components/CnSettingsPage/CnSettingsPage.vue.js +1 -1
  86. package/dist/esm/components/CnSettingsPage/CnSettingsPage.vue2.js +5 -1
  87. package/dist/esm/components/CnSettingsPage/CnSettingsPage.vue2.js.map +1 -1
  88. package/dist/esm/components/CnSettingsPage/CnSettingsPage.vue3.js.map +1 -1
  89. package/dist/esm/components/CnStagesWidget/CnStagesWidget.vue.js +1 -1
  90. package/dist/esm/components/CnStagesWidget/CnStagesWidget.vue2.js +72 -5
  91. package/dist/esm/components/CnStagesWidget/CnStagesWidget.vue2.js.map +1 -1
  92. package/dist/esm/components/CnStagesWidget/CnStagesWidget.vue3.js +33 -8
  93. package/dist/esm/components/CnStagesWidget/CnStagesWidget.vue3.js.map +1 -1
  94. package/dist/esm/components/CnStatWidget/CnStatWidget.vue.js +1 -1
  95. package/dist/esm/components/CnStatWidget/CnStatWidget.vue2.js +135 -11
  96. package/dist/esm/components/CnStatWidget/CnStatWidget.vue2.js.map +1 -1
  97. package/dist/esm/components/CnStatWidget/CnStatWidget.vue3.js +6 -2
  98. package/dist/esm/components/CnStatWidget/CnStatWidget.vue3.js.map +1 -1
  99. package/dist/esm/components/CnStatsBlockWidget/CnStatsBlockWidget.vue.js +1 -1
  100. package/dist/esm/components/CnStatsBlockWidget/CnStatsBlockWidget.vue2.js +17 -2
  101. package/dist/esm/components/CnStatsBlockWidget/CnStatsBlockWidget.vue2.js.map +1 -1
  102. package/dist/esm/components/CnStatsBlockWidget/CnStatsBlockWidget.vue3.js +1 -1
  103. package/dist/esm/components/CnStatsBlockWidget/CnStatsBlockWidget.vue3.js.map +1 -1
  104. package/dist/esm/components/CnTabsWidget/CnTabsWidget.vue.js +1 -1
  105. package/dist/esm/components/CnTabsWidget/CnTabsWidget.vue2.js +39 -6
  106. package/dist/esm/components/CnTabsWidget/CnTabsWidget.vue2.js.map +1 -1
  107. package/dist/esm/components/CnTabsWidget/CnTabsWidget.vue3.js.map +1 -1
  108. package/dist/esm/components/CnToggleTableWidget/CnToggleTableWidget.vue.js +1 -1
  109. package/dist/esm/components/CnToggleTableWidget/CnToggleTableWidget.vue2.js +140 -7
  110. package/dist/esm/components/CnToggleTableWidget/CnToggleTableWidget.vue2.js.map +1 -1
  111. package/dist/esm/components/CnToggleTableWidget/CnToggleTableWidget.vue3.js.map +1 -1
  112. package/dist/esm/components/CnVersionInfoCard/CnVersionInfoCard.vue.js +1 -1
  113. package/dist/esm/components/CnVersionInfoCard/CnVersionInfoCard.vue2.js +37 -9
  114. package/dist/esm/components/CnVersionInfoCard/CnVersionInfoCard.vue2.js.map +1 -1
  115. package/dist/esm/components/CnVersionInfoCard/CnVersionInfoCard.vue3.js +6 -5
  116. package/dist/esm/components/CnVersionInfoCard/CnVersionInfoCard.vue3.js.map +1 -1
  117. package/dist/esm/components/CnWalkthrough/CnWalkthrough.vue.js +1 -1
  118. package/dist/esm/components/CnWalkthrough/CnWalkthrough.vue2.js +16 -0
  119. package/dist/esm/components/CnWalkthrough/CnWalkthrough.vue2.js.map +1 -1
  120. package/dist/esm/components/CnWalkthrough/CnWalkthrough.vue3.js.map +1 -1
  121. package/dist/esm/components/CnWeekStripWidget/CnWeekStripWidget.vue.js +1 -1
  122. package/dist/esm/components/CnWeekStripWidget/CnWeekStripWidget.vue2.js +2 -1
  123. package/dist/esm/components/CnWeekStripWidget/CnWeekStripWidget.vue2.js.map +1 -1
  124. package/dist/esm/components/CnWeekStripWidget/CnWeekStripWidget.vue3.js.map +1 -1
  125. package/dist/esm/components/CnWidgetCardGrid/CnWidgetCardGrid.vue2.js +53 -1
  126. package/dist/esm/components/CnWidgetCardGrid/CnWidgetCardGrid.vue2.js.map +1 -1
  127. package/dist/esm/components/CnWidgetCardGrid/CnWidgetCardGrid.vue3.js +3 -2
  128. package/dist/esm/components/CnWidgetCardGrid/CnWidgetCardGrid.vue3.js.map +1 -1
  129. package/dist/esm/components/CnWidgetObjectTable/CnWidgetObjectTable.vue.js +1 -1
  130. package/dist/esm/components/CnWidgetObjectTable/CnWidgetObjectTable.vue2.js +135 -0
  131. package/dist/esm/components/CnWidgetObjectTable/CnWidgetObjectTable.vue2.js.map +1 -1
  132. package/dist/esm/components/CnWidgetObjectTable/CnWidgetObjectTable.vue3.js.map +1 -1
  133. package/dist/esm/components/CnWidgetWrapper/CnWidgetWrapper.vue.js +1 -1
  134. package/dist/esm/components/CnWidgetWrapper/CnWidgetWrapper.vue2.js +19 -0
  135. package/dist/esm/components/CnWidgetWrapper/CnWidgetWrapper.vue2.js.map +1 -1
  136. package/dist/esm/components/CnWidgetWrapper/CnWidgetWrapper.vue3.js +37 -19
  137. package/dist/esm/components/CnWidgetWrapper/CnWidgetWrapper.vue3.js.map +1 -1
  138. package/dist/esm/composables/useListView.js +21 -0
  139. package/dist/esm/composables/useListView.js.map +1 -1
  140. package/dist/esm/dialogs/CnTransitionInputDialog.vue.js +1 -1
  141. package/dist/esm/dialogs/CnTransitionInputDialog.vue2.js +68 -6
  142. package/dist/esm/dialogs/CnTransitionInputDialog.vue2.js.map +1 -1
  143. package/dist/esm/dialogs/CnTransitionInputDialog.vue3.js +133 -105
  144. package/dist/esm/dialogs/CnTransitionInputDialog.vue3.js.map +1 -1
  145. package/dist/esm/index.js +1 -0
  146. package/dist/esm/index.js.map +1 -1
  147. package/dist/esm/l10n/en.json.js +38 -1
  148. package/dist/esm/l10n/en.json.js.map +1 -1
  149. package/dist/esm/l10n/nl.json.js +78 -1
  150. package/dist/esm/l10n/nl.json.js.map +1 -1
  151. package/dist/esm/library-style.js +1 -1
  152. package/dist/esm/nextcloud-vue.css +1030 -533
  153. package/dist/esm/store/useObjectStore.js +16 -2
  154. package/dist/esm/store/useObjectStore.js.map +1 -1
  155. package/dist/esm/utils/boardColumns.js +8 -1
  156. package/dist/esm/utils/boardColumns.js.map +1 -1
  157. package/dist/esm/utils/boardReferenceColumns.js +278 -0
  158. package/dist/esm/utils/boardReferenceColumns.js.map +1 -0
  159. package/dist/esm/utils/buildManifest.js +41 -4
  160. package/dist/esm/utils/buildManifest.js.map +1 -1
  161. package/dist/esm/utils/detailWidgetVisibility.js +149 -0
  162. package/dist/esm/utils/detailWidgetVisibility.js.map +1 -0
  163. package/dist/esm/utils/formatMetric.js +39 -3
  164. package/dist/esm/utils/formatMetric.js.map +1 -1
  165. package/dist/esm/utils/gridStack.js +40 -1
  166. package/dist/esm/utils/gridStack.js.map +1 -1
  167. package/dist/esm/utils/humaniseKey.js +41 -0
  168. package/dist/esm/utils/humaniseKey.js.map +1 -0
  169. package/dist/esm/utils/notificationRuleLabel.js +6 -23
  170. package/dist/esm/utils/notificationRuleLabel.js.map +1 -1
  171. package/dist/esm/utils/resolveManifestTokens.js +1 -0
  172. package/dist/esm/utils/resolveManifestTokens.js.map +1 -1
  173. package/dist/esm/utils/sentinelTokens.js +9 -0
  174. package/dist/esm/utils/sentinelTokens.js.map +1 -1
  175. package/dist/esm/utils/validateManifestV2.compiled.js +3 -3
  176. package/dist/esm/utils/validateManifestV2.compiled.js.map +1 -1
  177. package/dist/esm/utils/widgetDispatch.js +8 -2
  178. package/dist/esm/utils/widgetDispatch.js.map +1 -1
  179. package/dist/nextcloud-vue.cjs.js +17159 -13422
  180. package/dist/nextcloud-vue.cjs.js.map +2 -2
  181. package/dist/nextcloud-vue.css +1030 -533
  182. package/l10n/en.json +38 -1
  183. package/l10n/nl.json +78 -1
  184. package/package.json +1 -1
  185. package/src/components/CnAdminSettingsShell/CnAdminSettingsShell.vue +160 -8
  186. package/src/components/CnAuditTrailCard/CnAuditTrailCard.vue +1 -1
  187. package/src/components/CnBoardView/CnBoardView.vue +262 -6
  188. package/src/components/CnBodySections/CnBodySections.vue +22 -1
  189. package/src/components/CnCountdownWidget/CnCountdownWidget.vue +47 -4
  190. package/src/components/CnDashboardGrid/CnDashboardGrid.vue +244 -8
  191. package/src/components/CnDashboardPage/CnDashboardPage.vue +62 -2
  192. package/src/components/CnDeltaWidget/CnDeltaWidget.vue +1 -1
  193. package/src/components/CnDetailPage/CnDetailPage.md +3 -1
  194. package/src/components/CnDetailPage/CnDetailPage.vue +226 -8
  195. package/src/components/CnDetailWidgetHost/CnDetailWidgetHost.vue +3 -1
  196. package/src/components/CnFactsWidget/CnFactsWidget.vue +18 -5
  197. package/src/components/CnFieldListWidget/CnFieldListWidget.vue +63 -1
  198. package/src/components/CnGaugeWidget/CnGaugeWidget.vue +1 -1
  199. package/src/components/CnIndexPage/CnIndexPage.vue +586 -25
  200. package/src/components/CnIndexPage/useSelfFetchList.js +10 -1
  201. package/src/components/CnInteractionFormWidget/CnInteractionFormWidget.vue +29 -6
  202. package/src/components/CnObjectDataWidget/CnObjectDataWidget.md +1 -1
  203. package/src/components/CnObjectDataWidget/CnObjectDataWidget.vue +154 -5
  204. package/src/components/CnRecordListWidget/CnRecordListWidget.vue +106 -3
  205. package/src/components/CnRegisterMapping/CnRegisterMapping.md +5 -0
  206. package/src/components/CnRegisterMapping/CnRegisterMapping.vue +231 -96
  207. package/src/components/CnReportsPage/CnReportsPage.vue +179 -1
  208. package/src/components/CnSettingsPage/CnSettingsPage.vue +5 -1
  209. package/src/components/CnStagesWidget/CnStagesWidget.vue +103 -6
  210. package/src/components/CnStatWidget/CnStatWidget.vue +137 -12
  211. package/src/components/CnStatsBlockWidget/CnStatsBlockWidget.vue +34 -3
  212. package/src/components/CnTabsWidget/CnTabsWidget.vue +39 -6
  213. package/src/components/CnToggleTableWidget/CnToggleTableWidget.vue +140 -7
  214. package/src/components/CnVersionInfoCard/CnVersionInfoCard.md +2 -1
  215. package/src/components/CnVersionInfoCard/CnVersionInfoCard.vue +42 -13
  216. package/src/components/CnWalkthrough/CnWalkthrough.vue +16 -0
  217. package/src/components/CnWeekStripWidget/CnWeekStripWidget.vue +2 -1
  218. package/src/components/CnWidgetCardGrid/CnWidgetCardGrid.vue +55 -2
  219. package/src/components/CnWidgetObjectTable/CnWidgetObjectTable.vue +135 -0
  220. package/src/components/CnWidgetWrapper/CnWidgetWrapper.md +10 -0
  221. package/src/components/CnWidgetWrapper/CnWidgetWrapper.vue +44 -1
  222. package/src/composables/useListView.js +21 -0
  223. package/src/css/board.css +65 -4
  224. package/src/css/dialog.css +4 -2
  225. package/src/css/form-field.css +14 -0
  226. package/src/css/form-widget.css +11 -0
  227. package/src/css/index-page.css +49 -0
  228. package/src/css/kpi-card.css +13 -0
  229. package/src/css/look-board-reports.css +58 -0
  230. package/src/css/look-board.css +108 -7
  231. package/src/dialogs/CnTransitionInputDialog.vue +87 -7
  232. package/src/index.js +2 -0
  233. package/src/schemas/app-manifest-v2.schema.json +137 -6
  234. package/src/store/useObjectStore.js +16 -2
  235. package/src/utils/boardColumns.js +8 -1
  236. package/src/utils/boardReferenceColumns.js +274 -0
  237. package/src/utils/buildManifest.js +40 -3
  238. package/src/utils/detailWidgetVisibility.js +145 -0
  239. package/src/utils/formatMetric.js +38 -2
  240. package/src/utils/gridStack.js +39 -0
  241. package/src/utils/humaniseKey.js +38 -0
  242. package/src/utils/notificationRuleLabel.js +5 -23
  243. package/src/utils/resolveManifestTokens.js +1 -0
  244. package/src/utils/sentinelTokens.js +9 -0
  245. package/src/utils/validateManifestV2.compiled.js +3 -3
  246. package/src/utils/widgetDispatch.js +8 -2
@@ -1 +1 @@
1
- {"version":3,"file":"CnTabsWidget.vue3.js","sources":["../../../../src/components/CnTabsWidget/CnTabsWidget.vue?vue&type=template&id=9ccd8dee&lang.js"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n\n<template>\n\t<div class=\"cn-tabs-widget\">\n\t\t<CnTabs\n\t\t\t:aria-label=\"stripLabel\"\n\t\t\t:moreLabel=\"moreLabel\"\n\t\t\t:variant=\"stripVariant\"\n\t\t\tclass=\"cn-tabs-widget__tabs\"\n\t\t\t@update:activeIndex=\"onTabChange\">\n\t\t\t<!-- One Actions menu for the whole widget, bound to whichever child\n\t\t\t is showing. This is the point of the component: six tabbed\n\t\t\t widgets used to mean six card headers stacked down the page. -->\n\t\t\t<template #nav-end>\n\t\t\t\t<CnActionsMenu\n\t\t\t\t\t:showRefresh=\"showRefresh\"\n\t\t\t\t\t:showRequestFeature=\"showRequestFeature\"\n\t\t\t\t\t:showDocumentation=\"showDocumentation\"\n\t\t\t\t\t:documentationUrl=\"documentationUrl\"\n\t\t\t\t\t:widgetId=\"activeWidgetId\"\n\t\t\t\t\t:title=\"activeTitle\"\n\t\t\t\t\t:variant=\"isBoard ? 'secondary' : undefined\"\n\t\t\t\t\t:surface=\"`widget:${activeWidgetId}`\"\n\t\t\t\t\trefreshChannel=\"cn:widget:refresh\"\n\t\t\t\t\ttestidBase=\"cn-tabs-widget\">\n\t\t\t\t\t<!-- The open panel's own items, below the built-in trio.\n\t\t\t\t\t A panel draws no header, so these would otherwise have\n\t\t\t\t\t nowhere to go: the data widget's Metadata and full edit\n\t\t\t\t\t dialog vanished outright when the panel stopped drawing\n\t\t\t\t\t a card. They are rendered here rather than rebuilt here\n\t\t\t\t\t because `run` closes over the widget that published it,\n\t\t\t\t\t which is what keeps the dialog's per-widget config and\n\t\t\t\t\t the widget's own save path. See utils/panelActions.js.\n\n\t\t\t\t\t Only the ACTIVE panel's items. `lazy` keeps a visited\n\t\t\t\t\t tab mounted, so several panels publish at once and an\n\t\t\t\t\t unfiltered list would offer actions for a sheet nobody\n\t\t\t\t\t is looking at. -->\n\t\t\t\t\t<template v-if=\"activePanelActions.length\" #action-items>\n\t\t\t\t\t\t<NcActionButton\n\t\t\t\t\t\t\tv-for=\"action in activePanelActions\"\n\t\t\t\t\t\t\t:key=\"action.key\"\n\t\t\t\t\t\t\t:closeAfterClick=\"true\"\n\t\t\t\t\t\t\t@click=\"action.run()\">\n\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t<CnIcon :name=\"action.icon\" :size=\"20\" />\n\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t\t{{ action.label }}\n\t\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t</template>\n\t\t\t\t</CnActionsMenu>\n\t\t\t</template>\n\n\t\t\t<CnTab\n\t\t\t\tv-for=\"(entry, index) in resolvedTabs\"\n\t\t\t\t:key=\"entry.key\"\n\t\t\t\t:active=\"index === activeIndex\"\n\t\t\t\t:title=\"entry.label\"\n\t\t\t\t:count=\"entry.count\"\n\t\t\t\t:overflow=\"entry.overflow\"\n\t\t\t\t:disabled=\"entry.pending\"\n\t\t\t\tlazy\n\t\t\t\t@click=\"activeIndex = index\">\n\t\t\t\t<template #title>\n\t\t\t\t\t<span class=\"cn-tabs-widget__title\">\n\t\t\t\t\t\t<CnIcon\n\t\t\t\t\t\t\tv-if=\"entry.icon && !isBoard\"\n\t\t\t\t\t\t\t:name=\"entry.icon\"\n\t\t\t\t\t\t\t:size=\"18\"\n\t\t\t\t\t\t\tclass=\"cn-tabs-widget__title-icon\" />\n\t\t\t\t\t\t{{ entry.label }}\n\t\t\t\t\t\t<NcLoadingIcon\n\t\t\t\t\t\t\tv-if=\"entry.pending\"\n\t\t\t\t\t\t\t:size=\"14\"\n\t\t\t\t\t\t\t:name=\"loadingLabel\"\n\t\t\t\t\t\t\tdata-testid=\"cn-tabs-widget-pending\" />\n\t\t\t\t\t</span>\n\t\t\t\t</template>\n\n\t\t\t\t<!-- A stack (`widgetIds`): every widget is a titled card; the\n\t\t\t\t first joins the open tab, the next ones stand below it. -->\n\t\t\t\t<div\n\t\t\t\t\tv-if=\"entry.widget && entry.stack.length\"\n\t\t\t\t\tclass=\"cn-tabs-widget__stack\"\n\t\t\t\t\t:class=\"{ 'cn-tabs-widget__stack--grid': !!entry.grid }\"\n\t\t\t\t\tdata-testid=\"cn-tabs-widget-stack\">\n\t\t\t\t\t<div class=\"cn-tabs-widget__stack-first\" :style=\"spanStyle(entry.grid, 0)\">\n\t\t\t\t\t\t<CnDetailWidgetHost\n\t\t\t\t\t\t\t:widget=\"entry.widget\"\n\t\t\t\t\t\t\tchrome=\"card\"\n\t\t\t\t\t\t\t:showCardTitle=\"true\"\n\t\t\t\t\t\t\t:showActions=\"false\"\n\t\t\t\t\t\t\t:availableWidgets=\"availableWidgets\"\n\t\t\t\t\t\t\t:objectId=\"objectId\"\n\t\t\t\t\t\t\t:object=\"objectData\"\n\t\t\t\t\t\t\t:objectType=\"objectType\"\n\t\t\t\t\t\t\t:schemaObject=\"schemaObject\"\n\t\t\t\t\t\t\t:register=\"register\"\n\t\t\t\t\t\t\t:schema=\"schema\"\n\t\t\t\t\t\t\t:store=\"store\"\n\t\t\t\t\t\t\t:surface=\"surface\"\n\t\t\t\t\t\t\t:integrationContext=\"integrationContext\"\n\t\t\t\t\t\t\t:cnRegistry=\"cnRegistry\"\n\t\t\t\t\t\t\t@geoSaved=\"onGeoSaved\"\n\t\t\t\t\t\t\t@openIntegration=\"onOpenIntegration\"\n\t\t\t\t\t\t\t@selectObject=\"onSelectObject\" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div\n\t\t\t\t\t\tv-for=\"(child, childIndex) in entry.stack\"\n\t\t\t\t\t\t:key=\"`${entry.key}-${child.id}`\"\n\t\t\t\t\t\tclass=\"cn-tabs-widget__stack-item\"\n\t\t\t\t\t\t:style=\"spanStyle(entry.grid, childIndex + 1)\"\n\t\t\t\t\t\t:data-testid=\"`cn-tabs-widget-stack-${child.id}`\">\n\t\t\t\t\t\t<CnDetailWidgetHost\n\t\t\t\t\t\t\t:widget=\"child\"\n\t\t\t\t\t\t\tchrome=\"card\"\n\t\t\t\t\t\t\t:showCardTitle=\"true\"\n\t\t\t\t\t\t\t:showActions=\"false\"\n\t\t\t\t\t\t\t:availableWidgets=\"availableWidgets\"\n\t\t\t\t\t\t\t:objectId=\"objectId\"\n\t\t\t\t\t\t\t:object=\"objectData\"\n\t\t\t\t\t\t\t:objectType=\"objectType\"\n\t\t\t\t\t\t\t:schemaObject=\"schemaObject\"\n\t\t\t\t\t\t\t:register=\"register\"\n\t\t\t\t\t\t\t:schema=\"schema\"\n\t\t\t\t\t\t\t:store=\"store\"\n\t\t\t\t\t\t\t:surface=\"surface\"\n\t\t\t\t\t\t\t:integrationContext=\"integrationContext\"\n\t\t\t\t\t\t\t:cnRegistry=\"cnRegistry\"\n\t\t\t\t\t\t\t@geoSaved=\"onGeoSaved\"\n\t\t\t\t\t\t\t@openIntegration=\"onOpenIntegration\"\n\t\t\t\t\t\t\t@selectObject=\"onSelectObject\" />\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<CnDetailWidgetHost\n\t\t\t\t\tv-else-if=\"entry.widget\"\n\t\t\t\t\t:widget=\"entry.widget\"\n\t\t\t\t\tchrome=\"bare\"\n\t\t\t\t\t:availableWidgets=\"availableWidgets\"\n\t\t\t\t\t:objectId=\"objectId\"\n\t\t\t\t\t:object=\"objectData\"\n\t\t\t\t\t:objectType=\"objectType\"\n\t\t\t\t\t:schemaObject=\"schemaObject\"\n\t\t\t\t\t:register=\"register\"\n\t\t\t\t\t:schema=\"schema\"\n\t\t\t\t\t:store=\"store\"\n\t\t\t\t\t:surface=\"surface\"\n\t\t\t\t\t:integrationContext=\"integrationContext\"\n\t\t\t\t\t:cnRegistry=\"cnRegistry\"\n\t\t\t\t\t@geoSaved=\"onGeoSaved\"\n\t\t\t\t\t@openIntegration=\"onOpenIntegration\"\n\t\t\t\t\t@selectObject=\"onSelectObject\" />\n\t\t\t\t<CnEmptyContent v-else :name=\"missingLabel(entry)\" />\n\t\t\t</CnTab>\n\t\t</CnTabs>\n\t</div>\n</template>\n\n<script>\nimport { subscribe, unsubscribe } from '@nextcloud/event-bus'\nimport { translate as t } from '@nextcloud/l10n'\nimport { NcActionButton, NcLoadingIcon } from '@nextcloud/vue'\nimport CnDetailWidgetHost from '../CnDetailWidgetHost/CnDetailWidgetHost.vue'\nimport CnEmptyContent from '../CnEmptyContent/CnEmptyContent.vue'\nimport CnIcon from '../CnIcon/CnIcon.vue'\nimport CnTab from '../CnTabs/CnTab.vue'\nimport CnTabs from '../CnTabs/CnTabs.vue'\nimport { normalizeLook } from '../../composables/useLook.js'\nimport { resolveTabCount } from '../../utils/detailActionModel.js'\nimport { fetchListTotal } from '../../utils/fetchFilterCounts.js'\nimport { isActivityWidget } from '../../utils/headerMeta.js'\nimport { PANEL_ACTION_SINK } from '../../utils/panelActions.js'\nimport { evaluateVisibleWhen, evaluateVisibleWhenLocal, isLocallyDecidableVisibleWhen } from '../../utils/visibleWhen.js'\nimport { widgetTitleOf } from '../../utils/widgetDispatch.js'\nimport { CnActionsMenu } from '../CnActionsMenu/index.js'\n\n/**\n * CnTabsWidget — a widget that holds other widgets, one per tab.\n *\n * A detail page that carries notes, files, related records, sub-records, mail\n * and appointments renders six cards, each with its own header and its own\n * Actions menu, stacked down the page. All six say roughly the same thing about\n * one record, and only one of them is being read at a time. This widget puts\n * them behind a tab strip instead.\n *\n * ## What the tabs take over\n *\n * The strip owns the title and the card. A child renders through\n * `CnDetailWidgetHost` with `chrome=\"bare\"`, so it draws no header and no\n * border of its own, and its content fills the panel exactly as it would have\n * filled its card. The tab label is what the widget's card header used to say.\n *\n * The Actions menu moves OUT of the panels and into the bar, beside the strip\n * rather than inside it, and rebinds to whichever child is showing. So there is\n * one menu, and it always acts on what you are looking at.\n *\n * ## Configuring it\n *\n * `content.tabs[]` names the children and their labels, so a deployment can\n * relabel or reorder tabs, or drop one, without touching code:\n *\n * ```js\n * content: {\n * tabs: [\n * { widgetId: 'case-notes', label: 'Notes', icon: 'NoteTextOutline' },\n * { widgetId: 'case-files', label: 'Files and attachments' },\n * ],\n * }\n * ```\n *\n * `label` and `icon` are optional and fall back to the child widget's own\n * title and icon, so the common case is a list of `widgetId`s.\n *\n * ## Panels are lazy, and stay mounted\n *\n * Each panel is a `CnTab` with `lazy`, so a child only mounts when its tab is\n * first opened. Six eager panels that each fetch on `mounted()` would fire six\n * requests on page load to answer five questions nobody asked. Once opened, a\n * panel stays mounted, so switching back never refetches.\n *\n * ## A named tab whose widget is missing\n *\n * The tab still renders, and its panel says which widget id did not resolve.\n * Dropping the tab would be worse: `content.tabs[]` is hand-authored config,\n * and a typo that silently removes a tab is a typo nobody finds.\n */\nexport default {\n\tname: 'CnTabsWidget',\n\n\tcomponents: {\n\t\tCnActionsMenu,\n\t\tCnDetailWidgetHost,\n\t\tCnIcon,\n\t\tCnTab,\n\t\tCnTabs,\n\t\tNcActionButton,\n\t\tCnEmptyContent,\n\t\tNcLoadingIcon,\n\t},\n\n\t/**\n\t * Offer the panels a way to put their own menu items in the strip's menu.\n\t *\n\t * Re-provided one level down by `CnDetailWidgetHost`, which knows the id to\n\t * key by; see utils/panelActions.js for why the items travel up instead of\n\t * being rebuilt here.\n\t *\n\t * @return {object} The provided sink.\n\t */\n\tprovide() {\n\t\treturn {\n\t\t\t[PANEL_ACTION_SINK]: {\n\t\t\t\t/**\n\t\t\t\t * Publish a panel's items, under one SOURCE.\n\t\t\t\t *\n\t\t\t\t * A panel has two possible publishers: the host, for an action\n\t\t\t\t * the host itself would have drawn (the catalog Add), and the\n\t\t\t\t * widget inside it, for its own menu items. Keyed by source so\n\t\t\t\t * the two coexist; a single slot per widget meant whichever\n\t\t\t\t * published last silently replaced the other.\n\t\t\t\t *\n\t\t\t\t * Replaces the map rather than mutating it so the computed that\n\t\t\t\t * reads it re-evaluates on any change.\n\t\t\t\t *\n\t\t\t\t * @param {string} id The publishing widget's id.\n\t\t\t\t * @param {object[]} items Its PanelAction descriptors.\n\t\t\t\t * @param {string} [source] Who is publishing: `host` or `widget`.\n\t\t\t\t * @return {void}\n\t\t\t\t */\n\t\t\t\tset: (id, items, source = 'widget') => {\n\t\t\t\t\t// `activePanelActions` spreads what is stored, so a\n\t\t\t\t\t// non-array becomes one menu item per character.\n\t\t\t\t\tif (!id || !Array.isArray(items)) {\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t\tconst forId = { ...(this.panelActionsByWidget[id] || {}), [source]: items }\n\t\t\t\t\tthis.panelActionsByWidget = { ...this.panelActionsByWidget, [id]: forId }\n\t\t\t\t},\n\n\t\t\t\t/**\n\t\t\t\t * Withdraw one source's items, on unmount or when that\n\t\t\t\t * publisher's own menu comes back. The other source's items\n\t\t\t\t * stay.\n\t\t\t\t *\n\t\t\t\t * @param {string} id The publishing widget's id.\n\t\t\t\t * @param {string} [source] Who is withdrawing.\n\t\t\t\t * @return {void}\n\t\t\t\t */\n\t\t\t\tclear: (id, source = 'widget') => {\n\t\t\t\t\tconst forId = this.panelActionsByWidget[id]\n\t\t\t\t\tif (!forId || !(source in forId)) {\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t\tconst { [source]: _removed, ...keptSources } = forId\n\t\t\t\t\tif (Object.keys(keptSources).length) {\n\t\t\t\t\t\tthis.panelActionsByWidget = { ...this.panelActionsByWidget, [id]: keptSources }\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t\tconst { [id]: _gone, ...rest } = this.panelActionsByWidget\n\t\t\t\t\tthis.panelActionsByWidget = rest\n\t\t\t\t},\n\t\t\t},\n\t\t}\n\t},\n\n\tinject: {\n\t\t/** The app's look, provided by CnAppRoot or CnPageRenderer (`nextcloud` or `board`). */\n\t\tcnLook: { default: 'nextcloud' },\n\t\t/** The tab list's name under the board look, provided by CnDetailPage (`config.tabsLabel`). */\n\t\tcnDetailTabsLabel: { default: null },\n\t\t/**\n\t\t * The host's translate (CnAppRoot provides `cnTranslate`), so a tab\n\t\t * label written in the manifest reads in the user's language.\n\t\t */\n\t\tcnTranslate: { default: () => (key) => key },\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * The widget's config: `{ tabs, ariaLabel }`.\n\t\t *\n\t\t * `tabs[]` entries are `{ widgetId, label?, icon?, count?, countField?, overflow? }`.\n\t\t * `label` and `icon` fall back to the referenced widget's own title and\n\t\t * icon. `count` is a number shown after the label; `countField` reads\n\t\t * it off the record instead (a list counts its items). `countFrom`\n\t\t * counts a list on the server: `\"widget\"` counts the child widget's\n\t\t * own list (`content.register`, `schema`, `filter`, tokens such as\n\t\t * `@objectId` resolved), an object `{ register, schema, filter? }`\n\t\t * names the list; `count` and `countField` win over it. `overflow: true`\n\t\t * lists the tab under \"More\".\n\t\t *\n\t\t * A tab with `widgetIds` can lay them out in a grid instead of one under\n\t\t * the other: `columns: 4` gives each a quarter of the row, and\n\t\t * `layout: [{ widgetId, gridWidth }]` sets a width (of 12) per widget, as\n\t\t * the page grid does. Widgets wrap onto the next row.\n\t\t *\n\t\t * `maxVisibleTabs` caps the strip: later tabs go under \"More\".\n\t\t * `hideEmpty: true` moves a tab whose count is 0 there too.\n\t\t * `moreLabel` names that menu. `variant: \"segmented\"` draws the strip\n\t\t * as a pill switch (CnTabs' segmented variant); `line` is the default.\n\t\t *\n\t\t * @type {{ tabs?: Array<{widgetId?: string, widgetIds?: string[], label?: string, icon?: string, count?: number, countField?: string, countFrom?: ('widget'|{register: string, schema: string, filter?: object}), overflow?: boolean, columns?: number, layout?: Array<{widgetId: string, gridWidth: number}>}>, ariaLabel?: string, maxVisibleTabs?: number, hideEmpty?: boolean, moreLabel?: string, variant?: ('line'|'segmented') }}\n\t\t */\n\t\tcontent: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({}),\n\t\t},\n\n\t\t/**\n\t\t * Every widget definition available on the surface, for `content.tabs[]`\n\t\t * to reference by id.\n\t\t *\n\t\t * The surface passes its whole list rather than the resolved children\n\t\t * because a tab may name a widget that does not exist, and this component\n\t\t * has to be able to say so.\n\t\t *\n\t\t * @type {object[]}\n\t\t */\n\t\tavailableWidgets: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t\t/** The bound record's id. */\n\t\tobjectId: {\n\t\t\ttype: [String, Number],\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The loaded record, or null while it is still being fetched. */\n\t\tobjectData: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** The resolved object-type slug. */\n\t\tobjectType: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The resolved JSON Schema object, needed by a `data` child. */\n\t\tschemaObject: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** OpenRegister register slug of the surface. */\n\t\tregister: {\n\t\t\ttype: [String, Object],\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** OpenRegister schema slug of the surface. */\n\t\tschema: {\n\t\t\ttype: [String, Object],\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The effective object store. */\n\t\tstore: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** Rendering surface forwarded to integration children (AD-19). */\n\t\tsurface: {\n\t\t\ttype: String,\n\t\t\tdefault: 'detail-page',\n\t\t},\n\n\t\t/** Object context forwarded to integration children. */\n\t\tintegrationContext: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** The consumer's component registry, for custom child widget types. */\n\t\tcnRegistry: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({}),\n\t\t},\n\n\t\t/** Show the Refresh entry in the hoisted Actions menu. */\n\t\tshowRefresh: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true,\n\t\t},\n\n\t\t/** Show the Request-a-feature entry in the hoisted Actions menu. */\n\t\tshowRequestFeature: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true,\n\t\t},\n\n\t\t/** Show the Documentation entry in the hoisted Actions menu. */\n\t\tshowDocumentation: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true,\n\t\t},\n\n\t\t/** Documentation URL for the hoisted Actions menu. */\n\t\tdocumentationUrl: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\t},\n\n\temits: ['geo-saved', 'open-integration', 'select-object'],\n\n\tdata() {\n\t\treturn {\n\t\t\tactiveIndex: 0,\n\t\t\t// Key of the tab showing, so it stays the active one when a tab\n\t\t\t// before it appears or disappears.\n\t\t\tactiveKey: '',\n\t\t\t// Result of each tab's SOURCE-mode `visibleWhen`, by the tab's index\n\t\t\t// in `content.tabs`. A missing entry means the count is pending.\n\t\t\tsourceVisibility: {},\n\t\t\t// Bumped per evaluation round, so a slow answer from an earlier round is dropped.\n\t\t\tvisibilitySeq: 0,\n\t\t\t// Totals counted for tabs with `countFrom`, by position in `content.tabs`.\n\t\t\twidgetCounts: {},\n\t\t\tcountSeq: 0,\n\t\t\t// Tab id named by the route hash that has not appeared yet (still pending).\n\t\t\thashTargetId: '',\n\t\t\t// Items published by the panels, keyed by widget id. Keyed rather\n\t\t\t// than a flat list because `lazy` keeps a visited tab mounted, so\n\t\t\t// more than one panel publishes at a time.\n\t\t\tpanelActionsByWidget: {},\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/**\n\t\t * The open panel's own menu items, or an empty list.\n\t\t *\n\t\t * @return {object[]} PanelAction descriptors for the active tab.\n\t\t */\n\t\tactivePanelActions() {\n\t\t\tconst forId = this.panelActionsByWidget[this.activeWidgetId]\n\t\t\tif (!forId) {\n\t\t\t\treturn []\n\t\t\t}\n\t\t\t// Host first, then the widget's own: the catalog Add is about the\n\t\t\t// panel as a whole, the widget's items about what is in it.\n\t\t\treturn [...(forId.host || []), ...(forId.widget || [])]\n\t\t},\n\n\t\t/**\n\t\t * The configured tabs, each paired with the widget definition it names.\n\t\t *\n\t\t * A tab goes under the strip's \"More\" menu when it says `overflow`, when\n\t\t * `content.hideEmpty` is set and its count is 0, or when\n\t\t * `content.maxVisibleTabs` places are already taken. `count` is a\n\t\t * literal, or read off the record through `countField`.\n\t\t *\n\t\t * @return {object[]} `{ key, widgetId, label, icon, widget, count, overflow }` per tab.\n\t\t * @spec openspec/changes/detail-action-model-and-case-surfaces/specs/detail-action-model/spec.md#requirement-tab-counts-and-overflow\n\t\t */\n\t\tresolvedTabs() {\n\t\t\tconst authored = Array.isArray(this.content?.tabs) ? this.content.tabs : []\n\t\t\t// The board look: the activity is the History tab and the last tab,\n\t\t\t// whatever its place in the manifest. `index` stays the position in\n\t\t\t// `content.tabs`, which the source-mode conditions are keyed on.\n\t\t\tconst isActivityTab = (tab) => {\n\t\t\t\tconst id = this.tabWidgetIds(tab)[0]\n\t\t\t\treturn isActivityWidget(this.availableWidgets.find((w) => w && w.id === id))\n\t\t\t}\n\t\t\tconst ordered = authored.map((tab, index) => ({ tab, index }))\n\t\t\tif (this.isBoard) {\n\t\t\t\tordered.sort((a, b) => (Number(isActivityTab(a.tab)) - Number(isActivityTab(b.tab))) || (a.index - b.index))\n\t\t\t}\n\t\t\tconst tabs = ordered.map(({ tab }) => tab)\n\t\t\tconst originalIndex = ordered.map(({ index }) => index)\n\t\t\tconst max = Number(this.content?.maxVisibleTabs)\n\t\t\tconst hideEmpty = this.content?.hideEmpty === true\n\t\t\t// How many tabs have taken a place in the strip so far. A tab that\n\t\t\t// is already going under \"More\" does not use one up.\n\t\t\tlet placed = 0\n\t\t\tconst resolved = []\n\t\t\ttabs.forEach((tab, position) => {\n\t\t\t\tconst index = originalIndex[position]\n\t\t\t\t// A tab whose condition is false is absent, not empty.\n\t\t\t\tconst visibility = this.tabVisibility(tab, index)\n\t\t\t\tif (visibility === 'hidden') {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\t// A stack (`widgetIds`) resolves every id; one that names no\n\t\t\t\t// widget is skipped. The first that resolves is the panel's.\n\t\t\t\tconst ids = this.tabWidgetIds(tab)\n\t\t\t\tconst widgets = ids.length > 1\n\t\t\t\t\t? ids.map((id) => this.availableWidgets.find((w) => w && w.id === id) || null).filter(Boolean)\n\t\t\t\t\t: []\n\t\t\t\tconst widget = ids.length > 1\n\t\t\t\t\t? (widgets[0] || null)\n\t\t\t\t\t: (this.availableWidgets.find((w) => w && w.id === ids[0]) || null)\n\t\t\t\tconst widgetId = widget ? widget.id : ids[0]\n\t\t\t\tconst declared = resolveTabCount(typeof tab === 'object' ? tab : null, this.objectData)\n\t\t\t\tconst counted = this.widgetCounts[index]\n\t\t\t\tconst count = declared === null && typeof counted === 'number' ? counted : declared\n\t\t\t\t// The board strip has no \"More\": every tab is in the strip.\n\t\t\t\tlet overflow = !this.isBoard && ((tab && tab.overflow === true) || (hideEmpty && count === 0))\n\t\t\t\tif (!overflow && !this.isBoard) {\n\t\t\t\t\tif (Number.isFinite(max) && max > 0 && placed >= max) {\n\t\t\t\t\t\toverflow = true\n\t\t\t\t\t} else {\n\t\t\t\t\t\tplaced += 1\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tresolved.push({\n\t\t\t\t\tkey: `${widgetId || 'tab'}-${index}`,\n\t\t\t\t\tid: (tab && typeof tab === 'object' && tab.id) || widgetId || '',\n\t\t\t\t\twidgetId,\n\t\t\t\t\tlabel: this.tabLabel(tab, widget, widgetId),\n\t\t\t\t\ticon: (tab && tab.icon) || widget?.icon || '',\n\t\t\t\t\twidget,\n\t\t\t\t\tstack: widgets.slice(1),\n\t\t\t\t\tgrid: this.stackGrid(tab, widgets),\n\t\t\t\t\tcount,\n\t\t\t\t\toverflow,\n\t\t\t\t\tpending: visibility === 'pending',\n\t\t\t\t})\n\t\t\t})\n\t\t\treturn resolved\n\t\t},\n\n\t\t/** @return {string} The keys of the tabs in the strip, to notice one appearing or going. */\n\t\tvisibleKeys() {\n\t\t\treturn this.resolvedTabs.map((tab) => tab.key).join('|')\n\t\t},\n\n\t\t/** @return {string} Accessible name of a pending tab's spinner. */\n\t\tloadingLabel() {\n\t\t\treturn t('nextcloud-vue', 'Loading …')\n\t\t},\n\n\t\t/**\n\t\t * The lists the tabs count (`countFrom`), serialised, to count again\n\t\t * when they change.\n\t\t *\n\t\t * @return {string} The key.\n\t\t */\n\t\tcountSourcesKey() {\n\t\t\tconst tabs = Array.isArray(this.content?.tabs) ? this.content.tabs : []\n\t\t\treturn JSON.stringify(tabs.map((tab) => this.countSourceOf(tab)))\n\t\t},\n\n\t\t/** @return {string} The source-mode conditions, serialised, to re-evaluate when they change. */\n\t\tsourceConditionsKey() {\n\t\t\tconst tabs = Array.isArray(this.content?.tabs) ? this.content.tabs : []\n\t\t\treturn JSON.stringify(tabs.map((tab) => (tab && typeof tab === 'object' && tab.visibleWhen && !isLocallyDecidableVisibleWhen(tab.visibleWhen)) ? tab.visibleWhen : null))\n\t\t},\n\n\t\t/**\n\t\t * Name of the menu that holds the tabs that are not in the strip.\n\t\t *\n\t\t * @return {string|undefined} The configured label, or undefined for the default.\n\t\t * @spec openspec/changes/detail-action-model-and-case-surfaces/specs/detail-action-model/spec.md#requirement-tab-counts-and-overflow\n\t\t */\n\t\tmoreLabel() {\n\t\t\tconst label = this.content?.moreLabel\n\t\t\treturn typeof label === 'string' && label !== '' ? label : undefined\n\t\t},\n\n\t\t/**\n\t\t * The tab currently showing.\n\t\t *\n\t\t * @return {object|null} The resolved tab, or null when there are none.\n\t\t */\n\t\tactiveTab() {\n\t\t\treturn this.resolvedTabs[this.activeIndex] || null\n\t\t},\n\n\t\t/**\n\t\t * The active child's id, so the hoisted Refresh reaches THAT child's\n\t\t * fetch over `cn:widget:refresh` rather than a sibling's.\n\t\t *\n\t\t * @return {string} The active widget id.\n\t\t */\n\t\tactiveWidgetId() {\n\t\t\treturn this.activeTab?.widgetId || ''\n\t\t},\n\n\t\t/**\n\t\t * The active child's label, so the Actions menu names what it acts on.\n\t\t *\n\t\t * @return {string} The active tab's label.\n\t\t */\n\t\tactiveTitle() {\n\t\t\treturn this.activeTab?.label || ''\n\t\t},\n\n\t\t/**\n\t\t * The strip's look: `segmented` when the content asks for it, else\n\t\t * CnTabs' default `line`. An unknown value falls back to `line`.\n\t\t *\n\t\t * @spec openspec/changes/zuiddrecht-pixel-gaps/specs/zuiddrecht-pixel-gaps/spec.md#requirement-a-tabs-widget-renders-a-segmented-strip\n\t\t * @return {('line'|'segmented')} The CnTabs variant.\n\t\t */\n\t\tstripVariant() {\n\t\t\treturn this.content?.variant === 'segmented' ? 'segmented' : 'line'\n\t\t},\n\n\t\t/**\n\t\t * Accessible name for the tab strip.\n\t\t *\n\t\t * @return {string} The aria-label.\n\t\t */\n\t\tstripLabel() {\n\t\t\tconst named = this.isBoard && this.cnDetailTabsLabel ? this.cnDetailTabsLabel.value : ''\n\t\t\treturn this.content?.ariaLabel || named || t('nextcloud-vue', 'Details')\n\t\t},\n\n\t\t/**\n\t\t * Whether the strip is drawn in the board look.\n\t\t *\n\t\t * @return {boolean} True in the board look.\n\t\t * @spec openspec/changes/screens-detail-page-parity/specs/detail-page-board-look/spec.md#requirement-folder-tabs-take-the-board-strip\n\t\t */\n\t\tisBoard() {\n\t\t\treturn normalizeLook(this.cnLook) === 'board'\n\t\t},\n\t},\n\n\twatch: {\n\t\tactiveIndex(index) {\n\t\t\tthis.activeKey = this.resolvedTabs[index]?.key || ''\n\t\t},\n\n\t\t// A tab appeared or went. Keep the same tab active; when it is the active\n\t\t// tab that went, the first visible one takes over and the hash follows.\n\t\tvisibleKeys() {\n\t\t\tif (this.hashTargetId !== '') {\n\t\t\t\tconst arrived = this.resolvedTabs.findIndex((tab) => tab.id === this.hashTargetId && !tab.pending)\n\t\t\t\tif (arrived >= 0) {\n\t\t\t\t\tthis.activeIndex = arrived\n\t\t\t\t\tthis.hashTargetId = ''\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tif (!this.resolvedTabs.some((tab) => tab.id === this.hashTargetId)) {\n\t\t\t\t\tthis.hashTargetId = ''\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst stay = this.resolvedTabs.findIndex((tab) => tab.key === this.activeKey)\n\t\t\tif (stay >= 0) {\n\t\t\t\tif (stay !== this.activeIndex) {\n\t\t\t\t\tthis.activeIndex = stay\n\t\t\t\t}\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst first = this.resolvedTabs.findIndex((tab) => !tab.overflow && !tab.pending)\n\t\t\tthis.activeIndex = first >= 0 ? first : 0\n\t\t\tthis.activeKey = this.resolvedTabs[this.activeIndex]?.key || ''\n\t\t\tthis.syncHash()\n\t\t},\n\n\t\tobjectId() {\n\t\t\tthis.sourceVisibility = {}\n\t\t\tthis.refreshSourceVisibility()\n\t\t\tthis.widgetCounts = {}\n\t\t\tthis.refreshWidgetCounts()\n\t\t},\n\n\t\tcountSourcesKey() {\n\t\t\tthis.refreshWidgetCounts()\n\t\t},\n\n\t\tsourceConditionsKey() {\n\t\t\tthis.refreshSourceVisibility()\n\t\t},\n\t},\n\n\t/**\n\t * Open on the first tab that is in the strip. Tab 0 is the default, and\n\t * when tab 0 sits under \"More\" the strip would open on a tab the author\n\t * chose to tuck away.\n\t *\n\t * @spec openspec/changes/detail-action-model-and-case-surfaces/specs/detail-action-model/spec.md#requirement-tab-counts-and-overflow\n\t */\n\tcreated() {\n\t\t// A route hash naming a tab opens that tab. One naming a hidden tab is\n\t\t// ignored, without an error; one naming a tab still pending is honoured\n\t\t// once its condition answers.\n\t\tconst wanted = this.currentHash()\n\t\tconst named = wanted === '' ? -1 : this.resolvedTabs.findIndex((tab) => tab.id === wanted)\n\t\tif (named >= 0 && !this.resolvedTabs[named].pending) {\n\t\t\tthis.activeIndex = named\n\t\t} else {\n\t\t\tif (named >= 0) {\n\t\t\t\tthis.hashTargetId = wanted\n\t\t\t}\n\t\t\tconst first = this.resolvedTabs.findIndex((tab) => !tab.overflow && !tab.pending)\n\t\t\tconst fallback = first >= 0 ? first : this.resolvedTabs.findIndex((tab) => !tab.overflow)\n\t\t\tif (fallback > 0) {\n\t\t\t\tthis.activeIndex = fallback\n\t\t\t}\n\t\t}\n\t\tthis.activeKey = this.resolvedTabs[this.activeIndex]?.key || ''\n\t\tthis.refreshSourceVisibility()\n\t\tthis.refreshWidgetCounts()\n\t},\n\n\tmounted() {\n\t\tthis._onRefresh = () => {\n\t\t\tthis.refreshSourceVisibility()\n\t\t\tthis.refreshWidgetCounts()\n\t\t}\n\t\tsubscribe('cn:page:refresh', this._onRefresh)\n\t\tsubscribe('cn:widget:refresh', this._onRefresh)\n\t},\n\n\tbeforeUnmount() {\n\t\tunsubscribe('cn:page:refresh', this._onRefresh)\n\t\tunsubscribe('cn:widget:refresh', this._onRefresh)\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * The grid a stack lays its widgets out in, as one column span (of 12)\n\t\t * per widget in order, or null for the plain vertical stack. A tab says\n\t\t * `columns: 4` (every widget spans a quarter of the row) and/or\n\t\t * `layout: [{ widgetId, gridWidth }]`, the page grid's width key per\n\t\t * widget (of 12; a widget it does not name takes the `columns` share, or\n\t\t * the whole row). Widgets wrap onto the next row. Heights follow the\n\t\t * content.\n\t\t *\n\t\t * @param {object|string} tab The `content.tabs[]` entry.\n\t\t * @param {Array<object>} widgets The widgets of the stack, in order.\n\t\t * @return {number[]|null} The column span of each widget, or null.\n\t\t */\n\t\tstackGrid(tab, widgets) {\n\t\t\tif (!tab || typeof tab !== 'object' || widgets.length < 2) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tconst clamp = (value) => Math.min(12, Math.max(1, Math.floor(Number(value))))\n\t\t\tconst columns = Number(tab.columns)\n\t\t\tconst share = Number.isFinite(columns) && columns >= 1 ? clamp(12 / Math.min(12, Math.floor(columns))) : 12\n\t\t\tconst placed = new Map((Array.isArray(tab.layout) ? tab.layout : [])\n\t\t\t\t.filter((entry) => entry && typeof entry.widgetId === 'string' && Number.isFinite(Number(entry.gridWidth)))\n\t\t\t\t.map((entry) => [entry.widgetId, clamp(entry.gridWidth)]))\n\t\t\tif (placed.size === 0 && share === 12) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\treturn widgets.map((widget) => placed.get(widget.id) ?? share)\n\t\t},\n\n\t\t/**\n\t\t * The inline column span of one widget of a gridded stack.\n\t\t *\n\t\t * @param {number[]|null} grid The spans of the stack, or null.\n\t\t * @param {number} index The widget's position in the stack.\n\t\t * @return {object|undefined} The style, or undefined without a grid.\n\t\t */\n\t\tspanStyle(grid, index) {\n\t\t\treturn grid ? { gridColumn: `span ${grid[index] || 12}` } : undefined\n\t\t},\n\n\t\t/**\n\t\t * The widget ids a tab names: `widgetIds` (a stack) when it holds at\n\t\t * least one id, else `widgetId`, or the bare string.\n\t\t *\n\t\t * @param {object|string} tab The `content.tabs[]` entry.\n\t\t * @return {string[]} The ids, at least one entry (possibly undefined).\n\t\t * @spec openspec/changes/screens-relation-pages/specs/relation-pages/spec.md#requirement-a-tab-can-hold-a-stack-of-widgets\n\t\t */\n\t\ttabWidgetIds(tab) {\n\t\t\tif (typeof tab === 'string') {\n\t\t\t\treturn [tab]\n\t\t\t}\n\t\t\tif (tab && Array.isArray(tab.widgetIds)) {\n\t\t\t\tconst ids = tab.widgetIds.filter((id) => typeof id === 'string' && id !== '')\n\t\t\t\tif (ids.length) {\n\t\t\t\t\treturn ids\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn [tab?.widgetId]\n\t\t},\n\n\t\t/**\n\t\t * The label a tab shows: the authored `label`, else (board look) History\n\t\t * for the activity widget, else the child widget's title, else its id.\n\t\t * A manifest label or title goes through the host's translate; the\n\t\t * library's own History is translated by the library catalogue.\n\t\t *\n\t\t * @param {object|string} tab The `content.tabs[]` entry.\n\t\t * @param {object|null} widget The widget definition it names.\n\t\t * @param {string} widgetId The widget id.\n\t\t * @return {string} The label.\n\t\t * @spec openspec/changes/screens-detail-labels-parity/specs/detail-labels-board-look/spec.md#requirement-detail-labels-read-in-the-users-language\n\t\t */\n\t\ttabLabel(tab, widget, widgetId) {\n\t\t\tconst translate = typeof this.cnTranslate === 'function' ? this.cnTranslate : (key) => key\n\t\t\tif (tab && typeof tab.label === 'string' && tab.label !== '') {\n\t\t\t\treturn translate(tab.label)\n\t\t\t}\n\t\t\tif (this.isBoard && isActivityWidget(widget)) {\n\t\t\t\treturn t('nextcloud-vue', 'History')\n\t\t\t}\n\t\t\tconst title = widgetTitleOf(widget)\n\t\t\treturn title ? translate(title) : (widgetId || '')\n\t\t},\n\n\t\t/**\n\t\t * Whether a tab shows: `visible`, `hidden`, or `pending` while its\n\t\t * condition cannot be decided yet (object not loaded, count not back).\n\t\t *\n\t\t * @param {string|object} tab The tab entry.\n\t\t * @param {number} index Its index in `content.tabs`.\n\t\t * @return {('visible'|'hidden'|'pending')} The state.\n\t\t * @spec openspec/changes/tabs-widget-visible-if/tasks.md#task-2\n\t\t */\n\t\ttabVisibility(tab, index) {\n\t\t\tconst cond = tab && typeof tab === 'object' ? tab.visibleWhen : null\n\t\t\tif (!cond) {\n\t\t\t\treturn 'visible'\n\t\t\t}\n\t\t\tif (isLocallyDecidableVisibleWhen(cond)) {\n\t\t\t\tif (!this.objectData) {\n\t\t\t\t\treturn 'pending'\n\t\t\t\t}\n\t\t\t\treturn evaluateVisibleWhenLocal(cond, this.objectData) ? 'visible' : 'hidden'\n\t\t\t}\n\t\t\tconst answer = this.sourceVisibility[index]\n\t\t\tif (answer === undefined) {\n\t\t\t\treturn 'pending'\n\t\t\t}\n\t\t\treturn answer ? 'visible' : 'hidden'\n\t\t},\n\n\t\t/**\n\t\t * Count the rows behind each source-mode condition: once on mount, when\n\t\t * the record changes, and after a refresh a write triggers. A tab keeps\n\t\t * its last answer while the new one is on its way, so the strip does\n\t\t * not jump.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t * @spec openspec/changes/tabs-widget-visible-if/tasks.md#task-2\n\t\t */\n\t\tasync refreshSourceVisibility() {\n\t\t\tconst tabs = Array.isArray(this.content?.tabs) ? this.content.tabs : []\n\t\t\tconst seq = ++this.visibilitySeq\n\t\t\tconst ctx = { objectId: this.objectId, object: this.objectData || undefined }\n\t\t\tawait Promise.all(tabs.map(async (tab, index) => {\n\t\t\t\tconst cond = tab && typeof tab === 'object' ? tab.visibleWhen : null\n\t\t\t\tif (!cond || isLocallyDecidableVisibleWhen(cond)) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tconst answer = await evaluateVisibleWhen(cond, ctx)\n\t\t\t\tif (seq === this.visibilitySeq) {\n\t\t\t\t\tthis.sourceVisibility = { ...this.sourceVisibility, [index]: answer }\n\t\t\t\t}\n\t\t\t}))\n\t\t},\n\n\t\t/**\n\t\t * The list a tab counts (`countFrom`): `\"widget\"` counts the child\n\t\t * widget's own list (its `content.register`, `content.schema` and\n\t\t * `content.filter`); an object `{ register, schema, filter? }` names\n\t\t * the list itself. Null for a tab that does not ask, or a child with\n\t\t * no list.\n\t\t *\n\t\t * @param {object|string} tab The `content.tabs[]` entry.\n\t\t * @return {{register: string, schema: string, filter: object}|null} The list.\n\t\t * @spec openspec/changes/screens-tab-counts-parity/specs/tab-counts/spec.md#requirement-a-tab-can-count-its-list\n\t\t */\n\t\tcountSourceOf(tab) {\n\t\t\tconst from = tab && typeof tab === 'object' ? tab.countFrom : null\n\t\t\tlet source = null\n\t\t\tif (from === 'widget') {\n\t\t\t\t// A stack counts its first widget that has a list.\n\t\t\t\tconst lists = this.tabWidgetIds(tab)\n\t\t\t\t\t.map((id) => this.availableWidgets.find((w) => w && w.id === id))\n\t\t\t\t\t.filter((w) => w && w.content && typeof w.content === 'object' && w.content.register && w.content.schema)\n\t\t\t\tsource = lists.length ? lists[0].content : null\n\t\t\t} else if (from && typeof from === 'object') {\n\t\t\t\tsource = from\n\t\t\t}\n\t\t\tif (!source || typeof source.register !== 'string' || source.register === '' || typeof source.schema !== 'string' || source.schema === '') {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tconst filter = source.filter && typeof source.filter === 'object' && !Array.isArray(source.filter) ? source.filter : {}\n\t\t\treturn { register: source.register, schema: source.schema, filter }\n\t\t},\n\n\t\t/**\n\t\t * Count the list behind every tab with `countFrom`: once on mount,\n\t\t * when the record changes and after a refresh. A tab keeps its last\n\t\t * total while the new one is on its way; a failed count shows none.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t * @spec openspec/changes/screens-tab-counts-parity/specs/tab-counts/spec.md#requirement-a-tab-can-count-its-list\n\t\t */\n\t\tasync refreshWidgetCounts() {\n\t\t\tconst tabs = Array.isArray(this.content?.tabs) ? this.content.tabs : []\n\t\t\tconst seq = ++this.countSeq\n\t\t\tconst ctx = { objectId: this.objectId, object: this.objectData || undefined }\n\t\t\tawait Promise.all(tabs.map(async (tab, index) => {\n\t\t\t\tconst source = this.countSourceOf(tab)\n\t\t\t\tif (!source) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tconst total = await fetchListTotal(source.register, source.schema, source.filter, ctx).catch(() => null)\n\t\t\t\tif (seq === this.countSeq) {\n\t\t\t\t\tthis.widgetCounts = { ...this.widgetCounts, [index]: total }\n\t\t\t\t}\n\t\t\t}))\n\t\t},\n\n\t\t/** @return {string} The route hash without its `#`, or ''. */\n\t\tcurrentHash() {\n\t\t\tconst fromRoute = this.$route && typeof this.$route.hash === 'string' ? this.$route.hash : ''\n\t\t\tconst raw = fromRoute !== '' ? fromRoute : (typeof window !== 'undefined' && window.location ? window.location.hash : '')\n\t\t\treturn typeof raw === 'string' ? raw.replace(/^#/, '') : ''\n\t\t},\n\n\t\t/**\n\t\t * After the active tab went, point a deep link's hash at the tab now showing.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tsyncHash() {\n\t\t\tconst id = this.activeTab?.id\n\t\t\tconst route = this.$route\n\t\t\tif (!id || !route || !route.hash || !this.$router || typeof this.$router.replace !== 'function') {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.$router.replace({ hash: `#${id}`, query: route.query })\n\t\t},\n\n\t\t/**\n\t\t * Re-emit a geo child's save so the surface can reload the record.\n\t\t *\n\t\t * @param {object} geo The saved geometry.\n\t\t * @return {void}\n\t\t */\n\t\tonGeoSaved(geo) {\n\t\t\t/**\n\t\t\t * @event geo-saved Re-emitted from a geo child that saved a geometry.\n\t\t\t * @type {object}\n\t\t\t */\n\t\t\tthis.$emit('geo-saved', geo)\n\t\t},\n\n\t\t/**\n\t\t * Re-emit a related child's request to open an integration.\n\t\t *\n\t\t * @param {string} integrationId The integration to open.\n\t\t * @return {void}\n\t\t */\n\t\tonOpenIntegration(integrationId) {\n\t\t\t/**\n\t\t\t * @event open-integration Re-emitted from a related child asking to open an integration.\n\t\t\t * @type {string}\n\t\t\t */\n\t\t\tthis.$emit('open-integration', integrationId)\n\t\t},\n\n\t\t/**\n\t\t * Re-emit a related child's object click; the page opens the object.\n\t\t *\n\t\t * @param {object} raw The clicked object.\n\t\t * @return {void}\n\t\t */\n\t\tonSelectObject(raw) {\n\t\t\t/**\n\t\t\t * @event select-object Re-emitted from a related child whose object row was clicked. Payload is the raw object.\n\t\t\t * @type {object}\n\t\t\t */\n\t\t\tthis.$emit('select-object', raw)\n\t\t},\n\n\t\t/**\n\t\t * Follow the strip's own selection, so keyboard navigation moves the\n\t\t * hoisted Actions menu too.\n\t\t *\n\t\t * @param {number} index The newly selected tab index.\n\t\t * @return {void}\n\t\t */\n\t\tonTabChange(index) {\n\t\t\tif (typeof index === 'number' && index >= 0) {\n\t\t\t\tthis.activeIndex = index\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Empty-state text for a tab whose widget id resolves to nothing.\n\t\t *\n\t\t * @param {object} entry The resolved tab.\n\t\t * @return {string} The message.\n\t\t */\n\t\tmissingLabel(entry) {\n\t\t\treturn t('nextcloud-vue', 'No widget found for \"{id}\"', { id: entry.widgetId || '' })\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n/* A stack (`widgetIds`): the panel's widget, then cards 20px apart. */\n.cn-tabs-widget__stack {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 20px;\n}\n\n/* A gridded stack (`columns` / `layout` on the tab): 12 columns, widgets wrap\n onto the next row, a row's cards as tall as the tallest. Narrow, it is the\n plain stack again. */\n.cn-tabs-widget__stack--grid {\n\tdisplay: grid;\n\tgrid-template-columns: repeat(12, minmax(0, 1fr));\n\talign-items: stretch;\n}\n\n.cn-tabs-widget__stack--grid > * {\n\tmin-width: 0;\n}\n\n@media (max-width: 700px) {\n\t.cn-tabs-widget__stack--grid {\n\t\tgrid-template-columns: minmax(0, 1fr);\n\t}\n\n\t.cn-tabs-widget__stack--grid > * {\n\t\tgrid-column: auto !important;\n\t}\n}\n\n/* The panel is the card; the strip is not inside it. There is no title bar\n above the tabs either: the open tab names the panel, so a title row would\n say the same thing twice and cost a row of height on a card that is mostly\n content.\n\n The card chrome used to wrap the strip as well, which drew a border and a\n pair of rounded corners ABOVE the tabs and boxed them in. Folder tabs are\n drawn as the edge of the sheet they open, so a second edge around them\n reads as a header the widget does not have. Border, radius and background\n now live on the panel below, and the strip sits bare on the page. */\n/* The class is doubled on purpose, and the four properties below are RESET\n rather than simply omitted.\n\n Nextcloud serves every enabled app's assets on every page, each app bundles\n this library's compiled CSS, and the Vue scope id is derived from the file\n PATH, so `data-v-1dbd6122` is byte-identical across library versions. An app\n still on an older release therefore ships a rule with exactly this selector\n and the OLD declarations, and it lands on the pages of an app already on the\n new one. Measured on a dossiq case page: three stale copies of the pre-fix\n rule, one from hermiq's `companion.css` (its companion bundle loads on every\n page by design) and two inline from other apps' bundles. Same specificity,\n so source order decided, and the card border came back around the strip.\n\n Dropping a declaration cannot beat a rule that sets it, so `border` and the\n rest are explicitly zeroed. Doubling the class takes this selector to\n (0,3,0) against the stale (0,2,0), which wins on specificity rather than on\n `!important` or on load order this library does not control. The same\n technique, for the same reason, is used on `.cn-tabs__nav .cn-tabs__nav-item`\n in CnTabs to beat Nextcloud's own button margin. */\n.cn-tabs-widget.cn-tabs-widget {\n\tbackground-color: transparent;\n\tborder: 0;\n\tborder-radius: 0;\n\tdisplay: flex;\n\tflex-direction: column;\n\theight: 100%;\n\tmin-height: 0;\n\toverflow: visible;\n\tpadding: 0;\n}\n\n/* No inset, so the first tab starts at the panel's own left edge. The 8px\n here was there to clear the card's rounded top corner; that corner is gone\n from the strip now, and the inset it existed for left the first tab floating\n 8px inside the sheet it opens.\n\n The bar's own bottom rule is switched off and redrawn as a pseudo-element\n that stops one corner radius short of the right edge. CnTabs draws its rule\n across the bar's whole width, which is the sheet's top edge everywhere\n except at the far right, where the panel's top-right corner curves away\n below it: the rule ran straight on to the widget's edge and read as a\n border sticking out past a rounded corner (Ruben, 2026-09-13). Ending it\n where the curve begins makes the rule and the curve one continuous edge. */\n.cn-tabs-widget__tabs :deep(.cn-tabs__bar) {\n\tborder-bottom: none;\n\tpadding: 0;\n\tposition: relative;\n}\n\n.cn-tabs-widget__tabs :deep(.cn-tabs__bar::after) {\n\tborder-bottom: 1px solid var(--color-border);\n\tcontent: '';\n\tinset-block-end: 0;\n\tinset-inline: 0 var(--border-radius-large);\n\tpointer-events: none;\n\tposition: absolute;\n}\n\n/* The open tab erases the slice of the rule directly above the panel with its\n own background-coloured bottom edge, which only works if it paints ABOVE the\n pseudo-element: a positioned pseudo-element otherwise paints over every\n in-flow sibling, rule included. */\n.cn-tabs-widget__tabs :deep(.cn-tabs__nav-item--active) {\n\tposition: relative;\n\tz-index: 1;\n}\n\n.cn-tabs-widget__tabs {\n\tdisplay: flex;\n\tflex-direction: column;\n\t/* Grow to the widget's height, so the panel fills the grid cell the\n\t layout gave it. Without this the strip plus the open panel took only\n\t the height of the panel's content, and a cell of nine rows ended in\n\t 130px of nothing under a sheet that stopped short of its own card. */\n\tflex: 1 1 auto;\n\tmin-height: 0;\n}\n\n/* The panel area is the scroll region, so the strip stays put while a long\n child scrolls under it.\n\n Padded on all four sides. The top was once zeroed to protect the join with\n the open tab, but padding sits inside the painted box — only a margin would\n have opened that gap, and a zero top put every panel's content against the\n strip. */\n.cn-tabs-widget__tabs :deep(.cn-tabs__content) {\n\tbackground-color: var(--color-main-background);\n\t/* Three sides only: the bar's rule (redrawn above, stopping at the corner)\n\t is this sheet's top edge, and the open tab erases the slice of it\n\t directly above the panel so the two read as one surface. A border-top\n\t here would put a second line under that tab which the tab cannot paint\n\t over. */\n\tborder: 1px solid var(--color-border);\n\tborder-top: none;\n\t/* Three rounded corners. The top-left stays square because the first tab\n\t is drawn joined to the panel there, and a curve under it would curl the\n\t sheet away from that tab. The top-right has no tab above it: the strip\n\t ends where the last tab ends and the Actions menu floats free, so a\n\t square corner there read as a sheet cut off, not as a tab's edge. */\n\tborder-radius: 0 var(--border-radius-large) var(--border-radius-large) var(--border-radius-large);\n\tflex: 1 1 auto;\n\tmin-height: 0;\n\toverflow: auto;\n\tpadding: 12px;\n}\n\n.cn-tabs-widget__tabs :deep(.cn-tab) {\n\theight: 100%;\n}\n\n/* A list widget's footer Add bleeds through its card's 16px content padding\n (margin 0 -16px -16px). The panel of a tab pads 12px, so on a tab that\n holds the list directly the footer stuck out 4px on the right and at the\n bottom and made the panel scroll. It bleeds exactly the panel's padding. */\n.cn-tabs-widget__tabs :deep(.cn-tabs__content > .cn-tab > .cn-detail-widget-host--bare .cn-object-list-widget__add) {\n\tmargin: auto -12px -12px;\n}\n\n.cn-tabs-widget__title {\n\talign-items: center;\n\tdisplay: inline-flex;\n\tgap: 6px;\n}\n\n.cn-tabs-widget__title-icon {\n\tflex: 0 0 auto;\n}\n</style>\n"],"names":["_createVNode","_createElementBlock","_Fragment","_renderList","_createBlock","_openBlock","_createElementVNode","_createTextVNode","_toDisplayString","_normalizeClass","_normalizeStyle"],"mappings":"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"}
1
+ {"version":3,"file":"CnTabsWidget.vue3.js","sources":["../../../../src/components/CnTabsWidget/CnTabsWidget.vue?vue&type=template&id=72f3975c&lang.js"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n\n<template>\n\t<div class=\"cn-tabs-widget\">\n\t\t<CnTabs\n\t\t\t:aria-label=\"stripLabel\"\n\t\t\t:moreLabel=\"moreLabel\"\n\t\t\t:variant=\"stripVariant\"\n\t\t\tclass=\"cn-tabs-widget__tabs\"\n\t\t\t@update:activeIndex=\"onTabChange\">\n\t\t\t<!-- One Actions menu for the whole widget, bound to whichever child\n\t\t\t is showing. This is the point of the component: six tabbed\n\t\t\t widgets used to mean six card headers stacked down the page. -->\n\t\t\t<template #nav-end>\n\t\t\t\t<CnActionsMenu\n\t\t\t\t\t:showRefresh=\"showRefresh\"\n\t\t\t\t\t:showRequestFeature=\"showRequestFeature\"\n\t\t\t\t\t:showDocumentation=\"showDocumentation\"\n\t\t\t\t\t:documentationUrl=\"documentationUrl\"\n\t\t\t\t\t:widgetId=\"activeWidgetId\"\n\t\t\t\t\t:title=\"activeTitle\"\n\t\t\t\t\t:variant=\"isBoard ? 'secondary' : undefined\"\n\t\t\t\t\t:surface=\"`widget:${activeWidgetId}`\"\n\t\t\t\t\trefreshChannel=\"cn:widget:refresh\"\n\t\t\t\t\ttestidBase=\"cn-tabs-widget\">\n\t\t\t\t\t<!-- The open panel's own items, below the built-in trio.\n\t\t\t\t\t A panel draws no header, so these would otherwise have\n\t\t\t\t\t nowhere to go: the data widget's Metadata and full edit\n\t\t\t\t\t dialog vanished outright when the panel stopped drawing\n\t\t\t\t\t a card. They are rendered here rather than rebuilt here\n\t\t\t\t\t because `run` closes over the widget that published it,\n\t\t\t\t\t which is what keeps the dialog's per-widget config and\n\t\t\t\t\t the widget's own save path. See utils/panelActions.js.\n\n\t\t\t\t\t Only the ACTIVE panel's items. `lazy` keeps a visited\n\t\t\t\t\t tab mounted, so several panels publish at once and an\n\t\t\t\t\t unfiltered list would offer actions for a sheet nobody\n\t\t\t\t\t is looking at. -->\n\t\t\t\t\t<template v-if=\"activePanelActions.length\" #action-items>\n\t\t\t\t\t\t<NcActionButton\n\t\t\t\t\t\t\tv-for=\"action in activePanelActions\"\n\t\t\t\t\t\t\t:key=\"action.key\"\n\t\t\t\t\t\t\t:closeAfterClick=\"true\"\n\t\t\t\t\t\t\t@click=\"action.run()\">\n\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t<CnIcon :name=\"action.icon\" :size=\"20\" />\n\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t\t{{ action.label }}\n\t\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t</template>\n\t\t\t\t</CnActionsMenu>\n\t\t\t</template>\n\n\t\t\t<CnTab\n\t\t\t\tv-for=\"(entry, index) in resolvedTabs\"\n\t\t\t\t:key=\"entry.key\"\n\t\t\t\t:active=\"index === activeIndex\"\n\t\t\t\t:title=\"entry.label\"\n\t\t\t\t:count=\"entry.count\"\n\t\t\t\t:overflow=\"entry.overflow\"\n\t\t\t\t:disabled=\"entry.pending\"\n\t\t\t\tlazy\n\t\t\t\t@click=\"activeIndex = index\">\n\t\t\t\t<template #title>\n\t\t\t\t\t<span class=\"cn-tabs-widget__title\">\n\t\t\t\t\t\t<CnIcon\n\t\t\t\t\t\t\tv-if=\"entry.icon && !isBoard\"\n\t\t\t\t\t\t\t:name=\"entry.icon\"\n\t\t\t\t\t\t\t:size=\"18\"\n\t\t\t\t\t\t\tclass=\"cn-tabs-widget__title-icon\" />\n\t\t\t\t\t\t{{ entry.label }}\n\t\t\t\t\t\t<NcLoadingIcon\n\t\t\t\t\t\t\tv-if=\"entry.pending\"\n\t\t\t\t\t\t\t:size=\"14\"\n\t\t\t\t\t\t\t:name=\"loadingLabel\"\n\t\t\t\t\t\t\tdata-testid=\"cn-tabs-widget-pending\" />\n\t\t\t\t\t</span>\n\t\t\t\t</template>\n\n\t\t\t\t<!-- A stack (`widgetIds`): every widget is a titled card; the\n\t\t\t\t first joins the open tab, the next ones stand below it. -->\n\t\t\t\t<div\n\t\t\t\t\tv-if=\"entry.widget && entry.stack.length\"\n\t\t\t\t\tclass=\"cn-tabs-widget__stack\"\n\t\t\t\t\t:class=\"{ 'cn-tabs-widget__stack--grid': !!entry.grid }\"\n\t\t\t\t\tdata-testid=\"cn-tabs-widget-stack\">\n\t\t\t\t\t<div class=\"cn-tabs-widget__stack-first\" :style=\"spanStyle(entry.grid, 0)\">\n\t\t\t\t\t\t<CnDetailWidgetHost\n\t\t\t\t\t\t\t:widget=\"entry.widget\"\n\t\t\t\t\t\t\tchrome=\"card\"\n\t\t\t\t\t\t\t:showCardTitle=\"true\"\n\t\t\t\t\t\t\t:showActions=\"false\"\n\t\t\t\t\t\t\t:availableWidgets=\"availableWidgets\"\n\t\t\t\t\t\t\t:objectId=\"objectId\"\n\t\t\t\t\t\t\t:object=\"objectData\"\n\t\t\t\t\t\t\t:objectType=\"objectType\"\n\t\t\t\t\t\t\t:schemaObject=\"schemaObject\"\n\t\t\t\t\t\t\t:register=\"register\"\n\t\t\t\t\t\t\t:schema=\"schema\"\n\t\t\t\t\t\t\t:store=\"store\"\n\t\t\t\t\t\t\t:surface=\"surface\"\n\t\t\t\t\t\t\t:integrationContext=\"integrationContext\"\n\t\t\t\t\t\t\t:cnRegistry=\"cnRegistry\"\n\t\t\t\t\t\t\t@geoSaved=\"onGeoSaved\"\n\t\t\t\t\t\t\t@openIntegration=\"onOpenIntegration\"\n\t\t\t\t\t\t\t@selectObject=\"onSelectObject\" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div\n\t\t\t\t\t\tv-for=\"(child, childIndex) in entry.stack\"\n\t\t\t\t\t\t:key=\"`${entry.key}-${child.id}`\"\n\t\t\t\t\t\tclass=\"cn-tabs-widget__stack-item\"\n\t\t\t\t\t\t:style=\"spanStyle(entry.grid, childIndex + 1)\"\n\t\t\t\t\t\t:data-testid=\"`cn-tabs-widget-stack-${child.id}`\">\n\t\t\t\t\t\t<CnDetailWidgetHost\n\t\t\t\t\t\t\t:widget=\"child\"\n\t\t\t\t\t\t\tchrome=\"card\"\n\t\t\t\t\t\t\t:showCardTitle=\"true\"\n\t\t\t\t\t\t\t:showActions=\"false\"\n\t\t\t\t\t\t\t:availableWidgets=\"availableWidgets\"\n\t\t\t\t\t\t\t:objectId=\"objectId\"\n\t\t\t\t\t\t\t:object=\"objectData\"\n\t\t\t\t\t\t\t:objectType=\"objectType\"\n\t\t\t\t\t\t\t:schemaObject=\"schemaObject\"\n\t\t\t\t\t\t\t:register=\"register\"\n\t\t\t\t\t\t\t:schema=\"schema\"\n\t\t\t\t\t\t\t:store=\"store\"\n\t\t\t\t\t\t\t:surface=\"surface\"\n\t\t\t\t\t\t\t:integrationContext=\"integrationContext\"\n\t\t\t\t\t\t\t:cnRegistry=\"cnRegistry\"\n\t\t\t\t\t\t\t@geoSaved=\"onGeoSaved\"\n\t\t\t\t\t\t\t@openIntegration=\"onOpenIntegration\"\n\t\t\t\t\t\t\t@selectObject=\"onSelectObject\" />\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<CnDetailWidgetHost\n\t\t\t\t\tv-else-if=\"entry.widget\"\n\t\t\t\t\t:widget=\"entry.widget\"\n\t\t\t\t\tchrome=\"bare\"\n\t\t\t\t\t:availableWidgets=\"availableWidgets\"\n\t\t\t\t\t:objectId=\"objectId\"\n\t\t\t\t\t:object=\"objectData\"\n\t\t\t\t\t:objectType=\"objectType\"\n\t\t\t\t\t:schemaObject=\"schemaObject\"\n\t\t\t\t\t:register=\"register\"\n\t\t\t\t\t:schema=\"schema\"\n\t\t\t\t\t:store=\"store\"\n\t\t\t\t\t:surface=\"surface\"\n\t\t\t\t\t:integrationContext=\"integrationContext\"\n\t\t\t\t\t:cnRegistry=\"cnRegistry\"\n\t\t\t\t\t@geoSaved=\"onGeoSaved\"\n\t\t\t\t\t@openIntegration=\"onOpenIntegration\"\n\t\t\t\t\t@selectObject=\"onSelectObject\" />\n\t\t\t\t<CnEmptyContent v-else :name=\"missingLabel(entry)\" />\n\t\t\t</CnTab>\n\t\t</CnTabs>\n\t</div>\n</template>\n\n<script>\nimport { subscribe, unsubscribe } from '@nextcloud/event-bus'\nimport { translate as t } from '@nextcloud/l10n'\nimport { NcActionButton, NcLoadingIcon } from '@nextcloud/vue'\nimport CnDetailWidgetHost from '../CnDetailWidgetHost/CnDetailWidgetHost.vue'\nimport CnEmptyContent from '../CnEmptyContent/CnEmptyContent.vue'\nimport CnIcon from '../CnIcon/CnIcon.vue'\nimport CnTab from '../CnTabs/CnTab.vue'\nimport CnTabs from '../CnTabs/CnTabs.vue'\nimport { normalizeLook } from '../../composables/useLook.js'\nimport { resolveTabCount } from '../../utils/detailActionModel.js'\nimport { fetchListTotal } from '../../utils/fetchFilterCounts.js'\nimport { isActivityWidget } from '../../utils/headerMeta.js'\nimport { PANEL_ACTION_SINK } from '../../utils/panelActions.js'\nimport { evaluateVisibleWhen, evaluateVisibleWhenLocal, isLocallyDecidableVisibleWhen } from '../../utils/visibleWhen.js'\nimport { widgetTitleOf } from '../../utils/widgetDispatch.js'\nimport { CnActionsMenu } from '../CnActionsMenu/index.js'\n\n/**\n * CnTabsWidget — a widget that holds other widgets, one per tab.\n *\n * A detail page that carries notes, files, related records, sub-records, mail\n * and appointments renders six cards, each with its own header and its own\n * Actions menu, stacked down the page. All six say roughly the same thing about\n * one record, and only one of them is being read at a time. This widget puts\n * them behind a tab strip instead.\n *\n * ## What the tabs take over\n *\n * The strip owns the title and the card. A child renders through\n * `CnDetailWidgetHost` with `chrome=\"bare\"`, so it draws no header and no\n * border of its own, and its content fills the panel exactly as it would have\n * filled its card. The tab label is what the widget's card header used to say.\n *\n * The Actions menu moves OUT of the panels and into the bar, beside the strip\n * rather than inside it, and rebinds to whichever child is showing. So there is\n * one menu, and it always acts on what you are looking at.\n *\n * ## Configuring it\n *\n * `content.tabs[]` names the children and their labels, so a deployment can\n * relabel or reorder tabs, or drop one, without touching code:\n *\n * ```js\n * content: {\n * tabs: [\n * { widgetId: 'case-notes', label: 'Notes', icon: 'NoteTextOutline' },\n * { widgetId: 'case-files', label: 'Files and attachments' },\n * ],\n * }\n * ```\n *\n * `label` and `icon` are optional and fall back to the child widget's own\n * title and icon, so the common case is a list of `widgetId`s.\n *\n * ## Panels are lazy, and stay mounted\n *\n * Each panel is a `CnTab` with `lazy`, so a child only mounts when its tab is\n * first opened. Six eager panels that each fetch on `mounted()` would fire six\n * requests on page load to answer five questions nobody asked. Once opened, a\n * panel stays mounted, so switching back never refetches.\n *\n * ## A named tab whose widget is missing\n *\n * The tab still renders, and its panel says which widget id did not resolve.\n * Dropping the tab would be worse: `content.tabs[]` is hand-authored config,\n * and a typo that silently removes a tab is a typo nobody finds.\n */\nexport default {\n\tname: 'CnTabsWidget',\n\n\tcomponents: {\n\t\tCnActionsMenu,\n\t\tCnDetailWidgetHost,\n\t\tCnIcon,\n\t\tCnTab,\n\t\tCnTabs,\n\t\tNcActionButton,\n\t\tCnEmptyContent,\n\t\tNcLoadingIcon,\n\t},\n\n\t/**\n\t * Offer the panels a way to put their own menu items in the strip's menu.\n\t *\n\t * Re-provided one level down by `CnDetailWidgetHost`, which knows the id to\n\t * key by; see utils/panelActions.js for why the items travel up instead of\n\t * being rebuilt here.\n\t *\n\t * @return {object} The provided sink.\n\t */\n\tprovide() {\n\t\treturn {\n\t\t\t[PANEL_ACTION_SINK]: {\n\t\t\t\t/**\n\t\t\t\t * Publish a panel's items, under one SOURCE.\n\t\t\t\t *\n\t\t\t\t * A panel has two possible publishers: the host, for an action\n\t\t\t\t * the host itself would have drawn (the catalog Add), and the\n\t\t\t\t * widget inside it, for its own menu items. Keyed by source so\n\t\t\t\t * the two coexist; a single slot per widget meant whichever\n\t\t\t\t * published last silently replaced the other.\n\t\t\t\t *\n\t\t\t\t * Replaces the map rather than mutating it so the computed that\n\t\t\t\t * reads it re-evaluates on any change.\n\t\t\t\t *\n\t\t\t\t * @param {string} id The publishing widget's id.\n\t\t\t\t * @param {object[]} items Its PanelAction descriptors.\n\t\t\t\t * @param {string} [source] Who is publishing: `host` or `widget`.\n\t\t\t\t * @return {void}\n\t\t\t\t */\n\t\t\t\tset: (id, items, source = 'widget') => {\n\t\t\t\t\t// `activePanelActions` spreads what is stored, so a\n\t\t\t\t\t// non-array becomes one menu item per character.\n\t\t\t\t\tif (!id || !Array.isArray(items)) {\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t\tconst forId = { ...(this.panelActionsByWidget[id] || {}), [source]: items }\n\t\t\t\t\tthis.panelActionsByWidget = { ...this.panelActionsByWidget, [id]: forId }\n\t\t\t\t},\n\n\t\t\t\t/**\n\t\t\t\t * Withdraw one source's items, on unmount or when that\n\t\t\t\t * publisher's own menu comes back. The other source's items\n\t\t\t\t * stay.\n\t\t\t\t *\n\t\t\t\t * @param {string} id The publishing widget's id.\n\t\t\t\t * @param {string} [source] Who is withdrawing.\n\t\t\t\t * @return {void}\n\t\t\t\t */\n\t\t\t\tclear: (id, source = 'widget') => {\n\t\t\t\t\tconst forId = this.panelActionsByWidget[id]\n\t\t\t\t\tif (!forId || !(source in forId)) {\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t\tconst { [source]: _removed, ...keptSources } = forId\n\t\t\t\t\tif (Object.keys(keptSources).length) {\n\t\t\t\t\t\tthis.panelActionsByWidget = { ...this.panelActionsByWidget, [id]: keptSources }\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t\tconst { [id]: _gone, ...rest } = this.panelActionsByWidget\n\t\t\t\t\tthis.panelActionsByWidget = rest\n\t\t\t\t},\n\t\t\t},\n\t\t}\n\t},\n\n\tinject: {\n\t\t/** The app's look, provided by CnAppRoot or CnPageRenderer (`nextcloud` or `board`). */\n\t\tcnLook: { default: 'nextcloud' },\n\t\t/** The tab list's name under the board look, provided by CnDetailPage (`config.tabsLabel`). */\n\t\tcnDetailTabsLabel: { default: null },\n\t\t/**\n\t\t * The records the detail page's `visibilityContext` names, keyed\n\t\t * by name (a case's case type), provided by CnDetailPage. A tab's\n\t\t * `visibleWhen` reads them as `@context.<name>`. Null on any other page.\n\t\t */\n\t\tcnDetailVisibilityRows: { default: null },\n\t\t/**\n\t\t * The host's translate (CnAppRoot provides `cnTranslate`), so a tab\n\t\t * label written in the manifest reads in the user's language.\n\t\t */\n\t\tcnTranslate: { default: () => (key) => key },\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * The widget's config: `{ tabs, ariaLabel }`.\n\t\t *\n\t\t * `tabs[]` entries are `{ widgetId, label?, icon?, count?, countField?, overflow? }`.\n\t\t * `label` and `icon` fall back to the referenced widget's own title and\n\t\t * icon. `count` is a number shown after the label; `countField` reads\n\t\t * it off the record instead (a list counts its items). `countFrom`\n\t\t * counts a list on the server: `\"widget\"` counts the child widget's\n\t\t * own list (`content.register`, `schema`, `filter`, tokens such as\n\t\t * `@objectId` resolved), an object `{ register, schema, filter? }`\n\t\t * names the list; `count` and `countField` win over it. `overflow: true`\n\t\t * lists the tab under \"More\".\n\t\t *\n\t\t * A tab with `widgetIds` can lay them out in a grid instead of one under\n\t\t * the other: `columns: 4` gives each a quarter of the row, and\n\t\t * `layout: [{ widgetId, gridWidth }]` sets a width (of 12) per widget, as\n\t\t * the page grid does. Widgets wrap onto the next row.\n\t\t *\n\t\t * `maxVisibleTabs` caps the strip: later tabs go under \"More\".\n\t\t * `hideEmpty: true` moves a tab whose count is 0 there too.\n\t\t * `moreLabel` names that menu. `variant: \"segmented\"` draws the strip\n\t\t * as a pill switch (CnTabs' segmented variant); `line` is the default.\n\t\t *\n\t\t * @type {{ tabs?: Array<{widgetId?: string, widgetIds?: string[], label?: string, icon?: string, count?: number, countField?: string, countFrom?: ('widget'|{register: string, schema: string, filter?: object}), overflow?: boolean, columns?: number, layout?: Array<{widgetId: string, gridWidth: number}>}>, ariaLabel?: string, maxVisibleTabs?: number, hideEmpty?: boolean, moreLabel?: string, variant?: ('line'|'segmented') }}\n\t\t */\n\t\tcontent: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({}),\n\t\t},\n\n\t\t/**\n\t\t * Every widget definition available on the surface, for `content.tabs[]`\n\t\t * to reference by id.\n\t\t *\n\t\t * The surface passes its whole list rather than the resolved children\n\t\t * because a tab may name a widget that does not exist, and this component\n\t\t * has to be able to say so.\n\t\t *\n\t\t * @type {object[]}\n\t\t */\n\t\tavailableWidgets: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t\t/** The bound record's id. */\n\t\tobjectId: {\n\t\t\ttype: [String, Number],\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The loaded record, or null while it is still being fetched. */\n\t\tobjectData: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** The resolved object-type slug. */\n\t\tobjectType: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The resolved JSON Schema object, needed by a `data` child. */\n\t\tschemaObject: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** OpenRegister register slug of the surface. */\n\t\tregister: {\n\t\t\ttype: [String, Object],\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** OpenRegister schema slug of the surface. */\n\t\tschema: {\n\t\t\ttype: [String, Object],\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The effective object store. */\n\t\tstore: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** Rendering surface forwarded to integration children (AD-19). */\n\t\tsurface: {\n\t\t\ttype: String,\n\t\t\tdefault: 'detail-page',\n\t\t},\n\n\t\t/** Object context forwarded to integration children. */\n\t\tintegrationContext: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** The consumer's component registry, for custom child widget types. */\n\t\tcnRegistry: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({}),\n\t\t},\n\n\t\t/** Show the Refresh entry in the hoisted Actions menu. */\n\t\tshowRefresh: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true,\n\t\t},\n\n\t\t/** Show the Request-a-feature entry in the hoisted Actions menu. */\n\t\tshowRequestFeature: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true,\n\t\t},\n\n\t\t/** Show the Documentation entry in the hoisted Actions menu. */\n\t\tshowDocumentation: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true,\n\t\t},\n\n\t\t/** Documentation URL for the hoisted Actions menu. */\n\t\tdocumentationUrl: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\t},\n\n\temits: ['geo-saved', 'open-integration', 'select-object'],\n\n\tdata() {\n\t\treturn {\n\t\t\tactiveIndex: 0,\n\t\t\t// Key of the tab showing, so it stays the active one when a tab\n\t\t\t// before it appears or disappears.\n\t\t\tactiveKey: '',\n\t\t\t// Result of each tab's SOURCE-mode `visibleWhen`, by the tab's index\n\t\t\t// in `content.tabs`. A missing entry means the count is pending.\n\t\t\tsourceVisibility: {},\n\t\t\t// Bumped per evaluation round, so a slow answer from an earlier round is dropped.\n\t\t\tvisibilitySeq: 0,\n\t\t\t// Totals counted for tabs with `countFrom`, by position in `content.tabs`.\n\t\t\twidgetCounts: {},\n\t\t\tcountSeq: 0,\n\t\t\t// Tab id named by the route hash that has not appeared yet (still pending).\n\t\t\thashTargetId: '',\n\t\t\t// Items published by the panels, keyed by widget id. Keyed rather\n\t\t\t// than a flat list because `lazy` keeps a visited tab mounted, so\n\t\t\t// more than one panel publishes at a time.\n\t\t\tpanelActionsByWidget: {},\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/**\n\t\t * What a tab's `visibleWhen` reads: the record, with the records the\n\t\t * detail page's `visibilityContext` names under `@context.<name>`. Null while\n\t\t * the record, or one of those records, is not there yet.\n\t\t *\n\t\t * @return {object|null}\n\t\t * @spec openspec/changes/detail-widgets-visible-when/specs/detail-widgets-visible-when/spec.md#requirement-a-detail-page-can-load-records-a-condition-names\n\t\t */\n\t\tconditionData() {\n\t\t\tif (!this.objectData) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tconst holder = this.cnDetailVisibilityRows\n\t\t\tif (!holder) {\n\t\t\t\treturn this.objectData\n\t\t\t}\n\t\t\tconst rows = holder.value\n\t\t\tif (!rows) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\treturn { ...this.objectData, '@context': rows }\n\t\t},\n\n\t\t/**\n\t\t * The open panel's own menu items, or an empty list.\n\t\t *\n\t\t * @return {object[]} PanelAction descriptors for the active tab.\n\t\t */\n\t\tactivePanelActions() {\n\t\t\tconst forId = this.panelActionsByWidget[this.activeWidgetId]\n\t\t\tif (!forId) {\n\t\t\t\treturn []\n\t\t\t}\n\t\t\t// Host first, then the widget's own: the catalog Add is about the\n\t\t\t// panel as a whole, the widget's items about what is in it.\n\t\t\treturn [...(forId.host || []), ...(forId.widget || [])]\n\t\t},\n\n\t\t/**\n\t\t * The configured tabs, each paired with the widget definition it names.\n\t\t *\n\t\t * A tab goes under the strip's \"More\" menu when it says `overflow`, when\n\t\t * `content.hideEmpty` is set and its count is 0, or when\n\t\t * `content.maxVisibleTabs` places are already taken. `count` is a\n\t\t * literal, or read off the record through `countField`.\n\t\t *\n\t\t * @return {object[]} `{ key, widgetId, label, icon, widget, count, overflow }` per tab.\n\t\t * @spec openspec/changes/detail-action-model-and-case-surfaces/specs/detail-action-model/spec.md#requirement-tab-counts-and-overflow\n\t\t */\n\t\tresolvedTabs() {\n\t\t\tconst authored = Array.isArray(this.content?.tabs) ? this.content.tabs : []\n\t\t\t// The board look: the activity is the History tab and the last tab,\n\t\t\t// whatever its place in the manifest. `index` stays the position in\n\t\t\t// `content.tabs`, which the source-mode conditions are keyed on.\n\t\t\tconst isActivityTab = (tab) => {\n\t\t\t\tconst id = this.tabWidgetIds(tab)[0]\n\t\t\t\treturn isActivityWidget(this.availableWidgets.find((w) => w && w.id === id))\n\t\t\t}\n\t\t\tconst ordered = authored.map((tab, index) => ({ tab, index }))\n\t\t\tif (this.isBoard) {\n\t\t\t\tordered.sort((a, b) => (Number(isActivityTab(a.tab)) - Number(isActivityTab(b.tab))) || (a.index - b.index))\n\t\t\t}\n\t\t\tconst tabs = ordered.map(({ tab }) => tab)\n\t\t\tconst originalIndex = ordered.map(({ index }) => index)\n\t\t\tconst max = Number(this.content?.maxVisibleTabs)\n\t\t\tconst hideEmpty = this.content?.hideEmpty === true\n\t\t\t// How many tabs have taken a place in the strip so far. A tab that\n\t\t\t// is already going under \"More\" does not use one up.\n\t\t\tlet placed = 0\n\t\t\tconst resolved = []\n\t\t\ttabs.forEach((tab, position) => {\n\t\t\t\tconst index = originalIndex[position]\n\t\t\t\t// A tab whose condition is false is absent, not empty.\n\t\t\t\tconst visibility = this.tabVisibility(tab, index)\n\t\t\t\tif (visibility === 'hidden') {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\t// A stack (`widgetIds`) resolves every id; one that names no\n\t\t\t\t// widget is skipped. The first that resolves is the panel's.\n\t\t\t\tconst ids = this.tabWidgetIds(tab)\n\t\t\t\tconst widgets = ids.length > 1\n\t\t\t\t\t? ids.map((id) => this.availableWidgets.find((w) => w && w.id === id) || null).filter(Boolean)\n\t\t\t\t\t: []\n\t\t\t\tconst widget = ids.length > 1\n\t\t\t\t\t? (widgets[0] || null)\n\t\t\t\t\t: (this.availableWidgets.find((w) => w && w.id === ids[0]) || null)\n\t\t\t\tconst widgetId = widget ? widget.id : ids[0]\n\t\t\t\tconst declared = resolveTabCount(typeof tab === 'object' ? tab : null, this.objectData)\n\t\t\t\tconst counted = this.widgetCounts[index]\n\t\t\t\tconst count = declared === null && typeof counted === 'number' ? counted : declared\n\t\t\t\t// The board strip has no \"More\": every tab is in the strip.\n\t\t\t\tlet overflow = !this.isBoard && ((tab && tab.overflow === true) || (hideEmpty && count === 0))\n\t\t\t\tif (!overflow && !this.isBoard) {\n\t\t\t\t\tif (Number.isFinite(max) && max > 0 && placed >= max) {\n\t\t\t\t\t\toverflow = true\n\t\t\t\t\t} else {\n\t\t\t\t\t\tplaced += 1\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tresolved.push({\n\t\t\t\t\tkey: `${widgetId || 'tab'}-${index}`,\n\t\t\t\t\tid: (tab && typeof tab === 'object' && tab.id) || widgetId || '',\n\t\t\t\t\twidgetId,\n\t\t\t\t\tlabel: this.tabLabel(tab, widget, widgetId),\n\t\t\t\t\ticon: (tab && tab.icon) || widget?.icon || '',\n\t\t\t\t\twidget,\n\t\t\t\t\tstack: widgets.slice(1),\n\t\t\t\t\tgrid: this.stackGrid(tab, widgets),\n\t\t\t\t\tcount,\n\t\t\t\t\toverflow,\n\t\t\t\t\tpending: visibility === 'pending',\n\t\t\t\t})\n\t\t\t})\n\t\t\treturn resolved\n\t\t},\n\n\t\t/** @return {string} The keys of the tabs in the strip, to notice one appearing or going. */\n\t\tvisibleKeys() {\n\t\t\treturn this.resolvedTabs.map((tab) => tab.key).join('|')\n\t\t},\n\n\t\t/** @return {string} Accessible name of a pending tab's spinner. */\n\t\tloadingLabel() {\n\t\t\treturn t('nextcloud-vue', 'Loading …')\n\t\t},\n\n\t\t/**\n\t\t * The lists the tabs count (`countFrom`), serialised, to count again\n\t\t * when they change.\n\t\t *\n\t\t * @return {string} The key.\n\t\t */\n\t\tcountSourcesKey() {\n\t\t\tconst tabs = Array.isArray(this.content?.tabs) ? this.content.tabs : []\n\t\t\treturn JSON.stringify(tabs.map((tab) => this.countSourceOf(tab)))\n\t\t},\n\n\t\t/** @return {string} The source-mode conditions, serialised, to re-evaluate when they change. */\n\t\tsourceConditionsKey() {\n\t\t\tconst tabs = Array.isArray(this.content?.tabs) ? this.content.tabs : []\n\t\t\treturn JSON.stringify(tabs.map((tab) => (tab && typeof tab === 'object' && tab.visibleWhen && !isLocallyDecidableVisibleWhen(tab.visibleWhen)) ? tab.visibleWhen : null))\n\t\t},\n\n\t\t/**\n\t\t * Name of the menu that holds the tabs that are not in the strip.\n\t\t *\n\t\t * @return {string|undefined} The configured label, or undefined for the default.\n\t\t * @spec openspec/changes/detail-action-model-and-case-surfaces/specs/detail-action-model/spec.md#requirement-tab-counts-and-overflow\n\t\t */\n\t\tmoreLabel() {\n\t\t\tconst label = this.content?.moreLabel\n\t\t\treturn typeof label === 'string' && label !== '' ? label : undefined\n\t\t},\n\n\t\t/**\n\t\t * The tab currently showing.\n\t\t *\n\t\t * @return {object|null} The resolved tab, or null when there are none.\n\t\t */\n\t\tactiveTab() {\n\t\t\treturn this.resolvedTabs[this.activeIndex] || null\n\t\t},\n\n\t\t/**\n\t\t * The active child's id, so the hoisted Refresh reaches THAT child's\n\t\t * fetch over `cn:widget:refresh` rather than a sibling's.\n\t\t *\n\t\t * @return {string} The active widget id.\n\t\t */\n\t\tactiveWidgetId() {\n\t\t\treturn this.activeTab?.widgetId || ''\n\t\t},\n\n\t\t/**\n\t\t * The active child's label, so the Actions menu names what it acts on.\n\t\t *\n\t\t * @return {string} The active tab's label.\n\t\t */\n\t\tactiveTitle() {\n\t\t\treturn this.activeTab?.label || ''\n\t\t},\n\n\t\t/**\n\t\t * The strip's look: `segmented` when the content asks for it, else\n\t\t * CnTabs' default `line`. An unknown value falls back to `line`.\n\t\t *\n\t\t * @spec openspec/changes/zuiddrecht-pixel-gaps/specs/zuiddrecht-pixel-gaps/spec.md#requirement-a-tabs-widget-renders-a-segmented-strip\n\t\t * @return {('line'|'segmented')} The CnTabs variant.\n\t\t */\n\t\tstripVariant() {\n\t\t\treturn this.content?.variant === 'segmented' ? 'segmented' : 'line'\n\t\t},\n\n\t\t/**\n\t\t * Accessible name for the tab strip.\n\t\t *\n\t\t * @return {string} The aria-label.\n\t\t */\n\t\tstripLabel() {\n\t\t\tconst named = this.isBoard && this.cnDetailTabsLabel ? this.cnDetailTabsLabel.value : ''\n\t\t\treturn this.content?.ariaLabel || named || t('nextcloud-vue', 'Details')\n\t\t},\n\n\t\t/**\n\t\t * Whether the strip is drawn in the board look.\n\t\t *\n\t\t * @return {boolean} True in the board look.\n\t\t * @spec openspec/changes/screens-detail-page-parity/specs/detail-page-board-look/spec.md#requirement-folder-tabs-take-the-board-strip\n\t\t */\n\t\tisBoard() {\n\t\t\treturn normalizeLook(this.cnLook) === 'board'\n\t\t},\n\t},\n\n\twatch: {\n\t\tactiveIndex(index) {\n\t\t\tthis.activeKey = this.resolvedTabs[index]?.key || ''\n\t\t},\n\n\t\t// A tab appeared or went. Keep the same tab active; when it is the active\n\t\t// tab that went, the first visible one takes over and the hash follows.\n\t\tvisibleKeys() {\n\t\t\tif (this.hashTargetId !== '') {\n\t\t\t\tconst arrived = this.resolvedTabs.findIndex((tab) => tab.id === this.hashTargetId && !tab.pending)\n\t\t\t\tif (arrived >= 0) {\n\t\t\t\t\tthis.activeIndex = arrived\n\t\t\t\t\tthis.hashTargetId = ''\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tif (!this.resolvedTabs.some((tab) => tab.id === this.hashTargetId)) {\n\t\t\t\t\tthis.hashTargetId = ''\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst stay = this.resolvedTabs.findIndex((tab) => tab.key === this.activeKey)\n\t\t\tif (stay >= 0) {\n\t\t\t\tif (stay !== this.activeIndex) {\n\t\t\t\t\tthis.activeIndex = stay\n\t\t\t\t}\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst first = this.resolvedTabs.findIndex((tab) => !tab.overflow && !tab.pending)\n\t\t\tthis.activeIndex = first >= 0 ? first : 0\n\t\t\tthis.activeKey = this.resolvedTabs[this.activeIndex]?.key || ''\n\t\t\tthis.syncHash()\n\t\t},\n\n\t\tobjectId() {\n\t\t\tthis.sourceVisibility = {}\n\t\t\tthis.refreshSourceVisibility()\n\t\t\tthis.widgetCounts = {}\n\t\t\tthis.refreshWidgetCounts()\n\t\t},\n\n\t\tcountSourcesKey() {\n\t\t\tthis.refreshWidgetCounts()\n\t\t},\n\n\t\tsourceConditionsKey() {\n\t\t\tthis.refreshSourceVisibility()\n\t\t},\n\t},\n\n\t/**\n\t * Open on the first tab that is in the strip. Tab 0 is the default, and\n\t * when tab 0 sits under \"More\" the strip would open on a tab the author\n\t * chose to tuck away.\n\t *\n\t * @spec openspec/changes/detail-action-model-and-case-surfaces/specs/detail-action-model/spec.md#requirement-tab-counts-and-overflow\n\t */\n\tcreated() {\n\t\t// A route hash naming a tab opens that tab. One naming a hidden tab is\n\t\t// ignored, without an error; one naming a tab still pending is honoured\n\t\t// once its condition answers.\n\t\tconst wanted = this.currentHash()\n\t\tconst named = wanted === '' ? -1 : this.resolvedTabs.findIndex((tab) => tab.id === wanted)\n\t\tif (named >= 0 && !this.resolvedTabs[named].pending) {\n\t\t\tthis.activeIndex = named\n\t\t} else {\n\t\t\tif (named >= 0) {\n\t\t\t\tthis.hashTargetId = wanted\n\t\t\t}\n\t\t\tconst first = this.resolvedTabs.findIndex((tab) => !tab.overflow && !tab.pending)\n\t\t\tconst fallback = first >= 0 ? first : this.resolvedTabs.findIndex((tab) => !tab.overflow)\n\t\t\tif (fallback > 0) {\n\t\t\t\tthis.activeIndex = fallback\n\t\t\t}\n\t\t}\n\t\tthis.activeKey = this.resolvedTabs[this.activeIndex]?.key || ''\n\t\tthis.refreshSourceVisibility()\n\t\tthis.refreshWidgetCounts()\n\t},\n\n\tmounted() {\n\t\tthis._onRefresh = () => {\n\t\t\tthis.refreshSourceVisibility()\n\t\t\tthis.refreshWidgetCounts()\n\t\t}\n\t\tsubscribe('cn:page:refresh', this._onRefresh)\n\t\tsubscribe('cn:widget:refresh', this._onRefresh)\n\t},\n\n\tbeforeUnmount() {\n\t\tunsubscribe('cn:page:refresh', this._onRefresh)\n\t\tunsubscribe('cn:widget:refresh', this._onRefresh)\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * The grid a stack lays its widgets out in, as one column span (of 12)\n\t\t * per widget in order, or null for the plain vertical stack. A tab says\n\t\t * `columns: 4` (every widget spans a quarter of the row) and/or\n\t\t * `layout: [{ widgetId, gridWidth }]`, the page grid's width key per\n\t\t * widget (of 12; a widget it does not name takes the `columns` share, or\n\t\t * the whole row). Widgets wrap onto the next row. Heights follow the\n\t\t * content.\n\t\t *\n\t\t * @param {object|string} tab The `content.tabs[]` entry.\n\t\t * @param {Array<object>} widgets The widgets of the stack, in order.\n\t\t * @return {number[]|null} The column span of each widget, or null.\n\t\t */\n\t\tstackGrid(tab, widgets) {\n\t\t\tif (!tab || typeof tab !== 'object' || widgets.length < 2) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tconst clamp = (value) => Math.min(12, Math.max(1, Math.floor(Number(value))))\n\t\t\tconst columns = Number(tab.columns)\n\t\t\tconst share = Number.isFinite(columns) && columns >= 1 ? clamp(12 / Math.min(12, Math.floor(columns))) : 12\n\t\t\tconst placed = new Map((Array.isArray(tab.layout) ? tab.layout : [])\n\t\t\t\t.filter((entry) => entry && typeof entry.widgetId === 'string' && Number.isFinite(Number(entry.gridWidth)))\n\t\t\t\t.map((entry) => [entry.widgetId, clamp(entry.gridWidth)]))\n\t\t\tif (placed.size === 0 && share === 12) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\treturn widgets.map((widget) => placed.get(widget.id) ?? share)\n\t\t},\n\n\t\t/**\n\t\t * The inline column span of one widget of a gridded stack.\n\t\t *\n\t\t * @param {number[]|null} grid The spans of the stack, or null.\n\t\t * @param {number} index The widget's position in the stack.\n\t\t * @return {object|undefined} The style, or undefined without a grid.\n\t\t */\n\t\tspanStyle(grid, index) {\n\t\t\treturn grid ? { gridColumn: `span ${grid[index] || 12}` } : undefined\n\t\t},\n\n\t\t/**\n\t\t * The widget ids a tab names: `widgetIds` (a stack) when it holds at\n\t\t * least one id, else `widgetId`, or the bare string.\n\t\t *\n\t\t * @param {object|string} tab The `content.tabs[]` entry.\n\t\t * @return {string[]} The ids, at least one entry (possibly undefined).\n\t\t * @spec openspec/changes/screens-relation-pages/specs/relation-pages/spec.md#requirement-a-tab-can-hold-a-stack-of-widgets\n\t\t */\n\t\ttabWidgetIds(tab) {\n\t\t\tif (typeof tab === 'string') {\n\t\t\t\treturn [tab]\n\t\t\t}\n\t\t\tif (tab && Array.isArray(tab.widgetIds)) {\n\t\t\t\tconst ids = tab.widgetIds.filter((id) => typeof id === 'string' && id !== '')\n\t\t\t\tif (ids.length) {\n\t\t\t\t\treturn ids\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn [tab?.widgetId]\n\t\t},\n\n\t\t/**\n\t\t * The label a tab shows: the authored `label`, else (board look) History\n\t\t * for the activity widget, else the child widget's title, else its id.\n\t\t * A manifest label or title goes through the host's translate; the\n\t\t * library's own History is translated by the library catalogue.\n\t\t *\n\t\t * @param {object|string} tab The `content.tabs[]` entry.\n\t\t * @param {object|null} widget The widget definition it names.\n\t\t * @param {string} widgetId The widget id.\n\t\t * @return {string} The label.\n\t\t * @spec openspec/changes/screens-detail-labels-parity/specs/detail-labels-board-look/spec.md#requirement-detail-labels-read-in-the-users-language\n\t\t */\n\t\ttabLabel(tab, widget, widgetId) {\n\t\t\tconst translate = typeof this.cnTranslate === 'function' ? this.cnTranslate : (key) => key\n\t\t\tif (tab && typeof tab.label === 'string' && tab.label !== '') {\n\t\t\t\treturn translate(tab.label)\n\t\t\t}\n\t\t\tif (this.isBoard && isActivityWidget(widget)) {\n\t\t\t\treturn t('nextcloud-vue', 'History')\n\t\t\t}\n\t\t\tconst title = widgetTitleOf(widget)\n\t\t\treturn title ? translate(title) : (widgetId || '')\n\t\t},\n\n\t\t/**\n\t\t * Whether a tab shows: `visible`, `hidden`, or `pending` while its\n\t\t * condition cannot be decided yet (object not loaded, count not back).\n\t\t *\n\t\t * @param {string|object} tab The tab entry.\n\t\t * @param {number} index Its index in `content.tabs`.\n\t\t * @return {('visible'|'hidden'|'pending')} The state.\n\t\t * @spec openspec/changes/tabs-widget-visible-if/tasks.md#task-2\n\t\t */\n\t\ttabVisibility(tab, index) {\n\t\t\tconst cond = tab && typeof tab === 'object' ? tab.visibleWhen : null\n\t\t\tif (!cond) {\n\t\t\t\treturn 'visible'\n\t\t\t}\n\t\t\tif (isLocallyDecidableVisibleWhen(cond)) {\n\t\t\t\tconst data = this.conditionData\n\t\t\t\tif (!data) {\n\t\t\t\t\treturn 'pending'\n\t\t\t\t}\n\t\t\t\treturn evaluateVisibleWhenLocal(cond, data) ? 'visible' : 'hidden'\n\t\t\t}\n\t\t\tconst answer = this.sourceVisibility[index]\n\t\t\tif (answer === undefined) {\n\t\t\t\treturn 'pending'\n\t\t\t}\n\t\t\treturn answer ? 'visible' : 'hidden'\n\t\t},\n\n\t\t/**\n\t\t * Count the rows behind each source-mode condition: once on mount, when\n\t\t * the record changes, and after a refresh a write triggers. A tab keeps\n\t\t * its last answer while the new one is on its way, so the strip does\n\t\t * not jump.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t * @spec openspec/changes/tabs-widget-visible-if/tasks.md#task-2\n\t\t */\n\t\tasync refreshSourceVisibility() {\n\t\t\tconst tabs = Array.isArray(this.content?.tabs) ? this.content.tabs : []\n\t\t\tconst seq = ++this.visibilitySeq\n\t\t\tconst ctx = { objectId: this.objectId, object: this.conditionData || this.objectData || undefined }\n\t\t\tawait Promise.all(tabs.map(async (tab, index) => {\n\t\t\t\tconst cond = tab && typeof tab === 'object' ? tab.visibleWhen : null\n\t\t\t\tif (!cond || isLocallyDecidableVisibleWhen(cond)) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tconst answer = await evaluateVisibleWhen(cond, ctx)\n\t\t\t\tif (seq === this.visibilitySeq) {\n\t\t\t\t\tthis.sourceVisibility = { ...this.sourceVisibility, [index]: answer }\n\t\t\t\t}\n\t\t\t}))\n\t\t},\n\n\t\t/**\n\t\t * The list a tab counts (`countFrom`): `\"widget\"` counts the child\n\t\t * widget's own list (its `content.register`, `content.schema` and\n\t\t * `content.filter`); an object `{ register, schema, filter? }` names\n\t\t * the list itself. Null for a tab that does not ask, or a child with\n\t\t * no list.\n\t\t *\n\t\t * @param {object|string} tab The `content.tabs[]` entry.\n\t\t * @return {{register: string, schema: string, filter: object}|null} The list.\n\t\t * @spec openspec/changes/screens-tab-counts-parity/specs/tab-counts/spec.md#requirement-a-tab-can-count-its-list\n\t\t */\n\t\tcountSourceOf(tab) {\n\t\t\tconst from = tab && typeof tab === 'object' ? tab.countFrom : null\n\t\t\tlet source = null\n\t\t\tif (from === 'widget') {\n\t\t\t\t// A stack counts its first widget that has a list: flat\n\t\t\t\t// (`content.register`) or a dashboard table's `content.source`.\n\t\t\t\tconst lists = this.tabWidgetIds(tab)\n\t\t\t\t\t.map((id) => this.availableWidgets.find((w) => w && w.id === id))\n\t\t\t\t\t.map((w) => (w && w.content && typeof w.content === 'object' ? w.content : null))\n\t\t\t\t\t.map((content) => (content && content.source && typeof content.source === 'object' && content.source.register ? content.source : content))\n\t\t\t\t\t.filter((content) => content && content.register && content.schema)\n\t\t\t\tsource = lists.length ? lists[0] : null\n\t\t\t} else if (from && typeof from === 'object') {\n\t\t\t\tsource = from\n\t\t\t}\n\t\t\tif (!source || typeof source.register !== 'string' || source.register === '' || typeof source.schema !== 'string' || source.schema === '') {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tconst filter = source.filter && typeof source.filter === 'object' && !Array.isArray(source.filter) ? source.filter : {}\n\t\t\treturn { register: source.register, schema: source.schema, filter }\n\t\t},\n\n\t\t/**\n\t\t * Count the list behind every tab with `countFrom`: once on mount,\n\t\t * when the record changes and after a refresh. A tab keeps its last\n\t\t * total while the new one is on its way; a failed count shows none.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t * @spec openspec/changes/screens-tab-counts-parity/specs/tab-counts/spec.md#requirement-a-tab-can-count-its-list\n\t\t */\n\t\tasync refreshWidgetCounts() {\n\t\t\tconst tabs = Array.isArray(this.content?.tabs) ? this.content.tabs : []\n\t\t\tconst seq = ++this.countSeq\n\t\t\tconst ctx = { objectId: this.objectId, object: this.objectData || undefined }\n\t\t\tawait Promise.all(tabs.map(async (tab, index) => {\n\t\t\t\tconst source = this.countSourceOf(tab)\n\t\t\t\tif (!source) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tconst total = await fetchListTotal(source.register, source.schema, source.filter, ctx).catch(() => null)\n\t\t\t\tif (seq === this.countSeq) {\n\t\t\t\t\tthis.widgetCounts = { ...this.widgetCounts, [index]: total }\n\t\t\t\t}\n\t\t\t}))\n\t\t},\n\n\t\t/** @return {string} The route hash without its `#`, or ''. */\n\t\tcurrentHash() {\n\t\t\tconst fromRoute = this.$route && typeof this.$route.hash === 'string' ? this.$route.hash : ''\n\t\t\tconst raw = fromRoute !== '' ? fromRoute : (typeof window !== 'undefined' && window.location ? window.location.hash : '')\n\t\t\treturn typeof raw === 'string' ? raw.replace(/^#/, '') : ''\n\t\t},\n\n\t\t/**\n\t\t * After the active tab went, point a deep link's hash at the tab now showing.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tsyncHash() {\n\t\t\tconst id = this.activeTab?.id\n\t\t\tconst route = this.$route\n\t\t\tif (!id || !route || !route.hash || !this.$router || typeof this.$router.replace !== 'function') {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.$router.replace({ hash: `#${id}`, query: route.query })\n\t\t},\n\n\t\t/**\n\t\t * Re-emit a geo child's save so the surface can reload the record.\n\t\t *\n\t\t * @param {object} geo The saved geometry.\n\t\t * @return {void}\n\t\t */\n\t\tonGeoSaved(geo) {\n\t\t\t/**\n\t\t\t * @event geo-saved Re-emitted from a geo child that saved a geometry.\n\t\t\t * @type {object}\n\t\t\t */\n\t\t\tthis.$emit('geo-saved', geo)\n\t\t},\n\n\t\t/**\n\t\t * Re-emit a related child's request to open an integration.\n\t\t *\n\t\t * @param {string} integrationId The integration to open.\n\t\t * @return {void}\n\t\t */\n\t\tonOpenIntegration(integrationId) {\n\t\t\t/**\n\t\t\t * @event open-integration Re-emitted from a related child asking to open an integration.\n\t\t\t * @type {string}\n\t\t\t */\n\t\t\tthis.$emit('open-integration', integrationId)\n\t\t},\n\n\t\t/**\n\t\t * Re-emit a related child's object click; the page opens the object.\n\t\t *\n\t\t * @param {object} raw The clicked object.\n\t\t * @return {void}\n\t\t */\n\t\tonSelectObject(raw) {\n\t\t\t/**\n\t\t\t * @event select-object Re-emitted from a related child whose object row was clicked. Payload is the raw object.\n\t\t\t * @type {object}\n\t\t\t */\n\t\t\tthis.$emit('select-object', raw)\n\t\t},\n\n\t\t/**\n\t\t * Follow the strip's own selection, so keyboard navigation moves the\n\t\t * hoisted Actions menu too.\n\t\t *\n\t\t * @param {number} index The newly selected tab index.\n\t\t * @return {void}\n\t\t */\n\t\tonTabChange(index) {\n\t\t\tif (typeof index === 'number' && index >= 0) {\n\t\t\t\tthis.activeIndex = index\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Empty-state text for a tab whose widget id resolves to nothing.\n\t\t *\n\t\t * @param {object} entry The resolved tab.\n\t\t * @return {string} The message.\n\t\t */\n\t\tmissingLabel(entry) {\n\t\t\treturn t('nextcloud-vue', 'No widget found for \"{id}\"', { id: entry.widgetId || '' })\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n/* A stack (`widgetIds`): the panel's widget, then cards 20px apart. */\n.cn-tabs-widget__stack {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 20px;\n}\n\n/* A gridded stack (`columns` / `layout` on the tab): 12 columns, widgets wrap\n onto the next row, a row's cards as tall as the tallest. Narrow, it is the\n plain stack again. */\n.cn-tabs-widget__stack--grid {\n\tdisplay: grid;\n\tgrid-template-columns: repeat(12, minmax(0, 1fr));\n\talign-items: stretch;\n}\n\n.cn-tabs-widget__stack--grid > * {\n\tmin-width: 0;\n}\n\n@media (max-width: 700px) {\n\t.cn-tabs-widget__stack--grid {\n\t\tgrid-template-columns: minmax(0, 1fr);\n\t}\n\n\t.cn-tabs-widget__stack--grid > * {\n\t\tgrid-column: auto !important;\n\t}\n}\n\n/* The panel is the card; the strip is not inside it. There is no title bar\n above the tabs either: the open tab names the panel, so a title row would\n say the same thing twice and cost a row of height on a card that is mostly\n content.\n\n The card chrome used to wrap the strip as well, which drew a border and a\n pair of rounded corners ABOVE the tabs and boxed them in. Folder tabs are\n drawn as the edge of the sheet they open, so a second edge around them\n reads as a header the widget does not have. Border, radius and background\n now live on the panel below, and the strip sits bare on the page. */\n/* The class is doubled on purpose, and the four properties below are RESET\n rather than simply omitted.\n\n Nextcloud serves every enabled app's assets on every page, each app bundles\n this library's compiled CSS, and the Vue scope id is derived from the file\n PATH, so `data-v-1dbd6122` is byte-identical across library versions. An app\n still on an older release therefore ships a rule with exactly this selector\n and the OLD declarations, and it lands on the pages of an app already on the\n new one. Measured on a dossiq case page: three stale copies of the pre-fix\n rule, one from hermiq's `companion.css` (its companion bundle loads on every\n page by design) and two inline from other apps' bundles. Same specificity,\n so source order decided, and the card border came back around the strip.\n\n Dropping a declaration cannot beat a rule that sets it, so `border` and the\n rest are explicitly zeroed. Doubling the class takes this selector to\n (0,3,0) against the stale (0,2,0), which wins on specificity rather than on\n `!important` or on load order this library does not control. The same\n technique, for the same reason, is used on `.cn-tabs__nav .cn-tabs__nav-item`\n in CnTabs to beat Nextcloud's own button margin. */\n.cn-tabs-widget.cn-tabs-widget {\n\tbackground-color: transparent;\n\tborder: 0;\n\tborder-radius: 0;\n\tdisplay: flex;\n\tflex-direction: column;\n\theight: 100%;\n\tmin-height: 0;\n\toverflow: visible;\n\tpadding: 0;\n}\n\n/* No inset, so the first tab starts at the panel's own left edge. The 8px\n here was there to clear the card's rounded top corner; that corner is gone\n from the strip now, and the inset it existed for left the first tab floating\n 8px inside the sheet it opens.\n\n The bar's own bottom rule is switched off and redrawn as a pseudo-element\n that stops one corner radius short of the right edge. CnTabs draws its rule\n across the bar's whole width, which is the sheet's top edge everywhere\n except at the far right, where the panel's top-right corner curves away\n below it: the rule ran straight on to the widget's edge and read as a\n border sticking out past a rounded corner (Ruben, 2026-09-13). Ending it\n where the curve begins makes the rule and the curve one continuous edge. */\n.cn-tabs-widget__tabs :deep(.cn-tabs__bar) {\n\tborder-bottom: none;\n\tpadding: 0;\n\tposition: relative;\n}\n\n.cn-tabs-widget__tabs :deep(.cn-tabs__bar::after) {\n\tborder-bottom: 1px solid var(--color-border);\n\tcontent: '';\n\tinset-block-end: 0;\n\tinset-inline: 0 var(--border-radius-large);\n\tpointer-events: none;\n\tposition: absolute;\n}\n\n/* The open tab erases the slice of the rule directly above the panel with its\n own background-coloured bottom edge, which only works if it paints ABOVE the\n pseudo-element: a positioned pseudo-element otherwise paints over every\n in-flow sibling, rule included. */\n.cn-tabs-widget__tabs :deep(.cn-tabs__nav-item--active) {\n\tposition: relative;\n\tz-index: 1;\n}\n\n.cn-tabs-widget__tabs {\n\tdisplay: flex;\n\tflex-direction: column;\n\t/* Grow to the widget's height, so the panel fills the grid cell the\n\t layout gave it. Without this the strip plus the open panel took only\n\t the height of the panel's content, and a cell of nine rows ended in\n\t 130px of nothing under a sheet that stopped short of its own card. */\n\tflex: 1 1 auto;\n\tmin-height: 0;\n}\n\n/* The panel area is the scroll region, so the strip stays put while a long\n child scrolls under it.\n\n Padded on all four sides. The top was once zeroed to protect the join with\n the open tab, but padding sits inside the painted box — only a margin would\n have opened that gap, and a zero top put every panel's content against the\n strip. */\n.cn-tabs-widget__tabs :deep(.cn-tabs__content) {\n\tbackground-color: var(--color-main-background);\n\t/* Three sides only: the bar's rule (redrawn above, stopping at the corner)\n\t is this sheet's top edge, and the open tab erases the slice of it\n\t directly above the panel so the two read as one surface. A border-top\n\t here would put a second line under that tab which the tab cannot paint\n\t over. */\n\tborder: 1px solid var(--color-border);\n\tborder-top: none;\n\t/* Three rounded corners. The top-left stays square because the first tab\n\t is drawn joined to the panel there, and a curve under it would curl the\n\t sheet away from that tab. The top-right has no tab above it: the strip\n\t ends where the last tab ends and the Actions menu floats free, so a\n\t square corner there read as a sheet cut off, not as a tab's edge. */\n\tborder-radius: 0 var(--border-radius-large) var(--border-radius-large) var(--border-radius-large);\n\tflex: 1 1 auto;\n\tmin-height: 0;\n\toverflow: auto;\n\tpadding: 12px;\n}\n\n.cn-tabs-widget__tabs :deep(.cn-tab) {\n\theight: 100%;\n}\n\n/* A list widget's footer Add bleeds through its card's 16px content padding\n (margin 0 -16px -16px). The panel of a tab pads 12px, so on a tab that\n holds the list directly the footer stuck out 4px on the right and at the\n bottom and made the panel scroll. It bleeds exactly the panel's padding. */\n.cn-tabs-widget__tabs :deep(.cn-tabs__content > .cn-tab > .cn-detail-widget-host--bare .cn-object-list-widget__add) {\n\tmargin: auto -12px -12px;\n}\n\n.cn-tabs-widget__title {\n\talign-items: center;\n\tdisplay: inline-flex;\n\tgap: 6px;\n}\n\n.cn-tabs-widget__title-icon {\n\tflex: 0 0 auto;\n}\n</style>\n"],"names":["_createVNode","_createElementBlock","_Fragment","_renderList","_createBlock","_openBlock","_createElementVNode","_createTextVNode","_toDisplayString","_normalizeClass","_normalizeStyle"],"mappings":"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"}
@@ -2,7 +2,7 @@ import script from './CnToggleTableWidget.vue2.js';
2
2
  import { render } from './CnToggleTableWidget.vue3.js';
3
3
 
4
4
  script.render = render;
5
- script.__scopeId = "data-v-1bb40018";
5
+ script.__scopeId = "data-v-24769640";
6
6
  const __sfc_main = script;
7
7
 
8
8
  export { __sfc_main as default };
@@ -16,6 +16,13 @@ import { serverErrorMessage } from '../../utils/serverErrorMessage.js';
16
16
  * the keys of the rows that are in it; the switch is on when the row's key is
17
17
  * in the list, or NOT in it with `bind.invert` (a list of hidden items shown
18
18
  * as "visible" switches).
19
+ * - `bind.mode: 'each'` — every row IS an object (read by `source`, its key the
20
+ * object id); the switch is that object's own boolean field (`bind.field`)
21
+ * and a toggle PATCHes that object (`bind.register` / `bind.schema`, else the
22
+ * surface's). No current object is needed, so it serves a settings page.
23
+ * - `bind.mode: 'map'` — a config map holds a boolean per row key: read from
24
+ * `bind.url` (at `bind.path`) and written through `save`, or one object field
25
+ * of the current object (`bind.field`) written by its dot-path.
19
26
  *
20
27
  * A toggle saves at once with ONE PATCH of that field; a refused PATCH puts the
21
28
  * switch back and shows the server's words.
@@ -35,7 +42,7 @@ var script = {
35
42
  /**
36
43
  * The widget configuration.
37
44
  *
38
- * - `bind` — `{ mode: 'flag' }` (default) or `{ mode: 'list', field, invert? }`.
45
+ * - `bind` — `{ mode: 'flag' }` (default), `{ mode: 'list', field, invert? }`, `{ mode: 'each', field, register?, schema?, invert? }` or `{ mode: 'map', url?, path?, field?, invert? }`.
39
46
  * - `rows` — static rows `[{ key, label, hint?, field?, ...extra }]`.
40
47
  * - `source` — `{ url, path?, key, label, hint? }`: rows read from an endpoint (tokens `@objectId`, `@object.<field>`), in addition to `rows`.
41
48
  * - `columns` — extra columns `[{ header, path, map? }]` read off each row.
@@ -86,13 +93,33 @@ var script = {
86
93
  notice: '',
87
94
  /** Per row, how often a refused toggle forced the switch to be drawn again from the stored value. */
88
95
  undone: {},
96
+ /** `each` and `map`: the value written per row key. */
97
+ rowSaved: {},
98
+ /** `map` with `bind.url`: the map as read. */
99
+ map: null,
89
100
  }
90
101
  },
91
102
 
92
103
  computed: {
104
+ /**
105
+ * How a switch is stored.
106
+ *
107
+ * @return {object} The normalised `bind`.
108
+ * @spec openspec/changes/toggle-table-objects-and-map/specs/toggle-table/spec.md#requirement-a-toggle-table-can-switch-objects-or-a-config-map
109
+ */
93
110
  bind() {
94
111
  const bind = this.content.bind || {};
95
- return bind.mode === 'list' ? { mode: 'list', field: bind.field, invert: bind.invert === true } : { mode: 'flag' }
112
+ const invert = bind.invert === true;
113
+ if (bind.mode === 'list') {
114
+ return { mode: 'list', field: bind.field, invert }
115
+ }
116
+ if (bind.mode === 'each') {
117
+ return { mode: 'each', field: bind.field || '', invert, register: bind.register || this.register, schema: bind.schema || this.schema }
118
+ }
119
+ if (bind.mode === 'map') {
120
+ return { mode: 'map', field: bind.field || '', url: bind.url || '', path: bind.path || '', invert }
121
+ }
122
+ return { mode: 'flag' }
96
123
  },
97
124
 
98
125
  /** The drawn rows: configured first, then sourced, each with a key, title and hint. */
@@ -137,12 +164,15 @@ var script = {
137
164
  watch: {
138
165
  objectData() {
139
166
  this.saved = {};
167
+ this.rowSaved = {};
140
168
  this.loadSource();
169
+ this.loadMap();
141
170
  },
142
171
  },
143
172
 
144
173
  created() {
145
174
  this.loadSource();
175
+ this.loadMap();
146
176
  },
147
177
 
148
178
  methods: {
@@ -170,6 +200,10 @@ var script = {
170
200
  * @return {boolean}
171
201
  */
172
202
  isOn(row) {
203
+ if (this.bind.mode === 'each' || this.bind.mode === 'map') {
204
+ const on = this.rowValue(row) === true;
205
+ return this.bind.invert ? !on : on
206
+ }
173
207
  if (this.bind.mode === 'list') {
174
208
  const list = this.stored(this.bind.field);
175
209
  const inList = Array.isArray(list) && list.map(String).includes(row.key);
@@ -178,6 +212,92 @@ var script = {
178
212
  return row.field ? this.stored(row.field) === true : false
179
213
  },
180
214
 
215
+ /**
216
+ * `each` and `map`: the stored value of a row's switch, as last written,
217
+ * else read off the row's object or the map.
218
+ *
219
+ * @param {object} row The row.
220
+ * @return {unknown}
221
+ * @spec openspec/changes/toggle-table-objects-and-map/specs/toggle-table/spec.md#requirement-a-toggle-table-can-switch-objects-or-a-config-map
222
+ */
223
+ rowValue(row) {
224
+ if (Object.hasOwn(this.rowSaved, row.key)) {
225
+ return this.rowSaved[row.key]
226
+ }
227
+ if (this.bind.mode === 'each') {
228
+ return this.bind.field ? readPath(row.item || row, this.bind.field) : undefined
229
+ }
230
+ const map = this.bind.url ? this.map : (this.bind.field ? this.stored(this.bind.field) : null);
231
+ return map && typeof map === 'object' ? map[row.key] : undefined
232
+ },
233
+
234
+ /**
235
+ * Resolve `@objectId` and `@object.<path>` in a url.
236
+ *
237
+ * @param {string} url The url.
238
+ * @return {string}
239
+ */
240
+ fillUrl(url) {
241
+ const object = this.objectData || {};
242
+ return String(url)
243
+ .replace(/@objectId/g, () => encodeURIComponent(String(this.objectId || object.id || '')))
244
+ .replace(/@object\.([\w.@]+)/g, (m, path) => encodeURIComponent(String(readPath(object, path) ?? '')))
245
+ },
246
+
247
+ /**
248
+ * `map` with `bind.url`: read the map.
249
+ *
250
+ * @return {Promise<void>}
251
+ * @spec openspec/changes/toggle-table-objects-and-map/specs/toggle-table/spec.md#requirement-a-toggle-table-can-switch-objects-or-a-config-map
252
+ */
253
+ async loadMap() {
254
+ if (this.bind.mode !== 'map' || !this.bind.url) {
255
+ return
256
+ }
257
+ try {
258
+ const { default: axios } = await import('@nextcloud/axios');
259
+ const { data } = await axios.get(prefixUrl(this.fillUrl(this.bind.url)));
260
+ const map = this.bind.path ? readPath(data, this.bind.path) : data;
261
+ this.map = map && typeof map === 'object' ? map : {};
262
+ } catch (e) {
263
+ this.notice = serverErrorMessage(e);
264
+ }
265
+ },
266
+
267
+ /**
268
+ * `each` and `map`: write one row's switch.
269
+ *
270
+ * @param {object} row The row.
271
+ * @param {boolean} value The value to store.
272
+ * @return {Promise<unknown>} The value the server holds now.
273
+ * @spec openspec/changes/toggle-table-objects-and-map/specs/toggle-table/spec.md#requirement-a-toggle-table-can-switch-objects-or-a-config-map
274
+ */
275
+ async writeRow(row, value) {
276
+ const save = this.content.save;
277
+ const hasSave = Boolean(save && save.url);
278
+ if (this.bind.mode === 'each') {
279
+ const url = objectUrlOf(this.bind.register, this.bind.schema, row.key);
280
+ if ((!url && !hasSave) || !this.bind.field) {
281
+ throw new Error(this.tr('This switch cannot be saved here.'))
282
+ }
283
+ const data = await writeFields(url, { [this.bind.field]: value }, { save, object: row.item || row });
284
+ const answered = hasSave ? undefined : readPath(data, this.bind.field);
285
+ return answered !== undefined ? answered : value
286
+ }
287
+ if (this.bind.url) {
288
+ if (!hasSave) {
289
+ throw new Error(this.tr('This switch cannot be saved here.'))
290
+ }
291
+ await writeFields('', { [row.key]: value }, { save, object: this.objectData });
292
+ return value
293
+ }
294
+ if ((!this.objectUrl && !hasSave) || !this.bind.field) {
295
+ throw new Error(this.tr('This switch cannot be saved here.'))
296
+ }
297
+ await writeFields(this.objectUrl, { [`${this.bind.field}.${row.key}`]: value }, { save, object: this.objectData });
298
+ return value
299
+ },
300
+
181
301
  /**
182
302
  * The text of an extra column for a row.
183
303
  *
@@ -202,10 +322,7 @@ var script = {
202
322
  if (!source || !source.url || !source.key) {
203
323
  return
204
324
  }
205
- const object = this.objectData || {};
206
- const url = String(source.url)
207
- .replace(/@objectId/g, () => encodeURIComponent(String(this.objectId || object.id || '')))
208
- .replace(/@object\.([\w.@]+)/g, (m, path) => encodeURIComponent(String(readPath(object, path) ?? '')));
325
+ const url = this.fillUrl(source.url);
209
326
  try {
210
327
  const { default: axios } = await import('@nextcloud/axios');
211
328
  const { data } = await axios.get(prefixUrl(url));
@@ -214,6 +331,7 @@ var script = {
214
331
  .filter((item) => item && readPath(item, source.key) !== undefined)
215
332
  .map((item) => ({
216
333
  ...item,
334
+ item,
217
335
  key: String(readPath(item, source.key)),
218
336
  title: String(readPath(item, source.label || source.key) ?? readPath(item, source.key)),
219
337
  hint: source.hint ? String(readPath(item, source.hint) ?? '') : '',
@@ -232,6 +350,21 @@ var script = {
232
350
  * @spec openspec/changes/abstract-toggle-table/specs/toggle-table/spec.md#requirement-a-toggle-saves-one-field
233
351
  */
234
352
  async toggle(row, on) {
353
+ if (this.bind.mode === 'each' || this.bind.mode === 'map') {
354
+ this.notice = '';
355
+ this.busy = row.key;
356
+ try {
357
+ const written = await this.writeRow(row, this.bind.invert ? !on : on);
358
+ this.rowSaved = { ...this.rowSaved, [row.key]: written };
359
+ this.$emit('saved', { field: this.bind.mode === 'each' ? this.bind.field : row.key, key: row.key, value: written });
360
+ } catch (e) {
361
+ this.notice = serverErrorMessage(e);
362
+ this.undone = { ...this.undone, [row.key]: (this.undone[row.key] || 0) + 1 };
363
+ } finally {
364
+ this.busy = '';
365
+ }
366
+ return
367
+ }
235
368
  const field = this.bind.mode === 'list' ? this.bind.field : row.field;
236
369
  if ((!this.objectUrl && !(this.content.save && this.content.save.url)) || !field) {
237
370
  this.notice = this.tr('This switch cannot be saved here.');
@@ -254,7 +387,7 @@ var script = {
254
387
  this.saved = { ...this.saved, [field]: written };
255
388
  /**
256
389
  * @event saved A switch was written.
257
- * @type {{field: string, value: unknown}}
390
+ * @type {{field: string, key?: string, value: unknown}} `key` is the row, in the `each` and `map` modes.
258
391
  */
259
392
  this.$emit('saved', { field, value: written });
260
393
  } catch (e) {