@conduction/nextcloud-vue 2.171.0 → 2.172.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 (31) hide show
  1. package/dist/esm/components/CnActionDialog/CnActionDialog.vue.js +1 -1
  2. package/dist/esm/components/CnActionDialog/CnActionDialog.vue2.js.map +1 -1
  3. package/dist/esm/components/CnActionDialog/CnActionDialog.vue3.js.map +1 -1
  4. package/dist/esm/components/CnChecklistRunWidget/CnChecklistRunWidget.vue.js +1 -1
  5. package/dist/esm/components/CnChecklistRunWidget/CnChecklistRunWidget.vue2.js +22 -3
  6. package/dist/esm/components/CnChecklistRunWidget/CnChecklistRunWidget.vue2.js.map +1 -1
  7. package/dist/esm/components/CnChecklistRunWidget/CnChecklistRunWidget.vue3.js.map +1 -1
  8. package/dist/esm/components/CnDeviceFramesWidget/CnDeviceFramesWidget.vue.js +1 -1
  9. package/dist/esm/components/CnDeviceFramesWidget/CnDeviceFramesWidget.vue2.js +75 -4
  10. package/dist/esm/components/CnDeviceFramesWidget/CnDeviceFramesWidget.vue2.js.map +1 -1
  11. package/dist/esm/components/CnDeviceFramesWidget/CnDeviceFramesWidget.vue3.js.map +1 -1
  12. package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue.js +1 -1
  13. package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue2.js +7 -3
  14. package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue2.js.map +1 -1
  15. package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue3.js.map +1 -1
  16. package/dist/esm/library-style.js +1 -1
  17. package/dist/esm/nextcloud-vue.css +270 -162
  18. package/dist/esm/utils/builtInFormatters.js +19 -1
  19. package/dist/esm/utils/builtInFormatters.js.map +1 -1
  20. package/dist/nextcloud-vue.cjs.js +122 -13
  21. package/dist/nextcloud-vue.cjs.js.map +2 -2
  22. package/dist/nextcloud-vue.css +270 -162
  23. package/package.json +1 -1
  24. package/src/components/CnActionDialog/CnActionDialog.vue +4 -1
  25. package/src/components/CnChecklistRunWidget/CnChecklistRunWidget.vue +24 -3
  26. package/src/components/CnDeviceFramesWidget/CnDeviceFramesWidget.vue +75 -4
  27. package/src/components/CnFactsWidget/CnFactsWidget.vue +7 -3
  28. package/src/css/look-board-detail.css +100 -1
  29. package/src/css/look-board-index.css +7 -6
  30. package/src/css/patches.css +4 -1
  31. package/src/utils/builtInFormatters.js +18 -0
@@ -1 +1 @@
1
- {"version":3,"file":"CnDeviceFramesWidget.vue3.js","sources":["../../../../src/components/CnDeviceFramesWidget/CnDeviceFramesWidget.vue?vue&type=template&id=0d8080b4&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, dividers: false, gap: 12, 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 plain sections, 12px apart\n * without a rule, under a header with the frame's title and an optional\n * status line. The status can follow the connection (\"Offline · synced at\n * 07:42\" while the device is offline). The frames wrap onto the next row\n * when the page is 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\tline-height: normal;\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,+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,QAAA,EAAA,KAAA,EAAA,GAAA,EAAA,EAAA,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=41a3b42e&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, dividers: false, gap: 12, 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'\nimport { fetchReferenceObjects } from '../../utils/boardReferenceColumns.js'\nimport { readPath } from '../../utils/readPath.js'\nimport { hasUnresolvedTokens, resolveFilterTokens } from '../../utils/resolveFilterTokens.js'\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 plain sections, 12px apart\n * without a rule, under a header with the frame's title and an optional\n * status line. The status can follow the connection (\"Offline · synced at\n * 07:42\" while the device is offline). The frames wrap onto the next row\n * when the page is 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, titleFrom?, 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 * `titleFrom: { source: { register, schema, filter, sort? }, field }` titles the frame by that field of the\n\t\t * first matching record, read under the reader's rights; `title` stays while none matches.\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`. With `syncedFrom: { source: { register, schema,\n\t\t * filter }, field }` the newest value of that date field is the last synchronisation, and while\n\t\t * offline the line reads `offlineSyncedText` with `{time}` as its time (`offlineText` without one).\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\treadTitles: {},\n\t\t\tsyncedTime: '',\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.readTitles[index] || 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\tthis.readSources()\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\tif (!this.online && this.syncedTime && typeof status.offlineSyncedText === 'string' && status.offlineSyncedText !== '') {\n\t\t\t\t\treturn this.statusLine(this.tr(status.offlineSyncedText).replace('{time}', this.syncedTime), tone)\n\t\t\t\t}\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\treturn this.statusLine(this.tr(text), tone)\n\t\t},\n\n\t\t/**\n\t\t * A status line of a text and a tone.\n\t\t *\n\t\t * @param {string} text The translated text.\n\t\t * @param {string} tone The tone.\n\t\t * @return {{text: string, tone: string, icon: object}}\n\t\t */\n\t\tstatusLine(text, tone) {\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, tone: known, icon: markRaw(icon) }\n\t\t},\n\n\t\t/**\n\t\t * The first record of a `{ source: { register, schema, filter, sort? } }`, sorted by `sort` (or\n\t\t * newest first by `orderBy`), under the reader's rights; null without one or while a token is unresolved.\n\t\t *\n\t\t * @param {object} spec The source spec.\n\t\t * @param {string} [orderBy] A field to sort on, newest first, when the source names no sort.\n\t\t * @return {Promise<object|null>}\n\t\t */\n\t\tasync firstOf(spec, orderBy = '') {\n\t\t\tconst source = spec?.source\n\t\t\tif (!source || typeof source !== 'object' || !source.register || !source.schema) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tconst filter = resolveFilterTokens(source.filter || {}, { objectId: this.objectId || null, object: this.objectData })\n\t\t\tif (hasUnresolvedTokens(filter)) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tconst sort = source.sort?.field ? { [`_order[${source.sort.field}]`]: source.sort.dir === 'asc' ? 'asc' : 'desc' } : (orderBy ? { [`_order[${orderBy}]`]: 'desc' } : {})\n\t\t\ttry {\n\t\t\t\tconst rows = await fetchReferenceObjects({ register: source.register, schema: source.schema, filter: { ...filter, ...sort }, limit: 1 })\n\t\t\t\treturn Array.isArray(rows) && rows.length > 0 ? rows[0] : null\n\t\t\t} catch {\n\t\t\t\treturn null\n\t\t\t}\n\t\t},\n\n\t\t/** Read the frame titles (`titleFrom`) and the last synchronisation (`status.syncedFrom`). */\n\t\tasync readSources() {\n\t\t\tconst list = Array.isArray(this.content?.frames) ? this.content.frames.filter((frame) => frame && typeof frame === 'object') : []\n\t\t\tconst titles = {}\n\t\t\tawait Promise.all(list.map(async (frame, index) => {\n\t\t\t\tif (!frame.titleFrom?.field) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tconst value = readPath(await this.firstOf(frame.titleFrom), frame.titleFrom.field)\n\t\t\t\tif (typeof value === 'string' && value !== '') {\n\t\t\t\t\ttitles[index] = value\n\t\t\t\t}\n\t\t\t}))\n\t\t\tthis.readTitles = titles\n\t\t\tconst synced = this.content?.status?.syncedFrom\n\t\t\tif (synced?.field) {\n\t\t\t\tconst at = new Date(readPath(await this.firstOf(synced, synced.field), synced.field) ?? '')\n\t\t\t\tthis.syncedTime = Number.isNaN(at.getTime()) ? '' : `${String(at.getHours()).padStart(2, '0')}:${String(at.getMinutes()).padStart(2, '0')}`\n\t\t\t}\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\tline-height: normal;\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,+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,QAAA,EAAA,KAAA,EAAA,GAAA,EAAA,EAAA,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;;;;;;;;;;;;"}
@@ -3,7 +3,7 @@ export { FACTS_REVEAL_CHANNEL } from './CnFactsWidget.vue2.js';
3
3
  import { render } from './CnFactsWidget.vue3.js';
4
4
 
5
5
  script.render = render;
6
- script.__scopeId = "data-v-03c2322b";
6
+ script.__scopeId = "data-v-4dae3b2e";
7
7
  const __sfc_main = script;
8
8
 
9
9
  export { __sfc_main as default };
@@ -15,7 +15,7 @@ import { useRefLabels } from '../../composables/useRefLabels.js';
15
15
  import { dispatchAction } from '../../utils/actionsDispatcher.js';
16
16
  import { isBadgeVariant } from '../../utils/badgeVariants.js';
17
17
  import { formatBoardDate, formatTimeOfDay } from '../../utils/boardDate.js';
18
- import { formatTermDuration } from '../../utils/builtInFormatters.js';
18
+ import { formatPostcode, formatTermDuration } from '../../utils/builtInFormatters.js';
19
19
  import { conditionalLine } from '../../utils/conditionalLine.js';
20
20
  import { parseDateValue } from '../../utils/dateVariant.js';
21
21
  import { fetchListTotal } from '../../utils/fetchFilterCounts.js';
@@ -245,8 +245,8 @@ var script = {
245
245
  * - `headerPill` — a status pill in the card header (reported through the `header` event): `{ path?, text?, map?, variant?, variantMap?, colorMap? }`, read from the record like a `pill` entry (DqBezwaar "Advies ontvangen"); nothing shows while the value is empty.
246
246
  * - `notice` — `{ text, variant? }`, a note band inside the card under the facts (`info` by default; `success`, `warning` or `error`); the text is translated.
247
247
  * - `footnote` — a plain muted line under the facts, without a band (DqZaakBesluiten "Na het ondertekenen ..."); the text is translated.
248
- * `format` is `text` (default), `date` (board short date), `date-long` (always with the year), `longdate` (the month written out, the year only outside this year: "3 oktober"), `longdatetime` (the month written out, the year and the time: "7 oktober 2026, 09:12"), `duration` (an ISO period in words, "4 weken"; `extendBy` names the extension period on the record: "4 weken, te verdagen met 2"), `year` ("2026"), `list` (an array joined by ", ", each item read at `itemPath` and written in `itemFormat`), `group` (a Nextcloud group by its display name), `bytes` (a size, "1.5 MB"), `number` (in the reader's language, `decimals` fraction digits when set), `months` (a number of months in words, whole years as years: 240 is "20 jaar") or `currency` (a money amount in the reader's language, "€ 1.234,50": the code in `currency`, else the record's `currencyField`, else the app's reporting currency, else EUR; `decimals` defaults to 2).
249
- * `format` is `text` (default), `today-time` (a moment today as "10:24", another day as its board date), `date` (board short date), `date-long` (always with the year), `longdate` (the month written out, the year only outside this year: "3 oktober"), `duration` (an ISO period in words, "4 weken"; `extendBy` names the extension period on the record: "4 weken, te verdagen met 2"), `year` ("2026"), `list` (an array joined by ", ", each item read at `itemPath` and written in `itemFormat`), `group` (a Nextcloud group by its display name), `bytes` (a size, "1.5 MB"), `number` (in the reader's language, `decimals` fraction digits when set), `months` (a number of months in words, whole years as years: 240 is "20 jaar") or `currency` (a money amount in the reader's language, "€ 1.234,50": the code in `currency`, else the record's `currencyField`, else the app's reporting currency, else EUR; `decimals` defaults to 2).
248
+ * `format` is `text` (default), `date` (board short date), `date-long` (always with the year), `longdate` (the month written out, the year only outside this year: "3 oktober"), `longdatetime` (the month written out, the year and the time: "7 oktober 2026, 09:12"), `duration` (an ISO period in words, "4 weken"; `extendBy` names the extension period on the record: "4 weken, te verdagen met 2"), `year` ("2026"), `postcode` (a Dutch postcode with its space, "2999 AA"), `list` (an array joined by ", ", each item read at `itemPath` and written in `itemFormat`), `group` (a Nextcloud group by its display name), `bytes` (a size, "1.5 MB"), `number` (in the reader's language, `decimals` fraction digits when set), `months` (a number of months in words, whole years as years: 240 is "20 jaar") or `currency` (a money amount in the reader's language, "€ 1.234,50": the code in `currency`, else the record's `currencyField`, else the app's reporting currency, else EUR; `decimals` defaults to 2).
249
+ * `format` is `text` (default), `today-time` (a moment today as "10:24", another day as its board date), `date` (board short date), `date-long` (always with the year), `longdate` (the month written out, the year only outside this year: "3 oktober"), `duration` (an ISO period in words, "4 weken"; `extendBy` names the extension period on the record: "4 weken, te verdagen met 2"), `year` ("2026"), `postcode` (a Dutch postcode with its space, "2999 AA"), `list` (an array joined by ", ", each item read at `itemPath` and written in `itemFormat`), `group` (a Nextcloud group by its display name), `bytes` (a size, "1.5 MB"), `number` (in the reader's language, `decimals` fraction digits when set), `months` (a number of months in words, whole years as years: 240 is "20 jaar") or `currency` (a money amount in the reader's language, "€ 1.234,50": the code in `currency`, else the record's `currencyField`, else the app's reporting currency, else EUR; `decimals` defaults to 2).
250
250
  * `map` turns a raw value into a label (translated). `parts` (on a `line`) lists paths, or `{ path, label?, format? }`, joined by `separator` (default " · "); empty parts are dropped.
251
251
  * - `source` — `{ register, schema, id }` or `{ url }`; omitted = the current object. `{ register, schema, filter, sort? }` without `id` reads the first object that matches `filter` in `sort` order (`{ field, dir }`): the latest count of a shift. An entry with `from: "object"` reads the current object even then (a client card that also shows the ticket's channel).
252
252
  * - `endpointSource` — `{ url, method?, params?, responsePath? }`, the block a stat or chart takes: the facts read an app endpoint, shared and cached like those.
@@ -1962,6 +1962,10 @@ var script = {
1962
1962
  const end = Date.UTC(today.getFullYear(), today.getMonth(), today.getDate());
1963
1963
  return String(Math.max(0, Math.round((end - start) / 86400000)))
1964
1964
  }
1965
+ // A Dutch postcode with its space: "2999AA" as "2999 AA".
1966
+ if (format === 'postcode') {
1967
+ return formatPostcode(raw)
1968
+ }
1965
1969
  if (format === 'year') {
1966
1970
  const date = parseDateValue(raw);
1967
1971
  return date === null ? '' : String(date.getFullYear())