@conduction/nextcloud-vue 2.151.0 → 2.153.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 (147) hide show
  1. package/dist/esm/components/CnAiCompanion/CnAiFloatingButton.vue2.js +13 -1
  2. package/dist/esm/components/CnAiCompanion/CnAiFloatingButton.vue2.js.map +1 -1
  3. package/dist/esm/components/CnAiCompanion/CnAiFloatingButton.vue3.js +1 -1
  4. package/dist/esm/components/CnAiCompanion/CnAiFloatingButton.vue3.js.map +1 -1
  5. package/dist/esm/components/CnAiCompanion/CnAiInput.vue2.js.map +1 -1
  6. package/dist/esm/components/CnAiCompanion/CnAiInput.vue3.js.map +1 -1
  7. package/dist/esm/components/CnAttentionFlagWidget/CnAttentionFlagWidget.vue.js +1 -1
  8. package/dist/esm/components/CnAttentionFlagWidget/CnAttentionFlagWidget.vue2.js.map +1 -1
  9. package/dist/esm/components/CnAttentionFlagWidget/CnAttentionFlagWidget.vue3.js +1 -1
  10. package/dist/esm/components/CnAttentionFlagWidget/CnAttentionFlagWidget.vue3.js.map +1 -1
  11. package/dist/esm/components/CnAuditTrailCard/CnAuditTrailCard.vue.js +1 -1
  12. package/dist/esm/components/CnAuditTrailCard/CnAuditTrailCard.vue2.js +30 -5
  13. package/dist/esm/components/CnAuditTrailCard/CnAuditTrailCard.vue2.js.map +1 -1
  14. package/dist/esm/components/CnAuditTrailCard/CnAuditTrailCard.vue3.js.map +1 -1
  15. package/dist/esm/components/CnBannerWidget/CnBannerWidget.vue.js +1 -1
  16. package/dist/esm/components/CnBannerWidget/CnBannerWidget.vue2.js +38 -0
  17. package/dist/esm/components/CnBannerWidget/CnBannerWidget.vue2.js.map +1 -1
  18. package/dist/esm/components/CnBannerWidget/CnBannerWidget.vue3.js.map +1 -1
  19. package/dist/esm/components/CnConversationThread/CnConversationThread.vue.js +1 -1
  20. package/dist/esm/components/CnConversationThread/CnConversationThread.vue2.js +2 -1
  21. package/dist/esm/components/CnConversationThread/CnConversationThread.vue2.js.map +1 -1
  22. package/dist/esm/components/CnConversationThread/CnConversationThread.vue3.js +33 -25
  23. package/dist/esm/components/CnConversationThread/CnConversationThread.vue3.js.map +1 -1
  24. package/dist/esm/components/CnConversationThread/CnConversationWidget.vue.js +1 -1
  25. package/dist/esm/components/CnConversationThread/CnConversationWidget.vue2.js +22 -2
  26. package/dist/esm/components/CnConversationThread/CnConversationWidget.vue2.js.map +1 -1
  27. package/dist/esm/components/CnConversationThread/CnConversationWidget.vue3.js.map +1 -1
  28. package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue.js +1 -1
  29. package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue2.js.map +1 -1
  30. package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue3.js.map +1 -1
  31. package/dist/esm/components/CnDeviceFramesWidget/CnDeviceFramesWidget.vue.js +1 -1
  32. package/dist/esm/components/CnDeviceFramesWidget/CnDeviceFramesWidget.vue2.js +7 -1
  33. package/dist/esm/components/CnDeviceFramesWidget/CnDeviceFramesWidget.vue2.js.map +1 -1
  34. package/dist/esm/components/CnDeviceFramesWidget/CnDeviceFramesWidget.vue3.js.map +1 -1
  35. package/dist/esm/components/CnExportsWidget/CnExportsWidget.vue.js +1 -1
  36. package/dist/esm/components/CnExportsWidget/CnExportsWidget.vue2.js +2 -1
  37. package/dist/esm/components/CnExportsWidget/CnExportsWidget.vue2.js.map +1 -1
  38. package/dist/esm/components/CnExportsWidget/CnExportsWidget.vue3.js +6 -2
  39. package/dist/esm/components/CnExportsWidget/CnExportsWidget.vue3.js.map +1 -1
  40. package/dist/esm/components/CnFeaturesBoard/CnFeaturesBoard.vue.js +1 -1
  41. package/dist/esm/components/CnFeaturesBoard/CnFeaturesBoard.vue2.js.map +1 -1
  42. package/dist/esm/components/CnFeaturesBoard/CnFeaturesBoard.vue3.js.map +1 -1
  43. package/dist/esm/components/CnFieldListWidget/CnFieldListWidget.vue.js +1 -1
  44. package/dist/esm/components/CnFieldListWidget/CnFieldListWidget.vue2.js +3 -1
  45. package/dist/esm/components/CnFieldListWidget/CnFieldListWidget.vue2.js.map +1 -1
  46. package/dist/esm/components/CnFieldListWidget/CnFieldListWidget.vue3.js +31 -9
  47. package/dist/esm/components/CnFieldListWidget/CnFieldListWidget.vue3.js.map +1 -1
  48. package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js +21 -3
  49. package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js.map +1 -1
  50. package/dist/esm/components/CnIndexPage/CnIndexPage.vue3.js.map +1 -1
  51. package/dist/esm/components/CnMapWidget/CnMapWidget.vue.js +1 -1
  52. package/dist/esm/components/CnMapWidget/CnMapWidget.vue2.js +20 -0
  53. package/dist/esm/components/CnMapWidget/CnMapWidget.vue2.js.map +1 -1
  54. package/dist/esm/components/CnMapWidget/CnMapWidget.vue3.js.map +1 -1
  55. package/dist/esm/components/CnNotificationMatrix/CnNotificationMatrix.vue.js +1 -1
  56. package/dist/esm/components/CnNotificationMatrix/CnNotificationMatrix.vue2.js.map +1 -1
  57. package/dist/esm/components/CnNotificationMatrix/CnNotificationMatrix.vue3.js.map +1 -1
  58. package/dist/esm/components/CnPlanWidget/CnPlanWidget.vue.js +1 -1
  59. package/dist/esm/components/CnPlanWidget/CnPlanWidget.vue2.js +18 -1
  60. package/dist/esm/components/CnPlanWidget/CnPlanWidget.vue2.js.map +1 -1
  61. package/dist/esm/components/CnPlanWidget/CnPlanWidget.vue3.js +4 -2
  62. package/dist/esm/components/CnPlanWidget/CnPlanWidget.vue3.js.map +1 -1
  63. package/dist/esm/components/CnPlanWidget/CnPlanWidgetRow.vue.js +1 -1
  64. package/dist/esm/components/CnPlanWidget/CnPlanWidgetRow.vue2.js +25 -3
  65. package/dist/esm/components/CnPlanWidget/CnPlanWidgetRow.vue2.js.map +1 -1
  66. package/dist/esm/components/CnPlanWidget/CnPlanWidgetRow.vue3.js +1 -1
  67. package/dist/esm/components/CnPlanWidget/CnPlanWidgetRow.vue3.js.map +1 -1
  68. package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue.js +1 -1
  69. package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue2.js +31 -1
  70. package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue2.js.map +1 -1
  71. package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue3.js +102 -97
  72. package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue3.js.map +1 -1
  73. package/dist/esm/components/CnSavedViewLookFields/CnSavedViewLookFields.vue.js +1 -1
  74. package/dist/esm/components/CnSavedViewLookFields/CnSavedViewLookFields.vue2.js +33 -0
  75. package/dist/esm/components/CnSavedViewLookFields/CnSavedViewLookFields.vue2.js.map +1 -1
  76. package/dist/esm/components/CnSavedViewLookFields/CnSavedViewLookFields.vue3.js +2 -2
  77. package/dist/esm/components/CnSavedViewLookFields/CnSavedViewLookFields.vue3.js.map +1 -1
  78. package/dist/esm/components/CnSettingsField/CnSettingsField.vue.js +1 -1
  79. package/dist/esm/components/CnSettingsField/CnSettingsField.vue2.js +2 -1
  80. package/dist/esm/components/CnSettingsField/CnSettingsField.vue2.js.map +1 -1
  81. package/dist/esm/components/CnSettingsField/CnSettingsField.vue3.js +15 -13
  82. package/dist/esm/components/CnSettingsField/CnSettingsField.vue3.js.map +1 -1
  83. package/dist/esm/components/CnSettingsFieldsSection/CnSettingsFieldsSection.vue.js +1 -1
  84. package/dist/esm/components/CnSettingsFieldsSection/CnSettingsFieldsSection.vue2.js +27 -0
  85. package/dist/esm/components/CnSettingsFieldsSection/CnSettingsFieldsSection.vue2.js.map +1 -1
  86. package/dist/esm/components/CnSettingsFieldsSection/CnSettingsFieldsSection.vue3.js +6 -6
  87. package/dist/esm/components/CnSettingsFieldsSection/CnSettingsFieldsSection.vue3.js.map +1 -1
  88. package/dist/esm/components/CnStepper/CnStepper.vue.js +1 -1
  89. package/dist/esm/components/CnStepper/CnStepper.vue2.js.map +1 -1
  90. package/dist/esm/components/CnStepper/CnStepper.vue3.js.map +1 -1
  91. package/dist/esm/components/CnTimelineWidget/CnTimelineManage.vue.js +1 -1
  92. package/dist/esm/components/CnTimelineWidget/CnTimelineManage.vue2.js.map +1 -1
  93. package/dist/esm/components/CnTimelineWidget/CnTimelineManage.vue3.js +14 -14
  94. package/dist/esm/components/CnTimelineWidget/CnTimelineManage.vue3.js.map +1 -1
  95. package/dist/esm/composables/indexSources.js +4 -1
  96. package/dist/esm/composables/indexSources.js.map +1 -1
  97. package/dist/esm/l10n/en.json.js +30 -1
  98. package/dist/esm/l10n/en.json.js.map +1 -1
  99. package/dist/esm/l10n/nl.json.js +31 -2
  100. package/dist/esm/l10n/nl.json.js.map +1 -1
  101. package/dist/esm/library-style.js +1 -1
  102. package/dist/esm/nextcloud-vue.css +1129 -567
  103. package/dist/esm/utils/fillTemplate.js +12 -2
  104. package/dist/esm/utils/fillTemplate.js.map +1 -1
  105. package/dist/esm/utils/libraryTranslate.js +19 -1
  106. package/dist/esm/utils/libraryTranslate.js.map +1 -1
  107. package/dist/esm/utils/savedViewSummary.js +109 -4
  108. package/dist/esm/utils/savedViewSummary.js.map +1 -1
  109. package/dist/nextcloud-vue.cjs.js +1096 -592
  110. package/dist/nextcloud-vue.cjs.js.map +2 -2
  111. package/dist/nextcloud-vue.css +1129 -567
  112. package/l10n/en.json +30 -1
  113. package/l10n/nl.json +31 -2
  114. package/package.json +1 -1
  115. package/src/components/CnAiCompanion/CnAiFloatingButton.vue +14 -2
  116. package/src/components/CnAiCompanion/CnAiInput.vue +19 -0
  117. package/src/components/CnAttentionFlagWidget/CnAttentionFlagWidget.vue +7 -1
  118. package/src/components/CnAuditTrailCard/CnAuditTrailCard.vue +30 -5
  119. package/src/components/CnBannerWidget/CnBannerWidget.vue +38 -0
  120. package/src/components/CnConversationThread/CnConversationThread.vue +7 -1
  121. package/src/components/CnConversationThread/CnConversationWidget.vue +22 -2
  122. package/src/components/CnDashboardPage/CnDashboardPage.vue +17 -0
  123. package/src/components/CnDeviceFramesWidget/CnDeviceFramesWidget.vue +16 -1
  124. package/src/components/CnExportsWidget/CnExportsWidget.vue +5 -1
  125. package/src/components/CnFeaturesBoard/CnFeaturesBoard.vue +2 -0
  126. package/src/components/CnFieldListWidget/CnFieldListWidget.vue +18 -4
  127. package/src/components/CnIndexPage/CnIndexPage.vue +21 -3
  128. package/src/components/CnMapWidget/CnMapWidget.vue +20 -0
  129. package/src/components/CnNotificationMatrix/CnNotificationMatrix.vue +23 -0
  130. package/src/components/CnPlanWidget/CnPlanWidget.vue +20 -1
  131. package/src/components/CnPlanWidget/CnPlanWidgetRow.vue +26 -4
  132. package/src/components/CnRecordListWidget/CnRecordListWidget.vue +73 -5
  133. package/src/components/CnSavedViewLookFields/CnSavedViewLookFields.vue +35 -2
  134. package/src/components/CnSettingsField/CnSettingsField.vue +5 -3
  135. package/src/components/CnSettingsFieldsSection/CnSettingsFieldsSection.vue +31 -4
  136. package/src/components/CnStepper/CnStepper.vue +7 -5
  137. package/src/components/CnTimelineWidget/CnTimelineManage.vue +9 -4
  138. package/src/composables/indexSources.js +4 -1
  139. package/src/css/dialog.css +18 -3
  140. package/src/css/form-field.css +11 -0
  141. package/src/css/look-board-detail.css +124 -1
  142. package/src/css/look-board-index.css +75 -9
  143. package/src/css/look-board.css +242 -6
  144. package/src/css/patches.css +5 -5
  145. package/src/utils/fillTemplate.js +12 -2
  146. package/src/utils/libraryTranslate.js +18 -0
  147. package/src/utils/savedViewSummary.js +109 -4
@@ -2,7 +2,7 @@ import script from './CnDeviceFramesWidget.vue2.js';
2
2
  import { render } from './CnDeviceFramesWidget.vue3.js';
3
3
 
4
4
  script.render = render;
5
- script.__scopeId = "data-v-64bde7d3";
5
+ script.__scopeId = "data-v-9442557e";
6
6
  const __sfc_main = script;
7
7
 
8
8
  export { __sfc_main as default };
@@ -56,6 +56,7 @@ var script = {
56
56
  * `offlineText` while the device is offline and `onlineText` otherwise. `tone` is `warning`
57
57
  * (default while offline), `success` or `info`.
58
58
  * - `width` — the frame width in pixels (default 350).
59
+ * - `height` — the frame height in pixels (at least 400); what does not fit scrolls inside it. Without it the frame grows with its content.
59
60
  *
60
61
  * @type {{frames?: Array<object>, status?: object, width?: number}}
61
62
  */
@@ -143,7 +144,12 @@ var script = {
143
144
  /** @return {object} The frame width. */
144
145
  frameStyle() {
145
146
  const width = Number(this.content?.width);
146
- return { '--cn-device-frame-width': `${Number.isFinite(width) && width >= 240 ? width : 350}px` }
147
+ const height = Number(this.content?.height);
148
+ const style = { '--cn-device-frame-width': `${Number.isFinite(width) && width >= 240 ? width : 350}px` };
149
+ if (Number.isFinite(height) && height >= 400) {
150
+ style['--cn-device-frame-height'] = `${height}px`;
151
+ }
152
+ return style
147
153
  },
148
154
 
149
155
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"CnDeviceFramesWidget.vue2.js","sources":["../../../../src/components/CnDeviceFramesWidget/CnDeviceFramesWidget.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n\n<template>\n\t<div class=\"cn-device-frames-widget\" data-testid=\"cn-device-frames-widget\">\n\t\t<section\n\t\t\tv-for=\"frame in frames\"\n\t\t\t:key=\"frame.key\"\n\t\t\tclass=\"cn-device-frames-widget__frame\"\n\t\t\t:style=\"frameStyle\"\n\t\t\t:aria-labelledby=\"headingId(frame.key)\"\n\t\t\t:data-testid=\"`cn-device-frame-${frame.key}`\">\n\t\t\t<header class=\"cn-device-frames-widget__head\">\n\t\t\t\t<span\n\t\t\t\t\tv-if=\"frame.status\"\n\t\t\t\t\tclass=\"cn-device-frames-widget__status\"\n\t\t\t\t\t:class=\"`cn-device-frames-widget__status--${frame.status.tone}`\"\n\t\t\t\t\tdata-testid=\"cn-device-frame-status\">\n\t\t\t\t\t<component :is=\"frame.status.icon\" :size=\"16\" aria-hidden=\"true\" />\n\t\t\t\t\t{{ frame.status.text }}\n\t\t\t\t</span>\n\t\t\t\t<h3 :id=\"headingId(frame.key)\" class=\"cn-device-frames-widget__title\">\n\t\t\t\t\t{{ frame.title }}\n\t\t\t\t</h3>\n\t\t\t</header>\n\t\t\t<div class=\"cn-device-frames-widget__body\">\n\t\t\t\t<CnSectionsWidget\n\t\t\t\t\t:content=\"{ sections: frame.sections, cards: false, hideEmpty: true }\"\n\t\t\t\t\t:availableWidgets=\"availableWidgets\"\n\t\t\t\t\t:objectId=\"objectId\"\n\t\t\t\t\t:objectData=\"objectData\"\n\t\t\t\t\t:objectType=\"objectType\"\n\t\t\t\t\t:schemaObject=\"schemaObject\"\n\t\t\t\t\t:register=\"register\"\n\t\t\t\t\t:schema=\"schema\"\n\t\t\t\t\t:store=\"store\"\n\t\t\t\t\t:surface=\"surface\"\n\t\t\t\t\t:integrationContext=\"integrationContext\"\n\t\t\t\t\t:cnRegistry=\"cnRegistry\" />\n\t\t\t</div>\n\t\t</section>\n\t</div>\n</template>\n\n<script>\nimport { markRaw } from 'vue'\nimport CloudCheckOutline from 'vue-material-design-icons/CloudCheckOutline.vue'\nimport CloudOffOutline from 'vue-material-design-icons/CloudOffOutline.vue'\nimport InformationOutline from 'vue-material-design-icons/InformationOutline.vue'\nimport CnSectionsWidget from '../CnSectionsWidget/CnSectionsWidget.vue'\n\n/** Counter for unique heading ids across instances. */\nlet instanceCounter = 0\n\n/**\n * CnDeviceFramesWidget - the `device-frames` widget: several small pages side\n * by side, each in a phone frame with its own header (board DqInspectie,\n * \"Inspectie in het veld\": the day offline, a checklist question with a\n * photo, and the sync queue).\n *\n * Each frame stacks widgets of the surface, as the `sections` widget does,\n * under a header with the frame's title and an optional status line. The\n * status can follow the connection (\"Offline · synced at 07:42\" while the\n * device is offline). The frames wrap onto the next row when the page is\n * narrower, and a frame takes the full width on a phone.\n *\n * ```json\n * {\n * \"type\": \"device-frames\",\n * \"content\": {\n * \"width\": 350,\n * \"status\": { \"followConnection\": true, \"offlineText\": \"Offline · synced at 07:42\", \"onlineText\": \"Online\" },\n * \"frames\": [\n * { \"key\": \"today\", \"title\": \"Today\", \"widgetIds\": [\"today-runs\", \"offline-note\"] },\n * { \"key\": \"question\", \"title\": \"Kerkplein 7\", \"widgetIds\": [\"checklist-run\"] },\n * { \"key\": \"sync\", \"title\": \"Synchronise\", \"widgetIds\": [\"sync-queue\"] }\n * ]\n * }\n * }\n * ```\n *\n * @spec openspec/changes/device-frames-widget/specs/device-frames-widget/spec.md#requirement-a-page-can-show-several-small-pages-as-phone-frames\n */\nexport default {\n\tname: 'CnDeviceFramesWidget',\n\n\tcomponents: { CnSectionsWidget },\n\n\tinject: {\n\t\tcnTranslate: { default: () => (key) => key },\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * The widget configuration.\n\t\t *\n\t\t * - `frames` — `[{ key?, title, widgetIds? | sections?, status? }]`, in order. `widgetIds` names\n\t\t * widgets of the surface, stacked; `sections` takes the `sections` widget's entries instead.\n\t\t * - `status` — the status line of every frame (a frame's own `status` wins): `{ text?, tone?,\n\t\t * followConnection?, onlineText?, offlineText? }`. With `followConnection` the line reads\n\t\t * `offlineText` while the device is offline and `onlineText` otherwise. `tone` is `warning`\n\t\t * (default while offline), `success` or `info`.\n\t\t * - `width` — the frame width in pixels (default 350).\n\t\t *\n\t\t * @type {{frames?: Array<object>, status?: object, width?: number}}\n\t\t */\n\t\tcontent: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({}),\n\t\t},\n\n\t\t/** Sibling widget definitions on the surface, for `widgetIds`. */\n\t\tavailableWidgets: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t\t/** The bound record's id, forwarded to the children. */\n\t\tobjectId: {\n\t\t\ttype: [String, Number],\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The loaded record, forwarded to the children. */\n\t\tobjectData: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** The resolved object-type slug. */\n\t\tobjectType: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The resolved JSON Schema object. */\n\t\tschemaObject: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** OpenRegister register slug of the surface. */\n\t\tregister: {\n\t\t\ttype: [String, Object],\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** OpenRegister schema slug of the surface. */\n\t\tschema: {\n\t\t\ttype: [String, Object],\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The effective object store. */\n\t\tstore: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** Rendering surface forwarded to the children. */\n\t\tsurface: {\n\t\t\ttype: String,\n\t\t\tdefault: 'app-dashboard',\n\t\t},\n\n\t\t/** Object context forwarded to integration children. */\n\t\tintegrationContext: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** The consumer's component registry, for custom child widget types. */\n\t\tcnRegistry: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({}),\n\t\t},\n\t},\n\n\tdata() {\n\t\tinstanceCounter += 1\n\t\treturn {\n\t\t\tuid: instanceCounter,\n\t\t\tonline: typeof navigator === 'undefined' || navigator.onLine !== false,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/** @return {object} The frame width. */\n\t\tframeStyle() {\n\t\t\tconst width = Number(this.content?.width)\n\t\t\treturn { '--cn-device-frame-width': `${Number.isFinite(width) && width >= 240 ? width : 350}px` }\n\t\t},\n\n\t\t/**\n\t\t * The frames to draw: a key, a translated title, the sections and the\n\t\t * status line.\n\t\t *\n\t\t * @return {Array<{key: string, title: string, sections: Array<object>, status: object|null}>}\n\t\t */\n\t\tframes() {\n\t\t\tconst list = Array.isArray(this.content?.frames) ? this.content.frames : []\n\t\t\treturn list\n\t\t\t\t.filter((frame) => frame && typeof frame === 'object')\n\t\t\t\t.map((frame, index) => {\n\t\t\t\t\tconst sections = Array.isArray(frame.sections)\n\t\t\t\t\t\t? frame.sections\n\t\t\t\t\t\t: (Array.isArray(frame.widgetIds) ? frame.widgetIds : []).filter((id) => typeof id === 'string' && id !== '').map((widgetId) => ({ widgetId }))\n\t\t\t\t\treturn {\n\t\t\t\t\t\tkey: String(frame.key || `frame-${index}`).replace(/[^\\w-]/g, '-'),\n\t\t\t\t\t\ttitle: this.tr(frame.title || ''),\n\t\t\t\t\t\tsections,\n\t\t\t\t\t\tstatus: this.statusOf(frame.status || this.content?.status || null),\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t},\n\t},\n\n\tmounted() {\n\t\tif (typeof window !== 'undefined') {\n\t\t\twindow.addEventListener('online', this.onConnection)\n\t\t\twindow.addEventListener('offline', this.onConnection)\n\t\t}\n\t},\n\n\tbeforeUnmount() {\n\t\tif (typeof window !== 'undefined') {\n\t\t\twindow.removeEventListener('online', this.onConnection)\n\t\t\twindow.removeEventListener('offline', this.onConnection)\n\t\t}\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Translate through the app's translate.\n\t\t *\n\t\t * @param {string} key The source string.\n\t\t * @return {string}\n\t\t */\n\t\ttr(key) {\n\t\t\treturn key && typeof this.cnTranslate === 'function' ? this.cnTranslate(key) : (key || '')\n\t\t},\n\n\t\t/**\n\t\t * The status line of a frame, or null.\n\t\t *\n\t\t * @param {object|null} status The configured status.\n\t\t * @return {{text: string, tone: string, icon: object}|null}\n\t\t */\n\t\tstatusOf(status) {\n\t\t\tif (!status || typeof status !== 'object') {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tlet text = status.text\n\t\t\tlet tone = status.tone\n\t\t\tif (status.followConnection === true) {\n\t\t\t\ttext = this.online ? status.onlineText : status.offlineText\n\t\t\t\ttone = tone || (this.online ? 'success' : 'warning')\n\t\t\t}\n\t\t\tif (typeof text !== 'string' || text === '') {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tconst known = ['warning', 'success', 'info'].includes(tone) ? tone : 'info'\n\t\t\tconst icon = known === 'warning' ? CloudOffOutline : (known === 'success' ? CloudCheckOutline : InformationOutline)\n\t\t\treturn { text: this.tr(text), tone: known, icon: markRaw(icon) }\n\t\t},\n\n\t\t/** Follow the browser's connection state. */\n\t\tonConnection() {\n\t\t\tthis.online = typeof navigator === 'undefined' || navigator.onLine !== false\n\t\t},\n\n\t\t/**\n\t\t * The id of a frame's heading.\n\t\t *\n\t\t * @param {string} key The frame key.\n\t\t * @return {string}\n\t\t */\n\t\theadingId(key) {\n\t\t\treturn `cn-device-frame-${this.uid}-${key}`\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-device-frames-widget {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\talign-items: flex-start;\n\tgap: 20px;\n}\n\n.cn-device-frames-widget__frame {\n\tdisplay: flex;\n\tflex: none;\n\tflex-direction: column;\n\twidth: var(--cn-device-frame-width, 350px);\n\tmax-width: 100%;\n\tmin-height: 600px;\n\tbox-sizing: border-box;\n\toverflow: hidden;\n\tborder: 10px solid var(--color-main-text);\n\tborder-radius: 36px;\n\tbackground: var(--color-background-hover);\n}\n\n.cn-device-frames-widget__head {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 6px;\n\tpadding: 14px 18px 10px;\n\tborder-bottom: 1px solid var(--color-border);\n\tbackground: var(--color-main-background);\n}\n\n.cn-device-frames-widget__status {\n\tdisplay: inline-flex;\n\talign-items: center;\n\tgap: 6px;\n\tfont-size: 13px;\n\tfont-weight: 600;\n}\n\n.cn-device-frames-widget__status--warning {\n\tcolor: var(--color-warning-text, var(--color-main-text));\n}\n\n.cn-device-frames-widget__status--success {\n\tcolor: var(--color-success-text, var(--color-main-text));\n}\n\n.cn-device-frames-widget__status--info {\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-device-frames-widget__title {\n\tmargin: 0;\n\tfont-size: 20px;\n\tfont-weight: 700;\n\tline-height: 1.2;\n}\n\n.cn-device-frames-widget__body {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 12px;\n\tpadding: 14px;\n}\n\n/* On a phone the frame is the screen: no bezel, the full width. */\n@media (max-width: 640px) {\n\t.cn-device-frames-widget__frame {\n\t\twidth: 100%;\n\t\tmin-height: 0;\n\t\tborder-width: 0;\n\t\tborder-radius: var(--cn-board-card-radius, 12px);\n\t}\n}\n</style>\n"],"names":["CnSectionsWidget"],"mappings":";;;;;;AAqDA;AACA,IAAI,kBAAkB,EAAA;;AAEtB;AACC;;;;AAIA;;;;;AAKA;AACA;AACA;;;;;;;AAOA;AACA;AACA;;;;AAIA;AACA;AACA;;AAED,aAAe;CACd,IAAI,EAAE,sBAAsB;;CAE5B,UAAU,EAAE,oBAAEA,UAAe,EAAG;;AAEhC,CAAA,MAAM,EAAE;AACP,EAAA,WAAW,EAAE,EAAE,OAAO,EAAE,MAAM,CAAC,GAAG,KAAK,KAAK;EAC5C;;AAED,CAAA,KAAK,EAAE;AACN;;AAEC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGD,EAAA,OAAO,EAAE;GACR,IAAI,EAAE,MAAM;AACZ,GAAA,OAAO,EAAE,OAAO,EAAE,CAAC;GACnB;;;AAGD,EAAA,gBAAgB,EAAE;GACjB,IAAI,EAAE,KAAK;AACX,GAAA,OAAO,EAAE,MAAM,EAAE;GACjB;;;AAGD,EAAA,QAAQ,EAAE;AACT,GAAA,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;GACtB,OAAO,EAAE,EAAE;GACX;;AAED;EACA,UAAU,EAAE;GACX,IAAI,EAAE,MAAM;GACZ,OAAO,EAAE,IAAI;GACb;;AAED;EACA,UAAU,EAAE;GACX,IAAI,EAAE,MAAM;GACZ,OAAO,EAAE,EAAE;GACX;;AAED;EACA,YAAY,EAAE;GACb,IAAI,EAAE,MAAM;GACZ,OAAO,EAAE,IAAI;GACb;;AAED;AACA,EAAA,QAAQ,EAAE;AACT,GAAA,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;GACtB,OAAO,EAAE,EAAE;GACX;;AAED;AACA,EAAA,MAAM,EAAE;AACP,GAAA,IAAI,EAAE,CAAC,MAAM,EAAE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,MAAO,KAAI,MAAI;GAC3E;;AAED;;AAEC;;AAEA;;AAED,EAAA,SAAS,CAAC,GAAG,EAAE;AACd,GAAA,OAAO,CAAC,gBAAgB,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,CAAA;GAC1C;EACD;AACF;;;;"}
1
+ {"version":3,"file":"CnDeviceFramesWidget.vue2.js","sources":["../../../../src/components/CnDeviceFramesWidget/CnDeviceFramesWidget.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n\n<template>\n\t<div class=\"cn-device-frames-widget\" data-testid=\"cn-device-frames-widget\">\n\t\t<section\n\t\t\tv-for=\"frame in frames\"\n\t\t\t:key=\"frame.key\"\n\t\t\tclass=\"cn-device-frames-widget__frame\"\n\t\t\t:style=\"frameStyle\"\n\t\t\t:aria-labelledby=\"headingId(frame.key)\"\n\t\t\t:data-testid=\"`cn-device-frame-${frame.key}`\">\n\t\t\t<header class=\"cn-device-frames-widget__head\">\n\t\t\t\t<span\n\t\t\t\t\tv-if=\"frame.status\"\n\t\t\t\t\tclass=\"cn-device-frames-widget__status\"\n\t\t\t\t\t:class=\"`cn-device-frames-widget__status--${frame.status.tone}`\"\n\t\t\t\t\tdata-testid=\"cn-device-frame-status\">\n\t\t\t\t\t<component :is=\"frame.status.icon\" :size=\"16\" aria-hidden=\"true\" />\n\t\t\t\t\t{{ frame.status.text }}\n\t\t\t\t</span>\n\t\t\t\t<h3 :id=\"headingId(frame.key)\" class=\"cn-device-frames-widget__title\">\n\t\t\t\t\t{{ frame.title }}\n\t\t\t\t</h3>\n\t\t\t</header>\n\t\t\t<div class=\"cn-device-frames-widget__body\">\n\t\t\t\t<CnSectionsWidget\n\t\t\t\t\t:content=\"{ sections: frame.sections, cards: false, hideEmpty: true }\"\n\t\t\t\t\t:availableWidgets=\"availableWidgets\"\n\t\t\t\t\t:objectId=\"objectId\"\n\t\t\t\t\t:objectData=\"objectData\"\n\t\t\t\t\t:objectType=\"objectType\"\n\t\t\t\t\t:schemaObject=\"schemaObject\"\n\t\t\t\t\t:register=\"register\"\n\t\t\t\t\t:schema=\"schema\"\n\t\t\t\t\t:store=\"store\"\n\t\t\t\t\t:surface=\"surface\"\n\t\t\t\t\t:integrationContext=\"integrationContext\"\n\t\t\t\t\t:cnRegistry=\"cnRegistry\" />\n\t\t\t</div>\n\t\t</section>\n\t</div>\n</template>\n\n<script>\nimport { markRaw } from 'vue'\nimport CloudCheckOutline from 'vue-material-design-icons/CloudCheckOutline.vue'\nimport CloudOffOutline from 'vue-material-design-icons/CloudOffOutline.vue'\nimport InformationOutline from 'vue-material-design-icons/InformationOutline.vue'\nimport CnSectionsWidget from '../CnSectionsWidget/CnSectionsWidget.vue'\n\n/** Counter for unique heading ids across instances. */\nlet instanceCounter = 0\n\n/**\n * CnDeviceFramesWidget - the `device-frames` widget: several small pages side\n * by side, each in a phone frame with its own header (board DqInspectie,\n * \"Inspectie in het veld\": the day offline, a checklist question with a\n * photo, and the sync queue).\n *\n * Each frame stacks widgets of the surface, as the `sections` widget does,\n * under a header with the frame's title and an optional status line. The\n * status can follow the connection (\"Offline · synced at 07:42\" while the\n * device is offline). The frames wrap onto the next row when the page is\n * narrower, and a frame takes the full width on a phone.\n *\n * ```json\n * {\n * \"type\": \"device-frames\",\n * \"content\": {\n * \"width\": 350,\n * \"status\": { \"followConnection\": true, \"offlineText\": \"Offline · synced at 07:42\", \"onlineText\": \"Online\" },\n * \"frames\": [\n * { \"key\": \"today\", \"title\": \"Today\", \"widgetIds\": [\"today-runs\", \"offline-note\"] },\n * { \"key\": \"question\", \"title\": \"Kerkplein 7\", \"widgetIds\": [\"checklist-run\"] },\n * { \"key\": \"sync\", \"title\": \"Synchronise\", \"widgetIds\": [\"sync-queue\"] }\n * ]\n * }\n * }\n * ```\n *\n * @spec openspec/changes/device-frames-widget/specs/device-frames-widget/spec.md#requirement-a-page-can-show-several-small-pages-as-phone-frames\n */\nexport default {\n\tname: 'CnDeviceFramesWidget',\n\n\tcomponents: { CnSectionsWidget },\n\n\tinject: {\n\t\tcnTranslate: { default: () => (key) => key },\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * The widget configuration.\n\t\t *\n\t\t * - `frames` — `[{ key?, title, widgetIds? | sections?, status? }]`, in order. `widgetIds` names\n\t\t * widgets of the surface, stacked; `sections` takes the `sections` widget's entries instead.\n\t\t * - `status` — the status line of every frame (a frame's own `status` wins): `{ text?, tone?,\n\t\t * followConnection?, onlineText?, offlineText? }`. With `followConnection` the line reads\n\t\t * `offlineText` while the device is offline and `onlineText` otherwise. `tone` is `warning`\n\t\t * (default while offline), `success` or `info`.\n\t\t * - `width` — the frame width in pixels (default 350).\n\t\t * - `height` — the frame height in pixels (at least 400); what does not fit scrolls inside it. Without it the frame grows with its content.\n\t\t *\n\t\t * @type {{frames?: Array<object>, status?: object, width?: number}}\n\t\t */\n\t\tcontent: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({}),\n\t\t},\n\n\t\t/** Sibling widget definitions on the surface, for `widgetIds`. */\n\t\tavailableWidgets: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t\t/** The bound record's id, forwarded to the children. */\n\t\tobjectId: {\n\t\t\ttype: [String, Number],\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The loaded record, forwarded to the children. */\n\t\tobjectData: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** The resolved object-type slug. */\n\t\tobjectType: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The resolved JSON Schema object. */\n\t\tschemaObject: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** OpenRegister register slug of the surface. */\n\t\tregister: {\n\t\t\ttype: [String, Object],\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** OpenRegister schema slug of the surface. */\n\t\tschema: {\n\t\t\ttype: [String, Object],\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The effective object store. */\n\t\tstore: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** Rendering surface forwarded to the children. */\n\t\tsurface: {\n\t\t\ttype: String,\n\t\t\tdefault: 'app-dashboard',\n\t\t},\n\n\t\t/** Object context forwarded to integration children. */\n\t\tintegrationContext: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** The consumer's component registry, for custom child widget types. */\n\t\tcnRegistry: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({}),\n\t\t},\n\t},\n\n\tdata() {\n\t\tinstanceCounter += 1\n\t\treturn {\n\t\t\tuid: instanceCounter,\n\t\t\tonline: typeof navigator === 'undefined' || navigator.onLine !== false,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/** @return {object} The frame width. */\n\t\tframeStyle() {\n\t\t\tconst width = Number(this.content?.width)\n\t\t\tconst height = Number(this.content?.height)\n\t\t\tconst style = { '--cn-device-frame-width': `${Number.isFinite(width) && width >= 240 ? width : 350}px` }\n\t\t\tif (Number.isFinite(height) && height >= 400) {\n\t\t\t\tstyle['--cn-device-frame-height'] = `${height}px`\n\t\t\t}\n\t\t\treturn style\n\t\t},\n\n\t\t/**\n\t\t * The frames to draw: a key, a translated title, the sections and the\n\t\t * status line.\n\t\t *\n\t\t * @return {Array<{key: string, title: string, sections: Array<object>, status: object|null}>}\n\t\t */\n\t\tframes() {\n\t\t\tconst list = Array.isArray(this.content?.frames) ? this.content.frames : []\n\t\t\treturn list\n\t\t\t\t.filter((frame) => frame && typeof frame === 'object')\n\t\t\t\t.map((frame, index) => {\n\t\t\t\t\tconst sections = Array.isArray(frame.sections)\n\t\t\t\t\t\t? frame.sections\n\t\t\t\t\t\t: (Array.isArray(frame.widgetIds) ? frame.widgetIds : []).filter((id) => typeof id === 'string' && id !== '').map((widgetId) => ({ widgetId }))\n\t\t\t\t\treturn {\n\t\t\t\t\t\tkey: String(frame.key || `frame-${index}`).replace(/[^\\w-]/g, '-'),\n\t\t\t\t\t\ttitle: this.tr(frame.title || ''),\n\t\t\t\t\t\tsections,\n\t\t\t\t\t\tstatus: this.statusOf(frame.status || this.content?.status || null),\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t},\n\t},\n\n\tmounted() {\n\t\tif (typeof window !== 'undefined') {\n\t\t\twindow.addEventListener('online', this.onConnection)\n\t\t\twindow.addEventListener('offline', this.onConnection)\n\t\t}\n\t},\n\n\tbeforeUnmount() {\n\t\tif (typeof window !== 'undefined') {\n\t\t\twindow.removeEventListener('online', this.onConnection)\n\t\t\twindow.removeEventListener('offline', this.onConnection)\n\t\t}\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Translate through the app's translate.\n\t\t *\n\t\t * @param {string} key The source string.\n\t\t * @return {string}\n\t\t */\n\t\ttr(key) {\n\t\t\treturn key && typeof this.cnTranslate === 'function' ? this.cnTranslate(key) : (key || '')\n\t\t},\n\n\t\t/**\n\t\t * The status line of a frame, or null.\n\t\t *\n\t\t * @param {object|null} status The configured status.\n\t\t * @return {{text: string, tone: string, icon: object}|null}\n\t\t */\n\t\tstatusOf(status) {\n\t\t\tif (!status || typeof status !== 'object') {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tlet text = status.text\n\t\t\tlet tone = status.tone\n\t\t\tif (status.followConnection === true) {\n\t\t\t\ttext = this.online ? status.onlineText : status.offlineText\n\t\t\t\ttone = tone || (this.online ? 'success' : 'warning')\n\t\t\t}\n\t\t\tif (typeof text !== 'string' || text === '') {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tconst known = ['warning', 'success', 'info'].includes(tone) ? tone : 'info'\n\t\t\tconst icon = known === 'warning' ? CloudOffOutline : (known === 'success' ? CloudCheckOutline : InformationOutline)\n\t\t\treturn { text: this.tr(text), tone: known, icon: markRaw(icon) }\n\t\t},\n\n\t\t/** Follow the browser's connection state. */\n\t\tonConnection() {\n\t\t\tthis.online = typeof navigator === 'undefined' || navigator.onLine !== false\n\t\t},\n\n\t\t/**\n\t\t * The id of a frame's heading.\n\t\t *\n\t\t * @param {string} key The frame key.\n\t\t * @return {string}\n\t\t */\n\t\theadingId(key) {\n\t\t\treturn `cn-device-frame-${this.uid}-${key}`\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-device-frames-widget {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\talign-items: flex-start;\n\tgap: 20px;\n}\n\n.cn-device-frames-widget__frame {\n\tdisplay: flex;\n\tflex: none;\n\tflex-direction: column;\n\twidth: var(--cn-device-frame-width, 350px);\n\tmax-width: 100%;\n\tmin-height: 600px;\n\theight: var(--cn-device-frame-height, auto);\n\tbox-sizing: border-box;\n\toverflow: hidden;\n\tborder: 10px solid var(--color-main-text);\n\tborder-radius: 36px;\n\tbackground: var(--color-background-hover);\n}\n\n.cn-device-frames-widget__head {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 6px;\n\tpadding: 14px 18px 10px;\n\tborder-bottom: 1px solid var(--color-border);\n\tbackground: var(--color-main-background);\n}\n\n.cn-device-frames-widget__status {\n\tdisplay: inline-flex;\n\talign-items: center;\n\tgap: 6px;\n\tfont-size: 13px;\n\tfont-weight: 600;\n}\n\n.cn-device-frames-widget__status--warning {\n\tcolor: var(--color-warning-text, var(--color-main-text));\n}\n\n.cn-device-frames-widget__status--success {\n\tcolor: var(--color-success-text, var(--color-main-text));\n}\n\n.cn-device-frames-widget__status--info {\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-device-frames-widget__title {\n\tmargin: 0;\n\tfont-size: 20px;\n\tfont-weight: 700;\n\tline-height: 1.2;\n}\n\n.cn-device-frames-widget__body {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 12px;\n\tpadding: 14px;\n}\n\n/* `height` (DqInspectie: 700) makes every frame a phone of that height;\n what does not fit scrolls inside the screen. */\n.cn-device-frames-widget__frame[style*='--cn-device-frame-height'] .cn-device-frames-widget__body {\n\tflex: 1 1 auto;\n\tmin-height: 0;\n\toverflow-y: auto;\n}\n\n/* On a phone the frame is the screen: no bezel, the full width. */\n@media (max-width: 640px) {\n\t.cn-device-frames-widget__frame {\n\t\twidth: 100%;\n\t\tmin-height: 0;\n\t\tborder-width: 0;\n\t\tborder-radius: var(--cn-board-card-radius, 12px);\n\t}\n}\n</style>\n"],"names":["CnSectionsWidget"],"mappings":";;;;;;AAqDA;AACA,IAAI,kBAAkB,EAAA;;AAEtB;AACC;;;;AAIA;;;;;AAKA;AACA;AACA;;;;;;;AAOA;AACA;AACA;;;;AAIA;AACA;AACA;;AAED,aAAe;CACd,IAAI,EAAE,sBAAsB;;CAE5B,UAAU,EAAE,oBAAEA,UAAe,EAAG;;AAEhC,CAAA,MAAM,EAAE;AACP,EAAA,WAAW,EAAE,EAAE,OAAO,EAAE,MAAM,CAAC,GAAG,KAAK,KAAK;EAC5C;;AAED,CAAA,KAAK,EAAE;AACN;;AAEC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;AAGD,EAAA,OAAO,EAAE;GACR,IAAI,EAAE,MAAM;AACZ,GAAA,OAAO,EAAE,OAAO,EAAE,CAAC;GACnB;;;AAGD,EAAA,gBAAgB,EAAE;GACjB,IAAI,EAAE,KAAK;AACX,GAAA,OAAO,EAAE,MAAM,EAAE;GACjB;;;AAGD,EAAA,QAAQ,EAAE;AACT,GAAA,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;GACtB,OAAO,EAAE,EAAE;GACX;;AAED;EACA,UAAU,EAAE;GACX,IAAI,EAAE,MAAM;GACZ,OAAO,EAAE,IAAI;GACb;;AAED;EACA,UAAU,EAAE;GACX,IAAI,EAAE,MAAM;GACZ,OAAO,EAAE,EAAE;GACX;;AAED;EACA,YAAY,EAAE;GACb,IAAI,EAAE,MAAM;GACZ,OAAO,EAAE,IAAI;GACb;;AAED;AACA,EAAA,QAAQ,EAAE;AACT,GAAA,IAAI,EAAE,CAAC,MAAM,EAAE,M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,CAAC,IAAI,CAAE,GAAE,IAAG,GAAI,OAAK;GAC1E,MAAM,OAAO,UAAU,SAAQ,GAAI,mBAAmB,UAAU,YAAY,iBAAgB,GAAI,kBAAkB,EAAA;GAClH,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,CAAE,EAAA;GAC/D;;AAED;AACA,EAAA,YAAY,GAAG;AACd,GAAA,IAAI,CAAC,MAAK,GAAI,OAAO,SAAU,KAAI,WAAU,IAAK,SAAS,CAAC,MAAO,KAAI,MAAI;GAC3E;;AAED;;AAEC;;AAEA;;AAED,EAAA,SAAS,CAAC,GAAG,EAAE;AACd,GAAA,OAAO,CAAC,gBAAgB,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,CAAA;GAC1C;EACD;AACF;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"CnDeviceFramesWidget.vue3.js","sources":["../../../../src/components/CnDeviceFramesWidget/CnDeviceFramesWidget.vue?vue&type=template&id=64bde7d3&lang.js"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n\n<template>\n\t<div class=\"cn-device-frames-widget\" data-testid=\"cn-device-frames-widget\">\n\t\t<section\n\t\t\tv-for=\"frame in frames\"\n\t\t\t:key=\"frame.key\"\n\t\t\tclass=\"cn-device-frames-widget__frame\"\n\t\t\t:style=\"frameStyle\"\n\t\t\t:aria-labelledby=\"headingId(frame.key)\"\n\t\t\t:data-testid=\"`cn-device-frame-${frame.key}`\">\n\t\t\t<header class=\"cn-device-frames-widget__head\">\n\t\t\t\t<span\n\t\t\t\t\tv-if=\"frame.status\"\n\t\t\t\t\tclass=\"cn-device-frames-widget__status\"\n\t\t\t\t\t:class=\"`cn-device-frames-widget__status--${frame.status.tone}`\"\n\t\t\t\t\tdata-testid=\"cn-device-frame-status\">\n\t\t\t\t\t<component :is=\"frame.status.icon\" :size=\"16\" aria-hidden=\"true\" />\n\t\t\t\t\t{{ frame.status.text }}\n\t\t\t\t</span>\n\t\t\t\t<h3 :id=\"headingId(frame.key)\" class=\"cn-device-frames-widget__title\">\n\t\t\t\t\t{{ frame.title }}\n\t\t\t\t</h3>\n\t\t\t</header>\n\t\t\t<div class=\"cn-device-frames-widget__body\">\n\t\t\t\t<CnSectionsWidget\n\t\t\t\t\t:content=\"{ sections: frame.sections, cards: false, hideEmpty: true }\"\n\t\t\t\t\t:availableWidgets=\"availableWidgets\"\n\t\t\t\t\t:objectId=\"objectId\"\n\t\t\t\t\t:objectData=\"objectData\"\n\t\t\t\t\t:objectType=\"objectType\"\n\t\t\t\t\t:schemaObject=\"schemaObject\"\n\t\t\t\t\t:register=\"register\"\n\t\t\t\t\t:schema=\"schema\"\n\t\t\t\t\t:store=\"store\"\n\t\t\t\t\t:surface=\"surface\"\n\t\t\t\t\t:integrationContext=\"integrationContext\"\n\t\t\t\t\t:cnRegistry=\"cnRegistry\" />\n\t\t\t</div>\n\t\t</section>\n\t</div>\n</template>\n\n<script>\nimport { markRaw } from 'vue'\nimport CloudCheckOutline from 'vue-material-design-icons/CloudCheckOutline.vue'\nimport CloudOffOutline from 'vue-material-design-icons/CloudOffOutline.vue'\nimport InformationOutline from 'vue-material-design-icons/InformationOutline.vue'\nimport CnSectionsWidget from '../CnSectionsWidget/CnSectionsWidget.vue'\n\n/** Counter for unique heading ids across instances. */\nlet instanceCounter = 0\n\n/**\n * CnDeviceFramesWidget - the `device-frames` widget: several small pages side\n * by side, each in a phone frame with its own header (board DqInspectie,\n * \"Inspectie in het veld\": the day offline, a checklist question with a\n * photo, and the sync queue).\n *\n * Each frame stacks widgets of the surface, as the `sections` widget does,\n * under a header with the frame's title and an optional status line. The\n * status can follow the connection (\"Offline · synced at 07:42\" while the\n * device is offline). The frames wrap onto the next row when the page is\n * narrower, and a frame takes the full width on a phone.\n *\n * ```json\n * {\n * \"type\": \"device-frames\",\n * \"content\": {\n * \"width\": 350,\n * \"status\": { \"followConnection\": true, \"offlineText\": \"Offline · synced at 07:42\", \"onlineText\": \"Online\" },\n * \"frames\": [\n * { \"key\": \"today\", \"title\": \"Today\", \"widgetIds\": [\"today-runs\", \"offline-note\"] },\n * { \"key\": \"question\", \"title\": \"Kerkplein 7\", \"widgetIds\": [\"checklist-run\"] },\n * { \"key\": \"sync\", \"title\": \"Synchronise\", \"widgetIds\": [\"sync-queue\"] }\n * ]\n * }\n * }\n * ```\n *\n * @spec openspec/changes/device-frames-widget/specs/device-frames-widget/spec.md#requirement-a-page-can-show-several-small-pages-as-phone-frames\n */\nexport default {\n\tname: 'CnDeviceFramesWidget',\n\n\tcomponents: { CnSectionsWidget },\n\n\tinject: {\n\t\tcnTranslate: { default: () => (key) => key },\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * The widget configuration.\n\t\t *\n\t\t * - `frames` — `[{ key?, title, widgetIds? | sections?, status? }]`, in order. `widgetIds` names\n\t\t * widgets of the surface, stacked; `sections` takes the `sections` widget's entries instead.\n\t\t * - `status` — the status line of every frame (a frame's own `status` wins): `{ text?, tone?,\n\t\t * followConnection?, onlineText?, offlineText? }`. With `followConnection` the line reads\n\t\t * `offlineText` while the device is offline and `onlineText` otherwise. `tone` is `warning`\n\t\t * (default while offline), `success` or `info`.\n\t\t * - `width` — the frame width in pixels (default 350).\n\t\t *\n\t\t * @type {{frames?: Array<object>, status?: object, width?: number}}\n\t\t */\n\t\tcontent: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({}),\n\t\t},\n\n\t\t/** Sibling widget definitions on the surface, for `widgetIds`. */\n\t\tavailableWidgets: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t\t/** The bound record's id, forwarded to the children. */\n\t\tobjectId: {\n\t\t\ttype: [String, Number],\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The loaded record, forwarded to the children. */\n\t\tobjectData: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** The resolved object-type slug. */\n\t\tobjectType: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The resolved JSON Schema object. */\n\t\tschemaObject: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** OpenRegister register slug of the surface. */\n\t\tregister: {\n\t\t\ttype: [String, Object],\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** OpenRegister schema slug of the surface. */\n\t\tschema: {\n\t\t\ttype: [String, Object],\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The effective object store. */\n\t\tstore: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** Rendering surface forwarded to the children. */\n\t\tsurface: {\n\t\t\ttype: String,\n\t\t\tdefault: 'app-dashboard',\n\t\t},\n\n\t\t/** Object context forwarded to integration children. */\n\t\tintegrationContext: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** The consumer's component registry, for custom child widget types. */\n\t\tcnRegistry: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({}),\n\t\t},\n\t},\n\n\tdata() {\n\t\tinstanceCounter += 1\n\t\treturn {\n\t\t\tuid: instanceCounter,\n\t\t\tonline: typeof navigator === 'undefined' || navigator.onLine !== false,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/** @return {object} The frame width. */\n\t\tframeStyle() {\n\t\t\tconst width = Number(this.content?.width)\n\t\t\treturn { '--cn-device-frame-width': `${Number.isFinite(width) && width >= 240 ? width : 350}px` }\n\t\t},\n\n\t\t/**\n\t\t * The frames to draw: a key, a translated title, the sections and the\n\t\t * status line.\n\t\t *\n\t\t * @return {Array<{key: string, title: string, sections: Array<object>, status: object|null}>}\n\t\t */\n\t\tframes() {\n\t\t\tconst list = Array.isArray(this.content?.frames) ? this.content.frames : []\n\t\t\treturn list\n\t\t\t\t.filter((frame) => frame && typeof frame === 'object')\n\t\t\t\t.map((frame, index) => {\n\t\t\t\t\tconst sections = Array.isArray(frame.sections)\n\t\t\t\t\t\t? frame.sections\n\t\t\t\t\t\t: (Array.isArray(frame.widgetIds) ? frame.widgetIds : []).filter((id) => typeof id === 'string' && id !== '').map((widgetId) => ({ widgetId }))\n\t\t\t\t\treturn {\n\t\t\t\t\t\tkey: String(frame.key || `frame-${index}`).replace(/[^\\w-]/g, '-'),\n\t\t\t\t\t\ttitle: this.tr(frame.title || ''),\n\t\t\t\t\t\tsections,\n\t\t\t\t\t\tstatus: this.statusOf(frame.status || this.content?.status || null),\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t},\n\t},\n\n\tmounted() {\n\t\tif (typeof window !== 'undefined') {\n\t\t\twindow.addEventListener('online', this.onConnection)\n\t\t\twindow.addEventListener('offline', this.onConnection)\n\t\t}\n\t},\n\n\tbeforeUnmount() {\n\t\tif (typeof window !== 'undefined') {\n\t\t\twindow.removeEventListener('online', this.onConnection)\n\t\t\twindow.removeEventListener('offline', this.onConnection)\n\t\t}\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Translate through the app's translate.\n\t\t *\n\t\t * @param {string} key The source string.\n\t\t * @return {string}\n\t\t */\n\t\ttr(key) {\n\t\t\treturn key && typeof this.cnTranslate === 'function' ? this.cnTranslate(key) : (key || '')\n\t\t},\n\n\t\t/**\n\t\t * The status line of a frame, or null.\n\t\t *\n\t\t * @param {object|null} status The configured status.\n\t\t * @return {{text: string, tone: string, icon: object}|null}\n\t\t */\n\t\tstatusOf(status) {\n\t\t\tif (!status || typeof status !== 'object') {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tlet text = status.text\n\t\t\tlet tone = status.tone\n\t\t\tif (status.followConnection === true) {\n\t\t\t\ttext = this.online ? status.onlineText : status.offlineText\n\t\t\t\ttone = tone || (this.online ? 'success' : 'warning')\n\t\t\t}\n\t\t\tif (typeof text !== 'string' || text === '') {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tconst known = ['warning', 'success', 'info'].includes(tone) ? tone : 'info'\n\t\t\tconst icon = known === 'warning' ? CloudOffOutline : (known === 'success' ? CloudCheckOutline : InformationOutline)\n\t\t\treturn { text: this.tr(text), tone: known, icon: markRaw(icon) }\n\t\t},\n\n\t\t/** Follow the browser's connection state. */\n\t\tonConnection() {\n\t\t\tthis.online = typeof navigator === 'undefined' || navigator.onLine !== false\n\t\t},\n\n\t\t/**\n\t\t * The id of a frame's heading.\n\t\t *\n\t\t * @param {string} key The frame key.\n\t\t * @return {string}\n\t\t */\n\t\theadingId(key) {\n\t\t\treturn `cn-device-frame-${this.uid}-${key}`\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-device-frames-widget {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\talign-items: flex-start;\n\tgap: 20px;\n}\n\n.cn-device-frames-widget__frame {\n\tdisplay: flex;\n\tflex: none;\n\tflex-direction: column;\n\twidth: var(--cn-device-frame-width, 350px);\n\tmax-width: 100%;\n\tmin-height: 600px;\n\tbox-sizing: border-box;\n\toverflow: hidden;\n\tborder: 10px solid var(--color-main-text);\n\tborder-radius: 36px;\n\tbackground: var(--color-background-hover);\n}\n\n.cn-device-frames-widget__head {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 6px;\n\tpadding: 14px 18px 10px;\n\tborder-bottom: 1px solid var(--color-border);\n\tbackground: var(--color-main-background);\n}\n\n.cn-device-frames-widget__status {\n\tdisplay: inline-flex;\n\talign-items: center;\n\tgap: 6px;\n\tfont-size: 13px;\n\tfont-weight: 600;\n}\n\n.cn-device-frames-widget__status--warning {\n\tcolor: var(--color-warning-text, var(--color-main-text));\n}\n\n.cn-device-frames-widget__status--success {\n\tcolor: var(--color-success-text, var(--color-main-text));\n}\n\n.cn-device-frames-widget__status--info {\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-device-frames-widget__title {\n\tmargin: 0;\n\tfont-size: 20px;\n\tfont-weight: 700;\n\tline-height: 1.2;\n}\n\n.cn-device-frames-widget__body {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 12px;\n\tpadding: 14px;\n}\n\n/* On a phone the frame is the screen: no bezel, the full width. */\n@media (max-width: 640px) {\n\t.cn-device-frames-widget__frame {\n\t\twidth: 100%;\n\t\tmin-height: 0;\n\t\tborder-width: 0;\n\t\tborder-radius: var(--cn-board-card-radius, 12px);\n\t}\n}\n</style>\n"],"names":["_openBlock","_createElementBlock","_createElementVNode","_createBlock","_resolveDynamicComponent","_createTextVNode","_toDisplayString"],"mappings":";;;AAWM,EAAA,KAAK,EAAC,yBAAS;AAAA,EAAA,aAAA,EAAA,yBAAA;;;AAQV,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,+BAAwB,GAAA;;AAajC,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,+BAAc,GAAA;;;;;AArBzB,EAAA,QAAAA,SAAA,EAAA,EAAAC,kBAAA,QAAA;sBACAA,8CACgB,QAAM,CAAA,MAAA,EAAA,CAAf,KAAK,KAAA;2BADZA;QAEC,GAAG,EAAE,KAAK,CAAC,GAAG;aACV,EAAA,gCAAA;AACH,QAAA,KAAI,iBAAE,QAAU,CAAA,UAAA,CAAA;AAChB,QAAA,iBAAc,EAAE,QAAA,CAAA,SAAS,CAAC,KAAK,CAAC,GAAG,CAAA;QACnC,aAAU,EAAA,CAAA,gBAAA,EAAqB,KAAK,CAAC,GAAG,CAAA,CAAA;;AACxC,QAAAC,kBAAA,CAYO,UAZP,UAYO,EAAA;AAVD,UAAA,CAAA,KAAK,CAAC,MAAM;4BADlBD,kBAOM,CAAA,MAAA,EAAA;;AALN,gBAAA,KAAK,kBAAA,iCAAA,EAAA,CAAA,iCAAA,EACuC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAA,CAAA,CAAA,CAAA;AAC7D,gBAAA,aAAW,EAAC,wBAAI;;AAChB,iBAAAD,SAAA,EAAA,EAAAG,WAAA,CAAGC,uBAAA,CAAA,KAAA,CAAA,MAAA,CAAA,IAAA,CAAA,EAAA;AAAA,kBAAA,IAAA,EAAA,EAAA;AAAA,kBAAA,aAAA,EAAA,MAAA;;AAAA,gBAAAC,eAAA,CAAA,GACH,GAAGC,eAAA,CAAA,KAAG,CAAA,MAAA,CAAA,IAAA,CAAA,EAAA,CAAA,YAAA;;;UAEPJ,kBAEK,CAAA,IAAA,EAAA;AAFA,YAAA,EAAE,EAAE,QAAA,CAAA,SAAO,CAAA,KAAA,CAAA,GAAA,CAAA;AAAA,YAAA,KAAA,EAAA,gCAAA;AACZ,WAAA,EAAAI,eAAA,CAAA,KAAK,CAAC,KAAK,CAAA,EAAA,CAAA,oBAAA,UAAA,CAAA;;;;YAKb,OAAO,EAAA,EAAA,QAAA,EAAc,KAAK,CAAA,QAAA,EAAA,KAAA,EAAA,KAAA,EAAA,SAAA,EAAA,IAAA,EAAA;AAC1B,YAAA,gBAAgB,EAAE,MAAA,CAAA,gBAAA;AAClB,YAAA,QAAQ,EAAE,MAAI,CAAA,QAAA;AACd,YAAA,UAAU,EAAE,MAAA,CAAA,UAAA;AACZ,YAAA,UAAU,EAAE,MAAI,CAAA,UAAA;AAChB,YAAA,YAAY,EAAE,MAAY,CAAA,YAAA;AAC1B,YAAA,QAAQ,EAAE,MAAQ,CAAA,QAAA;AAClB,YAAA,MAAE,EAAA,MAAA,CAAA,MAAA;AACF,YAAA,KAAK,EAAA,MAAA,CAAA,KAAA;AACL,YAAA,OAAA,EAAA,MAAA,CAAA,OAAA;;;;;;;;;;;;"}
1
+ {"version":3,"file":"CnDeviceFramesWidget.vue3.js","sources":["../../../../src/components/CnDeviceFramesWidget/CnDeviceFramesWidget.vue?vue&type=template&id=9442557e&lang.js"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n\n<template>\n\t<div class=\"cn-device-frames-widget\" data-testid=\"cn-device-frames-widget\">\n\t\t<section\n\t\t\tv-for=\"frame in frames\"\n\t\t\t:key=\"frame.key\"\n\t\t\tclass=\"cn-device-frames-widget__frame\"\n\t\t\t:style=\"frameStyle\"\n\t\t\t:aria-labelledby=\"headingId(frame.key)\"\n\t\t\t:data-testid=\"`cn-device-frame-${frame.key}`\">\n\t\t\t<header class=\"cn-device-frames-widget__head\">\n\t\t\t\t<span\n\t\t\t\t\tv-if=\"frame.status\"\n\t\t\t\t\tclass=\"cn-device-frames-widget__status\"\n\t\t\t\t\t:class=\"`cn-device-frames-widget__status--${frame.status.tone}`\"\n\t\t\t\t\tdata-testid=\"cn-device-frame-status\">\n\t\t\t\t\t<component :is=\"frame.status.icon\" :size=\"16\" aria-hidden=\"true\" />\n\t\t\t\t\t{{ frame.status.text }}\n\t\t\t\t</span>\n\t\t\t\t<h3 :id=\"headingId(frame.key)\" class=\"cn-device-frames-widget__title\">\n\t\t\t\t\t{{ frame.title }}\n\t\t\t\t</h3>\n\t\t\t</header>\n\t\t\t<div class=\"cn-device-frames-widget__body\">\n\t\t\t\t<CnSectionsWidget\n\t\t\t\t\t:content=\"{ sections: frame.sections, cards: false, hideEmpty: true }\"\n\t\t\t\t\t:availableWidgets=\"availableWidgets\"\n\t\t\t\t\t:objectId=\"objectId\"\n\t\t\t\t\t:objectData=\"objectData\"\n\t\t\t\t\t:objectType=\"objectType\"\n\t\t\t\t\t:schemaObject=\"schemaObject\"\n\t\t\t\t\t:register=\"register\"\n\t\t\t\t\t:schema=\"schema\"\n\t\t\t\t\t:store=\"store\"\n\t\t\t\t\t:surface=\"surface\"\n\t\t\t\t\t:integrationContext=\"integrationContext\"\n\t\t\t\t\t:cnRegistry=\"cnRegistry\" />\n\t\t\t</div>\n\t\t</section>\n\t</div>\n</template>\n\n<script>\nimport { markRaw } from 'vue'\nimport CloudCheckOutline from 'vue-material-design-icons/CloudCheckOutline.vue'\nimport CloudOffOutline from 'vue-material-design-icons/CloudOffOutline.vue'\nimport InformationOutline from 'vue-material-design-icons/InformationOutline.vue'\nimport CnSectionsWidget from '../CnSectionsWidget/CnSectionsWidget.vue'\n\n/** Counter for unique heading ids across instances. */\nlet instanceCounter = 0\n\n/**\n * CnDeviceFramesWidget - the `device-frames` widget: several small pages side\n * by side, each in a phone frame with its own header (board DqInspectie,\n * \"Inspectie in het veld\": the day offline, a checklist question with a\n * photo, and the sync queue).\n *\n * Each frame stacks widgets of the surface, as the `sections` widget does,\n * under a header with the frame's title and an optional status line. The\n * status can follow the connection (\"Offline · synced at 07:42\" while the\n * device is offline). The frames wrap onto the next row when the page is\n * narrower, and a frame takes the full width on a phone.\n *\n * ```json\n * {\n * \"type\": \"device-frames\",\n * \"content\": {\n * \"width\": 350,\n * \"status\": { \"followConnection\": true, \"offlineText\": \"Offline · synced at 07:42\", \"onlineText\": \"Online\" },\n * \"frames\": [\n * { \"key\": \"today\", \"title\": \"Today\", \"widgetIds\": [\"today-runs\", \"offline-note\"] },\n * { \"key\": \"question\", \"title\": \"Kerkplein 7\", \"widgetIds\": [\"checklist-run\"] },\n * { \"key\": \"sync\", \"title\": \"Synchronise\", \"widgetIds\": [\"sync-queue\"] }\n * ]\n * }\n * }\n * ```\n *\n * @spec openspec/changes/device-frames-widget/specs/device-frames-widget/spec.md#requirement-a-page-can-show-several-small-pages-as-phone-frames\n */\nexport default {\n\tname: 'CnDeviceFramesWidget',\n\n\tcomponents: { CnSectionsWidget },\n\n\tinject: {\n\t\tcnTranslate: { default: () => (key) => key },\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * The widget configuration.\n\t\t *\n\t\t * - `frames` — `[{ key?, title, widgetIds? | sections?, status? }]`, in order. `widgetIds` names\n\t\t * widgets of the surface, stacked; `sections` takes the `sections` widget's entries instead.\n\t\t * - `status` — the status line of every frame (a frame's own `status` wins): `{ text?, tone?,\n\t\t * followConnection?, onlineText?, offlineText? }`. With `followConnection` the line reads\n\t\t * `offlineText` while the device is offline and `onlineText` otherwise. `tone` is `warning`\n\t\t * (default while offline), `success` or `info`.\n\t\t * - `width` — the frame width in pixels (default 350).\n\t\t * - `height` — the frame height in pixels (at least 400); what does not fit scrolls inside it. Without it the frame grows with its content.\n\t\t *\n\t\t * @type {{frames?: Array<object>, status?: object, width?: number}}\n\t\t */\n\t\tcontent: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({}),\n\t\t},\n\n\t\t/** Sibling widget definitions on the surface, for `widgetIds`. */\n\t\tavailableWidgets: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t\t/** The bound record's id, forwarded to the children. */\n\t\tobjectId: {\n\t\t\ttype: [String, Number],\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The loaded record, forwarded to the children. */\n\t\tobjectData: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** The resolved object-type slug. */\n\t\tobjectType: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The resolved JSON Schema object. */\n\t\tschemaObject: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** OpenRegister register slug of the surface. */\n\t\tregister: {\n\t\t\ttype: [String, Object],\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** OpenRegister schema slug of the surface. */\n\t\tschema: {\n\t\t\ttype: [String, Object],\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The effective object store. */\n\t\tstore: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** Rendering surface forwarded to the children. */\n\t\tsurface: {\n\t\t\ttype: String,\n\t\t\tdefault: 'app-dashboard',\n\t\t},\n\n\t\t/** Object context forwarded to integration children. */\n\t\tintegrationContext: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** The consumer's component registry, for custom child widget types. */\n\t\tcnRegistry: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({}),\n\t\t},\n\t},\n\n\tdata() {\n\t\tinstanceCounter += 1\n\t\treturn {\n\t\t\tuid: instanceCounter,\n\t\t\tonline: typeof navigator === 'undefined' || navigator.onLine !== false,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/** @return {object} The frame width. */\n\t\tframeStyle() {\n\t\t\tconst width = Number(this.content?.width)\n\t\t\tconst height = Number(this.content?.height)\n\t\t\tconst style = { '--cn-device-frame-width': `${Number.isFinite(width) && width >= 240 ? width : 350}px` }\n\t\t\tif (Number.isFinite(height) && height >= 400) {\n\t\t\t\tstyle['--cn-device-frame-height'] = `${height}px`\n\t\t\t}\n\t\t\treturn style\n\t\t},\n\n\t\t/**\n\t\t * The frames to draw: a key, a translated title, the sections and the\n\t\t * status line.\n\t\t *\n\t\t * @return {Array<{key: string, title: string, sections: Array<object>, status: object|null}>}\n\t\t */\n\t\tframes() {\n\t\t\tconst list = Array.isArray(this.content?.frames) ? this.content.frames : []\n\t\t\treturn list\n\t\t\t\t.filter((frame) => frame && typeof frame === 'object')\n\t\t\t\t.map((frame, index) => {\n\t\t\t\t\tconst sections = Array.isArray(frame.sections)\n\t\t\t\t\t\t? frame.sections\n\t\t\t\t\t\t: (Array.isArray(frame.widgetIds) ? frame.widgetIds : []).filter((id) => typeof id === 'string' && id !== '').map((widgetId) => ({ widgetId }))\n\t\t\t\t\treturn {\n\t\t\t\t\t\tkey: String(frame.key || `frame-${index}`).replace(/[^\\w-]/g, '-'),\n\t\t\t\t\t\ttitle: this.tr(frame.title || ''),\n\t\t\t\t\t\tsections,\n\t\t\t\t\t\tstatus: this.statusOf(frame.status || this.content?.status || null),\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t},\n\t},\n\n\tmounted() {\n\t\tif (typeof window !== 'undefined') {\n\t\t\twindow.addEventListener('online', this.onConnection)\n\t\t\twindow.addEventListener('offline', this.onConnection)\n\t\t}\n\t},\n\n\tbeforeUnmount() {\n\t\tif (typeof window !== 'undefined') {\n\t\t\twindow.removeEventListener('online', this.onConnection)\n\t\t\twindow.removeEventListener('offline', this.onConnection)\n\t\t}\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Translate through the app's translate.\n\t\t *\n\t\t * @param {string} key The source string.\n\t\t * @return {string}\n\t\t */\n\t\ttr(key) {\n\t\t\treturn key && typeof this.cnTranslate === 'function' ? this.cnTranslate(key) : (key || '')\n\t\t},\n\n\t\t/**\n\t\t * The status line of a frame, or null.\n\t\t *\n\t\t * @param {object|null} status The configured status.\n\t\t * @return {{text: string, tone: string, icon: object}|null}\n\t\t */\n\t\tstatusOf(status) {\n\t\t\tif (!status || typeof status !== 'object') {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tlet text = status.text\n\t\t\tlet tone = status.tone\n\t\t\tif (status.followConnection === true) {\n\t\t\t\ttext = this.online ? status.onlineText : status.offlineText\n\t\t\t\ttone = tone || (this.online ? 'success' : 'warning')\n\t\t\t}\n\t\t\tif (typeof text !== 'string' || text === '') {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tconst known = ['warning', 'success', 'info'].includes(tone) ? tone : 'info'\n\t\t\tconst icon = known === 'warning' ? CloudOffOutline : (known === 'success' ? CloudCheckOutline : InformationOutline)\n\t\t\treturn { text: this.tr(text), tone: known, icon: markRaw(icon) }\n\t\t},\n\n\t\t/** Follow the browser's connection state. */\n\t\tonConnection() {\n\t\t\tthis.online = typeof navigator === 'undefined' || navigator.onLine !== false\n\t\t},\n\n\t\t/**\n\t\t * The id of a frame's heading.\n\t\t *\n\t\t * @param {string} key The frame key.\n\t\t * @return {string}\n\t\t */\n\t\theadingId(key) {\n\t\t\treturn `cn-device-frame-${this.uid}-${key}`\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-device-frames-widget {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\talign-items: flex-start;\n\tgap: 20px;\n}\n\n.cn-device-frames-widget__frame {\n\tdisplay: flex;\n\tflex: none;\n\tflex-direction: column;\n\twidth: var(--cn-device-frame-width, 350px);\n\tmax-width: 100%;\n\tmin-height: 600px;\n\theight: var(--cn-device-frame-height, auto);\n\tbox-sizing: border-box;\n\toverflow: hidden;\n\tborder: 10px solid var(--color-main-text);\n\tborder-radius: 36px;\n\tbackground: var(--color-background-hover);\n}\n\n.cn-device-frames-widget__head {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 6px;\n\tpadding: 14px 18px 10px;\n\tborder-bottom: 1px solid var(--color-border);\n\tbackground: var(--color-main-background);\n}\n\n.cn-device-frames-widget__status {\n\tdisplay: inline-flex;\n\talign-items: center;\n\tgap: 6px;\n\tfont-size: 13px;\n\tfont-weight: 600;\n}\n\n.cn-device-frames-widget__status--warning {\n\tcolor: var(--color-warning-text, var(--color-main-text));\n}\n\n.cn-device-frames-widget__status--success {\n\tcolor: var(--color-success-text, var(--color-main-text));\n}\n\n.cn-device-frames-widget__status--info {\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-device-frames-widget__title {\n\tmargin: 0;\n\tfont-size: 20px;\n\tfont-weight: 700;\n\tline-height: 1.2;\n}\n\n.cn-device-frames-widget__body {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 12px;\n\tpadding: 14px;\n}\n\n/* `height` (DqInspectie: 700) makes every frame a phone of that height;\n what does not fit scrolls inside the screen. */\n.cn-device-frames-widget__frame[style*='--cn-device-frame-height'] .cn-device-frames-widget__body {\n\tflex: 1 1 auto;\n\tmin-height: 0;\n\toverflow-y: auto;\n}\n\n/* On a phone the frame is the screen: no bezel, the full width. */\n@media (max-width: 640px) {\n\t.cn-device-frames-widget__frame {\n\t\twidth: 100%;\n\t\tmin-height: 0;\n\t\tborder-width: 0;\n\t\tborder-radius: var(--cn-board-card-radius, 12px);\n\t}\n}\n</style>\n"],"names":["_openBlock","_createElementBlock","_createElementVNode","_createBlock","_resolveDynamicComponent","_createTextVNode","_toDisplayString"],"mappings":";;;AAWM,EAAA,KAAK,EAAC,yBAAS;AAAA,EAAA,aAAA,EAAA,yBAAA;;;AAQV,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,+BAAwB,GAAA;;AAajC,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC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A,EAAA,IAAA,EAAA;AAC1B,YAAA,gBAAgB,EAAE,MAAA,CAAA,gBAAA;AAClB,YAAA,QAAQ,EAAE,MAAI,CAAA,QAAA;AACd,YAAA,UAAU,EAAE,MAAA,CAAA,UAAA;AACZ,YAAA,UAAU,EAAE,MAAI,CAAA,UAAA;AAChB,YAAA,YAAY,EAAE,MAAY,CAAA,YAAA;AAC1B,YAAA,QAAQ,EAAE,MAAQ,CAAA,QAAA;AAClB,YAAA,MAAE,EAAA,MAAA,CAAA,MAAA;AACF,YAAA,KAAK,EAAA,MAAA,CAAA,KAAA;AACL,YAAA,OAAA,EAAA,MAAA,CAAA,OAAA;;;;;;;;;;;;"}
@@ -2,7 +2,7 @@ import script from './CnExportsWidget.vue2.js';
2
2
  import { render } from './CnExportsWidget.vue3.js';
3
3
 
4
4
  script.render = render;
5
- script.__scopeId = "data-v-1a295cca";
5
+ script.__scopeId = "data-v-9d27adf2";
6
6
  const __sfc_main = script;
7
7
 
8
8
  export { __sfc_main as default };
@@ -3,6 +3,7 @@ import axios__default from '@nextcloud/axios';
3
3
  import { translate, translatePlural } from '@nextcloud/l10n';
4
4
  import { generateUrl, generateRemoteUrl } from '@nextcloud/router';
5
5
  import { NcButton } from '@nextcloud/vue';
6
+ import DownloadOutline from 'vue-material-design-icons/DownloadOutline.vue';
6
7
  import { formatBoardDate } from '../../utils/boardDate.js';
7
8
 
8
9
  /**
@@ -24,7 +25,7 @@ import { formatBoardDate } from '../../utils/boardDate.js';
24
25
  var script = {
25
26
  name: 'CnExportsWidget',
26
27
 
27
- components: { NcButton },
28
+ components: { DownloadOutline, NcButton },
28
29
 
29
30
  inject: {
30
31
  /** Host translate function provided by CnAppRoot. */
@@ -1 +1 @@
1
- {"version":3,"file":"CnExportsWidget.vue2.js","sources":["../../../../src/components/CnExportsWidget/CnExportsWidget.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n<template>\n\t<div class=\"cn-exports-widget\" data-testid=\"cn-exports-widget\">\n\t\t<p v-if=\"loading && runs.length === 0\" class=\"cn-exports-widget__muted\">\n\t\t\t{{ t('nextcloud-vue', 'Loading …') }}\n\t\t</p>\n\t\t<p v-else-if=\"failed\" class=\"cn-exports-widget__muted\" data-testid=\"cn-exports-error\">\n\t\t\t{{ t('nextcloud-vue', 'Your exports could not be loaded.') }}\n\t\t</p>\n\t\t<p v-else-if=\"runs.length === 0\" class=\"cn-exports-widget__muted\" data-testid=\"cn-exports-empty\">\n\t\t\t{{ emptyText }}\n\t\t</p>\n\t\t<ul v-else class=\"cn-exports-widget__list\">\n\t\t\t<li v-for=\"run in shownRuns\"\n\t\t\t\t:key=\"run.key\"\n\t\t\t\tclass=\"cn-exports-widget__row\"\n\t\t\t\tdata-testid=\"cn-exports-row\">\n\t\t\t\t<span class=\"cn-exports-widget__text\">\n\t\t\t\t\t<span class=\"cn-exports-widget__name\">{{ run.filename }}</span>\n\t\t\t\t\t<span class=\"cn-exports-widget__meta\">{{ run.meta }}</span>\n\t\t\t\t</span>\n\t\t\t\t<span v-if=\"run.expiresToday\" class=\"cn-exports-widget__tag\" data-testid=\"cn-exports-expires-today\">\n\t\t\t\t\t{{ t('nextcloud-vue', 'Expires today') }}\n\t\t\t\t</span>\n\t\t\t\t<NcButton v-else-if=\"run.href\"\n\t\t\t\t\t:href=\"run.href\"\n\t\t\t\t\tdata-testid=\"cn-exports-download\">\n\t\t\t\t\t{{ t('nextcloud-vue', 'Download') }}\n\t\t\t\t</NcButton>\n\t\t\t</li>\n\t\t</ul>\n\t</div>\n</template>\n\n<script>\nimport { getCurrentUser } from '@nextcloud/auth'\nimport axios from '@nextcloud/axios'\nimport { translatePlural as n, translate as t } from '@nextcloud/l10n'\nimport { generateRemoteUrl, generateUrl } from '@nextcloud/router'\nimport { NcButton } from '@nextcloud/vue'\nimport { formatBoardDate } from '../../utils/boardDate.js'\n\n/**\n * CnExportsWidget — the reader's own exports (DqZoekresultaten \"Uw exports\"):\n * each file with when it was made, how often it was downloaded and when it\n * expires, a Download button while the file is there, and \"Expires today\" on\n * the day it goes.\n *\n * Reads OpenRegister's export runs (`GET /apps/openregister/api/exports`)\n * with the reader as the actor, so an administrator sees their own here too.\n * `content.register` and `content.schema` narrow it to one list's exports.\n * A run whose file was swept, or that never produced one, is left out.\n *\n * Example (manifest, in an index page's `sidePanel`):\n * ```json\n * { \"id\": \"exports\", \"type\": \"exports\", \"title\": \"Your exports\", \"content\": { \"register\": \"dossiq\", \"schema\": \"case\", \"limit\": 5 } }\n * ```\n */\nexport default {\n\tname: 'CnExportsWidget',\n\n\tcomponents: { NcButton },\n\n\tinject: {\n\t\t/** Host translate function provided by CnAppRoot. */\n\t\tcnTranslate: { default: () => (key) => key },\n\t},\n\n\tprops: {\n\t\t/** `{ register?, schema?, limit?, emptyText? }`; `limit` defaults to 5. */\n\t\tcontent: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({}),\n\t\t},\n\t},\n\n\tdata() {\n\t\treturn { loading: false, failed: false, runs: [], now: new Date() }\n\t},\n\n\tcomputed: {\n\t\t/** @return {number} How many exports to show. */\n\t\tlimit() {\n\t\t\tconst limit = Number(this.content && this.content.limit)\n\t\t\treturn Number.isInteger(limit) && limit > 0 ? limit : 5\n\t\t},\n\n\t\t/** @return {Array<object>} The exports to draw, newest first. */\n\t\tshownRuns() {\n\t\t\treturn this.runs\n\t\t\t\t.filter((run) => run && run.filename && run.fileId !== null && run.fileId !== undefined && run.status !== 'expired')\n\t\t\t\t.slice(0, this.limit)\n\t\t\t\t.map((run) => this.view(run))\n\t\t},\n\n\t\t/** @return {string} The empty line. */\n\t\temptyText() {\n\t\t\tconst own = this.content && this.content.emptyText\n\t\t\treturn own ? this.cnTranslate(own) : t('nextcloud-vue', 'You have no exports here.')\n\t\t},\n\t},\n\n\tmounted() {\n\t\tthis.load()\n\t},\n\n\tmethods: {\n\t\tt,\n\n\t\t/**\n\t\t * Read the reader's export runs.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync load() {\n\t\t\tconst user = getCurrentUser()\n\t\t\tif (!user || !user.uid) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.loading = true\n\t\t\tthis.failed = false\n\t\t\ttry {\n\t\t\t\tconst params = { actor: user.uid, limit: Math.max(this.limit * 2, 10) }\n\t\t\t\tfor (const key of ['register', 'schema']) {\n\t\t\t\t\tif (this.content && typeof this.content[key] === 'string' && this.content[key] !== '') {\n\t\t\t\t\t\tparams[key] = this.content[key]\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tconst response = await axios.get(generateUrl('/apps/openregister/api/exports'), { params })\n\t\t\t\tconst results = response && response.data && Array.isArray(response.data.results) ? response.data.results : []\n\t\t\t\tthis.runs = [...results].sort((a, b) => String(b.producedAt || b.created || '').localeCompare(String(a.producedAt || a.created || '')))\n\t\t\t} catch {\n\t\t\t\tthis.failed = true\n\t\t\t\tthis.runs = []\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 * One export as the list draws it.\n\t\t *\n\t\t * @param {object} run An export run.\n\t\t * @return {{key: string, filename: string, meta: string, href: string, expiresToday: boolean}}\n\t\t */\n\t\tview(run) {\n\t\t\tconst made = run.producedAt || run.created\n\t\t\tconst parts = []\n\t\t\tif (made) {\n\t\t\t\tparts.push(t('nextcloud-vue', 'Made {date}', { date: formatBoardDate(made, this.now) }))\n\t\t\t}\n\t\t\tif (typeof run.downloadCount === 'number') {\n\t\t\t\tparts.push(n('nextcloud-vue', 'downloaded %n time', 'downloaded %n times', run.downloadCount))\n\t\t\t}\n\t\t\tif (run.expiresAt) {\n\t\t\t\tparts.push(t('nextcloud-vue', 'expires {date}', { date: formatBoardDate(run.expiresAt, this.now) }))\n\t\t\t}\n\t\t\tconst user = getCurrentUser()\n\t\t\tconst href = run.filePath && user && user.uid\n\t\t\t\t? generateRemoteUrl(`dav/files/${encodeURIComponent(user.uid)}`) + String(run.filePath).split('/').map(encodeURIComponent).join('/')\n\t\t\t\t: ''\n\t\t\treturn {\n\t\t\t\tkey: String(run.uuid || run.id),\n\t\t\t\tfilename: run.filename,\n\t\t\t\tmeta: parts.join(' · '),\n\t\t\t\thref,\n\t\t\t\texpiresToday: Boolean(run.expiresAt) && new Date(run.expiresAt).toDateString() === this.now.toDateString(),\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-exports-widget__list {\n\tdisplay: flex;\n\tflex-direction: column;\n\tmargin: 0;\n\tpadding: 0;\n\tlist-style: none;\n}\n\n.cn-exports-widget__row {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 12px;\n\tpadding: 10px 0;\n}\n\n.cn-exports-widget__row + .cn-exports-widget__row {\n\tborder-top: 1px solid var(--color-border);\n}\n\n.cn-exports-widget__text {\n\tdisplay: flex;\n\tflex: 1;\n\tflex-direction: column;\n\tgap: 2px;\n\tmin-width: 0;\n}\n\n.cn-exports-widget__name {\n\toverflow: hidden;\n\tfont-size: 14px;\n\tfont-weight: 600;\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n}\n\n.cn-exports-widget__meta,\n.cn-exports-widget__muted {\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 13px;\n}\n\n.cn-exports-widget__muted {\n\tmargin: 0;\n}\n\n.cn-exports-widget__tag {\n\tflex: none;\n\tpadding: 3px 10px;\n\tborder-radius: 12px;\n\tbackground: var(--color-warning-light, color-mix(in srgb, var(--color-warning) 18%, transparent));\n\tcolor: var(--color-warning-text, var(--color-main-text));\n\tfont-size: 13px;\n\tfont-weight: 600;\n\twhite-space: nowrap;\n}\n</style>\n"],"names":["t","axios","n"],"mappings":";;;;;;;AA6CA;AACC;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAED,aAAe;CACd,IAAI,EAAE,iBAAiB;;AAEvB,CAAA,UAAU,EAAE,EAAE,UAAU;;AAExB,CAAA,MAAM,EAAE;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U,EAAE,kBAAkB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAE,GAAE,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC,IAAI,CAAC,GAAG,CAAA;AACnI,MAAE,GAAC;AACJ,GAAA,OAAO;IACN,GAAG,EAAE,MAAM,CAAC,GAAG,CAAC,IAAG,IAAK,GAAG,CAAC,EAAE,CAAC;AAC/B,IAAA,QAAQ,EAAE,GAAG,CAAC,QAAQ;AACtB,IAAA,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC;IACvB,IAAI;IACJ,YAAY,EAAE,OAAO,CAAC,GAAG,CAAC,SAAS,CAAA,IAAK,IAAI,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,YAAY,EAAG,KAAI,IAAI,CAAC,GAAG,CAAC,YAAY,EAAE;AAC3G,IAAA;GACA;EACD;AACF;;;;"}
1
+ {"version":3,"file":"CnExportsWidget.vue2.js","sources":["../../../../src/components/CnExportsWidget/CnExportsWidget.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n<template>\n\t<div class=\"cn-exports-widget\" data-testid=\"cn-exports-widget\">\n\t\t<p v-if=\"loading && runs.length === 0\" class=\"cn-exports-widget__muted\">\n\t\t\t{{ t('nextcloud-vue', 'Loading …') }}\n\t\t</p>\n\t\t<p v-else-if=\"failed\" class=\"cn-exports-widget__muted\" data-testid=\"cn-exports-error\">\n\t\t\t{{ t('nextcloud-vue', 'Your exports could not be loaded.') }}\n\t\t</p>\n\t\t<p v-else-if=\"runs.length === 0\" class=\"cn-exports-widget__muted\" data-testid=\"cn-exports-empty\">\n\t\t\t{{ emptyText }}\n\t\t</p>\n\t\t<ul v-else class=\"cn-exports-widget__list\">\n\t\t\t<li v-for=\"run in shownRuns\"\n\t\t\t\t:key=\"run.key\"\n\t\t\t\tclass=\"cn-exports-widget__row\"\n\t\t\t\tdata-testid=\"cn-exports-row\">\n\t\t\t\t<span class=\"cn-exports-widget__text\">\n\t\t\t\t\t<span class=\"cn-exports-widget__name\">{{ run.filename }}</span>\n\t\t\t\t\t<span class=\"cn-exports-widget__meta\">{{ run.meta }}</span>\n\t\t\t\t</span>\n\t\t\t\t<span v-if=\"run.expiresToday\" class=\"cn-exports-widget__tag\" data-testid=\"cn-exports-expires-today\">\n\t\t\t\t\t{{ t('nextcloud-vue', 'Expires today') }}\n\t\t\t\t</span>\n\t\t\t\t<NcButton v-else-if=\"run.href\"\n\t\t\t\t\t:href=\"run.href\"\n\t\t\t\t\tdata-testid=\"cn-exports-download\">\n\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t<DownloadOutline :size=\"16\" />\n\t\t\t\t\t</template>\n\t\t\t\t\t{{ t('nextcloud-vue', 'Download') }}\n\t\t\t\t</NcButton>\n\t\t\t</li>\n\t\t</ul>\n\t</div>\n</template>\n\n<script>\nimport { getCurrentUser } from '@nextcloud/auth'\nimport axios from '@nextcloud/axios'\nimport { translatePlural as n, translate as t } from '@nextcloud/l10n'\nimport { generateRemoteUrl, generateUrl } from '@nextcloud/router'\nimport { NcButton } from '@nextcloud/vue'\nimport DownloadOutline from 'vue-material-design-icons/DownloadOutline.vue'\nimport { formatBoardDate } from '../../utils/boardDate.js'\n\n/**\n * CnExportsWidget — the reader's own exports (DqZoekresultaten \"Uw exports\"):\n * each file with when it was made, how often it was downloaded and when it\n * expires, a Download button while the file is there, and \"Expires today\" on\n * the day it goes.\n *\n * Reads OpenRegister's export runs (`GET /apps/openregister/api/exports`)\n * with the reader as the actor, so an administrator sees their own here too.\n * `content.register` and `content.schema` narrow it to one list's exports.\n * A run whose file was swept, or that never produced one, is left out.\n *\n * Example (manifest, in an index page's `sidePanel`):\n * ```json\n * { \"id\": \"exports\", \"type\": \"exports\", \"title\": \"Your exports\", \"content\": { \"register\": \"dossiq\", \"schema\": \"case\", \"limit\": 5 } }\n * ```\n */\nexport default {\n\tname: 'CnExportsWidget',\n\n\tcomponents: { DownloadOutline, NcButton },\n\n\tinject: {\n\t\t/** Host translate function provided by CnAppRoot. */\n\t\tcnTranslate: { default: () => (key) => key },\n\t},\n\n\tprops: {\n\t\t/** `{ register?, schema?, limit?, emptyText? }`; `limit` defaults to 5. */\n\t\tcontent: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({}),\n\t\t},\n\t},\n\n\tdata() {\n\t\treturn { loading: false, failed: false, runs: [], now: new Date() }\n\t},\n\n\tcomputed: {\n\t\t/** @return {number} How many exports to show. */\n\t\tlimit() {\n\t\t\tconst limit = Number(this.content && this.content.limit)\n\t\t\treturn Number.isInteger(limit) && limit > 0 ? limit : 5\n\t\t},\n\n\t\t/** @return {Array<object>} The exports to draw, newest first. */\n\t\tshownRuns() {\n\t\t\treturn this.runs\n\t\t\t\t.filter((run) => run && run.filename && run.fileId !== null && run.fileId !== undefined && run.status !== 'expired')\n\t\t\t\t.slice(0, this.limit)\n\t\t\t\t.map((run) => this.view(run))\n\t\t},\n\n\t\t/** @return {string} The empty line. */\n\t\temptyText() {\n\t\t\tconst own = this.content && this.content.emptyText\n\t\t\treturn own ? this.cnTranslate(own) : t('nextcloud-vue', 'You have no exports here.')\n\t\t},\n\t},\n\n\tmounted() {\n\t\tthis.load()\n\t},\n\n\tmethods: {\n\t\tt,\n\n\t\t/**\n\t\t * Read the reader's export runs.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync load() {\n\t\t\tconst user = getCurrentUser()\n\t\t\tif (!user || !user.uid) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.loading = true\n\t\t\tthis.failed = false\n\t\t\ttry {\n\t\t\t\tconst params = { actor: user.uid, limit: Math.max(this.limit * 2, 10) }\n\t\t\t\tfor (const key of ['register', 'schema']) {\n\t\t\t\t\tif (this.content && typeof this.content[key] === 'string' && this.content[key] !== '') {\n\t\t\t\t\t\tparams[key] = this.content[key]\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tconst response = await axios.get(generateUrl('/apps/openregister/api/exports'), { params })\n\t\t\t\tconst results = response && response.data && Array.isArray(response.data.results) ? response.data.results : []\n\t\t\t\tthis.runs = [...results].sort((a, b) => String(b.producedAt || b.created || '').localeCompare(String(a.producedAt || a.created || '')))\n\t\t\t} catch {\n\t\t\t\tthis.failed = true\n\t\t\t\tthis.runs = []\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 * One export as the list draws it.\n\t\t *\n\t\t * @param {object} run An export run.\n\t\t * @return {{key: string, filename: string, meta: string, href: string, expiresToday: boolean}}\n\t\t */\n\t\tview(run) {\n\t\t\tconst made = run.producedAt || run.created\n\t\t\tconst parts = []\n\t\t\tif (made) {\n\t\t\t\tparts.push(t('nextcloud-vue', 'Made {date}', { date: formatBoardDate(made, this.now) }))\n\t\t\t}\n\t\t\tif (typeof run.downloadCount === 'number') {\n\t\t\t\tparts.push(n('nextcloud-vue', 'downloaded %n time', 'downloaded %n times', run.downloadCount))\n\t\t\t}\n\t\t\tif (run.expiresAt) {\n\t\t\t\tparts.push(t('nextcloud-vue', 'expires {date}', { date: formatBoardDate(run.expiresAt, this.now) }))\n\t\t\t}\n\t\t\tconst user = getCurrentUser()\n\t\t\tconst href = run.filePath && user && user.uid\n\t\t\t\t? generateRemoteUrl(`dav/files/${encodeURIComponent(user.uid)}`) + String(run.filePath).split('/').map(encodeURIComponent).join('/')\n\t\t\t\t: ''\n\t\t\treturn {\n\t\t\t\tkey: String(run.uuid || run.id),\n\t\t\t\tfilename: run.filename,\n\t\t\t\tmeta: parts.join(' · '),\n\t\t\t\thref,\n\t\t\t\texpiresToday: Boolean(run.expiresAt) && new Date(run.expiresAt).toDateString() === this.now.toDateString(),\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-exports-widget__list {\n\tdisplay: flex;\n\tflex-direction: column;\n\tmargin: 0;\n\tpadding: 0;\n\tlist-style: none;\n}\n\n.cn-exports-widget__row {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 12px;\n\tpadding: 10px 0;\n}\n\n.cn-exports-widget__row + .cn-exports-widget__row {\n\tborder-top: 1px solid var(--color-border);\n}\n\n.cn-exports-widget__text {\n\tdisplay: flex;\n\tflex: 1;\n\tflex-direction: column;\n\tgap: 2px;\n\tmin-width: 0;\n}\n\n.cn-exports-widget__name {\n\toverflow: hidden;\n\tfont-size: 14px;\n\tfont-weight: 600;\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n}\n\n.cn-exports-widget__meta,\n.cn-exports-widget__muted {\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 13px;\n}\n\n.cn-exports-widget__muted {\n\tmargin: 0;\n}\n\n.cn-exports-widget__tag {\n\tflex: none;\n\tpadding: 3px 10px;\n\tborder-radius: 12px;\n\tbackground: var(--color-warning-light, color-mix(in srgb, var(--color-warning) 18%, transparent));\n\tcolor: var(--color-warning-text, var(--color-main-text));\n\tfont-size: 13px;\n\tfont-weight: 600;\n\twhite-space: nowrap;\n}\n</style>\n"],"names":["t","axios","n"],"mappings":";;;;;;;;AAiDA;AACC;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAED,aAAe;CACd,IAAI,EAAE,iBAAiB;;AAEvB,CAAA,UAAU,EAAE,EAAE,eAAe,EAAE,UAAU;;AAEzC,CAAA,MAAM,EAAE;AACP;AACA,EAAA,WAAW,EAAE,EAAE,OAAO,EAAE,MAAM,CAAC,GAAG,KAAK,KAAK;EAC5C;;AAED,CAAA,KAAK,EAAE;AACN;AACA,EAAA,OAAO,EAAE;GACR,IAAI,EAAE,MAAM;AACZ,GAAA,OAAO,EAAE,OAAO,EAAE,CAAC;GACnB;EACD;;AAED,CAAA,IAAI,GAAG;EACN,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK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AG,CAAC,EAAE,CAAC;AAC/B,IAAA,QAAQ,EAAE,GAAG,CAAC,QAAQ;AACtB,IAAA,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC;IACvB,IAAI;IACJ,YAAY,EAAE,OAAO,CAAC,GAAG,CAAC,SAAS,CAAA,IAAK,IAAI,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,YAAY,EAAG,KAAI,IAAI,CAAC,GAAG,CAAC,YAAY,EAAE;AAC3G,IAAA;GACA;EACD;AACF;;;;"}
@@ -1,4 +1,4 @@
1
- import { resolveComponent, openBlock, createElementBlock, toDisplayString, Fragment, renderList, createElementVNode, createBlock, withCtx, createTextVNode, createCommentVNode } from 'vue';
1
+ import { resolveComponent, openBlock, createElementBlock, toDisplayString, Fragment, renderList, createElementVNode, createBlock, withCtx, createVNode, createTextVNode, createCommentVNode } from 'vue';
2
2
 
3
3
  const _hoisted_1 = {
4
4
  class: "cn-exports-widget",
@@ -32,6 +32,7 @@ const _hoisted_9 = {
32
32
  };
33
33
 
34
34
  function render(_ctx, _cache, $props, $setup, $data, $options) {
35
+ const _component_DownloadOutline = resolveComponent("DownloadOutline");
35
36
  const _component_NcButton = resolveComponent("NcButton");
36
37
 
37
38
  return (openBlock(), createElementBlock("div", _hoisted_1, [
@@ -60,8 +61,11 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
60
61
  href: run.href,
61
62
  "data-testid": "cn-exports-download"
62
63
  }, {
64
+ icon: withCtx(() => [
65
+ createVNode(_component_DownloadOutline, { size: 16 })
66
+ ]),
63
67
  default: withCtx(() => [
64
- createTextVNode(toDisplayString($options.t('nextcloud-vue', 'Download')), 1 /* TEXT */)
68
+ createTextVNode(" " + toDisplayString($options.t('nextcloud-vue', 'Download')), 1 /* TEXT */)
65
69
  ]),
66
70
  _: 1 /* STABLE */
67
71
  }, 8 /* PROPS */, ["href"]))
@@ -1 +1 @@
1
- {"version":3,"file":"CnExportsWidget.vue3.js","sources":["../../../../src/components/CnExportsWidget/CnExportsWidget.vue?vue&type=template&id=1a295cca&lang.js"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n<template>\n\t<div class=\"cn-exports-widget\" data-testid=\"cn-exports-widget\">\n\t\t<p v-if=\"loading && runs.length === 0\" class=\"cn-exports-widget__muted\">\n\t\t\t{{ t('nextcloud-vue', 'Loading …') }}\n\t\t</p>\n\t\t<p v-else-if=\"failed\" class=\"cn-exports-widget__muted\" data-testid=\"cn-exports-error\">\n\t\t\t{{ t('nextcloud-vue', 'Your exports could not be loaded.') }}\n\t\t</p>\n\t\t<p v-else-if=\"runs.length === 0\" class=\"cn-exports-widget__muted\" data-testid=\"cn-exports-empty\">\n\t\t\t{{ emptyText }}\n\t\t</p>\n\t\t<ul v-else class=\"cn-exports-widget__list\">\n\t\t\t<li v-for=\"run in shownRuns\"\n\t\t\t\t:key=\"run.key\"\n\t\t\t\tclass=\"cn-exports-widget__row\"\n\t\t\t\tdata-testid=\"cn-exports-row\">\n\t\t\t\t<span class=\"cn-exports-widget__text\">\n\t\t\t\t\t<span class=\"cn-exports-widget__name\">{{ run.filename }}</span>\n\t\t\t\t\t<span class=\"cn-exports-widget__meta\">{{ run.meta }}</span>\n\t\t\t\t</span>\n\t\t\t\t<span v-if=\"run.expiresToday\" class=\"cn-exports-widget__tag\" data-testid=\"cn-exports-expires-today\">\n\t\t\t\t\t{{ t('nextcloud-vue', 'Expires today') }}\n\t\t\t\t</span>\n\t\t\t\t<NcButton v-else-if=\"run.href\"\n\t\t\t\t\t:href=\"run.href\"\n\t\t\t\t\tdata-testid=\"cn-exports-download\">\n\t\t\t\t\t{{ t('nextcloud-vue', 'Download') }}\n\t\t\t\t</NcButton>\n\t\t\t</li>\n\t\t</ul>\n\t</div>\n</template>\n\n<script>\nimport { getCurrentUser } from '@nextcloud/auth'\nimport axios from '@nextcloud/axios'\nimport { translatePlural as n, translate as t } from '@nextcloud/l10n'\nimport { generateRemoteUrl, generateUrl } from '@nextcloud/router'\nimport { NcButton } from '@nextcloud/vue'\nimport { formatBoardDate } from '../../utils/boardDate.js'\n\n/**\n * CnExportsWidget — the reader's own exports (DqZoekresultaten \"Uw exports\"):\n * each file with when it was made, how often it was downloaded and when it\n * expires, a Download button while the file is there, and \"Expires today\" on\n * the day it goes.\n *\n * Reads OpenRegister's export runs (`GET /apps/openregister/api/exports`)\n * with the reader as the actor, so an administrator sees their own here too.\n * `content.register` and `content.schema` narrow it to one list's exports.\n * A run whose file was swept, or that never produced one, is left out.\n *\n * Example (manifest, in an index page's `sidePanel`):\n * ```json\n * { \"id\": \"exports\", \"type\": \"exports\", \"title\": \"Your exports\", \"content\": { \"register\": \"dossiq\", \"schema\": \"case\", \"limit\": 5 } }\n * ```\n */\nexport default {\n\tname: 'CnExportsWidget',\n\n\tcomponents: { NcButton },\n\n\tinject: {\n\t\t/** Host translate function provided by CnAppRoot. */\n\t\tcnTranslate: { default: () => (key) => key },\n\t},\n\n\tprops: {\n\t\t/** `{ register?, schema?, limit?, emptyText? }`; `limit` defaults to 5. */\n\t\tcontent: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({}),\n\t\t},\n\t},\n\n\tdata() {\n\t\treturn { loading: false, failed: false, runs: [], now: new Date() }\n\t},\n\n\tcomputed: {\n\t\t/** @return {number} How many exports to show. */\n\t\tlimit() {\n\t\t\tconst limit = Number(this.content && this.content.limit)\n\t\t\treturn Number.isInteger(limit) && limit > 0 ? limit : 5\n\t\t},\n\n\t\t/** @return {Array<object>} The exports to draw, newest first. */\n\t\tshownRuns() {\n\t\t\treturn this.runs\n\t\t\t\t.filter((run) => run && run.filename && run.fileId !== null && run.fileId !== undefined && run.status !== 'expired')\n\t\t\t\t.slice(0, this.limit)\n\t\t\t\t.map((run) => this.view(run))\n\t\t},\n\n\t\t/** @return {string} The empty line. */\n\t\temptyText() {\n\t\t\tconst own = this.content && this.content.emptyText\n\t\t\treturn own ? this.cnTranslate(own) : t('nextcloud-vue', 'You have no exports here.')\n\t\t},\n\t},\n\n\tmounted() {\n\t\tthis.load()\n\t},\n\n\tmethods: {\n\t\tt,\n\n\t\t/**\n\t\t * Read the reader's export runs.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync load() {\n\t\t\tconst user = getCurrentUser()\n\t\t\tif (!user || !user.uid) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.loading = true\n\t\t\tthis.failed = false\n\t\t\ttry {\n\t\t\t\tconst params = { actor: user.uid, limit: Math.max(this.limit * 2, 10) }\n\t\t\t\tfor (const key of ['register', 'schema']) {\n\t\t\t\t\tif (this.content && typeof this.content[key] === 'string' && this.content[key] !== '') {\n\t\t\t\t\t\tparams[key] = this.content[key]\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tconst response = await axios.get(generateUrl('/apps/openregister/api/exports'), { params })\n\t\t\t\tconst results = response && response.data && Array.isArray(response.data.results) ? response.data.results : []\n\t\t\t\tthis.runs = [...results].sort((a, b) => String(b.producedAt || b.created || '').localeCompare(String(a.producedAt || a.created || '')))\n\t\t\t} catch {\n\t\t\t\tthis.failed = true\n\t\t\t\tthis.runs = []\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 * One export as the list draws it.\n\t\t *\n\t\t * @param {object} run An export run.\n\t\t * @return {{key: string, filename: string, meta: string, href: string, expiresToday: boolean}}\n\t\t */\n\t\tview(run) {\n\t\t\tconst made = run.producedAt || run.created\n\t\t\tconst parts = []\n\t\t\tif (made) {\n\t\t\t\tparts.push(t('nextcloud-vue', 'Made {date}', { date: formatBoardDate(made, this.now) }))\n\t\t\t}\n\t\t\tif (typeof run.downloadCount === 'number') {\n\t\t\t\tparts.push(n('nextcloud-vue', 'downloaded %n time', 'downloaded %n times', run.downloadCount))\n\t\t\t}\n\t\t\tif (run.expiresAt) {\n\t\t\t\tparts.push(t('nextcloud-vue', 'expires {date}', { date: formatBoardDate(run.expiresAt, this.now) }))\n\t\t\t}\n\t\t\tconst user = getCurrentUser()\n\t\t\tconst href = run.filePath && user && user.uid\n\t\t\t\t? generateRemoteUrl(`dav/files/${encodeURIComponent(user.uid)}`) + String(run.filePath).split('/').map(encodeURIComponent).join('/')\n\t\t\t\t: ''\n\t\t\treturn {\n\t\t\t\tkey: String(run.uuid || run.id),\n\t\t\t\tfilename: run.filename,\n\t\t\t\tmeta: parts.join(' · '),\n\t\t\t\thref,\n\t\t\t\texpiresToday: Boolean(run.expiresAt) && new Date(run.expiresAt).toDateString() === this.now.toDateString(),\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-exports-widget__list {\n\tdisplay: flex;\n\tflex-direction: column;\n\tmargin: 0;\n\tpadding: 0;\n\tlist-style: none;\n}\n\n.cn-exports-widget__row {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 12px;\n\tpadding: 10px 0;\n}\n\n.cn-exports-widget__row + .cn-exports-widget__row {\n\tborder-top: 1px solid var(--color-border);\n}\n\n.cn-exports-widget__text {\n\tdisplay: flex;\n\tflex: 1;\n\tflex-direction: column;\n\tgap: 2px;\n\tmin-width: 0;\n}\n\n.cn-exports-widget__name {\n\toverflow: hidden;\n\tfont-size: 14px;\n\tfont-weight: 600;\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n}\n\n.cn-exports-widget__meta,\n.cn-exports-widget__muted {\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 13px;\n}\n\n.cn-exports-widget__muted {\n\tmargin: 0;\n}\n\n.cn-exports-widget__tag {\n\tflex: none;\n\tpadding: 3px 10px;\n\tborder-radius: 12px;\n\tbackground: var(--color-warning-light, color-mix(in srgb, var(--color-warning) 18%, transparent));\n\tcolor: var(--color-warning-text, var(--color-main-text));\n\tfont-size: 13px;\n\tfont-weight: 600;\n\twhite-space: nowrap;\n}\n</style>\n"],"names":["_openBlock","_createElementBlock","_toDisplayString","_createElementVNode","_createBl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AA,CAGO,QAHP,UAGO,EAAA;AAFN,oBAAAA,kBAAA,CAAwC,MAAxC,EAAA,UAAwC,EAAAD,eAAA,CAAA,GAAA,CAAA,QAAA,CAAA,EAAA,CAAA,YAAA;AACxC,oBAAAC,kBAAA,CAAK,MAAL,EAAA,UAAK,EAAAD,eAAA,CAAA,GAAA,CAAA,IAAA,CAAA,EAAA,CAAA,YAAA;;AAEM,kBAAA,CAAA,GAAG,CAAC,YAAA;oCAAfD,kBAEM,CAAA,MAAA,EAFN,UAEM,EAAAC,eAAA,CADH,QAAC,CAAA,CAAA,CAAA,eAAA,EAAA,eAAA,CAAA,CAAA,EAAA,CAAA,YAAA;AAEK,sBAAA,CAAA,GAAA,CAAA,IAAA;sCAAVE;;0BACE,IAAC,EAAA,GAAA,CAAA,IAAA;AACF,0BAAA,aAAC,EAAA,qBAAA;;2CACD,MAAC;4DAAA,QAAA,CAAA,CAAA,CAAA,eAAA,EAAA,UAAA,CAAA,CAAA,EAAA,CAAA,YAAA;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"CnExportsWidget.vue3.js","sources":["../../../../src/components/CnExportsWidget/CnExportsWidget.vue?vue&type=template&id=9d27adf2&lang.js"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n<template>\n\t<div class=\"cn-exports-widget\" data-testid=\"cn-exports-widget\">\n\t\t<p v-if=\"loading && runs.length === 0\" class=\"cn-exports-widget__muted\">\n\t\t\t{{ t('nextcloud-vue', 'Loading …') }}\n\t\t</p>\n\t\t<p v-else-if=\"failed\" class=\"cn-exports-widget__muted\" data-testid=\"cn-exports-error\">\n\t\t\t{{ t('nextcloud-vue', 'Your exports could not be loaded.') }}\n\t\t</p>\n\t\t<p v-else-if=\"runs.length === 0\" class=\"cn-exports-widget__muted\" data-testid=\"cn-exports-empty\">\n\t\t\t{{ emptyText }}\n\t\t</p>\n\t\t<ul v-else class=\"cn-exports-widget__list\">\n\t\t\t<li v-for=\"run in shownRuns\"\n\t\t\t\t:key=\"run.key\"\n\t\t\t\tclass=\"cn-exports-widget__row\"\n\t\t\t\tdata-testid=\"cn-exports-row\">\n\t\t\t\t<span class=\"cn-exports-widget__text\">\n\t\t\t\t\t<span class=\"cn-exports-widget__name\">{{ run.filename }}</span>\n\t\t\t\t\t<span class=\"cn-exports-widget__meta\">{{ run.meta }}</span>\n\t\t\t\t</span>\n\t\t\t\t<span v-if=\"run.expiresToday\" class=\"cn-exports-widget__tag\" data-testid=\"cn-exports-expires-today\">\n\t\t\t\t\t{{ t('nextcloud-vue', 'Expires today') }}\n\t\t\t\t</span>\n\t\t\t\t<NcButton v-else-if=\"run.href\"\n\t\t\t\t\t:href=\"run.href\"\n\t\t\t\t\tdata-testid=\"cn-exports-download\">\n\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t<DownloadOutline :size=\"16\" />\n\t\t\t\t\t</template>\n\t\t\t\t\t{{ t('nextcloud-vue', 'Download') }}\n\t\t\t\t</NcButton>\n\t\t\t</li>\n\t\t</ul>\n\t</div>\n</template>\n\n<script>\nimport { getCurrentUser } from '@nextcloud/auth'\nimport axios from '@nextcloud/axios'\nimport { translatePlural as n, translate as t } from '@nextcloud/l10n'\nimport { generateRemoteUrl, generateUrl } from '@nextcloud/router'\nimport { NcButton } from '@nextcloud/vue'\nimport DownloadOutline from 'vue-material-design-icons/DownloadOutline.vue'\nimport { formatBoardDate } from '../../utils/boardDate.js'\n\n/**\n * CnExportsWidget — the reader's own exports (DqZoekresultaten \"Uw exports\"):\n * each file with when it was made, how often it was downloaded and when it\n * expires, a Download button while the file is there, and \"Expires today\" on\n * the day it goes.\n *\n * Reads OpenRegister's export runs (`GET /apps/openregister/api/exports`)\n * with the reader as the actor, so an administrator sees their own here too.\n * `content.register` and `content.schema` narrow it to one list's exports.\n * A run whose file was swept, or that never produced one, is left out.\n *\n * Example (manifest, in an index page's `sidePanel`):\n * ```json\n * { \"id\": \"exports\", \"type\": \"exports\", \"title\": \"Your exports\", \"content\": { \"register\": \"dossiq\", \"schema\": \"case\", \"limit\": 5 } }\n * ```\n */\nexport default {\n\tname: 'CnExportsWidget',\n\n\tcomponents: { DownloadOutline, NcButton },\n\n\tinject: {\n\t\t/** Host translate function provided by CnAppRoot. */\n\t\tcnTranslate: { default: () => (key) => key },\n\t},\n\n\tprops: {\n\t\t/** `{ register?, schema?, limit?, emptyText? }`; `limit` defaults to 5. */\n\t\tcontent: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({}),\n\t\t},\n\t},\n\n\tdata() {\n\t\treturn { loading: false, failed: false, runs: [], now: new Date() }\n\t},\n\n\tcomputed: {\n\t\t/** @return {number} How many exports to show. */\n\t\tlimit() {\n\t\t\tconst limit = Number(this.content && this.content.limit)\n\t\t\treturn Number.isInteger(limit) && limit > 0 ? limit : 5\n\t\t},\n\n\t\t/** @return {Array<object>} The exports to draw, newest first. */\n\t\tshownRuns() {\n\t\t\treturn this.runs\n\t\t\t\t.filter((run) => run && run.filename && run.fileId !== null && run.fileId !== undefined && run.status !== 'expired')\n\t\t\t\t.slice(0, this.limit)\n\t\t\t\t.map((run) => this.view(run))\n\t\t},\n\n\t\t/** @return {string} The empty line. */\n\t\temptyText() {\n\t\t\tconst own = this.content && this.content.emptyText\n\t\t\treturn own ? this.cnTranslate(own) : t('nextcloud-vue', 'You have no exports here.')\n\t\t},\n\t},\n\n\tmounted() {\n\t\tthis.load()\n\t},\n\n\tmethods: {\n\t\tt,\n\n\t\t/**\n\t\t * Read the reader's export runs.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync load() {\n\t\t\tconst user = getCurrentUser()\n\t\t\tif (!user || !user.uid) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.loading = true\n\t\t\tthis.failed = false\n\t\t\ttry {\n\t\t\t\tconst params = { actor: user.uid, limit: Math.max(this.limit * 2, 10) }\n\t\t\t\tfor (const key of ['register', 'schema']) {\n\t\t\t\t\tif (this.content && typeof this.content[key] === 'string' && this.content[key] !== '') {\n\t\t\t\t\t\tparams[key] = this.content[key]\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tconst response = await axios.get(generateUrl('/apps/openregister/api/exports'), { params })\n\t\t\t\tconst results = response && response.data && Array.isArray(response.data.results) ? response.data.results : []\n\t\t\t\tthis.runs = [...results].sort((a, b) => String(b.producedAt || b.created || '').localeCompare(String(a.producedAt || a.created || '')))\n\t\t\t} catch {\n\t\t\t\tthis.failed = true\n\t\t\t\tthis.runs = []\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 * One export as the list draws it.\n\t\t *\n\t\t * @param {object} run An export run.\n\t\t * @return {{key: string, filename: string, meta: string, href: string, expiresToday: boolean}}\n\t\t */\n\t\tview(run) {\n\t\t\tconst made = run.producedAt || run.created\n\t\t\tconst parts = []\n\t\t\tif (made) {\n\t\t\t\tparts.push(t('nextcloud-vue', 'Made {date}', { date: formatBoardDate(made, this.now) }))\n\t\t\t}\n\t\t\tif (typeof run.downloadCount === 'number') {\n\t\t\t\tparts.push(n('nextcloud-vue', 'downloaded %n time', 'downloaded %n times', run.downloadCount))\n\t\t\t}\n\t\t\tif (run.expiresAt) {\n\t\t\t\tparts.push(t('nextcloud-vue', 'expires {date}', { date: formatBoardDate(run.expiresAt, this.now) }))\n\t\t\t}\n\t\t\tconst user = getCurrentUser()\n\t\t\tconst href = run.filePath && user && user.uid\n\t\t\t\t? generateRemoteUrl(`dav/files/${encodeURIComponent(user.uid)}`) + String(run.filePath).split('/').map(encodeURIComponent).join('/')\n\t\t\t\t: ''\n\t\t\treturn {\n\t\t\t\tkey: String(run.uuid || run.id),\n\t\t\t\tfilename: run.filename,\n\t\t\t\tmeta: parts.join(' · '),\n\t\t\t\thref,\n\t\t\t\texpiresToday: Boolean(run.expiresAt) && new Date(run.expiresAt).toDateString() === this.now.toDateString(),\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-exports-widget__list {\n\tdisplay: flex;\n\tflex-direction: column;\n\tmargin: 0;\n\tpadding: 0;\n\tlist-style: none;\n}\n\n.cn-exports-widget__row {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 12px;\n\tpadding: 10px 0;\n}\n\n.cn-exports-widget__row + .cn-exports-widget__row {\n\tborder-top: 1px solid var(--color-border);\n}\n\n.cn-exports-widget__text {\n\tdisplay: flex;\n\tflex: 1;\n\tflex-direction: column;\n\tgap: 2px;\n\tmin-width: 0;\n}\n\n.cn-exports-widget__name {\n\toverflow: hidden;\n\tfont-size: 14px;\n\tfont-weight: 600;\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n}\n\n.cn-exports-widget__meta,\n.cn-exports-widget__muted {\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 13px;\n}\n\n.cn-exports-widget__muted {\n\tmargin: 0;\n}\n\n.cn-exports-widget__tag {\n\tflex: none;\n\tpadding: 3px 10px;\n\tborder-radius: 12px;\n\tbackground: var(--color-warning-light, color-mix(in srgb, var(--color-warning) 18%, transparent));\n\tcolor: var(--color-warning-text, var(--color-main-text));\n\tfont-size: 13px;\n\tfont-weight: 600;\n\twhite-space: nowrap;\n}\n</style>\n"],"names":["_openBlock","_createElementBlock","_toDisplayString","_createElementVNode","_createVNode","_createTextVNode"],"mappings":";;;AASM,EAAA,KAAK,EAAC,mBAAmB;AAAC,EAAA,aAAW,EAAC,mBAAmB;;;;AACtB,EAAA,KAAK,EAAC,0BAAgB;;;;AAG9C,EAAA,KAAA,EAAA,0BAAA;AAAA,EAAA,aAAA,EAAA,kBAAA;;;;AAGa,EAAA,KAAA,EAAA,0BAAA;AAAA,EAAA,aAAA,EAAA,kBAAA;;;;AAGjB,EAAA,KAAK,EAAC,yBAAa;;AAKtB,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,yBAAyB,GAAA;AAC9B,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,yBAAyB,GAAA;AAChC,MAA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YAAA;AAEgB,sBAAA,CAAA,GAAG,CAAC,IAAG;;;0BAC1B,IAAI,EAAE,GAAG,CAAA,IAAA;AACV,0BAAA,aAAW,EAAC;;AACH,0BAAA,IAAA,UACR,MAAC;4BAADE,WAAC,CAAA,0BAAA,EAAA,EAAA,IAAA,EAAA,EAAA,EAAA,CAAA;;2CACD,MACD;AADC,4BAAAC,eAAA,CAAA,GACD,mBAAC,QAAA,CAAA,CAAA,CAAA,eAAA,EAAA,UAAA,CAAA,CAAA,EAAA,CAAA,YAAA;;;;;;;;;;;;;"}
@@ -2,7 +2,7 @@ import script from './CnFeaturesBoard.vue2.js';
2
2
  import { render } from './CnFeaturesBoard.vue3.js';
3
3
 
4
4
  script.render = render;
5
- script.__scopeId = "data-v-0eb0ecb8";
5
+ script.__scopeId = "data-v-2f1d34be";
6
6
  const __sfc_main = script;
7
7
 
8
8
  export { __sfc_main as default };