@conduction/nextcloud-vue 2.135.0 → 2.137.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.
- package/dist/esm/components/CnActionDialog/CnActionDialog.vue.js +1 -1
- package/dist/esm/components/CnActionDialog/CnActionDialog.vue2.js +2 -1
- package/dist/esm/components/CnActionDialog/CnActionDialog.vue2.js.map +1 -1
- package/dist/esm/components/CnActionDialog/CnActionDialog.vue3.js +65 -50
- package/dist/esm/components/CnActionDialog/CnActionDialog.vue3.js.map +1 -1
- package/dist/esm/components/CnAdminSettingsShell/CnAdminSettingsShell.vue.js +1 -1
- package/dist/esm/components/CnAdminSettingsShell/CnAdminSettingsShell.vue2.js +9 -0
- package/dist/esm/components/CnAdminSettingsShell/CnAdminSettingsShell.vue2.js.map +1 -1
- package/dist/esm/components/CnAdminSettingsShell/CnAdminSettingsShell.vue3.js +4 -3
- package/dist/esm/components/CnAdminSettingsShell/CnAdminSettingsShell.vue3.js.map +1 -1
- package/dist/esm/components/CnAppNav/CnAppNav.vue2.js +4 -1
- package/dist/esm/components/CnAppNav/CnAppNav.vue2.js.map +1 -1
- package/dist/esm/components/CnAppNav/CnAppNav.vue3.js +61 -28
- package/dist/esm/components/CnAppNav/CnAppNav.vue3.js.map +1 -1
- package/dist/esm/components/CnAuditTrailCard/CnAuditTrailCard.vue.js +1 -1
- package/dist/esm/components/CnAuditTrailCard/CnAuditTrailCard.vue2.js +6 -0
- package/dist/esm/components/CnAuditTrailCard/CnAuditTrailCard.vue2.js.map +1 -1
- package/dist/esm/components/CnAuditTrailCard/CnAuditTrailCard.vue3.js +9 -1
- package/dist/esm/components/CnAuditTrailCard/CnAuditTrailCard.vue3.js.map +1 -1
- package/dist/esm/components/CnAuditTrailWidget/CnAuditTrailWidget.vue.js +1 -1
- package/dist/esm/components/CnAuditTrailWidget/CnAuditTrailWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnAuditTrailWidget/CnAuditTrailWidget.vue3.js +4 -11
- package/dist/esm/components/CnAuditTrailWidget/CnAuditTrailWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnDataTable/CnDataTable.vue2.js +32 -0
- package/dist/esm/components/CnDataTable/CnDataTable.vue2.js.map +1 -1
- package/dist/esm/components/CnDataTable/CnDataTable.vue3.js +34 -26
- package/dist/esm/components/CnDataTable/CnDataTable.vue3.js.map +1 -1
- package/dist/esm/components/CnDetailPage/CnDetailPage.vue2.js +24 -0
- package/dist/esm/components/CnDetailPage/CnDetailPage.vue2.js.map +1 -1
- package/dist/esm/components/CnDetailPage/CnDetailPage.vue3.js +2 -2
- package/dist/esm/components/CnDetailPage/CnDetailPage.vue3.js.map +1 -1
- package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHost.vue.js +1 -1
- package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHost.vue2.js.map +1 -1
- package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHost.vue3.js +2 -1
- package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHost.vue3.js.map +1 -1
- package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js +39 -2
- package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js.map +1 -1
- package/dist/esm/components/CnIndexPage/CnIndexPage.vue3.js +6 -5
- package/dist/esm/components/CnIndexPage/CnIndexPage.vue3.js.map +1 -1
- package/dist/esm/components/CnObjectDataWidget/CnObjectDataWidget.vue.js +1 -1
- package/dist/esm/components/CnObjectDataWidget/CnObjectDataWidget.vue2.js +11 -0
- package/dist/esm/components/CnObjectDataWidget/CnObjectDataWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnObjectDataWidget/CnObjectDataWidget.vue3.js +10 -2
- package/dist/esm/components/CnObjectDataWidget/CnObjectDataWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue.js +1 -1
- package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue2.js +18 -0
- package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue3.js +38 -23
- package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnRegisterMapping/CnRegisterMapping.vue.js +1 -1
- package/dist/esm/components/CnRegisterMapping/CnRegisterMapping.vue2.js.map +1 -1
- package/dist/esm/components/CnRegisterMapping/CnRegisterMapping.vue3.js +1 -0
- package/dist/esm/components/CnRegisterMapping/CnRegisterMapping.vue3.js.map +1 -1
- package/dist/esm/components/CnRetentionWidget/CnRetentionWidget.vue.js +1 -1
- package/dist/esm/components/CnRetentionWidget/CnRetentionWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnRetentionWidget/CnRetentionWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnSavedViewMenuSettings/CnSavedViewMenuSettings.vue.js +1 -1
- package/dist/esm/components/CnSavedViewMenuSettings/CnSavedViewMenuSettings.vue2.js +14 -4
- package/dist/esm/components/CnSavedViewMenuSettings/CnSavedViewMenuSettings.vue2.js.map +1 -1
- package/dist/esm/components/CnSavedViewMenuSettings/CnSavedViewMenuSettings.vue3.js.map +1 -1
- package/dist/esm/components/CnTimelineWidget/CnTimelineManage.vue.js +1 -1
- package/dist/esm/components/CnTimelineWidget/CnTimelineManage.vue2.js +10 -0
- package/dist/esm/components/CnTimelineWidget/CnTimelineManage.vue2.js.map +1 -1
- package/dist/esm/components/CnTimelineWidget/CnTimelineManage.vue3.js +29 -13
- package/dist/esm/components/CnTimelineWidget/CnTimelineManage.vue3.js.map +1 -1
- package/dist/esm/components/CnTimelineWidget/dashboardRegistration.js +3 -1
- package/dist/esm/components/CnTimelineWidget/dashboardRegistration.js.map +1 -1
- package/dist/esm/components/CnWorkingCalendarWidget/CnWorkingCalendarWidget.vue.js +1 -1
- package/dist/esm/components/CnWorkingCalendarWidget/CnWorkingCalendarWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnWorkingCalendarWidget/CnWorkingCalendarWidget.vue3.js.map +1 -1
- package/dist/esm/composables/indexSources.js +69 -3
- package/dist/esm/composables/indexSources.js.map +1 -1
- package/dist/esm/l10n/en.json.js +20 -20
- package/dist/esm/l10n/nl.json.js +21 -21
- package/dist/esm/library-style.js +1 -1
- package/dist/esm/nextcloud-vue.css +580 -324
- package/dist/esm/utils/contentHeaderLink.js +7 -1
- package/dist/esm/utils/contentHeaderLink.js.map +1 -1
- package/dist/esm/utils/savedViewMenu.js +4 -1
- package/dist/esm/utils/savedViewMenu.js.map +1 -1
- package/dist/esm/utils/savedViewSummary.js +11 -4
- package/dist/esm/utils/savedViewSummary.js.map +1 -1
- package/dist/esm/utils/validateManifestV2.compiled.js +2 -2
- package/dist/esm/utils/validateManifestV2.compiled.js.map +1 -1
- package/dist/esm/utils/widgetDispatch.js +3 -1
- package/dist/esm/utils/widgetDispatch.js.map +1 -1
- package/dist/nextcloud-vue.cjs.js +1159 -812
- package/dist/nextcloud-vue.cjs.js.map +2 -2
- package/dist/nextcloud-vue.css +580 -324
- package/l10n/en.json +20 -20
- package/l10n/nl.json +21 -21
- package/package.json +1 -1
- package/src/components/CnActionDialog/CnActionDialog.vue +45 -4
- package/src/components/CnAdminSettingsShell/CnAdminSettingsShell.vue +13 -1
- package/src/components/CnAppNav/CnAppNav.vue +28 -3
- package/src/components/CnAuditTrailCard/CnAuditTrailCard.vue +15 -0
- package/src/components/CnAuditTrailWidget/CnAuditTrailWidget.vue +2 -10
- package/src/components/CnDataTable/CnDataTable.md +1 -0
- package/src/components/CnDataTable/CnDataTable.vue +38 -1
- package/src/components/CnDetailPage/CnDetailPage.md +1 -0
- package/src/components/CnDetailPage/CnDetailPage.vue +26 -2
- package/src/components/CnDetailWidgetHost/CnDetailWidgetHost.vue +1 -0
- package/src/components/CnIndexPage/CnIndexPage.vue +44 -6
- package/src/components/CnObjectDataWidget/CnObjectDataWidget.md +1 -0
- package/src/components/CnObjectDataWidget/CnObjectDataWidget.vue +21 -0
- package/src/components/CnRecordListWidget/CnRecordListWidget.vue +38 -2
- package/src/components/CnRegisterMapping/CnRegisterMapping.vue +7 -0
- package/src/components/CnRetentionWidget/CnRetentionWidget.vue +13 -0
- package/src/components/CnSavedViewMenuSettings/CnSavedViewMenuSettings.vue +14 -4
- package/src/components/CnTimelineWidget/CnTimelineManage.vue +23 -0
- package/src/components/CnTimelineWidget/dashboardRegistration.js +3 -1
- package/src/components/CnWorkingCalendarWidget/CnWorkingCalendarWidget.vue +7 -0
- package/src/composables/indexSources.js +69 -3
- package/src/css/look-board-detail.css +57 -1
- package/src/css/look-board-index.css +76 -1
- package/src/css/look-board.css +51 -4
- package/src/css/table.css +5 -0
- package/src/schemas/app-manifest-v2.schema.json +4 -2
- package/src/utils/contentHeaderLink.js +7 -1
- package/src/utils/savedViewMenu.js +4 -1
- package/src/utils/savedViewSummary.js +11 -4
- package/src/utils/validateManifestV2.compiled.js +2 -2
- package/src/utils/widgetDispatch.js +3 -1
|
@@ -56,10 +56,12 @@ import { canonicalWidgetType } from './widgetTypeAliases.js';
|
|
|
56
56
|
* and its title come from the host, and the catalog Add does not apply.
|
|
57
57
|
* `handoff` is one action on one record; the card and title come from the host.
|
|
58
58
|
* `macros` lists a record's macros with their buttons; the card and title come from the host.
|
|
59
|
+
* `grouped-cards` draws groups of cards (DqZaaktype "Fasen en taken") with no card of
|
|
60
|
+
* its own; the card, title and subtitle come from the host, and it has no Add.
|
|
59
61
|
*
|
|
60
62
|
* @type {string[]}
|
|
61
63
|
*/
|
|
62
|
-
const CONTENT_ONLY_TYPES = Object.freeze(['object-list', 'table', 'files', 'flow-runs', 'tasks', 'events', 'facts', 'linked', 'field-list', 'record-list', 'parties', 'map', 'settings-form', 'switch-rows', 'radio-cards', 'chips-field', 'toggle-table', 'choice-picker', 'checklist', 'object-translations', 'row-mark-list', 'slot-grid', 'handoff', 'macros', 'ai-chat']);
|
|
64
|
+
const CONTENT_ONLY_TYPES = Object.freeze(['object-list', 'table', 'files', 'flow-runs', 'tasks', 'events', 'facts', 'linked', 'field-list', 'record-list', 'parties', 'map', 'settings-form', 'switch-rows', 'radio-cards', 'chips-field', 'toggle-table', 'choice-picker', 'checklist', 'object-translations', 'row-mark-list', 'slot-grid', 'handoff', 'macros', 'ai-chat', 'grouped-cards']);
|
|
63
65
|
|
|
64
66
|
/**
|
|
65
67
|
* The stored content/config blob for a widget definition.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"widgetDispatch.js","sources":["../../../src/utils/widgetDispatch.js"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2026 Conduction B.V.\n * SPDX-License-Identifier: EUPL-1.2\n *\n * widgetDispatch — how a detail-page widget definition picks its renderer.\n *\n * These predicates used to live as methods on `CnDetailPage`, each one calling\n * `findWidget(item)` first. That was fine while the detail grid was the only\n * surface rendering a widget definition. `CnTabsWidget` is a second one: it\n * renders the SAME definitions with no card chrome, because the tab strip owns\n * the title and the Actions menu instead.\n *\n * Two copies of \"is this a card widget?\" is exactly the kind of thing that\n * drifts. One copy grows a type, the other does not, and the symptom is a\n * widget that renders correctly on the page and blank inside a tab, with\n * nothing in the console either way. So the decisions live here as pure\n * functions over a widget DEFINITION, and both surfaces import them.\n *\n * The functions take the resolved definition, not a layout item. Resolving an\n * item to a definition needs the surface's own widget list, which is the one\n * part that genuinely differs between the two.\n *\n * @module utils/widgetDispatch\n */\n\nimport { BUILT_IN_WIDGETS } from '../components/CnWidgetGrid/builtInWidgets.js'\nimport { getWidgetTypeEntry } from '../components/CnWidgetGrid/dashboardWidgetRegistry.js'\nimport { canonicalWidgetType } from './widgetTypeAliases.js'\n\n/**\n * Content-only catalog widgets: bare renderers with no chrome of their own.\n * On a card surface they need the titled wrapper; inside a tab panel the strip\n * already supplies the title, so they render bare.\n *\n * `flow-runs` belongs here for the same reason the lists do: it renders a bare\n * row list, so without the wrapper it appeared on the detail page as loose text\n * with no title and no card, which ADR-062 rule 5 forbids (\"every body widget\n * has card chrome and its manifest title\"). It is NOT in the Add-action list,\n * because a run is started by a flow, never by a person clicking Add.\n * `tasks` follows for the same two reasons: a bare row list, and a task is\n * created by a flow, never by a person clicking Add.\n * `facts` is a bare list of label/value rows about one object: on a side\n * card it needs the same titled wrapper, and there is nothing to Add.\n * `field-list` draws rows of one object field and carries its own add form,\n * so it takes the titled wrapper and not the catalog Add action.\n * `record-list` draws bare rows of another schema's objects; the card and its\n * header (link, note) come from the host, and it has no Add.\n * `parties` draws a record's parties by role and `map` a bare Leaflet map:\n * on a card surface both need the titled wrapper, and neither has an Add.\n * `object-translations` is a bare per-language editor that takes the titled\n * wrapper and has no Add.\n * `row-mark-list` draws bare rows with their marks and one Save; the card and\n * its title come from the host, and it has no Add.\n * `slot-grid` draws a bare table with its own add buttons per cell; the card\n * and its title come from the host, and the catalog Add does not apply.\n * `handoff` is one action on one record; the card and title come from the host.\n * `macros` lists a record's macros with their buttons; the card and title come from the host.\n *\n * @type {string[]}\n */\nexport const CONTENT_ONLY_TYPES = Object.freeze(['object-list', 'table', 'files', 'flow-runs', 'tasks', 'events', 'facts', 'linked', 'field-list', 'record-list', 'parties', 'map', 'settings-form', 'switch-rows', 'radio-cards', 'chips-field', 'toggle-table', 'choice-picker', 'checklist', 'object-translations', 'row-mark-list', 'slot-grid', 'handoff', 'macros', 'ai-chat'])\n\n/**\n * The stored content/config blob for a widget definition.\n *\n * @param {object} def The widget definition.\n * @return {object} The definition's `content`, or an empty object.\n */\nexport function widgetContentOf(def) {\n\treturn (def && def.content && typeof def.content === 'object') ? def.content : {}\n}\n\n/**\n * Whether the definition is the schema-driven `data` widget.\n *\n * @param {object} def The widget definition.\n * @return {boolean} true for `type: 'data'`.\n */\nexport function isDataWidgetDef(def) {\n\treturn Boolean(def) && def.type === 'data'\n}\n\n/**\n * Whether the definition is the schema-driven `related` widget.\n *\n * @param {object} def The widget definition.\n * @return {boolean} true for `type: 'related'`.\n */\nexport function isRelatedWidgetDef(def) {\n\treturn Boolean(def) && def.type === 'related'\n}\n\n/**\n * Whether the definition is the `object-geo` widget.\n *\n * @param {object} def The widget definition.\n * @return {boolean} true for `type: 'object-geo'`.\n */\nexport function isGeoWidgetDef(def) {\n\treturn Boolean(def) && def.type === 'object-geo'\n}\n\n/**\n * Whether the definition names a registered integration leaf.\n *\n * @param {object} def The widget definition.\n * @return {boolean} true for `type: 'integration'` with an `integrationId`.\n */\nexport function isIntegrationWidgetDef(def) {\n\treturn Boolean(def) && def.type === 'integration' && typeof def.integrationId === 'string'\n}\n\n/**\n * Whether the definition is a content-only catalog widget.\n *\n * @param {object} def The widget definition.\n * @return {boolean} true when the type is in {@link CONTENT_ONLY_TYPES}.\n */\nexport function isContentOnlyWidgetDef(def) {\n\treturn Boolean(def) && CONTENT_ONLY_TYPES.includes(def.type)\n}\n\n/**\n * Whether the definition is a registry \"card\" widget: a self-contained KPI,\n * gauge or delta tile that headlines itself (registry entry `card: true`).\n *\n * @param {object} def The widget definition.\n * @return {boolean} true when the registry entry declares `card`.\n */\nexport function isCardWidgetDef(def) {\n\tif (!def || !def.type) {\n\t\treturn false\n\t}\n\tconst entry = getWidgetTypeEntry(def.type)\n\treturn Boolean(entry && entry.card === true)\n}\n\n/**\n * Resolve the registered RENDERER for a content-driven catalog widget type.\n *\n * Integration widgets resolve separately, and `data` needs object context the\n * caller supplies, so both are excluded from this generic fallback.\n *\n * Resolution order is consumer registry, then the dashboard catalog, then\n * `BUILT_IN_WIDGETS`. Those last two were near-disjoint vocabularies until they\n * were unified here: the dashboard catalog held chart / map / object-list /\n * related / stats-block / table, `BUILT_IN_WIDGETS` held audit-trail / banner /\n * card-grid / data / divider / form-renderer / header / integration /\n * map-viewer / metadata / nav-card-grid / object-geo / related / text, and only\n * `related` was in both. A widget authored against one was invisible to the\n * other, and the surface rendered nothing while saying nothing about why. On\n * hrmq that was 101 of 236 detail widgets.\n *\n * With `typeAsWritten`, a type registered in its own right wins over its\n * alias, as on CnDashboardPage: there `object-table` is the host adapter that\n * reads `content.source`, not the `table` widget its alias names. A detail\n * page keeps the alias first, as its manifests were written against it.\n *\n * @param {object} def The widget definition.\n * @param {object} [cnRegistry] The consumer's component registry, if any.\n * @param {{typeAsWritten?: boolean}} [options] Resolution options.\n * @return {object|null} The renderer component, or null.\n */\nexport function resolveRegistryRenderer(def, cnRegistry = {}, options = {}) {\n\tif (!def || !def.type || def.type === 'integration' || def.type === 'data') {\n\t\treturn null\n\t}\n\t// Consumer registry FIRST — the order REQ-MVR-005 mandates (\"Custom widget\n\t// overrides built-in\"), and the order CnWidgetGrid already uses.\n\tconst consumer = (cnRegistry || {})[def.type]\n\tif (consumer) {\n\t\treturn consumer.component ?? consumer\n\t}\n\tconst entry = (options.typeAsWritten === true && getWidgetTypeEntry(def.type)) || getWidgetTypeEntry(canonicalWidgetType(def.type))\n\tif (entry && entry.renderer) {\n\t\treturn entry.renderer\n\t}\n\treturn BUILT_IN_WIDGETS[canonicalWidgetType(def.type)] || BUILT_IN_WIDGETS[def.type] || null\n}\n\n/**\n * The effective title for a widget definition.\n *\n * A title-owning type (registry `ownsTitle`, e.g. `related`) keeps its editable\n * title in `content.title`, and that MUST win over the chrome `def.title`.\n * Otherwise a non-empty seed title permanently shadows the user's edit and the\n * title can never be changed. Without a `content.title` it falls back to\n * `def.title`. Every other type reads `def.title` first.\n *\n * @param {object} def The widget definition.\n * @return {string|undefined} The title, or undefined to let the widget default.\n */\nexport function widgetTitleOf(def) {\n\tif (!def) {\n\t\treturn undefined\n\t}\n\tconst content = widgetContentOf(def)\n\tconst entry = getWidgetTypeEntry(def.type)\n\tif (entry && entry.ownsTitle) {\n\t\t// A manifest that never set content.title keeps its def.title.\n\t\tif (typeof content.title !== 'string') {\n\t\t\treturn def.title || undefined\n\t\t}\n\t\treturn content.title || undefined\n\t}\n\treturn def.title || content.title || undefined\n}\n"],"names":[],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC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AI,QAAQ,EAAE;AACf,EAAE,OAAO,QAAQ,CAAC,SAAS,IAAI,QAAQ;AACvC,EAAE;AACF,CAAC,MAAM,KAAK,GAAG,CAAC,OAAO,CAAC,aAAa,KAAK,IAAI,IAAI,kBAAkB,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,kBAAkB,CAAC,mBAAmB,CAAC,GAAG,CAAC,IAAI,CAAC,EAAC;AACpI,CAAC,IAAI,KAAK,IAAI,KAAK,CAAC,QAAQ,EAAE;AAC9B,EAAE,OAAO,KAAK,CAAC,QAAQ;AACvB,EAAE;AACF,CAAC,OAAO,gBAAgB,CAAC,mBAAmB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,IAAI,gBAAgB,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,IAAI;AAC7F,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,aAAa,CAAC,GAAG,EAAE;AACnC,CAAC,IAAI,CAAC,GAAG,EAAE;AACX,EAAE,OAAO,SAAS;AAClB,EAAE;AACF,CAAC,MAAM,OAAO,GAAG,eAAe,CAAC,GAAG,EAAC;AACrC,CAAC,MAAM,KAAK,GAAG,kBAAkB,CAAC,GAAG,CAAC,IAAI,EAAC;AAC3C,CAAC,IAAI,KAAK,IAAI,KAAK,CAAC,SAAS,EAAE;AAC/B;AACA,EAAE,IAAI,OAAO,OAAO,CAAC,KAAK,KAAK,QAAQ,EAAE;AACzC,GAAG,OAAO,GAAG,CAAC,KAAK,IAAI,SAAS;AAChC,GAAG;AACH,EAAE,OAAO,OAAO,CAAC,KAAK,IAAI,SAAS;AACnC,EAAE;AACF,CAAC,OAAO,GAAG,CAAC,KAAK,IAAI,OAAO,CAAC,KAAK,IAAI,SAAS;AAC/C;;;;"}
|
|
1
|
+
{"version":3,"file":"widgetDispatch.js","sources":["../../../src/utils/widgetDispatch.js"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2026 Conduction B.V.\n * SPDX-License-Identifier: EUPL-1.2\n *\n * widgetDispatch — how a detail-page widget definition picks its renderer.\n *\n * These predicates used to live as methods on `CnDetailPage`, each one calling\n * `findWidget(item)` first. That was fine while the detail grid was the only\n * surface rendering a widget definition. `CnTabsWidget` is a second one: it\n * renders the SAME definitions with no card chrome, because the tab strip owns\n * the title and the Actions menu instead.\n *\n * Two copies of \"is this a card widget?\" is exactly the kind of thing that\n * drifts. One copy grows a type, the other does not, and the symptom is a\n * widget that renders correctly on the page and blank inside a tab, with\n * nothing in the console either way. So the decisions live here as pure\n * functions over a widget DEFINITION, and both surfaces import them.\n *\n * The functions take the resolved definition, not a layout item. Resolving an\n * item to a definition needs the surface's own widget list, which is the one\n * part that genuinely differs between the two.\n *\n * @module utils/widgetDispatch\n */\n\nimport { BUILT_IN_WIDGETS } from '../components/CnWidgetGrid/builtInWidgets.js'\nimport { getWidgetTypeEntry } from '../components/CnWidgetGrid/dashboardWidgetRegistry.js'\nimport { canonicalWidgetType } from './widgetTypeAliases.js'\n\n/**\n * Content-only catalog widgets: bare renderers with no chrome of their own.\n * On a card surface they need the titled wrapper; inside a tab panel the strip\n * already supplies the title, so they render bare.\n *\n * `flow-runs` belongs here for the same reason the lists do: it renders a bare\n * row list, so without the wrapper it appeared on the detail page as loose text\n * with no title and no card, which ADR-062 rule 5 forbids (\"every body widget\n * has card chrome and its manifest title\"). It is NOT in the Add-action list,\n * because a run is started by a flow, never by a person clicking Add.\n * `tasks` follows for the same two reasons: a bare row list, and a task is\n * created by a flow, never by a person clicking Add.\n * `facts` is a bare list of label/value rows about one object: on a side\n * card it needs the same titled wrapper, and there is nothing to Add.\n * `field-list` draws rows of one object field and carries its own add form,\n * so it takes the titled wrapper and not the catalog Add action.\n * `record-list` draws bare rows of another schema's objects; the card and its\n * header (link, note) come from the host, and it has no Add.\n * `parties` draws a record's parties by role and `map` a bare Leaflet map:\n * on a card surface both need the titled wrapper, and neither has an Add.\n * `object-translations` is a bare per-language editor that takes the titled\n * wrapper and has no Add.\n * `row-mark-list` draws bare rows with their marks and one Save; the card and\n * its title come from the host, and it has no Add.\n * `slot-grid` draws a bare table with its own add buttons per cell; the card\n * and its title come from the host, and the catalog Add does not apply.\n * `handoff` is one action on one record; the card and title come from the host.\n * `macros` lists a record's macros with their buttons; the card and title come from the host.\n * `grouped-cards` draws groups of cards (DqZaaktype \"Fasen en taken\") with no card of\n * its own; the card, title and subtitle come from the host, and it has no Add.\n *\n * @type {string[]}\n */\nexport const CONTENT_ONLY_TYPES = Object.freeze(['object-list', 'table', 'files', 'flow-runs', 'tasks', 'events', 'facts', 'linked', 'field-list', 'record-list', 'parties', 'map', 'settings-form', 'switch-rows', 'radio-cards', 'chips-field', 'toggle-table', 'choice-picker', 'checklist', 'object-translations', 'row-mark-list', 'slot-grid', 'handoff', 'macros', 'ai-chat', 'grouped-cards'])\n\n/**\n * The stored content/config blob for a widget definition.\n *\n * @param {object} def The widget definition.\n * @return {object} The definition's `content`, or an empty object.\n */\nexport function widgetContentOf(def) {\n\treturn (def && def.content && typeof def.content === 'object') ? def.content : {}\n}\n\n/**\n * Whether the definition is the schema-driven `data` widget.\n *\n * @param {object} def The widget definition.\n * @return {boolean} true for `type: 'data'`.\n */\nexport function isDataWidgetDef(def) {\n\treturn Boolean(def) && def.type === 'data'\n}\n\n/**\n * Whether the definition is the schema-driven `related` widget.\n *\n * @param {object} def The widget definition.\n * @return {boolean} true for `type: 'related'`.\n */\nexport function isRelatedWidgetDef(def) {\n\treturn Boolean(def) && def.type === 'related'\n}\n\n/**\n * Whether the definition is the `object-geo` widget.\n *\n * @param {object} def The widget definition.\n * @return {boolean} true for `type: 'object-geo'`.\n */\nexport function isGeoWidgetDef(def) {\n\treturn Boolean(def) && def.type === 'object-geo'\n}\n\n/**\n * Whether the definition names a registered integration leaf.\n *\n * @param {object} def The widget definition.\n * @return {boolean} true for `type: 'integration'` with an `integrationId`.\n */\nexport function isIntegrationWidgetDef(def) {\n\treturn Boolean(def) && def.type === 'integration' && typeof def.integrationId === 'string'\n}\n\n/**\n * Whether the definition is a content-only catalog widget.\n *\n * @param {object} def The widget definition.\n * @return {boolean} true when the type is in {@link CONTENT_ONLY_TYPES}.\n */\nexport function isContentOnlyWidgetDef(def) {\n\treturn Boolean(def) && CONTENT_ONLY_TYPES.includes(def.type)\n}\n\n/**\n * Whether the definition is a registry \"card\" widget: a self-contained KPI,\n * gauge or delta tile that headlines itself (registry entry `card: true`).\n *\n * @param {object} def The widget definition.\n * @return {boolean} true when the registry entry declares `card`.\n */\nexport function isCardWidgetDef(def) {\n\tif (!def || !def.type) {\n\t\treturn false\n\t}\n\tconst entry = getWidgetTypeEntry(def.type)\n\treturn Boolean(entry && entry.card === true)\n}\n\n/**\n * Resolve the registered RENDERER for a content-driven catalog widget type.\n *\n * Integration widgets resolve separately, and `data` needs object context the\n * caller supplies, so both are excluded from this generic fallback.\n *\n * Resolution order is consumer registry, then the dashboard catalog, then\n * `BUILT_IN_WIDGETS`. Those last two were near-disjoint vocabularies until they\n * were unified here: the dashboard catalog held chart / map / object-list /\n * related / stats-block / table, `BUILT_IN_WIDGETS` held audit-trail / banner /\n * card-grid / data / divider / form-renderer / header / integration /\n * map-viewer / metadata / nav-card-grid / object-geo / related / text, and only\n * `related` was in both. A widget authored against one was invisible to the\n * other, and the surface rendered nothing while saying nothing about why. On\n * hrmq that was 101 of 236 detail widgets.\n *\n * With `typeAsWritten`, a type registered in its own right wins over its\n * alias, as on CnDashboardPage: there `object-table` is the host adapter that\n * reads `content.source`, not the `table` widget its alias names. A detail\n * page keeps the alias first, as its manifests were written against it.\n *\n * @param {object} def The widget definition.\n * @param {object} [cnRegistry] The consumer's component registry, if any.\n * @param {{typeAsWritten?: boolean}} [options] Resolution options.\n * @return {object|null} The renderer component, or null.\n */\nexport function resolveRegistryRenderer(def, cnRegistry = {}, options = {}) {\n\tif (!def || !def.type || def.type === 'integration' || def.type === 'data') {\n\t\treturn null\n\t}\n\t// Consumer registry FIRST — the order REQ-MVR-005 mandates (\"Custom widget\n\t// overrides built-in\"), and the order CnWidgetGrid already uses.\n\tconst consumer = (cnRegistry || {})[def.type]\n\tif (consumer) {\n\t\treturn consumer.component ?? consumer\n\t}\n\tconst entry = (options.typeAsWritten === true && getWidgetTypeEntry(def.type)) || getWidgetTypeEntry(canonicalWidgetType(def.type))\n\tif (entry && entry.renderer) {\n\t\treturn entry.renderer\n\t}\n\treturn BUILT_IN_WIDGETS[canonicalWidgetType(def.type)] || BUILT_IN_WIDGETS[def.type] || null\n}\n\n/**\n * The effective title for a widget definition.\n *\n * A title-owning type (registry `ownsTitle`, e.g. `related`) keeps its editable\n * title in `content.title`, and that MUST win over the chrome `def.title`.\n * Otherwise a non-empty seed title permanently shadows the user's edit and the\n * title can never be changed. Without a `content.title` it falls back to\n * `def.title`. Every other type reads `def.title` first.\n *\n * @param {object} def The widget definition.\n * @return {string|undefined} The title, or undefined to let the widget default.\n */\nexport function widgetTitleOf(def) {\n\tif (!def) {\n\t\treturn undefined\n\t}\n\tconst content = widgetContentOf(def)\n\tconst entry = getWidgetTypeEntry(def.type)\n\tif (entry && entry.ownsTitle) {\n\t\t// A manifest that never set content.title keeps its def.title.\n\t\tif (typeof content.title !== 'string') {\n\t\t\treturn def.title || undefined\n\t\t}\n\t\treturn content.title || undefined\n\t}\n\treturn def.title || content.title || undefined\n}\n"],"names":[],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,kBAAkB,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,aAAa,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,E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