@conduction/nextcloud-vue 2.79.0 → 2.81.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (390) hide show
  1. package/dist/esm/components/CnActionButtons/CnActionButtons.vue2.js.map +1 -1
  2. package/dist/esm/components/CnActionButtons/CnActionButtons.vue3.js +3 -1
  3. package/dist/esm/components/CnActionButtons/CnActionButtons.vue3.js.map +1 -1
  4. package/dist/esm/components/CnActionsBar/CnActionsBar.vue2.js +32 -3
  5. package/dist/esm/components/CnActionsBar/CnActionsBar.vue2.js.map +1 -1
  6. package/dist/esm/components/CnActionsBar/CnActionsBar.vue3.js +13 -11
  7. package/dist/esm/components/CnActionsBar/CnActionsBar.vue3.js.map +1 -1
  8. package/dist/esm/components/CnAppRoot/CnAppRoot.vue2.js +80 -4
  9. package/dist/esm/components/CnAppRoot/CnAppRoot.vue2.js.map +1 -1
  10. package/dist/esm/components/CnAppRoot/CnAppRoot.vue3.js +95 -91
  11. package/dist/esm/components/CnAppRoot/CnAppRoot.vue3.js.map +1 -1
  12. package/dist/esm/components/CnBannerWidget/CnBannerWidget.vue2.js +179 -13
  13. package/dist/esm/components/CnBannerWidget/CnBannerWidget.vue2.js.map +1 -1
  14. package/dist/esm/components/CnBannerWidget/CnBannerWidget.vue3.js +52 -16
  15. package/dist/esm/components/CnBannerWidget/CnBannerWidget.vue3.js.map +1 -1
  16. package/dist/esm/components/CnCellRenderer/CnCellRenderer.vue2.js +96 -4
  17. package/dist/esm/components/CnCellRenderer/CnCellRenderer.vue2.js.map +1 -1
  18. package/dist/esm/components/CnCellRenderer/CnCellRenderer.vue3.js +158 -110
  19. package/dist/esm/components/CnCellRenderer/CnCellRenderer.vue3.js.map +1 -1
  20. package/dist/esm/components/CnChipsFieldWidget/CnChipsFieldWidget.vue.js +10 -0
  21. package/dist/esm/components/CnChipsFieldWidget/CnChipsFieldWidget.vue.js.map +1 -0
  22. package/dist/esm/components/CnChipsFieldWidget/CnChipsFieldWidget.vue2.js +252 -0
  23. package/dist/esm/components/CnChipsFieldWidget/CnChipsFieldWidget.vue2.js.map +1 -0
  24. package/dist/esm/components/CnChipsFieldWidget/CnChipsFieldWidget.vue3.js +140 -0
  25. package/dist/esm/components/CnChipsFieldWidget/CnChipsFieldWidget.vue3.js.map +1 -0
  26. package/dist/esm/components/CnChipsFieldWidget/index.js +26 -0
  27. package/dist/esm/components/CnChipsFieldWidget/index.js.map +1 -0
  28. package/dist/esm/components/CnChoicePickerWidget/CnChoicePickerWidget.vue.js +10 -0
  29. package/dist/esm/components/CnChoicePickerWidget/CnChoicePickerWidget.vue.js.map +1 -0
  30. package/dist/esm/components/CnChoicePickerWidget/CnChoicePickerWidget.vue2.js +354 -0
  31. package/dist/esm/components/CnChoicePickerWidget/CnChoicePickerWidget.vue2.js.map +1 -0
  32. package/dist/esm/components/CnChoicePickerWidget/CnChoicePickerWidget.vue3.js +172 -0
  33. package/dist/esm/components/CnChoicePickerWidget/CnChoicePickerWidget.vue3.js.map +1 -0
  34. package/dist/esm/components/CnChoicePickerWidget/index.js +27 -0
  35. package/dist/esm/components/CnChoicePickerWidget/index.js.map +1 -0
  36. package/dist/esm/components/CnConversationThread/CnConversationWidget.vue2.js +1 -1
  37. package/dist/esm/components/CnConversationThread/CnConversationWidget.vue2.js.map +1 -1
  38. package/dist/esm/components/CnConversationThread/CnConversationWidget.vue3.js.map +1 -1
  39. package/dist/esm/components/CnDashboardGrid/CnDashboardGrid.vue2.js +2 -2
  40. package/dist/esm/components/CnDashboardGrid/CnDashboardGrid.vue2.js.map +1 -1
  41. package/dist/esm/components/CnDashboardGrid/CnDashboardGrid.vue3.js.map +1 -1
  42. package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue2.js +65 -5
  43. package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue2.js.map +1 -1
  44. package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue3.js +2 -1
  45. package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue3.js.map +1 -1
  46. package/dist/esm/components/CnDataTable/CnDataTable.vue2.js +19 -11
  47. package/dist/esm/components/CnDataTable/CnDataTable.vue2.js.map +1 -1
  48. package/dist/esm/components/CnDataTable/CnDataTable.vue3.js +4 -2
  49. package/dist/esm/components/CnDataTable/CnDataTable.vue3.js.map +1 -1
  50. package/dist/esm/components/CnDetailPage/CnDetailPage.vue2.js +134 -4
  51. package/dist/esm/components/CnDetailPage/CnDetailPage.vue2.js.map +1 -1
  52. package/dist/esm/components/CnDetailPage/CnDetailPage.vue3.js +21 -4
  53. package/dist/esm/components/CnDetailPage/CnDetailPage.vue3.js.map +1 -1
  54. package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHost.vue2.js +24 -0
  55. package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHost.vue2.js.map +1 -1
  56. package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHost.vue3.js +43 -4
  57. package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHost.vue3.js.map +1 -1
  58. package/dist/esm/components/CnDocumentReviewList/CnDocumentReviewWidget.vue2.js +1 -1
  59. package/dist/esm/components/CnDocumentReviewList/CnDocumentReviewWidget.vue2.js.map +1 -1
  60. package/dist/esm/components/CnDocumentReviewList/CnDocumentReviewWidget.vue3.js.map +1 -1
  61. package/dist/esm/components/CnFacetSidebar/CnFacetSidebar.vue2.js +7 -7
  62. package/dist/esm/components/CnFacetSidebar/CnFacetSidebar.vue2.js.map +1 -1
  63. package/dist/esm/components/CnFacetSidebar/CnFacetSidebar.vue3.js.map +1 -1
  64. package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue.js +11 -0
  65. package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue.js.map +1 -0
  66. package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue2.js +867 -0
  67. package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue2.js.map +1 -0
  68. package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue3.js +238 -0
  69. package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue3.js.map +1 -0
  70. package/dist/esm/components/CnFactsWidget/index.js +30 -0
  71. package/dist/esm/components/CnFactsWidget/index.js.map +1 -0
  72. package/dist/esm/components/CnFieldListWidget/CnFieldListWidget.vue.js +10 -0
  73. package/dist/esm/components/CnFieldListWidget/CnFieldListWidget.vue.js.map +1 -0
  74. package/dist/esm/components/CnFieldListWidget/CnFieldListWidget.vue2.js +626 -0
  75. package/dist/esm/components/CnFieldListWidget/CnFieldListWidget.vue2.js.map +1 -0
  76. package/dist/esm/components/CnFieldListWidget/CnFieldListWidget.vue3.js +396 -0
  77. package/dist/esm/components/CnFieldListWidget/CnFieldListWidget.vue3.js.map +1 -0
  78. package/dist/esm/components/CnFieldListWidget/index.js +29 -0
  79. package/dist/esm/components/CnFieldListWidget/index.js.map +1 -0
  80. package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue2.js +302 -4
  81. package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue2.js.map +1 -1
  82. package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue3.js +417 -244
  83. package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue3.js.map +1 -1
  84. package/dist/esm/components/CnFilesBrowser/filesBrowser.js +101 -1
  85. package/dist/esm/components/CnFilesBrowser/filesBrowser.js.map +1 -1
  86. package/dist/esm/components/CnFilesBrowser/filesBrowserColumns.js +141 -1
  87. package/dist/esm/components/CnFilesBrowser/filesBrowserColumns.js.map +1 -1
  88. package/dist/esm/components/CnFormDialog/CnFormDialog.vue2.js +65 -17
  89. package/dist/esm/components/CnFormDialog/CnFormDialog.vue2.js.map +1 -1
  90. package/dist/esm/components/CnFormDialog/CnFormDialog.vue3.js +4 -4
  91. package/dist/esm/components/CnFormDialog/CnFormDialog.vue3.js.map +1 -1
  92. package/dist/esm/components/CnFormPage/CnFormPage.vue2.js +78 -3
  93. package/dist/esm/components/CnFormPage/CnFormPage.vue2.js.map +1 -1
  94. package/dist/esm/components/CnFormPage/CnFormPage.vue3.js +74 -49
  95. package/dist/esm/components/CnFormPage/CnFormPage.vue3.js.map +1 -1
  96. package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js +333 -73
  97. package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js.map +1 -1
  98. package/dist/esm/components/CnIndexPage/CnIndexPage.vue3.js +79 -17
  99. package/dist/esm/components/CnIndexPage/CnIndexPage.vue3.js.map +1 -1
  100. package/dist/esm/components/CnIndexPage/CnIndexPageWidgets.vue.js +10 -0
  101. package/dist/esm/components/CnIndexPage/CnIndexPageWidgets.vue.js.map +1 -0
  102. package/dist/esm/components/CnIndexPage/CnIndexPageWidgets.vue2.js +99 -0
  103. package/dist/esm/components/CnIndexPage/CnIndexPageWidgets.vue2.js.map +1 -0
  104. package/dist/esm/components/CnIndexPage/CnIndexPageWidgets.vue3.js +48 -0
  105. package/dist/esm/components/CnIndexPage/CnIndexPageWidgets.vue3.js.map +1 -0
  106. package/dist/esm/components/CnIndexSidebar/CnIndexSidebar.vue2.js +7 -7
  107. package/dist/esm/components/CnIndexSidebar/CnIndexSidebar.vue2.js.map +1 -1
  108. package/dist/esm/components/CnIndexSidebar/CnIndexSidebar.vue3.js.map +1 -1
  109. package/dist/esm/components/CnNextStepCard/CnNextStepWidget.vue2.js +1 -1
  110. package/dist/esm/components/CnNextStepCard/CnNextStepWidget.vue2.js.map +1 -1
  111. package/dist/esm/components/CnObjectListWidget/CnObjectListWidget.vue2.js +65 -2
  112. package/dist/esm/components/CnObjectListWidget/CnObjectListWidget.vue2.js.map +1 -1
  113. package/dist/esm/components/CnObjectListWidget/CnObjectListWidget.vue3.js +6 -2
  114. package/dist/esm/components/CnObjectListWidget/CnObjectListWidget.vue3.js.map +1 -1
  115. package/dist/esm/components/CnObjectSidebar/CnFilesTab.vue2.js +63 -1
  116. package/dist/esm/components/CnObjectSidebar/CnFilesTab.vue2.js.map +1 -1
  117. package/dist/esm/components/CnObjectSidebar/CnFilesTab.vue3.js +8 -1
  118. package/dist/esm/components/CnObjectSidebar/CnFilesTab.vue3.js.map +1 -1
  119. package/dist/esm/components/CnObjectSidebar/CnNotesTab.vue2.js +14 -0
  120. package/dist/esm/components/CnObjectSidebar/CnNotesTab.vue2.js.map +1 -1
  121. package/dist/esm/components/CnObjectSidebar/CnNotesTab.vue3.js +5 -1
  122. package/dist/esm/components/CnObjectSidebar/CnNotesTab.vue3.js.map +1 -1
  123. package/dist/esm/components/CnPageRenderer/CnPageRenderer.vue2.js +29 -1
  124. package/dist/esm/components/CnPageRenderer/CnPageRenderer.vue2.js.map +1 -1
  125. package/dist/esm/components/CnPageRenderer/CnPageRenderer.vue3.js.map +1 -1
  126. package/dist/esm/components/CnRadioCardsWidget/CnRadioCardsWidget.vue.js +10 -0
  127. package/dist/esm/components/CnRadioCardsWidget/CnRadioCardsWidget.vue.js.map +1 -0
  128. package/dist/esm/components/CnRadioCardsWidget/CnRadioCardsWidget.vue2.js +174 -0
  129. package/dist/esm/components/CnRadioCardsWidget/CnRadioCardsWidget.vue2.js.map +1 -0
  130. package/dist/esm/components/CnRadioCardsWidget/CnRadioCardsWidget.vue3.js +75 -0
  131. package/dist/esm/components/CnRadioCardsWidget/CnRadioCardsWidget.vue3.js.map +1 -0
  132. package/dist/esm/components/CnRadioCardsWidget/index.js +28 -0
  133. package/dist/esm/components/CnRadioCardsWidget/index.js.map +1 -0
  134. package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue.js +10 -0
  135. package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue.js.map +1 -0
  136. package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue2.js +411 -0
  137. package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue2.js.map +1 -0
  138. package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue3.js +178 -0
  139. package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue3.js.map +1 -0
  140. package/dist/esm/components/CnRecordListWidget/index.js +31 -0
  141. package/dist/esm/components/CnRecordListWidget/index.js.map +1 -0
  142. package/dist/esm/components/CnSavedViewsWidget/CnSavedViewsWidget.vue.js +10 -0
  143. package/dist/esm/components/CnSavedViewsWidget/CnSavedViewsWidget.vue.js.map +1 -0
  144. package/dist/esm/components/CnSavedViewsWidget/CnSavedViewsWidget.vue2.js +222 -0
  145. package/dist/esm/components/CnSavedViewsWidget/CnSavedViewsWidget.vue2.js.map +1 -0
  146. package/dist/esm/components/CnSavedViewsWidget/CnSavedViewsWidget.vue3.js +64 -0
  147. package/dist/esm/components/CnSavedViewsWidget/CnSavedViewsWidget.vue3.js.map +1 -0
  148. package/dist/esm/components/CnSavedViewsWidget/index.js +30 -0
  149. package/dist/esm/components/CnSavedViewsWidget/index.js.map +1 -0
  150. package/dist/esm/components/CnSectionsWidget/CnSectionsWidget.vue.js +10 -0
  151. package/dist/esm/components/CnSectionsWidget/CnSectionsWidget.vue.js.map +1 -0
  152. package/dist/esm/components/CnSectionsWidget/CnSectionsWidget.vue2.js +351 -0
  153. package/dist/esm/components/CnSectionsWidget/CnSectionsWidget.vue2.js.map +1 -0
  154. package/dist/esm/components/CnSectionsWidget/CnSectionsWidget.vue3.js +71 -0
  155. package/dist/esm/components/CnSectionsWidget/CnSectionsWidget.vue3.js.map +1 -0
  156. package/dist/esm/components/CnSectionsWidget/index.js +35 -0
  157. package/dist/esm/components/CnSectionsWidget/index.js.map +1 -0
  158. package/dist/esm/components/CnSegmentedControl/CnSegmentedControl.vue2.js.map +1 -1
  159. package/dist/esm/components/CnSegmentedControl/CnSegmentedControl.vue3.js.map +1 -1
  160. package/dist/esm/components/CnSettingsFormWidget/CnSettingsFormWidget.vue.js +10 -0
  161. package/dist/esm/components/CnSettingsFormWidget/CnSettingsFormWidget.vue.js.map +1 -0
  162. package/dist/esm/components/CnSettingsFormWidget/CnSettingsFormWidget.vue2.js +347 -0
  163. package/dist/esm/components/CnSettingsFormWidget/CnSettingsFormWidget.vue2.js.map +1 -0
  164. package/dist/esm/components/CnSettingsFormWidget/CnSettingsFormWidget.vue3.js +184 -0
  165. package/dist/esm/components/CnSettingsFormWidget/CnSettingsFormWidget.vue3.js.map +1 -0
  166. package/dist/esm/components/CnSettingsFormWidget/index.js +27 -0
  167. package/dist/esm/components/CnSettingsFormWidget/index.js.map +1 -0
  168. package/dist/esm/components/CnStagesWidget/CnStagesWidget.vue2.js +81 -2
  169. package/dist/esm/components/CnStagesWidget/CnStagesWidget.vue2.js.map +1 -1
  170. package/dist/esm/components/CnStagesWidget/CnStagesWidget.vue3.js.map +1 -1
  171. package/dist/esm/components/CnStatWidget/CnStatWidget.vue2.js +87 -6
  172. package/dist/esm/components/CnStatWidget/CnStatWidget.vue2.js.map +1 -1
  173. package/dist/esm/components/CnStatWidget/CnStatWidget.vue3.js +1 -0
  174. package/dist/esm/components/CnStatWidget/CnStatWidget.vue3.js.map +1 -1
  175. package/dist/esm/components/CnStatsBlockWidget/CnStatsBlockWidget.vue2.js +84 -1
  176. package/dist/esm/components/CnStatsBlockWidget/CnStatsBlockWidget.vue2.js.map +1 -1
  177. package/dist/esm/components/CnStatsBlockWidget/CnStatsBlockWidget.vue3.js +85 -41
  178. package/dist/esm/components/CnStatsBlockWidget/CnStatsBlockWidget.vue3.js.map +1 -1
  179. package/dist/esm/components/CnSwitchRowsWidget/CnSwitchRowsWidget.vue.js +10 -0
  180. package/dist/esm/components/CnSwitchRowsWidget/CnSwitchRowsWidget.vue.js.map +1 -0
  181. package/dist/esm/components/CnSwitchRowsWidget/CnSwitchRowsWidget.vue2.js +159 -0
  182. package/dist/esm/components/CnSwitchRowsWidget/CnSwitchRowsWidget.vue2.js.map +1 -0
  183. package/dist/esm/components/CnSwitchRowsWidget/CnSwitchRowsWidget.vue3.js +60 -0
  184. package/dist/esm/components/CnSwitchRowsWidget/CnSwitchRowsWidget.vue3.js.map +1 -0
  185. package/dist/esm/components/CnSwitchRowsWidget/index.js +26 -0
  186. package/dist/esm/components/CnSwitchRowsWidget/index.js.map +1 -0
  187. package/dist/esm/components/CnTabsWidget/CnTabsWidget.vue2.js +168 -7
  188. package/dist/esm/components/CnTabsWidget/CnTabsWidget.vue2.js.map +1 -1
  189. package/dist/esm/components/CnTabsWidget/CnTabsWidget.vue3.js +86 -23
  190. package/dist/esm/components/CnTabsWidget/CnTabsWidget.vue3.js.map +1 -1
  191. package/dist/esm/components/CnTasksWidget/CnTasksWidget.vue2.js +80 -1
  192. package/dist/esm/components/CnTasksWidget/CnTasksWidget.vue2.js.map +1 -1
  193. package/dist/esm/components/CnTasksWidget/CnTasksWidget.vue3.js +75 -32
  194. package/dist/esm/components/CnTasksWidget/CnTasksWidget.vue3.js.map +1 -1
  195. package/dist/esm/components/CnToggleTableWidget/CnToggleTableWidget.vue.js +10 -0
  196. package/dist/esm/components/CnToggleTableWidget/CnToggleTableWidget.vue.js.map +1 -0
  197. package/dist/esm/components/CnToggleTableWidget/CnToggleTableWidget.vue2.js +269 -0
  198. package/dist/esm/components/CnToggleTableWidget/CnToggleTableWidget.vue2.js.map +1 -0
  199. package/dist/esm/components/CnToggleTableWidget/CnToggleTableWidget.vue3.js +106 -0
  200. package/dist/esm/components/CnToggleTableWidget/CnToggleTableWidget.vue3.js.map +1 -0
  201. package/dist/esm/components/CnToggleTableWidget/index.js +27 -0
  202. package/dist/esm/components/CnToggleTableWidget/index.js.map +1 -0
  203. package/dist/esm/components/CnWidgetGrid/registerDashboardWidgets.js +11 -0
  204. package/dist/esm/components/CnWidgetGrid/registerDashboardWidgets.js.map +1 -1
  205. package/dist/esm/components/CnWidgetObjectTable/CnWidgetObjectTable.vue2.js +7 -2
  206. package/dist/esm/components/CnWidgetObjectTable/CnWidgetObjectTable.vue2.js.map +1 -1
  207. package/dist/esm/components/CnWidgetObjectTable/CnWidgetObjectTable.vue3.js.map +1 -1
  208. package/dist/esm/components/CnWidgetObjectTable/dashboardRegistration.js +5 -0
  209. package/dist/esm/components/CnWidgetObjectTable/dashboardRegistration.js.map +1 -1
  210. package/dist/esm/components/CnWorkspaceFilterWidget/CnWorkspaceFilterWidget.vue2.js +301 -6
  211. package/dist/esm/components/CnWorkspaceFilterWidget/CnWorkspaceFilterWidget.vue2.js.map +1 -1
  212. package/dist/esm/components/CnWorkspaceFilterWidget/CnWorkspaceFilterWidget.vue3.js +153 -55
  213. package/dist/esm/components/CnWorkspaceFilterWidget/CnWorkspaceFilterWidget.vue3.js.map +1 -1
  214. package/dist/esm/composables/useFormDraft.js +140 -9
  215. package/dist/esm/composables/useFormDraft.js.map +1 -1
  216. package/dist/esm/composables/useListView.js +4 -4
  217. package/dist/esm/composables/useListView.js.map +1 -1
  218. package/dist/esm/index.js +21 -1
  219. package/dist/esm/index.js.map +1 -1
  220. package/dist/esm/integrations/builtin/field-inspection/CnFieldInspectionCard.vue2.js +28 -20
  221. package/dist/esm/integrations/builtin/field-inspection/CnFieldInspectionCard.vue2.js.map +1 -1
  222. package/dist/esm/integrations/builtin/field-inspection/CnFieldInspectionCard.vue3.js +9 -0
  223. package/dist/esm/integrations/builtin/field-inspection/CnFieldInspectionCard.vue3.js.map +1 -1
  224. package/dist/esm/integrations/builtin/field-inspection.js +21 -0
  225. package/dist/esm/integrations/builtin/field-inspection.js.map +1 -1
  226. package/dist/esm/integrations/offline/checklistSubmission.js +141 -0
  227. package/dist/esm/integrations/offline/checklistSubmission.js.map +1 -0
  228. package/dist/esm/integrations/offline/fieldCollectionHelpers.js +70 -5
  229. package/dist/esm/integrations/offline/fieldCollectionHelpers.js.map +1 -1
  230. package/dist/esm/integrations/offline/index.js +2 -1
  231. package/dist/esm/integrations/offline/index.js.map +1 -1
  232. package/dist/esm/integrations/offline/offlineDb.js +6 -1
  233. package/dist/esm/integrations/offline/offlineDb.js.map +1 -1
  234. package/dist/esm/integrations/offline/syncReplayService.js +8 -2
  235. package/dist/esm/integrations/offline/syncReplayService.js.map +1 -1
  236. package/dist/esm/l10n/en.json.js +20 -1
  237. package/dist/esm/l10n/en.json.js.map +1 -1
  238. package/dist/esm/l10n/nl.json.js +70 -2
  239. package/dist/esm/l10n/nl.json.js.map +1 -1
  240. package/dist/esm/nextcloud-vue.css +2192 -222
  241. package/dist/esm/utils/contentHeaderLink.js +51 -0
  242. package/dist/esm/utils/contentHeaderLink.js.map +1 -0
  243. package/dist/esm/utils/detailActionModel.js +60 -3
  244. package/dist/esm/utils/detailActionModel.js.map +1 -1
  245. package/dist/esm/utils/facets.js +75 -3
  246. package/dist/esm/utils/facets.js.map +1 -1
  247. package/dist/esm/utils/fetchFilterCounts.js +40 -5
  248. package/dist/esm/utils/fetchFilterCounts.js.map +1 -1
  249. package/dist/esm/utils/fillTemplate.js +120 -0
  250. package/dist/esm/utils/fillTemplate.js.map +1 -0
  251. package/dist/esm/utils/initials.js +32 -0
  252. package/dist/esm/utils/initials.js.map +1 -0
  253. package/dist/esm/utils/libraryWidgetKeys.js +11 -0
  254. package/dist/esm/utils/libraryWidgetKeys.js.map +1 -1
  255. package/dist/esm/utils/objectWrite.js +59 -0
  256. package/dist/esm/utils/objectWrite.js.map +1 -0
  257. package/dist/esm/utils/pageControls.js +81 -0
  258. package/dist/esm/utils/pageControls.js.map +1 -0
  259. package/dist/esm/utils/personalLenses.js +40 -3
  260. package/dist/esm/utils/personalLenses.js.map +1 -1
  261. package/dist/esm/utils/queryPresets.js +96 -0
  262. package/dist/esm/utils/queryPresets.js.map +1 -0
  263. package/dist/esm/utils/resolveFilterTokens.js +12 -1
  264. package/dist/esm/utils/resolveFilterTokens.js.map +1 -1
  265. package/dist/esm/utils/resolveManifestTokens.js +2 -0
  266. package/dist/esm/utils/resolveManifestTokens.js.map +1 -1
  267. package/dist/esm/utils/schema.js +21 -0
  268. package/dist/esm/utils/schema.js.map +1 -1
  269. package/dist/esm/utils/sentinelTokens.js +22 -4
  270. package/dist/esm/utils/sentinelTokens.js.map +1 -1
  271. package/dist/esm/utils/userGroupsPeek.js +91 -0
  272. package/dist/esm/utils/userGroupsPeek.js.map +1 -0
  273. package/dist/esm/utils/validateManifestV2.compiled.js +3 -3
  274. package/dist/esm/utils/validateManifestV2.compiled.js.map +1 -1
  275. package/dist/esm/utils/visibleWhen.js +57 -5
  276. package/dist/esm/utils/visibleWhen.js.map +1 -1
  277. package/dist/esm/utils/widgetDispatch.js +7 -1
  278. package/dist/esm/utils/widgetDispatch.js.map +1 -1
  279. package/dist/esm/utils/widgetVisibility.js +4 -57
  280. package/dist/esm/utils/widgetVisibility.js.map +1 -1
  281. package/dist/nextcloud-vue.cjs.js +19708 -9301
  282. package/dist/nextcloud-vue.cjs.js.map +2 -2
  283. package/dist/nextcloud-vue.css +2192 -222
  284. package/l10n/en.json +20 -1
  285. package/l10n/nl.json +70 -2
  286. package/package.json +2 -1
  287. package/scripts/check-docs-mdx.mjs +108 -0
  288. package/src/components/CnActionButtons/CnActionButtons.vue +2 -0
  289. package/src/components/CnActionsBar/CnActionsBar.md +4 -0
  290. package/src/components/CnActionsBar/CnActionsBar.vue +48 -11
  291. package/src/components/CnAppRoot/CnAppRoot.md +4 -2
  292. package/src/components/CnAppRoot/CnAppRoot.vue +151 -59
  293. package/src/components/CnBannerWidget/CnBannerWidget.vue +244 -23
  294. package/src/components/CnCellRenderer/CnCellRenderer.md +2 -0
  295. package/src/components/CnCellRenderer/CnCellRenderer.vue +235 -5
  296. package/src/components/CnChipsFieldWidget/CnChipsFieldWidget.vue +433 -0
  297. package/src/components/CnChipsFieldWidget/index.js +25 -0
  298. package/src/components/CnChoicePickerWidget/CnChoicePickerWidget.vue +556 -0
  299. package/src/components/CnChoicePickerWidget/index.js +26 -0
  300. package/src/components/CnConversationThread/CnConversationWidget.vue +1 -1
  301. package/src/components/CnDashboardGrid/CnDashboardGrid.vue +2 -2
  302. package/src/components/CnDashboardPage/CnDashboardPage.vue +78 -5
  303. package/src/components/CnDataTable/CnDataTable.vue +22 -12
  304. package/src/components/CnDetailPage/CnDetailPage.md +1 -1
  305. package/src/components/CnDetailPage/CnDetailPage.vue +152 -6
  306. package/src/components/CnDetailWidgetHost/CnDetailWidgetHost.vue +66 -0
  307. package/src/components/CnDocumentReviewList/CnDocumentReviewWidget.vue +1 -1
  308. package/src/components/CnFacetSidebar/CnFacetSidebar.vue +7 -7
  309. package/src/components/CnFactsWidget/CnFactsWidget.vue +1190 -0
  310. package/src/components/CnFactsWidget/index.js +29 -0
  311. package/src/components/CnFieldListWidget/CnFieldListWidget.vue +1008 -0
  312. package/src/components/CnFieldListWidget/index.js +28 -0
  313. package/src/components/CnFilesBrowser/CnFilesBrowser.vue +588 -117
  314. package/src/components/CnFilesBrowser/filesBrowser.js +100 -0
  315. package/src/components/CnFilesBrowser/filesBrowserColumns.js +140 -0
  316. package/src/components/CnFormDialog/CnFormDialog.md +9 -3
  317. package/src/components/CnFormDialog/CnFormDialog.vue +69 -21
  318. package/src/components/CnFormPage/CnFormPage.vue +99 -3
  319. package/src/components/CnIndexPage/CnIndexPage.vue +309 -9
  320. package/src/components/CnIndexPage/CnIndexPageWidgets.vue +169 -0
  321. package/src/components/CnIndexSidebar/CnIndexSidebar.vue +7 -7
  322. package/src/components/CnNextStepCard/CnNextStepWidget.vue +1 -1
  323. package/src/components/CnObjectListWidget/CnObjectListWidget.vue +69 -2
  324. package/src/components/CnObjectSidebar/CnFilesTab.vue +70 -1
  325. package/src/components/CnObjectSidebar/CnNotesTab.vue +16 -0
  326. package/src/components/CnPageRenderer/CnPageRenderer.vue +29 -1
  327. package/src/components/CnRadioCardsWidget/CnRadioCardsWidget.vue +313 -0
  328. package/src/components/CnRadioCardsWidget/index.js +27 -0
  329. package/src/components/CnRecordListWidget/CnRecordListWidget.vue +652 -0
  330. package/src/components/CnRecordListWidget/index.js +30 -0
  331. package/src/components/CnSavedViewsWidget/CnSavedViewsWidget.vue +296 -0
  332. package/src/components/CnSavedViewsWidget/index.js +29 -0
  333. package/src/components/CnSectionsWidget/CnSectionsWidget.vue +489 -0
  334. package/src/components/CnSectionsWidget/index.js +34 -0
  335. package/src/components/CnSegmentedControl/CnSegmentedControl.vue +13 -0
  336. package/src/components/CnSettingsFormWidget/CnSettingsFormWidget.vue +555 -0
  337. package/src/components/CnSettingsFormWidget/index.js +26 -0
  338. package/src/components/CnStagesWidget/CnStagesWidget.vue +81 -2
  339. package/src/components/CnStatWidget/CnStatWidget.vue +88 -7
  340. package/src/components/CnStatsBlockWidget/CnStatsBlockWidget.vue +180 -3
  341. package/src/components/CnSwitchRowsWidget/CnSwitchRowsWidget.vue +226 -0
  342. package/src/components/CnSwitchRowsWidget/index.js +25 -0
  343. package/src/components/CnTabsWidget/CnTabsWidget.vue +263 -8
  344. package/src/components/CnTasksWidget/CnTasksWidget.vue +175 -15
  345. package/src/components/CnToggleTableWidget/CnToggleTableWidget.vue +386 -0
  346. package/src/components/CnToggleTableWidget/index.js +26 -0
  347. package/src/components/CnWidgetGrid/registerDashboardWidgets.js +11 -0
  348. package/src/components/CnWidgetObjectTable/CnWidgetObjectTable.vue +7 -2
  349. package/src/components/CnWidgetObjectTable/dashboardRegistration.js +5 -0
  350. package/src/components/CnWorkspaceFilterWidget/CnWorkspaceFilterWidget.vue +493 -11
  351. package/src/components/index.js +19 -0
  352. package/src/composables/__tests__/useFormDraft.spec.js +69 -0
  353. package/src/composables/useFormDraft.js +139 -8
  354. package/src/composables/useListView.js +4 -4
  355. package/src/css/form-field.css +14 -0
  356. package/src/css/index-page.css +71 -0
  357. package/src/css/kpi-card.css +32 -0
  358. package/src/css/look-board-detail.css +113 -2
  359. package/src/css/look-board-index.css +90 -8
  360. package/src/css/look-board.css +109 -2
  361. package/src/css/table.css +19 -0
  362. package/src/index.js +19 -0
  363. package/src/integrations/builtin/field-inspection/CnFieldInspectionCard.vue +35 -20
  364. package/src/integrations/builtin/field-inspection.js +21 -0
  365. package/src/integrations/offline/checklistSubmission.js +137 -0
  366. package/src/integrations/offline/fieldCollectionHelpers.js +69 -4
  367. package/src/integrations/offline/index.js +3 -0
  368. package/src/integrations/offline/offlineDb.js +6 -1
  369. package/src/integrations/offline/syncReplayService.js +8 -2
  370. package/src/schemas/app-manifest-v2.schema.json +196 -13
  371. package/src/utils/contentHeaderLink.js +48 -0
  372. package/src/utils/detailActionModel.js +59 -2
  373. package/src/utils/facets.js +74 -2
  374. package/src/utils/fetchFilterCounts.js +39 -4
  375. package/src/utils/fillTemplate.js +116 -0
  376. package/src/utils/initials.js +29 -0
  377. package/src/utils/libraryWidgetKeys.js +11 -0
  378. package/src/utils/objectWrite.js +55 -0
  379. package/src/utils/pageControls.js +78 -0
  380. package/src/utils/personalLenses.js +39 -2
  381. package/src/utils/queryPresets.js +93 -0
  382. package/src/utils/resolveFilterTokens.js +14 -1
  383. package/src/utils/resolveManifestTokens.js +2 -0
  384. package/src/utils/schema.js +21 -0
  385. package/src/utils/sentinelTokens.js +22 -4
  386. package/src/utils/userGroupsPeek.js +87 -0
  387. package/src/utils/validateManifestV2.compiled.js +3 -3
  388. package/src/utils/visibleWhen.js +56 -4
  389. package/src/utils/widgetDispatch.js +7 -1
  390. package/src/utils/widgetVisibility.js +7 -56
@@ -0,0 +1,867 @@
1
+ import { emit } from '@nextcloud/event-bus';
2
+ import { translate } from '@nextcloud/l10n';
3
+ import { NcLoadingIcon } from '@nextcloud/vue';
4
+ import Check from 'vue-material-design-icons/Check.vue';
5
+ import ContentCopy from 'vue-material-design-icons/ContentCopy.vue';
6
+ import EyeOutline from 'vue-material-design-icons/EyeOutline.vue';
7
+ import __sfc_main from '../CnIcon/CnIcon.vue.js';
8
+ import __sfc_main$1 from '../CnStatusBadge/CnStatusBadge.vue.js';
9
+ import { resolveEndpointRequest } from '../../composables/useEndpointSource.js';
10
+ import { useRefLabels } from '../../composables/useRefLabels.js';
11
+ import { dispatchAction } from '../../utils/actionsDispatcher.js';
12
+ import { isBadgeVariant } from '../../utils/badgeVariants.js';
13
+ import { formatBoardDate } from '../../utils/boardDate.js';
14
+ import { parseDateValue } from '../../utils/dateVariant.js';
15
+ import { readPath } from '../../utils/readPath.js';
16
+ import { resolveDeepTokens, hasUnresolvedDeepTokens } from '../../utils/resolveFilterTokens.js';
17
+
18
+ /** Kinds of entry a `fields[]` item can be. A labelled item without `as` is a row. */
19
+ const KINDS = Object.freeze(['row', 'title', 'line', 'pill', 'lead', 'text']);
20
+
21
+ /**
22
+ * The label resolver every facts widget on the page shares, made on first use
23
+ * (the object store needs an active pinia). One batched request per register and
24
+ * schema for the ids it has not seen; a label it has read stays until the page
25
+ * reloads, and an object the store already holds is not fetched at all.
26
+ *
27
+ * @type {{resolve: Function}|null}
28
+ */
29
+ let refLabels = null;
30
+
31
+ /** The page-wide reference label resolver. */
32
+ function sharedRefLabels() {
33
+ if (!refLabels) {
34
+ refLabels = useRefLabels();
35
+ }
36
+ return refLabels
37
+ }
38
+
39
+ /**
40
+ * Key of a resolved reference in the widget's `labels` data.
41
+ *
42
+ * @param {{register: string, schema: string, labelField?: string}} resolve The entry's `resolve` config.
43
+ * @param {string} id The referenced object's id.
44
+ * @return {string} The key.
45
+ */
46
+ function refKey(resolve, id) {
47
+ return `${resolve.register}/${resolve.schema}/${resolve.labelField || ''}/${id}`
48
+ }
49
+
50
+ /** Event-bus channel a reveal of a masked value is announced on, so an app can log it. */
51
+ const FACTS_REVEAL_CHANNEL = 'cn:facts:reveal';
52
+
53
+ /**
54
+ * CnFactsWidget — the `facts` widget: a card of facts about ONE object.
55
+ *
56
+ * Renders the configured fields of the current detail-page object, or of one
57
+ * other object named by `content.source`, as the side cards on the screens
58
+ * draw them: label/value rows (a two-column grid, label muted), a bold title
59
+ * line that may link, muted meta lines that join several fields with " · ",
60
+ * a status pill, and one link at the foot.
61
+ *
62
+ * Everything is configuration; nothing in it knows an app:
63
+ *
64
+ * ```json
65
+ * {
66
+ * "type": "facts",
67
+ * "title": "Zaak",
68
+ * "content": {
69
+ * "source": { "register": "dossiq", "schema": "case", "id": "@object.case" },
70
+ * "fields": [
71
+ * { "as": "title", "path": "title", "route": { "name": "CaseDetail", "params": { "id": "@source.id" } } },
72
+ * { "as": "line", "parts": ["identifier", "caseTypeTitle"] },
73
+ * { "as": "pill", "path": "status", "map": { "open": "In behandeling" } },
74
+ * { "path": "deadline", "label": "Termijn", "format": "date" }
75
+ * ],
76
+ * "link": { "label": "Naar de zaak", "route": { "name": "CaseDetail", "params": { "id": "@source.id" } } },
77
+ * "emptyText": "Geen zaak"
78
+ * }
79
+ * }
80
+ * ```
81
+ *
82
+ * Tokens: `source.id` takes the shared filter tokens; `source.url` takes them
83
+ * inside the url, the endpoint grammar (`/apps/x/api/y/@objectId`)
84
+ * (`@objectId`, `@object.<field>`, `@workspace.<key>`, `@me`, ...). Routes
85
+ * and the link also take `@source.<field>` (a field of the object shown).
86
+ * A source whose id token does not resolve renders the empty text, never a
87
+ * request for the literal token.
88
+ *
89
+ * Labels, map values, the link label and the empty text go through the host
90
+ * app's translate (`cnTranslate`).
91
+ */
92
+ var script = {
93
+ name: 'CnFactsWidget',
94
+
95
+ components: { Check, CnIcon: __sfc_main, CnStatusBadge: __sfc_main$1, ContentCopy, EyeOutline, NcLoadingIcon },
96
+
97
+ inject: {
98
+ cnTranslate: { default: () => (key) => key },
99
+ cnObjectContext: { default: null },
100
+ cnWorkspaceContext: { default: null },
101
+ /** Pre-bound action dispatcher of CnPageRenderer, for `action` / `headerAction`. */
102
+ cnDispatchAction: { default: null },
103
+ },
104
+
105
+ props: {
106
+ /**
107
+ * The widget configuration.
108
+ *
109
+ * - `fields` — the entries, in order. Each is `{ path, label?, as?, format?, map?, itemPath?, parts?, separator?, route?, variant?, variantMap?, icon?, copy?, reveal?, text?, title?, subtitle?, initialsPath?, tone? }`.
110
+ * `as` is `row` (default when `label` or `icon` is set), `title`, `line`, `text` (a line in the normal ink), `lead` (an icon tile or initials beside `title` and `subtitle`) or `pill`.
111
+ * A row's `format` may also be `email`, `phone` or `url` (a link) or `masked` (the last four characters; `reveal: true` adds Show). `copy: true` adds a copy button; `icon` replaces the label.
112
+ * A part may be `{ text }`, a constant; a `line` or `text` entry without `path` or `parts` shows its `text`.
113
+ * `resolve: { register, schema, labelField? }` on an entry or a part turns a value that is a reference (an id, or a list of ids) into the label of the referenced object (`labelField`, else `title`, then `name`): the case type or status of a task shows its name, not its uuid. The ids are fetched once per register and schema through the object store and shared by every facts widget on the page; the entry stays empty until its label is known, and when no label can be read.
114
+ * - `action` — an action drawn as a button under the facts; `headerAction` — one drawn in the card header (reported through the `header` event).
115
+ * `format` is `text` (default), `date` (board short date), `date-long` (always with the year) or `list` (an array joined by ", ", each item read at `itemPath`).
116
+ * `map` turns a raw value into a label (translated). `parts` (on a `line`) lists paths, or `{ path, label?, format? }`, joined by `separator` (default " · "); empty parts are dropped.
117
+ * - `source` — `{ register, schema, id }` or `{ url }`; omitted = the current object.
118
+ * - `link` — `{ label, route? | href? }` at the foot.
119
+ * - `hideEmpty` — drop an entry whose value is empty (default true).
120
+ * - `emptyText` — shown when no entry has a value.
121
+ *
122
+ * @type {{fields?: Array<object>, source?: object, link?: object, hideEmpty?: boolean, emptyText?: string}}
123
+ */
124
+ content: {
125
+ type: Object,
126
+ default: () => ({}),
127
+ },
128
+
129
+ /**
130
+ * The current detail-page object, passed by the detail page host.
131
+ * Read when `content.source` is not set.
132
+ */
133
+ objectData: {
134
+ type: Object,
135
+ default: null,
136
+ },
137
+
138
+ /** The current detail-page object id, for the `@objectId` token. */
139
+ objectId: {
140
+ type: [String, Number],
141
+ default: null,
142
+ },
143
+ },
144
+
145
+ emits: ['header', 'reveal'],
146
+
147
+ data() {
148
+ return {
149
+ fetched: null,
150
+ loading: false,
151
+ error: false,
152
+ /** Keys of the masked rows the reader chose to show. */
153
+ revealed: {},
154
+ /** Key of the row whose value was just copied. */
155
+ copied: '',
156
+ /** Labels of the referenced objects read so far, by `refKey`. */
157
+ labels: {},
158
+ }
159
+ },
160
+
161
+ computed: {
162
+ /**
163
+ * The token context: the detail object (prop, else the injected context)
164
+ * and the page workspace.
165
+ *
166
+ * @return {object}
167
+ */
168
+ tokenCtx() {
169
+ const unwrap = (c) => (c && typeof c === 'object' && 'value' in c ? c.value : c);
170
+ const injected = unwrap(this.cnObjectContext) || {};
171
+ return {
172
+ ...injected,
173
+ objectId: this.objectId ?? injected.objectId ?? this.objectData?.id ?? null,
174
+ object: this.objectData || injected.object || null,
175
+ workspace: unwrap(this.cnWorkspaceContext) || {},
176
+ }
177
+ },
178
+
179
+ /**
180
+ * The source declaration with its tokens resolved, or null for the current object.
181
+ *
182
+ * @return {object|null}
183
+ */
184
+ resolvedSource() {
185
+ const source = this.content?.source;
186
+ if (!source || typeof source !== 'object') {
187
+ return null
188
+ }
189
+ if (typeof source.url === 'string' && source.url !== '') {
190
+ // The endpoint grammar: tokens INSIDE the url, and a request
191
+ // that is blocked while one leaves an empty path segment.
192
+ const request = resolveEndpointRequest({ url: source.url }, this.tokenCtx);
193
+ return { url: request.blocked ? '' : request.url }
194
+ }
195
+ return resolveDeepTokens(source, this.tokenCtx)
196
+ },
197
+
198
+ /**
199
+ * A stable key of the resolved source, so the widget refetches only when it changes.
200
+ *
201
+ * @return {string}
202
+ */
203
+ sourceKey() {
204
+ return this.resolvedSource ? JSON.stringify(this.resolvedSource) : ''
205
+ },
206
+
207
+ /**
208
+ * The object the facts are read from.
209
+ *
210
+ * @return {object|null}
211
+ */
212
+ record() {
213
+ return this.resolvedSource ? this.fetched : this.objectData
214
+ },
215
+
216
+ /**
217
+ * The entries to draw, consecutive rows grouped into one list.
218
+ *
219
+ * @return {Array<object>}
220
+ */
221
+ blocks() {
222
+ const record = this.record;
223
+ if (!record) {
224
+ return []
225
+ }
226
+ const fields = Array.isArray(this.content?.fields) ? this.content.fields : [];
227
+ const hideEmpty = this.content?.hideEmpty !== false;
228
+ const out = [];
229
+ fields.forEach((field, index) => {
230
+ if (!field || typeof field !== 'object') {
231
+ return
232
+ }
233
+ const kind = this.kindOf(field);
234
+ const key = String(field.key || field.path || `${kind}-${index}`).replace(/[^\w-]/g, '-');
235
+ const value = this.entryValue(record, field, kind);
236
+ if (value === '' && (hideEmpty || kind === 'lead')) {
237
+ return
238
+ }
239
+ if (kind === 'row') {
240
+ const last = out[out.length - 1];
241
+ const row = { key, label: this.tr(field.label || ''), value, ...this.rowExtras(record, field, value) };
242
+ if (last && last.kind === 'rows') {
243
+ last.rows.push(row);
244
+ } else {
245
+ out.push({ kind: 'rows', key: `rows-${index}`, rows: [row] });
246
+ }
247
+ return
248
+ }
249
+ const block = { kind, key, value };
250
+ if (kind === 'lead') {
251
+ block.subtitle = this.partsValue(record, field.subtitle);
252
+ block.icon = typeof field.icon === 'string' ? field.icon : '';
253
+ block.initials = block.icon ? '' : this.initialsOf(readPath(record, field.initialsPath));
254
+ block.tone = ['success', 'info', 'warning', 'error'].includes(field.tone) ? field.tone : 'neutral';
255
+ }
256
+ if (kind === 'title' && field.route) {
257
+ block.to = this.resolveRoute(field.route, record);
258
+ }
259
+ if (kind === 'pill') {
260
+ const raw = readPath(record, field.path);
261
+ const variant = (field.variantMap && field.variantMap[raw]) || field.variant;
262
+ block.variant = isBadgeVariant(variant) ? variant : 'default';
263
+ }
264
+ out.push(block);
265
+ });
266
+ return out
267
+ },
268
+
269
+ /**
270
+ * The foot link, resolved, or null.
271
+ *
272
+ * @return {{label: string, to?: object, href?: string}|null}
273
+ */
274
+ link() {
275
+ const link = this.content?.link;
276
+ if (!link || typeof link !== 'object' || !link.label) {
277
+ return null
278
+ }
279
+ if (link.route) {
280
+ const to = this.resolveRoute(link.route, this.record);
281
+ return to ? { label: this.tr(link.label), to } : null
282
+ }
283
+ if (typeof link.href === 'string' && link.href !== '') {
284
+ const href = this.resolveTemplate(link.href, this.record);
285
+ return href ? { label: this.tr(link.label), href } : null
286
+ }
287
+ return null
288
+ },
289
+
290
+ /**
291
+ * The action under the facts, as drawn: `{ label, icon }`, or null.
292
+ *
293
+ * @return {{label: string, icon: string}|null}
294
+ * @spec openspec/changes/screens-relation-pages/specs/relation-pages/spec.md#requirement-the-facts-card-draws-contact-details-identity-and-a-lead
295
+ */
296
+ action() {
297
+ return this.actionView(this.content?.action)
298
+ },
299
+
300
+ /**
301
+ * The header action, as drawn: `{ label, icon }`, or null.
302
+ *
303
+ * @return {{label: string, icon: string}|null}
304
+ * @spec openspec/changes/screens-relation-pages/specs/relation-pages/spec.md#requirement-the-facts-card-draws-contact-details-identity-and-a-lead
305
+ */
306
+ headerAction() {
307
+ return this.actionView(this.content?.headerAction)
308
+ },
309
+
310
+ /** @return {string} The reveal button's text. */
311
+ showLabel() {
312
+ return translate('nextcloud-vue', 'Show')
313
+ },
314
+
315
+ /**
316
+ * The empty line.
317
+ *
318
+ * @return {string}
319
+ */
320
+ emptyLabel() {
321
+ return this.tr(this.content?.emptyText || 'Nothing to show yet')
322
+ },
323
+ },
324
+
325
+ watch: {
326
+ sourceKey: {
327
+ immediate: true,
328
+ handler() {
329
+ this.load();
330
+ },
331
+ },
332
+
333
+ record: {
334
+ immediate: true,
335
+ handler() {
336
+ this.loadLabels();
337
+ },
338
+ },
339
+
340
+ headerAction: {
341
+ immediate: true,
342
+ handler() {
343
+ this.emitHeader();
344
+ },
345
+ },
346
+ },
347
+
348
+ methods: {
349
+ /**
350
+ * Translate through the host app.
351
+ *
352
+ * @param {string} text The text.
353
+ * @return {string}
354
+ */
355
+ tr(text) {
356
+ if (typeof text !== 'string' || text === '') {
357
+ return ''
358
+ }
359
+ return typeof this.cnTranslate === 'function' ? this.cnTranslate(text) : text
360
+ },
361
+
362
+ /**
363
+ * The kind of a field entry.
364
+ *
365
+ * @param {object} field The entry.
366
+ * @return {string} `row`, `title`, `line` or `pill`.
367
+ */
368
+ kindOf(field) {
369
+ if (KINDS.includes(field.as)) {
370
+ return field.as
371
+ }
372
+ return field.label || field.icon ? 'row' : 'line'
373
+ },
374
+
375
+ /**
376
+ * The display text of an entry of any kind: a lead's title, the parts of
377
+ * a line or text, a constant `text`, else the value at `path`.
378
+ *
379
+ * @param {object} record The object.
380
+ * @param {object} field The entry.
381
+ * @param {string} kind The entry's kind.
382
+ * @return {string}
383
+ * @spec openspec/changes/screens-relation-pages/specs/relation-pages/spec.md#requirement-the-facts-card-draws-contact-details-identity-and-a-lead
384
+ */
385
+ entryValue(record, field, kind) {
386
+ if (kind === 'lead') {
387
+ return this.partsValue(record, field.title)
388
+ }
389
+ if ((kind === 'line' || kind === 'text') && Array.isArray(field.parts)) {
390
+ return this.lineValue(record, field)
391
+ }
392
+ if ((kind === 'line' || kind === 'text') && !field.path && typeof field.text === 'string') {
393
+ return this.tr(field.text)
394
+ }
395
+ return this.valueOf(record, field)
396
+ },
397
+
398
+ /**
399
+ * A lead's title or subtitle: a path, a part spec, or an array of parts
400
+ * joined as a line joins them.
401
+ *
402
+ * @param {object} record The object.
403
+ * @param {string|object|Array} spec The declaration.
404
+ * @return {string}
405
+ */
406
+ partsValue(record, spec) {
407
+ if (typeof spec === 'string' && spec !== '') {
408
+ return this.valueOf(record, { path: spec })
409
+ }
410
+ if (Array.isArray(spec)) {
411
+ return this.lineValue(record, { parts: spec })
412
+ }
413
+ if (spec && typeof spec === 'object') {
414
+ return this.lineValue(record, { parts: [spec] })
415
+ }
416
+ return ''
417
+ },
418
+
419
+ /**
420
+ * The initials of a name: "Sanne de Vries" reads "SV".
421
+ *
422
+ * @param {unknown} name The name.
423
+ * @return {string}
424
+ */
425
+ initialsOf(name) {
426
+ if (typeof name !== 'string' || name.trim() === '') {
427
+ return ''
428
+ }
429
+ const words = name.trim().split(/\s+/).filter((word) => /^\p{Lu}/u.test(word));
430
+ const picked = words.length ? words : name.trim().split(/\s+/);
431
+ const first = picked[0].charAt(0);
432
+ const last = picked.length > 1 ? picked[picked.length - 1].charAt(0) : '';
433
+ return (first + last).toUpperCase()
434
+ },
435
+
436
+ /**
437
+ * What a row adds to its value: an icon, a link for the email, phone
438
+ * and url formats, the masked text, and the copy and reveal buttons.
439
+ *
440
+ * @param {object} record The object.
441
+ * @param {object} field The entry.
442
+ * @param {string} value The display text.
443
+ * @return {object}
444
+ * @spec openspec/changes/screens-relation-pages/specs/relation-pages/spec.md#requirement-the-facts-card-draws-contact-details-identity-and-a-lead
445
+ */
446
+ rowExtras(record, field, value) {
447
+ const extras = {
448
+ icon: typeof field.icon === 'string' ? field.icon : '',
449
+ path: field.path || '',
450
+ raw: readPath(record, field.path),
451
+ copy: field.copy === true && value !== '',
452
+ reveal: false,
453
+ masked: '',
454
+ href: '',
455
+ external: false,
456
+ };
457
+ if (value === '') {
458
+ return extras
459
+ }
460
+ if (field.format === 'email') {
461
+ extras.href = `mailto:${value}`;
462
+ } else if (field.format === 'phone') {
463
+ extras.href = `tel:${value.replace(/[^\d+]/g, '')}`;
464
+ } else if (field.format === 'url') {
465
+ extras.href = /^https?:\/\//i.test(value) ? value : `https://${value}`;
466
+ extras.external = true;
467
+ } else if (field.format === 'masked') {
468
+ extras.masked = value.length > 4 ? '*'.repeat(Math.min(value.length - 4, 5)) + value.slice(-4) : value;
469
+ extras.reveal = field.reveal === true && value.length > 4;
470
+ }
471
+ return extras
472
+ },
473
+
474
+ /**
475
+ * Show a masked value, and say so: the `reveal` event and the event-bus
476
+ * channel {@link FACTS_REVEAL_CHANNEL}, so an app can log who saw it.
477
+ *
478
+ * @param {object} row The row.
479
+ * @spec openspec/changes/screens-relation-pages/specs/relation-pages/spec.md#requirement-the-facts-card-draws-contact-details-identity-and-a-lead
480
+ */
481
+ reveal(row) {
482
+ this.revealed = { ...this.revealed, [row.key]: true };
483
+ const detail = { path: row.path };
484
+ /**
485
+ * @event reveal Emitted when the reader shows a masked value.
486
+ * @type {{path: string}} The path of the shown field.
487
+ */
488
+ this.$emit('reveal', detail);
489
+ emit(FACTS_REVEAL_CHANNEL, { ...detail, objectId: this.tokenCtx.objectId, register: this.tokenCtx.register || null, schema: this.tokenCtx.schema || null });
490
+ },
491
+
492
+ /**
493
+ * Copy a row's value to the clipboard.
494
+ *
495
+ * @param {object} row The row.
496
+ * @return {Promise<void>}
497
+ */
498
+ async copy(row) {
499
+ const text = row.raw === null || row.raw === undefined || typeof row.raw === 'object' ? row.value : String(row.raw);
500
+ try {
501
+ await navigator.clipboard.writeText(text);
502
+ this.copied = row.key;
503
+ setTimeout(() => {
504
+ if (this.copied === row.key) {
505
+ this.copied = '';
506
+ }
507
+ }, 2000);
508
+ } catch (e) {
509
+ // eslint-disable-next-line no-console
510
+ console.warn('[CnFactsWidget] could not copy:', e?.message || e);
511
+ }
512
+ },
513
+
514
+ /**
515
+ * @param {object} row The row.
516
+ * @return {string} The copy button's accessible name.
517
+ */
518
+ copyLabel(row) {
519
+ return this.copied === row.key
520
+ ? translate('nextcloud-vue', 'Copied')
521
+ : translate('nextcloud-vue', 'Copy {label}', { label: row.label || row.value })
522
+ },
523
+
524
+ /**
525
+ * @param {object} row The row.
526
+ * @return {string} The reveal button's accessible name.
527
+ */
528
+ revealLabel(row) {
529
+ return translate('nextcloud-vue', 'Show {label}', { label: row.label || '' }).trim()
530
+ },
531
+
532
+ /**
533
+ * The drawn part of an action declaration.
534
+ *
535
+ * @param {object} action The declaration.
536
+ * @return {{label: string, icon: string}|null}
537
+ */
538
+ actionView(action) {
539
+ if (!action || typeof action !== 'object' || typeof action.label !== 'string' || action.label === '') {
540
+ return null
541
+ }
542
+ return { label: this.tr(action.label), icon: typeof action.icon === 'string' ? action.icon : '' }
543
+ },
544
+
545
+ /**
546
+ * Dispatch an action with the record's tokens resolved (`@objectId`,
547
+ * `@object.<field>`), through the page's dispatcher when there is one.
548
+ *
549
+ * @param {object} action The declaration.
550
+ * @return {unknown}
551
+ * @spec openspec/changes/screens-relation-pages/specs/relation-pages/spec.md#requirement-the-facts-card-draws-contact-details-identity-and-a-lead
552
+ */
553
+ runAction(action) {
554
+ if (!action || typeof action !== 'object') {
555
+ return undefined
556
+ }
557
+ const resolved = resolveDeepTokens(action, this.tokenCtx);
558
+ if (typeof this.cnDispatchAction === 'function') {
559
+ return this.cnDispatchAction(resolved)
560
+ }
561
+ return dispatchAction(resolved, { router: this.$router || null })
562
+ },
563
+
564
+ /** Tell the card around the facts what its header shows (the header action). */
565
+ emitHeader() {
566
+ const view = this.headerAction;
567
+ /**
568
+ * @event header Emitted with the card header's parts: the header action, if any.
569
+ * @type {{link: null, note: string, action: (object|null)}} `action` is `{ label, icon, run }`.
570
+ */
571
+ this.$emit('header', {
572
+ link: null,
573
+ note: '',
574
+ action: view ? { ...view, run: () => this.runAction(this.content.headerAction) } : null,
575
+ });
576
+ },
577
+
578
+ /**
579
+ * The text of a reference: the labels of the objects its id(s) name, joined
580
+ * by ", ". An id whose label is not known yet (or cannot be read) adds nothing.
581
+ *
582
+ * @param {unknown} raw The id, or a list of ids (or of `{ id }` objects).
583
+ * @param {object} spec `{ resolve: { register, schema, labelField? }, itemPath? }`.
584
+ * @return {string}
585
+ */
586
+ refText(raw, spec) {
587
+ return this.refIds(raw, spec)
588
+ .map((id) => this.labels[refKey(spec.resolve, id)])
589
+ .filter((label) => typeof label === 'string' && label !== '')
590
+ .join(', ')
591
+ },
592
+
593
+ /**
594
+ * The ids a reference value holds.
595
+ *
596
+ * @param {unknown} raw The value.
597
+ * @param {object} spec `{ itemPath? }`.
598
+ * @return {string[]}
599
+ */
600
+ refIds(raw, spec) {
601
+ return (Array.isArray(raw) ? raw : [raw])
602
+ .map((item) => (item && typeof item === 'object' ? (spec.itemPath ? readPath(item, spec.itemPath) : (item.id ?? item.uuid)) : item))
603
+ .filter((id) => id !== null && id !== undefined && id !== '' && typeof id !== 'object')
604
+ .map(String)
605
+ },
606
+
607
+ /**
608
+ * Every entry or part that carries `resolve`, with the record's value at its path.
609
+ *
610
+ * @param {object} record The object.
611
+ * @return {Array<{spec: object, raw: unknown}>}
612
+ */
613
+ refSpecs(record) {
614
+ const fields = Array.isArray(this.content?.fields) ? this.content.fields : [];
615
+ const specs = [];
616
+ const visit = (spec) => {
617
+ if (!spec || typeof spec !== 'object') {
618
+ return
619
+ }
620
+ if (spec.resolve && typeof spec.resolve === 'object' && spec.path) {
621
+ specs.push({ spec, raw: readPath(record, spec.path) });
622
+ }
623
+ const nested = [...(Array.isArray(spec.parts) ? spec.parts : []), ...(Array.isArray(spec.title) ? spec.title : [spec.title]), ...(Array.isArray(spec.subtitle) ? spec.subtitle : [spec.subtitle])];
624
+ nested.forEach(visit);
625
+ };
626
+ fields.forEach(visit);
627
+ return specs
628
+ },
629
+
630
+ /**
631
+ * Read the labels of the referenced objects, one batched request per
632
+ * register and schema, and keep them in `labels`.
633
+ *
634
+ * @param {object|null} record The object shown (defaults to the current record).
635
+ * @return {Promise<void>}
636
+ */
637
+ async loadLabels(record = this.record) {
638
+ if (!record) {
639
+ return
640
+ }
641
+ const groups = new Map();
642
+ for (const { spec, raw } of this.refSpecs(record)) {
643
+ const { register, schema, labelField } = spec.resolve;
644
+ if (!register || !schema) {
645
+ continue
646
+ }
647
+ const groupKey = `${register}/${schema}/${labelField || ''}`;
648
+ const group = groups.get(groupKey) || { resolve: spec.resolve, ids: new Set() };
649
+ this.refIds(raw, spec).forEach((id) => group.ids.add(id));
650
+ groups.set(groupKey, group);
651
+ }
652
+ if (groups.size === 0) {
653
+ return
654
+ }
655
+ const resolver = sharedRefLabels();
656
+ const next = { ...this.labels };
657
+ await Promise.all([...groups.values()].map(async ({ resolve, ids }) => {
658
+ const found = await resolver.resolve(resolve.register, resolve.schema, [...ids], resolve.labelField);
659
+ Object.entries(found).forEach(([id, label]) => {
660
+ next[refKey(resolve, id)] = label;
661
+ });
662
+ }));
663
+ this.labels = next;
664
+ },
665
+
666
+ /**
667
+ * Read the source object.
668
+ *
669
+ * @return {Promise<void>}
670
+ */
671
+ async load() {
672
+ const source = this.resolvedSource;
673
+ this.error = false;
674
+ if (!source) {
675
+ this.fetched = null;
676
+ return
677
+ }
678
+ const url = this.sourceUrl(source);
679
+ if (!url) {
680
+ this.fetched = null;
681
+ return
682
+ }
683
+ this.loading = true;
684
+ try {
685
+ const [{ default: axios }, { generateUrl }] = await Promise.all([
686
+ import('@nextcloud/axios'),
687
+ import('@nextcloud/router'),
688
+ ]);
689
+ const full = url.startsWith('/apps/') || url.startsWith('/ocs/') ? generateUrl(url) : url;
690
+ const response = await axios.get(full);
691
+ const data = response && response.data;
692
+ this.fetched = data && typeof data === 'object' && !Array.isArray(data) ? data : null;
693
+ } catch (e) {
694
+ // eslint-disable-next-line no-console
695
+ console.warn('[CnFactsWidget] the source could not be read:', e?.message || e);
696
+ this.fetched = null;
697
+ this.error = true;
698
+ } finally {
699
+ this.loading = false;
700
+ }
701
+ },
702
+
703
+ /**
704
+ * The URL of a resolved source, or '' when it cannot be read yet.
705
+ *
706
+ * @param {object} source The resolved source.
707
+ * @return {string}
708
+ */
709
+ sourceUrl(source) {
710
+ if (typeof source.url === 'string') {
711
+ return source.url
712
+ }
713
+ if (hasUnresolvedDeepTokens(source)) {
714
+ return ''
715
+ }
716
+ const { register, schema, id } = source;
717
+ if (!register || !schema || id === undefined || id === null || id === '' || typeof id === 'object') {
718
+ return ''
719
+ }
720
+ return `/apps/openregister/api/objects/${encodeURIComponent(register)}/${encodeURIComponent(schema)}/${encodeURIComponent(String(id))}`
721
+ },
722
+
723
+ /**
724
+ * The display text of one field.
725
+ *
726
+ * @param {object} record The object.
727
+ * @param {object} field The entry.
728
+ * @return {string}
729
+ */
730
+ valueOf(record, field) {
731
+ const raw = readPath(record, field.path);
732
+ return this.format(raw, field)
733
+ },
734
+
735
+ /**
736
+ * The text of a `line` entry that joins several parts.
737
+ *
738
+ * @param {object} record The object.
739
+ * @param {object} field The entry.
740
+ * @return {string}
741
+ */
742
+ lineValue(record, field) {
743
+ const separator = typeof field.separator === 'string' ? field.separator : ' · ';
744
+ return field.parts
745
+ .map((part) => {
746
+ const spec = typeof part === 'string' ? { path: part } : (part || {});
747
+ // A constant part (`{ text }`): "Handelsregister" after the legal form.
748
+ if (!spec.path && typeof spec.text === 'string') {
749
+ return this.tr(spec.text)
750
+ }
751
+ const value = this.format(readPath(record, spec.path), spec);
752
+ if (value === '') {
753
+ return ''
754
+ }
755
+ return spec.label ? `${this.tr(spec.label)} ${value}` : value
756
+ })
757
+ .filter((value) => value !== '')
758
+ .join(separator)
759
+ },
760
+
761
+ /**
762
+ * Format a raw value.
763
+ *
764
+ * @param {unknown} raw The value.
765
+ * @param {object} spec `{ format?, map?, itemPath? }`.
766
+ * @return {string} The text, '' when empty.
767
+ */
768
+ format(raw, spec) {
769
+ if (raw === null || raw === undefined || raw === '') {
770
+ return ''
771
+ }
772
+ if (spec.resolve && typeof spec.resolve === 'object') {
773
+ return this.refText(raw, spec)
774
+ }
775
+ const format = spec.format || 'text';
776
+ if (format === 'list' || Array.isArray(raw)) {
777
+ const items = (Array.isArray(raw) ? raw : [raw])
778
+ .map((item) => (spec.itemPath && item && typeof item === 'object' ? readPath(item, spec.itemPath) : item))
779
+ .map((item) => this.format(item, { ...spec, format: 'text' }))
780
+ .filter((item) => item !== '');
781
+ return items.join(', ')
782
+ }
783
+ if (format === 'date' || format === 'date-long') {
784
+ const date = parseDateValue(raw);
785
+ if (date === null) {
786
+ return ''
787
+ }
788
+ // A year far from now forces the long form, so date-long reuses the board formatter.
789
+ return format === 'date-long'
790
+ ? formatBoardDate(date, new Date(date.getFullYear() + 1, 0, 1))
791
+ : formatBoardDate(date)
792
+ }
793
+ if (typeof raw === 'object') {
794
+ const label = raw.title || raw.name || raw.label || raw.displayName;
795
+ return typeof label === 'string' ? label : ''
796
+ }
797
+ if (typeof raw === 'boolean') {
798
+ const mapped = spec.map && spec.map[String(raw)];
799
+ return mapped ? this.tr(mapped) : this.tr(raw ? 'Yes' : 'No')
800
+ }
801
+ if (spec.map && Object.hasOwn(spec.map, String(raw))) {
802
+ return this.tr(spec.map[String(raw)])
803
+ }
804
+ return String(raw)
805
+ },
806
+
807
+ /**
808
+ * Replace `@source.<field>` / `@source.id` and the shared tokens in a string.
809
+ *
810
+ * @param {string} value The template.
811
+ * @param {object|null} record The object shown.
812
+ * @return {string} The value, '' when a token stays unresolved.
813
+ */
814
+ resolveTemplate(value, record) {
815
+ if (typeof value !== 'string') {
816
+ return value
817
+ }
818
+ let unresolved = false;
819
+ const replaced = value.replace(/@source\.([\w.@]+)/g, (match, path) => {
820
+ const read = record ? (path === 'id' ? (record.id ?? readPath(record, '@self.id')) : readPath(record, path)) : undefined;
821
+ if (read === undefined || read === null || read === '') {
822
+ unresolved = true;
823
+ return match
824
+ }
825
+ return String(read)
826
+ });
827
+ if (unresolved) {
828
+ return ''
829
+ }
830
+ if (replaced.charAt(0) === '@') {
831
+ const resolved = resolveDeepTokens(replaced, this.tokenCtx);
832
+ return typeof resolved === 'string' && resolved.charAt(0) === '@' ? '' : String(resolved)
833
+ }
834
+ return replaced
835
+ },
836
+
837
+ /**
838
+ * Resolve a route declaration (`{ name, params?, query? }`).
839
+ *
840
+ * @param {object} route The declaration.
841
+ * @param {object|null} record The object shown.
842
+ * @return {object|null} The route, or null when a param stays unresolved.
843
+ */
844
+ resolveRoute(route, record) {
845
+ if (!route || typeof route !== 'object' || !route.name) {
846
+ return null
847
+ }
848
+ const out = { name: route.name };
849
+ for (const key of ['params', 'query']) {
850
+ if (route[key] && typeof route[key] === 'object') {
851
+ out[key] = {};
852
+ for (const [name, value] of Object.entries(route[key])) {
853
+ const resolved = this.resolveTemplate(value, record);
854
+ if (resolved === '') {
855
+ return null
856
+ }
857
+ out[key][name] = resolved;
858
+ }
859
+ }
860
+ }
861
+ return out
862
+ },
863
+ },
864
+ };
865
+
866
+ export { FACTS_REVEAL_CHANNEL, script as default };
867
+ //# sourceMappingURL=CnFactsWidget.vue2.js.map