@conduction/nextcloud-vue 2.156.0 → 2.157.1

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 (105) hide show
  1. package/dist/esm/components/CnAuditTrailCard/CnAuditTrailCard.vue.js +1 -1
  2. package/dist/esm/components/CnAuditTrailCard/CnAuditTrailCard.vue2.js +38 -1
  3. package/dist/esm/components/CnAuditTrailCard/CnAuditTrailCard.vue2.js.map +1 -1
  4. package/dist/esm/components/CnAuditTrailCard/CnAuditTrailCard.vue3.js.map +1 -1
  5. package/dist/esm/components/CnBannerWidget/CnBannerWidget.vue.js +1 -1
  6. package/dist/esm/components/CnBannerWidget/CnBannerWidget.vue2.js.map +1 -1
  7. package/dist/esm/components/CnBannerWidget/CnBannerWidget.vue3.js.map +1 -1
  8. package/dist/esm/components/CnChecklistRunWidget/CnChecklistRunWidget.vue.js +1 -1
  9. package/dist/esm/components/CnChecklistRunWidget/CnChecklistRunWidget.vue2.js.map +1 -1
  10. package/dist/esm/components/CnChecklistRunWidget/CnChecklistRunWidget.vue3.js.map +1 -1
  11. package/dist/esm/components/CnCountdownWidget/CnCountdownWidget.vue.js +1 -1
  12. package/dist/esm/components/CnCountdownWidget/CnCountdownWidget.vue2.js.map +1 -1
  13. package/dist/esm/components/CnCountdownWidget/CnCountdownWidget.vue3.js.map +1 -1
  14. package/dist/esm/components/CnDashboardGrid/CnDashboardGrid.vue.js +1 -1
  15. package/dist/esm/components/CnDashboardGrid/CnDashboardGrid.vue2.js +5 -3
  16. package/dist/esm/components/CnDashboardGrid/CnDashboardGrid.vue2.js.map +1 -1
  17. package/dist/esm/components/CnDashboardGrid/CnDashboardGrid.vue3.js.map +1 -1
  18. package/dist/esm/components/CnDeviceFramesWidget/CnDeviceFramesWidget.vue.js +1 -1
  19. package/dist/esm/components/CnDeviceFramesWidget/CnDeviceFramesWidget.vue2.js.map +1 -1
  20. package/dist/esm/components/CnDeviceFramesWidget/CnDeviceFramesWidget.vue3.js.map +1 -1
  21. package/dist/esm/components/CnDuplicateWarning/CnDuplicateWarning.vue.js +1 -1
  22. package/dist/esm/components/CnDuplicateWarning/CnDuplicateWarning.vue2.js +2 -1
  23. package/dist/esm/components/CnDuplicateWarning/CnDuplicateWarning.vue2.js.map +1 -1
  24. package/dist/esm/components/CnDuplicateWarning/CnDuplicateWarning.vue3.js +10 -3
  25. package/dist/esm/components/CnDuplicateWarning/CnDuplicateWarning.vue3.js.map +1 -1
  26. package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue.js +1 -1
  27. package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue2.js +14 -4
  28. package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue2.js.map +1 -1
  29. package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue3.js +3 -3
  30. package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue3.js.map +1 -1
  31. package/dist/esm/components/CnFeaturesBoard/CnFeaturesBoard.vue.js +1 -1
  32. package/dist/esm/components/CnFeaturesBoard/CnFeaturesBoard.vue2.js.map +1 -1
  33. package/dist/esm/components/CnFeaturesBoard/CnFeaturesBoard.vue3.js.map +1 -1
  34. package/dist/esm/components/CnFormDialog/CnFormDialog.vue.js +1 -1
  35. package/dist/esm/components/CnFormDialog/CnFormDialog.vue2.js.map +1 -1
  36. package/dist/esm/components/CnFormDialog/CnFormDialog.vue3.js +2 -1
  37. package/dist/esm/components/CnFormDialog/CnFormDialog.vue3.js.map +1 -1
  38. package/dist/esm/components/CnMailTab/CnMailTab.vue.js +1 -1
  39. package/dist/esm/components/CnMailTab/CnMailTab.vue2.js +4 -4
  40. package/dist/esm/components/CnMailTab/CnMailTab.vue2.js.map +1 -1
  41. package/dist/esm/components/CnMailTab/CnMailTab.vue3.js.map +1 -1
  42. package/dist/esm/components/CnNotificationMatrix/CnNotificationMatrix.vue.js +1 -1
  43. package/dist/esm/components/CnNotificationMatrix/CnNotificationMatrix.vue2.js +3 -0
  44. package/dist/esm/components/CnNotificationMatrix/CnNotificationMatrix.vue2.js.map +1 -1
  45. package/dist/esm/components/CnNotificationMatrix/CnNotificationMatrix.vue3.js +10 -2
  46. package/dist/esm/components/CnNotificationMatrix/CnNotificationMatrix.vue3.js.map +1 -1
  47. package/dist/esm/components/CnPartyPicker/CnPartyPicker.vue.js +1 -1
  48. package/dist/esm/components/CnPartyPicker/CnPartyPicker.vue2.js +6 -0
  49. package/dist/esm/components/CnPartyPicker/CnPartyPicker.vue2.js.map +1 -1
  50. package/dist/esm/components/CnPartyPicker/CnPartyPicker.vue3.js +2 -1
  51. package/dist/esm/components/CnPartyPicker/CnPartyPicker.vue3.js.map +1 -1
  52. package/dist/esm/components/CnSavedViewLookFields/CnSavedViewLookFields.vue.js +1 -1
  53. package/dist/esm/components/CnSavedViewLookFields/CnSavedViewLookFields.vue2.js.map +1 -1
  54. package/dist/esm/components/CnSavedViewLookFields/CnSavedViewLookFields.vue3.js +27 -24
  55. package/dist/esm/components/CnSavedViewLookFields/CnSavedViewLookFields.vue3.js.map +1 -1
  56. package/dist/esm/components/CnSearchSelect/CnSearchSelect.vue.js +1 -1
  57. package/dist/esm/components/CnSearchSelect/CnSearchSelect.vue2.js.map +1 -1
  58. package/dist/esm/components/CnSearchSelect/CnSearchSelect.vue3.js.map +1 -1
  59. package/dist/esm/components/CnStagesWidget/CnStagesWidget.vue.js +1 -1
  60. package/dist/esm/components/CnStagesWidget/CnStagesWidget.vue2.js +4 -1
  61. package/dist/esm/components/CnStagesWidget/CnStagesWidget.vue2.js.map +1 -1
  62. package/dist/esm/components/CnStagesWidget/CnStagesWidget.vue3.js.map +1 -1
  63. package/dist/esm/components/CnStagesWidget/stagesModel.js +10 -2
  64. package/dist/esm/components/CnStagesWidget/stagesModel.js.map +1 -1
  65. package/dist/esm/components/CnTimelineWidget/CnTimelineManage.vue.js +1 -1
  66. package/dist/esm/components/CnTimelineWidget/CnTimelineManage.vue2.js +61 -2
  67. package/dist/esm/components/CnTimelineWidget/CnTimelineManage.vue2.js.map +1 -1
  68. package/dist/esm/components/CnTimelineWidget/CnTimelineManage.vue3.js +68 -44
  69. package/dist/esm/components/CnTimelineWidget/CnTimelineManage.vue3.js.map +1 -1
  70. package/dist/esm/integrations/builtin/email/CnEmailTab.vue.js +1 -1
  71. package/dist/esm/integrations/builtin/email/CnEmailTab.vue2.js +13 -3
  72. package/dist/esm/integrations/builtin/email/CnEmailTab.vue2.js.map +1 -1
  73. package/dist/esm/integrations/builtin/email/CnEmailTab.vue3.js.map +1 -1
  74. package/dist/esm/library-style.js +1 -1
  75. package/dist/esm/nextcloud-vue.css +720 -401
  76. package/dist/esm/utils/dynamicProperties.js +20 -2
  77. package/dist/esm/utils/dynamicProperties.js.map +1 -1
  78. package/dist/nextcloud-vue.cjs.js +880 -684
  79. package/dist/nextcloud-vue.cjs.js.map +2 -2
  80. package/dist/nextcloud-vue.css +720 -401
  81. package/package.json +1 -1
  82. package/src/components/CnAuditTrailCard/CnAuditTrailCard.vue +38 -1
  83. package/src/components/CnBannerWidget/CnBannerWidget.vue +5 -1
  84. package/src/components/CnChecklistRunWidget/CnChecklistRunWidget.vue +12 -5
  85. package/src/components/CnCountdownWidget/CnCountdownWidget.vue +12 -0
  86. package/src/components/CnDashboardGrid/CnDashboardGrid.vue +5 -3
  87. package/src/components/CnDeviceFramesWidget/CnDeviceFramesWidget.vue +1 -0
  88. package/src/components/CnDuplicateWarning/CnDuplicateWarning.vue +8 -4
  89. package/src/components/CnFactsWidget/CnFactsWidget.vue +31 -6
  90. package/src/components/CnFeaturesBoard/CnFeaturesBoard.vue +4 -2
  91. package/src/components/CnFormDialog/CnFormDialog.vue +1 -0
  92. package/src/components/CnMailTab/CnMailTab.vue +4 -4
  93. package/src/components/CnNotificationMatrix/CnNotificationMatrix.vue +20 -0
  94. package/src/components/CnPartyPicker/CnPartyPicker.vue +7 -0
  95. package/src/components/CnSavedViewLookFields/CnSavedViewLookFields.vue +27 -20
  96. package/src/components/CnSearchSelect/CnSearchSelect.vue +3 -1
  97. package/src/components/CnStagesWidget/CnStagesWidget.vue +4 -1
  98. package/src/components/CnStagesWidget/stagesModel.js +10 -2
  99. package/src/components/CnTimelineWidget/CnTimelineManage.vue +69 -4
  100. package/src/css/dialog.css +33 -0
  101. package/src/css/look-board-detail.css +10 -3
  102. package/src/css/look-board-index.css +34 -3
  103. package/src/css/look-board.css +191 -4
  104. package/src/integrations/builtin/email/CnEmailTab.vue +13 -3
  105. package/src/utils/dynamicProperties.js +19 -1
@@ -1 +1 @@
1
- {"version":3,"file":"CnDuplicateWarning.vue2.js","sources":["../../../../src/components/CnDuplicateWarning/CnDuplicateWarning.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n<template>\n\t<CnDialog\n\t\t:name=\"text(title) || t('nextcloud-vue', 'This may already exist')\"\n\t\t:eyebrow=\"text(eyebrow)\"\n\t\twidth=\"form\"\n\t\tdata-testid=\"cn-duplicate-warning\"\n\t\t@closing=\"close\">\n\t\t<div class=\"cn-duplicate-warning\">\n\t\t\t<NcNoteCard :type=\"affordances.blocked && !affordances.mayContinue ? 'error' : 'warning'\" data-testid=\"cn-duplicate-warning-note\">\n\t\t\t\t{{ headlineText }}\n\t\t\t</NcNoteCard>\n\n\t\t\t<ul class=\"cn-duplicate-warning__matches\">\n\t\t\t\t<li v-for=\"row in rows\"\n\t\t\t\t\t:key=\"row.uuid\"\n\t\t\t\t\tclass=\"cn-duplicate-warning__match\"\n\t\t\t\t\tdata-testid=\"cn-duplicate-warning-match\">\n\t\t\t\t\t<a v-if=\"row.href\" :href=\"row.href\" class=\"cn-duplicate-warning__title\">{{ row.title }}</a>\n\t\t\t\t\t<span v-else class=\"cn-duplicate-warning__title\">{{ row.title }}</span>\n\t\t\t\t\t<span v-if=\"row.meta\" class=\"cn-duplicate-warning__meta\">{{ row.meta }}</span>\n\t\t\t\t\t<span class=\"cn-duplicate-warning__meta\">{{ row.matched }}</span>\n\t\t\t\t</li>\n\t\t\t</ul>\n\n\t\t\t<NcTextField v-if=\"affordances.needsReason\"\n\t\t\t\t:label=\"text(reasonLabel) || t('nextcloud-vue', 'Why file it anyway')\"\n\t\t\t\t:modelValue=\"reason\"\n\t\t\t\t:helperText=\"text(reasonHint)\"\n\t\t\t\tdata-testid=\"cn-duplicate-warning-reason\"\n\t\t\t\t@update:modelValue=\"reason = $event\" />\n\n\t\t\t<p v-if=\"affordances.blocked && !affordances.mayContinue\"\n\t\t\t\tclass=\"cn-duplicate-warning__hint\"\n\t\t\t\tdata-testid=\"cn-duplicate-warning-blocked\">\n\t\t\t\t{{ text(blockedText) || t('nextcloud-vue', 'This cannot be filed twice. Open the one it matches, or ask a coordinator.') }}\n\t\t\t</p>\n\n\t\t\t<p v-if=\"footnote\"\n\t\t\t\tclass=\"cn-duplicate-warning__hint\"\n\t\t\t\tdata-testid=\"cn-duplicate-warning-footnote\">\n\t\t\t\t{{ text(footnote) }}\n\t\t\t</p>\n\t\t</div>\n\n\t\t<template #actions>\n\t\t\t<NcButton variant=\"tertiary\" data-testid=\"cn-duplicate-warning-cancel\" @click=\"close\">\n\t\t\t\t{{ t('nextcloud-vue', 'Cancel') }}\n\t\t\t</NcButton>\n\t\t\t<NcButton v-if=\"affordances.mayContinue\"\n\t\t\t\tvariant=\"primary\"\n\t\t\t\t:disabled=\"!canFile\"\n\t\t\t\tdata-testid=\"cn-duplicate-warning-continue\"\n\t\t\t\t@click=\"fileAnyway\">\n\t\t\t\t{{ text(continueLabel) || t('nextcloud-vue', 'File it anyway') }}\n\t\t\t</NcButton>\n\t\t</template>\n\t</CnDialog>\n</template>\n\n<script>\nimport { translatePlural as n, translate as t } from '@nextcloud/l10n'\nimport { generateUrl } from '@nextcloud/router'\nimport { NcButton, NcNoteCard, NcTextField } from '@nextcloud/vue'\nimport { duplicateAffordances } from '../../utils/duplicateWarning.js'\nimport { fillTemplate, firstFilled } from '../../utils/fillTemplate.js'\nimport { CnDialog } from '../CnDialog/index.js'\n\n/**\n * CnDuplicateWarning — \"this may already exist\", before a record is filed.\n * It renders OpenRegister's scored matches (`{ uuid, score, matchedOn }`),\n * never scoring anything itself, with each matched record's title, a meta\n * line, what it matched on and how strongly. Under a `warn` policy anyone may\n * file it anyway; under `block` only a user who `mayOverride`, and they say\n * why. A match the user may not read is reported without disclosing it.\n * dossiq's case intake is the first consumer; pipelinq contacts share it.\n *\n * Open it in a template, or from code with `openDuplicateWarning(props)`,\n * which resolves with `{ reason, over }` or null.\n *\n * ```vue\n * <CnDuplicateWarning\n * :matches=\"matches\"\n * :records=\"readableCases\"\n * policy=\"block\"\n * :may-override=\"isCoordinator\"\n * record-url=\"/apps/dossiq/cases/{uuid}\"\n * :field-labels=\"{ requester: 'Requester', title: 'Subject' }\"\n * @file=\"save\"\n * @close=\"cancel\" />\n * ```\n */\nexport default {\n\tname: 'CnDuplicateWarning',\n\n\tcomponents: { CnDialog, NcButton, NcNoteCard, NcTextField },\n\n\tinject: {\n\t\t/** The host app's translate (CnAppRoot `cnTranslate`). */\n\t\tcnTranslate: { default: () => (key) => key },\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * The scored matches, as OpenRegister answered: `{ uuid, score, matchedOn }`.\n\t\t *\n\t\t * @type {Array<object>}\n\t\t */\n\t\tmatches: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t\t/**\n\t\t * The matched records the user may read, matched by `id`, `uuid` or `@self.id`.\n\t\t *\n\t\t * @type {Array<object>}\n\t\t */\n\t\trecords: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t\t/** `warn` lets anyone file it anyway; `block` only a user who `mayOverride`. */\n\t\tpolicy: {\n\t\t\ttype: String,\n\t\t\tdefault: 'warn',\n\t\t},\n\n\t\t/** Whether this user may file over a block (and must say why). */\n\t\tmayOverride: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/** A record's title, a template filled from it. */\n\t\trowTitle: {\n\t\t\ttype: String,\n\t\t\tdefault: '{title}',\n\t\t},\n\n\t\t/**\n\t\t * A record's meta line, a template filled from it, or several: the\n\t\t * first that fills is shown (\"{identifier} · {caseType.title}\", then\n\t\t * \"{identifier}\" for a record that lacks the type).\n\t\t *\n\t\t * @type {string|Array<string>}\n\t\t */\n\t\trowMeta: {\n\t\t\ttype: [String, Array],\n\t\t\tdefault: '{identifier}',\n\t\t},\n\n\t\t/**\n\t\t * What a match was found on, `{fields}` (joined as a list: \"Aanvrager\n\t\t * en Onderwerp\") and `{percentage}` filled, through the host\n\t\t * translate. Empty: \"Aanvrager, Onderwerp (82%)\".\n\t\t */\n\t\tmatchedText: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** A line above the title, as the board dialogs draw one. */\n\t\teyebrow: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The help line under the reason field. */\n\t\treasonHint: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** A muted note under the matches and the reason, for what Cancel and a block mean. */\n\t\tfootnote: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** A record's page, a template with `{uuid}`; empty draws no link. */\n\t\trecordUrl: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Words for the matched fields (`{ requester: \"Requester\" }`), through the host translate.\n\t\t *\n\t\t * @type {object}\n\t\t */\n\t\tfieldLabels: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({}),\n\t\t},\n\n\t\t/** The dialog title; defaults to \"This may already exist\". */\n\t\ttitle: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The note's sentence, `{count}` filled; defaults to \"%n existing record looks like this one.\". */\n\t\theadline: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The sentence under a block the user may not pass. */\n\t\tblockedText: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The reason field's label. */\n\t\treasonLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The continue button's label; defaults to \"File it anyway\". */\n\t\tcontinueLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\t},\n\n\temits: ['close', 'file'],\n\n\tdata() {\n\t\treturn {\n\t\t\treason: '',\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/**\n\t\t * What to draw and offer.\n\t\t *\n\t\t * @spec openspec/changes/duplicate-warning/specs/duplicate-warning/spec.md#requirement-a-generic-duplicate-warning\n\t\t * @return {{show: boolean, blocked: boolean, mayContinue: boolean, needsReason: boolean}}\n\t\t */\n\t\taffordances() {\n\t\t\treturn duplicateAffordances({ matches: this.matches, policy: this.policy, mayOverride: this.mayOverride })\n\t\t},\n\n\t\t/** @return {boolean} Whether \"file it anyway\" may be pressed. */\n\t\tcanFile() {\n\t\t\treturn this.affordances.mayContinue && (!this.affordances.needsReason || this.reason.trim() !== '')\n\t\t},\n\n\t\t/** @return {string} The note's sentence. */\n\t\theadlineText() {\n\t\t\tconst count = this.matches.length\n\t\t\tif (this.headline) {\n\t\t\t\treturn fillTemplate(this.cnTranslate(this.headline), { count })\n\t\t\t}\n\t\t\treturn n('nextcloud-vue', '%n existing record looks like this one.', '%n existing records look like this one.', count)\n\t\t},\n\n\t\t/**\n\t\t * One row per match: the readable record's title and meta and link, or\n\t\t * a neutral name for one the user may not read.\n\t\t *\n\t\t * @spec openspec/changes/duplicate-warning/specs/duplicate-warning/spec.md#requirement-a-generic-duplicate-warning\n\t\t * @return {Array<object>}\n\t\t */\n\t\trows() {\n\t\t\treturn this.matches.map((match) => {\n\t\t\t\tconst uuid = String((match && match.uuid) || '')\n\t\t\t\tconst record = this.records.find((row) => String((row && (row.id || row.uuid || (row['@self'] && row['@self'].id))) || '') === uuid)\n\t\t\t\tconst fields = Array.isArray(match && match.matchedOn) ? match.matchedOn : []\n\t\t\t\tconst score = Number(match && match.score)\n\t\t\t\tconst words = fields.map((field) => (this.fieldLabels[field] ? this.cnTranslate(this.fieldLabels[field]) : field))\n\t\t\t\tconst percentage = Number.isFinite(score) ? Math.max(0, Math.min(100, Math.round(score * 100))) : 0\n\t\t\t\treturn {\n\t\t\t\t\tuuid,\n\t\t\t\t\ttitle: record ? (fillTemplate(this.rowTitle, record).trim() || uuid) : t('nextcloud-vue', 'A record you may not open'),\n\t\t\t\t\tmeta: record ? firstFilled(this.rowMeta, record, (key) => key).trim() : '',\n\t\t\t\t\thref: record && this.recordUrl ? generateUrl(fillTemplate(this.recordUrl, { uuid: encodeURIComponent(uuid) })) : '',\n\t\t\t\t\tmatched: this.matchedLine(words, percentage),\n\t\t\t\t}\n\t\t\t})\n\t\t},\n\t},\n\n\tmethods: {\n\t\tt,\n\n\t\t/**\n\t\t * A prop text through the host translate.\n\t\t *\n\t\t * @param {string} value The text.\n\t\t * @return {string}\n\t\t */\n\t\ttext(value) {\n\t\t\treturn value ? this.cnTranslate(value) : ''\n\t\t},\n\n\t\t/**\n\t\t * What a match was found on, and how strongly.\n\t\t *\n\t\t * @param {Array<string>} words The matched fields, in the host's words.\n\t\t * @param {number} percentage The score as a percentage.\n\t\t * @return {string}\n\t\t */\n\t\tmatchedLine(words, percentage) {\n\t\t\tif (words.length === 0) {\n\t\t\t\treturn `${t('nextcloud-vue', 'Matched on the score, not on a single field')} (${percentage}%)`\n\t\t\t}\n\t\t\tif (!this.matchedText) {\n\t\t\t\treturn `${words.join(', ')} (${percentage}%)`\n\t\t\t}\n\t\t\tlet fields = words.join(', ')\n\t\t\ttry {\n\t\t\t\tfields = new Intl.ListFormat(document.documentElement.lang || undefined, { type: 'conjunction' }).format(words)\n\t\t\t} catch {\n\t\t\t\t// An engine without Intl.ListFormat keeps the comma list.\n\t\t\t}\n\t\t\treturn fillTemplate(this.cnTranslate(this.matchedText), { fields, percentage: String(percentage) })\n\t\t},\n\n\t\t/** File it over the warning, carrying the reason and what it was filed over. */\n\t\tfileAnyway() {\n\t\t\tif (!this.canFile) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\t/** @event file The user files it anyway. Payload: `{ reason, over }`, `over` the matched uuids. */\n\t\t\tthis.$emit('file', { reason: this.reason.trim(), over: this.matches.map((m) => String((m && m.uuid) || '')).filter(Boolean) })\n\t\t},\n\n\t\t/** Go back without filing. */\n\t\tclose() {\n\t\t\t/** @event close The user went back without filing. */\n\t\t\tthis.$emit('close')\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-duplicate-warning {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 12px;\n}\n\n.cn-duplicate-warning__matches {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 8px;\n\tmargin: 0;\n\tpadding: 0;\n\tlist-style: none;\n}\n\n.cn-duplicate-warning__match {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tgap: 4px 12px;\n\tpadding: 8px 12px;\n\tborder: 1px solid var(--color-border);\n\tborder-radius: var(--border-radius-large, 8px);\n}\n\n.cn-duplicate-warning__title {\n\tfont-weight: 600;\n}\n\n.cn-duplicate-warning__meta,\n.cn-duplicate-warning__hint {\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-duplicate-warning__hint {\n\tmargin: 0;\n}\n</style>\n"],"names":["CnDialog","n","t"],"mappings":";;;;;;;AAuEA;AACC;AACA;;AAEA;;;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;;AAGA;AACA;;AAED,aAAe;CACd,IAAI,EAAE,oBAAoB;;CAE1B,UAAU,EAAE,YAAEA,UAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,WAAU,EAAG;;AAE3D,CAAA,MAAM,EAAE;;AAEP,EAAA,WAAW,EAAE,EAAE,OAAO,EAAE,MAAM,CAAC,GAAG,KAAK,KAAK;EAC5C;;AAED,CAAA,KAAK,EAAE;AACN;AACC;AACA;AACA;;AAED,EAAA,OAA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AE,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,CAAC,UAAU,GAAG,CAAA;GAClG;;AAED;EACA,UAAU,GAAG;AACZ,GAAA,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;IAClB,MAAK;AACN,IAAA;AACA;GACA,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,CAAC,CAAA,IAAK,CAAC,CAAC,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAA,EAAG,EAAA;GAC7H;;;AAGD,EAAA,KAAK,GAAG;AACP;AACA,GAAA,IAAI,CAAC,KAAK,CAAC,OAAO,EAAA;GAClB;EACD;AACF;;;;"}
1
+ {"version":3,"file":"CnDuplicateWarning.vue2.js","sources":["../../../../src/components/CnDuplicateWarning/CnDuplicateWarning.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n<template>\n\t<CnDialog\n\t\t:name=\"text(title) || t('nextcloud-vue', 'This may already exist')\"\n\t\t:eyebrow=\"text(eyebrow)\"\n\t\twidth=\"confirm\"\n\t\tdata-testid=\"cn-duplicate-warning\"\n\t\t@closing=\"close\">\n\t\t<div class=\"cn-duplicate-warning\">\n\t\t\t<NcNoteCard :type=\"affordances.blocked && !affordances.mayContinue ? 'error' : 'warning'\" data-testid=\"cn-duplicate-warning-note\">\n\t\t\t\t{{ headlineText }}\n\t\t\t</NcNoteCard>\n\n\t\t\t<ul class=\"cn-duplicate-warning__matches\">\n\t\t\t\t<li v-for=\"row in rows\"\n\t\t\t\t\t:key=\"row.uuid\"\n\t\t\t\t\tclass=\"cn-duplicate-warning__match\"\n\t\t\t\t\tdata-testid=\"cn-duplicate-warning-match\">\n\t\t\t\t\t<a v-if=\"row.href\" :href=\"row.href\" class=\"cn-duplicate-warning__title\">{{ row.title }}</a>\n\t\t\t\t\t<span v-else class=\"cn-duplicate-warning__title\">{{ row.title }}</span>\n\t\t\t\t\t<span v-if=\"row.meta\" class=\"cn-duplicate-warning__meta\">{{ row.meta }}</span>\n\t\t\t\t\t<span class=\"cn-duplicate-warning__meta\">{{ row.matched }}</span>\n\t\t\t\t</li>\n\t\t\t</ul>\n\n\t\t\t<NcTextField v-if=\"affordances.needsReason\"\n\t\t\t\t:label=\"text(reasonLabel) || t('nextcloud-vue', 'Why file it anyway')\"\n\t\t\t\t:modelValue=\"reason\"\n\t\t\t\t:helperText=\"text(reasonHint)\"\n\t\t\t\tdata-testid=\"cn-duplicate-warning-reason\"\n\t\t\t\t@update:modelValue=\"reason = $event\" />\n\n\t\t\t<p v-if=\"affordances.blocked && !affordances.mayContinue\"\n\t\t\t\tclass=\"cn-duplicate-warning__hint\"\n\t\t\t\tdata-testid=\"cn-duplicate-warning-blocked\">\n\t\t\t\t{{ text(blockedText) || t('nextcloud-vue', 'This cannot be filed twice. Open the one it matches, or ask a coordinator.') }}\n\t\t\t</p>\n\n\t\t\t<p v-if=\"footnote\"\n\t\t\t\tclass=\"cn-duplicate-warning__hint\"\n\t\t\t\tdata-testid=\"cn-duplicate-warning-footnote\">\n\t\t\t\t{{ text(footnote) }}\n\t\t\t</p>\n\t\t</div>\n\n\t\t<template #actions>\n\t\t\t<NcButton variant=\"secondary\" data-testid=\"cn-duplicate-warning-cancel\" @click=\"close\">\n\t\t\t\t{{ t('nextcloud-vue', 'Cancel') }}\n\t\t\t</NcButton>\n\t\t\t<NcButton v-if=\"affordances.mayContinue\"\n\t\t\t\tvariant=\"primary\"\n\t\t\t\t:disabled=\"!canFile\"\n\t\t\t\tdata-testid=\"cn-duplicate-warning-continue\"\n\t\t\t\t@click=\"fileAnyway\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<CnIcon name=\"Plus\" :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\t{{ text(continueLabel) || t('nextcloud-vue', 'File it anyway') }}\n\t\t\t</NcButton>\n\t\t</template>\n\t</CnDialog>\n</template>\n\n<script>\nimport { translatePlural as n, translate as t } from '@nextcloud/l10n'\nimport { generateUrl } from '@nextcloud/router'\nimport { NcButton, NcNoteCard, NcTextField } from '@nextcloud/vue'\nimport CnIcon from '../CnIcon/CnIcon.vue'\nimport { duplicateAffordances } from '../../utils/duplicateWarning.js'\nimport { fillTemplate, firstFilled } from '../../utils/fillTemplate.js'\nimport { CnDialog } from '../CnDialog/index.js'\n\n/**\n * CnDuplicateWarning — \"this may already exist\", before a record is filed.\n * It renders OpenRegister's scored matches (`{ uuid, score, matchedOn }`),\n * never scoring anything itself, with each matched record's title, a meta\n * line, what it matched on and how strongly. Under a `warn` policy anyone may\n * file it anyway; under `block` only a user who `mayOverride`, and they say\n * why. A match the user may not read is reported without disclosing it.\n * dossiq's case intake is the first consumer; pipelinq contacts share it.\n *\n * Open it in a template, or from code with `openDuplicateWarning(props)`,\n * which resolves with `{ reason, over }` or null.\n *\n * ```vue\n * <CnDuplicateWarning\n * :matches=\"matches\"\n * :records=\"readableCases\"\n * policy=\"block\"\n * :may-override=\"isCoordinator\"\n * record-url=\"/apps/dossiq/cases/{uuid}\"\n * :field-labels=\"{ requester: 'Requester', title: 'Subject' }\"\n * @file=\"save\"\n * @close=\"cancel\" />\n * ```\n */\nexport default {\n\tname: 'CnDuplicateWarning',\n\n\tcomponents: { CnDialog, CnIcon, NcButton, NcNoteCard, NcTextField },\n\n\tinject: {\n\t\t/** The host app's translate (CnAppRoot `cnTranslate`). */\n\t\tcnTranslate: { default: () => (key) => key },\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * The scored matches, as OpenRegister answered: `{ uuid, score, matchedOn }`.\n\t\t *\n\t\t * @type {Array<object>}\n\t\t */\n\t\tmatches: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t\t/**\n\t\t * The matched records the user may read, matched by `id`, `uuid` or `@self.id`.\n\t\t *\n\t\t * @type {Array<object>}\n\t\t */\n\t\trecords: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t\t/** `warn` lets anyone file it anyway; `block` only a user who `mayOverride`. */\n\t\tpolicy: {\n\t\t\ttype: String,\n\t\t\tdefault: 'warn',\n\t\t},\n\n\t\t/** Whether this user may file over a block (and must say why). */\n\t\tmayOverride: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/** A record's title, a template filled from it. */\n\t\trowTitle: {\n\t\t\ttype: String,\n\t\t\tdefault: '{title}',\n\t\t},\n\n\t\t/**\n\t\t * A record's meta line, a template filled from it, or several: the\n\t\t * first that fills is shown (\"{identifier} · {caseType.title}\", then\n\t\t * \"{identifier}\" for a record that lacks the type).\n\t\t *\n\t\t * @type {string|Array<string>}\n\t\t */\n\t\trowMeta: {\n\t\t\ttype: [String, Array],\n\t\t\tdefault: '{identifier}',\n\t\t},\n\n\t\t/**\n\t\t * What a match was found on, `{fields}` (joined as a list: \"Aanvrager\n\t\t * en Onderwerp\") and `{percentage}` filled, through the host\n\t\t * translate. Empty: \"Aanvrager, Onderwerp (82%)\".\n\t\t */\n\t\tmatchedText: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** A line above the title, as the board dialogs draw one. */\n\t\teyebrow: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The help line under the reason field. */\n\t\treasonHint: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** A muted note under the matches and the reason, for what Cancel and a block mean. */\n\t\tfootnote: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** A record's page, a template with `{uuid}`; empty draws no link. */\n\t\trecordUrl: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Words for the matched fields (`{ requester: \"Requester\" }`), through the host translate.\n\t\t *\n\t\t * @type {object}\n\t\t */\n\t\tfieldLabels: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({}),\n\t\t},\n\n\t\t/** The dialog title; defaults to \"This may already exist\". */\n\t\ttitle: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The note's sentence, `{count}` filled; defaults to \"%n existing record looks like this one.\". */\n\t\theadline: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The sentence under a block the user may not pass. */\n\t\tblockedText: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The reason field's label. */\n\t\treasonLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The continue button's label; defaults to \"File it anyway\". */\n\t\tcontinueLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\t},\n\n\temits: ['close', 'file'],\n\n\tdata() {\n\t\treturn {\n\t\t\treason: '',\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/**\n\t\t * What to draw and offer.\n\t\t *\n\t\t * @spec openspec/changes/duplicate-warning/specs/duplicate-warning/spec.md#requirement-a-generic-duplicate-warning\n\t\t * @return {{show: boolean, blocked: boolean, mayContinue: boolean, needsReason: boolean}}\n\t\t */\n\t\taffordances() {\n\t\t\treturn duplicateAffordances({ matches: this.matches, policy: this.policy, mayOverride: this.mayOverride })\n\t\t},\n\n\t\t/** @return {boolean} Whether \"file it anyway\" may be pressed. */\n\t\tcanFile() {\n\t\t\treturn this.affordances.mayContinue && (!this.affordances.needsReason || this.reason.trim() !== '')\n\t\t},\n\n\t\t/** @return {string} The note's sentence. */\n\t\theadlineText() {\n\t\t\tconst count = this.matches.length\n\t\t\tif (this.headline) {\n\t\t\t\treturn fillTemplate(this.cnTranslate(this.headline), { count })\n\t\t\t}\n\t\t\treturn n('nextcloud-vue', '%n existing record looks like this one.', '%n existing records look like this one.', count)\n\t\t},\n\n\t\t/**\n\t\t * One row per match: the readable record's title and meta and link, or\n\t\t * a neutral name for one the user may not read.\n\t\t *\n\t\t * @spec openspec/changes/duplicate-warning/specs/duplicate-warning/spec.md#requirement-a-generic-duplicate-warning\n\t\t * @return {Array<object>}\n\t\t */\n\t\trows() {\n\t\t\treturn this.matches.map((match) => {\n\t\t\t\tconst uuid = String((match && match.uuid) || '')\n\t\t\t\tconst record = this.records.find((row) => String((row && (row.id || row.uuid || (row['@self'] && row['@self'].id))) || '') === uuid)\n\t\t\t\tconst fields = Array.isArray(match && match.matchedOn) ? match.matchedOn : []\n\t\t\t\tconst score = Number(match && match.score)\n\t\t\t\tconst words = fields.map((field) => (this.fieldLabels[field] ? this.cnTranslate(this.fieldLabels[field]) : field))\n\t\t\t\tconst percentage = Number.isFinite(score) ? Math.max(0, Math.min(100, Math.round(score * 100))) : 0\n\t\t\t\treturn {\n\t\t\t\t\tuuid,\n\t\t\t\t\ttitle: record ? (fillTemplate(this.rowTitle, record).trim() || uuid) : t('nextcloud-vue', 'A record you may not open'),\n\t\t\t\t\tmeta: record ? firstFilled(this.rowMeta, record, (key) => key).trim() : '',\n\t\t\t\t\thref: record && this.recordUrl ? generateUrl(fillTemplate(this.recordUrl, { uuid: encodeURIComponent(uuid) })) : '',\n\t\t\t\t\tmatched: this.matchedLine(words, percentage),\n\t\t\t\t}\n\t\t\t})\n\t\t},\n\t},\n\n\tmethods: {\n\t\tt,\n\n\t\t/**\n\t\t * A prop text through the host translate.\n\t\t *\n\t\t * @param {string} value The text.\n\t\t * @return {string}\n\t\t */\n\t\ttext(value) {\n\t\t\treturn value ? this.cnTranslate(value) : ''\n\t\t},\n\n\t\t/**\n\t\t * What a match was found on, and how strongly.\n\t\t *\n\t\t * @param {Array<string>} words The matched fields, in the host's words.\n\t\t * @param {number} percentage The score as a percentage.\n\t\t * @return {string}\n\t\t */\n\t\tmatchedLine(words, percentage) {\n\t\t\tif (words.length === 0) {\n\t\t\t\treturn `${t('nextcloud-vue', 'Matched on the score, not on a single field')} (${percentage}%)`\n\t\t\t}\n\t\t\tif (!this.matchedText) {\n\t\t\t\treturn `${words.join(', ')} (${percentage}%)`\n\t\t\t}\n\t\t\tlet fields = words.join(', ')\n\t\t\ttry {\n\t\t\t\tfields = new Intl.ListFormat(document.documentElement.lang || undefined, { type: 'conjunction' }).format(words)\n\t\t\t} catch {\n\t\t\t\t// An engine without Intl.ListFormat keeps the comma list.\n\t\t\t}\n\t\t\treturn fillTemplate(this.cnTranslate(this.matchedText), { fields, percentage: String(percentage) })\n\t\t},\n\n\t\t/** File it over the warning, carrying the reason and what it was filed over. */\n\t\tfileAnyway() {\n\t\t\tif (!this.canFile) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\t/** @event file The user files it anyway. Payload: `{ reason, over }`, `over` the matched uuids. */\n\t\t\tthis.$emit('file', { reason: this.reason.trim(), over: this.matches.map((m) => String((m && m.uuid) || '')).filter(Boolean) })\n\t\t},\n\n\t\t/** Go back without filing. */\n\t\tclose() {\n\t\t\t/** @event close The user went back without filing. */\n\t\t\tthis.$emit('close')\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-duplicate-warning {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 12px;\n}\n\n.cn-duplicate-warning__matches {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 8px;\n\tmargin: 0;\n\tpadding: 0;\n\tlist-style: none;\n}\n\n.cn-duplicate-warning__match {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tgap: 4px 12px;\n\tpadding: 8px 12px;\n\tborder: 1px solid var(--color-border);\n\tborder-radius: 8px;\n}\n\n.cn-duplicate-warning__title {\n\tfont-weight: 600;\n}\n\n.cn-duplicate-warning__meta,\n.cn-duplicate-warning__hint {\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-duplicate-warning__hint {\n\tmargin: 0;\n}\n</style>\n"],"names":["CnDialog","CnIcon","n","t"],"mappings":";;;;;;;;AA2EA;AACC;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E,CAAA;AAC7C,IAAA;GACA,IAAI,MAAO,GAAE,KAAK,CAAC,IAAI,CAAC,IAAI,EAAA;AAC5B,GAAA,IAAI;IACH,SAAS,IAAI,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,eAAe,CAAC,IAAK,IAAG,SAAS,EAAE,EAAE,IAAI,EAAE,aAAc,EAAC,CAAC,CAAC,MAAM,CAAC,KAAK,EAAA;AAC/G,IAAA,CAAE,MAAM;;AAER,IAAA;AACA,GAAA,OAAO,YAAY,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,CAAC,UAAU,GAAG,CAAA;GAClG;;AAED;EACA,UAAU,GAAG;AACZ,GAAA,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;IAClB,MAAK;AACN,IAAA;AACA;GACA,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,CAAC,CAAA,IAAK,CAAC,CAAC,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAA,EAAG,EAAA;GAC7H;;;AAGD,EAAA,KAAK,GAAG;AACP;AACA,GAAA,IAAI,CAAC,KAAK,CAAC,OAAO,EAAA;GAClB;EACD;AACF;;;;"}
@@ -27,18 +27,19 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
27
27
  const _component_NcNoteCard = resolveComponent("NcNoteCard");
28
28
  const _component_NcTextField = resolveComponent("NcTextField");
29
29
  const _component_NcButton = resolveComponent("NcButton");
30
+ const _component_CnIcon = resolveComponent("CnIcon");
30
31
  const _component_CnDialog = resolveComponent("CnDialog");
31
32
 
32
33
  return (openBlock(), createBlock(_component_CnDialog, {
33
34
  name: $options.text($props.title) || $options.t('nextcloud-vue', 'This may already exist'),
34
35
  eyebrow: $options.text($props.eyebrow),
35
- width: "form",
36
+ width: "confirm",
36
37
  "data-testid": "cn-duplicate-warning",
37
38
  onClosing: $options.close
38
39
  }, {
39
40
  actions: withCtx(() => [
40
41
  createVNode(_component_NcButton, {
41
- variant: "tertiary",
42
+ variant: "secondary",
42
43
  "data-testid": "cn-duplicate-warning-cancel",
43
44
  onClick: $options.close
44
45
  }, {
@@ -55,8 +56,14 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
55
56
  "data-testid": "cn-duplicate-warning-continue",
56
57
  onClick: $options.fileAnyway
57
58
  }, {
59
+ icon: withCtx(() => [
60
+ createVNode(_component_CnIcon, {
61
+ name: "Plus",
62
+ size: 20
63
+ })
64
+ ]),
58
65
  default: withCtx(() => [
59
- createTextVNode(toDisplayString($options.text($props.continueLabel) || $options.t('nextcloud-vue', 'File it anyway')), 1 /* TEXT */)
66
+ createTextVNode(" " + toDisplayString($options.text($props.continueLabel) || $options.t('nextcloud-vue', 'File it anyway')), 1 /* TEXT */)
60
67
  ]),
61
68
  _: 1 /* STABLE */
62
69
  }, 8 /* PROPS */, ["disabled", "onClick"]))
@@ -1 +1 @@
1
- {"version":3,"file":"CnDuplicateWarning.vue3.js","sources":["../../../../src/components/CnDuplicateWarning/CnDuplicateWarning.vue?vue&type=template&id=22af78f5&lang.js"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n<template>\n\t<CnDialog\n\t\t:name=\"text(title) || t('nextcloud-vue', 'This may already exist')\"\n\t\t:eyebrow=\"text(eyebrow)\"\n\t\twidth=\"form\"\n\t\tdata-testid=\"cn-duplicate-warning\"\n\t\t@closing=\"close\">\n\t\t<div class=\"cn-duplicate-warning\">\n\t\t\t<NcNoteCard :type=\"affordances.blocked && !affordances.mayContinue ? 'error' : 'warning'\" data-testid=\"cn-duplicate-warning-note\">\n\t\t\t\t{{ headlineText }}\n\t\t\t</NcNoteCard>\n\n\t\t\t<ul class=\"cn-duplicate-warning__matches\">\n\t\t\t\t<li v-for=\"row in rows\"\n\t\t\t\t\t:key=\"row.uuid\"\n\t\t\t\t\tclass=\"cn-duplicate-warning__match\"\n\t\t\t\t\tdata-testid=\"cn-duplicate-warning-match\">\n\t\t\t\t\t<a v-if=\"row.href\" :href=\"row.href\" class=\"cn-duplicate-warning__title\">{{ row.title }}</a>\n\t\t\t\t\t<span v-else class=\"cn-duplicate-warning__title\">{{ row.title }}</span>\n\t\t\t\t\t<span v-if=\"row.meta\" class=\"cn-duplicate-warning__meta\">{{ row.meta }}</span>\n\t\t\t\t\t<span class=\"cn-duplicate-warning__meta\">{{ row.matched }}</span>\n\t\t\t\t</li>\n\t\t\t</ul>\n\n\t\t\t<NcTextField v-if=\"affordances.needsReason\"\n\t\t\t\t:label=\"text(reasonLabel) || t('nextcloud-vue', 'Why file it anyway')\"\n\t\t\t\t:modelValue=\"reason\"\n\t\t\t\t:helperText=\"text(reasonHint)\"\n\t\t\t\tdata-testid=\"cn-duplicate-warning-reason\"\n\t\t\t\t@update:modelValue=\"reason = $event\" />\n\n\t\t\t<p v-if=\"affordances.blocked && !affordances.mayContinue\"\n\t\t\t\tclass=\"cn-duplicate-warning__hint\"\n\t\t\t\tdata-testid=\"cn-duplicate-warning-blocked\">\n\t\t\t\t{{ text(blockedText) || t('nextcloud-vue', 'This cannot be filed twice. Open the one it matches, or ask a coordinator.') }}\n\t\t\t</p>\n\n\t\t\t<p v-if=\"footnote\"\n\t\t\t\tclass=\"cn-duplicate-warning__hint\"\n\t\t\t\tdata-testid=\"cn-duplicate-warning-footnote\">\n\t\t\t\t{{ text(footnote) }}\n\t\t\t</p>\n\t\t</div>\n\n\t\t<template #actions>\n\t\t\t<NcButton variant=\"tertiary\" data-testid=\"cn-duplicate-warning-cancel\" @click=\"close\">\n\t\t\t\t{{ t('nextcloud-vue', 'Cancel') }}\n\t\t\t</NcButton>\n\t\t\t<NcButton v-if=\"affordances.mayContinue\"\n\t\t\t\tvariant=\"primary\"\n\t\t\t\t:disabled=\"!canFile\"\n\t\t\t\tdata-testid=\"cn-duplicate-warning-continue\"\n\t\t\t\t@click=\"fileAnyway\">\n\t\t\t\t{{ text(continueLabel) || t('nextcloud-vue', 'File it anyway') }}\n\t\t\t</NcButton>\n\t\t</template>\n\t</CnDialog>\n</template>\n\n<script>\nimport { translatePlural as n, translate as t } from '@nextcloud/l10n'\nimport { generateUrl } from '@nextcloud/router'\nimport { NcButton, NcNoteCard, NcTextField } from '@nextcloud/vue'\nimport { duplicateAffordances } from '../../utils/duplicateWarning.js'\nimport { fillTemplate, firstFilled } from '../../utils/fillTemplate.js'\nimport { CnDialog } from '../CnDialog/index.js'\n\n/**\n * CnDuplicateWarning — \"this may already exist\", before a record is filed.\n * It renders OpenRegister's scored matches (`{ uuid, score, matchedOn }`),\n * never scoring anything itself, with each matched record's title, a meta\n * line, what it matched on and how strongly. Under a `warn` policy anyone may\n * file it anyway; under `block` only a user who `mayOverride`, and they say\n * why. A match the user may not read is reported without disclosing it.\n * dossiq's case intake is the first consumer; pipelinq contacts share it.\n *\n * Open it in a template, or from code with `openDuplicateWarning(props)`,\n * which resolves with `{ reason, over }` or null.\n *\n * ```vue\n * <CnDuplicateWarning\n * :matches=\"matches\"\n * :records=\"readableCases\"\n * policy=\"block\"\n * :may-override=\"isCoordinator\"\n * record-url=\"/apps/dossiq/cases/{uuid}\"\n * :field-labels=\"{ requester: 'Requester', title: 'Subject' }\"\n * @file=\"save\"\n * @close=\"cancel\" />\n * ```\n */\nexport default {\n\tname: 'CnDuplicateWarning',\n\n\tcomponents: { CnDialog, NcButton, NcNoteCard, NcTextField },\n\n\tinject: {\n\t\t/** The host app's translate (CnAppRoot `cnTranslate`). */\n\t\tcnTranslate: { default: () => (key) => key },\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * The scored matches, as OpenRegister answered: `{ uuid, score, matchedOn }`.\n\t\t *\n\t\t * @type {Array<object>}\n\t\t */\n\t\tmatches: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t\t/**\n\t\t * The matched records the user may read, matched by `id`, `uuid` or `@self.id`.\n\t\t *\n\t\t * @type {Array<object>}\n\t\t */\n\t\trecords: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t\t/** `warn` lets anyone file it anyway; `block` only a user who `mayOverride`. */\n\t\tpolicy: {\n\t\t\ttype: String,\n\t\t\tdefault: 'warn',\n\t\t},\n\n\t\t/** Whether this user may file over a block (and must say why). */\n\t\tmayOverride: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/** A record's title, a template filled from it. */\n\t\trowTitle: {\n\t\t\ttype: String,\n\t\t\tdefault: '{title}',\n\t\t},\n\n\t\t/**\n\t\t * A record's meta line, a template filled from it, or several: the\n\t\t * first that fills is shown (\"{identifier} · {caseType.title}\", then\n\t\t * \"{identifier}\" for a record that lacks the type).\n\t\t *\n\t\t * @type {string|Array<string>}\n\t\t */\n\t\trowMeta: {\n\t\t\ttype: [String, Array],\n\t\t\tdefault: '{identifier}',\n\t\t},\n\n\t\t/**\n\t\t * What a match was found on, `{fields}` (joined as a list: \"Aanvrager\n\t\t * en Onderwerp\") and `{percentage}` filled, through the host\n\t\t * translate. Empty: \"Aanvrager, Onderwerp (82%)\".\n\t\t */\n\t\tmatchedText: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** A line above the title, as the board dialogs draw one. */\n\t\teyebrow: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The help line under the reason field. */\n\t\treasonHint: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** A muted note under the matches and the reason, for what Cancel and a block mean. */\n\t\tfootnote: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** A record's page, a template with `{uuid}`; empty draws no link. */\n\t\trecordUrl: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Words for the matched fields (`{ requester: \"Requester\" }`), through the host translate.\n\t\t *\n\t\t * @type {object}\n\t\t */\n\t\tfieldLabels: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({}),\n\t\t},\n\n\t\t/** The dialog title; defaults to \"This may already exist\". */\n\t\ttitle: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The note's sentence, `{count}` filled; defaults to \"%n existing record looks like this one.\". */\n\t\theadline: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The sentence under a block the user may not pass. */\n\t\tblockedText: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The reason field's label. */\n\t\treasonLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The continue button's label; defaults to \"File it anyway\". */\n\t\tcontinueLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\t},\n\n\temits: ['close', 'file'],\n\n\tdata() {\n\t\treturn {\n\t\t\treason: '',\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/**\n\t\t * What to draw and offer.\n\t\t *\n\t\t * @spec openspec/changes/duplicate-warning/specs/duplicate-warning/spec.md#requirement-a-generic-duplicate-warning\n\t\t * @return {{show: boolean, blocked: boolean, mayContinue: boolean, needsReason: boolean}}\n\t\t */\n\t\taffordances() {\n\t\t\treturn duplicateAffordances({ matches: this.matches, policy: this.policy, mayOverride: this.mayOverride })\n\t\t},\n\n\t\t/** @return {boolean} Whether \"file it anyway\" may be pressed. */\n\t\tcanFile() {\n\t\t\treturn this.affordances.mayContinue && (!this.affordances.needsReason || this.reason.trim() !== '')\n\t\t},\n\n\t\t/** @return {string} The note's sentence. */\n\t\theadlineText() {\n\t\t\tconst count = this.matches.length\n\t\t\tif (this.headline) {\n\t\t\t\treturn fillTemplate(this.cnTranslate(this.headline), { count })\n\t\t\t}\n\t\t\treturn n('nextcloud-vue', '%n existing record looks like this one.', '%n existing records look like this one.', count)\n\t\t},\n\n\t\t/**\n\t\t * One row per match: the readable record's title and meta and link, or\n\t\t * a neutral name for one the user may not read.\n\t\t *\n\t\t * @spec openspec/changes/duplicate-warning/specs/duplicate-warning/spec.md#requirement-a-generic-duplicate-warning\n\t\t * @return {Array<object>}\n\t\t */\n\t\trows() {\n\t\t\treturn this.matches.map((match) => {\n\t\t\t\tconst uuid = String((match && match.uuid) || '')\n\t\t\t\tconst record = this.records.find((row) => String((row && (row.id || row.uuid || (row['@self'] && row['@self'].id))) || '') === uuid)\n\t\t\t\tconst fields = Array.isArray(match && match.matchedOn) ? match.matchedOn : []\n\t\t\t\tconst score = Number(match && match.score)\n\t\t\t\tconst words = fields.map((field) => (this.fieldLabels[field] ? this.cnTranslate(this.fieldLabels[field]) : field))\n\t\t\t\tconst percentage = Number.isFinite(score) ? Math.max(0, Math.min(100, Math.round(score * 100))) : 0\n\t\t\t\treturn {\n\t\t\t\t\tuuid,\n\t\t\t\t\ttitle: record ? (fillTemplate(this.rowTitle, record).trim() || uuid) : t('nextcloud-vue', 'A record you may not open'),\n\t\t\t\t\tmeta: record ? firstFilled(this.rowMeta, record, (key) => key).trim() : '',\n\t\t\t\t\thref: record && this.recordUrl ? generateUrl(fillTemplate(this.recordUrl, { uuid: encodeURIComponent(uuid) })) : '',\n\t\t\t\t\tmatched: this.matchedLine(words, percentage),\n\t\t\t\t}\n\t\t\t})\n\t\t},\n\t},\n\n\tmethods: {\n\t\tt,\n\n\t\t/**\n\t\t * A prop text through the host translate.\n\t\t *\n\t\t * @param {string} value The text.\n\t\t * @return {string}\n\t\t */\n\t\ttext(value) {\n\t\t\treturn value ? this.cnTranslate(value) : ''\n\t\t},\n\n\t\t/**\n\t\t * What a match was found on, and how strongly.\n\t\t *\n\t\t * @param {Array<string>} words The matched fields, in the host's words.\n\t\t * @param {number} percentage The score as a percentage.\n\t\t * @return {string}\n\t\t */\n\t\tmatchedLine(words, percentage) {\n\t\t\tif (words.length === 0) {\n\t\t\t\treturn `${t('nextcloud-vue', 'Matched on the score, not on a single field')} (${percentage}%)`\n\t\t\t}\n\t\t\tif (!this.matchedText) {\n\t\t\t\treturn `${words.join(', ')} (${percentage}%)`\n\t\t\t}\n\t\t\tlet fields = words.join(', ')\n\t\t\ttry {\n\t\t\t\tfields = new Intl.ListFormat(document.documentElement.lang || undefined, { type: 'conjunction' }).format(words)\n\t\t\t} catch {\n\t\t\t\t// An engine without Intl.ListFormat keeps the comma list.\n\t\t\t}\n\t\t\treturn fillTemplate(this.cnTranslate(this.matchedText), { fields, percentage: String(percentage) })\n\t\t},\n\n\t\t/** File it over the warning, carrying the reason and what it was filed over. */\n\t\tfileAnyway() {\n\t\t\tif (!this.canFile) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\t/** @event file The user files it anyway. Payload: `{ reason, over }`, `over` the matched uuids. */\n\t\t\tthis.$emit('file', { reason: this.reason.trim(), over: this.matches.map((m) => String((m && m.uuid) || '')).filter(Boolean) })\n\t\t},\n\n\t\t/** Go back without filing. */\n\t\tclose() {\n\t\t\t/** @event close The user went back without filing. */\n\t\t\tthis.$emit('close')\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-duplicate-warning {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 12px;\n}\n\n.cn-duplicate-warning__matches {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 8px;\n\tmargin: 0;\n\tpadding: 0;\n\tlist-style: none;\n}\n\n.cn-duplicate-warning__match {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tgap: 4px 12px;\n\tpadding: 8px 12px;\n\tborder: 1px solid var(--color-border);\n\tborder-radius: var(--border-radius-large, 8px);\n}\n\n.cn-duplicate-warning__title {\n\tfont-weight: 600;\n}\n\n.cn-duplicate-warning__meta,\n.cn-duplicate-warning__hint {\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-duplicate-warning__hint {\n\tmargin: 0;\n}\n</style>\n"],"names":["_createBlock","_createVNode","_createElementVNode","_createElementBlock","_Fragment","_renderList","_toDisplayString","_openBlock"],"mappings":";;;AAoBO,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,+BAA+B,GAAA;;;;AAMrC,EAAA,KAAA,EAAA,6BAAA;;;;;;AAEI,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,4BAA4B,GAAA;;;;AAazC,EAAA,aAAW,EAAC,8BAAI;;;;AAKhB,EAAA,KAAG,EAAA,4BAAA;;;;;;;;;;uBArCLA;AACC,IAAA,IAAI,EAAE,QAAA,CAAA,IAAI,CAAC,MAAA,CAAA,KAAI,KAAA,QAAA,CAAA,CAAA,CAAA,eAAA,EAAA,wBAAA,CAAA;IACf,OAAO,EAAE,QAAI,CAAA,IAAA,CAAC,MAAO,CAAA,OAAA,CAAA;SACjB,EAAC,MAAO;AACX,IAAA,aAAS,EAAC,sBAAO;AAClB,IAAA,SAAO,EAAE,QAAG,CAAA,KAAA;;AAsCF,IAAA,OAAO,UAChB,MAEU;MAFVC,WAEU,CAAA,mBAAA,EAAA;AAFD,QAAA,OAAO,EAAA,UAAA;AAAA,QAAA,aAAA,EAAA,6BAAA;AAAA,QAAA,OAAA,EAAA,QAAA,CAAA,KAAA;;yBAChB,MAAmB;0CAAhB,QAAC,CAAA,CAAA,CAAA,eAAA,EAAA,QAAA,CAAA,CAAA,EAAA,CAAA,YAAA;;;;AAEW,MAAA,CAAA,QAAA,CAAA,WAAI,CAAA,WAAA;wBAAnBD;;AACA,YAAA,OAAO,EAAC,SAAS;AAChB,YAAA,QAAQ,GAAA,QAAA,CAAA,OAAA;AACT,YAAA,aAAQ,EAAA,+BAAA;AACP,YAAA,OAAK,EAAC,QAAA,CAAA,UAAA;;;;;;;;;2BAVH;yBAAA,iBAAA,EAAA;QAlCLC,WAEa,CAAA,qBAAA,EAAA;AAFA,UAAA,IAAI,EAAE,QAAW,CAAA,WAAA,CAA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AC,6BAAqB;cAChC,qBAAiB,EAAA,MAAA,CAAA,CAAA,CAAA,KAAA,MAAA,CAAA,CAAA,CAAA,GAAA,MAAA,KAAE,KAAM,CAAA,MAAA,GAAG,MAAM,CAAA,CAAA;;;AAEjC,QAAA,CAAA,QAAA,CAAA,WAAA,CAAA,OAAA,IAAA,CAAA,QAAA,CAAA,WAAA,CAAA,WAAA;AAAH,aAAAO,SAAA,EAAA,EAAAJ,kBAAA,CAII,KAJJ,UAII,EAAAG,eAAA,CADA,aAAI,CAAC,MAAA,CAAA,WAAW,KAAK,QAAC,CAAA,CAAA,CAAA,eAAA,EAAA,4EAAA,CAAA,CAAA,EAAA,CAAA,YAAA;;SAGvB,MAAA,CAAA,QAAA;AAAH,aAAAC,SAAA,EAAA,EAAAJ,kBAAA,CAII,GAJJ,EAAA,UAII,EADAG,eAAA,CAAA,QAAA,CAAA,IAAK,CAAA,MAAQ,CAAA,QAAA,CAAA,CAAA,EAAA,CAAA,YAAA;;;;;;;;;;"}
1
+ {"version":3,"file":"CnDuplicateWarning.vue3.js","sources":["../../../../src/components/CnDuplicateWarning/CnDuplicateWarning.vue?vue&type=template&id=0588a184&lang.js"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n<template>\n\t<CnDialog\n\t\t:name=\"text(title) || t('nextcloud-vue', 'This may already exist')\"\n\t\t:eyebrow=\"text(eyebrow)\"\n\t\twidth=\"confirm\"\n\t\tdata-testid=\"cn-duplicate-warning\"\n\t\t@closing=\"close\">\n\t\t<div class=\"cn-duplicate-warning\">\n\t\t\t<NcNoteCard :type=\"affordances.blocked && !affordances.mayContinue ? 'error' : 'warning'\" data-testid=\"cn-duplicate-warning-note\">\n\t\t\t\t{{ headlineText }}\n\t\t\t</NcNoteCard>\n\n\t\t\t<ul class=\"cn-duplicate-warning__matches\">\n\t\t\t\t<li v-for=\"row in rows\"\n\t\t\t\t\t:key=\"row.uuid\"\n\t\t\t\t\tclass=\"cn-duplicate-warning__match\"\n\t\t\t\t\tdata-testid=\"cn-duplicate-warning-match\">\n\t\t\t\t\t<a v-if=\"row.href\" :href=\"row.href\" class=\"cn-duplicate-warning__title\">{{ row.title }}</a>\n\t\t\t\t\t<span v-else class=\"cn-duplicate-warning__title\">{{ row.title }}</span>\n\t\t\t\t\t<span v-if=\"row.meta\" class=\"cn-duplicate-warning__meta\">{{ row.meta }}</span>\n\t\t\t\t\t<span class=\"cn-duplicate-warning__meta\">{{ row.matched }}</span>\n\t\t\t\t</li>\n\t\t\t</ul>\n\n\t\t\t<NcTextField v-if=\"affordances.needsReason\"\n\t\t\t\t:label=\"text(reasonLabel) || t('nextcloud-vue', 'Why file it anyway')\"\n\t\t\t\t:modelValue=\"reason\"\n\t\t\t\t:helperText=\"text(reasonHint)\"\n\t\t\t\tdata-testid=\"cn-duplicate-warning-reason\"\n\t\t\t\t@update:modelValue=\"reason = $event\" />\n\n\t\t\t<p v-if=\"affordances.blocked && !affordances.mayContinue\"\n\t\t\t\tclass=\"cn-duplicate-warning__hint\"\n\t\t\t\tdata-testid=\"cn-duplicate-warning-blocked\">\n\t\t\t\t{{ text(blockedText) || t('nextcloud-vue', 'This cannot be filed twice. Open the one it matches, or ask a coordinator.') }}\n\t\t\t</p>\n\n\t\t\t<p v-if=\"footnote\"\n\t\t\t\tclass=\"cn-duplicate-warning__hint\"\n\t\t\t\tdata-testid=\"cn-duplicate-warning-footnote\">\n\t\t\t\t{{ text(footnote) }}\n\t\t\t</p>\n\t\t</div>\n\n\t\t<template #actions>\n\t\t\t<NcButton variant=\"secondary\" data-testid=\"cn-duplicate-warning-cancel\" @click=\"close\">\n\t\t\t\t{{ t('nextcloud-vue', 'Cancel') }}\n\t\t\t</NcButton>\n\t\t\t<NcButton v-if=\"affordances.mayContinue\"\n\t\t\t\tvariant=\"primary\"\n\t\t\t\t:disabled=\"!canFile\"\n\t\t\t\tdata-testid=\"cn-duplicate-warning-continue\"\n\t\t\t\t@click=\"fileAnyway\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<CnIcon name=\"Plus\" :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\t{{ text(continueLabel) || t('nextcloud-vue', 'File it anyway') }}\n\t\t\t</NcButton>\n\t\t</template>\n\t</CnDialog>\n</template>\n\n<script>\nimport { translatePlural as n, translate as t } from '@nextcloud/l10n'\nimport { generateUrl } from '@nextcloud/router'\nimport { NcButton, NcNoteCard, NcTextField } from '@nextcloud/vue'\nimport CnIcon from '../CnIcon/CnIcon.vue'\nimport { duplicateAffordances } from '../../utils/duplicateWarning.js'\nimport { fillTemplate, firstFilled } from '../../utils/fillTemplate.js'\nimport { CnDialog } from '../CnDialog/index.js'\n\n/**\n * CnDuplicateWarning — \"this may already exist\", before a record is filed.\n * It renders OpenRegister's scored matches (`{ uuid, score, matchedOn }`),\n * never scoring anything itself, with each matched record's title, a meta\n * line, what it matched on and how strongly. Under a `warn` policy anyone may\n * file it anyway; under `block` only a user who `mayOverride`, and they say\n * why. A match the user may not read is reported without disclosing it.\n * dossiq's case intake is the first consumer; pipelinq contacts share it.\n *\n * Open it in a template, or from code with `openDuplicateWarning(props)`,\n * which resolves with `{ reason, over }` or null.\n *\n * ```vue\n * <CnDuplicateWarning\n * :matches=\"matches\"\n * :records=\"readableCases\"\n * policy=\"block\"\n * :may-override=\"isCoordinator\"\n * record-url=\"/apps/dossiq/cases/{uuid}\"\n * :field-labels=\"{ requester: 'Requester', title: 'Subject' }\"\n * @file=\"save\"\n * @close=\"cancel\" />\n * ```\n */\nexport default {\n\tname: 'CnDuplicateWarning',\n\n\tcomponents: { CnDialog, CnIcon, NcButton, NcNoteCard, NcTextField },\n\n\tinject: {\n\t\t/** The host app's translate (CnAppRoot `cnTranslate`). */\n\t\tcnTranslate: { default: () => (key) => key },\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * The scored matches, as OpenRegister answered: `{ uuid, score, matchedOn }`.\n\t\t *\n\t\t * @type {Array<object>}\n\t\t */\n\t\tmatches: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t\t/**\n\t\t * The matched records the user may read, matched by `id`, `uuid` or `@self.id`.\n\t\t *\n\t\t * @type {Array<object>}\n\t\t */\n\t\trecords: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t\t/** `warn` lets anyone file it anyway; `block` only a user who `mayOverride`. */\n\t\tpolicy: {\n\t\t\ttype: String,\n\t\t\tdefault: 'warn',\n\t\t},\n\n\t\t/** Whether this user may file over a block (and must say why). */\n\t\tmayOverride: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/** A record's title, a template filled from it. */\n\t\trowTitle: {\n\t\t\ttype: String,\n\t\t\tdefault: '{title}',\n\t\t},\n\n\t\t/**\n\t\t * A record's meta line, a template filled from it, or several: the\n\t\t * first that fills is shown (\"{identifier} · {caseType.title}\", then\n\t\t * \"{identifier}\" for a record that lacks the type).\n\t\t *\n\t\t * @type {string|Array<string>}\n\t\t */\n\t\trowMeta: {\n\t\t\ttype: [String, Array],\n\t\t\tdefault: '{identifier}',\n\t\t},\n\n\t\t/**\n\t\t * What a match was found on, `{fields}` (joined as a list: \"Aanvrager\n\t\t * en Onderwerp\") and `{percentage}` filled, through the host\n\t\t * translate. Empty: \"Aanvrager, Onderwerp (82%)\".\n\t\t */\n\t\tmatchedText: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** A line above the title, as the board dialogs draw one. */\n\t\teyebrow: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The help line under the reason field. */\n\t\treasonHint: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** A muted note under the matches and the reason, for what Cancel and a block mean. */\n\t\tfootnote: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** A record's page, a template with `{uuid}`; empty draws no link. */\n\t\trecordUrl: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Words for the matched fields (`{ requester: \"Requester\" }`), through the host translate.\n\t\t *\n\t\t * @type {object}\n\t\t */\n\t\tfieldLabels: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({}),\n\t\t},\n\n\t\t/** The dialog title; defaults to \"This may already exist\". */\n\t\ttitle: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The note's sentence, `{count}` filled; defaults to \"%n existing record looks like this one.\". */\n\t\theadline: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The sentence under a block the user may not pass. */\n\t\tblockedText: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The reason field's label. */\n\t\treasonLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The continue button's label; defaults to \"File it anyway\". */\n\t\tcontinueLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\t},\n\n\temits: ['close', 'file'],\n\n\tdata() {\n\t\treturn {\n\t\t\treason: '',\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/**\n\t\t * What to draw and offer.\n\t\t *\n\t\t * @spec openspec/changes/duplicate-warning/specs/duplicate-warning/spec.md#requirement-a-generic-duplicate-warning\n\t\t * @return {{show: boolean, blocked: boolean, mayContinue: boolean, needsReason: boolean}}\n\t\t */\n\t\taffordances() {\n\t\t\treturn duplicateAffordances({ matches: this.matches, policy: this.policy, mayOverride: this.mayOverride })\n\t\t},\n\n\t\t/** @return {boolean} Whether \"file it anyway\" may be pressed. */\n\t\tcanFile() {\n\t\t\treturn this.affordances.mayContinue && (!this.affordances.needsReason || this.reason.trim() !== '')\n\t\t},\n\n\t\t/** @return {string} The note's sentence. */\n\t\theadlineText() {\n\t\t\tconst count = this.matches.length\n\t\t\tif (this.headline) {\n\t\t\t\treturn fillTemplate(this.cnTranslate(this.headline), { count })\n\t\t\t}\n\t\t\treturn n('nextcloud-vue', '%n existing record looks like this one.', '%n existing records look like this one.', count)\n\t\t},\n\n\t\t/**\n\t\t * One row per match: the readable record's title and meta and link, or\n\t\t * a neutral name for one the user may not read.\n\t\t *\n\t\t * @spec openspec/changes/duplicate-warning/specs/duplicate-warning/spec.md#requirement-a-generic-duplicate-warning\n\t\t * @return {Array<object>}\n\t\t */\n\t\trows() {\n\t\t\treturn this.matches.map((match) => {\n\t\t\t\tconst uuid = String((match && match.uuid) || '')\n\t\t\t\tconst record = this.records.find((row) => String((row && (row.id || row.uuid || (row['@self'] && row['@self'].id))) || '') === uuid)\n\t\t\t\tconst fields = Array.isArray(match && match.matchedOn) ? match.matchedOn : []\n\t\t\t\tconst score = Number(match && match.score)\n\t\t\t\tconst words = fields.map((field) => (this.fieldLabels[field] ? this.cnTranslate(this.fieldLabels[field]) : field))\n\t\t\t\tconst percentage = Number.isFinite(score) ? Math.max(0, Math.min(100, Math.round(score * 100))) : 0\n\t\t\t\treturn {\n\t\t\t\t\tuuid,\n\t\t\t\t\ttitle: record ? (fillTemplate(this.rowTitle, record).trim() || uuid) : t('nextcloud-vue', 'A record you may not open'),\n\t\t\t\t\tmeta: record ? firstFilled(this.rowMeta, record, (key) => key).trim() : '',\n\t\t\t\t\thref: record && this.recordUrl ? generateUrl(fillTemplate(this.recordUrl, { uuid: encodeURIComponent(uuid) })) : '',\n\t\t\t\t\tmatched: this.matchedLine(words, percentage),\n\t\t\t\t}\n\t\t\t})\n\t\t},\n\t},\n\n\tmethods: {\n\t\tt,\n\n\t\t/**\n\t\t * A prop text through the host translate.\n\t\t *\n\t\t * @param {string} value The text.\n\t\t * @return {string}\n\t\t */\n\t\ttext(value) {\n\t\t\treturn value ? this.cnTranslate(value) : ''\n\t\t},\n\n\t\t/**\n\t\t * What a match was found on, and how strongly.\n\t\t *\n\t\t * @param {Array<string>} words The matched fields, in the host's words.\n\t\t * @param {number} percentage The score as a percentage.\n\t\t * @return {string}\n\t\t */\n\t\tmatchedLine(words, percentage) {\n\t\t\tif (words.length === 0) {\n\t\t\t\treturn `${t('nextcloud-vue', 'Matched on the score, not on a single field')} (${percentage}%)`\n\t\t\t}\n\t\t\tif (!this.matchedText) {\n\t\t\t\treturn `${words.join(', ')} (${percentage}%)`\n\t\t\t}\n\t\t\tlet fields = words.join(', ')\n\t\t\ttry {\n\t\t\t\tfields = new Intl.ListFormat(document.documentElement.lang || undefined, { type: 'conjunction' }).format(words)\n\t\t\t} catch {\n\t\t\t\t// An engine without Intl.ListFormat keeps the comma list.\n\t\t\t}\n\t\t\treturn fillTemplate(this.cnTranslate(this.matchedText), { fields, percentage: String(percentage) })\n\t\t},\n\n\t\t/** File it over the warning, carrying the reason and what it was filed over. */\n\t\tfileAnyway() {\n\t\t\tif (!this.canFile) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\t/** @event file The user files it anyway. Payload: `{ reason, over }`, `over` the matched uuids. */\n\t\t\tthis.$emit('file', { reason: this.reason.trim(), over: this.matches.map((m) => String((m && m.uuid) || '')).filter(Boolean) })\n\t\t},\n\n\t\t/** Go back without filing. */\n\t\tclose() {\n\t\t\t/** @event close The user went back without filing. */\n\t\t\tthis.$emit('close')\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-duplicate-warning {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 12px;\n}\n\n.cn-duplicate-warning__matches {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 8px;\n\tmargin: 0;\n\tpadding: 0;\n\tlist-style: none;\n}\n\n.cn-duplicate-warning__match {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tgap: 4px 12px;\n\tpadding: 8px 12px;\n\tborder: 1px solid var(--color-border);\n\tborder-radius: 8px;\n}\n\n.cn-duplicate-warning__title {\n\tfont-weight: 600;\n}\n\n.cn-duplicate-warning__meta,\n.cn-duplicate-warning__hint {\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-duplicate-warning__hint {\n\tmargin: 0;\n}\n</style>\n"],"names":["_createBlock","_createVNode","_createTextVNode","_createElementVNode","_createElementBlock","_Fragment","_renderList","_toDisplayString","_openBlock"],"mappings":";;;AAoBO,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,+BAA+B,GAAA;;;;AAMrC,EAAA,KAAA,EAAA,6BAAA;;;;;;AAEI,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,4BAA4B,GAAA;;;;AAazC,EAAA,aAAW,EAAC,8BAAI;;;;AAKhB,EAAA,KAAG,EAAA,4BAAA;;;;;;;;;;;uBArCLA;AACC,IAAA,IAAI,EAAE,QAAA,CAAA,IAAI,CAAC,MAAA,CAAA,KAAI,KAAA,QAAA,CAAA,CAAA,CAAA,eAAA,EAAA,wBAAA,CAAA;IACf,OAAO,EAAE,QAAI,CAAA,IAAA,CAAC,MAAO,CAAA,OAAA,CAAA;SACjB,EAAC,SAAS;AACb,IAAA,aAAS,EAAC,sBAAO;AAClB,IAAA,SAAO,EAAE,QAAG,CAAA,KAAA;;AAsCF,IAAA,OAAO,UAChB,MAEU;MAFVC,WAEU,CAAA,mBAAA,EAAA;AAFD,QAAA,OAAO,EAAA,WAAA;AAAA,QAAA,aAAA,EAAA,6BAAA;AAAA,QAAA,OAAA,EAAA,QAAA,CAAA,KAAA;;yBAChB,MAAmB;0CAAhB,QAAC,CAAA,CAAA,CAAA,eAAA,EAAA,QAAA,CAAA,CAAA,EAAA,CAAA,YAAA;;;;AAEW,MAAA,CAAA,QAAA,CAAA,WAAI,CAAA,WAAA;wBAAnBD;;AACA,YAAA,OAAO,EAAC,SAAO;AACd,YAAA,QAAQ,GAAG,QAAO,CAAA,OAAA;AACnB,YAAA,aAAU,EAAA,+BAAA;AACT,YAAA,OAAK,EAAE,QAAU,CAAA,UAAA;;AACT,YAAA,IAAA,UACR,MAAO;cAAPC,WAAO,CAAA,iBAAA,EAAA;AAAA,gBAAA,IAAA,EAAA,MAAA;AAAA,gBAAA,IAAA,EAA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AA,WAAW,KAAK,QAAC,CAAA,CAAA,CAAA,eAAA,EAAA,oBAAA,CAAA;;cAE9B,UAAW,EAAE,QAAI,CAAA,IAAA,CAAC,MAAU,CAAA,UAAA,CAAA;AAC5B,cAAA,aAAW,EAAC,6BAAqB;cAChC,qBAAiB,EAAA,MAAA,CAAA,CAAA,CAAA,KAAA,MAAA,CAAA,CAAA,CAAA,GAAA,MAAA,KAAE,KAAM,CAAA,MAAA,GAAG,MAAM,CAAA,CAAA;;;AAEjC,QAAA,CAAA,QAAA,CAAA,WAAA,CAAA,OAAA,IAAA,CAAA,QAAA,CAAA,WAAA,CAAA,WAAA;AAAH,aAAAQ,SAAA,EAAA,EAAAJ,kBAAA,CAII,KAJJ,UAII,EAAAG,eAAA,CADA,aAAI,CAAC,MAAA,CAAA,WAAW,KAAK,QAAC,CAAA,CAAA,CAAA,eAAA,EAAA,4EAAA,CAAA,CAAA,EAAA,CAAA,YAAA;;SAGvB,MAAA,CAAA,QAAA;AAAH,aAAAC,SAAA,EAAA,EAAAJ,kBAAA,CAII,GAJJ,EAAA,UAII,EADAG,eAAA,CAAA,QAAA,CAAA,IAAK,CAAA,MAAQ,CAAA,QAAA,CAAA,CAAA,EAAA,CAAA,YAAA;;;;;;;;;;"}
@@ -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-531080cb";
6
+ script.__scopeId = "data-v-3ce13882";
7
7
  const __sfc_main = script;
8
8
 
9
9
  export { __sfc_main as default };
@@ -223,7 +223,7 @@ var script = {
223
223
  * `as` is `row` (default when `label` or `icon` is set), `title`, `line`, `text` (a line in the normal ink), `lead` (an icon tile or initials beside `title` and `subtitle`), `pill` or `meter`.
224
224
  * `countFrom` (`{ register, schema, filter? }`, `@objectId` / `@object.<field>` in the filter) shows how many records that list holds ("Lopende zaken 43"); the row is left out while the count cannot be read.
225
225
  * A `meter` shows the amount at `path` against the limit at `limitPath` (or a constant `limit`) as "12 of 50" with a bar; past the limit the bar turns red and the text says "over the limit"; without a positive limit it shows the amount and no bar.
226
- * A `line` or `text` with `joinPrevious: true` is written on after the line or text just before it, as one paragraph (`joinSeparator`, default a space); with none before it, it stands alone.
226
+ * A `line` or `text` with `joinPrevious: true` is written on after the line or text just before it, as one paragraph (`joinSeparator`, default a space); with none before it, it stands alone. A text joined with a line break (`joinSeparator: "\n"`) keeps it: two address lines as one block.
227
227
  * A row with `inline: true` spans both columns as one line, the label, the value and its buttons side by side (a masked BSN with Show).
228
228
  * A row's `format` may also be `email`, `phone` or `url` (a link) or `masked` (the last four characters; `reveal: true` adds Show, which unmasks the record's value; `reveal: { url, path? }` makes Show ask the server for the value at `url` (tokens resolved), read at `path` (else the entry's path), so a server that answers the mask can check and record the reveal). `copy: true` adds a copy button; `icon` replaces the label.
229
229
  * A part may be `{ text }`, a constant; a `line` or `text` entry without `path` or `parts` shows its `text`.
@@ -248,7 +248,7 @@ var script = {
248
248
  * - `emptyWhen` — a path; when the record's value there is truthy the card shows `emptyText` (an endpoint that answers `empty: true`).
249
249
  * - `link` — `{ label, route? | href? }` at the foot. `{ label, icon?, sidebarTab }` instead opens the page's object sidebar on that tab (no link without a sidebar).
250
250
  * - `hideEmpty` — drop an entry whose value is empty (default true).
251
- * - `columns` — `2` lays the rows out in two columns with the label above the value (board DqContact); a row with `parts` joins them like a line (an address on one row). `1` stacks each label above its value in one column, for a narrow card with long labels (board DqHandhaving "Afwijking en definitief").
251
+ * - `columns` — `2` lays the rows out in two columns with the label above the value (board DqContact), `3` in three (board DqSociaalDomein "De melding"); a row with `parts` joins them like a line (an address on one row). `1` stacks each label above its value in one column, for a narrow card with long labels (board DqHandhaving "Afwijking en definitief").
252
252
  * - `emptyText` — shown when no entry has a value.
253
253
  *
254
254
  * @type {{fields?: Array<object>, source?: object, link?: object, hideEmpty?: boolean, emptyText?: string}}
@@ -324,13 +324,23 @@ var script = {
324
324
  },
325
325
 
326
326
  /**
327
- * Whether the rows sit in two columns, label above value.
327
+ * Whether the rows sit in columns, label above value: two, or three.
328
328
  *
329
329
  * @spec openspec/changes/facts-columns/specs/facts-widget/spec.md#requirement-facts-rows-can-sit-in-two-columns
330
330
  * @return {boolean}
331
331
  */
332
332
  twoColumns() {
333
- return Number(this.content?.columns) === 2
333
+ return [2, 3].includes(Number(this.content?.columns))
334
+ },
335
+
336
+ /**
337
+ * Whether the rows sit in three columns (board DqSociaalDomein "De melding").
338
+ *
339
+ * @spec openspec/changes/facts-columns/specs/facts-widget/spec.md#requirement-facts-rows-can-sit-in-three-columns
340
+ * @return {boolean}
341
+ */
342
+ threeColumns() {
343
+ return Number(this.content?.columns) === 3
334
344
  },
335
345
 
336
346
  /**