@conduction/nextcloud-vue 2.56.0-beta.65 → 2.56.0-beta.66

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 (127) hide show
  1. package/dist/esm/components/CnActionDialog/CnActionDialog.vue.js +1 -1
  2. package/dist/esm/components/CnActionDialog/CnActionDialog.vue2.js +3 -2
  3. package/dist/esm/components/CnActionDialog/CnActionDialog.vue2.js.map +1 -1
  4. package/dist/esm/components/CnActionDialog/CnActionDialog.vue3.js +4 -2
  5. package/dist/esm/components/CnActionDialog/CnActionDialog.vue3.js.map +1 -1
  6. package/dist/esm/components/CnAssignDialog/CnAssignDialog.vue.js +1 -1
  7. package/dist/esm/components/CnAssignDialog/CnAssignDialog.vue2.js +3 -2
  8. package/dist/esm/components/CnAssignDialog/CnAssignDialog.vue2.js.map +1 -1
  9. package/dist/esm/components/CnAssignDialog/CnAssignDialog.vue3.js +2 -1
  10. package/dist/esm/components/CnAssignDialog/CnAssignDialog.vue3.js.map +1 -1
  11. package/dist/esm/components/CnBoardView/CnBoardView.vue.js +1 -1
  12. package/dist/esm/components/CnBoardView/CnBoardView.vue2.js +54 -5
  13. package/dist/esm/components/CnBoardView/CnBoardView.vue2.js.map +1 -1
  14. package/dist/esm/components/CnBoardView/CnBoardView.vue3.js +16 -2
  15. package/dist/esm/components/CnBoardView/CnBoardView.vue3.js.map +1 -1
  16. package/dist/esm/components/CnCardGrid/CnCardGrid.vue.js +1 -1
  17. package/dist/esm/components/CnCardGrid/CnCardGrid.vue2.js +10 -0
  18. package/dist/esm/components/CnCardGrid/CnCardGrid.vue2.js.map +1 -1
  19. package/dist/esm/components/CnCardGrid/CnCardGrid.vue3.js +2 -1
  20. package/dist/esm/components/CnCardGrid/CnCardGrid.vue3.js.map +1 -1
  21. package/dist/esm/components/CnCellRenderer/CnCellRenderer.vue.js +1 -1
  22. package/dist/esm/components/CnCellRenderer/CnCellRenderer.vue2.js +22 -2
  23. package/dist/esm/components/CnCellRenderer/CnCellRenderer.vue2.js.map +1 -1
  24. package/dist/esm/components/CnCellRenderer/CnCellRenderer.vue3.js +17 -3
  25. package/dist/esm/components/CnCellRenderer/CnCellRenderer.vue3.js.map +1 -1
  26. package/dist/esm/components/CnChartWidget/CnChartWidget.vue.js +1 -1
  27. package/dist/esm/components/CnChartWidget/CnChartWidget.vue2.js.map +1 -1
  28. package/dist/esm/components/CnChartWidget/CnChartWidget.vue3.js.map +1 -1
  29. package/dist/esm/components/CnDetailPage/CnDetailPage.vue2.js +32 -8
  30. package/dist/esm/components/CnDetailPage/CnDetailPage.vue2.js.map +1 -1
  31. package/dist/esm/components/CnDetailPage/CnDetailPage.vue3.js +31 -3
  32. package/dist/esm/components/CnDetailPage/CnDetailPage.vue3.js.map +1 -1
  33. package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHost.vue.js +1 -1
  34. package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHost.vue2.js +48 -11
  35. package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHost.vue2.js.map +1 -1
  36. package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHost.vue3.js +160 -97
  37. package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHost.vue3.js.map +1 -1
  38. package/dist/esm/components/CnFormDialog/CnFormDialog.vue.js +1 -1
  39. package/dist/esm/components/CnFormDialog/CnFormDialog.vue2.js.map +1 -1
  40. package/dist/esm/components/CnFormDialog/CnFormDialog.vue3.js +2 -2
  41. package/dist/esm/components/CnFormDialog/CnFormDialog.vue3.js.map +1 -1
  42. package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js +166 -2
  43. package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js.map +1 -1
  44. package/dist/esm/components/CnIndexPage/CnIndexPage.vue3.js +19 -4
  45. package/dist/esm/components/CnIndexPage/CnIndexPage.vue3.js.map +1 -1
  46. package/dist/esm/components/CnNcDashboardList/CnNcDashboardList.vue.js +1 -1
  47. package/dist/esm/components/CnNcDashboardList/CnNcDashboardList.vue2.js +21 -1
  48. package/dist/esm/components/CnNcDashboardList/CnNcDashboardList.vue2.js.map +1 -1
  49. package/dist/esm/components/CnNcDashboardList/CnNcDashboardList.vue3.js.map +1 -1
  50. package/dist/esm/components/CnObjectCard/CnObjectCard.vue.js +1 -1
  51. package/dist/esm/components/CnObjectCard/CnObjectCard.vue2.js +36 -2
  52. package/dist/esm/components/CnObjectCard/CnObjectCard.vue2.js.map +1 -1
  53. package/dist/esm/components/CnObjectCard/CnObjectCard.vue3.js +44 -5
  54. package/dist/esm/components/CnObjectCard/CnObjectCard.vue3.js.map +1 -1
  55. package/dist/esm/components/CnPartyPicker/CnPartyPicker.vue.js +1 -0
  56. package/dist/esm/components/CnPartyPicker/CnPartyPicker.vue.js.map +1 -1
  57. package/dist/esm/components/CnPartyPicker/CnPartyPicker.vue2.js +22 -2
  58. package/dist/esm/components/CnPartyPicker/CnPartyPicker.vue2.js.map +1 -1
  59. package/dist/esm/components/CnPartyPicker/CnPartyPicker.vue3.js +36 -16
  60. package/dist/esm/components/CnPartyPicker/CnPartyPicker.vue3.js.map +1 -1
  61. package/dist/esm/components/CnSearchSelect/CnSearchSelect.vue.js +1 -1
  62. package/dist/esm/components/CnSearchSelect/CnSearchSelect.vue2.js.map +1 -1
  63. package/dist/esm/components/CnSearchSelect/CnSearchSelect.vue3.js.map +1 -1
  64. package/dist/esm/composables/useRefLabels.js +26 -6
  65. package/dist/esm/composables/useRefLabels.js.map +1 -1
  66. package/dist/esm/integrations/registry.js +4 -0
  67. package/dist/esm/integrations/registry.js.map +1 -1
  68. package/dist/esm/l10n/en.json.js +3 -1
  69. package/dist/esm/l10n/en.json.js.map +1 -1
  70. package/dist/esm/l10n/nl.json.js +3 -1
  71. package/dist/esm/l10n/nl.json.js.map +1 -1
  72. package/dist/esm/library-style.js +1 -1
  73. package/dist/esm/nextcloud-vue.css +533 -273
  74. package/dist/esm/store/plugins/liveUpdates.js +3 -1
  75. package/dist/esm/store/plugins/liveUpdates.js.map +1 -1
  76. package/dist/esm/store/plugins/logs.js +2 -1
  77. package/dist/esm/store/plugins/logs.js.map +1 -1
  78. package/dist/esm/utils/detailActionModel.js +28 -1
  79. package/dist/esm/utils/detailActionModel.js.map +1 -1
  80. package/dist/esm/utils/fillTemplate.js +13 -5
  81. package/dist/esm/utils/fillTemplate.js.map +1 -1
  82. package/dist/esm/utils/headerFieldChips.js +21 -2
  83. package/dist/esm/utils/headerFieldChips.js.map +1 -1
  84. package/dist/esm/utils/mapList.js +26 -11
  85. package/dist/esm/utils/mapList.js.map +1 -1
  86. package/dist/esm/utils/savedViewMenu.js +12 -5
  87. package/dist/esm/utils/savedViewMenu.js.map +1 -1
  88. package/dist/esm/utils/validateManifestV2.compiled.js +3 -3
  89. package/dist/esm/utils/validateManifestV2.compiled.js.map +1 -1
  90. package/dist/nextcloud-vue.cjs.js +2562 -1886
  91. package/dist/nextcloud-vue.cjs.js.map +2 -2
  92. package/dist/nextcloud-vue.css +533 -273
  93. package/l10n/en.json +3 -1
  94. package/l10n/nl.json +3 -1
  95. package/package.json +1 -1
  96. package/src/components/CnActionDialog/CnActionDialog.vue +32 -9
  97. package/src/components/CnAssignDialog/CnAssignDialog.vue +4 -2
  98. package/src/components/CnBoardView/CnBoardView.vue +58 -5
  99. package/src/components/CnCardGrid/CnCardGrid.md +1 -0
  100. package/src/components/CnCardGrid/CnCardGrid.vue +11 -0
  101. package/src/components/CnCellRenderer/CnCellRenderer.vue +27 -3
  102. package/src/components/CnChartWidget/CnChartWidget.vue +6 -0
  103. package/src/components/CnDetailPage/CnDetailPage.vue +42 -9
  104. package/src/components/CnDetailWidgetHost/CnDetailWidgetHost.vue +100 -5
  105. package/src/components/CnFormDialog/CnFormDialog.vue +1 -1
  106. package/src/components/CnIndexPage/CnIndexPage.vue +174 -4
  107. package/src/components/CnNcDashboardList/CnNcDashboardList.vue +21 -1
  108. package/src/components/CnObjectCard/CnObjectCard.md +1 -0
  109. package/src/components/CnObjectCard/CnObjectCard.vue +51 -5
  110. package/src/components/CnPartyPicker/CnPartyPicker.vue +62 -16
  111. package/src/components/CnSearchSelect/CnSearchSelect.vue +8 -0
  112. package/src/composables/useRefLabels.js +25 -5
  113. package/src/css/dialog.css +53 -3
  114. package/src/css/index-page.css +26 -1
  115. package/src/css/look-board-detail.css +36 -15
  116. package/src/css/look-board-index.css +69 -3
  117. package/src/css/look-board.css +30 -2
  118. package/src/integrations/registry.js +4 -0
  119. package/src/schemas/app-manifest-v2.schema.json +11 -5
  120. package/src/store/plugins/liveUpdates.js +3 -1
  121. package/src/store/plugins/logs.js +2 -1
  122. package/src/utils/detailActionModel.js +27 -0
  123. package/src/utils/fillTemplate.js +13 -5
  124. package/src/utils/headerFieldChips.js +21 -2
  125. package/src/utils/mapList.js +26 -11
  126. package/src/utils/savedViewMenu.js +12 -5
  127. package/src/utils/validateManifestV2.compiled.js +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"CnAssignDialog.vue3.js","sources":["../../../../src/components/CnAssignDialog/CnAssignDialog.vue?vue&type=template&id=9921b726&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(config.title) || t('nextcloud-vue', 'Assign')\"\n\t\t:eyebrow=\"fill(config.eyebrow)\"\n\t\t:subtitle=\"text(config.subtitle)\"\n\t\twidth=\"form\"\n\t\t:noClose=\"busy\"\n\t\tdata-testid=\"cn-assign-dialog\"\n\t\t@closing=\"close\">\n\t\t<div v-if=\"!done\" class=\"cn-assign-dialog\">\n\t\t\t<div class=\"cn-assign-dialog__field\">\n\t\t\t\t<CnSearchSelect\n\t\t\t\t\t:modelValue=\"picked ? picked.id : null\"\n\t\t\t\t\t:inputId=\"assigneeId\"\n\t\t\t\t\t:inputLabel=\"assigneeLabel\"\n\t\t\t\t\t:labelOutside=\"true\"\n\t\t\t\t\t:options=\"shownOptions\"\n\t\t\t\t\t:loading=\"searching\"\n\t\t\t\t\t:filterable=\"false\"\n\t\t\t\t\t:placeholder=\"text(assigneeConfig.placeholder)\"\n\t\t\t\t\tdata-testid=\"cn-assign-dialog-assignee\"\n\t\t\t\t\t@search=\"onSearch\"\n\t\t\t\t\t@update:modelValue=\"onPick\" />\n\t\t\t\t<span v-if=\"assigneeHint\" class=\"cn-assign-dialog__hint\">{{ assigneeHint }}</span>\n\t\t\t</div>\n\n\t\t\t<div v-if=\"config.note !== false\" class=\"cn-assign-dialog__field\">\n\t\t\t\t<NcTextArea\n\t\t\t\t\t:id=\"noteId\"\n\t\t\t\t\tv-model=\"note\"\n\t\t\t\t\t:label=\"noteLabel\"\n\t\t\t\t\t:labelOutside=\"false\"\n\t\t\t\t\tresize=\"vertical\"\n\t\t\t\t\tdata-testid=\"cn-assign-dialog-note\" />\n\t\t\t\t<span v-if=\"noteConfig.hint\" class=\"cn-assign-dialog__hint\">{{ text(noteConfig.hint) }}</span>\n\t\t\t</div>\n\n\t\t\t<div v-for=\"toggle in toggles\"\n\t\t\t\t:key=\"toggle.field\"\n\t\t\t\tclass=\"cn-assign-dialog__toggle\"\n\t\t\t\t:class=\"{ 'cn-assign-dialog__toggle--on': flags[toggle.field] }\"\n\t\t\t\t:data-testid=\"`cn-assign-dialog-toggle-${toggle.field}`\">\n\t\t\t\t<NcCheckboxRadioSwitch :modelValue=\"flags[toggle.field] === true\" @update:modelValue=\"flags[toggle.field] = $event\">\n\t\t\t\t\t<span class=\"cn-assign-dialog__toggle-title\">{{ text(toggle.label) }}</span>\n\t\t\t\t</NcCheckboxRadioSwitch>\n\t\t\t\t<span v-if=\"toggle.note\" class=\"cn-assign-dialog__hint cn-assign-dialog__toggle-note\">{{ text(toggle.note) }}</span>\n\t\t\t</div>\n\n\t\t\t<p v-if=\"refusal\"\n\t\t\t\tclass=\"cn-assign-dialog__error\"\n\t\t\t\trole=\"alert\"\n\t\t\t\tdata-testid=\"cn-assign-dialog-refusal\">\n\t\t\t\t{{ refusal }}\n\t\t\t</p>\n\t\t</div>\n\n\t\t<p v-else role=\"status\" data-testid=\"cn-assign-dialog-done\">\n\t\t\t{{ text(config.doneText) || t('nextcloud-vue', 'Done') }}\n\t\t</p>\n\n\t\t<template #actions>\n\t\t\t<NcButton :disabled=\"busy\" data-testid=\"cn-assign-dialog-cancel\" @click=\"close\">\n\t\t\t\t{{ done ? t('nextcloud-vue', 'Close') : t('nextcloud-vue', 'Cancel') }}\n\t\t\t</NcButton>\n\t\t\t<NcButton v-if=\"!done\"\n\t\t\t\tvariant=\"primary\"\n\t\t\t\t:disabled=\"!canConfirm\"\n\t\t\t\tdata-testid=\"cn-assign-dialog-confirm\"\n\t\t\t\t@click=\"confirm\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<CnIcon :name=\"confirmConfig.icon || 'SwapHorizontal'\" :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\t{{ text(confirmConfig.label) || t('nextcloud-vue', 'Assign') }}\n\t\t\t</NcButton>\n\t\t</template>\n\t</CnDialog>\n</template>\n\n<script>\nimport axios from '@nextcloud/axios'\nimport { emit } from '@nextcloud/event-bus'\nimport { translate as t } from '@nextcloud/l10n'\nimport { generateUrl } from '@nextcloud/router'\nimport { NcButton, NcCheckboxRadioSwitch, NcTextArea } from '@nextcloud/vue'\nimport { fetchEndpointSource, interpolateUrlTokens } from '../../composables/useEndpointSource.js'\nimport { fillTemplate } from '../../utils/fillTemplate.js'\nimport { readPath } from '../../utils/readPath.js'\nimport { searchNextcloudGroups, searchNextcloudUsers } from '../../utils/userAutocomplete.js'\nimport { CnDialog } from '../CnDialog/index.js'\nimport { CnIcon } from '../CnIcon/index.js'\nimport { CnSearchSelect } from '../CnSearchSelect/index.js'\n\n/** The page refresh channel the built-in widgets listen on. */\nconst PAGE_REFRESH = 'cn:page:refresh'\n\n/** How long typing rests before a search runs, in ms. */\nconst SEARCH_DELAY = 250\n\n/** Gives each dialog's fields their own ids. */\nlet fieldSeq = 0\n\n/**\n * The found rows, with what was typed offered as an assignee of its own when\n * no row carries that id or name: where sharing is restricted the search\n * answers nothing, and an endpoint may still take the name.\n *\n * @param {Array<object>} found The rows found.\n * @param {string} typed What was typed.\n * @param {string} label The typed row's label.\n * @return {Array<object>} The rows.\n */\nexport function withTypedAssignee(found, typed, label) {\n\tconst lower = typed.toLowerCase()\n\tif (typed === '' || found.some((row) => String(row.id) === typed || String(row.label).toLowerCase() === lower)) {\n\t\treturn found\n\t}\n\treturn [...found, { id: typed, label, icon: 'AccountGroupOutline', kind: 'typed' }]\n}\n\n/**\n * CnAssignDialog — hand a record to another user or team, with a note and\n * optional switches, configured from the manifest (an `open-modal` action's\n * props). dossiq's case handover (board DqOverdragen: new team, why it moves,\n * \"this is a doorzending (Awb 2:3)\") is the first; pipelinq tickets and bulk\n * reassignment use the same dialog.\n *\n * `config`:\n * - `title`, `subtitle`, `doneText`: texts, through the host translate;\n * `eyebrow` a template filled from the record.\n * - `source`: an endpointSource to read the record from, else `object`.\n * - `assignee`: `{ kinds?, label?, placeholder?, hint?, currentPath?,\n * currentHint?, currentAs?, allowTyped?, field?, kindField? }`. `kinds` is `[\"group\"]`\n * (default), `[\"user\"]` or both; `currentPath` reads who has it now from the\n * record and `currentHint` (\"Now with {current}.\", the placeholder named\n * by `currentAs`) says so, in place of `hint`; `allowTyped`\n * offers what was typed as a choice; the id is sent as `field` (default\n * `assignee`) and its kind as `kindField` when set.\n * - `note`: `{ label?, hint?, required?, field? }`, required by default and\n * sent as `field` (default `note`); `false` drops it.\n * - `toggles`: `[{ field, label, note? }]`: switches that start off and are\n * sent as booleans.\n * - `confirm`: `{ label?, icon?, request?: { method?, url, body? }, action? }`.\n * `request` sends the choice itself (`body` templates filled from the\n * record); `action` dispatches a manifest action with the choice as its\n * last argument.\n *\n * Tokens (`@objectId`, `@object.<field>`) resolve in every url. A refusal is\n * shown in the server's own words and the dialog stays open.\n */\nexport default {\n\tname: 'CnAssignDialog',\n\n\tcomponents: { CnDialog, CnIcon, CnSearchSelect, NcButton, NcCheckboxRadioSwitch, NcTextArea },\n\n\tinject: {\n\t\t/** The host app's translate (CnAppRoot `cnTranslate`). */\n\t\tcnTranslate: { default: () => (key) => key },\n\t\t/** The page's pre-bound action dispatcher (CnPageRenderer), for `confirm.action`. */\n\t\tcnDispatchAction: { default: null },\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * The dialog's configuration (see the component docs).\n\t\t *\n\t\t * @type {object}\n\t\t */\n\t\tconfig: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({}),\n\t\t},\n\n\t\t/** The record's id, for the `@objectId` token. */\n\t\tobjectId: {\n\t\t\ttype: [String, Number],\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * The record, when the host has it.\n\t\t *\n\t\t * @type {object|null}\n\t\t */\n\t\tobject: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\t},\n\n\temits: ['close', 'done'],\n\n\tdata() {\n\t\tconst seq = ++fieldSeq\n\t\tconst flags = {}\n\t\tfor (const toggle of Array.isArray(this.config.toggles) ? this.config.toggles : []) {\n\t\t\tif (toggle && toggle.field) {\n\t\t\t\tflags[toggle.field] = false\n\t\t\t}\n\t\t}\n\t\treturn {\n\t\t\trecord: this.object,\n\t\t\toptions: [],\n\t\t\tpicked: null,\n\t\t\tsearching: false,\n\t\t\ttimer: null,\n\t\t\tsearchSeq: 0,\n\t\t\tnote: '',\n\t\t\tflags,\n\t\t\tbusy: false,\n\t\t\trefusal: '',\n\t\t\tdone: false,\n\t\t\tassigneeId: `cn-assign-dialog-assignee-${seq}`,\n\t\t\tnoteId: `cn-assign-dialog-note-${seq}`,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/** @return {object} The token context. */\n\t\ttokenCtx() {\n\t\t\treturn { objectId: this.recordId, object: this.record || {} }\n\t\t},\n\n\t\t/**\n\t\t * The record's id: `objectId`, or the route's `id` when the prop is\n\t\t * empty or a token the opener could not resolve.\n\t\t *\n\t\t * @return {string|number}\n\t\t */\n\t\trecordId() {\n\t\t\tconst given = this.objectId\n\t\t\tif (given !== '' && given !== null && given !== undefined && !String(given).startsWith('@')) {\n\t\t\t\treturn given\n\t\t\t}\n\t\t\treturn (this.$route && this.$route.params && this.$route.params.id) || ''\n\t\t},\n\n\t\t/** @return {object} The assignee config. */\n\t\tassigneeConfig() {\n\t\t\treturn this.config.assignee && typeof this.config.assignee === 'object' ? this.config.assignee : {}\n\t\t},\n\n\t\t/** @return {object} The note config. */\n\t\tnoteConfig() {\n\t\t\treturn this.config.note && typeof this.config.note === 'object' ? this.config.note : {}\n\t\t},\n\n\t\t/** @return {object} The confirm config. */\n\t\tconfirmConfig() {\n\t\t\treturn this.config.confirm && typeof this.config.confirm === 'object' ? this.config.confirm : {}\n\t\t},\n\n\t\t/** @return {Array<object>} The switches with a field. */\n\t\ttoggles() {\n\t\t\treturn (Array.isArray(this.config.toggles) ? this.config.toggles : []).filter((toggle) => toggle && toggle.field)\n\t\t},\n\n\t\t/** @return {string[]} The kinds searched: `group`, `user`. */\n\t\tkinds() {\n\t\t\tconst kinds = Array.isArray(this.assigneeConfig.kinds) ? this.assigneeConfig.kinds.filter((k) => k === 'group' || k === 'user') : []\n\t\t\treturn kinds.length ? kinds : ['group']\n\t\t},\n\n\t\t/** @return {string} The assignee field's label. */\n\t\tassigneeLabel() {\n\t\t\tif (this.assigneeConfig.label) {\n\t\t\t\treturn this.text(this.assigneeConfig.label)\n\t\t\t}\n\t\t\treturn this.kinds.length === 1 && this.kinds[0] === 'user' ? t('nextcloud-vue', 'New handler') : t('nextcloud-vue', 'New team')\n\t\t},\n\n\t\t/** @return {string} Who has the record now, read from it. */\n\t\tcurrent() {\n\t\t\tconst path = this.assigneeConfig.currentPath\n\t\t\tconst value = path && this.record ? readPath(this.record, path) : ''\n\t\t\treturn value === undefined || value === null ? '' : String(value)\n\t\t},\n\n\t\t/**\n\t\t * The hint under the assignee field: who has it now, else the configured hint.\n\t\t *\n\t\t * @spec openspec/changes/assign-dialog/specs/assign-dialog/spec.md#requirement-a-manifest-configures-an-assign-dialog\n\t\t * @return {string}\n\t\t */\n\t\tassigneeHint() {\n\t\t\tconst name = this.assigneeConfig.currentAs || 'current'\n\t\t\tconst now = this.current && this.assigneeConfig.currentHint ? fillTemplate(this.cnTranslate(this.assigneeConfig.currentHint), { [name]: this.current }) : ''\n\t\t\treturn now || this.text(this.assigneeConfig.hint)\n\t\t},\n\n\t\t/** @return {Array<object>} The rows, keeping the picked one listed. */\n\t\tshownOptions() {\n\t\t\tif (this.picked && !this.options.some((o) => String(o.id) === String(this.picked.id))) {\n\t\t\t\treturn [this.picked, ...this.options]\n\t\t\t}\n\t\t\treturn this.options\n\t\t},\n\n\t\t/** @return {boolean} Whether a note is asked and needed. */\n\t\tnoteNeeded() {\n\t\t\treturn this.config.note !== false && this.noteConfig.required !== false\n\t\t},\n\n\t\t/** @return {string} The note field's label. */\n\t\tnoteLabel() {\n\t\t\treturn this.text(this.noteConfig.label) || t('nextcloud-vue', 'Why it is moving')\n\t\t},\n\n\t\t/**\n\t\t * Whether the assignment may run: an assignee, a note when needed, nothing in flight.\n\t\t *\n\t\t * @spec openspec/changes/assign-dialog/specs/assign-dialog/spec.md#requirement-a-manifest-configures-an-assign-dialog\n\t\t * @return {boolean}\n\t\t */\n\t\tcanConfirm() {\n\t\t\treturn !this.busy && this.picked !== null && (!this.noteNeeded || this.note.trim() !== '')\n\t\t},\n\t},\n\n\tasync mounted() {\n\t\tconst source = this.config.source\n\t\tif (source && source.url) {\n\t\t\ttry {\n\t\t\t\tconst data = await fetchEndpointSource(source, this.tokenCtx, { fresh: true })\n\t\t\t\tthis.record = data && typeof data === 'object' ? data : this.record\n\t\t\t} catch {\n\t\t\t\t// The hint stays without the current assignee; the dialog still works.\n\t\t\t}\n\t\t}\n\t},\n\n\tbeforeUnmount() {\n\t\tclearTimeout(this.timer)\n\t},\n\n\tmethods: {\n\t\tt,\n\n\t\t/**\n\t\t * A config text through the host translate, '' for anything else.\n\t\t *\n\t\t * @param {unknown} value The text.\n\t\t * @return {string}\n\t\t */\n\t\ttext(value) {\n\t\t\treturn typeof value === 'string' && value !== '' ? this.cnTranslate(value) : ''\n\t\t},\n\n\t\t/**\n\t\t * A template filled from the record, translated first.\n\t\t *\n\t\t * @param {unknown} template The template.\n\t\t * @return {string}\n\t\t */\n\t\tfill(template) {\n\t\t\tif (typeof template !== 'string' || template === '') {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\treturn fillTemplate(this.cnTranslate(template), this.record || {}).trim()\n\t\t},\n\n\t\t/**\n\t\t * Search after typing rests.\n\t\t *\n\t\t * @param {string} query What was typed.\n\t\t */\n\t\tonSearch(query) {\n\t\t\tclearTimeout(this.timer)\n\t\t\tconst typed = String(query ?? '').trim()\n\t\t\tif (typed === '') {\n\t\t\t\tthis.options = []\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.timer = setTimeout(() => this.search(typed), SEARCH_DELAY)\n\t\t},\n\n\t\t/**\n\t\t * Search the configured kinds; offer what was typed when allowed.\n\t\t *\n\t\t * @spec openspec/changes/assign-dialog/specs/assign-dialog/spec.md#requirement-a-manifest-configures-an-assign-dialog\n\t\t * @param {string} typed What was typed.\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync search(typed) {\n\t\t\tconst seq = ++this.searchSeq\n\t\t\tthis.searching = true\n\t\t\tconst [groups, users] = await Promise.all([\n\t\t\t\tthis.kinds.includes('group') ? searchNextcloudGroups(typed, { limit: 20 }) : [],\n\t\t\t\tthis.kinds.includes('user') ? searchNextcloudUsers(typed, { limit: 20 }) : [],\n\t\t\t])\n\t\t\tif (seq !== this.searchSeq) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst found = [\n\t\t\t\t...groups.map((g) => ({ id: g.id, label: g.label, secondary: g.subline || '', icon: 'AccountGroupOutline', kind: 'group' })),\n\t\t\t\t...users.map((u) => ({ id: u.id, label: u.label, secondary: u.subline || '', avatar: true, kind: 'user' })),\n\t\t\t]\n\t\t\tthis.options = this.assigneeConfig.allowTyped ? withTypedAssignee(found, typed, t('nextcloud-vue', 'Use \"{name}\"', { name: typed })) : found\n\t\t\tthis.searching = false\n\t\t},\n\n\t\t/**\n\t\t * Take the picked row.\n\t\t *\n\t\t * @param {string|null} id The picked id.\n\t\t */\n\t\tonPick(id) {\n\t\t\tthis.picked = id === null ? null : (this.shownOptions.find((o) => String(o.id) === String(id)) || null)\n\t\t},\n\n\t\t/**\n\t\t * The choice as sent: assignee, its kind, the note and the switches.\n\t\t *\n\t\t * @return {object}\n\t\t */\n\t\tchoice() {\n\t\t\tconst out = { [this.assigneeConfig.field || 'assignee']: String(this.picked.id) }\n\t\t\tif (this.assigneeConfig.kindField) {\n\t\t\t\tout[this.assigneeConfig.kindField] = this.picked.kind === 'typed' ? this.kinds[0] : this.picked.kind\n\t\t\t}\n\t\t\tif (this.config.note !== false) {\n\t\t\t\tout[this.noteConfig.field || 'note'] = this.note.trim()\n\t\t\t}\n\t\t\treturn { ...out, ...this.flags }\n\t\t},\n\n\t\t/**\n\t\t * Assign once: send `confirm.request`, or dispatch `confirm.action`,\n\t\t * then show the done text and refresh the page.\n\t\t *\n\t\t * @spec openspec/changes/assign-dialog/specs/assign-dialog/spec.md#requirement-a-manifest-configures-an-assign-dialog\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync confirm() {\n\t\t\tif (!this.canConfirm) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.busy = true\n\t\t\tthis.refusal = ''\n\t\t\tconst choice = this.choice()\n\t\t\ttry {\n\t\t\t\tconst request = this.confirmConfig.request\n\t\t\t\tif (request && request.url) {\n\t\t\t\t\tconst url = interpolateUrlTokens(request.url, this.tokenCtx)\n\t\t\t\t\tconst body = {}\n\t\t\t\t\tfor (const [key, value] of Object.entries(request.body || {})) {\n\t\t\t\t\t\tbody[key] = typeof value === 'string' ? fillTemplate(value, this.record || {}) : value\n\t\t\t\t\t}\n\t\t\t\t\tconst method = String(request.method || 'POST').toLowerCase()\n\t\t\t\t\tawait axios[['post', 'put', 'patch'].includes(method) ? method : 'post'](/^https?:\\/\\//i.test(url) ? url : generateUrl(url), { ...body, ...choice })\n\t\t\t\t} else if (this.confirmConfig.action && typeof this.cnDispatchAction === 'function') {\n\t\t\t\t\tawait this.cnDispatchAction({ ...this.confirmConfig.action, args: [...(this.confirmConfig.action.args || []), choice] })\n\t\t\t\t}\n\t\t\t\tthis.done = true\n\t\t\t\temit(PAGE_REFRESH, {})\n\t\t\t\t/** @event done The assignment ran. Payload: the choice as sent. */\n\t\t\t\tthis.$emit('done', choice)\n\t\t\t} catch (failure) {\n\t\t\t\tconst data = failure && failure.response && failure.response.data\n\t\t\t\tthis.refusal = String((data && (data.message || data.error)) || t('nextcloud-vue', 'It was not handed over.'))\n\t\t\t} finally {\n\t\t\t\tthis.busy = false\n\t\t\t}\n\t\t},\n\n\t\t/** Close the dialog, unless the assignment is running. */\n\t\tclose() {\n\t\t\tif (this.busy) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\t/** @event close The dialog was closed. */\n\t\t\tthis.$emit('close')\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-assign-dialog {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 18px;\n}\n\n.cn-assign-dialog__field {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 6px;\n}\n\n.cn-assign-dialog__hint {\n\tfont-size: 13px;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-assign-dialog__toggle {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 2px;\n\tpadding: 12px 14px;\n\tborder: 1px solid var(--color-border-dark);\n\tborder-radius: var(--border-radius-large, 8px);\n}\n\n.cn-assign-dialog__toggle--on {\n\tborder: 2px solid var(--color-primary-element);\n\tbackground: var(--color-primary-element-light);\n}\n\n.cn-assign-dialog__toggle-title {\n\tfont-weight: 600;\n}\n\n.cn-assign-dialog__toggle-note {\n\tpadding-inline-start: 44px;\n}\n\n.cn-assign-dialog__error {\n\tmargin: 0;\n\tcolor: var(--color-error-text, var(--color-error));\n}\n</style>\n"],"names":["_createVNode","_createBlock","_createTextVNode","_openBlock","_createElementBlock","_toDisplayString","_Fragment","_renderList"],"mappings":";;;;AAiBoB,EAAA,KAAK,EAAA,kBAAA;;AACjB,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,yBAAiB,GAAA;;;AAajB,EAAA,KAAA,EAAA,wBAAA;;;;AAGQ,EAAA,KAAA,EAAA,yBAAA;;;;AAQA,EAAA,KAAA,EAAA,wBAAA;;;;;;AAWO,EAAA,KAAK,EAAA,sDAAA;;;;AAI9B,EAAA,KAAE,EAAA,yBAAA;AACF,EAAA,IAAG,EAAA,OAAA;;;;;AAMK,EAAA,IAAI,EAAC,QAAG;AAAA,EAAA,aAAA,EAAA,uBAAA;;;;;;;;;;;;AAtDjB,IAAA,IAAI,EAAE,QAAI,CAAA,IAAA,CAAC,aAAE,CAAA,KAAA,KAAA,QAAA,CAAA,CAAA,CAAA,eAAA,EAAA,QAAA,CAAA;AACb,IAAA,OAAO,EAAE,QAAA,CAAA,IAAI,CAAC,MAAA,CAAA,MAAM,CAAC,OAAO,CAAA;AAC5B,IAAA,QAAQ,EAAE,QAAA,CAAA,IAAI,CAAC,MAAA,CAAA,MAAA,CAAA,QAAA,CAAA;AAChB,IAAA,KAAK,EAAC,MAAM;AACX,IAAA,OAAO,EAAE,KAAI,CAAA,IAAA;AACZ,IAAA,aAAS,EAAC,kBAAI;AACb,IAAA,SAAK,EAAE,QAAK,CAAA,KAAA;;AAoDJ,IAAA,OAAO,UAChB,MAEU;MAFVA,WAEU,CAAA,mBAAA,EAAA;AAFA,QAAA,QAAM,EAAA,KAAA,CAAA,IAAA;AAAA,QAAA,aAAA,EAAA,yBAAA;AAAA,QAAA,OAAA,EAAA,QAAA,CAAA,KAAA;;yBAChB,MAAsB;0CAAnB,KAAI,CAAA,IAAA,GAAG,QAAC,CAAA,CAAA,CAAA,eAAA,EAAA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A,EAAA,EAAAC,kBAAA,CAA8B,QAA9B,UAA8B,EAAAC,eAAA,CAAA,aAAA,CAAA,MAAA,CAAA,IAAA,CAAA,CAAA,EAAA,CAAA,YAAA;;;;aAGtB,KAAI,CAAA,OAAA;gDAKT,CAAA,GAAA,YAAA,EAAAA,eAAA,CADA,KAAO,CAAA,OAAA,CAAA,EAAA,CAAA,YAAA;;;wBAIZD,kBAEK,CAAA,GAAA,EAFL,WAEK,EADDC,eAAA,CAAA,QAAA,CAAA,IAAI,CAAC,MAAM,CAAA,MAAA,CAAC,QAAQ,CAAA,IAAK,QAAC,CAAA,CAAA,CAAA,eAAA,EAAA,MAAA,CAAA,CAAA,EAAA,CAAA,YAAA,CAAA;;;;;;;;"}
1
+ {"version":3,"file":"CnAssignDialog.vue3.js","sources":["../../../../src/components/CnAssignDialog/CnAssignDialog.vue?vue&type=template&id=45153be8&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(config.title) || t('nextcloud-vue', 'Assign')\"\n\t\t:eyebrow=\"fill(config.eyebrow)\"\n\t\t:subtitle=\"text(config.subtitle)\"\n\t\twidth=\"form\"\n\t\t:noClose=\"busy\"\n\t\tdata-testid=\"cn-assign-dialog\"\n\t\t@closing=\"close\">\n\t\t<div v-if=\"!done\" class=\"cn-assign-dialog\">\n\t\t\t<div class=\"cn-assign-dialog__field\">\n\t\t\t\t<CnSearchSelect\n\t\t\t\t\t:modelValue=\"picked ? picked.id : null\"\n\t\t\t\t\t:inputId=\"assigneeId\"\n\t\t\t\t\t:inputLabel=\"assigneeLabel\"\n\t\t\t\t\t:labelOutside=\"true\"\n\t\t\t\t\t:options=\"shownOptions\"\n\t\t\t\t\t:loading=\"searching\"\n\t\t\t\t\t:filterable=\"false\"\n\t\t\t\t\t:placeholder=\"text(assigneeConfig.placeholder)\"\n\t\t\t\t\tdata-testid=\"cn-assign-dialog-assignee\"\n\t\t\t\t\t@search=\"onSearch\"\n\t\t\t\t\t@update:modelValue=\"onPick\" />\n\t\t\t\t<span v-if=\"assigneeHint\" class=\"cn-assign-dialog__hint\">{{ assigneeHint }}</span>\n\t\t\t</div>\n\n\t\t\t<div v-if=\"config.note !== false\" class=\"cn-assign-dialog__field\">\n\t\t\t\t<NcTextArea\n\t\t\t\t\t:id=\"noteId\"\n\t\t\t\t\tv-model=\"note\"\n\t\t\t\t\t:label=\"noteLabel\"\n\t\t\t\t\t:labelOutside=\"false\"\n\t\t\t\t\t:rows=\"noteConfig.rows || 3\"\n\t\t\t\t\tresize=\"vertical\"\n\t\t\t\t\tdata-testid=\"cn-assign-dialog-note\" />\n\t\t\t\t<span v-if=\"noteConfig.hint\" class=\"cn-assign-dialog__hint\">{{ text(noteConfig.hint) }}</span>\n\t\t\t</div>\n\n\t\t\t<div v-for=\"toggle in toggles\"\n\t\t\t\t:key=\"toggle.field\"\n\t\t\t\tclass=\"cn-assign-dialog__toggle\"\n\t\t\t\t:class=\"{ 'cn-assign-dialog__toggle--on': flags[toggle.field] }\"\n\t\t\t\t:data-testid=\"`cn-assign-dialog-toggle-${toggle.field}`\">\n\t\t\t\t<NcCheckboxRadioSwitch :modelValue=\"flags[toggle.field] === true\" @update:modelValue=\"flags[toggle.field] = $event\">\n\t\t\t\t\t<span class=\"cn-assign-dialog__toggle-title\">{{ text(toggle.label) }}</span>\n\t\t\t\t</NcCheckboxRadioSwitch>\n\t\t\t\t<span v-if=\"toggle.note\" class=\"cn-assign-dialog__hint cn-assign-dialog__toggle-note\">{{ text(toggle.note) }}</span>\n\t\t\t</div>\n\n\t\t\t<p v-if=\"refusal\"\n\t\t\t\tclass=\"cn-assign-dialog__error\"\n\t\t\t\trole=\"alert\"\n\t\t\t\tdata-testid=\"cn-assign-dialog-refusal\">\n\t\t\t\t{{ refusal }}\n\t\t\t</p>\n\t\t</div>\n\n\t\t<p v-else role=\"status\" data-testid=\"cn-assign-dialog-done\">\n\t\t\t{{ text(config.doneText) || t('nextcloud-vue', 'Done') }}\n\t\t</p>\n\n\t\t<template #actions>\n\t\t\t<NcButton :disabled=\"busy\" data-testid=\"cn-assign-dialog-cancel\" @click=\"close\">\n\t\t\t\t{{ done ? t('nextcloud-vue', 'Close') : t('nextcloud-vue', 'Cancel') }}\n\t\t\t</NcButton>\n\t\t\t<NcButton v-if=\"!done\"\n\t\t\t\tvariant=\"primary\"\n\t\t\t\t:disabled=\"!canConfirm\"\n\t\t\t\tdata-testid=\"cn-assign-dialog-confirm\"\n\t\t\t\t@click=\"confirm\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<CnIcon :name=\"confirmConfig.icon || 'SwapHorizontal'\" :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\t{{ text(confirmConfig.label) || t('nextcloud-vue', 'Assign') }}\n\t\t\t</NcButton>\n\t\t</template>\n\t</CnDialog>\n</template>\n\n<script>\nimport axios from '@nextcloud/axios'\nimport { emit } from '@nextcloud/event-bus'\nimport { translate as t } from '@nextcloud/l10n'\nimport { generateUrl } from '@nextcloud/router'\nimport { NcButton, NcCheckboxRadioSwitch, NcTextArea } from '@nextcloud/vue'\nimport { fetchEndpointSource, interpolateUrlTokens } from '../../composables/useEndpointSource.js'\nimport { fillTemplate } from '../../utils/fillTemplate.js'\nimport { readPath } from '../../utils/readPath.js'\nimport { searchNextcloudGroups, searchNextcloudUsers } from '../../utils/userAutocomplete.js'\nimport { CnDialog } from '../CnDialog/index.js'\nimport { CnIcon } from '../CnIcon/index.js'\nimport { CnSearchSelect } from '../CnSearchSelect/index.js'\n\n/** The page refresh channel the built-in widgets listen on. */\nconst PAGE_REFRESH = 'cn:page:refresh'\n\n/** How long typing rests before a search runs, in ms. */\nconst SEARCH_DELAY = 250\n\n/** Gives each dialog's fields their own ids. */\nlet fieldSeq = 0\n\n/**\n * The found rows, with what was typed offered as an assignee of its own when\n * no row carries that id or name: where sharing is restricted the search\n * answers nothing, and an endpoint may still take the name.\n *\n * @param {Array<object>} found The rows found.\n * @param {string} typed What was typed.\n * @param {string} label The typed row's label.\n * @return {Array<object>} The rows.\n */\nexport function withTypedAssignee(found, typed, label) {\n\tconst lower = typed.toLowerCase()\n\tif (typed === '' || found.some((row) => String(row.id) === typed || String(row.label).toLowerCase() === lower)) {\n\t\treturn found\n\t}\n\treturn [...found, { id: typed, label, icon: 'AccountGroupOutline', kind: 'typed' }]\n}\n\n/**\n * CnAssignDialog — hand a record to another user or team, with a note and\n * optional switches, configured from the manifest (an `open-modal` action's\n * props). dossiq's case handover (board DqOverdragen: new team, why it moves,\n * \"this is a doorzending (Awb 2:3)\") is the first; pipelinq tickets and bulk\n * reassignment use the same dialog.\n *\n * `config`:\n * - `title`, `subtitle`, `doneText`: texts, through the host translate;\n * `eyebrow` a template filled from the record.\n * - `source`: an endpointSource to read the record from, else `object`.\n * - `assignee`: `{ kinds?, label?, placeholder?, hint?, currentPath?,\n * currentHint?, currentAs?, allowTyped?, field?, kindField? }`. `kinds` is `[\"group\"]`\n * (default), `[\"user\"]` or both; `currentPath` reads who has it now from the\n * record and `currentHint` (\"Now with {current}.\", the placeholder named\n * by `currentAs`) says so, in place of `hint`; `allowTyped`\n * offers what was typed as a choice; the id is sent as `field` (default\n * `assignee`) and its kind as `kindField` when set.\n * - `note`: `{ label?, hint?, required?, field?, rows? }`, required by default and\n * sent as `field` (default `note`); `false` drops it. `rows` is the text\n * area's height in lines (default 3, as board DqOverdragen draws it).\n * - `toggles`: `[{ field, label, note? }]`: switches that start off and are\n * sent as booleans.\n * - `confirm`: `{ label?, icon?, request?: { method?, url, body? }, action? }`.\n * `request` sends the choice itself (`body` templates filled from the\n * record); `action` dispatches a manifest action with the choice as its\n * last argument.\n *\n * Tokens (`@objectId`, `@object.<field>`) resolve in every url. A refusal is\n * shown in the server's own words and the dialog stays open.\n */\nexport default {\n\tname: 'CnAssignDialog',\n\n\tcomponents: { CnDialog, CnIcon, CnSearchSelect, NcButton, NcCheckboxRadioSwitch, NcTextArea },\n\n\tinject: {\n\t\t/** The host app's translate (CnAppRoot `cnTranslate`). */\n\t\tcnTranslate: { default: () => (key) => key },\n\t\t/** The page's pre-bound action dispatcher (CnPageRenderer), for `confirm.action`. */\n\t\tcnDispatchAction: { default: null },\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * The dialog's configuration (see the component docs).\n\t\t *\n\t\t * @type {object}\n\t\t */\n\t\tconfig: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({}),\n\t\t},\n\n\t\t/** The record's id, for the `@objectId` token. */\n\t\tobjectId: {\n\t\t\ttype: [String, Number],\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * The record, when the host has it.\n\t\t *\n\t\t * @type {object|null}\n\t\t */\n\t\tobject: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\t},\n\n\temits: ['close', 'done'],\n\n\tdata() {\n\t\tconst seq = ++fieldSeq\n\t\tconst flags = {}\n\t\tfor (const toggle of Array.isArray(this.config.toggles) ? this.config.toggles : []) {\n\t\t\tif (toggle && toggle.field) {\n\t\t\t\tflags[toggle.field] = false\n\t\t\t}\n\t\t}\n\t\treturn {\n\t\t\trecord: this.object,\n\t\t\toptions: [],\n\t\t\tpicked: null,\n\t\t\tsearching: false,\n\t\t\ttimer: null,\n\t\t\tsearchSeq: 0,\n\t\t\tnote: '',\n\t\t\tflags,\n\t\t\tbusy: false,\n\t\t\trefusal: '',\n\t\t\tdone: false,\n\t\t\tassigneeId: `cn-assign-dialog-assignee-${seq}`,\n\t\t\tnoteId: `cn-assign-dialog-note-${seq}`,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/** @return {object} The token context. */\n\t\ttokenCtx() {\n\t\t\treturn { objectId: this.recordId, object: this.record || {} }\n\t\t},\n\n\t\t/**\n\t\t * The record's id: `objectId`, or the route's `id` when the prop is\n\t\t * empty or a token the opener could not resolve.\n\t\t *\n\t\t * @return {string|number}\n\t\t */\n\t\trecordId() {\n\t\t\tconst given = this.objectId\n\t\t\tif (given !== '' && given !== null && given !== undefined && !String(given).startsWith('@')) {\n\t\t\t\treturn given\n\t\t\t}\n\t\t\treturn (this.$route && this.$route.params && this.$route.params.id) || ''\n\t\t},\n\n\t\t/** @return {object} The assignee config. */\n\t\tassigneeConfig() {\n\t\t\treturn this.config.assignee && typeof this.config.assignee === 'object' ? this.config.assignee : {}\n\t\t},\n\n\t\t/** @return {object} The note config. */\n\t\tnoteConfig() {\n\t\t\treturn this.config.note && typeof this.config.note === 'object' ? this.config.note : {}\n\t\t},\n\n\t\t/** @return {object} The confirm config. */\n\t\tconfirmConfig() {\n\t\t\treturn this.config.confirm && typeof this.config.confirm === 'object' ? this.config.confirm : {}\n\t\t},\n\n\t\t/** @return {Array<object>} The switches with a field. */\n\t\ttoggles() {\n\t\t\treturn (Array.isArray(this.config.toggles) ? this.config.toggles : []).filter((toggle) => toggle && toggle.field)\n\t\t},\n\n\t\t/** @return {string[]} The kinds searched: `group`, `user`. */\n\t\tkinds() {\n\t\t\tconst kinds = Array.isArray(this.assigneeConfig.kinds) ? this.assigneeConfig.kinds.filter((k) => k === 'group' || k === 'user') : []\n\t\t\treturn kinds.length ? kinds : ['group']\n\t\t},\n\n\t\t/** @return {string} The assignee field's label. */\n\t\tassigneeLabel() {\n\t\t\tif (this.assigneeConfig.label) {\n\t\t\t\treturn this.text(this.assigneeConfig.label)\n\t\t\t}\n\t\t\treturn this.kinds.length === 1 && this.kinds[0] === 'user' ? t('nextcloud-vue', 'New handler') : t('nextcloud-vue', 'New team')\n\t\t},\n\n\t\t/** @return {string} Who has the record now, read from it. */\n\t\tcurrent() {\n\t\t\tconst path = this.assigneeConfig.currentPath\n\t\t\tconst value = path && this.record ? readPath(this.record, path) : ''\n\t\t\treturn value === undefined || value === null ? '' : String(value)\n\t\t},\n\n\t\t/**\n\t\t * The hint under the assignee field: who has it now, else the configured hint.\n\t\t *\n\t\t * @spec openspec/changes/assign-dialog/specs/assign-dialog/spec.md#requirement-a-manifest-configures-an-assign-dialog\n\t\t * @return {string}\n\t\t */\n\t\tassigneeHint() {\n\t\t\tconst name = this.assigneeConfig.currentAs || 'current'\n\t\t\tconst now = this.current && this.assigneeConfig.currentHint ? fillTemplate(this.cnTranslate(this.assigneeConfig.currentHint), { [name]: this.current }) : ''\n\t\t\treturn now || this.text(this.assigneeConfig.hint)\n\t\t},\n\n\t\t/** @return {Array<object>} The rows, keeping the picked one listed. */\n\t\tshownOptions() {\n\t\t\tif (this.picked && !this.options.some((o) => String(o.id) === String(this.picked.id))) {\n\t\t\t\treturn [this.picked, ...this.options]\n\t\t\t}\n\t\t\treturn this.options\n\t\t},\n\n\t\t/** @return {boolean} Whether a note is asked and needed. */\n\t\tnoteNeeded() {\n\t\t\treturn this.config.note !== false && this.noteConfig.required !== false\n\t\t},\n\n\t\t/** @return {string} The note field's label. */\n\t\tnoteLabel() {\n\t\t\treturn this.text(this.noteConfig.label) || t('nextcloud-vue', 'Why it is moving')\n\t\t},\n\n\t\t/**\n\t\t * Whether the assignment may run: an assignee, a note when needed, nothing in flight.\n\t\t *\n\t\t * @spec openspec/changes/assign-dialog/specs/assign-dialog/spec.md#requirement-a-manifest-configures-an-assign-dialog\n\t\t * @return {boolean}\n\t\t */\n\t\tcanConfirm() {\n\t\t\treturn !this.busy && this.picked !== null && (!this.noteNeeded || this.note.trim() !== '')\n\t\t},\n\t},\n\n\tasync mounted() {\n\t\tconst source = this.config.source\n\t\tif (source && source.url) {\n\t\t\ttry {\n\t\t\t\tconst data = await fetchEndpointSource(source, this.tokenCtx, { fresh: true })\n\t\t\t\tthis.record = data && typeof data === 'object' ? data : this.record\n\t\t\t} catch {\n\t\t\t\t// The hint stays without the current assignee; the dialog still works.\n\t\t\t}\n\t\t}\n\t},\n\n\tbeforeUnmount() {\n\t\tclearTimeout(this.timer)\n\t},\n\n\tmethods: {\n\t\tt,\n\n\t\t/**\n\t\t * A config text through the host translate, '' for anything else.\n\t\t *\n\t\t * @param {unknown} value The text.\n\t\t * @return {string}\n\t\t */\n\t\ttext(value) {\n\t\t\treturn typeof value === 'string' && value !== '' ? this.cnTranslate(value) : ''\n\t\t},\n\n\t\t/**\n\t\t * A template filled from the record, translated first.\n\t\t *\n\t\t * @param {unknown} template The template.\n\t\t * @return {string}\n\t\t */\n\t\tfill(template) {\n\t\t\tif (typeof template !== 'string' || template === '') {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\treturn fillTemplate(this.cnTranslate(template), this.record || {}).trim()\n\t\t},\n\n\t\t/**\n\t\t * Search after typing rests.\n\t\t *\n\t\t * @param {string} query What was typed.\n\t\t */\n\t\tonSearch(query) {\n\t\t\tclearTimeout(this.timer)\n\t\t\tconst typed = String(query ?? '').trim()\n\t\t\tif (typed === '') {\n\t\t\t\tthis.options = []\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.timer = setTimeout(() => this.search(typed), SEARCH_DELAY)\n\t\t},\n\n\t\t/**\n\t\t * Search the configured kinds; offer what was typed when allowed.\n\t\t *\n\t\t * @spec openspec/changes/assign-dialog/specs/assign-dialog/spec.md#requirement-a-manifest-configures-an-assign-dialog\n\t\t * @param {string} typed What was typed.\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync search(typed) {\n\t\t\tconst seq = ++this.searchSeq\n\t\t\tthis.searching = true\n\t\t\tconst [groups, users] = await Promise.all([\n\t\t\t\tthis.kinds.includes('group') ? searchNextcloudGroups(typed, { limit: 20 }) : [],\n\t\t\t\tthis.kinds.includes('user') ? searchNextcloudUsers(typed, { limit: 20 }) : [],\n\t\t\t])\n\t\t\tif (seq !== this.searchSeq) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst found = [\n\t\t\t\t...groups.map((g) => ({ id: g.id, label: g.label, secondary: g.subline || '', icon: 'AccountGroupOutline', kind: 'group' })),\n\t\t\t\t...users.map((u) => ({ id: u.id, label: u.label, secondary: u.subline || '', avatar: true, kind: 'user' })),\n\t\t\t]\n\t\t\tthis.options = this.assigneeConfig.allowTyped ? withTypedAssignee(found, typed, t('nextcloud-vue', 'Use \"{name}\"', { name: typed })) : found\n\t\t\tthis.searching = false\n\t\t},\n\n\t\t/**\n\t\t * Take the picked row.\n\t\t *\n\t\t * @param {string|null} id The picked id.\n\t\t */\n\t\tonPick(id) {\n\t\t\tthis.picked = id === null ? null : (this.shownOptions.find((o) => String(o.id) === String(id)) || null)\n\t\t},\n\n\t\t/**\n\t\t * The choice as sent: assignee, its kind, the note and the switches.\n\t\t *\n\t\t * @return {object}\n\t\t */\n\t\tchoice() {\n\t\t\tconst out = { [this.assigneeConfig.field || 'assignee']: String(this.picked.id) }\n\t\t\tif (this.assigneeConfig.kindField) {\n\t\t\t\tout[this.assigneeConfig.kindField] = this.picked.kind === 'typed' ? this.kinds[0] : this.picked.kind\n\t\t\t}\n\t\t\tif (this.config.note !== false) {\n\t\t\t\tout[this.noteConfig.field || 'note'] = this.note.trim()\n\t\t\t}\n\t\t\treturn { ...out, ...this.flags }\n\t\t},\n\n\t\t/**\n\t\t * Assign once: send `confirm.request`, or dispatch `confirm.action`,\n\t\t * then show the done text and refresh the page.\n\t\t *\n\t\t * @spec openspec/changes/assign-dialog/specs/assign-dialog/spec.md#requirement-a-manifest-configures-an-assign-dialog\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync confirm() {\n\t\t\tif (!this.canConfirm) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.busy = true\n\t\t\tthis.refusal = ''\n\t\t\tconst choice = this.choice()\n\t\t\ttry {\n\t\t\t\tconst request = this.confirmConfig.request\n\t\t\t\tif (request && request.url) {\n\t\t\t\t\tconst url = interpolateUrlTokens(request.url, this.tokenCtx)\n\t\t\t\t\tconst body = {}\n\t\t\t\t\tfor (const [key, value] of Object.entries(request.body || {})) {\n\t\t\t\t\t\tbody[key] = typeof value === 'string' ? fillTemplate(value, this.record || {}) : value\n\t\t\t\t\t}\n\t\t\t\t\tconst method = String(request.method || 'POST').toLowerCase()\n\t\t\t\t\tawait axios[['post', 'put', 'patch'].includes(method) ? method : 'post'](/^https?:\\/\\//i.test(url) ? url : generateUrl(url), { ...body, ...choice })\n\t\t\t\t} else if (this.confirmConfig.action && typeof this.cnDispatchAction === 'function') {\n\t\t\t\t\tawait this.cnDispatchAction({ ...this.confirmConfig.action, args: [...(this.confirmConfig.action.args || []), choice] })\n\t\t\t\t}\n\t\t\t\tthis.done = true\n\t\t\t\temit(PAGE_REFRESH, {})\n\t\t\t\t/** @event done The assignment ran. Payload: the choice as sent. */\n\t\t\t\tthis.$emit('done', choice)\n\t\t\t} catch (failure) {\n\t\t\t\tconst data = failure && failure.response && failure.response.data\n\t\t\t\tthis.refusal = String((data && (data.message || data.error)) || t('nextcloud-vue', 'It was not handed over.'))\n\t\t\t} finally {\n\t\t\t\tthis.busy = false\n\t\t\t}\n\t\t},\n\n\t\t/** Close the dialog, unless the assignment is running. */\n\t\tclose() {\n\t\t\tif (this.busy) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\t/** @event close The dialog was closed. */\n\t\t\tthis.$emit('close')\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-assign-dialog {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 18px;\n}\n\n.cn-assign-dialog__field {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 6px;\n}\n\n.cn-assign-dialog__hint {\n\tfont-size: 13px;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-assign-dialog__toggle {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 2px;\n\tpadding: 12px 14px;\n\tborder: 1px solid var(--color-border-dark);\n\tborder-radius: var(--border-radius-large, 8px);\n}\n\n.cn-assign-dialog__toggle--on {\n\tborder: 2px solid var(--color-primary-element);\n\tbackground: var(--color-primary-element-light);\n}\n\n.cn-assign-dialog__toggle-title {\n\tfont-weight: 600;\n}\n\n.cn-assign-dialog__toggle-note {\n\tpadding-inline-start: 44px;\n}\n\n.cn-assign-dialog__error {\n\tmargin: 0;\n\tcolor: var(--color-error-text, var(--color-error));\n}\n</style>\n"],"names":["_createVNode","_createBlock","_createTextVNode","_openBlock","_createElementBlock","_toDisplayString","_Fragment","_renderList"],"mappings":";;;;AAiBoB,EAAA,KAAK,EAAA,kBAAA;;AACjB,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,yBAAiB,GAAA;;;AAajB,EAAA,KAAA,EAAA,wBAAA;;;;AAGQ,EAAA,KAAA,EAAA,yBAAA;;;;AASA,EAAA,KAAA,EAAA,wBAAA;;;;;;AAWO,EAAA,KAAK,EAAA,sDAAA;;;;AAI9B,EAAA,KAAE,EAAA,yBAAA;AACF,EAAA,IAAG,EAAA,OAAA;;;;;AAMK,EAAA,IAAI,EAAC,QAAG;AAAA,EAAA,aAAA,EAAA,uBAAA;;;;;;;;;;;;AAvDjB,IAAA,IAAI,EAAE,QAAI,CAAA,IAAA,CAAC,aAAE,CAAA,KAAA,KAAA,QAAA,CAAA,CAAA,CAAA,eAAA,EAAA,QAAA,CAAA;AACb,IAAA,OAAO,EAAE,QAAA,CAAA,IAAI,CAAC,MAAA,CAAA,MAAM,CAAC,OAAO,CAAA;AAC5B,IAAA,QAAQ,EAAE,QAAA,CAAA,IAAI,CAAC,MAAA,CAAA,MAAA,CAAA,QAAA,CAAA;AAChB,IAAA,KAAK,EAAC,MAAM;AACX,IAAA,OAAO,EAAE,KAAI,CAAA,IAAA;AACZ,IAAA,aAAS,EAAC,kBAAI;AACb,IAAA,SAAK,EAAE,QAAK,CAAA,KAAA;;AAqDJ,IAAA,OAAO,UAChB,MAEU;MAFVA,WAEU,CAAA,mBAAA,EAAA;AAFA,QAAA,QAAM,EAAA,KAAA,CAAA,IAAA;AAAA,QAAA,aAAA,EAAA,yBAAA;AAAA,QAAA,OAAA,EAAA,QAAA,CAAA,KAAA;;yBAChB,MAAsB;0CAAnB,KAAI,CAAA,IAAA,GAAG,QAAC,CAAA,CAAA,CAAA,eAAA,EAAA,OAAA,CAAA,GAAW,QAAA,CAAA,CAAA,CAAA,e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;AAAvB,qBAAAG,SAAA,EAAA,EAAAC,kBAAA,CAA8B,QAA9B,UAA8B,EAAAC,eAAA,CAAA,aAAA,CAAA,MAAA,CAAA,IAAA,CAAA,CAAA,EAAA,CAAA,YAAA;;;;aAGtB,KAAI,CAAA,OAAA;gDAKT,CAAA,GAAA,YAAA,EAAAA,eAAA,CADA,KAAO,CAAA,OAAA,CAAA,EAAA,CAAA,YAAA;;;wBAIZD,kBAEK,CAAA,GAAA,EAFL,WAEK,EADDC,eAAA,CAAA,QAAA,CAAA,IAAI,CAAC,MAAM,CAAA,MAAA,CAAC,QAAQ,CAAA,IAAK,QAAC,CAAA,CAAA,CAAA,eAAA,EAAA,MAAA,CAAA,CAAA,EAAA,CAAA,YAAA,CAAA;;;;;;;;"}
@@ -2,7 +2,7 @@ import script from './CnBoardView.vue2.js';
2
2
  import { render } from './CnBoardView.vue3.js';
3
3
 
4
4
  script.render = render;
5
- script.__scopeId = "data-v-4b0d3015";
5
+ script.__scopeId = "data-v-45db9bd1";
6
6
  const __sfc_main = script;
7
7
 
8
8
  export { __sfc_main as default };
@@ -1,10 +1,12 @@
1
1
  import { translate } from '@nextcloud/l10n';
2
- import __sfc_main from '../CnStatusBadge/CnStatusBadge.vue.js';
2
+ import __sfc_main from '../CnIcon/CnIcon.vue.js';
3
+ import __sfc_main$1 from '../CnStatusBadge/CnStatusBadge.vue.js';
3
4
  import { normalizeLook } from '../../composables/useLook.js';
4
5
  import { isBadgeVariant } from '../../utils/badgeVariants.js';
5
6
  import { buildBoardColumns, normalizeAllowed, resolveStageColor } from '../../utils/boardColumns.js';
6
7
  import { buildSwimlanes } from '../../utils/boardSwimlanes.js';
7
8
  import { runBoardDrop, DROP_OUTCOMES } from '../../utils/boardTransition.js';
9
+ import { pillLook } from '../../utils/detailActionModel.js';
8
10
  import { dueStateForRow } from '../../utils/dueRule.js';
9
11
  import { formatMetricValue } from '../../utils/formatMetric.js';
10
12
  import { readPath } from '../../utils/readPath.js';
@@ -39,7 +41,7 @@ import { daysUntil } from '../../utils/dateVariant.js';
39
41
  var script = {
40
42
  name: 'CnBoardView',
41
43
 
42
- components: { CnStatusBadge: __sfc_main },
44
+ components: { CnIcon: __sfc_main, CnStatusBadge: __sfc_main$1 },
43
45
 
44
46
  inject: {
45
47
  /**
@@ -135,9 +137,10 @@ var script = {
135
137
 
136
138
  /**
137
139
  * The board look's card roles (manifest `config.board.card`):
138
- * `{ title, sub, pill, due, owner, pillColors? }`. `sub` is a field or
139
- * a list of fields joined by a middle dot; `pillColors` maps a pill
140
- * value to a badge variant. Missing, the first of `cardFields` is the
140
+ * `{ title, sub, pill, due, owner, pillColors?, resolve? }`. `sub` is a
141
+ * field or a list of fields joined by a middle dot; `pillColors` maps a
142
+ * pill value to a badge variant; `resolve: { colorField?, iconField? }`
143
+ * takes the pill's tone and icon from the record it points at. Missing, the first of `cardFields` is the
141
144
  * title and the rest form the sub line. The Nextcloud look ignores it.
142
145
  *
143
146
  * @type {{title?: string, sub?: string|Array<string>, pill?: string, due?: string, owner?: string, pillColors?: object}|null}
@@ -148,6 +151,20 @@ var script = {
148
151
  default: null,
149
152
  },
150
153
 
154
+ /**
155
+ * The referenced records' colour and icon names, by field and id
156
+ * (`{ [field]: { [id]: { color, icon } } }`, CnIndexPage reads them).
157
+ * With `cardRoles.resolve: { colorField?, iconField? }` the card's pill
158
+ * takes its record's tone and icon from here.
159
+ *
160
+ * @type {object}
161
+ * @spec openspec/changes/pill-color-field/specs/pill-color-field/spec.md#requirement-a-card-pill-takes-its-tone-and-icon-from-the-referenced-record
162
+ */
163
+ pillLooks: {
164
+ type: Object,
165
+ default: () => ({}),
166
+ },
167
+
151
168
  /**
152
169
  * The field on a column's state that holds its dot colour (manifest
153
170
  * `config.board.colorField`). Empty, the lifecycle state's declared
@@ -710,11 +727,43 @@ var script = {
710
727
  * @return {string} A CnStatusBadge variant.
711
728
  */
712
729
  pillVariant(card) {
730
+ const look = this.pillLookOf(card);
731
+ if (look.variant) {
732
+ return look.variant
733
+ }
713
734
  const raw = this.fieldText(card, this.roles.pill);
714
735
  const variant = this.roles.pillColors[raw] ?? this.roles.pillColors[raw.toLowerCase()];
715
736
  return isBadgeVariant(variant) ? variant : 'default'
716
737
  },
717
738
 
739
+ /**
740
+ * The pill's icon, from the record it points at (`cardRoles.resolve`).
741
+ *
742
+ * @param {object} card The card's row.
743
+ * @return {string} An icon name, or ''.
744
+ * @spec openspec/changes/pill-color-field/specs/pill-color-field/spec.md#requirement-a-card-pill-takes-its-tone-and-icon-from-the-referenced-record
745
+ */
746
+ pillIcon(card) {
747
+ return this.pillLookOf(card).icon || ''
748
+ },
749
+
750
+ /**
751
+ * The tone and icon of the record the card's pill points at, when
752
+ * `cardRoles.resolve` asks for them; empty otherwise.
753
+ *
754
+ * @param {object} card The card's row.
755
+ * @return {{variant?: string, icon?: string}} The look.
756
+ */
757
+ pillLookOf(card) {
758
+ const given = this.cardRoles && typeof this.cardRoles === 'object' ? this.cardRoles : null;
759
+ if (!given || !given.resolve || !this.roles.pill || !this.pillLooks) {
760
+ return {}
761
+ }
762
+ const raw = readPath(card, this.roles.pill);
763
+ const looks = this.pillLooks[this.roles.pill];
764
+ return pillLook(looks && raw !== null && raw !== undefined && typeof raw !== 'object' ? looks[String(raw)] : null)
765
+ },
766
+
718
767
  /**
719
768
  * The footer's due text: "Due today", "Due 2 Nov", or "Overdue 2 Nov"
720
769
  * for a date in the past. Words, so the late tone is not colour alone.