@conduction/nextcloud-vue 2.56.0-beta.73 → 2.56.0-beta.75

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 (204) hide show
  1. package/dist/esm/components/CnActionDialog/CnActionDialog.vue.js +1 -1
  2. package/dist/esm/components/CnActionDialog/CnActionDialog.vue2.js +90 -7
  3. package/dist/esm/components/CnActionDialog/CnActionDialog.vue2.js.map +1 -1
  4. package/dist/esm/components/CnActionDialog/CnActionDialog.vue3.js +82 -79
  5. package/dist/esm/components/CnActionDialog/CnActionDialog.vue3.js.map +1 -1
  6. package/dist/esm/components/CnBuildiqEditButton/CnBuildiqEditButton.vue.js +1 -1
  7. package/dist/esm/components/CnBuildiqEditButton/CnBuildiqEditButton.vue2.js +12 -1
  8. package/dist/esm/components/CnBuildiqEditButton/CnBuildiqEditButton.vue2.js.map +1 -1
  9. package/dist/esm/components/CnBuildiqEditButton/CnBuildiqEditButton.vue3.js.map +1 -1
  10. package/dist/esm/components/CnCardNotices/CnCardNotices.vue.js +1 -1
  11. package/dist/esm/components/CnCardNotices/CnCardNotices.vue2.js +45 -7
  12. package/dist/esm/components/CnCardNotices/CnCardNotices.vue2.js.map +1 -1
  13. package/dist/esm/components/CnCardNotices/CnCardNotices.vue3.js +1 -1
  14. package/dist/esm/components/CnCardNotices/CnCardNotices.vue3.js.map +1 -1
  15. package/dist/esm/components/CnCellRenderer/CnCellRenderer.vue.js +1 -1
  16. package/dist/esm/components/CnCellRenderer/CnCellRenderer.vue2.js +10 -8
  17. package/dist/esm/components/CnCellRenderer/CnCellRenderer.vue2.js.map +1 -1
  18. package/dist/esm/components/CnCellRenderer/CnCellRenderer.vue3.js +95 -88
  19. package/dist/esm/components/CnCellRenderer/CnCellRenderer.vue3.js.map +1 -1
  20. package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue.js +1 -1
  21. package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue2.js +40 -1
  22. package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue2.js.map +1 -1
  23. package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue3.js +149 -109
  24. package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue3.js.map +1 -1
  25. package/dist/esm/components/CnFilesBrowser/filesBrowserColumns.js +10 -4
  26. package/dist/esm/components/CnFilesBrowser/filesBrowserColumns.js.map +1 -1
  27. package/dist/esm/components/CnFlowDetail/CnFlowDetail.vue.js +1 -1
  28. package/dist/esm/components/CnFlowDetail/CnFlowDetail.vue2.js +86 -8
  29. package/dist/esm/components/CnFlowDetail/CnFlowDetail.vue2.js.map +1 -1
  30. package/dist/esm/components/CnFlowDetail/CnFlowDetail.vue3.js +137 -121
  31. package/dist/esm/components/CnFlowDetail/CnFlowDetail.vue3.js.map +1 -1
  32. package/dist/esm/components/CnFlowDetail/CnFlowDryRunResult.vue.js +1 -1
  33. package/dist/esm/components/CnFlowDetail/CnFlowDryRunResult.vue2.js +56 -4
  34. package/dist/esm/components/CnFlowDetail/CnFlowDryRunResult.vue2.js.map +1 -1
  35. package/dist/esm/components/CnFlowDetail/CnFlowDryRunResult.vue3.js +166 -70
  36. package/dist/esm/components/CnFlowDetail/CnFlowDryRunResult.vue3.js.map +1 -1
  37. package/dist/esm/components/CnFlowDetail/CnFlowStepList.vue.js +9 -0
  38. package/dist/esm/components/CnFlowDetail/CnFlowStepList.vue.js.map +1 -0
  39. package/dist/esm/components/CnFlowDetail/CnFlowStepList.vue2.js +123 -0
  40. package/dist/esm/components/CnFlowDetail/CnFlowStepList.vue2.js.map +1 -0
  41. package/dist/esm/components/CnFlowDetail/CnFlowStepList.vue3.js +268 -0
  42. package/dist/esm/components/CnFlowDetail/CnFlowStepList.vue3.js.map +1 -0
  43. package/dist/esm/components/CnFlowDetail/CnFlowViewSwitch.vue.js +9 -0
  44. package/dist/esm/components/CnFlowDetail/CnFlowViewSwitch.vue.js.map +1 -0
  45. package/dist/esm/components/CnFlowDetail/CnFlowViewSwitch.vue2.js +49 -0
  46. package/dist/esm/components/CnFlowDetail/CnFlowViewSwitch.vue2.js.map +1 -0
  47. package/dist/esm/components/CnFlowDetail/CnFlowViewSwitch.vue3.js +41 -0
  48. package/dist/esm/components/CnFlowDetail/CnFlowViewSwitch.vue3.js.map +1 -0
  49. package/dist/esm/components/CnFlowsPage/CnFlowBoard.vue.js +1 -1
  50. package/dist/esm/components/CnFlowsPage/CnFlowBoard.vue2.js +116 -8
  51. package/dist/esm/components/CnFlowsPage/CnFlowBoard.vue2.js.map +1 -1
  52. package/dist/esm/components/CnFlowsPage/CnFlowBoard.vue3.js +110 -58
  53. package/dist/esm/components/CnFlowsPage/CnFlowBoard.vue3.js.map +1 -1
  54. package/dist/esm/components/CnFlowsPage/CnFlowEditorPage.vue2.js +78 -1
  55. package/dist/esm/components/CnFlowsPage/CnFlowEditorPage.vue2.js.map +1 -1
  56. package/dist/esm/components/CnFlowsPage/CnFlowEditorPage.vue3.js +44 -3
  57. package/dist/esm/components/CnFlowsPage/CnFlowEditorPage.vue3.js.map +1 -1
  58. package/dist/esm/components/CnGroupedCardsWidget/CnGroupedCardsWidget.vue.js +1 -1
  59. package/dist/esm/components/CnGroupedCardsWidget/CnGroupedCardsWidget.vue2.js +112 -1
  60. package/dist/esm/components/CnGroupedCardsWidget/CnGroupedCardsWidget.vue2.js.map +1 -1
  61. package/dist/esm/components/CnGroupedCardsWidget/CnGroupedCardsWidget.vue3.js +53 -18
  62. package/dist/esm/components/CnGroupedCardsWidget/CnGroupedCardsWidget.vue3.js.map +1 -1
  63. package/dist/esm/components/CnIndexPage/CnIndexHeaderMenu.vue2.js +3 -3
  64. package/dist/esm/components/CnIndexPage/CnIndexHeaderMenu.vue2.js.map +1 -1
  65. package/dist/esm/components/CnIndexPage/CnIndexHeaderMenu.vue3.js +108 -74
  66. package/dist/esm/components/CnIndexPage/CnIndexHeaderMenu.vue3.js.map +1 -1
  67. package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js +219 -83
  68. package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js.map +1 -1
  69. package/dist/esm/components/CnIndexPage/CnIndexPage.vue3.js +92 -58
  70. package/dist/esm/components/CnIndexPage/CnIndexPage.vue3.js.map +1 -1
  71. package/dist/esm/components/CnObjectDataWidget/CnObjectDataWidget.vue.js +1 -1
  72. package/dist/esm/components/CnObjectDataWidget/CnObjectDataWidget.vue2.js +56 -0
  73. package/dist/esm/components/CnObjectDataWidget/CnObjectDataWidget.vue2.js.map +1 -1
  74. package/dist/esm/components/CnObjectDataWidget/CnObjectDataWidget.vue3.js +185 -123
  75. package/dist/esm/components/CnObjectDataWidget/CnObjectDataWidget.vue3.js.map +1 -1
  76. package/dist/esm/components/CnObjectSidebar/CnFilesTab.vue.js +1 -1
  77. package/dist/esm/components/CnObjectSidebar/CnFilesTab.vue2.js +2 -0
  78. package/dist/esm/components/CnObjectSidebar/CnFilesTab.vue2.js.map +1 -1
  79. package/dist/esm/components/CnObjectSidebar/CnFilesTab.vue3.js +2 -1
  80. package/dist/esm/components/CnObjectSidebar/CnFilesTab.vue3.js.map +1 -1
  81. package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue.js +1 -1
  82. package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue2.js +197 -63
  83. package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue2.js.map +1 -1
  84. package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue3.js +244 -161
  85. package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue3.js.map +1 -1
  86. package/dist/esm/components/CnSearchPage/CnSearchPage.vue.js +1 -1
  87. package/dist/esm/components/CnSearchPage/CnSearchPage.vue2.js +39 -1
  88. package/dist/esm/components/CnSearchPage/CnSearchPage.vue2.js.map +1 -1
  89. package/dist/esm/components/CnSearchPage/CnSearchPage.vue3.js +12 -2
  90. package/dist/esm/components/CnSearchPage/CnSearchPage.vue3.js.map +1 -1
  91. package/dist/esm/components/CnStepper/CnStepper.vue.js +1 -1
  92. package/dist/esm/components/CnStepper/CnStepper.vue2.js.map +1 -1
  93. package/dist/esm/components/CnStepper/CnStepper.vue3.js.map +1 -1
  94. package/dist/esm/components/CnTaskFormFields/CnTaskFormFields.vue.js +1 -1
  95. package/dist/esm/components/CnTaskFormFields/CnTaskFormFields.vue2.js +51 -2
  96. package/dist/esm/components/CnTaskFormFields/CnTaskFormFields.vue2.js.map +1 -1
  97. package/dist/esm/components/CnTaskFormFields/CnTaskFormFields.vue3.js +49 -11
  98. package/dist/esm/components/CnTaskFormFields/CnTaskFormFields.vue3.js.map +1 -1
  99. package/dist/esm/components/CnTaskFormWidget/CnTaskFormWidget.vue.js +9 -0
  100. package/dist/esm/components/CnTaskFormWidget/CnTaskFormWidget.vue.js.map +1 -0
  101. package/dist/esm/components/CnTaskFormWidget/CnTaskFormWidget.vue2.js +328 -0
  102. package/dist/esm/components/CnTaskFormWidget/CnTaskFormWidget.vue2.js.map +1 -0
  103. package/dist/esm/components/CnTaskFormWidget/CnTaskFormWidget.vue3.js +85 -0
  104. package/dist/esm/components/CnTaskFormWidget/CnTaskFormWidget.vue3.js.map +1 -0
  105. package/dist/esm/components/CnTaskFormWidget/index.js +24 -0
  106. package/dist/esm/components/CnTaskFormWidget/index.js.map +1 -0
  107. package/dist/esm/components/CnTasksWidget/CnTasksWidget.vue.js +1 -1
  108. package/dist/esm/components/CnTasksWidget/CnTasksWidget.vue2.js +8 -2
  109. package/dist/esm/components/CnTasksWidget/CnTasksWidget.vue2.js.map +1 -1
  110. package/dist/esm/components/CnTasksWidget/CnTasksWidget.vue3.js +16 -3
  111. package/dist/esm/components/CnTasksWidget/CnTasksWidget.vue3.js.map +1 -1
  112. package/dist/esm/components/CnWidgetGrid/registerDashboardWidgets.js +1 -0
  113. package/dist/esm/components/CnWidgetGrid/registerDashboardWidgets.js.map +1 -1
  114. package/dist/esm/composables/indexSources.js +24 -4
  115. package/dist/esm/composables/indexSources.js.map +1 -1
  116. package/dist/esm/composables/useFlowStore.js +75 -4
  117. package/dist/esm/composables/useFlowStore.js.map +1 -1
  118. package/dist/esm/dialogs/CnFlowEdgeEditModal.vue.js +1 -1
  119. package/dist/esm/dialogs/CnFlowEdgeEditModal.vue2.js +17 -0
  120. package/dist/esm/dialogs/CnFlowEdgeEditModal.vue2.js.map +1 -1
  121. package/dist/esm/dialogs/CnFlowEdgeEditModal.vue3.js +9 -1
  122. package/dist/esm/dialogs/CnFlowEdgeEditModal.vue3.js.map +1 -1
  123. package/dist/esm/dialogs/CnFlowEditModal.vue.js +1 -1
  124. package/dist/esm/dialogs/CnFlowEditModal.vue2.js +15 -0
  125. package/dist/esm/dialogs/CnFlowEditModal.vue2.js.map +1 -1
  126. package/dist/esm/dialogs/CnFlowEditModal.vue3.js +13 -3
  127. package/dist/esm/dialogs/CnFlowEditModal.vue3.js.map +1 -1
  128. package/dist/esm/dialogs/CnFlowStepPickerModal.vue.js +1 -1
  129. package/dist/esm/dialogs/CnFlowStepPickerModal.vue2.js +13 -1
  130. package/dist/esm/dialogs/CnFlowStepPickerModal.vue2.js.map +1 -1
  131. package/dist/esm/dialogs/CnFlowStepPickerModal.vue3.js.map +1 -1
  132. package/dist/esm/index.js +3 -0
  133. package/dist/esm/index.js.map +1 -1
  134. package/dist/esm/l10n/en.json.js +52 -1
  135. package/dist/esm/l10n/en.json.js.map +1 -1
  136. package/dist/esm/l10n/nl.json.js +51 -1
  137. package/dist/esm/l10n/nl.json.js.map +1 -1
  138. package/dist/esm/library-style.js +1 -1
  139. package/dist/esm/nextcloud-vue.css +1203 -812
  140. package/dist/esm/utils/dialogWidths.js +6 -4
  141. package/dist/esm/utils/dialogWidths.js.map +1 -1
  142. package/dist/esm/utils/fieldPill.js +77 -0
  143. package/dist/esm/utils/fieldPill.js.map +1 -0
  144. package/dist/esm/utils/flowCondition.js +177 -0
  145. package/dist/esm/utils/flowCondition.js.map +1 -0
  146. package/dist/esm/utils/flowRunStatus.js +64 -1
  147. package/dist/esm/utils/flowRunStatus.js.map +1 -1
  148. package/dist/esm/utils/flowStepList.js +385 -0
  149. package/dist/esm/utils/flowStepList.js.map +1 -0
  150. package/dist/esm/utils/libraryWidgetKeys.js +1 -0
  151. package/dist/esm/utils/libraryWidgetKeys.js.map +1 -1
  152. package/dist/esm/utils/searchRefusal.js +35 -1
  153. package/dist/esm/utils/searchRefusal.js.map +1 -1
  154. package/dist/esm/utils/widgetDispatch.js +1 -1
  155. package/dist/esm/utils/widgetDispatch.js.map +1 -1
  156. package/dist/nextcloud-vue.cjs.js +14837 -11411
  157. package/dist/nextcloud-vue.cjs.js.map +2 -2
  158. package/dist/nextcloud-vue.css +1203 -812
  159. package/l10n/en.json +52 -1
  160. package/l10n/nl.json +51 -1
  161. package/package.json +1 -1
  162. package/src/components/CnActionDialog/CnActionDialog.vue +116 -9
  163. package/src/components/CnBuildiqEditButton/CnBuildiqEditButton.vue +12 -1
  164. package/src/components/CnCardNotices/CnCardNotices.vue +46 -8
  165. package/src/components/CnCellRenderer/CnCellRenderer.vue +8 -0
  166. package/src/components/CnFilesBrowser/CnFilesBrowser.vue +61 -2
  167. package/src/components/CnFilesBrowser/filesBrowserColumns.js +10 -4
  168. package/src/components/CnFlowDetail/CnFlowDetail.vue +110 -12
  169. package/src/components/CnFlowDetail/CnFlowDryRunResult.vue +163 -5
  170. package/src/components/CnFlowDetail/CnFlowStepList.vue +408 -0
  171. package/src/components/CnFlowDetail/CnFlowViewSwitch.vue +117 -0
  172. package/src/components/CnFlowDetail/index.js +2 -0
  173. package/src/components/CnFlowsPage/CnFlowBoard.vue +182 -25
  174. package/src/components/CnFlowsPage/CnFlowEditorPage.vue +101 -3
  175. package/src/components/CnGroupedCardsWidget/CnGroupedCardsWidget.vue +141 -1
  176. package/src/components/CnIndexPage/CnIndexHeaderMenu.vue +22 -4
  177. package/src/components/CnIndexPage/CnIndexPage.vue +172 -13
  178. package/src/components/CnObjectDataWidget/CnObjectDataWidget.vue +148 -4
  179. package/src/components/CnObjectSidebar/CnFilesTab.vue +3 -0
  180. package/src/components/CnRecordListWidget/CnRecordListWidget.vue +310 -66
  181. package/src/components/CnSearchPage/CnSearchPage.vue +50 -1
  182. package/src/components/CnStepper/CnStepper.vue +14 -5
  183. package/src/components/CnTaskFormFields/CnTaskFormFields.md +1 -0
  184. package/src/components/CnTaskFormFields/CnTaskFormFields.vue +89 -3
  185. package/src/components/CnTaskFormWidget/CnTaskFormWidget.vue +400 -0
  186. package/src/components/CnTaskFormWidget/index.js +23 -0
  187. package/src/components/CnTasksWidget/CnTasksWidget.vue +17 -3
  188. package/src/components/CnWidgetGrid/registerDashboardWidgets.js +1 -0
  189. package/src/components/index.js +2 -1
  190. package/src/composables/indexSources.js +24 -4
  191. package/src/composables/useFlowStore.js +75 -4
  192. package/src/css/index-page.css +10 -0
  193. package/src/dialogs/CnFlowEdgeEditModal.vue +28 -0
  194. package/src/dialogs/CnFlowEditModal.vue +26 -6
  195. package/src/dialogs/CnFlowStepPickerModal.vue +13 -1
  196. package/src/index.js +3 -0
  197. package/src/utils/dialogWidths.js +6 -4
  198. package/src/utils/fieldPill.js +73 -0
  199. package/src/utils/flowCondition.js +173 -0
  200. package/src/utils/flowRunStatus.js +63 -0
  201. package/src/utils/flowStepList.js +381 -0
  202. package/src/utils/libraryWidgetKeys.js +1 -0
  203. package/src/utils/searchRefusal.js +33 -0
  204. package/src/utils/widgetDispatch.js +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"CnFilesTab.vue3.js","sources":["../../../../src/components/CnObjectSidebar/CnFilesTab.vue?vue&type=template&id=102820fc&lang.js"],"sourcesContent":["<template>\n\t<div class=\"cn-sidebar-tab\">\n\t\t<!-- The object's folder as a real files browser, on the Files app's own\n\t\t primitives (its actions, its New menu, its breadcrumbs), when the\n\t\t folder resolves for this user. The list below is the fallback for an\n\t\t object with no folder, or a user the folder is not shared with. -->\n\t\t<CnFilesBrowser\n\t\t\tv-if=\"browserRoot !== null\"\n\t\t\t:rootPath=\"browserRoot\"\n\t\t\t:rootLabel=\"effectiveBrowserRootLabel\"\n\t\t\t:source=\"browserSource\"\n\t\t\t:deleteLabel=\"deleteLabel\"\n\t\t\t:uploadButton=\"uploadButton\"\n\t\t\t:newMenu=\"newMenu\"\n\t\t\t:folderButton=\"folderButton\"\n\t\t\t:dropOverlay=\"dropOverlay\"\n\t\t\t:dropLabel=\"dropLabel\"\n\t\t\t:dropDetail=\"dropDetail\"\n\t\t\t:dropDetailValues=\"dropDetailValues\"\n\t\t\t:dropHint=\"dropHint\"\n\t\t\t:rowActions=\"rowActions\"\n\t\t\t:newActions=\"newActions\"\n\t\t\t:headerActions=\"headerActions\"\n\t\t\t:rowButton=\"rowButton\"\n\t\t\t:reviewSummary=\"reviewSummary\"\n\t\t\t:footnote=\"footnote\"\n\t\t\t:nameSecondary=\"nameSecondary\"\n\t\t\t:secondLine=\"secondLine\"\n\t\t\t:linkedItems=\"linkedItems\"\n\t\t\t:columns=\"columns\"\n\t\t\t:rowData=\"rowDataSource\"\n\t\t\t:preferenceApp=\"preferenceApp\"\n\t\t\t:preferenceKey=\"preferenceKey\"\n\t\t\t:bulkActions=\"bulkActions\"\n\t\t\t:selectionLabel=\"selectionLabel\"\n\t\t\t:selectionLabelOne=\"selectionLabelOne\"\n\t\t\t:showClearSelection=\"showClearSelection\"\n\t\t\t:sideCards=\"sideCards\"\n\t\t\t:sideCardsPlacement=\"sideCardsPlacement\"\n\t\t\t:groupBy=\"groupBy\"\n\t\t\t:facets=\"facets\"\n\t\t\t:facetPresentation=\"facetPresentation\"\n\t\t\t@changed=\"onBrowserChanged\" />\n\t\t<template v-else>\n\t\t\t<!-- Upload error -->\n\t\t\t<div v-if=\"uploadError\" class=\"cn-sidebar-tab__upload-error\">\n\t\t\t\t{{ uploadError }}\n\t\t\t</div>\n\n\t\t\t<!-- Share toggle — seeds from schema config (defaultAutoShare) or\n\t\t from the `defaultShare` prop. Hidden via `showShareToggle=false`. -->\n\t\t\t<NcCheckboxRadioSwitch\n\t\t\t\tv-if=\"showShareToggle\"\n\t\t\t\tv-model=\"share\"\n\t\t\t\tclass=\"cn-sidebar-tab__share\"\n\t\t\t\t:disabled=\"loading\"\n\t\t\t\ttype=\"switch\">\n\t\t\t\t{{ shareLabel }}\n\t\t\t</NcCheckboxRadioSwitch>\n\n\t\t\t<!-- File drop zone -->\n\t\t\t<div\n\t\t\t\tclass=\"cn-sidebar-tab__dropzone\"\n\t\t\t\t:class=\"{ 'cn-sidebar-tab__dropzone--active': isDragOver }\"\n\t\t\t\trole=\"button\"\n\t\t\t\ttabindex=\"0\"\n\t\t\t\t@click=\"triggerFileInput\"\n\t\t\t\t@keydown.enter.prevent=\"triggerFileInput\"\n\t\t\t\t@keydown.space.prevent=\"triggerFileInput\"\n\t\t\t\t@dragover.prevent=\"onDragOver\"\n\t\t\t\t@dragleave.prevent=\"onDragLeave\"\n\t\t\t\t@drop.prevent=\"onDrop\">\n\t\t\t\t<!--\n\t\t\t\t`:ref` (dynamic), not `ref` (static), and this is load-bearing.\n\n\t\t\t\tEvery other binding on this input is static, and Vue caches the\n\t\t\t\t`@change` handler, so with a STATIC ref the compiler hoists the\n\t\t\t\twhole vnode to module scope. A hoisted vnode is created once,\n\t\t\t\toutside any render, so its ref carries no owner instance\n\t\t\t\t(`rawRef.i === null`).\n\n\t\t\t\t`setRef()` guards that — but the guard AND its early `return`\n\t\t\t\tlive inside `if (process.env.NODE_ENV !== 'production')`. In a\n\t\t\t\tdevelopment build you get the warning \"Missing ref owner\n\t\t\t\tcontext. ref cannot be used on hoisted vnodes.\" and nothing\n\t\t\t\tbreaks. In a PRODUCTION build the guard is compiled out and\n\t\t\t\texecution falls through to `owner.refs`, throwing\n\t\t\t\t`TypeError: Cannot read properties of null (reading 'refs')`\n\t\t\t\t— which aborts the render of whatever mounted this tab.\n\n\t\t\t\tMeasured: hrmq's detail pages (the only pages in the fleet that\n\t\t\t\treach CnIntegrationWidget through a `widgets[]` grid) rendered a\n\t\t\t\tCOMPLETELY BLANK content pane in production while looking fine\n\t\t\t\tin dev. A dynamic ref is compiled as a patchable prop, so the\n\t\t\t\tvnode is created inside the render function and owns a proper\n\t\t\t\tinstance.\n\t\t\t-->\n\t\t\t\t<input\n\t\t\t\t\t:ref=\"fileInputRef\"\n\t\t\t\t\ttype=\"file\"\n\t\t\t\t\tmultiple\n\t\t\t\t\tclass=\"cn-sidebar-tab__file-input\"\n\t\t\t\t\t:aria-label=\"dropZoneLabel\"\n\t\t\t\t\t@change=\"onFileUpload\">\n\t\t\t\t<Upload :size=\"24\" class=\"cn-sidebar-tab__dropzone-icon\" />\n\t\t\t\t<span class=\"cn-sidebar-tab__dropzone-text\">{{ dropZoneLabel }}</span>\n\t\t\t</div>\n\n\t\t\t<!-- File list. Each row borrows what Nextcloud already has on this\n\t\t page: the theme's own mime icon (OC.MimeType), the core preview\n\t\t endpoint for images, the Viewer for opening, and the Files sidebar\n\t\t for details, sharing and versions. Nothing of the Files app is\n\t\t rebuilt here; the row hands over to it. -->\n\t\t\t<NcLoadingIcon v-if=\"loading\" />\n\t\t\t<NcEmptyContent\n\t\t\t\tv-else-if=\"files.length === 0\"\n\t\t\t\tclass=\"cn-sidebar-tab__empty\"\n\t\t\t\t:name=\"noFilesLabel\"\n\t\t\t\t:description=\"dropZoneLabel\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<Paperclip :size=\"44\" />\n\t\t\t\t</template>\n\t\t\t</NcEmptyContent>\n\t\t\t<div v-else class=\"cn-sidebar-tab__list\">\n\t\t\t\t<NcListItem\n\t\t\t\t\tv-for=\"file in files\"\n\t\t\t\t\t:key=\"file.id\"\n\t\t\t\t\t:name=\"file.name || file.title\"\n\t\t\t\t\t:bold=\"false\"\n\t\t\t\t\t:forceDisplayActions=\"true\"\n\t\t\t\t\t@click=\"openFile(file)\">\n\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t<img\n\t\t\t\t\t\t\tv-if=\"previewUrlFor(file)\"\n\t\t\t\t\t\t\tclass=\"cn-sidebar-tab__thumb\"\n\t\t\t\t\t\t\t:src=\"previewUrlFor(file)\"\n\t\t\t\t\t\t\talt=\"\"\n\t\t\t\t\t\t\tloading=\"lazy\"\n\t\t\t\t\t\t\t@error=\"onPreviewError(file)\">\n\t\t\t\t\t\t<img\n\t\t\t\t\t\t\tv-else-if=\"mimeIconFor(file)\"\n\t\t\t\t\t\t\tclass=\"cn-sidebar-tab__mime\"\n\t\t\t\t\t\t\t:src=\"mimeIconFor(file)\"\n\t\t\t\t\t\t\talt=\"\">\n\t\t\t\t\t\t<FileOutline v-else :size=\"32\" />\n\t\t\t\t\t</template>\n\t\t\t\t\t<template #subname>\n\t\t\t\t\t\t<span class=\"cn-sidebar-tab__meta\">\n\t\t\t\t\t\t\t<span>{{ formatFileSize(file.size) }}</span>\n\t\t\t\t\t\t\t<template v-if=\"modifiedAt(file)\">\n\t\t\t\t\t\t\t\t<span aria-hidden=\"true\"> · </span>\n\t\t\t\t\t\t\t\t<NcDateTime :timestamp=\"modifiedAt(file)\" :ignoreSeconds=\"true\" />\n\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t\t<template v-if=\"labelsOf(file)\">\n\t\t\t\t\t\t\t\t<span aria-hidden=\"true\"> · </span>\n\t\t\t\t\t\t\t\t<span>{{ labelsOf(file) }}</span>\n\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</template>\n\t\t\t\t\t<template #actions>\n\t\t\t\t\t\t<NcActionButton :closeAfterClick=\"true\" @click=\"openFile(file)\">\n\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t<OpenInNew :size=\"20\" />\n\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t\t{{ openLabel }}\n\t\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t\t<!-- OpenRegister's Office page applies the object rule:\n\t\t\t\t\t\t update edits, read views, no read is a 404. -->\n\t\t\t\t\t\t<NcActionLink\n\t\t\t\t\t\t\tv-if=\"officeOpens(file)\"\n\t\t\t\t\t\t\t:href=\"officeUrlFor(file)\"\n\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t:closeAfterClick=\"true\">\n\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t<FileDocumentEditOutline :size=\"20\" />\n\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t\t{{ openInOfficeLabel }}\n\t\t\t\t\t\t</NcActionLink>\n\t\t\t\t\t\t<NcActionLink\n\t\t\t\t\t\t\tv-if=\"file.id\"\n\t\t\t\t\t\t\t:href=\"downloadUrlFor(file)\"\n\t\t\t\t\t\t\t:download=\"file.name || file.title || ''\"\n\t\t\t\t\t\t\t:closeAfterClick=\"true\">\n\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t<Download :size=\"20\" />\n\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t\t{{ downloadLabel }}\n\t\t\t\t\t\t</NcActionLink>\n\t\t\t\t\t\t<NcActionButton\n\t\t\t\t\t\t\tv-if=\"canShowDetails() && file.path\"\n\t\t\t\t\t\t\t:closeAfterClick=\"true\"\n\t\t\t\t\t\t\t@click=\"showDetails(file)\">\n\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t<InformationOutline :size=\"20\" />\n\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t\t{{ detailsLabel }}\n\t\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t\t<NcActionLink\n\t\t\t\t\t\t\tv-if=\"file.id\"\n\t\t\t\t\t\t\t:href=\"showInFilesUrl(file)\"\n\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t:closeAfterClick=\"true\">\n\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t<FolderOutline :size=\"20\" />\n\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t\t{{ showInFilesLabel }}\n\t\t\t\t\t\t</NcActionLink>\n\t\t\t\t\t\t<NcActionButton v-if=\"file.id\" :closeAfterClick=\"true\" @click=\"copyLink(file)\">\n\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t<LinkVariant :size=\"20\" />\n\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t\t{{ copyLinkLabel }}\n\t\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t\t<NcActionSeparator />\n\t\t\t\t\t\t<NcActionButton :closeAfterClick=\"true\" @click=\"deleteFile(file)\">\n\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t<Delete :size=\"20\" />\n\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t\t{{ deleteLabel }}\n\t\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t</template>\n\t\t\t\t</NcListItem>\n\t\t\t</div>\n\t\t\t<NcButton\n\t\t\t\tv-if=\"files.length < total\"\n\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t:wide=\"true\"\n\t\t\t\t:disabled=\"loadingMore\"\n\t\t\t\tclass=\"cn-sidebar-tab__load-more\"\n\t\t\t\t@click=\"loadMore\">\n\t\t\t\t<template v-if=\"loadingMore\" #icon>\n\t\t\t\t\t<NcLoadingIcon :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\t{{ loadMoreLabel }}\n\t\t\t</NcButton>\n\t\t</template>\n\t\t<CnFilePreview v-if=\"previewFile\" :file=\"previewFile\" @close=\"previewFile = null\" />\n\t</div>\n</template>\n\n<script>\nimport { getCurrentUser } from '@nextcloud/auth'\nimport axios from '@nextcloud/axios'\nimport { getCapabilities } from '@nextcloud/capabilities'\nimport { translate as t } from '@nextcloud/l10n'\nimport { generateRemoteUrl, generateUrl } from '@nextcloud/router'\nimport {\n\tNcActionButton,\n\tNcActionLink,\n\tNcActionSeparator,\n\tNcButton,\n\tNcCheckboxRadioSwitch,\n\tNcDateTime,\n\tNcEmptyContent,\n\tNcListItem,\n\tNcLoadingIcon,\n} from '@nextcloud/vue'\nimport Delete from 'vue-material-design-icons/Delete.vue'\nimport Download from 'vue-material-design-icons/Download.vue'\nimport FileDocumentEditOutline from 'vue-material-design-icons/FileDocumentEditOutline.vue'\nimport FileOutline from 'vue-material-design-icons/FileOutline.vue'\nimport FolderOutline from 'vue-material-design-icons/FolderOutline.vue'\nimport InformationOutline from 'vue-material-design-icons/InformationOutline.vue'\nimport LinkVariant from 'vue-material-design-icons/LinkVariant.vue'\nimport OpenInNew from 'vue-material-design-icons/OpenInNew.vue'\nimport Paperclip from 'vue-material-design-icons/Paperclip.vue'\nimport Upload from 'vue-material-design-icons/Upload.vue'\nimport CnFilePreview from '../CnFilePreview/CnFilePreview.vue'\nimport CnFilesBrowser from '../CnFilesBrowser/CnFilesBrowser.vue'\nimport { useFileOpener } from '../../composables/useFileOpener.js'\nimport { buildHeaders, prefixUrl } from '../../utils/index.js'\nimport { indexRowData, objectDisplayName, resolveObjectFolderInfo } from '../CnFilesBrowser/filesBrowser.js'\nimport { createOpenRegisterSource } from '../CnFilesBrowser/openRegisterSource.js'\n\n/**\n * The mime types Nextcloud Office opens by default for the current person.\n *\n * richdocuments publishes its capabilities only to a person it lets use\n * Office, so an empty list means no Office here, or none for them.\n *\n * @return {Array<string>} The mime types, or an empty list.\n */\nfunction readOfficeMimetypes() {\n\ttry {\n\t\tconst mimetypes = getCapabilities()?.richdocuments?.mimetypes\n\t\treturn Array.isArray(mimetypes) ? mimetypes.filter((mime) => typeof mime === 'string') : []\n\t} catch {\n\t\treturn []\n\t}\n}\n\nexport default {\n\tname: 'CnFilesTab',\n\n\tcomponents: {\n\t\tCnFilePreview,\n\t\tCnFilesBrowser,\n\t\tNcActionButton,\n\t\tNcActionLink,\n\t\tNcActionSeparator,\n\t\tNcButton,\n\t\tNcCheckboxRadioSwitch,\n\t\tNcDateTime,\n\t\tNcEmptyContent,\n\t\tNcListItem,\n\t\tNcLoadingIcon,\n\t\tDelete,\n\t\tDownload,\n\t\tFileDocumentEditOutline,\n\t\tFileOutline,\n\t\tFolderOutline,\n\t\tInformationOutline,\n\t\tLinkVariant,\n\t\tOpenInNew,\n\t\tPaperclip,\n\t\tUpload,\n\t},\n\n\tprops: {\n\t\t/** ID of the object this tab belongs to */\n\t\tobjectId: { type: String, required: true },\n\t\t/** OpenRegister register slug */\n\t\tregister: { type: String, default: '' },\n\t\t/** JSON Schema definition for the object */\n\t\tschema: { type: String, default: '' },\n\t\t/** Base URL for the OpenRegister API */\n\t\tapiBase: { type: String, default: '/apps/openregister/api' },\n\t\t/** Text shown inside the file drop zone */\n\t\tdropZoneLabel: { type: String, default: () => t('nextcloud-vue', 'Drop files here or click to browse') },\n\t\t/** Text shown when no files are attached */\n\t\tnoFilesLabel: { type: String, default: () => t('nextcloud-vue', 'No files attached') },\n\t\t/** Label for the open/view file action */\n\t\topenLabel: { type: String, default: () => t('nextcloud-vue', 'Open') },\n\t\t/**\n\t\t * Label of the action that opens a document in Nextcloud Office through\n\t\t * OpenRegister's Office page. Shown only when Office is there for this\n\t\t * person and opens the file's type; the page opens it for editing or\n\t\t * read-only by the object's own rule.\n\t\t */\n\t\topenInOfficeLabel: { type: String, default: () => t('nextcloud-vue', 'Open in Office') },\n\t\t/** Label for the delete action */\n\t\tdeleteLabel: { type: String, default: () => t('nextcloud-vue', 'Delete') },\n\t\t/** What the files browser's root crumb reads; null shows the object's name, else the folder's own name. */\n\t\tbrowserRootLabel: { type: String, default: null },\n\t\t/**\n\t\t * Where the files browser reads the object's folder from.\n\t\t * `openregister` (the default) goes through OpenRegister's files API under\n\t\t * the object's access rule, so anyone who may read the object sees its\n\t\t * files, without a share. `webdav` is the earlier behaviour: the folder is\n\t\t * looked up in the person's own Files over WebDAV and the browser shows\n\t\t * only when it is shared with them.\n\t\t */\n\t\tsource: {\n\t\t\ttype: String,\n\t\t\tdefault: 'openregister',\n\t\t\tvalidator: (value) => ['openregister', 'webdav'].includes(value),\n\t\t},\n\n\t\t/** Forwarded to CnFilesBrowser: a primary \"Add files\" button beside the New menu. */\n\t\tuploadButton: { type: Boolean, default: false },\n\t\t/** Whether the bar has the New menu; `false` leaves it out (CnFilesBrowser `newMenu`). */\n\t\tnewMenu: { type: Boolean, default: true },\n\t\t/** Whether the bar has a New folder button (CnFilesBrowser `folderButton`). */\n\t\tfolderButton: { type: Boolean, default: false },\n\t\t/** Forwarded to CnFilesBrowser: the drop state drawn over the list (\"Drop to add\") and announced. */\n\t\tdropOverlay: { type: Boolean, default: false },\n\t\t/** Forwarded to CnFilesBrowser: the drop state's line (\"Laat los om toe te voegen\"); the library's own without it. */\n\t\tdropLabel: { type: String, default: undefined },\n\t\t/** Forwarded to CnFilesBrowser: the drop state's second line, `{count}` the files dragged; it also makes the overlay fill the panel. */\n\t\tdropDetail: { type: [String, Array], default: '' },\n\t\t/** Forwarded to CnFilesBrowser: named values filled into `dropDetail`. */\n\t\tdropDetailValues: { type: Object, default: null },\n\t\t/** Forwarded to CnFilesBrowser: \"Or drag files onto this list.\" under the list. */\n\t\tdropHint: { type: Boolean, default: false },\n\t\t/**\n\t\t * The host's own actions on each file row of the browser, forwarded\n\t\t * to CnFilesBrowser's `rowActions`: declared like any manifest action\n\t\t * and dispatched with the file's id, name and path merged in.\n\t\t *\n\t\t * @type {Array<{id: string, label: string, icon?: string, type?: string, target?: string, props?: object}>}\n\t\t */\n\t\trowActions: { type: Array, default: () => [] },\n\t\t/**\n\t\t * The host's own entries in the browser's New menu, forwarded to\n\t\t * CnFilesBrowser's `newActions`: declared like a row action and\n\t\t * dispatched with the folder rather than a row, for things like\n\t\t * \"new from template\" or \"request a file from a party\".\n\t\t *\n\t\t * @type {Array<{id: string, label: string, icon?: string, type?: string, target?: string, props?: object}>}\n\t\t */\n\t\tnewActions: { type: Array, default: () => [] },\n\t\t/**\n\t\t * An app endpoint that answers the object's linked files, rows the\n\t\t * browser shows after the folder's own (files the host joined from\n\t\t * another object's folder). App-relative; `{objectId}` is replaced.\n\t\t * The response is an array (or `{ items: [] }`) of\n\t\t * `{ id, name, mime?, size?, mtime?, href?, downloadHref?, note?, noteHref? }`.\n\t\t * Null fetches nothing.\n\t\t */\n\t\tlinkedItemsUrl: { type: String, default: null },\n\t\t/**\n\t\t * Forwarded to CnFilesBrowser: the columns the browser shows, built-in\n\t\t * names or declared columns (`{ key, label, source, formatter }`).\n\t\t * A `source: 'row'` column reads the host's record for the file from\n\t\t * `rowDataUrl`. None keeps name, size and modified.\n\t\t *\n\t\t * @type {Array<string|object>}\n\t\t */\n\t\tcolumns: { type: Array, default: () => [] },\n\t\t/** Forwarded to CnFilesBrowser: the app id the user's column choice is stored under; unset offers no Columns chooser. */\n\t\tpreferenceApp: { type: String, default: '' },\n\t\t/** Forwarded to CnFilesBrowser: the key the column choice is stored under. */\n\t\tpreferenceKey: { type: String, default: 'files-browser-columns' },\n\t\t/**\n\t\t * An app endpoint that answers the host's own record per file, for the\n\t\t * browser's `source: 'row'` columns. App-relative; `{objectId}` is\n\t\t * replaced. Read once per listing. The answer is a list of records\n\t\t * (or the list at `rowDataPath`, or under `items` or `results`), each\n\t\t * naming its file in `rowDataKey`. Null reads nothing.\n\t\t */\n\t\trowDataUrl: { type: String, default: null },\n\t\t/**\n\t\t * Forwarded to CnFilesBrowser: the host's actions on a selection of\n\t\t * files. With at least one, files get checkboxes and a bulk bar.\n\t\t *\n\t\t * @type {Array<{id: string, label: string, icon?: string, type?: string, target?: string, props?: object}>}\n\t\t */\n\t\tbulkActions: { type: Array, default: () => [] },\n\t\t/** Forwarded to CnFilesBrowser: the bulk bar's count, a template with `{count}`. */\n\t\tselectionLabel: { type: String, default: '' },\n\t\t/** Forwarded to CnFilesBrowser: the bulk bar's count for one file. */\n\t\tselectionLabelOne: { type: String, default: '' },\n\t\t/** Forwarded to CnFilesBrowser: whether the bulk bar ends in \"Clear selection\". */\n\t\tshowClearSelection: { type: Boolean, default: true },\n\t\t/**\n\t\t * Forwarded to CnFilesBrowser: cards beside the list about the last\n\t\t * selected file.\n\t\t *\n\t\t * @type {Array<{id: string, title: string, fields?: Array<object>, actions?: Array<object>}>}\n\t\t */\n\t\tsideCards: { type: Array, default: () => [] },\n\t\t/** Forwarded to CnFilesBrowser: `page-side` puts the side cards in the detail page's side column. */\n\t\tsideCardsPlacement: { type: String, default: 'beside' },\n\t\t/** Forwarded to CnFilesBrowser: the key of a declared column to group the files on. */\n\t\tgroupBy: { type: String, default: '' },\n\t\t/**\n\t\t * Forwarded to CnFilesBrowser: keys of declared columns to filter on,\n\t\t * a chip per value in use.\n\t\t *\n\t\t * @type {string[]}\n\t\t */\n\t\tfacets: { type: Array, default: () => [] },\n\t\t/** How the facets are drawn: `chips` or `menu` (CnFilesBrowser `facetPresentation`). */\n\t\tfacetPresentation: { type: String, default: 'chips' },\n\t\t/** Forwarded to CnFilesBrowser: the host's own buttons in the bar. */\n\t\theaderActions: { type: Array, default: () => [] },\n\t\t/** Forwarded to CnFilesBrowser: one visible button on every file row. */\n\t\trowButton: { type: Object, default: null },\n\t\t/** Forwarded to CnFilesBrowser: the review summary above the list. */\n\t\treviewSummary: { type: Object, default: null },\n\t\t/** Forwarded to CnFilesBrowser: the host's own line under the list. */\n\t\tfootnote: { type: String, default: '' },\n\t\t/** Forwarded to CnFilesBrowser: the second line under each file's name. */\n\t\tnameSecondary: { type: String, default: '' },\n\t\t/** Forwarded to CnFilesBrowser: the second line as a list of fields, or variants. */\n\t\tsecondLine: { type: Array, default: null },\n\t\t/** A dotted path to the list of records in the `rowDataUrl` answer; empty reads the answer itself. */\n\t\trowDataPath: { type: String, default: '' },\n\t\t/** The record field that holds the Nextcloud file id. */\n\t\trowDataKey: { type: String, default: 'fileId' },\n\t\t/** Label of the Download action. */\n\t\tdownloadLabel: { type: String, default: () => t('nextcloud-vue', 'Download') },\n\t\t/** Label of the action that opens the Files sidebar on the file. */\n\t\tdetailsLabel: { type: String, default: () => t('nextcloud-vue', 'Details and sharing') },\n\t\t/** Label of the link that opens the file in the Files app. */\n\t\tshowInFilesLabel: { type: String, default: () => t('nextcloud-vue', 'Show in Files') },\n\t\t/** Label of the action that copies the file permalink. */\n\t\tcopyLinkLabel: { type: String, default: () => t('nextcloud-vue', 'Copy link') },\n\t\t/** Label for the load-more button */\n\t\tloadMoreLabel: { type: String, default: () => t('nextcloud-vue', 'Load more') },\n\t\t/**\n\t\t * Whether to render the \"share uploaded files\" toggle. Off by default;\n\t\t * when false, uploads never set the share flag (no auto-publish).\n\t\t *\n\t\t * @type {boolean}\n\t\t */\n\t\tshowShareToggle: { type: Boolean, default: false },\n\t\t/**\n\t\t * Initial state for the share toggle. `true`/`false` wins outright;\n\t\t * `null` (the default) defers to the schema's\n\t\t * `configuration.defaultAutoShare` from OpenRegister.\n\t\t *\n\t\t * @type {boolean|null}\n\t\t */\n\t\tdefaultShare: { type: Boolean, default: null },\n\t\t/** Label for the share toggle */\n\t\tshareLabel: { type: String, default: () => t('nextcloud-vue', 'Share uploaded files') },\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\tpreviewFile: null,\n\t\t\tfiles: [],\n\t\t\tloading: false,\n\t\t\tloadingMore: false,\n\t\t\tisDragOver: false,\n\t\t\tuploadError: '',\n\t\t\tpage: 1,\n\t\t\ttotal: 0,\n\t\t\tlimit: 20,\n\t\t\tshare: false,\n\t\t\t/** The object's folder as a user-relative path, or null while unresolved or absent. */\n\t\t\tbrowserRoot: null,\n\t\t\t/** The browser's data source for `source: 'openregister'`, or null for WebDAV. */\n\t\t\tbrowserSource: null,\n\t\t\tbrowserObjectName: null,\n\t\t\tlinkedItems: [],\n\t\t\t/** File ids whose preview request failed, so the row falls back to the mime icon. */\n\t\t\tpreviewFailed: {},\n\t\t\t/**\n\t\t\t * The file input element, set by the template's function ref.\n\t\t\t *\n\t\t\t * Held here rather than read back through `$refs` so the ref stays\n\t\t\t * DYNAMIC — see the long comment on the input itself for why a\n\t\t\t * static ref on this element is a production crash.\n\t\t\t *\n\t\t\t * @type {HTMLInputElement|null}\n\t\t\t */\n\t\t\tfileInputEl: null,\n\t\t\t/** The mime types Nextcloud Office opens for this person; empty without Office. */\n\t\t\tofficeMimetypes: readOfficeMimetypes(),\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/**\n\t\t * The browser's `rowData`: a function that reads the host's records\n\t\t * from `rowDataUrl` and keys them by file id, or null without a url.\n\t\t * The browser calls it once per listing.\n\t\t *\n\t\t * @return {(function(): Promise<object>)|null} The row data source.\n\t\t * @spec openspec/changes/files-browser-hosts-a-documents-list/specs/files-browser/spec.md\n\t\t */\n\t\trowDataSource() {\n\t\t\tif (!this.rowDataUrl || !this.objectId) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tconst url = generateUrl(this.rowDataUrl.replace('{objectId}', encodeURIComponent(this.objectId)))\n\t\t\tconst path = this.rowDataPath\n\t\t\tconst key = this.rowDataKey\n\t\t\treturn async () => {\n\t\t\t\tconst { data } = await axios.get(url)\n\t\t\t\treturn indexRowData(data, { path, key })\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * The root crumb: the host's label, else the object's name (its folder\n\t\t * on disk is called after its uuid), else the folder's own name.\n\t\t *\n\t\t * @return {string|null}\n\t\t * @spec openspec/changes/dutch-library-strings-and-files-crumb/specs/dutch-library-strings-and-files-crumb/spec.md#requirement-the-files-browser-names-the-object-in-its-root-crumb\n\t\t */\n\t\teffectiveBrowserRootLabel() {\n\t\t\treturn this.browserRootLabel || this.browserObjectName || null\n\t\t},\n\t},\n\n\twatch: {\n\t\t// Match every other CnObjectSidebar tab — a single immediate\n\t\t// `objectId` watcher drives all initial loads. Folding the\n\t\t// share-toggle seed in here avoids two concurrent GETs of\n\t\t// `schemas/{schema}` on mount (one per immediate watcher).\n\t\tobjectId: {\n\t\t\timmediate: true,\n\t\t\thandler(id) {\n\t\t\t\tif (id) {\n\t\t\t\t\tthis.fetchFiles()\n\t\t\t\t}\n\t\t\t\tthis.applyShareDefault()\n\t\t\t\tthis.resolveBrowserRoot()\n\t\t\t\tthis.fetchLinkedItems()\n\t\t\t},\n\t\t},\n\n\t\tlinkedItemsUrl() {\n\t\t\tthis.fetchLinkedItems()\n\t\t},\n\n\t\tsource() {\n\t\t\tthis.resolveBrowserRoot()\n\t\t},\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Function ref for the file input.\n\t\t *\n\t\t * A method (not an inline arrow in the template) so the binding is a\n\t\t * stable reference across renders and Vue does not detach/reattach the\n\t\t * ref on every patch. Being a function ref is what keeps the vnode\n\t\t * dynamic — see the template comment on the input.\n\t\t *\n\t\t * @param {HTMLInputElement|null} el The element, or null on unmount.\n\t\t * @return {void}\n\t\t */\n\t\tfileInputRef(el) {\n\t\t\tthis.fileInputEl = el || null\n\t\t},\n\n\t\t/**\n\t\t * Find the object's folder for the browser, or leave the legacy list.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t */\n\t\t/**\n\t\t * The browser changed the folder: refresh the object's file list and\n\t\t * the linked rows, since a join or a move can change either.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tonBrowserChanged() {\n\t\t\tthis.fetchFiles()\n\t\t\tthis.fetchLinkedItems()\n\t\t},\n\n\t\t/**\n\t\t * Read the object's linked files from the host's endpoint, if any.\n\t\t *\n\t\t * A failure leaves the last list in place and logs at debug: the\n\t\t * folder's own rows are the surface, the linked rows a supplement.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync fetchLinkedItems() {\n\t\t\tif (!this.linkedItemsUrl || !this.objectId) {\n\t\t\t\tthis.linkedItems = []\n\t\t\t\treturn\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tconst url = generateUrl(this.linkedItemsUrl.replace('{objectId}', encodeURIComponent(this.objectId)))\n\t\t\t\tconst { data } = await axios.get(url)\n\t\t\t\tconst items = Array.isArray(data) ? data : (Array.isArray(data?.items) ? data.items : [])\n\t\t\t\tthis.linkedItems = items.filter((item) => item && typeof item === 'object')\n\t\t\t} catch (error) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.debug('[CnFilesTab] linked items not read', error)\n\t\t\t}\n\t\t},\n\n\t\tasync resolveBrowserRoot() {\n\t\t\tthis.browserRoot = null\n\t\t\tthis.browserSource = null\n\t\t\tthis.browserObjectName = null\n\t\t\tif (!this.objectId || !this.register || !this.schema) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (this.source === 'openregister') {\n\t\t\t\tawait this.resolveOpenRegisterSource()\n\t\t\t\treturn\n\t\t\t}\n\t\t\tlet remoteUrl\n\t\t\ttry {\n\t\t\t\tremoteUrl = generateRemoteUrl('dav')\n\t\t\t} catch {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst info = await resolveObjectFolderInfo({\n\t\t\t\tapiBase: this.apiBase,\n\t\t\t\tregister: this.register,\n\t\t\t\tschema: this.schema,\n\t\t\t\tobjectId: this.objectId,\n\t\t\t\tuid: getCurrentUser()?.uid || '',\n\t\t\t\tremoteUrl,\n\t\t\t})\n\t\t\tthis.browserRoot = info === null ? null : info.path\n\t\t\tthis.browserObjectName = info === null ? null : info.name\n\t\t},\n\n\t\t/**\n\t\t * Use OpenRegister's files API for the browser, when this person may read\n\t\t * the object's folder through it. A listing that fails (no read on the\n\t\t * object, or an OpenRegister without the folder endpoints) leaves the\n\t\t * legacy list, as an unresolved WebDAV folder did.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t * @spec openspec/changes/files-browser-openregister-source/specs/files-browser/spec.md\n\t\t */\n\t\tasync resolveOpenRegisterSource() {\n\t\t\tconst objectId = this.objectId\n\t\t\tconst source = createOpenRegisterSource({\n\t\t\t\tapiBase: this.apiBase,\n\t\t\t\tregister: this.register,\n\t\t\t\tschema: this.schema,\n\t\t\t\tobjectId,\n\t\t\t})\n\t\t\ttry {\n\t\t\t\tawait source.list('/')\n\t\t\t} catch {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (objectId !== this.objectId) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.browserSource = source\n\t\t\tthis.browserRoot = '/'\n\t\t\tthis.fetchObjectName()\n\t\t},\n\n\t\t/**\n\t\t * Read the object's name for the root crumb, by the same rule the WebDAV\n\t\t * path uses (`objectDisplayName`: never the uuid). The OpenRegister path\n\t\t * has no folder lookup to piggyback on, so this is its one object read.\n\t\t * A failure keeps the crumb on its default.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync fetchObjectName() {\n\t\t\tconst objectId = this.objectId\n\t\t\ttry {\n\t\t\t\tconst { data } = await axios.get(generateUrl(`${this.apiBase}/objects/{register}/{schema}/{objectId}`, {\n\t\t\t\t\tregister: this.register,\n\t\t\t\t\tschema: this.schema,\n\t\t\t\t\tobjectId,\n\t\t\t\t}))\n\t\t\t\tif (objectId === this.objectId) {\n\t\t\t\t\tthis.browserObjectName = objectDisplayName(data, objectId)\n\t\t\t\t}\n\t\t\t} catch {\n\t\t\t\t// The crumb keeps its default.\n\t\t\t}\n\t\t},\n\n\t\tasync fetchFiles(append = false) {\n\t\t\tif (!this.register || !this.schema) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (append) {\n\t\t\t\tthis.loadingMore = true\n\t\t\t} else {\n\t\t\t\tthis.loading = true\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tconst params = new URLSearchParams({ limit: this.limit, _page: this.page })\n\t\t\t\tconst response = await fetch(\n\t\t\t\t\tprefixUrl(`${this.apiBase}/objects/${this.register}/${this.schema}/${this.objectId}/files?${params}`),\n\t\t\t\t\t{ headers: buildHeaders() },\n\t\t\t\t)\n\t\t\t\tif (response.ok) {\n\t\t\t\t\tconst data = await response.json()\n\t\t\t\t\tconst results = data.results || data || []\n\t\t\t\t\tthis.files = append ? [...this.files, ...results] : results\n\t\t\t\t\tthis.total = data.total || this.files.length\n\t\t\t\t}\n\t\t\t} catch (err) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.error('CnFilesTab: Failed to fetch files', err)\n\t\t\t} finally {\n\t\t\t\tthis.loading = false\n\t\t\t\tthis.loadingMore = false\n\t\t\t}\n\t\t},\n\n\t\tloadMore() {\n\t\t\tthis.page++\n\t\t\tthis.fetchFiles(true)\n\t\t},\n\n\t\t/**\n\t\t * Seed the `share` toggle. The `defaultShare` prop wins when set\n\t\t * (non-null); otherwise we look up the active schema's\n\t\t * `configuration.defaultAutoShare` from OpenRegister and use that.\n\t\t * Network failure or missing key → keep the safe default (false) so\n\t\t * a hiccup never silently flips uploads to \"share\".\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync applyShareDefault() {\n\t\t\tif (this.defaultShare !== null && this.defaultShare !== undefined) {\n\t\t\t\tthis.share = !!this.defaultShare\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.share = false\n\t\t\tif (!this.schema) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tconst response = await fetch(\n\t\t\t\t\tprefixUrl(`${this.apiBase}/schemas/${this.schema}`),\n\t\t\t\t\t{ headers: buildHeaders() },\n\t\t\t\t)\n\t\t\t\tif (!response.ok) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tconst data = await response.json().catch(() => null)\n\t\t\t\tif (data?.configuration?.defaultAutoShare === true) {\n\t\t\t\t\tthis.share = true\n\t\t\t\t}\n\t\t\t} catch (err) {\n\t\t\t\t// Non-fatal — keep the safe default, but surface the\n\t\t\t\t// failure so a missing toggle default isn't silent.\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.error('CnFilesTab: Failed to fetch schema default for share toggle', err)\n\t\t\t}\n\t\t},\n\n\t\ttriggerFileInput() {\n\t\t\tthis.fileInputEl?.click()\n\t\t},\n\n\t\tonDragOver() {\n\t\t\tthis.isDragOver = true\n\t\t},\n\n\t\tonDragLeave() {\n\t\t\tthis.isDragOver = false\n\t\t},\n\n\t\tonDrop(event) {\n\t\t\tthis.isDragOver = false\n\t\t\tconst droppedFiles = event.dataTransfer?.files\n\t\t\tif (droppedFiles?.length) {\n\t\t\t\tthis.uploadFiles(droppedFiles)\n\t\t\t}\n\t\t},\n\n\t\tasync onFileUpload(event) {\n\t\t\tconst inputFiles = event.target.files\n\t\t\tif (!inputFiles?.length) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tawait this.uploadFiles(inputFiles)\n\t\t\tif (this.fileInputEl) {\n\t\t\t\tthis.fileInputEl.value = ''\n\t\t\t}\n\t\t},\n\n\t\tasync uploadFiles(fileList) {\n\t\t\tif (!fileList?.length || !this.register || !this.schema) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.uploadError = ''\n\t\t\tconst formData = new FormData()\n\t\t\tfor (const file of fileList) {\n\t\t\t\tformData.append('files[]', file)\n\t\t\t}\n\t\t\t// Only forward the share flag when the toggle is actually visible.\n\t\t\t// Hiding the toggle (showShareToggle=false) means \"don't auto-publish\".\n\t\t\tif (this.showShareToggle) {\n\t\t\t\tformData.append('share', String(this.share))\n\t\t\t}\n\n\t\t\tthis.loading = true\n\t\t\ttry {\n\t\t\t\tconst response = await fetch(\n\t\t\t\t\tprefixUrl(`${this.apiBase}/objects/${this.register}/${this.schema}/${this.objectId}/filesMultipart`),\n\t\t\t\t\t{\n\t\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\t\theaders: { requesttoken: OC?.requestToken || '', 'OCS-APIREQUEST': 'true' },\n\t\t\t\t\t\tbody: formData,\n\t\t\t\t\t},\n\t\t\t\t)\n\t\t\t\tif (!response.ok) {\n\t\t\t\t\tconst data = await response.json().catch(() => ({}))\n\t\t\t\t\tthis.uploadError = data.error || `Upload failed (${response.status})`\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tawait this.fetchFiles()\n\t\t\t} catch (err) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.error('CnFilesTab: Failed to upload file', err)\n\t\t\t\tthis.uploadError = 'Upload failed: could not connect to server'\n\t\t\t} finally {\n\t\t\t\tthis.loading = false\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Whether the Files app's details sidebar is on this page.\n\t\t *\n\t\t * It is when the host page dispatched Nextcloud's `LoadSidebar` event\n\t\t * server-side; then `OCA.Files.Sidebar.open(path)` shows the same\n\t\t * sharing, versions, comments and activity tabs the Files app shows.\n\t\t * Absent, the row offers no details action rather than a dead one. A\n\t\t * method rather than a computed: the global is not reactive, so a\n\t\t * cached answer from before the sidebar script ran would stay wrong.\n\t\t *\n\t\t * @return {boolean} true when the sidebar can be opened.\n\t\t */\n\t\tcanShowDetails() {\n\t\t\treturn typeof window !== 'undefined' && typeof window.OCA?.Files?.Sidebar?.open === 'function'\n\t\t},\n\n\t\t/**\n\t\t * The file's path relative to the user's files root, which is the path\n\t\t * the Viewer and the Files sidebar take. OpenRegister reports the node's\n\t\t * full path (`/{uid}/files/…`), so the first two segments come off.\n\t\t *\n\t\t * @param {string} path The node path as OpenRegister reports it.\n\t\t * @return {string} The user-relative path, `/` at least.\n\t\t */\n\t\tuserRelativePath(path) {\n\t\t\tconst stripped = String(path || '').replace(/^\\/[^/]+\\/files(?=\\/|$)/, '')\n\t\t\treturn stripped === '' ? '/' : stripped\n\t\t},\n\n\t\t/**\n\t\t * The theme's own icon for the file's mime type, the one the Files app\n\t\t * draws, or null on a page without Nextcloud's core script.\n\t\t *\n\t\t * @param {object} file The file row.\n\t\t * @return {string|null} The icon url.\n\t\t */\n\t\tmimeIconFor(file) {\n\t\t\tconst getIconUrl = typeof window !== 'undefined' ? window.OC?.MimeType?.getIconUrl : null\n\t\t\tif (typeof getIconUrl !== 'function') {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tconst mime = file.type || file.mimetype || file.mimeType || ''\n\t\t\ttry {\n\t\t\t\treturn getIconUrl(mime) || null\n\t\t\t} catch {\n\t\t\t\treturn null\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * A small preview for an image, through Nextcloud's core preview\n\t\t * endpoint, or null for anything else or after the preview failed once.\n\t\t *\n\t\t * @param {object} file The file row.\n\t\t * @return {string|null} The preview url.\n\t\t */\n\t\tpreviewUrlFor(file) {\n\t\t\tconst mime = file.type || file.mimetype || file.mimeType || ''\n\t\t\tif (!file.id || !/^image\\//i.test(mime) || /svg/i.test(mime) || this.previewFailed[file.id]) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\treturn generateUrl('/core/preview?fileId={fileId}&x=64&y=64&a=1', { fileId: file.id })\n\t\t},\n\n\t\t/**\n\t\t * Remember that a preview did not load, so the row shows the mime icon.\n\t\t *\n\t\t * @param {object} file The file row.\n\t\t * @return {void}\n\t\t */\n\t\tonPreviewError(file) {\n\t\t\tthis.previewFailed = { ...this.previewFailed, [file.id]: true }\n\t\t},\n\n\t\t/**\n\t\t * The file's modification moment as a Date, or null when unknown.\n\t\t *\n\t\t * @param {object} file The file row.\n\t\t * @return {Date|null} The moment.\n\t\t */\n\t\tmodifiedAt(file) {\n\t\t\tconst raw = file.modified || file.updated || ''\n\t\t\tif (!raw) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tconst date = new Date(raw)\n\t\t\treturn Number.isNaN(date.getTime()) ? null : date\n\t\t},\n\n\t\t/**\n\t\t * The file's labels (Nextcloud tags), joined for the meta line.\n\t\t *\n\t\t * @param {object} file The file row.\n\t\t * @return {string} The labels, or the empty string.\n\t\t */\n\t\tlabelsOf(file) {\n\t\t\treturn Array.isArray(file.labels) ? file.labels.filter(Boolean).join(', ') : ''\n\t\t},\n\n\t\t/**\n\t\t * The download url for a file, through OpenRegister's file endpoint,\n\t\t * which streams the node the object owns.\n\t\t *\n\t\t * @param {object} file The file row.\n\t\t * @return {string} The url.\n\t\t */\n\t\tdownloadUrlFor(file) {\n\t\t\treturn `${this.apiBase}/files/${encodeURIComponent(String(file.id))}/download`\n\t\t},\n\n\t\t/**\n\t\t * Whether Nextcloud Office opens this file for this person.\n\t\t *\n\t\t * @param {object} file The file row.\n\t\t * @return {boolean} true when the Office action applies.\n\t\t */\n\t\tofficeOpens(file) {\n\t\t\tconst mime = file.type || file.mimetype || file.mimeType || ''\n\t\t\treturn Boolean(file.id) && mime !== '' && this.officeMimetypes.includes(mime)\n\t\t},\n\n\t\t/**\n\t\t * OpenRegister's Office page for a file of this object, which checks the\n\t\t * object rule and opens the document editable or read-only.\n\t\t *\n\t\t * @param {object} file The file row.\n\t\t * @return {string} The url.\n\t\t */\n\t\tofficeUrlFor(file) {\n\t\t\tconst appBase = /\\/api\\/?$/.test(this.apiBase) ? this.apiBase.replace(/\\/api\\/?$/, '') : '/apps/openregister'\n\t\t\tconst segments = [this.register, this.schema, this.objectId, String(file.id)].map((part) => encodeURIComponent(String(part)))\n\t\t\treturn prefixUrl(`${appBase}/office/${segments.join('/')}`)\n\t\t},\n\n\t\t/**\n\t\t * The Files app's permalink for a file: opens the Files app at the\n\t\t * file's folder with the file selected.\n\t\t *\n\t\t * @param {object} file The file row.\n\t\t * @return {string} The url.\n\t\t */\n\t\tshowInFilesUrl(file) {\n\t\t\treturn generateUrl('/f/{fileid}', { fileid: file.id })\n\t\t},\n\n\t\t/**\n\t\t * Open the Files sidebar on this file: details, sharing, versions,\n\t\t * comments and activity, exactly as the Files app offers them.\n\t\t *\n\t\t * @param {object} file The file row.\n\t\t * @return {void}\n\t\t */\n\t\tshowDetails(file) {\n\t\t\tif (!this.canShowDetails() || !file.path) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\twindow.OCA.Files.Sidebar.open(this.userRelativePath(file.path))\n\t\t},\n\n\t\t/**\n\t\t * Put the file's permalink on the clipboard and say so.\n\t\t *\n\t\t * @param {object} file The file row.\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync copyLink(file) {\n\t\t\tconst href = new URL(this.showInFilesUrl(file), window.location.origin).href\n\t\t\ttry {\n\t\t\t\tawait navigator.clipboard.writeText(href)\n\t\t\t\tconst { showSuccess } = await import('@nextcloud/dialogs')\n\t\t\t\tshowSuccess(t('nextcloud-vue', 'Link copied'))\n\t\t\t} catch {\n\t\t\t\tconst { showError } = await import('@nextcloud/dialogs')\n\t\t\t\tshowError(t('nextcloud-vue', 'The link could not be copied'))\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Show a file in the in-page preview.\n\t\t *\n\t\t * @param {object} file The file to preview.\n\t\t */\n\t\tshowPreview(file) {\n\t\t\tthis.previewFile = file\n\t\t},\n\n\t\t/**\n\t\t * Open a file through the shared opener (Viewer, preview, browser, Files).\n\t\t *\n\t\t * @param {object} file The file row.\n\t\t */\n\t\topenFile(file) {\n\t\t\tuseFileOpener({\n\t\t\t\tonPreview: this.showPreview,\n\t\t\t\tuserRelativePath: this.userRelativePath,\n\t\t\t\tanyAccessUrl: true,\n\t\t\t\tfilesAppUrl: (f) => {\n\t\t\t\t\tconst dirPath = f.path ? f.path.substring(0, f.path.lastIndexOf('/')) : ''\n\t\t\t\t\tconst cleanPath = dirPath.replace(/^\\/admin\\/files\\//, '/')\n\t\t\t\t\treturn `/index.php/apps/files/files/${f.id}?dir=${encodeURIComponent(cleanPath)}&openfile=true`\n\t\t\t\t},\n\t\t\t}).open(file)\n\t\t},\n\n\t\tasync deleteFile(file) {\n\t\t\tif (!this.register || !this.schema) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tawait fetch(\n\t\t\t\t\tprefixUrl(`${this.apiBase}/objects/${this.register}/${this.schema}/${this.objectId}/files/${file.id}`),\n\t\t\t\t\t{ method: 'DELETE', headers: buildHeaders() },\n\t\t\t\t)\n\t\t\t\tthis.files = this.files.filter((f) => f.id !== file.id)\n\t\t\t} catch (err) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.error('CnFilesTab: Failed to delete file', err)\n\t\t\t}\n\t\t},\n\n\t\tformatFileSize(bytes) {\n\t\t\tconst sizes = ['Bytes', 'KB', 'MB', 'GB']\n\t\t\tif (!bytes || bytes === 0) {\n\t\t\t\treturn 'n/a'\n\t\t\t}\n\t\t\tconst i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)))\n\t\t\tif (i === 0) {\n\t\t\t\treturn '< 1 KB'\n\t\t\t}\n\t\t\treturn (bytes / Math.pow(1024, i)).toFixed(1) + ' ' + sizes[i]\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-sidebar-tab { padding: 12px; }\n\n.cn-sidebar-tab__upload-error {\n\tpadding: 8px 12px;\n\tmargin-bottom: 8px;\n\tborder-radius: var(--border-radius, 4px);\n\tbackground-color: var(--color-error-light, rgba(229, 57, 53, 0.1));\n\tcolor: var(--color-error, #e53935);\n\tfont-size: 13px;\n}\n\n.cn-sidebar-tab__dropzone {\n\tdisplay: flex;\n\tflex-direction: column;\n\talign-items: center;\n\tjustify-content: center;\n\tgap: 8px;\n\tpadding: 20px 12px;\n\tmargin-bottom: 16px;\n\tborder: 2px dashed var(--color-border);\n\tborder-radius: var(--border-radius-large, 8px);\n\tcursor: pointer;\n\ttransition: border-color 0.15s ease, background-color 0.15s ease;\n}\n\n.cn-sidebar-tab__dropzone:hover {\n\tborder-color: var(--color-primary-element);\n\tbackground-color: var(--color-primary-element-light, rgba(0, 130, 201, 0.08));\n}\n\n.cn-sidebar-tab__dropzone--active {\n\tborder-color: var(--color-primary-element);\n\tbackground-color: var(--color-primary-element-light, rgba(0, 130, 201, 0.12));\n}\n\n@media (prefers-reduced-motion: reduce) {\n\t.cn-sidebar-tab__dropzone { transition: none; }\n}\n\n.cn-sidebar-tab__share { margin-bottom: 12px; }\n\n.cn-sidebar-tab__dropzone-icon { color: var(--color-text-maxcontrast); }\n\n.cn-sidebar-tab__dropzone--active .cn-sidebar-tab__dropzone-icon,\n.cn-sidebar-tab__dropzone:hover .cn-sidebar-tab__dropzone-icon { color: var(--color-primary-element); }\n\n.cn-sidebar-tab__dropzone-text { font-size: 13px; color: var(--color-text-maxcontrast); }\n\n.cn-sidebar-tab__file-input { display: none; }\n\n.cn-sidebar-tab__empty {\n\ttext-align: center;\n\tpadding: 24px 12px;\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 13px;\n}\n\n.cn-sidebar-tab__list { display: flex; flex-direction: column; gap: 2px; }\n\n.cn-sidebar-tab__mime,\n.cn-sidebar-tab__thumb {\n\twidth: 32px;\n\theight: 32px;\n\tdisplay: block;\n}\n\n.cn-sidebar-tab__thumb {\n\tobject-fit: cover;\n\tborder-radius: var(--border-radius, 4px);\n}\n\n.cn-sidebar-tab__meta { color: var(--color-text-maxcontrast); }\n\n.cn-sidebar-tab__load-more { margin-top: 8px; }\n</style>\n"],"names":["_openBlock","_createElementBlock","_createBlock","_Fragment","_toDisplayString","_createElementVNode","_normalizeClass","_createVNode","_renderList","_createTextVNode"],"mappings":";;AACM,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,gBAAgB,GAAA;;;AA4CD,EAAA,KAAK,EAAC,8BAA8B;;;AA4DrD,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,+BAA+B,GAAA;;;AAkBhC,EAAA,KAAK,EAAC,sBAAsB;;;;AAwB/B,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,sBAAsB,GAAA;;;;;;;;;;;;;;;;;;;;;;;;;AAlJvC,EAAA,QAAAA,SAAA,EAAA,EAAAC,kBAAA,CA4OK,OA5OL,UA4OK,EAAA;KAtOG,KAAY,CAAA,WAAA,KAAA,IAAA;sBADnBC,WAoC8B,CAAA,yBAAA,EAAA;;AAlC5B,UAAA,QAAQ,EAAE,KAAW,CAAA,WAAA;AACrB,UAAA,SAAS,EAAE,QAAyB,CAAA,yBAAA;AACpC,UAAA,MAAM,EAAE,KAAa,CAAA,aAAA;AACrB,UAAA,WAAW,EAAE,MAAW,CAAA,WAAA;AACxB,UAAA,YAAY,EAAE,MAAY,CAAA,YAAA;AAC1B,UAAA,OAAO,EAAE,MAAO,CAAA,OAAA;AAChB,UAAA,YAAY,EAAE,MAAY,CAAA,YAAA;AAC1B,UAAA,WAAW,EAAE,MAAW,CAAA,WAAA;AACxB,UAAA,SAAS,EAAE,MAAS,CAAA,SAAA;AACpB,UAAA,UAAU,EAAE,MAAU,CAAA,UAAA;AACtB,UAAA,gBAAgB,EAAE,MAAgB,CAAA,gBAAA;AAClC,UAAA,QAAQ,EAAE,MAAQ,CAAA,QAAA;AAClB,UAAA,UAAU,EAAE,MAAU,CAAA,UAAA;AACtB,UAAA,U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AA,WAAA;sBAAhCL,WAAmF,CAAA,wBAAA,EAAA;;AAAhD,UAAA,IAAI,EAAE,KAAW,CAAA,WAAA;AAAG,UAAA,OAAK,uCAAE,KAAU,CAAA,WAAA,GAAA,IAAA,CAAA,CAAA;;;;;;;;"}
1
+ {"version":3,"file":"CnFilesTab.vue3.js","sources":["../../../../src/components/CnObjectSidebar/CnFilesTab.vue?vue&type=template&id=8a465eda&lang.js"],"sourcesContent":["<template>\n\t<div class=\"cn-sidebar-tab\">\n\t\t<!-- The object's folder as a real files browser, on the Files app's own\n\t\t primitives (its actions, its New menu, its breadcrumbs), when the\n\t\t folder resolves for this user. The list below is the fallback for an\n\t\t object with no folder, or a user the folder is not shared with. -->\n\t\t<CnFilesBrowser\n\t\t\tv-if=\"browserRoot !== null\"\n\t\t\t:rootPath=\"browserRoot\"\n\t\t\t:rootLabel=\"effectiveBrowserRootLabel\"\n\t\t\t:source=\"browserSource\"\n\t\t\t:deleteLabel=\"deleteLabel\"\n\t\t\t:uploadButton=\"uploadButton\"\n\t\t\t:newMenu=\"newMenu\"\n\t\t\t:folderButton=\"folderButton\"\n\t\t\t:dropOverlay=\"dropOverlay\"\n\t\t\t:dropLabel=\"dropLabel\"\n\t\t\t:dropDetail=\"dropDetail\"\n\t\t\t:dropDetailValues=\"dropDetailValues\"\n\t\t\t:dropHint=\"dropHint\"\n\t\t\t:rowActions=\"rowActions\"\n\t\t\t:newActions=\"newActions\"\n\t\t\t:headerActions=\"headerActions\"\n\t\t\t:rowButton=\"rowButton\"\n\t\t\t:reviewSummary=\"reviewSummary\"\n\t\t\t:footnote=\"footnote\"\n\t\t\t:nameSecondary=\"nameSecondary\"\n\t\t\t:secondLine=\"secondLine\"\n\t\t\t:linkedItems=\"linkedItems\"\n\t\t\t:columns=\"columns\"\n\t\t\t:rowData=\"rowDataSource\"\n\t\t\t:preferenceApp=\"preferenceApp\"\n\t\t\t:preferenceKey=\"preferenceKey\"\n\t\t\t:bulkActions=\"bulkActions\"\n\t\t\t:toolbarSelectionActions=\"toolbarSelectionActions\"\n\t\t\t:selectionLabel=\"selectionLabel\"\n\t\t\t:selectionLabelOne=\"selectionLabelOne\"\n\t\t\t:showClearSelection=\"showClearSelection\"\n\t\t\t:sideCards=\"sideCards\"\n\t\t\t:sideCardsPlacement=\"sideCardsPlacement\"\n\t\t\t:groupBy=\"groupBy\"\n\t\t\t:facets=\"facets\"\n\t\t\t:facetPresentation=\"facetPresentation\"\n\t\t\t@changed=\"onBrowserChanged\" />\n\t\t<template v-else>\n\t\t\t<!-- Upload error -->\n\t\t\t<div v-if=\"uploadError\" class=\"cn-sidebar-tab__upload-error\">\n\t\t\t\t{{ uploadError }}\n\t\t\t</div>\n\n\t\t\t<!-- Share toggle — seeds from schema config (defaultAutoShare) or\n\t\t from the `defaultShare` prop. Hidden via `showShareToggle=false`. -->\n\t\t\t<NcCheckboxRadioSwitch\n\t\t\t\tv-if=\"showShareToggle\"\n\t\t\t\tv-model=\"share\"\n\t\t\t\tclass=\"cn-sidebar-tab__share\"\n\t\t\t\t:disabled=\"loading\"\n\t\t\t\ttype=\"switch\">\n\t\t\t\t{{ shareLabel }}\n\t\t\t</NcCheckboxRadioSwitch>\n\n\t\t\t<!-- File drop zone -->\n\t\t\t<div\n\t\t\t\tclass=\"cn-sidebar-tab__dropzone\"\n\t\t\t\t:class=\"{ 'cn-sidebar-tab__dropzone--active': isDragOver }\"\n\t\t\t\trole=\"button\"\n\t\t\t\ttabindex=\"0\"\n\t\t\t\t@click=\"triggerFileInput\"\n\t\t\t\t@keydown.enter.prevent=\"triggerFileInput\"\n\t\t\t\t@keydown.space.prevent=\"triggerFileInput\"\n\t\t\t\t@dragover.prevent=\"onDragOver\"\n\t\t\t\t@dragleave.prevent=\"onDragLeave\"\n\t\t\t\t@drop.prevent=\"onDrop\">\n\t\t\t\t<!--\n\t\t\t\t`:ref` (dynamic), not `ref` (static), and this is load-bearing.\n\n\t\t\t\tEvery other binding on this input is static, and Vue caches the\n\t\t\t\t`@change` handler, so with a STATIC ref the compiler hoists the\n\t\t\t\twhole vnode to module scope. A hoisted vnode is created once,\n\t\t\t\toutside any render, so its ref carries no owner instance\n\t\t\t\t(`rawRef.i === null`).\n\n\t\t\t\t`setRef()` guards that — but the guard AND its early `return`\n\t\t\t\tlive inside `if (process.env.NODE_ENV !== 'production')`. In a\n\t\t\t\tdevelopment build you get the warning \"Missing ref owner\n\t\t\t\tcontext. ref cannot be used on hoisted vnodes.\" and nothing\n\t\t\t\tbreaks. In a PRODUCTION build the guard is compiled out and\n\t\t\t\texecution falls through to `owner.refs`, throwing\n\t\t\t\t`TypeError: Cannot read properties of null (reading 'refs')`\n\t\t\t\t— which aborts the render of whatever mounted this tab.\n\n\t\t\t\tMeasured: hrmq's detail pages (the only pages in the fleet that\n\t\t\t\treach CnIntegrationWidget through a `widgets[]` grid) rendered a\n\t\t\t\tCOMPLETELY BLANK content pane in production while looking fine\n\t\t\t\tin dev. A dynamic ref is compiled as a patchable prop, so the\n\t\t\t\tvnode is created inside the render function and owns a proper\n\t\t\t\tinstance.\n\t\t\t-->\n\t\t\t\t<input\n\t\t\t\t\t:ref=\"fileInputRef\"\n\t\t\t\t\ttype=\"file\"\n\t\t\t\t\tmultiple\n\t\t\t\t\tclass=\"cn-sidebar-tab__file-input\"\n\t\t\t\t\t:aria-label=\"dropZoneLabel\"\n\t\t\t\t\t@change=\"onFileUpload\">\n\t\t\t\t<Upload :size=\"24\" class=\"cn-sidebar-tab__dropzone-icon\" />\n\t\t\t\t<span class=\"cn-sidebar-tab__dropzone-text\">{{ dropZoneLabel }}</span>\n\t\t\t</div>\n\n\t\t\t<!-- File list. Each row borrows what Nextcloud already has on this\n\t\t page: the theme's own mime icon (OC.MimeType), the core preview\n\t\t endpoint for images, the Viewer for opening, and the Files sidebar\n\t\t for details, sharing and versions. Nothing of the Files app is\n\t\t rebuilt here; the row hands over to it. -->\n\t\t\t<NcLoadingIcon v-if=\"loading\" />\n\t\t\t<NcEmptyContent\n\t\t\t\tv-else-if=\"files.length === 0\"\n\t\t\t\tclass=\"cn-sidebar-tab__empty\"\n\t\t\t\t:name=\"noFilesLabel\"\n\t\t\t\t:description=\"dropZoneLabel\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<Paperclip :size=\"44\" />\n\t\t\t\t</template>\n\t\t\t</NcEmptyContent>\n\t\t\t<div v-else class=\"cn-sidebar-tab__list\">\n\t\t\t\t<NcListItem\n\t\t\t\t\tv-for=\"file in files\"\n\t\t\t\t\t:key=\"file.id\"\n\t\t\t\t\t:name=\"file.name || file.title\"\n\t\t\t\t\t:bold=\"false\"\n\t\t\t\t\t:forceDisplayActions=\"true\"\n\t\t\t\t\t@click=\"openFile(file)\">\n\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t<img\n\t\t\t\t\t\t\tv-if=\"previewUrlFor(file)\"\n\t\t\t\t\t\t\tclass=\"cn-sidebar-tab__thumb\"\n\t\t\t\t\t\t\t:src=\"previewUrlFor(file)\"\n\t\t\t\t\t\t\talt=\"\"\n\t\t\t\t\t\t\tloading=\"lazy\"\n\t\t\t\t\t\t\t@error=\"onPreviewError(file)\">\n\t\t\t\t\t\t<img\n\t\t\t\t\t\t\tv-else-if=\"mimeIconFor(file)\"\n\t\t\t\t\t\t\tclass=\"cn-sidebar-tab__mime\"\n\t\t\t\t\t\t\t:src=\"mimeIconFor(file)\"\n\t\t\t\t\t\t\talt=\"\">\n\t\t\t\t\t\t<FileOutline v-else :size=\"32\" />\n\t\t\t\t\t</template>\n\t\t\t\t\t<template #subname>\n\t\t\t\t\t\t<span class=\"cn-sidebar-tab__meta\">\n\t\t\t\t\t\t\t<span>{{ formatFileSize(file.size) }}</span>\n\t\t\t\t\t\t\t<template v-if=\"modifiedAt(file)\">\n\t\t\t\t\t\t\t\t<span aria-hidden=\"true\"> · </span>\n\t\t\t\t\t\t\t\t<NcDateTime :timestamp=\"modifiedAt(file)\" :ignoreSeconds=\"true\" />\n\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t\t<template v-if=\"labelsOf(file)\">\n\t\t\t\t\t\t\t\t<span aria-hidden=\"true\"> · </span>\n\t\t\t\t\t\t\t\t<span>{{ labelsOf(file) }}</span>\n\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</template>\n\t\t\t\t\t<template #actions>\n\t\t\t\t\t\t<NcActionButton :closeAfterClick=\"true\" @click=\"openFile(file)\">\n\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t<OpenInNew :size=\"20\" />\n\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t\t{{ openLabel }}\n\t\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t\t<!-- OpenRegister's Office page applies the object rule:\n\t\t\t\t\t\t update edits, read views, no read is a 404. -->\n\t\t\t\t\t\t<NcActionLink\n\t\t\t\t\t\t\tv-if=\"officeOpens(file)\"\n\t\t\t\t\t\t\t:href=\"officeUrlFor(file)\"\n\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t:closeAfterClick=\"true\">\n\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t<FileDocumentEditOutline :size=\"20\" />\n\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t\t{{ openInOfficeLabel }}\n\t\t\t\t\t\t</NcActionLink>\n\t\t\t\t\t\t<NcActionLink\n\t\t\t\t\t\t\tv-if=\"file.id\"\n\t\t\t\t\t\t\t:href=\"downloadUrlFor(file)\"\n\t\t\t\t\t\t\t:download=\"file.name || file.title || ''\"\n\t\t\t\t\t\t\t:closeAfterClick=\"true\">\n\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t<Download :size=\"20\" />\n\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t\t{{ downloadLabel }}\n\t\t\t\t\t\t</NcActionLink>\n\t\t\t\t\t\t<NcActionButton\n\t\t\t\t\t\t\tv-if=\"canShowDetails() && file.path\"\n\t\t\t\t\t\t\t:closeAfterClick=\"true\"\n\t\t\t\t\t\t\t@click=\"showDetails(file)\">\n\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t<InformationOutline :size=\"20\" />\n\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t\t{{ detailsLabel }}\n\t\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t\t<NcActionLink\n\t\t\t\t\t\t\tv-if=\"file.id\"\n\t\t\t\t\t\t\t:href=\"showInFilesUrl(file)\"\n\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t:closeAfterClick=\"true\">\n\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t<FolderOutline :size=\"20\" />\n\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t\t{{ showInFilesLabel }}\n\t\t\t\t\t\t</NcActionLink>\n\t\t\t\t\t\t<NcActionButton v-if=\"file.id\" :closeAfterClick=\"true\" @click=\"copyLink(file)\">\n\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t<LinkVariant :size=\"20\" />\n\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t\t{{ copyLinkLabel }}\n\t\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t\t<NcActionSeparator />\n\t\t\t\t\t\t<NcActionButton :closeAfterClick=\"true\" @click=\"deleteFile(file)\">\n\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t<Delete :size=\"20\" />\n\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t\t{{ deleteLabel }}\n\t\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t</template>\n\t\t\t\t</NcListItem>\n\t\t\t</div>\n\t\t\t<NcButton\n\t\t\t\tv-if=\"files.length < total\"\n\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t:wide=\"true\"\n\t\t\t\t:disabled=\"loadingMore\"\n\t\t\t\tclass=\"cn-sidebar-tab__load-more\"\n\t\t\t\t@click=\"loadMore\">\n\t\t\t\t<template v-if=\"loadingMore\" #icon>\n\t\t\t\t\t<NcLoadingIcon :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\t{{ loadMoreLabel }}\n\t\t\t</NcButton>\n\t\t</template>\n\t\t<CnFilePreview v-if=\"previewFile\" :file=\"previewFile\" @close=\"previewFile = null\" />\n\t</div>\n</template>\n\n<script>\nimport { getCurrentUser } from '@nextcloud/auth'\nimport axios from '@nextcloud/axios'\nimport { getCapabilities } from '@nextcloud/capabilities'\nimport { translate as t } from '@nextcloud/l10n'\nimport { generateRemoteUrl, generateUrl } from '@nextcloud/router'\nimport {\n\tNcActionButton,\n\tNcActionLink,\n\tNcActionSeparator,\n\tNcButton,\n\tNcCheckboxRadioSwitch,\n\tNcDateTime,\n\tNcEmptyContent,\n\tNcListItem,\n\tNcLoadingIcon,\n} from '@nextcloud/vue'\nimport Delete from 'vue-material-design-icons/Delete.vue'\nimport Download from 'vue-material-design-icons/Download.vue'\nimport FileDocumentEditOutline from 'vue-material-design-icons/FileDocumentEditOutline.vue'\nimport FileOutline from 'vue-material-design-icons/FileOutline.vue'\nimport FolderOutline from 'vue-material-design-icons/FolderOutline.vue'\nimport InformationOutline from 'vue-material-design-icons/InformationOutline.vue'\nimport LinkVariant from 'vue-material-design-icons/LinkVariant.vue'\nimport OpenInNew from 'vue-material-design-icons/OpenInNew.vue'\nimport Paperclip from 'vue-material-design-icons/Paperclip.vue'\nimport Upload from 'vue-material-design-icons/Upload.vue'\nimport CnFilePreview from '../CnFilePreview/CnFilePreview.vue'\nimport CnFilesBrowser from '../CnFilesBrowser/CnFilesBrowser.vue'\nimport { useFileOpener } from '../../composables/useFileOpener.js'\nimport { buildHeaders, prefixUrl } from '../../utils/index.js'\nimport { indexRowData, objectDisplayName, resolveObjectFolderInfo } from '../CnFilesBrowser/filesBrowser.js'\nimport { createOpenRegisterSource } from '../CnFilesBrowser/openRegisterSource.js'\n\n/**\n * The mime types Nextcloud Office opens by default for the current person.\n *\n * richdocuments publishes its capabilities only to a person it lets use\n * Office, so an empty list means no Office here, or none for them.\n *\n * @return {Array<string>} The mime types, or an empty list.\n */\nfunction readOfficeMimetypes() {\n\ttry {\n\t\tconst mimetypes = getCapabilities()?.richdocuments?.mimetypes\n\t\treturn Array.isArray(mimetypes) ? mimetypes.filter((mime) => typeof mime === 'string') : []\n\t} catch {\n\t\treturn []\n\t}\n}\n\nexport default {\n\tname: 'CnFilesTab',\n\n\tcomponents: {\n\t\tCnFilePreview,\n\t\tCnFilesBrowser,\n\t\tNcActionButton,\n\t\tNcActionLink,\n\t\tNcActionSeparator,\n\t\tNcButton,\n\t\tNcCheckboxRadioSwitch,\n\t\tNcDateTime,\n\t\tNcEmptyContent,\n\t\tNcListItem,\n\t\tNcLoadingIcon,\n\t\tDelete,\n\t\tDownload,\n\t\tFileDocumentEditOutline,\n\t\tFileOutline,\n\t\tFolderOutline,\n\t\tInformationOutline,\n\t\tLinkVariant,\n\t\tOpenInNew,\n\t\tPaperclip,\n\t\tUpload,\n\t},\n\n\tprops: {\n\t\t/** ID of the object this tab belongs to */\n\t\tobjectId: { type: String, required: true },\n\t\t/** OpenRegister register slug */\n\t\tregister: { type: String, default: '' },\n\t\t/** JSON Schema definition for the object */\n\t\tschema: { type: String, default: '' },\n\t\t/** Base URL for the OpenRegister API */\n\t\tapiBase: { type: String, default: '/apps/openregister/api' },\n\t\t/** Text shown inside the file drop zone */\n\t\tdropZoneLabel: { type: String, default: () => t('nextcloud-vue', 'Drop files here or click to browse') },\n\t\t/** Text shown when no files are attached */\n\t\tnoFilesLabel: { type: String, default: () => t('nextcloud-vue', 'No files attached') },\n\t\t/** Label for the open/view file action */\n\t\topenLabel: { type: String, default: () => t('nextcloud-vue', 'Open') },\n\t\t/**\n\t\t * Label of the action that opens a document in Nextcloud Office through\n\t\t * OpenRegister's Office page. Shown only when Office is there for this\n\t\t * person and opens the file's type; the page opens it for editing or\n\t\t * read-only by the object's own rule.\n\t\t */\n\t\topenInOfficeLabel: { type: String, default: () => t('nextcloud-vue', 'Open in Office') },\n\t\t/** Label for the delete action */\n\t\tdeleteLabel: { type: String, default: () => t('nextcloud-vue', 'Delete') },\n\t\t/** What the files browser's root crumb reads; null shows the object's name, else the folder's own name. */\n\t\tbrowserRootLabel: { type: String, default: null },\n\t\t/**\n\t\t * Where the files browser reads the object's folder from.\n\t\t * `openregister` (the default) goes through OpenRegister's files API under\n\t\t * the object's access rule, so anyone who may read the object sees its\n\t\t * files, without a share. `webdav` is the earlier behaviour: the folder is\n\t\t * looked up in the person's own Files over WebDAV and the browser shows\n\t\t * only when it is shared with them.\n\t\t */\n\t\tsource: {\n\t\t\ttype: String,\n\t\t\tdefault: 'openregister',\n\t\t\tvalidator: (value) => ['openregister', 'webdav'].includes(value),\n\t\t},\n\n\t\t/** Forwarded to CnFilesBrowser: a primary \"Add files\" button beside the New menu. */\n\t\tuploadButton: { type: Boolean, default: false },\n\t\t/** Whether the bar has the New menu; `false` leaves it out (CnFilesBrowser `newMenu`). */\n\t\tnewMenu: { type: Boolean, default: true },\n\t\t/** Whether the bar has a New folder button (CnFilesBrowser `folderButton`). */\n\t\tfolderButton: { type: Boolean, default: false },\n\t\t/** Forwarded to CnFilesBrowser: the drop state drawn over the list (\"Drop to add\") and announced. */\n\t\tdropOverlay: { type: Boolean, default: false },\n\t\t/** Forwarded to CnFilesBrowser: the drop state's line (\"Laat los om toe te voegen\"); the library's own without it. */\n\t\tdropLabel: { type: String, default: undefined },\n\t\t/** Forwarded to CnFilesBrowser: the drop state's second line, `{count}` the files dragged; it also makes the overlay fill the panel. */\n\t\tdropDetail: { type: [String, Array], default: '' },\n\t\t/** Forwarded to CnFilesBrowser: named values filled into `dropDetail`. */\n\t\tdropDetailValues: { type: Object, default: null },\n\t\t/** Forwarded to CnFilesBrowser: \"Or drag files onto this list.\" under the list. */\n\t\tdropHint: { type: Boolean, default: false },\n\t\t/**\n\t\t * The host's own actions on each file row of the browser, forwarded\n\t\t * to CnFilesBrowser's `rowActions`: declared like any manifest action\n\t\t * and dispatched with the file's id, name and path merged in.\n\t\t *\n\t\t * @type {Array<{id: string, label: string, icon?: string, type?: string, target?: string, props?: object}>}\n\t\t */\n\t\trowActions: { type: Array, default: () => [] },\n\t\t/**\n\t\t * The host's own entries in the browser's New menu, forwarded to\n\t\t * CnFilesBrowser's `newActions`: declared like a row action and\n\t\t * dispatched with the folder rather than a row, for things like\n\t\t * \"new from template\" or \"request a file from a party\".\n\t\t *\n\t\t * @type {Array<{id: string, label: string, icon?: string, type?: string, target?: string, props?: object}>}\n\t\t */\n\t\tnewActions: { type: Array, default: () => [] },\n\t\t/**\n\t\t * An app endpoint that answers the object's linked files, rows the\n\t\t * browser shows after the folder's own (files the host joined from\n\t\t * another object's folder). App-relative; `{objectId}` is replaced.\n\t\t * The response is an array (or `{ items: [] }`) of\n\t\t * `{ id, name, mime?, size?, mtime?, href?, downloadHref?, note?, noteHref? }`.\n\t\t * Null fetches nothing.\n\t\t */\n\t\tlinkedItemsUrl: { type: String, default: null },\n\t\t/**\n\t\t * Forwarded to CnFilesBrowser: the columns the browser shows, built-in\n\t\t * names or declared columns (`{ key, label, source, formatter }`).\n\t\t * A `source: 'row'` column reads the host's record for the file from\n\t\t * `rowDataUrl`. None keeps name, size and modified.\n\t\t *\n\t\t * @type {Array<string|object>}\n\t\t */\n\t\tcolumns: { type: Array, default: () => [] },\n\t\t/** Forwarded to CnFilesBrowser: the app id the user's column choice is stored under; unset offers no Columns chooser. */\n\t\tpreferenceApp: { type: String, default: '' },\n\t\t/** Forwarded to CnFilesBrowser: the key the column choice is stored under. */\n\t\tpreferenceKey: { type: String, default: 'files-browser-columns' },\n\t\t/**\n\t\t * An app endpoint that answers the host's own record per file, for the\n\t\t * browser's `source: 'row'` columns. App-relative; `{objectId}` is\n\t\t * replaced. Read once per listing. The answer is a list of records\n\t\t * (or the list at `rowDataPath`, or under `items` or `results`), each\n\t\t * naming its file in `rowDataKey`. Null reads nothing.\n\t\t */\n\t\trowDataUrl: { type: String, default: null },\n\t\t/**\n\t\t * Forwarded to CnFilesBrowser: the host's actions on a selection of\n\t\t * files. With at least one, files get checkboxes and a bulk bar.\n\t\t *\n\t\t * @type {Array<{id: string, label: string, icon?: string, type?: string, target?: string, props?: object}>}\n\t\t */\n\t\tbulkActions: { type: Array, default: () => [] },\n\t\t/** Forwarded to CnFilesBrowser: bulk actions as toolbar buttons, off while nothing is ticked. */\n\t\ttoolbarSelectionActions: { type: Array, default: () => [] },\n\t\t/** Forwarded to CnFilesBrowser: the bulk bar's count, a template with `{count}`. */\n\t\tselectionLabel: { type: String, default: '' },\n\t\t/** Forwarded to CnFilesBrowser: the bulk bar's count for one file. */\n\t\tselectionLabelOne: { type: String, default: '' },\n\t\t/** Forwarded to CnFilesBrowser: whether the bulk bar ends in \"Clear selection\". */\n\t\tshowClearSelection: { type: Boolean, default: true },\n\t\t/**\n\t\t * Forwarded to CnFilesBrowser: cards beside the list about the last\n\t\t * selected file.\n\t\t *\n\t\t * @type {Array<{id: string, title: string, fields?: Array<object>, actions?: Array<object>}>}\n\t\t */\n\t\tsideCards: { type: Array, default: () => [] },\n\t\t/** Forwarded to CnFilesBrowser: `page-side` puts the side cards in the detail page's side column. */\n\t\tsideCardsPlacement: { type: String, default: 'beside' },\n\t\t/** Forwarded to CnFilesBrowser: the key of a declared column to group the files on. */\n\t\tgroupBy: { type: String, default: '' },\n\t\t/**\n\t\t * Forwarded to CnFilesBrowser: keys of declared columns to filter on,\n\t\t * a chip per value in use.\n\t\t *\n\t\t * @type {string[]}\n\t\t */\n\t\tfacets: { type: Array, default: () => [] },\n\t\t/** How the facets are drawn: `chips` or `menu` (CnFilesBrowser `facetPresentation`). */\n\t\tfacetPresentation: { type: String, default: 'chips' },\n\t\t/** Forwarded to CnFilesBrowser: the host's own buttons in the bar. */\n\t\theaderActions: { type: Array, default: () => [] },\n\t\t/** Forwarded to CnFilesBrowser: one visible button on every file row. */\n\t\trowButton: { type: Object, default: null },\n\t\t/** Forwarded to CnFilesBrowser: the review summary above the list. */\n\t\treviewSummary: { type: Object, default: null },\n\t\t/** Forwarded to CnFilesBrowser: the host's own line under the list. */\n\t\tfootnote: { type: String, default: '' },\n\t\t/** Forwarded to CnFilesBrowser: the second line under each file's name. */\n\t\tnameSecondary: { type: String, default: '' },\n\t\t/** Forwarded to CnFilesBrowser: the second line as a list of fields, or variants. */\n\t\tsecondLine: { type: Array, default: null },\n\t\t/** A dotted path to the list of records in the `rowDataUrl` answer; empty reads the answer itself. */\n\t\trowDataPath: { type: String, default: '' },\n\t\t/** The record field that holds the Nextcloud file id. */\n\t\trowDataKey: { type: String, default: 'fileId' },\n\t\t/** Label of the Download action. */\n\t\tdownloadLabel: { type: String, default: () => t('nextcloud-vue', 'Download') },\n\t\t/** Label of the action that opens the Files sidebar on the file. */\n\t\tdetailsLabel: { type: String, default: () => t('nextcloud-vue', 'Details and sharing') },\n\t\t/** Label of the link that opens the file in the Files app. */\n\t\tshowInFilesLabel: { type: String, default: () => t('nextcloud-vue', 'Show in Files') },\n\t\t/** Label of the action that copies the file permalink. */\n\t\tcopyLinkLabel: { type: String, default: () => t('nextcloud-vue', 'Copy link') },\n\t\t/** Label for the load-more button */\n\t\tloadMoreLabel: { type: String, default: () => t('nextcloud-vue', 'Load more') },\n\t\t/**\n\t\t * Whether to render the \"share uploaded files\" toggle. Off by default;\n\t\t * when false, uploads never set the share flag (no auto-publish).\n\t\t *\n\t\t * @type {boolean}\n\t\t */\n\t\tshowShareToggle: { type: Boolean, default: false },\n\t\t/**\n\t\t * Initial state for the share toggle. `true`/`false` wins outright;\n\t\t * `null` (the default) defers to the schema's\n\t\t * `configuration.defaultAutoShare` from OpenRegister.\n\t\t *\n\t\t * @type {boolean|null}\n\t\t */\n\t\tdefaultShare: { type: Boolean, default: null },\n\t\t/** Label for the share toggle */\n\t\tshareLabel: { type: String, default: () => t('nextcloud-vue', 'Share uploaded files') },\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\tpreviewFile: null,\n\t\t\tfiles: [],\n\t\t\tloading: false,\n\t\t\tloadingMore: false,\n\t\t\tisDragOver: false,\n\t\t\tuploadError: '',\n\t\t\tpage: 1,\n\t\t\ttotal: 0,\n\t\t\tlimit: 20,\n\t\t\tshare: false,\n\t\t\t/** The object's folder as a user-relative path, or null while unresolved or absent. */\n\t\t\tbrowserRoot: null,\n\t\t\t/** The browser's data source for `source: 'openregister'`, or null for WebDAV. */\n\t\t\tbrowserSource: null,\n\t\t\tbrowserObjectName: null,\n\t\t\tlinkedItems: [],\n\t\t\t/** File ids whose preview request failed, so the row falls back to the mime icon. */\n\t\t\tpreviewFailed: {},\n\t\t\t/**\n\t\t\t * The file input element, set by the template's function ref.\n\t\t\t *\n\t\t\t * Held here rather than read back through `$refs` so the ref stays\n\t\t\t * DYNAMIC — see the long comment on the input itself for why a\n\t\t\t * static ref on this element is a production crash.\n\t\t\t *\n\t\t\t * @type {HTMLInputElement|null}\n\t\t\t */\n\t\t\tfileInputEl: null,\n\t\t\t/** The mime types Nextcloud Office opens for this person; empty without Office. */\n\t\t\tofficeMimetypes: readOfficeMimetypes(),\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/**\n\t\t * The browser's `rowData`: a function that reads the host's records\n\t\t * from `rowDataUrl` and keys them by file id, or null without a url.\n\t\t * The browser calls it once per listing.\n\t\t *\n\t\t * @return {(function(): Promise<object>)|null} The row data source.\n\t\t * @spec openspec/changes/files-browser-hosts-a-documents-list/specs/files-browser/spec.md\n\t\t */\n\t\trowDataSource() {\n\t\t\tif (!this.rowDataUrl || !this.objectId) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tconst url = generateUrl(this.rowDataUrl.replace('{objectId}', encodeURIComponent(this.objectId)))\n\t\t\tconst path = this.rowDataPath\n\t\t\tconst key = this.rowDataKey\n\t\t\treturn async () => {\n\t\t\t\tconst { data } = await axios.get(url)\n\t\t\t\treturn indexRowData(data, { path, key })\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * The root crumb: the host's label, else the object's name (its folder\n\t\t * on disk is called after its uuid), else the folder's own name.\n\t\t *\n\t\t * @return {string|null}\n\t\t * @spec openspec/changes/dutch-library-strings-and-files-crumb/specs/dutch-library-strings-and-files-crumb/spec.md#requirement-the-files-browser-names-the-object-in-its-root-crumb\n\t\t */\n\t\teffectiveBrowserRootLabel() {\n\t\t\treturn this.browserRootLabel || this.browserObjectName || null\n\t\t},\n\t},\n\n\twatch: {\n\t\t// Match every other CnObjectSidebar tab — a single immediate\n\t\t// `objectId` watcher drives all initial loads. Folding the\n\t\t// share-toggle seed in here avoids two concurrent GETs of\n\t\t// `schemas/{schema}` on mount (one per immediate watcher).\n\t\tobjectId: {\n\t\t\timmediate: true,\n\t\t\thandler(id) {\n\t\t\t\tif (id) {\n\t\t\t\t\tthis.fetchFiles()\n\t\t\t\t}\n\t\t\t\tthis.applyShareDefault()\n\t\t\t\tthis.resolveBrowserRoot()\n\t\t\t\tthis.fetchLinkedItems()\n\t\t\t},\n\t\t},\n\n\t\tlinkedItemsUrl() {\n\t\t\tthis.fetchLinkedItems()\n\t\t},\n\n\t\tsource() {\n\t\t\tthis.resolveBrowserRoot()\n\t\t},\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Function ref for the file input.\n\t\t *\n\t\t * A method (not an inline arrow in the template) so the binding is a\n\t\t * stable reference across renders and Vue does not detach/reattach the\n\t\t * ref on every patch. Being a function ref is what keeps the vnode\n\t\t * dynamic — see the template comment on the input.\n\t\t *\n\t\t * @param {HTMLInputElement|null} el The element, or null on unmount.\n\t\t * @return {void}\n\t\t */\n\t\tfileInputRef(el) {\n\t\t\tthis.fileInputEl = el || null\n\t\t},\n\n\t\t/**\n\t\t * Find the object's folder for the browser, or leave the legacy list.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t */\n\t\t/**\n\t\t * The browser changed the folder: refresh the object's file list and\n\t\t * the linked rows, since a join or a move can change either.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tonBrowserChanged() {\n\t\t\tthis.fetchFiles()\n\t\t\tthis.fetchLinkedItems()\n\t\t},\n\n\t\t/**\n\t\t * Read the object's linked files from the host's endpoint, if any.\n\t\t *\n\t\t * A failure leaves the last list in place and logs at debug: the\n\t\t * folder's own rows are the surface, the linked rows a supplement.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync fetchLinkedItems() {\n\t\t\tif (!this.linkedItemsUrl || !this.objectId) {\n\t\t\t\tthis.linkedItems = []\n\t\t\t\treturn\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tconst url = generateUrl(this.linkedItemsUrl.replace('{objectId}', encodeURIComponent(this.objectId)))\n\t\t\t\tconst { data } = await axios.get(url)\n\t\t\t\tconst items = Array.isArray(data) ? data : (Array.isArray(data?.items) ? data.items : [])\n\t\t\t\tthis.linkedItems = items.filter((item) => item && typeof item === 'object')\n\t\t\t} catch (error) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.debug('[CnFilesTab] linked items not read', error)\n\t\t\t}\n\t\t},\n\n\t\tasync resolveBrowserRoot() {\n\t\t\tthis.browserRoot = null\n\t\t\tthis.browserSource = null\n\t\t\tthis.browserObjectName = null\n\t\t\tif (!this.objectId || !this.register || !this.schema) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (this.source === 'openregister') {\n\t\t\t\tawait this.resolveOpenRegisterSource()\n\t\t\t\treturn\n\t\t\t}\n\t\t\tlet remoteUrl\n\t\t\ttry {\n\t\t\t\tremoteUrl = generateRemoteUrl('dav')\n\t\t\t} catch {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst info = await resolveObjectFolderInfo({\n\t\t\t\tapiBase: this.apiBase,\n\t\t\t\tregister: this.register,\n\t\t\t\tschema: this.schema,\n\t\t\t\tobjectId: this.objectId,\n\t\t\t\tuid: getCurrentUser()?.uid || '',\n\t\t\t\tremoteUrl,\n\t\t\t})\n\t\t\tthis.browserRoot = info === null ? null : info.path\n\t\t\tthis.browserObjectName = info === null ? null : info.name\n\t\t},\n\n\t\t/**\n\t\t * Use OpenRegister's files API for the browser, when this person may read\n\t\t * the object's folder through it. A listing that fails (no read on the\n\t\t * object, or an OpenRegister without the folder endpoints) leaves the\n\t\t * legacy list, as an unresolved WebDAV folder did.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t * @spec openspec/changes/files-browser-openregister-source/specs/files-browser/spec.md\n\t\t */\n\t\tasync resolveOpenRegisterSource() {\n\t\t\tconst objectId = this.objectId\n\t\t\tconst source = createOpenRegisterSource({\n\t\t\t\tapiBase: this.apiBase,\n\t\t\t\tregister: this.register,\n\t\t\t\tschema: this.schema,\n\t\t\t\tobjectId,\n\t\t\t})\n\t\t\ttry {\n\t\t\t\tawait source.list('/')\n\t\t\t} catch {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (objectId !== this.objectId) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.browserSource = source\n\t\t\tthis.browserRoot = '/'\n\t\t\tthis.fetchObjectName()\n\t\t},\n\n\t\t/**\n\t\t * Read the object's name for the root crumb, by the same rule the WebDAV\n\t\t * path uses (`objectDisplayName`: never the uuid). The OpenRegister path\n\t\t * has no folder lookup to piggyback on, so this is its one object read.\n\t\t * A failure keeps the crumb on its default.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync fetchObjectName() {\n\t\t\tconst objectId = this.objectId\n\t\t\ttry {\n\t\t\t\tconst { data } = await axios.get(generateUrl(`${this.apiBase}/objects/{register}/{schema}/{objectId}`, {\n\t\t\t\t\tregister: this.register,\n\t\t\t\t\tschema: this.schema,\n\t\t\t\t\tobjectId,\n\t\t\t\t}))\n\t\t\t\tif (objectId === this.objectId) {\n\t\t\t\t\tthis.browserObjectName = objectDisplayName(data, objectId)\n\t\t\t\t}\n\t\t\t} catch {\n\t\t\t\t// The crumb keeps its default.\n\t\t\t}\n\t\t},\n\n\t\tasync fetchFiles(append = false) {\n\t\t\tif (!this.register || !this.schema) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (append) {\n\t\t\t\tthis.loadingMore = true\n\t\t\t} else {\n\t\t\t\tthis.loading = true\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tconst params = new URLSearchParams({ limit: this.limit, _page: this.page })\n\t\t\t\tconst response = await fetch(\n\t\t\t\t\tprefixUrl(`${this.apiBase}/objects/${this.register}/${this.schema}/${this.objectId}/files?${params}`),\n\t\t\t\t\t{ headers: buildHeaders() },\n\t\t\t\t)\n\t\t\t\tif (response.ok) {\n\t\t\t\t\tconst data = await response.json()\n\t\t\t\t\tconst results = data.results || data || []\n\t\t\t\t\tthis.files = append ? [...this.files, ...results] : results\n\t\t\t\t\tthis.total = data.total || this.files.length\n\t\t\t\t}\n\t\t\t} catch (err) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.error('CnFilesTab: Failed to fetch files', err)\n\t\t\t} finally {\n\t\t\t\tthis.loading = false\n\t\t\t\tthis.loadingMore = false\n\t\t\t}\n\t\t},\n\n\t\tloadMore() {\n\t\t\tthis.page++\n\t\t\tthis.fetchFiles(true)\n\t\t},\n\n\t\t/**\n\t\t * Seed the `share` toggle. The `defaultShare` prop wins when set\n\t\t * (non-null); otherwise we look up the active schema's\n\t\t * `configuration.defaultAutoShare` from OpenRegister and use that.\n\t\t * Network failure or missing key → keep the safe default (false) so\n\t\t * a hiccup never silently flips uploads to \"share\".\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync applyShareDefault() {\n\t\t\tif (this.defaultShare !== null && this.defaultShare !== undefined) {\n\t\t\t\tthis.share = !!this.defaultShare\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.share = false\n\t\t\tif (!this.schema) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tconst response = await fetch(\n\t\t\t\t\tprefixUrl(`${this.apiBase}/schemas/${this.schema}`),\n\t\t\t\t\t{ headers: buildHeaders() },\n\t\t\t\t)\n\t\t\t\tif (!response.ok) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tconst data = await response.json().catch(() => null)\n\t\t\t\tif (data?.configuration?.defaultAutoShare === true) {\n\t\t\t\t\tthis.share = true\n\t\t\t\t}\n\t\t\t} catch (err) {\n\t\t\t\t// Non-fatal — keep the safe default, but surface the\n\t\t\t\t// failure so a missing toggle default isn't silent.\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.error('CnFilesTab: Failed to fetch schema default for share toggle', err)\n\t\t\t}\n\t\t},\n\n\t\ttriggerFileInput() {\n\t\t\tthis.fileInputEl?.click()\n\t\t},\n\n\t\tonDragOver() {\n\t\t\tthis.isDragOver = true\n\t\t},\n\n\t\tonDragLeave() {\n\t\t\tthis.isDragOver = false\n\t\t},\n\n\t\tonDrop(event) {\n\t\t\tthis.isDragOver = false\n\t\t\tconst droppedFiles = event.dataTransfer?.files\n\t\t\tif (droppedFiles?.length) {\n\t\t\t\tthis.uploadFiles(droppedFiles)\n\t\t\t}\n\t\t},\n\n\t\tasync onFileUpload(event) {\n\t\t\tconst inputFiles = event.target.files\n\t\t\tif (!inputFiles?.length) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tawait this.uploadFiles(inputFiles)\n\t\t\tif (this.fileInputEl) {\n\t\t\t\tthis.fileInputEl.value = ''\n\t\t\t}\n\t\t},\n\n\t\tasync uploadFiles(fileList) {\n\t\t\tif (!fileList?.length || !this.register || !this.schema) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.uploadError = ''\n\t\t\tconst formData = new FormData()\n\t\t\tfor (const file of fileList) {\n\t\t\t\tformData.append('files[]', file)\n\t\t\t}\n\t\t\t// Only forward the share flag when the toggle is actually visible.\n\t\t\t// Hiding the toggle (showShareToggle=false) means \"don't auto-publish\".\n\t\t\tif (this.showShareToggle) {\n\t\t\t\tformData.append('share', String(this.share))\n\t\t\t}\n\n\t\t\tthis.loading = true\n\t\t\ttry {\n\t\t\t\tconst response = await fetch(\n\t\t\t\t\tprefixUrl(`${this.apiBase}/objects/${this.register}/${this.schema}/${this.objectId}/filesMultipart`),\n\t\t\t\t\t{\n\t\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\t\theaders: { requesttoken: OC?.requestToken || '', 'OCS-APIREQUEST': 'true' },\n\t\t\t\t\t\tbody: formData,\n\t\t\t\t\t},\n\t\t\t\t)\n\t\t\t\tif (!response.ok) {\n\t\t\t\t\tconst data = await response.json().catch(() => ({}))\n\t\t\t\t\tthis.uploadError = data.error || `Upload failed (${response.status})`\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tawait this.fetchFiles()\n\t\t\t} catch (err) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.error('CnFilesTab: Failed to upload file', err)\n\t\t\t\tthis.uploadError = 'Upload failed: could not connect to server'\n\t\t\t} finally {\n\t\t\t\tthis.loading = false\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Whether the Files app's details sidebar is on this page.\n\t\t *\n\t\t * It is when the host page dispatched Nextcloud's `LoadSidebar` event\n\t\t * server-side; then `OCA.Files.Sidebar.open(path)` shows the same\n\t\t * sharing, versions, comments and activity tabs the Files app shows.\n\t\t * Absent, the row offers no details action rather than a dead one. A\n\t\t * method rather than a computed: the global is not reactive, so a\n\t\t * cached answer from before the sidebar script ran would stay wrong.\n\t\t *\n\t\t * @return {boolean} true when the sidebar can be opened.\n\t\t */\n\t\tcanShowDetails() {\n\t\t\treturn typeof window !== 'undefined' && typeof window.OCA?.Files?.Sidebar?.open === 'function'\n\t\t},\n\n\t\t/**\n\t\t * The file's path relative to the user's files root, which is the path\n\t\t * the Viewer and the Files sidebar take. OpenRegister reports the node's\n\t\t * full path (`/{uid}/files/…`), so the first two segments come off.\n\t\t *\n\t\t * @param {string} path The node path as OpenRegister reports it.\n\t\t * @return {string} The user-relative path, `/` at least.\n\t\t */\n\t\tuserRelativePath(path) {\n\t\t\tconst stripped = String(path || '').replace(/^\\/[^/]+\\/files(?=\\/|$)/, '')\n\t\t\treturn stripped === '' ? '/' : stripped\n\t\t},\n\n\t\t/**\n\t\t * The theme's own icon for the file's mime type, the one the Files app\n\t\t * draws, or null on a page without Nextcloud's core script.\n\t\t *\n\t\t * @param {object} file The file row.\n\t\t * @return {string|null} The icon url.\n\t\t */\n\t\tmimeIconFor(file) {\n\t\t\tconst getIconUrl = typeof window !== 'undefined' ? window.OC?.MimeType?.getIconUrl : null\n\t\t\tif (typeof getIconUrl !== 'function') {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tconst mime = file.type || file.mimetype || file.mimeType || ''\n\t\t\ttry {\n\t\t\t\treturn getIconUrl(mime) || null\n\t\t\t} catch {\n\t\t\t\treturn null\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * A small preview for an image, through Nextcloud's core preview\n\t\t * endpoint, or null for anything else or after the preview failed once.\n\t\t *\n\t\t * @param {object} file The file row.\n\t\t * @return {string|null} The preview url.\n\t\t */\n\t\tpreviewUrlFor(file) {\n\t\t\tconst mime = file.type || file.mimetype || file.mimeType || ''\n\t\t\tif (!file.id || !/^image\\//i.test(mime) || /svg/i.test(mime) || this.previewFailed[file.id]) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\treturn generateUrl('/core/preview?fileId={fileId}&x=64&y=64&a=1', { fileId: file.id })\n\t\t},\n\n\t\t/**\n\t\t * Remember that a preview did not load, so the row shows the mime icon.\n\t\t *\n\t\t * @param {object} file The file row.\n\t\t * @return {void}\n\t\t */\n\t\tonPreviewError(file) {\n\t\t\tthis.previewFailed = { ...this.previewFailed, [file.id]: true }\n\t\t},\n\n\t\t/**\n\t\t * The file's modification moment as a Date, or null when unknown.\n\t\t *\n\t\t * @param {object} file The file row.\n\t\t * @return {Date|null} The moment.\n\t\t */\n\t\tmodifiedAt(file) {\n\t\t\tconst raw = file.modified || file.updated || ''\n\t\t\tif (!raw) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tconst date = new Date(raw)\n\t\t\treturn Number.isNaN(date.getTime()) ? null : date\n\t\t},\n\n\t\t/**\n\t\t * The file's labels (Nextcloud tags), joined for the meta line.\n\t\t *\n\t\t * @param {object} file The file row.\n\t\t * @return {string} The labels, or the empty string.\n\t\t */\n\t\tlabelsOf(file) {\n\t\t\treturn Array.isArray(file.labels) ? file.labels.filter(Boolean).join(', ') : ''\n\t\t},\n\n\t\t/**\n\t\t * The download url for a file, through OpenRegister's file endpoint,\n\t\t * which streams the node the object owns.\n\t\t *\n\t\t * @param {object} file The file row.\n\t\t * @return {string} The url.\n\t\t */\n\t\tdownloadUrlFor(file) {\n\t\t\treturn `${this.apiBase}/files/${encodeURIComponent(String(file.id))}/download`\n\t\t},\n\n\t\t/**\n\t\t * Whether Nextcloud Office opens this file for this person.\n\t\t *\n\t\t * @param {object} file The file row.\n\t\t * @return {boolean} true when the Office action applies.\n\t\t */\n\t\tofficeOpens(file) {\n\t\t\tconst mime = file.type || file.mimetype || file.mimeType || ''\n\t\t\treturn Boolean(file.id) && mime !== '' && this.officeMimetypes.includes(mime)\n\t\t},\n\n\t\t/**\n\t\t * OpenRegister's Office page for a file of this object, which checks the\n\t\t * object rule and opens the document editable or read-only.\n\t\t *\n\t\t * @param {object} file The file row.\n\t\t * @return {string} The url.\n\t\t */\n\t\tofficeUrlFor(file) {\n\t\t\tconst appBase = /\\/api\\/?$/.test(this.apiBase) ? this.apiBase.replace(/\\/api\\/?$/, '') : '/apps/openregister'\n\t\t\tconst segments = [this.register, this.schema, this.objectId, String(file.id)].map((part) => encodeURIComponent(String(part)))\n\t\t\treturn prefixUrl(`${appBase}/office/${segments.join('/')}`)\n\t\t},\n\n\t\t/**\n\t\t * The Files app's permalink for a file: opens the Files app at the\n\t\t * file's folder with the file selected.\n\t\t *\n\t\t * @param {object} file The file row.\n\t\t * @return {string} The url.\n\t\t */\n\t\tshowInFilesUrl(file) {\n\t\t\treturn generateUrl('/f/{fileid}', { fileid: file.id })\n\t\t},\n\n\t\t/**\n\t\t * Open the Files sidebar on this file: details, sharing, versions,\n\t\t * comments and activity, exactly as the Files app offers them.\n\t\t *\n\t\t * @param {object} file The file row.\n\t\t * @return {void}\n\t\t */\n\t\tshowDetails(file) {\n\t\t\tif (!this.canShowDetails() || !file.path) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\twindow.OCA.Files.Sidebar.open(this.userRelativePath(file.path))\n\t\t},\n\n\t\t/**\n\t\t * Put the file's permalink on the clipboard and say so.\n\t\t *\n\t\t * @param {object} file The file row.\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync copyLink(file) {\n\t\t\tconst href = new URL(this.showInFilesUrl(file), window.location.origin).href\n\t\t\ttry {\n\t\t\t\tawait navigator.clipboard.writeText(href)\n\t\t\t\tconst { showSuccess } = await import('@nextcloud/dialogs')\n\t\t\t\tshowSuccess(t('nextcloud-vue', 'Link copied'))\n\t\t\t} catch {\n\t\t\t\tconst { showError } = await import('@nextcloud/dialogs')\n\t\t\t\tshowError(t('nextcloud-vue', 'The link could not be copied'))\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Show a file in the in-page preview.\n\t\t *\n\t\t * @param {object} file The file to preview.\n\t\t */\n\t\tshowPreview(file) {\n\t\t\tthis.previewFile = file\n\t\t},\n\n\t\t/**\n\t\t * Open a file through the shared opener (Viewer, preview, browser, Files).\n\t\t *\n\t\t * @param {object} file The file row.\n\t\t */\n\t\topenFile(file) {\n\t\t\tuseFileOpener({\n\t\t\t\tonPreview: this.showPreview,\n\t\t\t\tuserRelativePath: this.userRelativePath,\n\t\t\t\tanyAccessUrl: true,\n\t\t\t\tfilesAppUrl: (f) => {\n\t\t\t\t\tconst dirPath = f.path ? f.path.substring(0, f.path.lastIndexOf('/')) : ''\n\t\t\t\t\tconst cleanPath = dirPath.replace(/^\\/admin\\/files\\//, '/')\n\t\t\t\t\treturn `/index.php/apps/files/files/${f.id}?dir=${encodeURIComponent(cleanPath)}&openfile=true`\n\t\t\t\t},\n\t\t\t}).open(file)\n\t\t},\n\n\t\tasync deleteFile(file) {\n\t\t\tif (!this.register || !this.schema) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tawait fetch(\n\t\t\t\t\tprefixUrl(`${this.apiBase}/objects/${this.register}/${this.schema}/${this.objectId}/files/${file.id}`),\n\t\t\t\t\t{ method: 'DELETE', headers: buildHeaders() },\n\t\t\t\t)\n\t\t\t\tthis.files = this.files.filter((f) => f.id !== file.id)\n\t\t\t} catch (err) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.error('CnFilesTab: Failed to delete file', err)\n\t\t\t}\n\t\t},\n\n\t\tformatFileSize(bytes) {\n\t\t\tconst sizes = ['Bytes', 'KB', 'MB', 'GB']\n\t\t\tif (!bytes || bytes === 0) {\n\t\t\t\treturn 'n/a'\n\t\t\t}\n\t\t\tconst i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)))\n\t\t\tif (i === 0) {\n\t\t\t\treturn '< 1 KB'\n\t\t\t}\n\t\t\treturn (bytes / Math.pow(1024, i)).toFixed(1) + ' ' + sizes[i]\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-sidebar-tab { padding: 12px; }\n\n.cn-sidebar-tab__upload-error {\n\tpadding: 8px 12px;\n\tmargin-bottom: 8px;\n\tborder-radius: var(--border-radius, 4px);\n\tbackground-color: var(--color-error-light, rgba(229, 57, 53, 0.1));\n\tcolor: var(--color-error, #e53935);\n\tfont-size: 13px;\n}\n\n.cn-sidebar-tab__dropzone {\n\tdisplay: flex;\n\tflex-direction: column;\n\talign-items: center;\n\tjustify-content: center;\n\tgap: 8px;\n\tpadding: 20px 12px;\n\tmargin-bottom: 16px;\n\tborder: 2px dashed var(--color-border);\n\tborder-radius: var(--border-radius-large, 8px);\n\tcursor: pointer;\n\ttransition: border-color 0.15s ease, background-color 0.15s ease;\n}\n\n.cn-sidebar-tab__dropzone:hover {\n\tborder-color: var(--color-primary-element);\n\tbackground-color: var(--color-primary-element-light, rgba(0, 130, 201, 0.08));\n}\n\n.cn-sidebar-tab__dropzone--active {\n\tborder-color: var(--color-primary-element);\n\tbackground-color: var(--color-primary-element-light, rgba(0, 130, 201, 0.12));\n}\n\n@media (prefers-reduced-motion: reduce) {\n\t.cn-sidebar-tab__dropzone { transition: none; }\n}\n\n.cn-sidebar-tab__share { margin-bottom: 12px; }\n\n.cn-sidebar-tab__dropzone-icon { color: var(--color-text-maxcontrast); }\n\n.cn-sidebar-tab__dropzone--active .cn-sidebar-tab__dropzone-icon,\n.cn-sidebar-tab__dropzone:hover .cn-sidebar-tab__dropzone-icon { color: var(--color-primary-element); }\n\n.cn-sidebar-tab__dropzone-text { font-size: 13px; color: var(--color-text-maxcontrast); }\n\n.cn-sidebar-tab__file-input { display: none; }\n\n.cn-sidebar-tab__empty {\n\ttext-align: center;\n\tpadding: 24px 12px;\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 13px;\n}\n\n.cn-sidebar-tab__list { display: flex; flex-direction: column; gap: 2px; }\n\n.cn-sidebar-tab__mime,\n.cn-sidebar-tab__thumb {\n\twidth: 32px;\n\theight: 32px;\n\tdisplay: block;\n}\n\n.cn-sidebar-tab__thumb {\n\tobject-fit: cover;\n\tborder-radius: var(--border-radius, 4px);\n}\n\n.cn-sidebar-tab__meta { color: var(--color-text-maxcontrast); }\n\n.cn-sidebar-tab__load-more { margin-top: 8px; }\n</style>\n"],"names":["_openBlock","_createElementBlock","_createBlock","_Fragment","_toDisplayString","_createElementVNode","_normalizeClass","_createVNode","_renderList","_createTextVNode"],"mappings":";;AACM,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,gBAAgB,GAAA;;;AA6CD,EAAA,KAAK,EAAC,8BAA8B;;;AA4DrD,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,+BAA+B,GAAA;;;AAkBhC,EAAA,KAAK,EAAC,sBAAsB;;;;AAwB/B,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,sBAAsB,GAAA;;;;;;;;;;;;;;;;;;;;;;;;;AAnJvC,EAAA,QAAAA,SAAA,EAAA,EAAAC,kBAAA,CA6OK,OA7OL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CAAC,IAAI,CAAA,CAAA;;AACnD,0BAAA,IAAI,UACd,MAAoB;4BAApBA,WAAoB,CAAA,iBAAA,EAAA,EAAX,IAAI,EAAE,EAAE,EAAA,CAAA;;2CACR,MACV;AADU,4BAAAE,eAAA,CAAA,GACV,mBAAG,MAAU,CAAA,WAAA,CAAA,EAAA,CAAA,YAAA;;;;;;;;;WAMV,KAAK,CAAA,KAAA,CAAC,MAAK,GAAI,KAAK,CAAA,KAAA;4BAD3BP,WAWU,CAAA,mBAAA,EAAA;;AATT,gBAAA,OAAO,EAAC,UAAS;AAChB,gBAAA,IAAI,EAAE,IAAI;AACV,gBAAA,QAAQ,EAAE,KAAW,CAAA,WAAA;AACtB,gBAAA,KAAK,EAAC,2BAA0B;AAC/B,gBAAA,OAAK,EAAE,QAAQ,CAAA,QAAA;;iCAGN,MACV;AADU,kBAAAO,eAAA,CAAA,GACV,mBAAG;;;;iBAHa,KAAW,CAAA,WAAA;;4BAAG,MAAI;kCACjC,MAA2B;wBAA3BF,WAA2B,CAAA,wBAAA,EAAA,EAAX,IAAI,EAAE,EAAE,EAAA,CAAA;;;;;;;;KAKN,KAAW,CAAA,WAAA;sBAAhCL,WAAmF,CAAA,wBAAA,EAAA;;AAAhD,UAAA,IAAI,EAAE,KAAW,CAAA,WAAA;AAAG,UAAA,OAAK,uCAAE,KAAU,CAAA,WAAA,GAAA,IAAA,CAAA,CAAA;;;;;;;;"}
@@ -2,7 +2,7 @@ import script from './CnRecordListWidget.vue2.js';
2
2
  import { render } from './CnRecordListWidget.vue3.js';
3
3
 
4
4
  script.render = render;
5
- script.__scopeId = "data-v-0567aa04";
5
+ script.__scopeId = "data-v-08641536";
6
6
  const __sfc_main = script;
7
7
 
8
8
  export { __sfc_main as default };
@@ -17,10 +17,10 @@ import { isAppInstalled } from '../../utils/appInstalled.js';
17
17
  import { isBadgeVariant } from '../../utils/badgeVariants.js';
18
18
  import { ageInDays } from '../../utils/boardDate.js';
19
19
  import { resolveDue } from '../../utils/dueText.js';
20
+ import { fieldPill } from '../../utils/fieldPill.js';
20
21
  import { fillCountLabel } from '../../utils/fillCountLabel.js';
21
22
  import { firstFilled, fillTemplate } from '../../utils/fillTemplate.js';
22
23
  import { unwrapAppConfig } from '../../utils/formatMetric.js';
23
- import { variantForColor } from '../../utils/headerFieldChips.js';
24
24
  import { initialsOf } from '../../utils/initials.js';
25
25
  import { lensUnavailableText, readLensReports } from '../../utils/lensAvailability.js';
26
26
  import { isObjectRowsSpec, objectRowsOf } from '../../utils/objectRows.js';
@@ -252,6 +252,7 @@ var script = {
252
252
 
253
253
  emits: ['header'],
254
254
 
255
+ /** @spec openspec/changes/record-list-checklist-sources-and-next-step/specs/record-list/spec.md#requirement-a-record-lists-header-can-carry-a-pill-from-the-answer */
255
256
  setup(props) {
256
257
  const objectCtxRaw = inject('cnObjectContext', null);
257
258
  const workspaceRaw = inject('cnWorkspaceContext', null);
@@ -327,7 +328,31 @@ var script = {
327
328
  },
328
329
  },
329
330
  );
330
- return { epData: data, epLoading: loading, epError: error, epRefusal: refusal, epRefetch: refetch, footnoteValue: footnoteSource.data, footnoteRefetch: footnoteSource.refetch, footerNoteValue: footerNoteSource.data }
331
+ // A header pill that reads another part of the same answer
332
+ // (`headerPillFrom: { path }`), through the same cache.
333
+ const headerPillSource = useEndpointSource(
334
+ () => {
335
+ const spec = props.content?.headerPillFrom;
336
+ const source = props.content?.endpointSource;
337
+ if (!spec || typeof spec !== 'object' || typeof spec.path !== 'string' || !source || typeof source !== 'object') {
338
+ return null
339
+ }
340
+ return { ...source, responsePath: spec.path }
341
+ },
342
+ {
343
+ ctx: () => {
344
+ const injected = unwrap(objectCtxRaw) || {};
345
+ return {
346
+ ...injected,
347
+ objectId: props.objectId ?? injected.objectId ?? props.objectData?.id ?? null,
348
+ object: props.objectData || injected.object || null,
349
+ workspace: unwrap(workspaceRaw) || {},
350
+ config: unwrapAppConfig(appConfigRaw) || {},
351
+ }
352
+ },
353
+ },
354
+ );
355
+ return { epData: data, epLoading: loading, epError: error, epRefusal: refusal, epRefetch: refetch, footnoteValue: footnoteSource.data, footnoteRefetch: footnoteSource.refetch, footerNoteValue: footerNoteSource.data, headerPillValue: headerPillSource.data }
331
356
  },
332
357
 
333
358
  data() {
@@ -1046,6 +1071,70 @@ var script = {
1046
1071
  return this.items.length > 0 ? Math.round((this.checklistDone / this.items.length) * 100) : 0
1047
1072
  },
1048
1073
 
1074
+ /**
1075
+ * Whether a checklist row draws its meta at the row's end
1076
+ * (`content.metaAt: "end"`) rather than under its title.
1077
+ *
1078
+ * @return {boolean}
1079
+ * @spec openspec/changes/record-list-checklist-sources-and-next-step/specs/record-list/spec.md#requirement-a-checklist-row-can-say-where-it-comes-from
1080
+ */
1081
+ checklistMetaAtEnd() {
1082
+ return this.content?.metaAt === 'end'
1083
+ },
1084
+
1085
+ /**
1086
+ * @return {string} What an open checklist row reads in place of its meta (`content.missingText`).
1087
+ *
1088
+ * @spec openspec/changes/record-list-checklist-sources-and-next-step/specs/record-list/spec.md#requirement-a-checklist-row-can-say-where-it-comes-from
1089
+ */
1090
+ checklistMissingText() {
1091
+ const text = this.content?.missingText;
1092
+ return typeof text === 'string' && text !== '' ? this.translate(text) : ''
1093
+ },
1094
+
1095
+ /**
1096
+ * The actions side by side under the list (`content.footerActions`):
1097
+ * each `{ label, icon?, variant?, visibleWhen?, ...action }`, those whose
1098
+ * `visibleWhen` (a local condition over the page's record) does not
1099
+ * hold left out. The first is primary unless it says otherwise.
1100
+ *
1101
+ * @return {Array<{key: string, label: string, icon: string, variant: string, action: object}>}
1102
+ * @spec openspec/changes/record-list-checklist-sources-and-next-step/specs/record-list/spec.md#requirement-a-record-list-can-end-with-several-actions-side-by-side
1103
+ */
1104
+ footerActionList() {
1105
+ const declared = this.content?.footerActions;
1106
+ if (!Array.isArray(declared)) {
1107
+ return []
1108
+ }
1109
+ const record = this.tokenCtx.object || {};
1110
+ return declared
1111
+ .filter((entry) => entry && typeof entry === 'object' && typeof entry.label === 'string' && entry.label !== '')
1112
+ .filter((entry) => !entry.visibleWhen || evaluateVisibleWhenLocal(entry.visibleWhen, record))
1113
+ .map((entry, index) => ({
1114
+ key: String(entry.id || index),
1115
+ label: this.translate(entry.label),
1116
+ icon: typeof entry.icon === 'string' ? entry.icon : '',
1117
+ variant: ['primary', 'secondary', 'tertiary'].includes(entry.variant) ? entry.variant : (index === 0 ? 'primary' : 'secondary'),
1118
+ action: entry,
1119
+ }))
1120
+ },
1121
+
1122
+ /**
1123
+ * The status pill in the card header, read from the endpoint's answer
1124
+ * (`content.headerPillFrom: { path, labels?, colorMap? }`): a verdict
1125
+ * such as `incomplete` reading "Nog niet ontvankelijk" in the warning tone.
1126
+ *
1127
+ * @return {{label: string, variant: string}|null} The pill, or null.
1128
+ * @spec openspec/changes/record-list-checklist-sources-and-next-step/specs/record-list/spec.md#requirement-a-record-lists-header-can-carry-a-pill-from-the-answer
1129
+ */
1130
+ headerPill() {
1131
+ const spec = this.content?.headerPillFrom;
1132
+ if (!spec || typeof spec !== 'object' || typeof spec.path !== 'string') {
1133
+ return null
1134
+ }
1135
+ return fieldPill({ value: this.headerPillValue }, { ...spec, field: 'value' }, { translate: (text) => this.translate(text) })
1136
+ },
1137
+
1049
1138
  /** @return {string} What a done checklist row says to a screen reader. */
1050
1139
  doneLabel() {
1051
1140
  return translate('nextcloud-vue', 'Done')
@@ -1143,6 +1232,27 @@ var script = {
1143
1232
  return this.content?.absentText ? this.translate(this.content.absentText) : translate('nextcloud-vue', 'The app these come from is not installed')
1144
1233
  },
1145
1234
 
1235
+ /**
1236
+ * Whether the intro is drawn as a group heading (`content.introAsHeading`).
1237
+ *
1238
+ * @return {boolean}
1239
+ * @spec openspec/changes/record-list-section-intro-heading/specs/record-list/spec.md#requirement-a-sections-intro-can-be-its-group-heading
1240
+ */
1241
+ introAsHeading() {
1242
+ return this.content?.introAsHeading === true
1243
+ },
1244
+
1245
+ /**
1246
+ * Whether a heading intro drops out: the list read no rows and says
1247
+ * nothing about it (`emptyText: ""`).
1248
+ *
1249
+ * @return {boolean}
1250
+ * @spec openspec/changes/record-list-section-intro-heading/specs/record-list/spec.md#requirement-a-sections-intro-can-be-its-group-heading
1251
+ */
1252
+ introHidden() {
1253
+ return this.content?.emptyText === '' && !this.loading && !this.error && this.rows.length === 0
1254
+ },
1255
+
1146
1256
  /** @return {string} The line above the list (`intro`), translated. */
1147
1257
  intro() {
1148
1258
  const text = this.content?.intro;
@@ -1286,6 +1396,15 @@ var script = {
1286
1396
  this.fetchRows();
1287
1397
  },
1288
1398
 
1399
+ /**
1400
+ * The header pill read from the answer arrives after the rows.
1401
+ *
1402
+ * @spec openspec/changes/record-list-checklist-sources-and-next-step/specs/record-list/spec.md#requirement-a-record-lists-header-can-carry-a-pill-from-the-answer
1403
+ */
1404
+ headerPill() {
1405
+ this.emitHeader();
1406
+ },
1407
+
1289
1408
  rows() {
1290
1409
  this.evaluateEmptyTexts();
1291
1410
  this.loadAggregates();
@@ -1477,6 +1596,18 @@ var script = {
1477
1596
  if (!declared || this.footerDisabled) {
1478
1597
  return undefined
1479
1598
  }
1599
+ return this.runListAction(declared)
1600
+ },
1601
+
1602
+ /**
1603
+ * Dispatch an action the list declares (a footer action), without its
1604
+ * drawing keys, through the page's dispatcher when there is one.
1605
+ *
1606
+ * @param {object} declared The declared action.
1607
+ * @return {unknown} What the dispatcher returns.
1608
+ * @spec openspec/changes/record-list-checklist-sources-and-next-step/specs/record-list/spec.md#requirement-a-record-list-can-end-with-several-actions-side-by-side
1609
+ */
1610
+ runListAction(declared) {
1480
1611
  const { disabledWhen, disabledReason, group, variant, visibleWhen, note, wide, ...action } = declared;
1481
1612
  if (typeof this.cnDispatchAction === 'function') {
1482
1613
  return this.cnDispatchAction(action)
@@ -1484,6 +1615,57 @@ var script = {
1484
1615
  return dispatchAction(action, { router: this.$router || null, tokenCtx: this.tokenCtx, source: { register: this.content?.register, schema: this.content?.schema } })
1485
1616
  },
1486
1617
 
1618
+ /**
1619
+ * The next-step row's own action, when it names no href: dispatched
1620
+ * with the row's `action` object.
1621
+ *
1622
+ * @param {object} row The row.
1623
+ * @return {unknown} What the dispatcher returns.
1624
+ * @spec openspec/changes/record-list-checklist-sources-and-next-step/specs/record-list/spec.md#requirement-a-checklist-can-mark-the-next-step
1625
+ */
1626
+ runCheckNextAction(row) {
1627
+ const action = readPath(row, 'action');
1628
+ return action && typeof action === 'object' && action.type ? this.runListAction(action) : undefined
1629
+ },
1630
+
1631
+ /**
1632
+ * The checklist's next-step marking for a row (`content.next`): its
1633
+ * pill label and, when the row names one, its action. Null for a row
1634
+ * where `next.when` does not hold.
1635
+ *
1636
+ * @param {object} row The row.
1637
+ * @return {{label: string, action: ({label: string, href: string}|null)}|null}
1638
+ * @spec openspec/changes/record-list-checklist-sources-and-next-step/specs/record-list/spec.md#requirement-a-checklist-can-mark-the-next-step
1639
+ */
1640
+ checkNextOf(row) {
1641
+ const next = this.content?.next;
1642
+ if (!next || typeof next !== 'object' || !next.when || !row || !evaluateVisibleWhenLocal(next.when, row)) {
1643
+ return null
1644
+ }
1645
+ const spec = next.action && typeof next.action === 'object' ? next.action : {};
1646
+ const label = readPath(row, spec.labelField || 'action.label');
1647
+ const href = readPath(row, spec.hrefField || 'action.href');
1648
+ return {
1649
+ label: typeof next.label === 'string' && next.label !== '' ? this.translate(next.label) : translate('nextcloud-vue', 'Next step'),
1650
+ action: typeof label === 'string' && label !== '' ? { label: this.translate(label), href: typeof href === 'string' ? href : '' } : null,
1651
+ }
1652
+ },
1653
+
1654
+ /**
1655
+ * A checklist row's meta line: `content.missingText` while the row is
1656
+ * not done, else its `meta`.
1657
+ *
1658
+ * @param {object} item The drawn row.
1659
+ * @return {string} The line, or ''.
1660
+ * @spec openspec/changes/record-list-checklist-sources-and-next-step/specs/record-list/spec.md#requirement-a-checklist-row-can-say-where-it-comes-from
1661
+ */
1662
+ checkMetaOf(item) {
1663
+ if (!this.isChecked(item.row) && this.checklistMissingText !== '') {
1664
+ return this.checklistMissingText
1665
+ }
1666
+ return item.meta || ''
1667
+ },
1668
+
1487
1669
  /**
1488
1670
  * A row's `bar`: its value, the maximum it is measured against (the
1489
1671
  * row's `maxField`, else the largest row), the filled share and
@@ -2473,68 +2655,13 @@ var script = {
2473
2655
  * @param {object} row The row.
2474
2656
  * @param {object} [config] A pill config; the widget's `pill` by default.
2475
2657
  * @return {{label: string, variant: string}|null} The pill, or null.
2476
- */
2477
- pillOf(row, config) {
2478
- const pill = config || this.content?.pill;
2479
- if (pill && typeof pill === 'object' && Array.isArray(pill.cases)) {
2480
- return this.pillCaseOf(row, pill)
2481
- }
2482
- if (!pill || typeof pill !== 'object' || !pill.field) {
2483
- return null
2484
- }
2485
- const raw = readPath(row, pill.field);
2486
- if (raw === null || raw === undefined || raw === '' || typeof raw === 'object') {
2487
- return null
2488
- }
2489
- const key = String(raw);
2490
- if (Array.isArray(pill.hideValues) && pill.hideValues.map(String).includes(key)) {
2491
- return null
2492
- }
2493
- const labels = pill.labels && typeof pill.labels === 'object' ? pill.labels : {};
2494
- const map = pill.colorMap && typeof pill.colorMap === 'object' ? pill.colorMap : {};
2495
- const found = Object.keys(map).find((k) => k.toLowerCase() === key.toLowerCase());
2496
- // `variantWhen` colours the pill by the row rather than the value: a
2497
- // finished case is green whatever its case type calls the final status.
2498
- const rule = Array.isArray(pill.variantWhen)
2499
- ? pill.variantWhen.find((entry) => entry && entry.when && evaluateVisibleWhenLocal(entry.when, row || {}))
2500
- : null;
2501
- const colour = pill.colorField ? readPath(row, pill.colorField) : null;
2502
- const fromRow = typeof colour === 'string' && colour !== '' ? variantForColor(colour) : null;
2503
- const variant = rule ? rule.variant : (found ? map[found] : (fromRow || pill.variant));
2504
- return {
2505
- label: labels[key] ? this.translate(labels[key]) : key,
2506
- variant: isBadgeVariant(variant) ? variant : 'default',
2507
- }
2508
- },
2509
-
2510
- /**
2511
- * The pill of `{ cases: [{ when, label, variant? }], label?, variant? }`:
2512
- * the first case whose `when` (a local condition over the row) holds,
2513
- * else the pill's own `label` and `variant`, else none. For a state that
2514
- * reads more than one field (Concept, Actief, Vastgezet).
2515
- *
2516
- * @param {object} row The row.
2517
- * @param {object} pill The pill config.
2518
- * @return {{label: string, variant: string}|null} The pill, or null.
2519
2658
  * @spec openspec/changes/record-list-pill-cases-footer-choice/specs/record-list/spec.md#requirement-a-record-list-row-pill-can-read-a-state-from-several-fields
2520
- * @spec openspec/changes/record-list-pill-case-template/specs/record-list/spec.md#requirement-a-pill-case-label-can-carry-the-rows-values
2521
2659
  */
2522
- pillCaseOf(row, pill) {
2523
- const found = pill.cases.find((entry) => entry && typeof entry === 'object' && entry.when && evaluateVisibleWhenLocal(entry.when, row || {}));
2524
- const chosen = found || pill;
2525
- if (typeof chosen.label !== 'string' || chosen.label === '') {
2526
- return null
2527
- }
2528
- // A label with `{field}` tokens reads the row ("{value|currency}");
2529
- // one that fills to nothing draws no pill.
2530
- const label = chosen.label.indexOf('{') === -1 ? this.translate(chosen.label) : this.fill(chosen.label, row);
2531
- if (label === '') {
2532
- return null
2533
- }
2534
- return {
2535
- label,
2536
- variant: isBadgeVariant(chosen.variant) ? chosen.variant : 'default',
2537
- }
2660
+ pillOf(row, config) {
2661
+ return fieldPill(row, config || this.content?.pill, {
2662
+ translate: (text) => this.translate(text),
2663
+ fill: (template, values) => this.fill(template, values),
2664
+ })
2538
2665
  },
2539
2666
 
2540
2667
  /**
@@ -2561,9 +2688,16 @@ var script = {
2561
2688
  return 'CircleSmall'
2562
2689
  },
2563
2690
 
2564
- /** Tell the card around this list what its header shows. */
2691
+ /**
2692
+ * Tell the card around this list what its header shows.
2693
+ *
2694
+ * @spec openspec/changes/record-list-checklist-sources-and-next-step/specs/record-list/spec.md#requirement-a-record-lists-header-can-carry-a-pill-from-the-answer
2695
+ */
2565
2696
  emitHeader() {
2566
2697
  const header = { link: this.headerLink, note: this.headerNote };
2698
+ if (this.headerPill && !this.error) {
2699
+ header.pill = this.headerPill;
2700
+ }
2567
2701
  // `headerSubtitle`: the counts as the muted line under the card title.
2568
2702
  const subtitle = this.content?.headerSubtitle;
2569
2703
  if (typeof subtitle === 'string' && subtitle !== '' && !this.error) {