@conduction/nextcloud-vue 2.156.0 → 2.157.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/dist/esm/components/CnBannerWidget/CnBannerWidget.vue.js +1 -1
  2. package/dist/esm/components/CnBannerWidget/CnBannerWidget.vue2.js.map +1 -1
  3. package/dist/esm/components/CnBannerWidget/CnBannerWidget.vue3.js.map +1 -1
  4. package/dist/esm/components/CnChecklistRunWidget/CnChecklistRunWidget.vue.js +1 -1
  5. package/dist/esm/components/CnChecklistRunWidget/CnChecklistRunWidget.vue2.js.map +1 -1
  6. package/dist/esm/components/CnChecklistRunWidget/CnChecklistRunWidget.vue3.js.map +1 -1
  7. package/dist/esm/components/CnCountdownWidget/CnCountdownWidget.vue.js +1 -1
  8. package/dist/esm/components/CnCountdownWidget/CnCountdownWidget.vue2.js.map +1 -1
  9. package/dist/esm/components/CnCountdownWidget/CnCountdownWidget.vue3.js.map +1 -1
  10. package/dist/esm/components/CnDeviceFramesWidget/CnDeviceFramesWidget.vue.js +1 -1
  11. package/dist/esm/components/CnDeviceFramesWidget/CnDeviceFramesWidget.vue2.js.map +1 -1
  12. package/dist/esm/components/CnDeviceFramesWidget/CnDeviceFramesWidget.vue3.js.map +1 -1
  13. package/dist/esm/components/CnDuplicateWarning/CnDuplicateWarning.vue.js +1 -1
  14. package/dist/esm/components/CnDuplicateWarning/CnDuplicateWarning.vue2.js +2 -1
  15. package/dist/esm/components/CnDuplicateWarning/CnDuplicateWarning.vue2.js.map +1 -1
  16. package/dist/esm/components/CnDuplicateWarning/CnDuplicateWarning.vue3.js +10 -3
  17. package/dist/esm/components/CnDuplicateWarning/CnDuplicateWarning.vue3.js.map +1 -1
  18. package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue.js +1 -1
  19. package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue2.js +14 -4
  20. package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue2.js.map +1 -1
  21. package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue3.js +3 -3
  22. package/dist/esm/components/CnFactsWidget/CnFactsWidget.vue3.js.map +1 -1
  23. package/dist/esm/components/CnFeaturesBoard/CnFeaturesBoard.vue.js +1 -1
  24. package/dist/esm/components/CnFeaturesBoard/CnFeaturesBoard.vue2.js.map +1 -1
  25. package/dist/esm/components/CnFeaturesBoard/CnFeaturesBoard.vue3.js.map +1 -1
  26. package/dist/esm/components/CnFormDialog/CnFormDialog.vue.js +1 -1
  27. package/dist/esm/components/CnFormDialog/CnFormDialog.vue2.js.map +1 -1
  28. package/dist/esm/components/CnFormDialog/CnFormDialog.vue3.js +2 -1
  29. package/dist/esm/components/CnFormDialog/CnFormDialog.vue3.js.map +1 -1
  30. package/dist/esm/components/CnMailTab/CnMailTab.vue.js +1 -1
  31. package/dist/esm/components/CnMailTab/CnMailTab.vue2.js +4 -4
  32. package/dist/esm/components/CnMailTab/CnMailTab.vue2.js.map +1 -1
  33. package/dist/esm/components/CnMailTab/CnMailTab.vue3.js.map +1 -1
  34. package/dist/esm/components/CnNotificationMatrix/CnNotificationMatrix.vue.js +1 -1
  35. package/dist/esm/components/CnNotificationMatrix/CnNotificationMatrix.vue2.js +3 -0
  36. package/dist/esm/components/CnNotificationMatrix/CnNotificationMatrix.vue2.js.map +1 -1
  37. package/dist/esm/components/CnNotificationMatrix/CnNotificationMatrix.vue3.js +10 -2
  38. package/dist/esm/components/CnNotificationMatrix/CnNotificationMatrix.vue3.js.map +1 -1
  39. package/dist/esm/components/CnPartyPicker/CnPartyPicker.vue.js +1 -1
  40. package/dist/esm/components/CnPartyPicker/CnPartyPicker.vue2.js +6 -0
  41. package/dist/esm/components/CnPartyPicker/CnPartyPicker.vue2.js.map +1 -1
  42. package/dist/esm/components/CnPartyPicker/CnPartyPicker.vue3.js +2 -1
  43. package/dist/esm/components/CnPartyPicker/CnPartyPicker.vue3.js.map +1 -1
  44. package/dist/esm/components/CnSavedViewLookFields/CnSavedViewLookFields.vue.js +1 -1
  45. package/dist/esm/components/CnSavedViewLookFields/CnSavedViewLookFields.vue2.js.map +1 -1
  46. package/dist/esm/components/CnSavedViewLookFields/CnSavedViewLookFields.vue3.js +27 -24
  47. package/dist/esm/components/CnSavedViewLookFields/CnSavedViewLookFields.vue3.js.map +1 -1
  48. package/dist/esm/components/CnSearchSelect/CnSearchSelect.vue.js +1 -1
  49. package/dist/esm/components/CnSearchSelect/CnSearchSelect.vue2.js.map +1 -1
  50. package/dist/esm/components/CnSearchSelect/CnSearchSelect.vue3.js.map +1 -1
  51. package/dist/esm/components/CnStagesWidget/CnStagesWidget.vue.js +1 -1
  52. package/dist/esm/components/CnStagesWidget/CnStagesWidget.vue2.js +4 -1
  53. package/dist/esm/components/CnStagesWidget/CnStagesWidget.vue2.js.map +1 -1
  54. package/dist/esm/components/CnStagesWidget/CnStagesWidget.vue3.js.map +1 -1
  55. package/dist/esm/components/CnStagesWidget/stagesModel.js +10 -2
  56. package/dist/esm/components/CnStagesWidget/stagesModel.js.map +1 -1
  57. package/dist/esm/components/CnTimelineWidget/CnTimelineManage.vue.js +1 -1
  58. package/dist/esm/components/CnTimelineWidget/CnTimelineManage.vue2.js +61 -2
  59. package/dist/esm/components/CnTimelineWidget/CnTimelineManage.vue2.js.map +1 -1
  60. package/dist/esm/components/CnTimelineWidget/CnTimelineManage.vue3.js +68 -44
  61. package/dist/esm/components/CnTimelineWidget/CnTimelineManage.vue3.js.map +1 -1
  62. package/dist/esm/integrations/builtin/email/CnEmailTab.vue.js +1 -1
  63. package/dist/esm/integrations/builtin/email/CnEmailTab.vue2.js +13 -3
  64. package/dist/esm/integrations/builtin/email/CnEmailTab.vue2.js.map +1 -1
  65. package/dist/esm/integrations/builtin/email/CnEmailTab.vue3.js.map +1 -1
  66. package/dist/esm/library-style.js +1 -1
  67. package/dist/esm/nextcloud-vue.css +667 -375
  68. package/dist/esm/utils/dynamicProperties.js +14 -2
  69. package/dist/esm/utils/dynamicProperties.js.map +1 -1
  70. package/dist/nextcloud-vue.cjs.js +829 -678
  71. package/dist/nextcloud-vue.cjs.js.map +2 -2
  72. package/dist/nextcloud-vue.css +667 -375
  73. package/package.json +1 -1
  74. package/src/components/CnBannerWidget/CnBannerWidget.vue +5 -1
  75. package/src/components/CnChecklistRunWidget/CnChecklistRunWidget.vue +12 -5
  76. package/src/components/CnCountdownWidget/CnCountdownWidget.vue +12 -0
  77. package/src/components/CnDeviceFramesWidget/CnDeviceFramesWidget.vue +1 -0
  78. package/src/components/CnDuplicateWarning/CnDuplicateWarning.vue +8 -4
  79. package/src/components/CnFactsWidget/CnFactsWidget.vue +31 -6
  80. package/src/components/CnFeaturesBoard/CnFeaturesBoard.vue +4 -2
  81. package/src/components/CnFormDialog/CnFormDialog.vue +1 -0
  82. package/src/components/CnMailTab/CnMailTab.vue +4 -4
  83. package/src/components/CnNotificationMatrix/CnNotificationMatrix.vue +20 -0
  84. package/src/components/CnPartyPicker/CnPartyPicker.vue +7 -0
  85. package/src/components/CnSavedViewLookFields/CnSavedViewLookFields.vue +27 -20
  86. package/src/components/CnSearchSelect/CnSearchSelect.vue +3 -1
  87. package/src/components/CnStagesWidget/CnStagesWidget.vue +4 -1
  88. package/src/components/CnStagesWidget/stagesModel.js +10 -2
  89. package/src/components/CnTimelineWidget/CnTimelineManage.vue +69 -4
  90. package/src/css/dialog.css +33 -0
  91. package/src/css/look-board-detail.css +4 -3
  92. package/src/css/look-board-index.css +34 -3
  93. package/src/css/look-board.css +170 -4
  94. package/src/integrations/builtin/email/CnEmailTab.vue +13 -3
  95. package/src/utils/dynamicProperties.js +13 -1
@@ -1 +1 @@
1
- {"version":3,"file":"CnPartyPicker.vue2.js","sources":["../../../../src/components/CnPartyPicker/CnPartyPicker.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n<template>\n\t<div class=\"cn-party-picker\">\n\t\t<CnSearchSelect\n\t\t\t:modelValue=\"selectedOption\"\n\t\t\t:options=\"options\"\n\t\t\t:inputLabel=\"inputLabel\"\n\t\t\t:labelOutside=\"labelOutside\"\n\t\t\t:placeholder=\"placeholder ? cnTranslate(placeholder) : ''\"\n\t\t\t:loading=\"searching\"\n\t\t\t:filterable=\"false\"\n\t\t\t:clearable=\"clearable\"\n\t\t\t:disabled=\"disabled\"\n\t\t\tdata-testid=\"cn-party-picker\"\n\t\t\t@search=\"onSearch\"\n\t\t\t@update:modelValue=\"onPick\" />\n\t\t<p v-if=\"refusal\"\n\t\t\tclass=\"cn-party-picker__refusal\"\n\t\t\trole=\"alert\"\n\t\t\tdata-testid=\"cn-party-picker-refusal\">\n\t\t\t{{ t('nextcloud-vue', 'This search could not be read.') }} {{ refusal }}\n\t\t</p>\n\t\t<p v-for=\"name in unavailable\"\n\t\t\t:key=\"name\"\n\t\t\tclass=\"cn-party-picker__unavailable\"\n\t\t\trole=\"status\"\n\t\t\tdata-testid=\"cn-party-picker-unavailable\">\n\t\t\t{{ t('nextcloud-vue', '{source} could not be searched, so this list may be incomplete.', { source: name }) }}\n\t\t</p>\n\t</div>\n</template>\n\n<script>\nimport axios from '@nextcloud/axios'\nimport { translate as t } from '@nextcloud/l10n'\nimport { generateUrl } from '@nextcloud/router'\nimport { fillTemplate } from '../../utils/fillTemplate.js'\nimport { CnSearchSelect } from '../CnSearchSelect/index.js'\n\n/** How long typing rests before a search runs, in ms. */\nconst SEARCH_DELAY = 250\n\n/**\n * CnPartyPicker — one search field over several kinds of party: people and\n * organisations from OpenRegister register sets (BRP persons, KvK companies,\n * an app's own clients) and the reader's Nextcloud contacts, as rows with\n * initials, the name and a second line, in one list (board DqNieuweZaak\n * \"Aanvrager\": \"Henk Visser · Inwoner · Beukenlaan 3\", \"Visser Bouw B.V. ·\n * Organisatie · KvK …\"). Built on CnSearchSelect.\n *\n * `sources`: each `{ id, register, schema, label?, title?, secondary?,\n * limit?, icon?, lookup? }` searches OpenRegister with `_search`; `lookup`\n * (`{ url, when }`) sends a term matching `when` to the app's exact lookup\n * instead (a POST of `{ term }` answering `{ results }`); `title` and\n * `secondary` are templates filled from the row (default `{name}` / none),\n * `label` names the kind (\"Resident\") and starts the second line; `label`\n * and `secondary` go through the host translate, so a manifest can write\n * `\"CoC {kvkNumber}\"` and a Dutch reader sees \"KvK 24157431\". A source\n * `{ id, type: \"contacts\", label? }` searches the reader's Nextcloud contacts.\n *\n * `update:modelValue` emits the chosen row's id (a contact has none and\n * emits its contact id); `select` emits the whole choice: `{ source, id,\n * label, secondary, row }`, so a host can store more than the id (a case's\n * initiator type, source id and display name). A `modelValue` the list does\n * not hold is shown by its `selectedLabel`, else looked up by id in the\n * OpenRegister sources.\n *\n * ```vue\n * <CnPartyPicker\n * v-model=\"case.requester\"\n * input-label=\"Requester\"\n * :sources=\"[\n * { id: 'person', register: 'dossiq', schema: 'brpPerson', label: 'Resident', title: '{firstName} {lastName}', secondary: '{residence.street} {residence.houseNumber}' },\n * { id: 'company', register: 'dossiq', schema: 'kvkCompany', label: 'Organisation', title: '{tradeName}', secondary: 'KvK {sourceId}' },\n * { id: 'contact', type: 'contacts', label: 'Contact' },\n * ]\"\n * @select=\"onRequester\" />\n * ```\n */\nexport default {\n\tname: 'CnPartyPicker',\n\n\tcomponents: { CnSearchSelect },\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/** The chosen party's id. */\n\t\tmodelValue: {\n\t\t\ttype: [String, Number],\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * Where to search: OpenRegister sets `{ id, register, schema, label?,\n\t\t * title?, secondary?, limit?, icon? }`, or `{ id, type: \"contacts\",\n\t\t * label? }` for the reader's Nextcloud contacts.\n\t\t *\n\t\t * @type {Array<object>}\n\t\t */\n\t\tsources: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t\t/** The field's label. */\n\t\tinputLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** Draw the label above the field. */\n\t\tlabelOutside: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/** Placeholder (\"Name, BSN, trade name or KvK number\"), through the host translate. */\n\t\tplaceholder: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The chosen party's name, shown before the list holds it. */\n\t\tselectedLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** Offer a clear button. */\n\t\tclearable: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true,\n\t\t},\n\n\t\t/** Disable the field. */\n\t\tdisabled: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/** The fewest characters a search needs. */\n\t\tminLength: {\n\t\t\ttype: Number,\n\t\t\tdefault: 2,\n\t\t},\n\t},\n\n\temits: ['update:modelValue', 'select'],\n\n\tdata() {\n\t\treturn {\n\t\t\toptions: [],\n\t\t\tsearching: false,\n\t\t\tknown: null,\n\t\t\ttimer: null,\n\t\t\tsearchSeq: 0,\n\t\t\trefusal: '',\n\t\t\tunavailable: [],\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/**\n\t\t * The option for `modelValue`: in the list, else the known choice,\n\t\t * else one named by `selectedLabel`.\n\t\t *\n\t\t * @spec openspec/changes/party-picker/specs/party-picker/spec.md#requirement-one-search-field-over-several-kinds-of-party\n\t\t * @return {object|null}\n\t\t */\n\t\tselectedOption() {\n\t\t\tconst value = this.modelValue\n\t\t\tif (value === null || value === undefined || value === '') {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tconst found = this.options.find((o) => String(o.id) === String(value))\n\t\t\tif (found) {\n\t\t\t\treturn found\n\t\t\t}\n\t\t\tif (this.known && String(this.known.id) === String(value)) {\n\t\t\t\treturn this.known\n\t\t\t}\n\t\t\treturn { id: value, label: this.selectedLabel || String(value), avatar: true }\n\t\t},\n\t},\n\n\twatch: {\n\t\tmodelValue: {\n\t\t\timmediate: true,\n\t\t\thandler(value) {\n\t\t\t\tif (value && !this.selectedLabel && !this.options.some((o) => String(o.id) === String(value))) {\n\t\t\t\t\tthis.lookUp(value)\n\t\t\t\t}\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 source's row as a picker option.\n\t\t *\n\t\t * @param {object} source The source.\n\t\t * @param {object} row The row.\n\t\t * @return {object|null} The option, or null without an id.\n\t\t */\n\t\toptionOf(source, row) {\n\t\t\tconst id = row && (row.id ?? row['@self']?.id ?? row.uuid)\n\t\t\tif (id === undefined || id === null || id === '') {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tconst title = (source.title ? fillTemplate(source.title, row) : (row.name || row.title || row.displayName || '')).trim() || String(id)\n\t\t\tconst detail = source.secondary ? fillTemplate(this.cnTranslate(source.secondary), row).trim() : ''\n\t\t\tconst kind = source.label ? this.cnTranslate(source.label) : ''\n\t\t\treturn {\n\t\t\t\tid,\n\t\t\t\tlabel: title,\n\t\t\t\tsecondary: [kind, detail].filter(Boolean).join(' · '),\n\t\t\t\tavatar: !source.icon,\n\t\t\t\ticon: source.icon || '',\n\t\t\t\tsource: source.id,\n\t\t\t\trow,\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * A Nextcloud contact as a picker option.\n\t\t *\n\t\t * @param {object} source The contacts source.\n\t\t * @param {object} contact The contactsmenu entry.\n\t\t * @return {object|null}\n\t\t */\n\t\tcontactOptionOf(source, contact) {\n\t\t\tconst id = contact && (contact.id || contact.uid)\n\t\t\tif (!id) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tconst mail = Array.isArray(contact.emailAddresses) ? contact.emailAddresses[0] : ''\n\t\t\tconst kind = source.label ? this.cnTranslate(source.label) : ''\n\t\t\treturn { id, label: contact.fullName || String(id), secondary: [kind, mail].filter(Boolean).join(' · '), avatar: true, source: source.id, row: contact }\n\t\t},\n\n\t\t/**\n\t\t * Search after typing rests.\n\t\t *\n\t\t * @param {string} query The typed text.\n\t\t */\n\t\tonSearch(query) {\n\t\t\tclearTimeout(this.timer)\n\t\t\tconst term = String(query || '').trim()\n\t\t\tif (term.length < this.minLength) {\n\t\t\t\tthis.options = this.selectedOption ? [this.selectedOption] : []\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.timer = setTimeout(() => this.search(term), SEARCH_DELAY)\n\t\t},\n\n\t\t/**\n\t\t * Search every source at once. A term a source refused (400) is said\n\t\t * under the field in its words; a source that could not be searched at\n\t\t * all is named, so an empty list never hides a missing source.\n\t\t *\n\t\t * @spec openspec/changes/party-picker/specs/party-picker/spec.md#requirement-one-search-field-over-several-kinds-of-party\n\t\t * @param {string} term The search term.\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync search(term) {\n\t\t\tconst seq = ++this.searchSeq\n\t\t\tthis.searching = true\n\t\t\tlet refusal = ''\n\t\t\tconst unavailable = []\n\t\t\tconst sets = await Promise.all((this.sources || []).map(async (source) => {\n\t\t\t\ttry {\n\t\t\t\t\tif (source.type === 'contacts') {\n\t\t\t\t\t\tconst { data } = await axios.post(generateUrl('/contactsmenu/contacts'), { filter: term })\n\t\t\t\t\t\treturn (data && Array.isArray(data.contacts) ? data.contacts : []).map((c) => this.contactOptionOf(source, c))\n\t\t\t\t\t}\n\t\t\t\t\tif (this.isExactLookup(source, term) === true) {\n\t\t\t\t\t\tconst { data } = await axios.post(generateUrl(source.lookup.url), { term })\n\t\t\t\t\t\treturn (data && Array.isArray(data.results) ? data.results : []).map((row) => this.optionOf(source, row))\n\t\t\t\t\t}\n\t\t\t\t\tif (!source.register || !source.schema) {\n\t\t\t\t\t\treturn []\n\t\t\t\t\t}\n\t\t\t\t\tconst { data } = await axios.get(generateUrl(`/apps/openregister/api/objects/${source.register}/${source.schema}`), { params: { _search: term, _limit: source.limit || 8 } })\n\t\t\t\t\treturn (data && Array.isArray(data.results) ? data.results : []).map((row) => this.optionOf(source, row))\n\t\t\t\t} catch (failure) {\n\t\t\t\t\t// OpenRegister refuses a term it cannot parse with a 400 rather\n\t\t\t\t\t// than answering nothing, so that refusal is said, not hidden.\n\t\t\t\t\tconst response = failure && failure.response\n\t\t\t\t\tif (response && response.status === 400) {\n\t\t\t\t\t\tconst body = response.data\n\t\t\t\t\t\trefusal = String((body && (body.message || body.error)) || (typeof body === 'string' ? body : '') || refusal)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tunavailable.push(source.label ? this.cnTranslate(source.label) : String(source.id || ''))\n\t\t\t\t\t}\n\t\t\t\t\treturn []\n\t\t\t\t}\n\t\t\t}))\n\t\t\tif (seq !== this.searchSeq) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.options = sets.flat().filter(Boolean)\n\t\t\tthis.refusal = refusal\n\t\t\tthis.unavailable = unavailable.filter(Boolean)\n\t\t\tthis.searching = false\n\t\t},\n\n\t\t/**\n\t\t * Whether a typed term goes to the source's exact lookup instead of the\n\t\t * free-text search: `source.lookup` is `{ url, when }`, `when` a regular\n\t\t * expression the whole term must match (\"^[0-9]{9}$\" for a BSN). The\n\t\t * lookup is a POST, so the term never sits in a URL or a server log line,\n\t\t * and the app behind it may check and record who looked whom up.\n\t\t *\n\t\t * @param {object} source The source.\n\t\t * @param {string} term The typed term.\n\t\t * @return {boolean}\n\t\t * @spec openspec/changes/party-picker-exact-lookup/specs/party-picker/spec.md#requirement-a-party-source-can-look-a-term-up-exactly\n\t\t */\n\t\tisExactLookup(source, term) {\n\t\t\tconst lookup = source && source.lookup\n\t\t\tif (!lookup || typeof lookup.url !== 'string' || lookup.url === '' || typeof lookup.when !== 'string') {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\ttry {\n\t\t\t\treturn new RegExp(lookup.when).test(term)\n\t\t\t} catch {\n\t\t\t\treturn false\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Name a value the list does not hold: the first OpenRegister source\n\t\t * that has an object with that id.\n\t\t *\n\t\t * @param {string|number} id The id.\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync lookUp(id) {\n\t\t\tfor (const source of (this.sources || []).filter((s) => s.register && s.schema && s.type !== 'contacts')) {\n\t\t\t\ttry {\n\t\t\t\t\tconst { data } = await axios.get(generateUrl(`/apps/openregister/api/objects/${source.register}/${source.schema}/${encodeURIComponent(id)}`))\n\t\t\t\t\tconst option = data ? this.optionOf(source, data) : null\n\t\t\t\t\tif (option && String(this.modelValue) === String(id)) {\n\t\t\t\t\t\tthis.known = option\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t} catch {\n\t\t\t\t\t// Not in this source; try the next.\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Take the picked option: emit its id and the whole choice.\n\t\t *\n\t\t * @param {string|number|null} id The picked id.\n\t\t */\n\t\tonPick(id) {\n\t\t\tconst option = id === null ? null : this.options.find((o) => String(o.id) === String(id)) || null\n\t\t\tif (option) {\n\t\t\t\tthis.known = option\n\t\t\t}\n\t\t\t/** @event update:modelValue The chosen party's id, or null when cleared. */\n\t\t\tthis.$emit('update:modelValue', id)\n\t\t\t/** @event select The whole choice: `{ source, id, label, secondary, row }`, or null when cleared. */\n\t\t\tthis.$emit('select', option ? { source: option.source, id: option.id, label: option.label, secondary: option.secondary, row: option.row } : null)\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-party-picker__refusal {\n\tmargin: 4px 0 0;\n\tcolor: var(--color-error-text, var(--color-error));\n}\n\n.cn-party-picker__unavailable {\n\tmargin: 4px 0 0;\n\tcolor: var(--color-text-maxcontrast);\n}\n</style>\n"],"names":["CnSearchSelect","t","axios"],"mappings":";;;;;;AA0CA;AACA,MAAM,YAAa,GAAE,IAAE;;AAEvB;;AAEC;;;;AAIA;AACA;;AAEA;;;AAGA;;;;AAIA;AACA;;;;AAIA;;AAEA;AACA;AACA;AACA;;;;AAIA;;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C,CAAC,CAAC,EAAA;KAC5I,MAAM,MAAK,GAAI,IAAK,GAAE,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAE,GAAE,KAAG;KACvD,IAAI,UAAU,MAAM,CAAC,IAAI,CAAC,UAAU,MAAM,MAAM,CAAC,EAAE,CAAC,EAAE;AACrD,MAAA,IAAI,CAAC,KAAI,GAAI,OAAK;MAClB,MAAK;AACN,MAAA;AACD,KAAA,CAAE,MAAM;;AAER,KAAA;AACD,IAAA;GACA;;AAED;;AAEC;AACA;;EAED,MAAM,CAAC,EAAE,EAAE;AACV,GAAA,MAAM,MAAK,GAAI,EAAC,KAAM,IAAG,GAAI,IAAG,GAAI,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,CAAC,CAAC,EAAE,CAAE,KAAI,MAAM,CAAC,EAAE,CAAC,CAAA,IAAK,KAAG;GAChG,IAAI,MAAM,EAAE;AACX,IAAA,IAAI,CAAC,KAAI,GAAI,OAAK;AACnB,IAAA;AACA;AACA,GAAA,IAAI,CAAC,KAAK,CAAC,mBAAmB,EAAE,EAAE,EAAA;AAClC;AACA,GAAA,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,MAAO,GAAE,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,SAAS,EAAE,MAAM,CAAC,SAAS,EAAE,GAAG,EAAE,MAAM,CAAC,GAAE,EAAI,GAAE,IAAI,EAAA;GAChJ;EACD;AACF;;;;"}
1
+ {"version":3,"file":"CnPartyPicker.vue2.js","sources":["../../../../src/components/CnPartyPicker/CnPartyPicker.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n<template>\n\t<div class=\"cn-party-picker\">\n\t\t<CnSearchSelect\n\t\t\t:inputId=\"inputId\"\n\t\t\t:modelValue=\"selectedOption\"\n\t\t\t:options=\"options\"\n\t\t\t:inputLabel=\"inputLabel\"\n\t\t\t:labelOutside=\"labelOutside\"\n\t\t\t:placeholder=\"placeholder ? cnTranslate(placeholder) : ''\"\n\t\t\t:loading=\"searching\"\n\t\t\t:filterable=\"false\"\n\t\t\t:clearable=\"clearable\"\n\t\t\t:disabled=\"disabled\"\n\t\t\tdata-testid=\"cn-party-picker\"\n\t\t\t@search=\"onSearch\"\n\t\t\t@update:modelValue=\"onPick\" />\n\t\t<p v-if=\"refusal\"\n\t\t\tclass=\"cn-party-picker__refusal\"\n\t\t\trole=\"alert\"\n\t\t\tdata-testid=\"cn-party-picker-refusal\">\n\t\t\t{{ t('nextcloud-vue', 'This search could not be read.') }} {{ refusal }}\n\t\t</p>\n\t\t<p v-for=\"name in unavailable\"\n\t\t\t:key=\"name\"\n\t\t\tclass=\"cn-party-picker__unavailable\"\n\t\t\trole=\"status\"\n\t\t\tdata-testid=\"cn-party-picker-unavailable\">\n\t\t\t{{ t('nextcloud-vue', '{source} could not be searched, so this list may be incomplete.', { source: name }) }}\n\t\t</p>\n\t</div>\n</template>\n\n<script>\nimport axios from '@nextcloud/axios'\nimport { translate as t } from '@nextcloud/l10n'\nimport { generateUrl } from '@nextcloud/router'\nimport { fillTemplate } from '../../utils/fillTemplate.js'\nimport { CnSearchSelect } from '../CnSearchSelect/index.js'\n\n/** How long typing rests before a search runs, in ms. */\nconst SEARCH_DELAY = 250\n\n/**\n * CnPartyPicker — one search field over several kinds of party: people and\n * organisations from OpenRegister register sets (BRP persons, KvK companies,\n * an app's own clients) and the reader's Nextcloud contacts, as rows with\n * initials, the name and a second line, in one list (board DqNieuweZaak\n * \"Aanvrager\": \"Henk Visser · Inwoner · Beukenlaan 3\", \"Visser Bouw B.V. ·\n * Organisatie · KvK …\"). Built on CnSearchSelect.\n *\n * `sources`: each `{ id, register, schema, label?, title?, secondary?,\n * limit?, icon?, lookup? }` searches OpenRegister with `_search`; `lookup`\n * (`{ url, when }`) sends a term matching `when` to the app's exact lookup\n * instead (a POST of `{ term }` answering `{ results }`); `title` and\n * `secondary` are templates filled from the row (default `{name}` / none),\n * `label` names the kind (\"Resident\") and starts the second line; `label`\n * and `secondary` go through the host translate, so a manifest can write\n * `\"CoC {kvkNumber}\"` and a Dutch reader sees \"KvK 24157431\". A source\n * `{ id, type: \"contacts\", label? }` searches the reader's Nextcloud contacts.\n *\n * `update:modelValue` emits the chosen row's id (a contact has none and\n * emits its contact id); `select` emits the whole choice: `{ source, id,\n * label, secondary, row }`, so a host can store more than the id (a case's\n * initiator type, source id and display name). A `modelValue` the list does\n * not hold is shown by its `selectedLabel`, else looked up by id in the\n * OpenRegister sources.\n *\n * ```vue\n * <CnPartyPicker\n * v-model=\"case.requester\"\n * input-label=\"Requester\"\n * :sources=\"[\n * { id: 'person', register: 'dossiq', schema: 'brpPerson', label: 'Resident', title: '{firstName} {lastName}', secondary: '{residence.street} {residence.houseNumber}' },\n * { id: 'company', register: 'dossiq', schema: 'kvkCompany', label: 'Organisation', title: '{tradeName}', secondary: 'KvK {sourceId}' },\n * { id: 'contact', type: 'contacts', label: 'Contact' },\n * ]\"\n * @select=\"onRequester\" />\n * ```\n */\nexport default {\n\tname: 'CnPartyPicker',\n\n\tcomponents: { CnSearchSelect },\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/** The search input's id, so the form's own label names it. */\n\t\tinputId: {\n\t\t\ttype: String,\n\t\t\tdefault: undefined,\n\t\t},\n\n\t\t/** The chosen party's id. */\n\t\tmodelValue: {\n\t\t\ttype: [String, Number],\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * Where to search: OpenRegister sets `{ id, register, schema, label?,\n\t\t * title?, secondary?, limit?, icon? }`, or `{ id, type: \"contacts\",\n\t\t * label? }` for the reader's Nextcloud contacts.\n\t\t *\n\t\t * @type {Array<object>}\n\t\t */\n\t\tsources: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t\t/** The field's label. */\n\t\tinputLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** Draw the label above the field. */\n\t\tlabelOutside: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/** Placeholder (\"Name, BSN, trade name or KvK number\"), through the host translate. */\n\t\tplaceholder: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The chosen party's name, shown before the list holds it. */\n\t\tselectedLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** Offer a clear button. */\n\t\tclearable: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true,\n\t\t},\n\n\t\t/** Disable the field. */\n\t\tdisabled: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/** The fewest characters a search needs. */\n\t\tminLength: {\n\t\t\ttype: Number,\n\t\t\tdefault: 2,\n\t\t},\n\t},\n\n\temits: ['update:modelValue', 'select'],\n\n\tdata() {\n\t\treturn {\n\t\t\toptions: [],\n\t\t\tsearching: false,\n\t\t\tknown: null,\n\t\t\ttimer: null,\n\t\t\tsearchSeq: 0,\n\t\t\trefusal: '',\n\t\t\tunavailable: [],\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/**\n\t\t * The option for `modelValue`: in the list, else the known choice,\n\t\t * else one named by `selectedLabel`.\n\t\t *\n\t\t * @spec openspec/changes/party-picker/specs/party-picker/spec.md#requirement-one-search-field-over-several-kinds-of-party\n\t\t * @return {object|null}\n\t\t */\n\t\tselectedOption() {\n\t\t\tconst value = this.modelValue\n\t\t\tif (value === null || value === undefined || value === '') {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tconst found = this.options.find((o) => String(o.id) === String(value))\n\t\t\tif (found) {\n\t\t\t\treturn found\n\t\t\t}\n\t\t\tif (this.known && String(this.known.id) === String(value)) {\n\t\t\t\treturn this.known\n\t\t\t}\n\t\t\treturn { id: value, label: this.selectedLabel || String(value), avatar: true }\n\t\t},\n\t},\n\n\twatch: {\n\t\tmodelValue: {\n\t\t\timmediate: true,\n\t\t\thandler(value) {\n\t\t\t\tif (value && !this.selectedLabel && !this.options.some((o) => String(o.id) === String(value))) {\n\t\t\t\t\tthis.lookUp(value)\n\t\t\t\t}\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 source's row as a picker option.\n\t\t *\n\t\t * @param {object} source The source.\n\t\t * @param {object} row The row.\n\t\t * @return {object|null} The option, or null without an id.\n\t\t */\n\t\toptionOf(source, row) {\n\t\t\tconst id = row && (row.id ?? row['@self']?.id ?? row.uuid)\n\t\t\tif (id === undefined || id === null || id === '') {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tconst title = (source.title ? fillTemplate(source.title, row) : (row.name || row.title || row.displayName || '')).trim() || String(id)\n\t\t\tconst detail = source.secondary ? fillTemplate(this.cnTranslate(source.secondary), row).trim() : ''\n\t\t\tconst kind = source.label ? this.cnTranslate(source.label) : ''\n\t\t\treturn {\n\t\t\t\tid,\n\t\t\t\tlabel: title,\n\t\t\t\tsecondary: [kind, detail].filter(Boolean).join(' · '),\n\t\t\t\tavatar: !source.icon,\n\t\t\t\ticon: source.icon || '',\n\t\t\t\tsource: source.id,\n\t\t\t\trow,\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * A Nextcloud contact as a picker option.\n\t\t *\n\t\t * @param {object} source The contacts source.\n\t\t * @param {object} contact The contactsmenu entry.\n\t\t * @return {object|null}\n\t\t */\n\t\tcontactOptionOf(source, contact) {\n\t\t\tconst id = contact && (contact.id || contact.uid)\n\t\t\tif (!id) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tconst mail = Array.isArray(contact.emailAddresses) ? contact.emailAddresses[0] : ''\n\t\t\tconst kind = source.label ? this.cnTranslate(source.label) : ''\n\t\t\treturn { id, label: contact.fullName || String(id), secondary: [kind, mail].filter(Boolean).join(' · '), avatar: true, source: source.id, row: contact }\n\t\t},\n\n\t\t/**\n\t\t * Search after typing rests.\n\t\t *\n\t\t * @param {string} query The typed text.\n\t\t */\n\t\tonSearch(query) {\n\t\t\tclearTimeout(this.timer)\n\t\t\tconst term = String(query || '').trim()\n\t\t\tif (term.length < this.minLength) {\n\t\t\t\tthis.options = this.selectedOption ? [this.selectedOption] : []\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.timer = setTimeout(() => this.search(term), SEARCH_DELAY)\n\t\t},\n\n\t\t/**\n\t\t * Search every source at once. A term a source refused (400) is said\n\t\t * under the field in its words; a source that could not be searched at\n\t\t * all is named, so an empty list never hides a missing source.\n\t\t *\n\t\t * @spec openspec/changes/party-picker/specs/party-picker/spec.md#requirement-one-search-field-over-several-kinds-of-party\n\t\t * @param {string} term The search term.\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync search(term) {\n\t\t\tconst seq = ++this.searchSeq\n\t\t\tthis.searching = true\n\t\t\tlet refusal = ''\n\t\t\tconst unavailable = []\n\t\t\tconst sets = await Promise.all((this.sources || []).map(async (source) => {\n\t\t\t\ttry {\n\t\t\t\t\tif (source.type === 'contacts') {\n\t\t\t\t\t\tconst { data } = await axios.post(generateUrl('/contactsmenu/contacts'), { filter: term })\n\t\t\t\t\t\treturn (data && Array.isArray(data.contacts) ? data.contacts : []).map((c) => this.contactOptionOf(source, c))\n\t\t\t\t\t}\n\t\t\t\t\tif (this.isExactLookup(source, term) === true) {\n\t\t\t\t\t\tconst { data } = await axios.post(generateUrl(source.lookup.url), { term })\n\t\t\t\t\t\treturn (data && Array.isArray(data.results) ? data.results : []).map((row) => this.optionOf(source, row))\n\t\t\t\t\t}\n\t\t\t\t\tif (!source.register || !source.schema) {\n\t\t\t\t\t\treturn []\n\t\t\t\t\t}\n\t\t\t\t\tconst { data } = await axios.get(generateUrl(`/apps/openregister/api/objects/${source.register}/${source.schema}`), { params: { _search: term, _limit: source.limit || 8 } })\n\t\t\t\t\treturn (data && Array.isArray(data.results) ? data.results : []).map((row) => this.optionOf(source, row))\n\t\t\t\t} catch (failure) {\n\t\t\t\t\t// OpenRegister refuses a term it cannot parse with a 400 rather\n\t\t\t\t\t// than answering nothing, so that refusal is said, not hidden.\n\t\t\t\t\tconst response = failure && failure.response\n\t\t\t\t\tif (response && response.status === 400) {\n\t\t\t\t\t\tconst body = response.data\n\t\t\t\t\t\trefusal = String((body && (body.message || body.error)) || (typeof body === 'string' ? body : '') || refusal)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tunavailable.push(source.label ? this.cnTranslate(source.label) : String(source.id || ''))\n\t\t\t\t\t}\n\t\t\t\t\treturn []\n\t\t\t\t}\n\t\t\t}))\n\t\t\tif (seq !== this.searchSeq) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.options = sets.flat().filter(Boolean)\n\t\t\tthis.refusal = refusal\n\t\t\tthis.unavailable = unavailable.filter(Boolean)\n\t\t\tthis.searching = false\n\t\t},\n\n\t\t/**\n\t\t * Whether a typed term goes to the source's exact lookup instead of the\n\t\t * free-text search: `source.lookup` is `{ url, when }`, `when` a regular\n\t\t * expression the whole term must match (\"^[0-9]{9}$\" for a BSN). The\n\t\t * lookup is a POST, so the term never sits in a URL or a server log line,\n\t\t * and the app behind it may check and record who looked whom up.\n\t\t *\n\t\t * @param {object} source The source.\n\t\t * @param {string} term The typed term.\n\t\t * @return {boolean}\n\t\t * @spec openspec/changes/party-picker-exact-lookup/specs/party-picker/spec.md#requirement-a-party-source-can-look-a-term-up-exactly\n\t\t */\n\t\tisExactLookup(source, term) {\n\t\t\tconst lookup = source && source.lookup\n\t\t\tif (!lookup || typeof lookup.url !== 'string' || lookup.url === '' || typeof lookup.when !== 'string') {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\ttry {\n\t\t\t\treturn new RegExp(lookup.when).test(term)\n\t\t\t} catch {\n\t\t\t\treturn false\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Name a value the list does not hold: the first OpenRegister source\n\t\t * that has an object with that id.\n\t\t *\n\t\t * @param {string|number} id The id.\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync lookUp(id) {\n\t\t\tfor (const source of (this.sources || []).filter((s) => s.register && s.schema && s.type !== 'contacts')) {\n\t\t\t\ttry {\n\t\t\t\t\tconst { data } = await axios.get(generateUrl(`/apps/openregister/api/objects/${source.register}/${source.schema}/${encodeURIComponent(id)}`))\n\t\t\t\t\tconst option = data ? this.optionOf(source, data) : null\n\t\t\t\t\tif (option && String(this.modelValue) === String(id)) {\n\t\t\t\t\t\tthis.known = option\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t} catch {\n\t\t\t\t\t// Not in this source; try the next.\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Take the picked option: emit its id and the whole choice.\n\t\t *\n\t\t * @param {string|number|null} id The picked id.\n\t\t */\n\t\tonPick(id) {\n\t\t\tconst option = id === null ? null : this.options.find((o) => String(o.id) === String(id)) || null\n\t\t\tif (option) {\n\t\t\t\tthis.known = option\n\t\t\t}\n\t\t\t/** @event update:modelValue The chosen party's id, or null when cleared. */\n\t\t\tthis.$emit('update:modelValue', id)\n\t\t\t/** @event select The whole choice: `{ source, id, label, secondary, row }`, or null when cleared. */\n\t\t\tthis.$emit('select', option ? { source: option.source, id: option.id, label: option.label, secondary: option.secondary, row: option.row } : null)\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-party-picker__refusal {\n\tmargin: 4px 0 0;\n\tcolor: var(--color-error-text, var(--color-error));\n}\n\n.cn-party-picker__unavailable {\n\tmargin: 4px 0 0;\n\tcolor: var(--color-text-maxcontrast);\n}\n</style>\n"],"names":["CnSearchSelect","t","axios"],"mappings":";;;;;;AA2CA;AACA,MAAM,YAAa,GAAE,IA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, $props, $setup, $data, $options) {
13
13
 
14
14
  return (openBlock(), createElementBlock("div", _hoisted_1, [
15
15
  createVNode(_component_CnSearchSelect, {
16
+ inputId: $props.inputId,
16
17
  modelValue: $options.selectedOption,
17
18
  options: $data.options,
18
19
  inputLabel: $props.inputLabel,
@@ -25,7 +26,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
25
26
  "data-testid": "cn-party-picker",
26
27
  onSearch: $options.onSearch,
27
28
  "onUpdate:modelValue": $options.onPick
28
- }, null, 8 /* PROPS */, ["modelValue", "options", "inputLabel", "labelOutside", "placeholder", "loading", "clearable", "disabled", "onSearch", "onUpdate:modelValue"]),
29
+ }, null, 8 /* PROPS */, ["inputId", "modelValue", "options", "inputLabel", "labelOutside", "placeholder", "loading", "clearable", "disabled", "onSearch", "onUpdate:modelValue"]),
29
30
  ($data.refusal)
30
31
  ? (openBlock(), createElementBlock("p", _hoisted_2, toDisplayString($options.t('nextcloud-vue', 'This search could not be read.')) + " " + toDisplayString($data.refusal), 1 /* TEXT */))
31
32
  : createCommentVNode("v-if", true),
@@ -1 +1 @@
1
- {"version":3,"file":"CnPartyPicker.vue3.js","sources":["../../../../src/components/CnPartyPicker/CnPartyPicker.vue?vue&type=template&id=1b4d732c&lang.js"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n<template>\n\t<div class=\"cn-party-picker\">\n\t\t<CnSearchSelect\n\t\t\t:modelValue=\"selectedOption\"\n\t\t\t:options=\"options\"\n\t\t\t:inputLabel=\"inputLabel\"\n\t\t\t:labelOutside=\"labelOutside\"\n\t\t\t:placeholder=\"placeholder ? cnTranslate(placeholder) : ''\"\n\t\t\t:loading=\"searching\"\n\t\t\t:filterable=\"false\"\n\t\t\t:clearable=\"clearable\"\n\t\t\t:disabled=\"disabled\"\n\t\t\tdata-testid=\"cn-party-picker\"\n\t\t\t@search=\"onSearch\"\n\t\t\t@update:modelValue=\"onPick\" />\n\t\t<p v-if=\"refusal\"\n\t\t\tclass=\"cn-party-picker__refusal\"\n\t\t\trole=\"alert\"\n\t\t\tdata-testid=\"cn-party-picker-refusal\">\n\t\t\t{{ t('nextcloud-vue', 'This search could not be read.') }} {{ refusal }}\n\t\t</p>\n\t\t<p v-for=\"name in unavailable\"\n\t\t\t:key=\"name\"\n\t\t\tclass=\"cn-party-picker__unavailable\"\n\t\t\trole=\"status\"\n\t\t\tdata-testid=\"cn-party-picker-unavailable\">\n\t\t\t{{ t('nextcloud-vue', '{source} could not be searched, so this list may be incomplete.', { source: name }) }}\n\t\t</p>\n\t</div>\n</template>\n\n<script>\nimport axios from '@nextcloud/axios'\nimport { translate as t } from '@nextcloud/l10n'\nimport { generateUrl } from '@nextcloud/router'\nimport { fillTemplate } from '../../utils/fillTemplate.js'\nimport { CnSearchSelect } from '../CnSearchSelect/index.js'\n\n/** How long typing rests before a search runs, in ms. */\nconst SEARCH_DELAY = 250\n\n/**\n * CnPartyPicker — one search field over several kinds of party: people and\n * organisations from OpenRegister register sets (BRP persons, KvK companies,\n * an app's own clients) and the reader's Nextcloud contacts, as rows with\n * initials, the name and a second line, in one list (board DqNieuweZaak\n * \"Aanvrager\": \"Henk Visser · Inwoner · Beukenlaan 3\", \"Visser Bouw B.V. ·\n * Organisatie · KvK …\"). Built on CnSearchSelect.\n *\n * `sources`: each `{ id, register, schema, label?, title?, secondary?,\n * limit?, icon?, lookup? }` searches OpenRegister with `_search`; `lookup`\n * (`{ url, when }`) sends a term matching `when` to the app's exact lookup\n * instead (a POST of `{ term }` answering `{ results }`); `title` and\n * `secondary` are templates filled from the row (default `{name}` / none),\n * `label` names the kind (\"Resident\") and starts the second line; `label`\n * and `secondary` go through the host translate, so a manifest can write\n * `\"CoC {kvkNumber}\"` and a Dutch reader sees \"KvK 24157431\". A source\n * `{ id, type: \"contacts\", label? }` searches the reader's Nextcloud contacts.\n *\n * `update:modelValue` emits the chosen row's id (a contact has none and\n * emits its contact id); `select` emits the whole choice: `{ source, id,\n * label, secondary, row }`, so a host can store more than the id (a case's\n * initiator type, source id and display name). A `modelValue` the list does\n * not hold is shown by its `selectedLabel`, else looked up by id in the\n * OpenRegister sources.\n *\n * ```vue\n * <CnPartyPicker\n * v-model=\"case.requester\"\n * input-label=\"Requester\"\n * :sources=\"[\n * { id: 'person', register: 'dossiq', schema: 'brpPerson', label: 'Resident', title: '{firstName} {lastName}', secondary: '{residence.street} {residence.houseNumber}' },\n * { id: 'company', register: 'dossiq', schema: 'kvkCompany', label: 'Organisation', title: '{tradeName}', secondary: 'KvK {sourceId}' },\n * { id: 'contact', type: 'contacts', label: 'Contact' },\n * ]\"\n * @select=\"onRequester\" />\n * ```\n */\nexport default {\n\tname: 'CnPartyPicker',\n\n\tcomponents: { CnSearchSelect },\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/** The chosen party's id. */\n\t\tmodelValue: {\n\t\t\ttype: [String, Number],\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * Where to search: OpenRegister sets `{ id, register, schema, label?,\n\t\t * title?, secondary?, limit?, icon? }`, or `{ id, type: \"contacts\",\n\t\t * label? }` for the reader's Nextcloud contacts.\n\t\t *\n\t\t * @type {Array<object>}\n\t\t */\n\t\tsources: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t\t/** The field's label. */\n\t\tinputLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** Draw the label above the field. */\n\t\tlabelOutside: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/** Placeholder (\"Name, BSN, trade name or KvK number\"), through the host translate. */\n\t\tplaceholder: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The chosen party's name, shown before the list holds it. */\n\t\tselectedLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** Offer a clear button. */\n\t\tclearable: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true,\n\t\t},\n\n\t\t/** Disable the field. */\n\t\tdisabled: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/** The fewest characters a search needs. */\n\t\tminLength: {\n\t\t\ttype: Number,\n\t\t\tdefault: 2,\n\t\t},\n\t},\n\n\temits: ['update:modelValue', 'select'],\n\n\tdata() {\n\t\treturn {\n\t\t\toptions: [],\n\t\t\tsearching: false,\n\t\t\tknown: null,\n\t\t\ttimer: null,\n\t\t\tsearchSeq: 0,\n\t\t\trefusal: '',\n\t\t\tunavailable: [],\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/**\n\t\t * The option for `modelValue`: in the list, else the known choice,\n\t\t * else one named by `selectedLabel`.\n\t\t *\n\t\t * @spec openspec/changes/party-picker/specs/party-picker/spec.md#requirement-one-search-field-over-several-kinds-of-party\n\t\t * @return {object|null}\n\t\t */\n\t\tselectedOption() {\n\t\t\tconst value = this.modelValue\n\t\t\tif (value === null || value === undefined || value === '') {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tconst found = this.options.find((o) => String(o.id) === String(value))\n\t\t\tif (found) {\n\t\t\t\treturn found\n\t\t\t}\n\t\t\tif (this.known && String(this.known.id) === String(value)) {\n\t\t\t\treturn this.known\n\t\t\t}\n\t\t\treturn { id: value, label: this.selectedLabel || String(value), avatar: true }\n\t\t},\n\t},\n\n\twatch: {\n\t\tmodelValue: {\n\t\t\timmediate: true,\n\t\t\thandler(value) {\n\t\t\t\tif (value && !this.selectedLabel && !this.options.some((o) => String(o.id) === String(value))) {\n\t\t\t\t\tthis.lookUp(value)\n\t\t\t\t}\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 source's row as a picker option.\n\t\t *\n\t\t * @param {object} source The source.\n\t\t * @param {object} row The row.\n\t\t * @return {object|null} The option, or null without an id.\n\t\t */\n\t\toptionOf(source, row) {\n\t\t\tconst id = row && (row.id ?? row['@self']?.id ?? row.uuid)\n\t\t\tif (id === undefined || id === null || id === '') {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tconst title = (source.title ? fillTemplate(source.title, row) : (row.name || row.title || row.displayName || '')).trim() || String(id)\n\t\t\tconst detail = source.secondary ? fillTemplate(this.cnTranslate(source.secondary), row).trim() : ''\n\t\t\tconst kind = source.label ? this.cnTranslate(source.label) : ''\n\t\t\treturn {\n\t\t\t\tid,\n\t\t\t\tlabel: title,\n\t\t\t\tsecondary: [kind, detail].filter(Boolean).join(' · '),\n\t\t\t\tavatar: !source.icon,\n\t\t\t\ticon: source.icon || '',\n\t\t\t\tsource: source.id,\n\t\t\t\trow,\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * A Nextcloud contact as a picker option.\n\t\t *\n\t\t * @param {object} source The contacts source.\n\t\t * @param {object} contact The contactsmenu entry.\n\t\t * @return {object|null}\n\t\t */\n\t\tcontactOptionOf(source, contact) {\n\t\t\tconst id = contact && (contact.id || contact.uid)\n\t\t\tif (!id) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tconst mail = Array.isArray(contact.emailAddresses) ? contact.emailAddresses[0] : ''\n\t\t\tconst kind = source.label ? this.cnTranslate(source.label) : ''\n\t\t\treturn { id, label: contact.fullName || String(id), secondary: [kind, mail].filter(Boolean).join(' · '), avatar: true, source: source.id, row: contact }\n\t\t},\n\n\t\t/**\n\t\t * Search after typing rests.\n\t\t *\n\t\t * @param {string} query The typed text.\n\t\t */\n\t\tonSearch(query) {\n\t\t\tclearTimeout(this.timer)\n\t\t\tconst term = String(query || '').trim()\n\t\t\tif (term.length < this.minLength) {\n\t\t\t\tthis.options = this.selectedOption ? [this.selectedOption] : []\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.timer = setTimeout(() => this.search(term), SEARCH_DELAY)\n\t\t},\n\n\t\t/**\n\t\t * Search every source at once. A term a source refused (400) is said\n\t\t * under the field in its words; a source that could not be searched at\n\t\t * all is named, so an empty list never hides a missing source.\n\t\t *\n\t\t * @spec openspec/changes/party-picker/specs/party-picker/spec.md#requirement-one-search-field-over-several-kinds-of-party\n\t\t * @param {string} term The search term.\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync search(term) {\n\t\t\tconst seq = ++this.searchSeq\n\t\t\tthis.searching = true\n\t\t\tlet refusal = ''\n\t\t\tconst unavailable = []\n\t\t\tconst sets = await Promise.all((this.sources || []).map(async (source) => {\n\t\t\t\ttry {\n\t\t\t\t\tif (source.type === 'contacts') {\n\t\t\t\t\t\tconst { data } = await axios.post(generateUrl('/contactsmenu/contacts'), { filter: term })\n\t\t\t\t\t\treturn (data && Array.isArray(data.contacts) ? data.contacts : []).map((c) => this.contactOptionOf(source, c))\n\t\t\t\t\t}\n\t\t\t\t\tif (this.isExactLookup(source, term) === true) {\n\t\t\t\t\t\tconst { data } = await axios.post(generateUrl(source.lookup.url), { term })\n\t\t\t\t\t\treturn (data && Array.isArray(data.results) ? data.results : []).map((row) => this.optionOf(source, row))\n\t\t\t\t\t}\n\t\t\t\t\tif (!source.register || !source.schema) {\n\t\t\t\t\t\treturn []\n\t\t\t\t\t}\n\t\t\t\t\tconst { data } = await axios.get(generateUrl(`/apps/openregister/api/objects/${source.register}/${source.schema}`), { params: { _search: term, _limit: source.limit || 8 } })\n\t\t\t\t\treturn (data && Array.isArray(data.results) ? data.results : []).map((row) => this.optionOf(source, row))\n\t\t\t\t} catch (failure) {\n\t\t\t\t\t// OpenRegister refuses a term it cannot parse with a 400 rather\n\t\t\t\t\t// than answering nothing, so that refusal is said, not hidden.\n\t\t\t\t\tconst response = failure && failure.response\n\t\t\t\t\tif (response && response.status === 400) {\n\t\t\t\t\t\tconst body = response.data\n\t\t\t\t\t\trefusal = String((body && (body.message || body.error)) || (typeof body === 'string' ? body : '') || refusal)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tunavailable.push(source.label ? this.cnTranslate(source.label) : String(source.id || ''))\n\t\t\t\t\t}\n\t\t\t\t\treturn []\n\t\t\t\t}\n\t\t\t}))\n\t\t\tif (seq !== this.searchSeq) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.options = sets.flat().filter(Boolean)\n\t\t\tthis.refusal = refusal\n\t\t\tthis.unavailable = unavailable.filter(Boolean)\n\t\t\tthis.searching = false\n\t\t},\n\n\t\t/**\n\t\t * Whether a typed term goes to the source's exact lookup instead of the\n\t\t * free-text search: `source.lookup` is `{ url, when }`, `when` a regular\n\t\t * expression the whole term must match (\"^[0-9]{9}$\" for a BSN). The\n\t\t * lookup is a POST, so the term never sits in a URL or a server log line,\n\t\t * and the app behind it may check and record who looked whom up.\n\t\t *\n\t\t * @param {object} source The source.\n\t\t * @param {string} term The typed term.\n\t\t * @return {boolean}\n\t\t * @spec openspec/changes/party-picker-exact-lookup/specs/party-picker/spec.md#requirement-a-party-source-can-look-a-term-up-exactly\n\t\t */\n\t\tisExactLookup(source, term) {\n\t\t\tconst lookup = source && source.lookup\n\t\t\tif (!lookup || typeof lookup.url !== 'string' || lookup.url === '' || typeof lookup.when !== 'string') {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\ttry {\n\t\t\t\treturn new RegExp(lookup.when).test(term)\n\t\t\t} catch {\n\t\t\t\treturn false\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Name a value the list does not hold: the first OpenRegister source\n\t\t * that has an object with that id.\n\t\t *\n\t\t * @param {string|number} id The id.\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync lookUp(id) {\n\t\t\tfor (const source of (this.sources || []).filter((s) => s.register && s.schema && s.type !== 'contacts')) {\n\t\t\t\ttry {\n\t\t\t\t\tconst { data } = await axios.get(generateUrl(`/apps/openregister/api/objects/${source.register}/${source.schema}/${encodeURIComponent(id)}`))\n\t\t\t\t\tconst option = data ? this.optionOf(source, data) : null\n\t\t\t\t\tif (option && String(this.modelValue) === String(id)) {\n\t\t\t\t\t\tthis.known = option\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t} catch {\n\t\t\t\t\t// Not in this source; try the next.\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Take the picked option: emit its id and the whole choice.\n\t\t *\n\t\t * @param {string|number|null} id The picked id.\n\t\t */\n\t\tonPick(id) {\n\t\t\tconst option = id === null ? null : this.options.find((o) => String(o.id) === String(id)) || null\n\t\t\tif (option) {\n\t\t\t\tthis.known = option\n\t\t\t}\n\t\t\t/** @event update:modelValue The chosen party's id, or null when cleared. */\n\t\t\tthis.$emit('update:modelValue', id)\n\t\t\t/** @event select The whole choice: `{ source, id, label, secondary, row }`, or null when cleared. */\n\t\t\tthis.$emit('select', option ? { source: option.source, id: option.id, label: option.label, secondary: option.secondary, row: option.row } : null)\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-party-picker__refusal {\n\tmargin: 4px 0 0;\n\tcolor: var(--color-error-text, var(--color-error));\n}\n\n.cn-party-picker__unavailable {\n\tmargin: 4px 0 0;\n\tcolor: var(--color-text-maxcontrast);\n}\n</style>\n"],"names":["_toDisplayString","_createElementBlock"],"mappings":";;AASM,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,iBAAc,GAAA;;;AAevB,EAAA,KAAE,EAAA,0BAAA;AACF,EAAA,IAAI,EAAC,OAAO;AACZ,EAAA,aAAU,EAAA,yBAAA;;;;;;;eAJoB,CAAA,yBAAA,EAAA;AAX7B,MAAA,UAAU,EAAE,QAAa,CAAA,cAAA;AACzB,MAAA,OAAO,EAAE,KAAO,CAAA,OAAA;AAChB,MAAA,UAAU,EAAE,MAAK,CAAA,UAAA;AACjB,MAAA,YAAY,EAAE,MAAM,CAAA,YAAA;AACpB,MAAA,WAAW,EAAE,MAAA,CAAA,WAAK,GAAA,QAAA,CAAA,WAAA,CAAA,MAAA,CAAA,WAAA,CAAA,GAAA,EAAA;AAClB,MAAA,OAAO,EAAE,KAAS,CAAA,SAAA;AAClB,MAAA,UAAU,EAAE,KAAI;AAChB,MAAA,SAAS,EAAE,MAAS,CAAA,SAAA;AACnB,MAAA,QAAO,EAAE,MAAI,CAAA,QAAA;AACf,MAAA,aAAW,EAAC,iBAAiB;AAC5B,MAAA,QAAM,EAAE,QAAE,CAAA,QAAA;AACV,MAAA,qBAAiB,EAAE,QAAM,CAAA,MAAA;;KAClB,KAAO,CAAA,OAAA;yCAKZ,eAAA,EAAAA,eAAA,CADA,UAAC,CAA+B,eAAA,EAAA,gCAAA,CAAA,CAAA,GAAA,GAAA,mBAAA,KAAA,CAAA,OAAA,CAAA,EAAA,CAAA,YAAA;;sBAEnCC,8CAAiB,KAAW,CAAA,WAAA,EAAA,CAAnB,IAAI,KAAA;2BAAbA;AACC,QAAA,GAAG,EAAE,IAAI;AACV,QAAA,KAAE,EAAA,8BAAA;AACF,QAAA,IAAG,EAAA,QAAA;;;;;;;;;"}
1
+ {"version":3,"file":"CnPartyPicker.vue3.js","sources":["../../../../src/components/CnPartyPicker/CnPartyPicker.vue?vue&type=template&id=4a9b14a6&lang.js"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n<template>\n\t<div class=\"cn-party-picker\">\n\t\t<CnSearchSelect\n\t\t\t:inputId=\"inputId\"\n\t\t\t:modelValue=\"selectedOption\"\n\t\t\t:options=\"options\"\n\t\t\t:inputLabel=\"inputLabel\"\n\t\t\t:labelOutside=\"labelOutside\"\n\t\t\t:placeholder=\"placeholder ? cnTranslate(placeholder) : ''\"\n\t\t\t:loading=\"searching\"\n\t\t\t:filterable=\"false\"\n\t\t\t:clearable=\"clearable\"\n\t\t\t:disabled=\"disabled\"\n\t\t\tdata-testid=\"cn-party-picker\"\n\t\t\t@search=\"onSearch\"\n\t\t\t@update:modelValue=\"onPick\" />\n\t\t<p v-if=\"refusal\"\n\t\t\tclass=\"cn-party-picker__refusal\"\n\t\t\trole=\"alert\"\n\t\t\tdata-testid=\"cn-party-picker-refusal\">\n\t\t\t{{ t('nextcloud-vue', 'This search could not be read.') }} {{ refusal }}\n\t\t</p>\n\t\t<p v-for=\"name in unavailable\"\n\t\t\t:key=\"name\"\n\t\t\tclass=\"cn-party-picker__unavailable\"\n\t\t\trole=\"status\"\n\t\t\tdata-testid=\"cn-party-picker-unavailable\">\n\t\t\t{{ t('nextcloud-vue', '{source} could not be searched, so this list may be incomplete.', { source: name }) }}\n\t\t</p>\n\t</div>\n</template>\n\n<script>\nimport axios from '@nextcloud/axios'\nimport { translate as t } from '@nextcloud/l10n'\nimport { generateUrl } from '@nextcloud/router'\nimport { fillTemplate } from '../../utils/fillTemplate.js'\nimport { CnSearchSelect } from '../CnSearchSelect/index.js'\n\n/** How long typing rests before a search runs, in ms. */\nconst SEARCH_DELAY = 250\n\n/**\n * CnPartyPicker — one search field over several kinds of party: people and\n * organisations from OpenRegister register sets (BRP persons, KvK companies,\n * an app's own clients) and the reader's Nextcloud contacts, as rows with\n * initials, the name and a second line, in one list (board DqNieuweZaak\n * \"Aanvrager\": \"Henk Visser · Inwoner · Beukenlaan 3\", \"Visser Bouw B.V. ·\n * Organisatie · KvK …\"). Built on CnSearchSelect.\n *\n * `sources`: each `{ id, register, schema, label?, title?, secondary?,\n * limit?, icon?, lookup? }` searches OpenRegister with `_search`; `lookup`\n * (`{ url, when }`) sends a term matching `when` to the app's exact lookup\n * instead (a POST of `{ term }` answering `{ results }`); `title` and\n * `secondary` are templates filled from the row (default `{name}` / none),\n * `label` names the kind (\"Resident\") and starts the second line; `label`\n * and `secondary` go through the host translate, so a manifest can write\n * `\"CoC {kvkNumber}\"` and a Dutch reader sees \"KvK 24157431\". A source\n * `{ id, type: \"contacts\", label? }` searches the reader's Nextcloud contacts.\n *\n * `update:modelValue` emits the chosen row's id (a contact has none and\n * emits its contact id); `select` emits the whole choice: `{ source, id,\n * label, secondary, row }`, so a host can store more than the id (a case's\n * initiator type, source id and display name). A `modelValue` the list does\n * not hold is shown by its `selectedLabel`, else looked up by id in the\n * OpenRegister sources.\n *\n * ```vue\n * <CnPartyPicker\n * v-model=\"case.requester\"\n * input-label=\"Requester\"\n * :sources=\"[\n * { id: 'person', register: 'dossiq', schema: 'brpPerson', label: 'Resident', title: '{firstName} {lastName}', secondary: '{residence.street} {residence.houseNumber}' },\n * { id: 'company', register: 'dossiq', schema: 'kvkCompany', label: 'Organisation', title: '{tradeName}', secondary: 'KvK {sourceId}' },\n * { id: 'contact', type: 'contacts', label: 'Contact' },\n * ]\"\n * @select=\"onRequester\" />\n * ```\n */\nexport default {\n\tname: 'CnPartyPicker',\n\n\tcomponents: { CnSearchSelect },\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/** The search input's id, so the form's own label names it. */\n\t\tinputId: {\n\t\t\ttype: String,\n\t\t\tdefault: undefined,\n\t\t},\n\n\t\t/** The chosen party's id. */\n\t\tmodelValue: {\n\t\t\ttype: [String, Number],\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * Where to search: OpenRegister sets `{ id, register, schema, label?,\n\t\t * title?, secondary?, limit?, icon? }`, or `{ id, type: \"contacts\",\n\t\t * label? }` for the reader's Nextcloud contacts.\n\t\t *\n\t\t * @type {Array<object>}\n\t\t */\n\t\tsources: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t\t/** The field's label. */\n\t\tinputLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** Draw the label above the field. */\n\t\tlabelOutside: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/** Placeholder (\"Name, BSN, trade name or KvK number\"), through the host translate. */\n\t\tplaceholder: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The chosen party's name, shown before the list holds it. */\n\t\tselectedLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** Offer a clear button. */\n\t\tclearable: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true,\n\t\t},\n\n\t\t/** Disable the field. */\n\t\tdisabled: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/** The fewest characters a search needs. */\n\t\tminLength: {\n\t\t\ttype: Number,\n\t\t\tdefault: 2,\n\t\t},\n\t},\n\n\temits: ['update:modelValue', 'select'],\n\n\tdata() {\n\t\treturn {\n\t\t\toptions: [],\n\t\t\tsearching: false,\n\t\t\tknown: null,\n\t\t\ttimer: null,\n\t\t\tsearchSeq: 0,\n\t\t\trefusal: '',\n\t\t\tunavailable: [],\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/**\n\t\t * The option for `modelValue`: in the list, else the known choice,\n\t\t * else one named by `selectedLabel`.\n\t\t *\n\t\t * @spec openspec/changes/party-picker/specs/party-picker/spec.md#requirement-one-search-field-over-several-kinds-of-party\n\t\t * @return {object|null}\n\t\t */\n\t\tselectedOption() {\n\t\t\tconst value = this.modelValue\n\t\t\tif (value === null || value === undefined || value === '') {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tconst found = this.options.find((o) => String(o.id) === String(value))\n\t\t\tif (found) {\n\t\t\t\treturn found\n\t\t\t}\n\t\t\tif (this.known && String(this.known.id) === String(value)) {\n\t\t\t\treturn this.known\n\t\t\t}\n\t\t\treturn { id: value, label: this.selectedLabel || String(value), avatar: true }\n\t\t},\n\t},\n\n\twatch: {\n\t\tmodelValue: {\n\t\t\timmediate: true,\n\t\t\thandler(value) {\n\t\t\t\tif (value && !this.selectedLabel && !this.options.some((o) => String(o.id) === String(value))) {\n\t\t\t\t\tthis.lookUp(value)\n\t\t\t\t}\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 source's row as a picker option.\n\t\t *\n\t\t * @param {object} source The source.\n\t\t * @param {object} row The row.\n\t\t * @return {object|null} The option, or null without an id.\n\t\t */\n\t\toptionOf(source, row) {\n\t\t\tconst id = row && (row.id ?? row['@self']?.id ?? row.uuid)\n\t\t\tif (id === undefined || id === null || id === '') {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tconst title = (source.title ? fillTemplate(source.title, row) : (row.name || row.title || row.displayName || '')).trim() || String(id)\n\t\t\tconst detail = source.secondary ? fillTemplate(this.cnTranslate(source.secondary), row).trim() : ''\n\t\t\tconst kind = source.label ? this.cnTranslate(source.label) : ''\n\t\t\treturn {\n\t\t\t\tid,\n\t\t\t\tlabel: title,\n\t\t\t\tsecondary: [kind, detail].filter(Boolean).join(' · '),\n\t\t\t\tavatar: !source.icon,\n\t\t\t\ticon: source.icon || '',\n\t\t\t\tsource: source.id,\n\t\t\t\trow,\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * A Nextcloud contact as a picker option.\n\t\t *\n\t\t * @param {object} source The contacts source.\n\t\t * @param {object} contact The contactsmenu entry.\n\t\t * @return {object|null}\n\t\t */\n\t\tcontactOptionOf(source, contact) {\n\t\t\tconst id = contact && (contact.id || contact.uid)\n\t\t\tif (!id) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tconst mail = Array.isArray(contact.emailAddresses) ? contact.emailAddresses[0] : ''\n\t\t\tconst kind = source.label ? this.cnTranslate(source.label) : ''\n\t\t\treturn { id, label: contact.fullName || String(id), secondary: [kind, mail].filter(Boolean).join(' · '), avatar: true, source: source.id, row: contact }\n\t\t},\n\n\t\t/**\n\t\t * Search after typing rests.\n\t\t *\n\t\t * @param {string} query The typed text.\n\t\t */\n\t\tonSearch(query) {\n\t\t\tclearTimeout(this.timer)\n\t\t\tconst term = String(query || '').trim()\n\t\t\tif (term.length < this.minLength) {\n\t\t\t\tthis.options = this.selectedOption ? [this.selectedOption] : []\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.timer = setTimeout(() => this.search(term), SEARCH_DELAY)\n\t\t},\n\n\t\t/**\n\t\t * Search every source at once. A term a source refused (400) is said\n\t\t * under the field in its words; a source that could not be searched at\n\t\t * all is named, so an empty list never hides a missing source.\n\t\t *\n\t\t * @spec openspec/changes/party-picker/specs/party-picker/spec.md#requirement-one-search-field-over-several-kinds-of-party\n\t\t * @param {string} term The search term.\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync search(term) {\n\t\t\tconst seq = ++this.searchSeq\n\t\t\tthis.searching = true\n\t\t\tlet refusal = ''\n\t\t\tconst unavailable = []\n\t\t\tconst sets = await Promise.all((this.sources || []).map(async (source) => {\n\t\t\t\ttry {\n\t\t\t\t\tif (source.type === 'contacts') {\n\t\t\t\t\t\tconst { data } = await axios.post(generateUrl('/contactsmenu/contacts'), { filter: term })\n\t\t\t\t\t\treturn (data && Array.isArray(data.contacts) ? data.contacts : []).map((c) => this.contactOptionOf(source, c))\n\t\t\t\t\t}\n\t\t\t\t\tif (this.isExactLookup(source, term) === true) {\n\t\t\t\t\t\tconst { data } = await axios.post(generateUrl(source.lookup.url), { term })\n\t\t\t\t\t\treturn (data && Array.isArray(data.results) ? data.results : []).map((row) => this.optionOf(source, row))\n\t\t\t\t\t}\n\t\t\t\t\tif (!source.register || !source.schema) {\n\t\t\t\t\t\treturn []\n\t\t\t\t\t}\n\t\t\t\t\tconst { data } = await axios.get(generateUrl(`/apps/openregister/api/objects/${source.register}/${source.schema}`), { params: { _search: term, _limit: source.limit || 8 } })\n\t\t\t\t\treturn (data && Array.isArray(data.results) ? data.results : []).map((row) => this.optionOf(source, row))\n\t\t\t\t} catch (failure) {\n\t\t\t\t\t// OpenRegister refuses a term it cannot parse with a 400 rather\n\t\t\t\t\t// than answering nothing, so that refusal is said, not hidden.\n\t\t\t\t\tconst response = failure && failure.response\n\t\t\t\t\tif (response && response.status === 400) {\n\t\t\t\t\t\tconst body = response.data\n\t\t\t\t\t\trefusal = String((body && (body.message || body.error)) || (typeof body === 'string' ? body : '') || refusal)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tunavailable.push(source.label ? this.cnTranslate(source.label) : String(source.id || ''))\n\t\t\t\t\t}\n\t\t\t\t\treturn []\n\t\t\t\t}\n\t\t\t}))\n\t\t\tif (seq !== this.searchSeq) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.options = sets.flat().filter(Boolean)\n\t\t\tthis.refusal = refusal\n\t\t\tthis.unavailable = unavailable.filter(Boolean)\n\t\t\tthis.searching = false\n\t\t},\n\n\t\t/**\n\t\t * Whether a typed term goes to the source's exact lookup instead of the\n\t\t * free-text search: `source.lookup` is `{ url, when }`, `when` a regular\n\t\t * expression the whole term must match (\"^[0-9]{9}$\" for a BSN). The\n\t\t * lookup is a POST, so the term never sits in a URL or a server log line,\n\t\t * and the app behind it may check and record who looked whom up.\n\t\t *\n\t\t * @param {object} source The source.\n\t\t * @param {string} term The typed term.\n\t\t * @return {boolean}\n\t\t * @spec openspec/changes/party-picker-exact-lookup/specs/party-picker/spec.md#requirement-a-party-source-can-look-a-term-up-exactly\n\t\t */\n\t\tisExactLookup(source, term) {\n\t\t\tconst lookup = source && source.lookup\n\t\t\tif (!lookup || typeof lookup.url !== 'string' || lookup.url === '' || typeof lookup.when !== 'string') {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\ttry {\n\t\t\t\treturn new RegExp(lookup.when).test(term)\n\t\t\t} catch {\n\t\t\t\treturn false\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Name a value the list does not hold: the first OpenRegister source\n\t\t * that has an object with that id.\n\t\t *\n\t\t * @param {string|number} id The id.\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync lookUp(id) {\n\t\t\tfor (const source of (this.sources || []).filter((s) => s.register && s.schema && s.type !== 'contacts')) {\n\t\t\t\ttry {\n\t\t\t\t\tconst { data } = await axios.get(generateUrl(`/apps/openregister/api/objects/${source.register}/${source.schema}/${encodeURIComponent(id)}`))\n\t\t\t\t\tconst option = data ? this.optionOf(source, data) : null\n\t\t\t\t\tif (option && String(this.modelValue) === String(id)) {\n\t\t\t\t\t\tthis.known = option\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t} catch {\n\t\t\t\t\t// Not in this source; try the next.\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Take the picked option: emit its id and the whole choice.\n\t\t *\n\t\t * @param {string|number|null} id The picked id.\n\t\t */\n\t\tonPick(id) {\n\t\t\tconst option = id === null ? null : this.options.find((o) => String(o.id) === String(id)) || null\n\t\t\tif (option) {\n\t\t\t\tthis.known = option\n\t\t\t}\n\t\t\t/** @event update:modelValue The chosen party's id, or null when cleared. */\n\t\t\tthis.$emit('update:modelValue', id)\n\t\t\t/** @event select The whole choice: `{ source, id, label, secondary, row }`, or null when cleared. */\n\t\t\tthis.$emit('select', option ? { source: option.source, id: option.id, label: option.label, secondary: option.secondary, row: option.row } : null)\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-party-picker__refusal {\n\tmargin: 4px 0 0;\n\tcolor: var(--color-error-text, var(--color-error));\n}\n\n.cn-party-picker__unavailable {\n\tmargin: 4px 0 0;\n\tcolor: var(--color-text-maxcontrast);\n}\n</style>\n"],"names":["_openBlock","_createElementBlock","_toDisplayString"],"mappings":";;AASM,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,iBAAQ,GAAA;;;AAgBjB,EAAA,KAAE,EAAA,0BAAA;AACF,EAAA,IAAI,EAAC,OAAO;AACZ,EAAA,aAAU,EAAA,yBAAA;;;;;;AAlBV,EAAA,QAAAA,SAAA,EAAA,EAAAC,kBAAA,QAAA;eAc8B,CAAA,yBAAA,EAAA;AAZ7B,MAAA,OAAO,EAAE,MAAO,CAAA,OAAA;AAChB,MAAA,UAAU,EAAE,QAAa,CAAA,cAAA;AACzB,MAAA,OAAO,EAAE,KAAO,CAAA,OAAA;AAChB,MAAA,UAAU,EAAE,MAAK,CAAA,UAAA;AACjB,MAAA,YAAY,EAAE,MAAM,CAAA,YAAA;AACpB,MAAA,WAAW,EAAE,MAAA,CAAA,WAAK,GAAA,QAAA,CAAA,WAAA,CAAA,MAAA,CAAA,WAAA,CAAA,GAAA,EAAA;AAClB,MAAA,OAAO,EAAE,KAAS,CAAA,SAAA;AAClB,MAAA,UAAU,EAAE,KAAI;AAChB,MAAA,SAAS,EAAE,MAAS,CAAA,SAAA;AACnB,MAAA,QAAO,EAAE,MAAI,CAAA,QAAA;AACf,MAAA,aAAW,EAAC,iBAAiB;AAC5B,MAAA,QAAM,EAAE,QAAE,CAAA,QAAA;AACV,MAAA,qBAAiB,EAAE,QAAM,CAAA,MAAA;;KAClB,KAAO,CAAA,OAAA;yCAKZ,eAAA,EAAAC,eAAA,CADA,UAAC,CAA+B,eAAA,EAAA,gCAAA,CAAA,CAAA,GAAA,GAAA,mBAAA,KAAA,CAAA,OAAA,CAAA,EAAA,CAAA,YAAA;;sBAEnCD,8CAAiB,KAAW,CAAA,WAAA,EAAA,CAAnB,IAAI,KAAA;2BAAbA;AACC,QAAA,GAAG,EAAE,IAAI;AACV,QAAA,KAAE,EAAA,8BAAA;AACF,QAAA,IAAG,EAAA,QAAA;;;;;;;;;"}
@@ -2,7 +2,7 @@ import script from './CnSavedViewLookFields.vue2.js';
2
2
  import { render } from './CnSavedViewLookFields.vue3.js';
3
3
 
4
4
  script.render = render;
5
- script.__scopeId = "data-v-6fab246c";
5
+ script.__scopeId = "data-v-f0552066";
6
6
  const __sfc_main = script;
7
7
 
8
8
  export { __sfc_main as default };
@@ -1 +1 @@
1
- {"version":3,"file":"CnSavedViewLookFields.vue2.js","sources":["../../../../src/components/CnSavedViewLookFields/CnSavedViewLookFields.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n<template>\n\t<div class=\"cn-saved-view-look\" data-testid=\"cn-saved-view-look-fields\">\n\t\t<NcTextField\n\t\t\t:modelValue=\"description\"\n\t\t\t:label=\"t('nextcloud-vue', 'Description')\"\n\t\t\t:labelVisible=\"true\"\n\t\t\t:helperText=\"t('nextcloud-vue', 'Shown when you point at the view in the menu.')\"\n\t\t\tdata-testid=\"cn-saved-view-description\"\n\t\t\t@update:modelValue=\"onDescription\" />\n\t\t<div\n\t\t\tclass=\"cn-saved-view-look__icons\"\n\t\t\trole=\"radiogroup\"\n\t\t\t:aria-label=\"t('nextcloud-vue', 'Icon')\"\n\t\t\tdata-testid=\"cn-saved-view-icon\">\n\t\t\t<span class=\"cn-saved-view-look__label\" aria-hidden=\"true\">{{ t('nextcloud-vue', 'Icon') }}</span>\n\t\t\t<button\n\t\t\t\tv-for=\"name in iconNames\"\n\t\t\t\t:key=\"name\"\n\t\t\t\ttype=\"button\"\n\t\t\t\trole=\"radio\"\n\t\t\t\tclass=\"cn-saved-view-look__icon\"\n\t\t\t\t:class=\"{ 'cn-saved-view-look__icon--chosen': name === chosenIcon }\"\n\t\t\t\t:aria-checked=\"name === chosenIcon ? 'true' : 'false'\"\n\t\t\t\t:aria-label=\"iconLabel(name)\"\n\t\t\t\t:title=\"iconLabel(name)\"\n\t\t\t\t:data-icon=\"name\"\n\t\t\t\t@click=\"onIcon(name)\">\n\t\t\t\t<component :is=\"componentOf(name)\" :size=\"20\" />\n\t\t\t</button>\n\t\t</div>\n\t</div>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport { NcTextField } from '@nextcloud/vue'\nimport { SAVED_VIEW_ICONS, SAVED_VIEW_MENU_DEFAULT_ICON } from '../../utils/savedViewMenu.js'\nimport { getSemanticIconComponent } from '../CnIcon/semanticIcons.js'\n\n/**\n * CnSavedViewLookFields — a saved view's description and icon, in the save\n * and edit dialogs. The description is the tooltip on the view's menu entry;\n * the icon stands before it in the menu. The icons are a short list from the\n * shared semantic vocabulary, so every one resolves in the menu without the\n * app registering it. Choosing the menu's own default icon stores none.\n *\n * @event {string} update:description The typed description.\n * @event {string} update:icon The chosen icon name, '' for the default.\n * @spec openspec/changes/saved-view-icon-description-count/specs/saved-view-icon-description-count/spec.md#requirement-a-saved-view-has-an-icon-and-a-description\n */\nexport default {\n\tname: 'CnSavedViewLookFields',\n\n\tcomponents: { NcTextField },\n\n\tprops: {\n\t\t/** The view's description. */\n\t\tdescription: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The view's icon name, '' for the menu's default. */\n\t\ticon: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\t},\n\n\temits: ['update:description', 'update:icon'],\n\n\tcomputed: {\n\t\t/** @return {string} The icon the menu falls back to. */\n\t\tdefaultIcon() {\n\t\t\treturn SAVED_VIEW_MENU_DEFAULT_ICON\n\t\t},\n\n\t\t/** @return {Array<string>} The icons offered, the default first. */\n\t\ticonNames() {\n\t\t\treturn SAVED_VIEW_ICONS\n\t\t},\n\n\t\t/** @return {string} The icon shown as chosen. */\n\t\tchosenIcon() {\n\t\t\treturn this.icon && SAVED_VIEW_ICONS.includes(this.icon) ? this.icon : SAVED_VIEW_MENU_DEFAULT_ICON\n\t\t},\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Pass the typed description on.\n\t\t *\n\t\t * @param {string} value The description.\n\t\t * @return {void}\n\t\t */\n\t\tonDescription(value) {\n\t\t\t/** @event update:description The typed description. */\n\t\t\tthis.$emit('update:description', value)\n\t\t},\n\n\t\t/**\n\t\t * Pass the chosen icon on; the menu's own default icon is stored as none.\n\t\t *\n\t\t * @param {string} name The icon name.\n\t\t * @return {void}\n\t\t */\n\t\tonIcon(name) {\n\t\t\t/** @event update:icon The chosen icon name, '' for the menu's default. */\n\t\t\tthis.$emit('update:icon', name === this.defaultIcon ? '' : name)\n\t\t},\n\n\t\tt,\n\n\t\t/**\n\t\t * The accessible name of an icon option: what it shows, in words.\n\t\t *\n\t\t * @param {string} name An icon name.\n\t\t * @return {string} Its label, or the name when it has none.\n\t\t * @spec openspec/changes/saved-view-icon-labels/specs/saved-view-icon-labels/spec.md#requirement-an-icon-option-is-named-in-words\n\t\t */\n\t\ticonLabel(name) {\n\t\t\tconst labels = {\n\t\t\t\tFilterVariant: t('nextcloud-vue', 'Filter'),\n\t\t\t\tClockOutline: t('nextcloud-vue', 'Clock'),\n\t\t\t\tClockAlertOutline: t('nextcloud-vue', 'Clock with warning'),\n\t\t\t\tCalendarClockOutline: t('nextcloud-vue', 'Calendar with clock'),\n\t\t\t\tCalendarOutline: t('nextcloud-vue', 'Calendar'),\n\t\t\t\tAccountOutline: t('nextcloud-vue', 'Person'),\n\t\t\t\tAccountGroupOutline: t('nextcloud-vue', 'Group'),\n\t\t\t\tFolderOutline: t('nextcloud-vue', 'Folder'),\n\t\t\t\tFileDocumentOutline: t('nextcloud-vue', 'Document'),\n\t\t\t\tAlertCircleOutline: t('nextcloud-vue', 'Attention'),\n\t\t\t\tCheckCircleOutline: t('nextcloud-vue', 'Ready'),\n\t\t\t\tEmailOutline: t('nextcloud-vue', 'Email'),\n\t\t\t\tMapMarkerOutline: t('nextcloud-vue', 'Location'),\n\t\t\t\tTagOutline: t('nextcloud-vue', 'Label'),\n\t\t\t\tBellOutline: t('nextcloud-vue', 'Bell'),\n\t\t\t\tScaleBalance: t('nextcloud-vue', 'Scales'),\n\t\t\t\tBriefcaseOutline: t('nextcloud-vue', 'Briefcase'),\n\t\t\t\tEyeOutline: t('nextcloud-vue', 'Eye'),\n\t\t\t\tLockOutline: t('nextcloud-vue', 'Lock'),\n\t\t\t\tCurrencyEur: t('nextcloud-vue', 'Euro'),\n\t\t\t}\n\t\t\treturn labels[name] || name\n\t\t},\n\n\t\t/**\n\t\t * @param {string} name An icon name.\n\t\t * @return {object|null} Its component.\n\t\t */\n\t\tcomponentOf(name) {\n\t\t\treturn getSemanticIconComponent(name)\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-saved-view-look {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 12px;\n}\n\n.cn-saved-view-look__icons {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tgap: 4px;\n}\n\n.cn-saved-view-look__label {\n\tflex: 0 0 100%;\n\tfont-weight: 600;\n}\n\n.cn-saved-view-look__icon {\n\tdisplay: inline-flex;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: var(--default-clickable-area);\n\theight: var(--default-clickable-area);\n\tpadding: 0;\n\tborder: 1px solid var(--color-border);\n\tborder-radius: var(--border-radius-element, 8px);\n\tbackground: var(--color-main-background);\n\tcolor: var(--color-main-text);\n\tcursor: pointer;\n}\n\n.cn-saved-view-look__icon--chosen {\n\tborder-color: var(--color-primary-element);\n\tbackground: var(--color-primary-element-light);\n\tcolor: var(--color-primary-element-light-text);\n}\n\n.cn-saved-view-look__icon:focus-visible {\n\toutline: 2px solid var(--color-primary-element);\n\toutline-offset: 2px;\n}\n</style>\n"],"names":["t"],"mappings":";;;;;AA2CA;AACC;AACA;;AAEA;;AAEA;;;AAGA;;AAED,aAAe;CACd,IAAI,EAAE,uBAAuB;;CAE7B,UAAU,EAAE,EAAE,WAAU,EAAG;;AAE3B,CAAA,KAAK,EAAE;;EAEN,WAAW,EAAE;GACZ,IAAI,EAAE,MAAM;GACZ,OAAO,EAAE,EAAE;GACX;;AAED;EACA,IAAI,EAAE;GACL,IAAI,EAAE,MAAM;GACZ,OAAO,EAAE,EAAE;GACX;EACD;;AAED,CAAA,KAAK,EAAE,CAAC,oBAAoB,EAAE,aAAa,CAAC;;AAE5C,CAAA,QAAQ,EAAE;AACT;EACA,WAAW,GAAG;AACb,GAAA,OAAO,4BAA2B;GAClC;;;EAGD,SAAS,GAAG;AACX,GAAA,OAAO,gBAAe;GACtB;;AAED;EACA,UAAU,GAAG;AACZ,GAAA,OAAO,IAAI,CAAC,IAAK,IAAG,gBAAgB,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAA,GAAI,IAAI,CAAC,OAAO,4BAA2B;GAClG;EACD;;AAED,CAAA,OAAO,EAAE;AACR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vC,IAAA,WAAW,EAAEA,SAAC,CAAC,eAAe,EAAE,MAAM,CAAC;AACvC,IAAA,YAAY,EAAEA,SAAC,CAAC,eAAe,EAAE,QAAQ,CAAC;IAC1C,gBAAgB,EAAEA,SAAC,CAAC,eAAe,EAAE,WAAW,CAAC;AACjD,IAAA,UAAU,EAAEA,SAAC,CAAC,eAAe,EAAE,KAAK,CAAC;AACrC,IAAA,WAAW,EAAEA,SAAC,CAAC,eAAe,EAAE,MAAM,CAAC;AACvC,IAAA,WAAW,EAAEA,SAAC,CAAC,eAAe,EAAE,MAAM,CAAC;AACxC,KAAA;GACA,OAAO,MAAM,CAAC,IAAI,KAAK,IAAG;GAC1B;;AAED;;AAEC;;AAED,EAAA,WAAW,CAAC,IAAI,EAAE;AACjB,GAAA,OAAO,wBAAwB,CAAC,IAAI,CAAA;GACpC;EACD;AACF;;;;"}
1
+ {"version":3,"file":"CnSavedViewLookFields.vue2.js","sources":["../../../../src/components/CnSavedViewLookFields/CnSavedViewLookFields.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n<template>\n\t<div class=\"cn-saved-view-look\" data-testid=\"cn-saved-view-look-fields\">\n\t\t<NcTextField\n\t\t\t:modelValue=\"description\"\n\t\t\t:label=\"t('nextcloud-vue', 'Description')\"\n\t\t\t:labelVisible=\"true\"\n\t\t\t:helperText=\"t('nextcloud-vue', 'Shown when you point at the view in the menu.')\"\n\t\t\tdata-testid=\"cn-saved-view-description\"\n\t\t\t@update:modelValue=\"onDescription\" />\n\t\t<div class=\"cn-saved-view-look__icon-field\">\n\t\t\t<span class=\"cn-saved-view-look__label\" aria-hidden=\"true\">{{ t('nextcloud-vue', 'Icon') }}</span>\n\t\t\t<div\n\t\t\t\tclass=\"cn-saved-view-look__icons\"\n\t\t\t\trole=\"radiogroup\"\n\t\t\t\t:aria-label=\"t('nextcloud-vue', 'Icon')\"\n\t\t\t\tdata-testid=\"cn-saved-view-icon\">\n\t\t\t\t<button\n\t\t\t\t\tv-for=\"name in iconNames\"\n\t\t\t\t\t:key=\"name\"\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\trole=\"radio\"\n\t\t\t\t\tclass=\"cn-saved-view-look__icon\"\n\t\t\t\t\t:class=\"{ 'cn-saved-view-look__icon--chosen': name === chosenIcon }\"\n\t\t\t\t\t:aria-checked=\"name === chosenIcon ? 'true' : 'false'\"\n\t\t\t\t\t:aria-label=\"iconLabel(name)\"\n\t\t\t\t\t:title=\"iconLabel(name)\"\n\t\t\t\t\t:data-icon=\"name\"\n\t\t\t\t\t@click=\"onIcon(name)\">\n\t\t\t\t\t<component :is=\"componentOf(name)\" :size=\"20\" />\n\t\t\t\t</button>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport { NcTextField } from '@nextcloud/vue'\nimport { SAVED_VIEW_ICONS, SAVED_VIEW_MENU_DEFAULT_ICON } from '../../utils/savedViewMenu.js'\nimport { getSemanticIconComponent } from '../CnIcon/semanticIcons.js'\n\n/**\n * CnSavedViewLookFields — a saved view's description and icon, in the save\n * and edit dialogs. The description is the tooltip on the view's menu entry;\n * the icon stands before it in the menu. The icons are a short list from the\n * shared semantic vocabulary, so every one resolves in the menu without the\n * app registering it. Choosing the menu's own default icon stores none.\n *\n * @event {string} update:description The typed description.\n * @event {string} update:icon The chosen icon name, '' for the default.\n * @spec openspec/changes/saved-view-icon-description-count/specs/saved-view-icon-description-count/spec.md#requirement-a-saved-view-has-an-icon-and-a-description\n */\nexport default {\n\tname: 'CnSavedViewLookFields',\n\n\tcomponents: { NcTextField },\n\n\tprops: {\n\t\t/** The view's description. */\n\t\tdescription: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The view's icon name, '' for the menu's default. */\n\t\ticon: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\t},\n\n\temits: ['update:description', 'update:icon'],\n\n\tcomputed: {\n\t\t/** @return {string} The icon the menu falls back to. */\n\t\tdefaultIcon() {\n\t\t\treturn SAVED_VIEW_MENU_DEFAULT_ICON\n\t\t},\n\n\t\t/** @return {Array<string>} The icons offered, the default first. */\n\t\ticonNames() {\n\t\t\treturn SAVED_VIEW_ICONS\n\t\t},\n\n\t\t/** @return {string} The icon shown as chosen. */\n\t\tchosenIcon() {\n\t\t\treturn this.icon && SAVED_VIEW_ICONS.includes(this.icon) ? this.icon : SAVED_VIEW_MENU_DEFAULT_ICON\n\t\t},\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Pass the typed description on.\n\t\t *\n\t\t * @param {string} value The description.\n\t\t * @return {void}\n\t\t */\n\t\tonDescription(value) {\n\t\t\t/** @event update:description The typed description. */\n\t\t\tthis.$emit('update:description', value)\n\t\t},\n\n\t\t/**\n\t\t * Pass the chosen icon on; the menu's own default icon is stored as none.\n\t\t *\n\t\t * @param {string} name The icon name.\n\t\t * @return {void}\n\t\t */\n\t\tonIcon(name) {\n\t\t\t/** @event update:icon The chosen icon name, '' for the menu's default. */\n\t\t\tthis.$emit('update:icon', name === this.defaultIcon ? '' : name)\n\t\t},\n\n\t\tt,\n\n\t\t/**\n\t\t * The accessible name of an icon option: what it shows, in words.\n\t\t *\n\t\t * @param {string} name An icon name.\n\t\t * @return {string} Its label, or the name when it has none.\n\t\t * @spec openspec/changes/saved-view-icon-labels/specs/saved-view-icon-labels/spec.md#requirement-an-icon-option-is-named-in-words\n\t\t */\n\t\ticonLabel(name) {\n\t\t\tconst labels = {\n\t\t\t\tFilterVariant: t('nextcloud-vue', 'Filter'),\n\t\t\t\tClockOutline: t('nextcloud-vue', 'Clock'),\n\t\t\t\tClockAlertOutline: t('nextcloud-vue', 'Clock with warning'),\n\t\t\t\tCalendarClockOutline: t('nextcloud-vue', 'Calendar with clock'),\n\t\t\t\tCalendarOutline: t('nextcloud-vue', 'Calendar'),\n\t\t\t\tAccountOutline: t('nextcloud-vue', 'Person'),\n\t\t\t\tAccountGroupOutline: t('nextcloud-vue', 'Group'),\n\t\t\t\tFolderOutline: t('nextcloud-vue', 'Folder'),\n\t\t\t\tFileDocumentOutline: t('nextcloud-vue', 'Document'),\n\t\t\t\tAlertCircleOutline: t('nextcloud-vue', 'Attention'),\n\t\t\t\tCheckCircleOutline: t('nextcloud-vue', 'Ready'),\n\t\t\t\tEmailOutline: t('nextcloud-vue', 'Email'),\n\t\t\t\tMapMarkerOutline: t('nextcloud-vue', 'Location'),\n\t\t\t\tTagOutline: t('nextcloud-vue', 'Label'),\n\t\t\t\tBellOutline: t('nextcloud-vue', 'Bell'),\n\t\t\t\tScaleBalance: t('nextcloud-vue', 'Scales'),\n\t\t\t\tBriefcaseOutline: t('nextcloud-vue', 'Briefcase'),\n\t\t\t\tEyeOutline: t('nextcloud-vue', 'Eye'),\n\t\t\t\tLockOutline: t('nextcloud-vue', 'Lock'),\n\t\t\t\tCurrencyEur: t('nextcloud-vue', 'Euro'),\n\t\t\t}\n\t\t\treturn labels[name] || name\n\t\t},\n\n\t\t/**\n\t\t * @param {string} name An icon name.\n\t\t * @return {object|null} Its component.\n\t\t */\n\t\tcomponentOf(name) {\n\t\t\treturn getSemanticIconComponent(name)\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-saved-view-look {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 12px;\n}\n\n.cn-saved-view-look__icons {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tgap: 4px;\n}\n\n.cn-saved-view-look__icon-field {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 4px;\n}\n\n.cn-saved-view-look__label {\n\tfont-weight: 600;\n}\n\n.cn-saved-view-look__icon {\n\tdisplay: inline-flex;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: var(--default-clickable-area);\n\theight: var(--default-clickable-area);\n\tpadding: 0;\n\tborder: 1px solid var(--color-border);\n\tborder-radius: var(--border-radius-element, 8px);\n\tbackground: var(--color-main-background);\n\tcolor: var(--color-main-text);\n\tcursor: pointer;\n}\n\n.cn-saved-view-look__icon--chosen {\n\tborder-color: var(--color-primary-element);\n\tbackground: var(--color-primary-element-light);\n\tcolor: var(--color-primary-element-light-text);\n}\n\n.cn-saved-view-look__icon:focus-visible {\n\toutline: 2px solid var(--color-primary-element);\n\toutline-offset: 2px;\n}\n</style>\n"],"names":["t"],"mappings":";;;;;AA6CA;AACC;AACA;;AAEA;;AAEA;;;AAGA;;AAED,aAAe;CACd,IAAI,EAAE,uBAAuB;;CAE7B,UAAU,EAAE,EAAE,WAAU,EAAG;;AAE3B,CAAA,KAAK,EAAE;;EAEN,WAAW,EAAE;GACZ,IAAI,EAAE,MAAM;GACZ,OAAO,EAAE,EAAE;GACX;;AAED;EACA,IAAI,EAAE;GACL,IAAI,EAAE,MAAM;GACZ,OAAO,EAAE,EAAE;GACX;EACD;;AAED,CAAA,KAAK,EAAE,CAAC,oBAAoB,EAAE,aAAa,CAAC;;AAE5C,CAAA,QAAQ,EAAE;AACT;EACA,WAAW,GAAG;AACb,GAAA,OAAO,4BAA2B;GAClC;;;EAGD,SAAS,GAAG;AACX,GAAA,OAAO,gBAAe;GACtB;;AAED;EACA,UAAU,GAAG;AACZ,GAAA,OAAO,IAAI,CAAC,IAAK,IAAG,gBAAgB,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAA,GAAI,IAAI,CAAC,OAAO,4BAA2B;GAClG;EACD;;AAED,CAAA,OAAO,EAAE;AACR;;AAEC;AACA;;;AAGD,EAAA,aAAa,CAAC,KAAK,EAAE;;AAEpB,GAAA,IAAI,CAAC,KAAK,CAAC,oBAAoB,EAAE,KAAK,EAAA;GACtC;;AAED;;AAEC;AACA;;;EAGD,MAAM,CAAC,IAAI,EAAE;;GAEZ,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE,SAAS,IAAI,CAAC,WAAY,GAAE,EAAC,GAAI,IAAI,EAAA;GAC/D;;KAEDA,SAAC;;AAED;;AAEC;;;AA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AA,WAAW,EAAEA,SAAC,CAAC,eAAe,EAAE,MAAM,CAAC;AACxC,KAAA;GACA,OAAO,MAAM,CAAC,IAAI,KAAK,IAAG;GAC1B;;AAED;;AAEC;;AAED,EAAA,WAAW,CAAC,IAAI,EAAE;AACjB,GAAA,OAAO,wBAAwB,CAAC,IAAI,CAAA;GACpC;EACD;AACF;;;;"}
@@ -4,12 +4,13 @@ const _hoisted_1 = {
4
4
  class: "cn-saved-view-look",
5
5
  "data-testid": "cn-saved-view-look-fields"
6
6
  };
7
- const _hoisted_2 = ["aria-label"];
7
+ const _hoisted_2 = { class: "cn-saved-view-look__icon-field" };
8
8
  const _hoisted_3 = {
9
9
  class: "cn-saved-view-look__label",
10
10
  "aria-hidden": "true"
11
11
  };
12
- const _hoisted_4 = ["aria-checked", "aria-label", "title", "data-icon", "onClick"];
12
+ const _hoisted_4 = ["aria-label"];
13
+ const _hoisted_5 = ["aria-checked", "aria-label", "title", "data-icon", "onClick"];
13
14
 
14
15
  function render(_ctx, _cache, $props, $setup, $data, $options) {
15
16
  const _component_NcTextField = resolveComponent("NcTextField");
@@ -23,29 +24,31 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
23
24
  "data-testid": "cn-saved-view-description",
24
25
  "onUpdate:modelValue": $options.onDescription
25
26
  }, null, 8 /* PROPS */, ["modelValue", "label", "helperText", "onUpdate:modelValue"]),
26
- createElementVNode("div", {
27
- class: "cn-saved-view-look__icons",
28
- role: "radiogroup",
29
- "aria-label": $options.t('nextcloud-vue', 'Icon'),
30
- "data-testid": "cn-saved-view-icon"
31
- }, [
27
+ createElementVNode("div", _hoisted_2, [
32
28
  createElementVNode("span", _hoisted_3, toDisplayString($options.t('nextcloud-vue', 'Icon')), 1 /* TEXT */),
33
- (openBlock(true), createElementBlock(Fragment, null, renderList($options.iconNames, (name) => {
34
- return (openBlock(), createElementBlock("button", {
35
- key: name,
36
- type: "button",
37
- role: "radio",
38
- class: normalizeClass(["cn-saved-view-look__icon", { 'cn-saved-view-look__icon--chosen': name === $options.chosenIcon }]),
39
- "aria-checked": name === $options.chosenIcon ? 'true' : 'false',
40
- "aria-label": $options.iconLabel(name),
41
- title: $options.iconLabel(name),
42
- "data-icon": name,
43
- onClick: $event => ($options.onIcon(name))
44
- }, [
45
- (openBlock(), createBlock(resolveDynamicComponent($options.componentOf(name)), { size: 20 }))
46
- ], 10 /* CLASS, PROPS */, _hoisted_4))
47
- }), 128 /* KEYED_FRAGMENT */))
48
- ], 8 /* PROPS */, _hoisted_2)
29
+ createElementVNode("div", {
30
+ class: "cn-saved-view-look__icons",
31
+ role: "radiogroup",
32
+ "aria-label": $options.t('nextcloud-vue', 'Icon'),
33
+ "data-testid": "cn-saved-view-icon"
34
+ }, [
35
+ (openBlock(true), createElementBlock(Fragment, null, renderList($options.iconNames, (name) => {
36
+ return (openBlock(), createElementBlock("button", {
37
+ key: name,
38
+ type: "button",
39
+ role: "radio",
40
+ class: normalizeClass(["cn-saved-view-look__icon", { 'cn-saved-view-look__icon--chosen': name === $options.chosenIcon }]),
41
+ "aria-checked": name === $options.chosenIcon ? 'true' : 'false',
42
+ "aria-label": $options.iconLabel(name),
43
+ title: $options.iconLabel(name),
44
+ "data-icon": name,
45
+ onClick: $event => ($options.onIcon(name))
46
+ }, [
47
+ (openBlock(), createBlock(resolveDynamicComponent($options.componentOf(name)), { size: 20 }))
48
+ ], 10 /* CLASS, PROPS */, _hoisted_5))
49
+ }), 128 /* KEYED_FRAGMENT */))
50
+ ], 8 /* PROPS */, _hoisted_4)
51
+ ])
49
52
  ]))
50
53
  }
51
54
 
@@ -1 +1 @@
1
- {"version":3,"file":"CnSavedViewLookFields.vue3.js","sources":["../../../../src/components/CnSavedViewLookFields/CnSavedViewLookFields.vue?vue&type=template&id=6fab246c&lang.js"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n<template>\n\t<div class=\"cn-saved-view-look\" data-testid=\"cn-saved-view-look-fields\">\n\t\t<NcTextField\n\t\t\t:modelValue=\"description\"\n\t\t\t:label=\"t('nextcloud-vue', 'Description')\"\n\t\t\t:labelVisible=\"true\"\n\t\t\t:helperText=\"t('nextcloud-vue', 'Shown when you point at the view in the menu.')\"\n\t\t\tdata-testid=\"cn-saved-view-description\"\n\t\t\t@update:modelValue=\"onDescription\" />\n\t\t<div\n\t\t\tclass=\"cn-saved-view-look__icons\"\n\t\t\trole=\"radiogroup\"\n\t\t\t:aria-label=\"t('nextcloud-vue', 'Icon')\"\n\t\t\tdata-testid=\"cn-saved-view-icon\">\n\t\t\t<span class=\"cn-saved-view-look__label\" aria-hidden=\"true\">{{ t('nextcloud-vue', 'Icon') }}</span>\n\t\t\t<button\n\t\t\t\tv-for=\"name in iconNames\"\n\t\t\t\t:key=\"name\"\n\t\t\t\ttype=\"button\"\n\t\t\t\trole=\"radio\"\n\t\t\t\tclass=\"cn-saved-view-look__icon\"\n\t\t\t\t:class=\"{ 'cn-saved-view-look__icon--chosen': name === chosenIcon }\"\n\t\t\t\t:aria-checked=\"name === chosenIcon ? 'true' : 'false'\"\n\t\t\t\t:aria-label=\"iconLabel(name)\"\n\t\t\t\t:title=\"iconLabel(name)\"\n\t\t\t\t:data-icon=\"name\"\n\t\t\t\t@click=\"onIcon(name)\">\n\t\t\t\t<component :is=\"componentOf(name)\" :size=\"20\" />\n\t\t\t</button>\n\t\t</div>\n\t</div>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport { NcTextField } from '@nextcloud/vue'\nimport { SAVED_VIEW_ICONS, SAVED_VIEW_MENU_DEFAULT_ICON } from '../../utils/savedViewMenu.js'\nimport { getSemanticIconComponent } from '../CnIcon/semanticIcons.js'\n\n/**\n * CnSavedViewLookFields — a saved view's description and icon, in the save\n * and edit dialogs. The description is the tooltip on the view's menu entry;\n * the icon stands before it in the menu. The icons are a short list from the\n * shared semantic vocabulary, so every one resolves in the menu without the\n * app registering it. Choosing the menu's own default icon stores none.\n *\n * @event {string} update:description The typed description.\n * @event {string} update:icon The chosen icon name, '' for the default.\n * @spec openspec/changes/saved-view-icon-description-count/specs/saved-view-icon-description-count/spec.md#requirement-a-saved-view-has-an-icon-and-a-description\n */\nexport default {\n\tname: 'CnSavedViewLookFields',\n\n\tcomponents: { NcTextField },\n\n\tprops: {\n\t\t/** The view's description. */\n\t\tdescription: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The view's icon name, '' for the menu's default. */\n\t\ticon: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\t},\n\n\temits: ['update:description', 'update:icon'],\n\n\tcomputed: {\n\t\t/** @return {string} The icon the menu falls back to. */\n\t\tdefaultIcon() {\n\t\t\treturn SAVED_VIEW_MENU_DEFAULT_ICON\n\t\t},\n\n\t\t/** @return {Array<string>} The icons offered, the default first. */\n\t\ticonNames() {\n\t\t\treturn SAVED_VIEW_ICONS\n\t\t},\n\n\t\t/** @return {string} The icon shown as chosen. */\n\t\tchosenIcon() {\n\t\t\treturn this.icon && SAVED_VIEW_ICONS.includes(this.icon) ? this.icon : SAVED_VIEW_MENU_DEFAULT_ICON\n\t\t},\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Pass the typed description on.\n\t\t *\n\t\t * @param {string} value The description.\n\t\t * @return {void}\n\t\t */\n\t\tonDescription(value) {\n\t\t\t/** @event update:description The typed description. */\n\t\t\tthis.$emit('update:description', value)\n\t\t},\n\n\t\t/**\n\t\t * Pass the chosen icon on; the menu's own default icon is stored as none.\n\t\t *\n\t\t * @param {string} name The icon name.\n\t\t * @return {void}\n\t\t */\n\t\tonIcon(name) {\n\t\t\t/** @event update:icon The chosen icon name, '' for the menu's default. */\n\t\t\tthis.$emit('update:icon', name === this.defaultIcon ? '' : name)\n\t\t},\n\n\t\tt,\n\n\t\t/**\n\t\t * The accessible name of an icon option: what it shows, in words.\n\t\t *\n\t\t * @param {string} name An icon name.\n\t\t * @return {string} Its label, or the name when it has none.\n\t\t * @spec openspec/changes/saved-view-icon-labels/specs/saved-view-icon-labels/spec.md#requirement-an-icon-option-is-named-in-words\n\t\t */\n\t\ticonLabel(name) {\n\t\t\tconst labels = {\n\t\t\t\tFilterVariant: t('nextcloud-vue', 'Filter'),\n\t\t\t\tClockOutline: t('nextcloud-vue', 'Clock'),\n\t\t\t\tClockAlertOutline: t('nextcloud-vue', 'Clock with warning'),\n\t\t\t\tCalendarClockOutline: t('nextcloud-vue', 'Calendar with clock'),\n\t\t\t\tCalendarOutline: t('nextcloud-vue', 'Calendar'),\n\t\t\t\tAccountOutline: t('nextcloud-vue', 'Person'),\n\t\t\t\tAccountGroupOutline: t('nextcloud-vue', 'Group'),\n\t\t\t\tFolderOutline: t('nextcloud-vue', 'Folder'),\n\t\t\t\tFileDocumentOutline: t('nextcloud-vue', 'Document'),\n\t\t\t\tAlertCircleOutline: t('nextcloud-vue', 'Attention'),\n\t\t\t\tCheckCircleOutline: t('nextcloud-vue', 'Ready'),\n\t\t\t\tEmailOutline: t('nextcloud-vue', 'Email'),\n\t\t\t\tMapMarkerOutline: t('nextcloud-vue', 'Location'),\n\t\t\t\tTagOutline: t('nextcloud-vue', 'Label'),\n\t\t\t\tBellOutline: t('nextcloud-vue', 'Bell'),\n\t\t\t\tScaleBalance: t('nextcloud-vue', 'Scales'),\n\t\t\t\tBriefcaseOutline: t('nextcloud-vue', 'Briefcase'),\n\t\t\t\tEyeOutline: t('nextcloud-vue', 'Eye'),\n\t\t\t\tLockOutline: t('nextcloud-vue', 'Lock'),\n\t\t\t\tCurrencyEur: t('nextcloud-vue', 'Euro'),\n\t\t\t}\n\t\t\treturn labels[name] || name\n\t\t},\n\n\t\t/**\n\t\t * @param {string} name An icon name.\n\t\t * @return {object|null} Its component.\n\t\t */\n\t\tcomponentOf(name) {\n\t\t\treturn getSemanticIconComponent(name)\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-saved-view-look {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 12px;\n}\n\n.cn-saved-view-look__icons {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tgap: 4px;\n}\n\n.cn-saved-view-look__label {\n\tflex: 0 0 100%;\n\tfont-weight: 600;\n}\n\n.cn-saved-view-look__icon {\n\tdisplay: inline-flex;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: var(--default-clickable-area);\n\theight: var(--default-clickable-area);\n\tpadding: 0;\n\tborder: 1px solid var(--color-border);\n\tborder-radius: var(--border-radius-element, 8px);\n\tbackground: var(--color-main-background);\n\tcolor: var(--color-main-text);\n\tcursor: pointer;\n}\n\n.cn-saved-view-look__icon--chosen {\n\tborder-color: var(--color-primary-element);\n\tbackground: var(--color-primary-element-light);\n\tcolor: var(--color-primary-element-light-text);\n}\n\n.cn-saved-view-look__icon:focus-visible {\n\toutline: 2px solid var(--color-primary-element);\n\toutline-offset: 2px;\n}\n</style>\n"],"names":["_openBlock","_createElementBlock","_createVNode","_createElementVNode","_toDisplayString","_normalizeClass"],"mappings":";;;AASM,EAAA,KAAK,EAAC,oBAAU;AAAA,EAAA,aAAA,EAAA,2BAAA;;;;AAab,EAAA,KAAK,EAAC,2BAAC;AAAA,EAAA,aAAA,EAAA,MAAA;;;;;;;AAbb,EAAA,QAAAA,SAAA,EAAA,EAAAC,kBAAA,QAAA;IACAC,WAMqC,CAAA,sBAAA,EAAA;AALpC,MAAA,UAAU,EAAE,MAAW,CAAA,WAAA;AACvB,MAAA,KAAK,EAAE,QAAC,CAAA,CAAA,CAAA,eAAA,EAAA,aAAA,CAAA;AACR,MAAA,YAAC,EAAA,IAAA;AACD,MAAA,UAAU,EAAE,QAAC,CAAA,CAAA,CAAA,eAAA,EAAA,+CAAA,CAAA;AACd,MAAA,aAAW,EAAC,2BAAI;AACf,MAAA,qBAAiB,EAAE,QAAa,CAAA,aAAA;;IACjCC;AACA,MAAA,OAAM,2BAA2B;AACjC,MAAA,IAAI,EAAC,YAAC;AACL,MAAA,YAAU,EAAE,QAAC,CAAA,CAAA,CAAA,eAAA,EAAA,MAAA,CAAA;mBACH,EAAA,oBAAA;;wBACE,CAAA,MAAA,YAAA,EAAAC,eAAA,CAAA,QAAA,CAAA,CAAA,CAAA,eAAA,EAAA,MAAA,CAAA,CAAA,EAAA,CAAA,YAAA;sEAEG,QAAS,CAAA,SAAA,EAAA,CAAjB,IAAI,KAAA;;AACV,UAAA,GAAG,EAAE,IAAI;AACV,UAAA,IAAI,EAAC,QAAQ;AACb,UAAA,IAAI,EAAC,OAAO;AACZ,UAAA,KAAK,EAACC,cAAA,CAAA,CAAA,0BAAiB,EACP,EAAA,kCAAA,EAAA,IAAA,KAAA,QAAA,CAAA,UAAA,EAAA,CAAA,CAAA;UACf,cAAY,EAAE,IAAI,KAAE,QAAA,CAAA,UAAA,GAAA,MAAA,GAAA,OAAA;UACpB,YAAU,EAAE,QAAS,CAAA,SAAA,CAAC,IAAI,CAAA;UAC1B,KAAK,EAAC,QAAA,CAAA,SAAA,CAAA,IAAA,CAAA;AACN,UAAA,WAAE,EAAA,IAAA;UACF,OAAC,EAAA,MAAA,KAAA,QAAA,CAAA,MAAA,CAAA,IAAA,CAAA,CAAA;;;;;;;;;;;"}
1
+ {"version":3,"file":"CnSavedViewLookFields.vue3.js","sources":["../../../../src/components/CnSavedViewLookFields/CnSavedViewLookFields.vue?vue&type=template&id=f0552066&lang.js"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n<template>\n\t<div class=\"cn-saved-view-look\" data-testid=\"cn-saved-view-look-fields\">\n\t\t<NcTextField\n\t\t\t:modelValue=\"description\"\n\t\t\t:label=\"t('nextcloud-vue', 'Description')\"\n\t\t\t:labelVisible=\"true\"\n\t\t\t:helperText=\"t('nextcloud-vue', 'Shown when you point at the view in the menu.')\"\n\t\t\tdata-testid=\"cn-saved-view-description\"\n\t\t\t@update:modelValue=\"onDescription\" />\n\t\t<div class=\"cn-saved-view-look__icon-field\">\n\t\t\t<span class=\"cn-saved-view-look__label\" aria-hidden=\"true\">{{ t('nextcloud-vue', 'Icon') }}</span>\n\t\t\t<div\n\t\t\t\tclass=\"cn-saved-view-look__icons\"\n\t\t\t\trole=\"radiogroup\"\n\t\t\t\t:aria-label=\"t('nextcloud-vue', 'Icon')\"\n\t\t\t\tdata-testid=\"cn-saved-view-icon\">\n\t\t\t\t<button\n\t\t\t\t\tv-for=\"name in iconNames\"\n\t\t\t\t\t:key=\"name\"\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\trole=\"radio\"\n\t\t\t\t\tclass=\"cn-saved-view-look__icon\"\n\t\t\t\t\t:class=\"{ 'cn-saved-view-look__icon--chosen': name === chosenIcon }\"\n\t\t\t\t\t:aria-checked=\"name === chosenIcon ? 'true' : 'false'\"\n\t\t\t\t\t:aria-label=\"iconLabel(name)\"\n\t\t\t\t\t:title=\"iconLabel(name)\"\n\t\t\t\t\t:data-icon=\"name\"\n\t\t\t\t\t@click=\"onIcon(name)\">\n\t\t\t\t\t<component :is=\"componentOf(name)\" :size=\"20\" />\n\t\t\t\t</button>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport { NcTextField } from '@nextcloud/vue'\nimport { SAVED_VIEW_ICONS, SAVED_VIEW_MENU_DEFAULT_ICON } from '../../utils/savedViewMenu.js'\nimport { getSemanticIconComponent } from '../CnIcon/semanticIcons.js'\n\n/**\n * CnSavedViewLookFields — a saved view's description and icon, in the save\n * and edit dialogs. The description is the tooltip on the view's menu entry;\n * the icon stands before it in the menu. The icons are a short list from the\n * shared semantic vocabulary, so every one resolves in the menu without the\n * app registering it. Choosing the menu's own default icon stores none.\n *\n * @event {string} update:description The typed description.\n * @event {string} update:icon The chosen icon name, '' for the default.\n * @spec openspec/changes/saved-view-icon-description-count/specs/saved-view-icon-description-count/spec.md#requirement-a-saved-view-has-an-icon-and-a-description\n */\nexport default {\n\tname: 'CnSavedViewLookFields',\n\n\tcomponents: { NcTextField },\n\n\tprops: {\n\t\t/** The view's description. */\n\t\tdescription: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** The view's icon name, '' for the menu's default. */\n\t\ticon: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\t},\n\n\temits: ['update:description', 'update:icon'],\n\n\tcomputed: {\n\t\t/** @return {string} The icon the menu falls back to. */\n\t\tdefaultIcon() {\n\t\t\treturn SAVED_VIEW_MENU_DEFAULT_ICON\n\t\t},\n\n\t\t/** @return {Array<string>} The icons offered, the default first. */\n\t\ticonNames() {\n\t\t\treturn SAVED_VIEW_ICONS\n\t\t},\n\n\t\t/** @return {string} The icon shown as chosen. */\n\t\tchosenIcon() {\n\t\t\treturn this.icon && SAVED_VIEW_ICONS.includes(this.icon) ? this.icon : SAVED_VIEW_MENU_DEFAULT_ICON\n\t\t},\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Pass the typed description on.\n\t\t *\n\t\t * @param {string} value The description.\n\t\t * @return {void}\n\t\t */\n\t\tonDescription(value) {\n\t\t\t/** @event update:description The typed description. */\n\t\t\tthis.$emit('update:description', value)\n\t\t},\n\n\t\t/**\n\t\t * Pass the chosen icon on; the menu's own default icon is stored as none.\n\t\t *\n\t\t * @param {string} name The icon name.\n\t\t * @return {void}\n\t\t */\n\t\tonIcon(name) {\n\t\t\t/** @event update:icon The chosen icon name, '' for the menu's default. */\n\t\t\tthis.$emit('update:icon', name === this.defaultIcon ? '' : name)\n\t\t},\n\n\t\tt,\n\n\t\t/**\n\t\t * The accessible name of an icon option: what it shows, in words.\n\t\t *\n\t\t * @param {string} name An icon name.\n\t\t * @return {string} Its label, or the name when it has none.\n\t\t * @spec openspec/changes/saved-view-icon-labels/specs/saved-view-icon-labels/spec.md#requirement-an-icon-option-is-named-in-words\n\t\t */\n\t\ticonLabel(name) {\n\t\t\tconst labels = {\n\t\t\t\tFilterVariant: t('nextcloud-vue', 'Filter'),\n\t\t\t\tClockOutline: t('nextcloud-vue', 'Clock'),\n\t\t\t\tClockAlertOutline: t('nextcloud-vue', 'Clock with warning'),\n\t\t\t\tCalendarClockOutline: t('nextcloud-vue', 'Calendar with clock'),\n\t\t\t\tCalendarOutline: t('nextcloud-vue', 'Calendar'),\n\t\t\t\tAccountOutline: t('nextcloud-vue', 'Person'),\n\t\t\t\tAccountGroupOutline: t('nextcloud-vue', 'Group'),\n\t\t\t\tFolderOutline: t('nextcloud-vue', 'Folder'),\n\t\t\t\tFileDocumentOutline: t('nextcloud-vue', 'Document'),\n\t\t\t\tAlertCircleOutline: t('nextcloud-vue', 'Attention'),\n\t\t\t\tCheckCircleOutline: t('nextcloud-vue', 'Ready'),\n\t\t\t\tEmailOutline: t('nextcloud-vue', 'Email'),\n\t\t\t\tMapMarkerOutline: t('nextcloud-vue', 'Location'),\n\t\t\t\tTagOutline: t('nextcloud-vue', 'Label'),\n\t\t\t\tBellOutline: t('nextcloud-vue', 'Bell'),\n\t\t\t\tScaleBalance: t('nextcloud-vue', 'Scales'),\n\t\t\t\tBriefcaseOutline: t('nextcloud-vue', 'Briefcase'),\n\t\t\t\tEyeOutline: t('nextcloud-vue', 'Eye'),\n\t\t\t\tLockOutline: t('nextcloud-vue', 'Lock'),\n\t\t\t\tCurrencyEur: t('nextcloud-vue', 'Euro'),\n\t\t\t}\n\t\t\treturn labels[name] || name\n\t\t},\n\n\t\t/**\n\t\t * @param {string} name An icon name.\n\t\t * @return {object|null} Its component.\n\t\t */\n\t\tcomponentOf(name) {\n\t\t\treturn getSemanticIconComponent(name)\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-saved-view-look {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 12px;\n}\n\n.cn-saved-view-look__icons {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tgap: 4px;\n}\n\n.cn-saved-view-look__icon-field {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 4px;\n}\n\n.cn-saved-view-look__label {\n\tfont-weight: 600;\n}\n\n.cn-saved-view-look__icon {\n\tdisplay: inline-flex;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: var(--default-clickable-area);\n\theight: var(--default-clickable-area);\n\tpadding: 0;\n\tborder: 1px solid var(--color-border);\n\tborder-radius: var(--border-radius-element, 8px);\n\tbackground: var(--color-main-background);\n\tcolor: var(--color-main-text);\n\tcursor: pointer;\n}\n\n.cn-saved-view-look__icon--chosen {\n\tborder-color: var(--color-primary-element);\n\tbackground: var(--color-primary-element-light);\n\tcolor: var(--color-primary-element-light-text);\n}\n\n.cn-saved-view-look__icon:focus-visible {\n\toutline: 2px solid var(--color-primary-element);\n\toutline-offset: 2px;\n}\n</style>\n"],"names":["_openBlock","_createElementBlock","_createVNode","_createElementVNode","_toDisplayString","_normalizeClass","_createBlock","_resolveDynamicComponent"],"mappings":";;;AASM,EAAA,KAAK,EAAC,oBAAU;AAAA,EAAA,aAAA,EAAA,2BAAA;;AAQf,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,gCAAO,GAAA;;AACX,EAAA,KAAK,EAAC,2BAA2B;AAAC,EAAA,aAAA,EAAA,MAAA;;;;;;;;AATxC,EAAA,QAAAA,SAAA,EAAA,EAAAC,kBAAA,QAAA;IACAC,WAMiC,CAAA,sBAAA,EAAA;AALhC,MAAA,UAAU,EAAE,MAAW,CAAA,WAAA;AACvB,MAAA,KAAK,EAAE,QAAC,CAAA,CAAA,CAAA,eAAA,EAAA,aAAA,CAAA;AACR,MAAA,YAAY,EAAE,IAAI;AAClB,MAAA,UAAU,EAAE,QAAC,CAAA,CAAA,CAAA,eAAA,EAAA,+CAAA,CAAA;AACd,MAAA,aAAG,EAAA,2BAAA;AACF,MAAA,qBAAiB,EAAE,QAAa,CAAA,aAAA;;AAChC,IAAAC,kBAAA,QAAA;MACAA,kBAAuC,CAAA,MAAA,EAAvC,UAAuC,EAAAC,eAAA,CAAA,QAAA,CAAA,CAAA,CAAA,eAAA,EAAA,MAAA,CAAA,CAAA,EAAA,CAAA,YAAA;MACvCD;AACA,QAAA,KAAK,EAAC,2BAAA;YACF,EAAC,YAAY;AAChB,QAAA,YAAU,EAAA,QAAA,CAAA,CAAA,CAAA,eAAA,EAAA,MAAA,CAAA;qBACA,EAAC,oBAAC;;wEAEG,QAAS,CAAA,SAAA,EAAA,CAAjB,IAAI,KAAA;;AACV,YAAA,GAAG,EAAE,IAAI;AACV,YAAA,IAAI,EAAC,QAAQ;AACb,YAAA,IAAI,EAAC,OAAO;AACZ,YAAA,KAAK,EAACE,cAAA,CAAA,CAAA,0BAAiB,EACP,EAAA,kCAAA,EAAA,IAAA,KAAA,QAAA,CAAA,UAAA,EAAA,CAAA,CAAA;YACf,cAAY,EAAE,IAAI,KAAE,QAAA,CAAA,UAAA,GAAA,MAAA,GAAA,OAAA;YACpB,YAAU,EAAE,QAAS,CAAA,SAAA,CAAC,IAAI,CAAA;YAC1B,KAAK,EAAC,QAAA,CAAA,SAAA,CAAA,IAAA,CAAA;AACN,YAAA,WAAE,EAAA,IAAA;YACF,OAAC,EAAA,MAAA,KAAA,QAAA,CAAA,MAAA,CAAA,IAAA,CAAA,CAAA;;AACF,aAAAL,SAAA,EAAA,EAAAM,WAAA,CAACC,wBAAA,QAAA,CAAA,WAAA,CAAA,IAAA,CAAA,CAAA,EAAA,EAAA,IAAA,EAAA,EAAA,EAAA,CAAA;;;;;;;;;;"}
@@ -2,7 +2,7 @@ import script from './CnSearchSelect.vue2.js';
2
2
  import { render } from './CnSearchSelect.vue3.js';
3
3
 
4
4
  script.render = render;
5
- script.__scopeId = "data-v-aaa45660";
5
+ script.__scopeId = "data-v-29601046";
6
6
  const __sfc_main = script;
7
7
 
8
8
  export { __sfc_main as default };
@@ -1 +1 @@
1
- {"version":3,"file":"CnSearchSelect.vue2.js","sources":["../../../../src/components/CnSearchSelect/CnSearchSelect.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n<template>\n\t<div class=\"cn-search-select\" :class=\"{ 'cn-search-select--label-outside': labelOutside }\" data-testid=\"cn-search-select\">\n\t\t<NcSelect\n\t\t\t:inputId=\"inputId\"\n\t\t\t:inputLabel=\"inputLabel\"\n\t\t\t:labelOutside=\"labelOutside\"\n\t\t\t:modelValue=\"selectedOption\"\n\t\t\t:options=\"options\"\n\t\t\t:loading=\"loading\"\n\t\t\t:clearable=\"clearable\"\n\t\t\t:disabled=\"disabled\"\n\t\t\t:placeholder=\"resolvedPlaceholder\"\n\t\t\t:filterable=\"filterable\"\n\t\t\tlabel=\"label\"\n\t\t\t@search=\"onSearch\"\n\t\t\t@update:modelValue=\"onInput\">\n\t\t\t<template #option=\"option\">\n\t\t\t\t<span class=\"cn-search-select__row\" data-testid=\"cn-search-select-row\">\n\t\t\t\t\t<span\n\t\t\t\t\t\tv-if=\"option.avatar || option.icon\"\n\t\t\t\t\t\tclass=\"cn-search-select__lead\"\n\t\t\t\t\t\t:class=\"{ 'cn-search-select__lead--avatar': option.avatar && !option.icon }\"\n\t\t\t\t\t\taria-hidden=\"true\">\n\t\t\t\t\t\t<CnIcon v-if=\"option.icon\" :name=\"option.icon\" :size=\"18\" />\n\t\t\t\t\t\t<template v-else>{{ initialsOf(option) }}</template>\n\t\t\t\t\t</span>\n\t\t\t\t\t<span class=\"cn-search-select__text\">\n\t\t\t\t\t\t<span class=\"cn-search-select__name\">{{ option.label }}</span>\n\t\t\t\t\t\t<span v-if=\"option.secondary\" class=\"cn-search-select__secondary\">{{ option.secondary }}</span>\n\t\t\t\t\t</span>\n\t\t\t\t\t<Check\n\t\t\t\t\t\tv-if=\"isSelected(option)\"\n\t\t\t\t\t\tclass=\"cn-search-select__check\"\n\t\t\t\t\t\t:size=\"18\"\n\t\t\t\t\t\tdata-testid=\"cn-search-select-check\" />\n\t\t\t\t</span>\n\t\t\t</template>\n\t\t</NcSelect>\n\t\t<Magnify class=\"cn-search-select__magnifier\" :size=\"18\" aria-hidden=\"true\" />\n\t</div>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport { NcSelect } from '@nextcloud/vue'\nimport Check from 'vue-material-design-icons/Check.vue'\nimport Magnify from 'vue-material-design-icons/Magnify.vue'\nimport CnIcon from '../CnIcon/CnIcon.vue'\nimport { initialsOf } from '../../utils/initials.js'\n\n/**\n * CnSearchSelect — a single picker drawn as a search field: a magnifier\n * instead of the chevron, and results as rows with an icon or initials, a\n * name, a secondary line and a check on the chosen one (boards DqOverdragen\n * \"Nieuw team\", DqNieuweZaak \"Aanvrager\").\n *\n * Each option is `{ id, label, secondary?, icon?, avatar? }`: `icon` names a\n * CnIcon, `avatar: true` draws the label's initials in a circle. The value is\n * the option's `id` (or `value`); `update:modelValue` emits that id, or null\n * when cleared. Searching is the host's: listen to `search` and pass new\n * `options`, with `filterable: false` when the host already filtered them.\n *\n * ```vue\n * <CnSearchSelect\n * v-model=\"team\"\n * inputLabel=\"Nieuw team\"\n * :options=\"[{ id: 'legal', label: 'Juridische zaken', secondary: '6 leden · bezwaar, beroep en Woo-advies', avatar: true }]\" />\n * ```\n */\nexport default {\n\tname: 'CnSearchSelect',\n\n\tcomponents: { Check, CnIcon, Magnify, NcSelect },\n\n\tprops: {\n\t\t/** The chosen option's id, or the option itself. */\n\t\tmodelValue: {\n\t\t\ttype: [String, Number, Object],\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * The options: `{ id, label, secondary?, icon?, avatar? }`.\n\t\t *\n\t\t * @type {Array<{id: (string|number), label: string, secondary?: string, icon?: string, avatar?: boolean}>}\n\t\t */\n\t\toptions: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t\t/** The field's label. */\n\t\tinputLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** Draw the label above the field instead of inside it. */\n\t\tlabelOutside: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/** The input's id. */\n\t\tinputId: {\n\t\t\ttype: String,\n\t\t\tdefault: undefined,\n\t\t},\n\n\t\t/** Placeholder text; defaults to \"Search…\". */\n\t\tplaceholder: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** Show the loading spinner. */\n\t\tloading: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/** Offer a clear button. */\n\t\tclearable: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true,\n\t\t},\n\n\t\t/** Disable the field. */\n\t\tdisabled: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/** Filter the options on the typed text; false when the host searches. */\n\t\tfilterable: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true,\n\t\t},\n\t},\n\n\temits: ['update:modelValue', 'search'],\n\n\tcomputed: {\n\t\t/**\n\t\t * The option matching `modelValue`, or a bare one carrying it.\n\t\t *\n\t\t * @return {object|null}\n\t\t */\n\t\tselectedOption() {\n\t\t\tconst value = this.modelValue\n\t\t\tif (value === null || value === undefined || value === '') {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tif (typeof value === 'object') {\n\t\t\t\treturn value\n\t\t\t}\n\t\t\treturn this.options.find((o) => this.idOf(o) === String(value)) || { id: value, label: String(value) }\n\t\t},\n\n\t\t/** @return {string} The placeholder. */\n\t\tresolvedPlaceholder() {\n\t\t\treturn this.placeholder || t('nextcloud-vue', 'Search…')\n\t\t},\n\t},\n\n\tmethods: {\n\t\tinitialsOf(option) {\n\t\t\treturn initialsOf(option.label || '')\n\t\t},\n\n\t\t/**\n\t\t * @param {object} option An option.\n\t\t * @return {string} Its id as a string, '' without one.\n\t\t */\n\t\tidOf(option) {\n\t\t\tconst id = option && (option.id ?? option.value)\n\t\t\treturn id === null || id === undefined ? '' : String(id)\n\t\t},\n\n\t\t/**\n\t\t * @param {object} option An option.\n\t\t * @return {boolean} Whether it is the chosen one.\n\t\t */\n\t\tisSelected(option) {\n\t\t\treturn this.selectedOption !== null && this.idOf(option) !== '' && this.idOf(option) === this.idOf(this.selectedOption)\n\t\t},\n\n\t\t/**\n\t\t * @param {object|null} option The picked option.\n\t\t */\n\t\tonInput(option) {\n\t\t\tconst id = option ? (option.id ?? option.value ?? null) : null\n\t\t\t/** @event update:modelValue The picked option's id, or null when cleared. */\n\t\t\tthis.$emit('update:modelValue', id)\n\t\t},\n\n\t\t/**\n\t\t * @param {string} query The typed text.\n\t\t */\n\t\tonSearch(query) {\n\t\t\t/** @event search The typed text, for a host that searches itself. */\n\t\t\tthis.$emit('search', query)\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-search-select {\n\tposition: relative;\n}\n\n/* The field takes the row: NcSelect is an inline block of at least 260px,\n which left the magnifier, placed at the row's end, outside the field\n (DqOverdragen \"Nieuw team\"). */\n.cn-search-select :deep(.v-select) {\n\twidth: 100%;\n}\n\n/* The magnifier sits where the chevron was: in the field, at its end. */\n.cn-search-select__magnifier {\n\tposition: absolute;\n\tinset-inline-end: 12px;\n\tbottom: 0;\n\theight: var(--default-clickable-area, 34px);\n\tdisplay: flex;\n\talign-items: center;\n\tz-index: 1;\n\tcolor: var(--color-text-maxcontrast);\n\tpointer-events: none;\n}\n\n.cn-search-select :deep(.vs__open-indicator),\n.cn-search-select :deep(.vs__open-indicator-button) {\n\tdisplay: none;\n}\n\n.cn-search-select :deep(.vs__actions) {\n\tpadding-inline-end: 36px;\n}\n\n.cn-search-select__row {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 10px;\n\twidth: 100%;\n\tmin-width: 0;\n\tpadding: 4px 0;\n}\n\n.cn-search-select__lead {\n\tflex: 0 0 32px;\n\twidth: 32px;\n\theight: 32px;\n\tborder-radius: 50%;\n\tdisplay: inline-flex;\n\talign-items: center;\n\tjustify-content: center;\n\tbackground: var(--color-primary-element-light);\n\tcolor: var(--color-primary-element-light-text);\n\tfont-size: 13px;\n\tfont-weight: 600;\n}\n\n.cn-search-select__text {\n\tdisplay: flex;\n\tflex-direction: column;\n\tflex: 1 1 auto;\n\tmin-width: 0;\n}\n\n.cn-search-select__name {\n\tfont-weight: 600;\n\toverflow-wrap: anywhere;\n}\n\n.cn-search-select__secondary {\n\tfont-size: 13px;\n\tcolor: var(--color-text-maxcontrast);\n\toverflow-wrap: anywhere;\n}\n\n.cn-search-select__check {\n\tflex: 0 0 auto;\n\tcolor: var(--color-primary-element);\n}\n</style>\n"],"names":["CnIcon","t"],"mappings":";;;;;;;AAsDA;;;;AAIC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;AAGA;;AAED,aAAe;AACd,CAAA,IAAI,EAAE,gBAAgB;;AAEtB,CAAA,UAAU,EAAE,EAAE,KAAK,UAAEA,UAAM,EAAE,OAAO,EAAE,UAAU;;AAEhD,CAAA,KAAK,EAAE;AACN;EACA,UAAU,EAAE;GACX,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;GAC9B,OAAO,EAAE,IAAI;GACb;;AAED;;AAEC;;;AAGD,EAAA,OAAO,EAAE;GACR,IAAI,EAAE,KAAK;AACX,GAAA,OAAO,EAAE,MAAM,EAAE;GACjB;;AAED;EACA,UAAU,EAAE;GACX,IAAI,EAAE,MAAM;GACZ,OAAO,EAAE,EAAE;GACX;;;EAGD,YAAY,EAAE;GACb,IAAI,EAAE,OAAO;GACb,OAAO,EAAE,KAAK;GACd;;AAED;AACA,EAAA,OAAO,EAAE;GACR,IAAI,EAAE,MAAM;AACZ,GAAA,OAAO,EAAE,SAAS;GAClB;;AAED;EACA,WAAW,EAAE;GACZ,IAAI,EAAE,MAAM;GACZ,OAAO,EAAE,EAAE;GACX;;;AAGD,EAAA,OAAO,EAAE;GACR,IAAI,EAAE,OAAO;GACb,OAAO,EAAE,KAAK;GACd;;;EAGD,SAAS,EAAE;GACV,IAAI,EAAE,OAAO;GACb,OAAO,EAAE,IAAI;GACb;;AAED;AACA,EAAA,QAAQ,EAAE;GACT,IAAI,EAAE,OAA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AAI,IAAG,IAAK,IAAI,CAAC,IAAI,CAAC,MAAM,CAAA,KAAM,EAAC,IAAK,IAAI,CAAC,IAAI,CAAC,MAAM,CAAE,KAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,CAAA;GACtH;;AAED;AACC;;AAED,EAAA,OAAO,CAAC,MAAM,EAAE;GACf,MAAM,EAAG,GAAE,MAAO,IAAG,MAAM,CAAC,EAAC,IAAK,MAAM,CAAC,SAAS,IAAI,IAAI,KAAG;AAC7D;AACA,GAAA,IAAI,CAAC,KAAK,CAAC,mBAAmB,EAAE,EAAE,EAAA;GAClC;;AAED;AACC;;AAED,EAAA,QAAQ,CAAC,KAAK,EAAE;;GAEf,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,EAAA;GAC1B;EACD;AACF;;;;"}
1
+ {"version":3,"file":"CnSearchSelect.vue2.js","sources":["../../../../src/components/CnSearchSelect/CnSearchSelect.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n<template>\n\t<div class=\"cn-search-select\" :class=\"{ 'cn-search-select--label-outside': labelOutside }\" data-testid=\"cn-search-select\">\n\t\t<NcSelect\n\t\t\t:inputId=\"inputId\"\n\t\t\t:inputLabel=\"inputLabel\"\n\t\t\t:labelOutside=\"labelOutside\"\n\t\t\t:modelValue=\"selectedOption\"\n\t\t\t:options=\"options\"\n\t\t\t:loading=\"loading\"\n\t\t\t:clearable=\"clearable\"\n\t\t\t:disabled=\"disabled\"\n\t\t\t:placeholder=\"resolvedPlaceholder\"\n\t\t\t:filterable=\"filterable\"\n\t\t\tlabel=\"label\"\n\t\t\t@search=\"onSearch\"\n\t\t\t@update:modelValue=\"onInput\">\n\t\t\t<template #option=\"option\">\n\t\t\t\t<span class=\"cn-search-select__row\" data-testid=\"cn-search-select-row\">\n\t\t\t\t\t<span\n\t\t\t\t\t\tv-if=\"option.avatar || option.icon\"\n\t\t\t\t\t\tclass=\"cn-search-select__lead\"\n\t\t\t\t\t\t:class=\"{ 'cn-search-select__lead--avatar': option.avatar && !option.icon }\"\n\t\t\t\t\t\taria-hidden=\"true\">\n\t\t\t\t\t\t<CnIcon v-if=\"option.icon\" :name=\"option.icon\" :size=\"18\" />\n\t\t\t\t\t\t<template v-else>{{ initialsOf(option) }}</template>\n\t\t\t\t\t</span>\n\t\t\t\t\t<span class=\"cn-search-select__text\">\n\t\t\t\t\t\t<span class=\"cn-search-select__name\">{{ option.label }}</span>\n\t\t\t\t\t\t<span v-if=\"option.secondary\" class=\"cn-search-select__secondary\">{{ option.secondary }}</span>\n\t\t\t\t\t</span>\n\t\t\t\t\t<Check\n\t\t\t\t\t\tv-if=\"isSelected(option)\"\n\t\t\t\t\t\tclass=\"cn-search-select__check\"\n\t\t\t\t\t\t:size=\"18\"\n\t\t\t\t\t\tdata-testid=\"cn-search-select-check\" />\n\t\t\t\t</span>\n\t\t\t</template>\n\t\t</NcSelect>\n\t\t<Magnify class=\"cn-search-select__magnifier\" :size=\"18\" aria-hidden=\"true\" />\n\t</div>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport { NcSelect } from '@nextcloud/vue'\nimport Check from 'vue-material-design-icons/Check.vue'\nimport Magnify from 'vue-material-design-icons/Magnify.vue'\nimport CnIcon from '../CnIcon/CnIcon.vue'\nimport { initialsOf } from '../../utils/initials.js'\n\n/**\n * CnSearchSelect — a single picker drawn as a search field: a magnifier\n * instead of the chevron, and results as rows with an icon or initials, a\n * name, a secondary line and a check on the chosen one (boards DqOverdragen\n * \"Nieuw team\", DqNieuweZaak \"Aanvrager\").\n *\n * Each option is `{ id, label, secondary?, icon?, avatar? }`: `icon` names a\n * CnIcon, `avatar: true` draws the label's initials in a circle. The value is\n * the option's `id` (or `value`); `update:modelValue` emits that id, or null\n * when cleared. Searching is the host's: listen to `search` and pass new\n * `options`, with `filterable: false` when the host already filtered them.\n *\n * ```vue\n * <CnSearchSelect\n * v-model=\"team\"\n * inputLabel=\"Nieuw team\"\n * :options=\"[{ id: 'legal', label: 'Juridische zaken', secondary: '6 leden · bezwaar, beroep en Woo-advies', avatar: true }]\" />\n * ```\n */\nexport default {\n\tname: 'CnSearchSelect',\n\n\tcomponents: { Check, CnIcon, Magnify, NcSelect },\n\n\tprops: {\n\t\t/** The chosen option's id, or the option itself. */\n\t\tmodelValue: {\n\t\t\ttype: [String, Number, Object],\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * The options: `{ id, label, secondary?, icon?, avatar? }`.\n\t\t *\n\t\t * @type {Array<{id: (string|number), label: string, secondary?: string, icon?: string, avatar?: boolean}>}\n\t\t */\n\t\toptions: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t\t/** The field's label. */\n\t\tinputLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** Draw the label above the field instead of inside it. */\n\t\tlabelOutside: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/** The input's id. */\n\t\tinputId: {\n\t\t\ttype: String,\n\t\t\tdefault: undefined,\n\t\t},\n\n\t\t/** Placeholder text; defaults to \"Search…\". */\n\t\tplaceholder: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** Show the loading spinner. */\n\t\tloading: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/** Offer a clear button. */\n\t\tclearable: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true,\n\t\t},\n\n\t\t/** Disable the field. */\n\t\tdisabled: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/** Filter the options on the typed text; false when the host searches. */\n\t\tfilterable: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true,\n\t\t},\n\t},\n\n\temits: ['update:modelValue', 'search'],\n\n\tcomputed: {\n\t\t/**\n\t\t * The option matching `modelValue`, or a bare one carrying it.\n\t\t *\n\t\t * @return {object|null}\n\t\t */\n\t\tselectedOption() {\n\t\t\tconst value = this.modelValue\n\t\t\tif (value === null || value === undefined || value === '') {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tif (typeof value === 'object') {\n\t\t\t\treturn value\n\t\t\t}\n\t\t\treturn this.options.find((o) => this.idOf(o) === String(value)) || { id: value, label: String(value) }\n\t\t},\n\n\t\t/** @return {string} The placeholder. */\n\t\tresolvedPlaceholder() {\n\t\t\treturn this.placeholder || t('nextcloud-vue', 'Search…')\n\t\t},\n\t},\n\n\tmethods: {\n\t\tinitialsOf(option) {\n\t\t\treturn initialsOf(option.label || '')\n\t\t},\n\n\t\t/**\n\t\t * @param {object} option An option.\n\t\t * @return {string} Its id as a string, '' without one.\n\t\t */\n\t\tidOf(option) {\n\t\t\tconst id = option && (option.id ?? option.value)\n\t\t\treturn id === null || id === undefined ? '' : String(id)\n\t\t},\n\n\t\t/**\n\t\t * @param {object} option An option.\n\t\t * @return {boolean} Whether it is the chosen one.\n\t\t */\n\t\tisSelected(option) {\n\t\t\treturn this.selectedOption !== null && this.idOf(option) !== '' && this.idOf(option) === this.idOf(this.selectedOption)\n\t\t},\n\n\t\t/**\n\t\t * @param {object|null} option The picked option.\n\t\t */\n\t\tonInput(option) {\n\t\t\tconst id = option ? (option.id ?? option.value ?? null) : null\n\t\t\t/** @event update:modelValue The picked option's id, or null when cleared. */\n\t\t\tthis.$emit('update:modelValue', id)\n\t\t},\n\n\t\t/**\n\t\t * @param {string} query The typed text.\n\t\t */\n\t\tonSearch(query) {\n\t\t\t/** @event search The typed text, for a host that searches itself. */\n\t\t\tthis.$emit('search', query)\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-search-select {\n\tposition: relative;\n}\n\n/* The field takes the row: NcSelect is an inline block of at least 260px,\n which left the magnifier, placed at the row's end, outside the field\n (DqOverdragen \"Nieuw team\"). */\n.cn-search-select :deep(.v-select) {\n\twidth: 100%;\n}\n\n/* The magnifier sits where the chevron was: in the field, at its end. */\n.cn-search-select__magnifier {\n\tposition: absolute;\n\tinset-inline-end: 12px;\n\tbottom: 0;\n\theight: var(--default-clickable-area, 34px);\n\tdisplay: flex;\n\talign-items: center;\n\tz-index: 1;\n\tcolor: var(--color-text-maxcontrast);\n\tpointer-events: none;\n}\n\n.cn-search-select :deep(.vs__open-indicator),\n.cn-search-select :deep(.vs__open-indicator-button) {\n\tdisplay: none;\n}\n\n.cn-search-select :deep(.vs__actions) {\n\tpadding-inline-end: 36px;\n}\n\n.cn-search-select__row {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 10px;\n\twidth: 100%;\n\tmin-width: 0;\n\tpadding: 0;\n}\n\n.cn-search-select__lead {\n\tflex: 0 0 32px;\n\twidth: 32px;\n\theight: 32px;\n\tborder-radius: 50%;\n\tdisplay: inline-flex;\n\talign-items: center;\n\tjustify-content: center;\n\tbackground: var(--color-primary-element-light);\n\tcolor: var(--color-primary-element-light-text);\n\tfont-size: 13px;\n\tfont-weight: 600;\n}\n\n.cn-search-select__text {\n\tdisplay: flex;\n\tflex-direction: column;\n\tflex: 1 1 auto;\n\tmin-width: 0;\n}\n\n.cn-search-select__name {\n\tfont-weight: 600;\n\tline-height: normal;\n\toverflow-wrap: anywhere;\n}\n\n.cn-search-select__secondary {\n\tfont-size: 13px;\n\tline-height: normal;\n\tcolor: var(--color-text-maxcontrast);\n\toverflow-wrap: anywhere;\n}\n\n.cn-search-select__check {\n\tflex: 0 0 auto;\n\tcolor: var(--color-primary-element);\n}\n</style>\n"],"names":["CnIcon","t"],"mappings":";;;;;;;AAsDA;;;;AAIC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;AAGA;;AAED,aAAe;AACd,CAAA,IAAI,EAAE,gBAAgB;;AAEtB,CAAA,UAAU,EAAE,EAAE,KAAK,UAAEA,UAAM,EAAE,OAAO,EAAE,UAAU;;AAEhD,CAAA,KAAK,EAAE;AACN;EACA,UAAU,EAAE;GACX,IA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file":"CnSearchSelect.vue3.js","sources":["../../../../src/components/CnSearchSelect/CnSearchSelect.vue?vue&type=template&id=aaa45660&lang.js"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n<template>\n\t<div class=\"cn-search-select\" :class=\"{ 'cn-search-select--label-outside': labelOutside }\" data-testid=\"cn-search-select\">\n\t\t<NcSelect\n\t\t\t:inputId=\"inputId\"\n\t\t\t:inputLabel=\"inputLabel\"\n\t\t\t:labelOutside=\"labelOutside\"\n\t\t\t:modelValue=\"selectedOption\"\n\t\t\t:options=\"options\"\n\t\t\t:loading=\"loading\"\n\t\t\t:clearable=\"clearable\"\n\t\t\t:disabled=\"disabled\"\n\t\t\t:placeholder=\"resolvedPlaceholder\"\n\t\t\t:filterable=\"filterable\"\n\t\t\tlabel=\"label\"\n\t\t\t@search=\"onSearch\"\n\t\t\t@update:modelValue=\"onInput\">\n\t\t\t<template #option=\"option\">\n\t\t\t\t<span class=\"cn-search-select__row\" data-testid=\"cn-search-select-row\">\n\t\t\t\t\t<span\n\t\t\t\t\t\tv-if=\"option.avatar || option.icon\"\n\t\t\t\t\t\tclass=\"cn-search-select__lead\"\n\t\t\t\t\t\t:class=\"{ 'cn-search-select__lead--avatar': option.avatar && !option.icon }\"\n\t\t\t\t\t\taria-hidden=\"true\">\n\t\t\t\t\t\t<CnIcon v-if=\"option.icon\" :name=\"option.icon\" :size=\"18\" />\n\t\t\t\t\t\t<template v-else>{{ initialsOf(option) }}</template>\n\t\t\t\t\t</span>\n\t\t\t\t\t<span class=\"cn-search-select__text\">\n\t\t\t\t\t\t<span class=\"cn-search-select__name\">{{ option.label }}</span>\n\t\t\t\t\t\t<span v-if=\"option.secondary\" class=\"cn-search-select__secondary\">{{ option.secondary }}</span>\n\t\t\t\t\t</span>\n\t\t\t\t\t<Check\n\t\t\t\t\t\tv-if=\"isSelected(option)\"\n\t\t\t\t\t\tclass=\"cn-search-select__check\"\n\t\t\t\t\t\t:size=\"18\"\n\t\t\t\t\t\tdata-testid=\"cn-search-select-check\" />\n\t\t\t\t</span>\n\t\t\t</template>\n\t\t</NcSelect>\n\t\t<Magnify class=\"cn-search-select__magnifier\" :size=\"18\" aria-hidden=\"true\" />\n\t</div>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport { NcSelect } from '@nextcloud/vue'\nimport Check from 'vue-material-design-icons/Check.vue'\nimport Magnify from 'vue-material-design-icons/Magnify.vue'\nimport CnIcon from '../CnIcon/CnIcon.vue'\nimport { initialsOf } from '../../utils/initials.js'\n\n/**\n * CnSearchSelect — a single picker drawn as a search field: a magnifier\n * instead of the chevron, and results as rows with an icon or initials, a\n * name, a secondary line and a check on the chosen one (boards DqOverdragen\n * \"Nieuw team\", DqNieuweZaak \"Aanvrager\").\n *\n * Each option is `{ id, label, secondary?, icon?, avatar? }`: `icon` names a\n * CnIcon, `avatar: true` draws the label's initials in a circle. The value is\n * the option's `id` (or `value`); `update:modelValue` emits that id, or null\n * when cleared. Searching is the host's: listen to `search` and pass new\n * `options`, with `filterable: false` when the host already filtered them.\n *\n * ```vue\n * <CnSearchSelect\n * v-model=\"team\"\n * inputLabel=\"Nieuw team\"\n * :options=\"[{ id: 'legal', label: 'Juridische zaken', secondary: '6 leden · bezwaar, beroep en Woo-advies', avatar: true }]\" />\n * ```\n */\nexport default {\n\tname: 'CnSearchSelect',\n\n\tcomponents: { Check, CnIcon, Magnify, NcSelect },\n\n\tprops: {\n\t\t/** The chosen option's id, or the option itself. */\n\t\tmodelValue: {\n\t\t\ttype: [String, Number, Object],\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * The options: `{ id, label, secondary?, icon?, avatar? }`.\n\t\t *\n\t\t * @type {Array<{id: (string|number), label: string, secondary?: string, icon?: string, avatar?: boolean}>}\n\t\t */\n\t\toptions: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t\t/** The field's label. */\n\t\tinputLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** Draw the label above the field instead of inside it. */\n\t\tlabelOutside: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/** The input's id. */\n\t\tinputId: {\n\t\t\ttype: String,\n\t\t\tdefault: undefined,\n\t\t},\n\n\t\t/** Placeholder text; defaults to \"Search…\". */\n\t\tplaceholder: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** Show the loading spinner. */\n\t\tloading: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/** Offer a clear button. */\n\t\tclearable: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true,\n\t\t},\n\n\t\t/** Disable the field. */\n\t\tdisabled: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/** Filter the options on the typed text; false when the host searches. */\n\t\tfilterable: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true,\n\t\t},\n\t},\n\n\temits: ['update:modelValue', 'search'],\n\n\tcomputed: {\n\t\t/**\n\t\t * The option matching `modelValue`, or a bare one carrying it.\n\t\t *\n\t\t * @return {object|null}\n\t\t */\n\t\tselectedOption() {\n\t\t\tconst value = this.modelValue\n\t\t\tif (value === null || value === undefined || value === '') {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tif (typeof value === 'object') {\n\t\t\t\treturn value\n\t\t\t}\n\t\t\treturn this.options.find((o) => this.idOf(o) === String(value)) || { id: value, label: String(value) }\n\t\t},\n\n\t\t/** @return {string} The placeholder. */\n\t\tresolvedPlaceholder() {\n\t\t\treturn this.placeholder || t('nextcloud-vue', 'Search…')\n\t\t},\n\t},\n\n\tmethods: {\n\t\tinitialsOf(option) {\n\t\t\treturn initialsOf(option.label || '')\n\t\t},\n\n\t\t/**\n\t\t * @param {object} option An option.\n\t\t * @return {string} Its id as a string, '' without one.\n\t\t */\n\t\tidOf(option) {\n\t\t\tconst id = option && (option.id ?? option.value)\n\t\t\treturn id === null || id === undefined ? '' : String(id)\n\t\t},\n\n\t\t/**\n\t\t * @param {object} option An option.\n\t\t * @return {boolean} Whether it is the chosen one.\n\t\t */\n\t\tisSelected(option) {\n\t\t\treturn this.selectedOption !== null && this.idOf(option) !== '' && this.idOf(option) === this.idOf(this.selectedOption)\n\t\t},\n\n\t\t/**\n\t\t * @param {object|null} option The picked option.\n\t\t */\n\t\tonInput(option) {\n\t\t\tconst id = option ? (option.id ?? option.value ?? null) : null\n\t\t\t/** @event update:modelValue The picked option's id, or null when cleared. */\n\t\t\tthis.$emit('update:modelValue', id)\n\t\t},\n\n\t\t/**\n\t\t * @param {string} query The typed text.\n\t\t */\n\t\tonSearch(query) {\n\t\t\t/** @event search The typed text, for a host that searches itself. */\n\t\t\tthis.$emit('search', query)\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-search-select {\n\tposition: relative;\n}\n\n/* The field takes the row: NcSelect is an inline block of at least 260px,\n which left the magnifier, placed at the row's end, outside the field\n (DqOverdragen \"Nieuw team\"). */\n.cn-search-select :deep(.v-select) {\n\twidth: 100%;\n}\n\n/* The magnifier sits where the chevron was: in the field, at its end. */\n.cn-search-select__magnifier {\n\tposition: absolute;\n\tinset-inline-end: 12px;\n\tbottom: 0;\n\theight: var(--default-clickable-area, 34px);\n\tdisplay: flex;\n\talign-items: center;\n\tz-index: 1;\n\tcolor: var(--color-text-maxcontrast);\n\tpointer-events: none;\n}\n\n.cn-search-select :deep(.vs__open-indicator),\n.cn-search-select :deep(.vs__open-indicator-button) {\n\tdisplay: none;\n}\n\n.cn-search-select :deep(.vs__actions) {\n\tpadding-inline-end: 36px;\n}\n\n.cn-search-select__row {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 10px;\n\twidth: 100%;\n\tmin-width: 0;\n\tpadding: 4px 0;\n}\n\n.cn-search-select__lead {\n\tflex: 0 0 32px;\n\twidth: 32px;\n\theight: 32px;\n\tborder-radius: 50%;\n\tdisplay: inline-flex;\n\talign-items: center;\n\tjustify-content: center;\n\tbackground: var(--color-primary-element-light);\n\tcolor: var(--color-primary-element-light-text);\n\tfont-size: 13px;\n\tfont-weight: 600;\n}\n\n.cn-search-select__text {\n\tdisplay: flex;\n\tflex-direction: column;\n\tflex: 1 1 auto;\n\tmin-width: 0;\n}\n\n.cn-search-select__name {\n\tfont-weight: 600;\n\toverflow-wrap: anywhere;\n}\n\n.cn-search-select__secondary {\n\tfont-size: 13px;\n\tcolor: var(--color-text-maxcontrast);\n\toverflow-wrap: anywhere;\n}\n\n.cn-search-select__check {\n\tflex: 0 0 auto;\n\tcolor: var(--color-primary-element);\n}\n</style>\n"],"names":["_normalizeClass","_withCtx","_createElementVNode","_createElementBlock","_createBlock","_Fragment","_createTextVNode","_toDisplayString","_openBlock"],"mappings":";;;AAyBU,EAAA,KAAM,EAAA,uBAAuB;AAAC,EAAA,aAAW,EAAC,sBAAsB;;AAShE,MAAA,UAAA,GAAA,EAAA,KAAA,EAAA,wBAAA,GAAA;AACE,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,wBAAY,GAAA;;;AACM,EAAA,KAAA,EAAA,6BAAA;;;;;;;;;;IA3B9B,KAAK,EAAAA,cAAA,CAAA,CAAC,kBAAkB,EAAA,EAAA,iCAAA,EAAA,MAAA,CAAA,YAAA,EAAA,CAAA,CAAA;AAAA,IAAA,aAAA,EAAA,kBAAA;;;AAE1B,MAAA,OAAO,EAAE,MAAO,CAAA,OAAA;AAChB,MAAA,UAAU,EAAE,MAAI,CAAA,UAAA;AAChB,MAAA,YAAY,EAAE,MAAM,CAAA,YAAA;AACpB,MAAA,UAAU,EAAE,QAAM,CAAA,cAAA;AAClB,MAAA,OAAO,EAAE,MAAO,CAAA,OAAA;AAChB,MAAA,OAAO,EAAE,MAAO,CAAA,OAAA;AAChB,MAAA,SAAS,EAAE,MAAA,CAAA,SAAA;AACX,MAAA,QAAQ,EAAE,MAAM,CAAA,QAAA;AAChB,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,CAAA,MAAA,CAAA;4BADJH,WAIuC,CAAA,gBAAA,EAAA;;AAFvC,gBAAA,KAAK,EAAC,yBAAC;AACN,gBAAA,IAAI,EAAC,EAAA;AACN,gBAAA,aAAW,EAAC,wBAAwB;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"CnSearchSelect.vue3.js","sources":["../../../../src/components/CnSearchSelect/CnSearchSelect.vue?vue&type=template&id=29601046&lang.js"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n<template>\n\t<div class=\"cn-search-select\" :class=\"{ 'cn-search-select--label-outside': labelOutside }\" data-testid=\"cn-search-select\">\n\t\t<NcSelect\n\t\t\t:inputId=\"inputId\"\n\t\t\t:inputLabel=\"inputLabel\"\n\t\t\t:labelOutside=\"labelOutside\"\n\t\t\t:modelValue=\"selectedOption\"\n\t\t\t:options=\"options\"\n\t\t\t:loading=\"loading\"\n\t\t\t:clearable=\"clearable\"\n\t\t\t:disabled=\"disabled\"\n\t\t\t:placeholder=\"resolvedPlaceholder\"\n\t\t\t:filterable=\"filterable\"\n\t\t\tlabel=\"label\"\n\t\t\t@search=\"onSearch\"\n\t\t\t@update:modelValue=\"onInput\">\n\t\t\t<template #option=\"option\">\n\t\t\t\t<span class=\"cn-search-select__row\" data-testid=\"cn-search-select-row\">\n\t\t\t\t\t<span\n\t\t\t\t\t\tv-if=\"option.avatar || option.icon\"\n\t\t\t\t\t\tclass=\"cn-search-select__lead\"\n\t\t\t\t\t\t:class=\"{ 'cn-search-select__lead--avatar': option.avatar && !option.icon }\"\n\t\t\t\t\t\taria-hidden=\"true\">\n\t\t\t\t\t\t<CnIcon v-if=\"option.icon\" :name=\"option.icon\" :size=\"18\" />\n\t\t\t\t\t\t<template v-else>{{ initialsOf(option) }}</template>\n\t\t\t\t\t</span>\n\t\t\t\t\t<span class=\"cn-search-select__text\">\n\t\t\t\t\t\t<span class=\"cn-search-select__name\">{{ option.label }}</span>\n\t\t\t\t\t\t<span v-if=\"option.secondary\" class=\"cn-search-select__secondary\">{{ option.secondary }}</span>\n\t\t\t\t\t</span>\n\t\t\t\t\t<Check\n\t\t\t\t\t\tv-if=\"isSelected(option)\"\n\t\t\t\t\t\tclass=\"cn-search-select__check\"\n\t\t\t\t\t\t:size=\"18\"\n\t\t\t\t\t\tdata-testid=\"cn-search-select-check\" />\n\t\t\t\t</span>\n\t\t\t</template>\n\t\t</NcSelect>\n\t\t<Magnify class=\"cn-search-select__magnifier\" :size=\"18\" aria-hidden=\"true\" />\n\t</div>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport { NcSelect } from '@nextcloud/vue'\nimport Check from 'vue-material-design-icons/Check.vue'\nimport Magnify from 'vue-material-design-icons/Magnify.vue'\nimport CnIcon from '../CnIcon/CnIcon.vue'\nimport { initialsOf } from '../../utils/initials.js'\n\n/**\n * CnSearchSelect — a single picker drawn as a search field: a magnifier\n * instead of the chevron, and results as rows with an icon or initials, a\n * name, a secondary line and a check on the chosen one (boards DqOverdragen\n * \"Nieuw team\", DqNieuweZaak \"Aanvrager\").\n *\n * Each option is `{ id, label, secondary?, icon?, avatar? }`: `icon` names a\n * CnIcon, `avatar: true` draws the label's initials in a circle. The value is\n * the option's `id` (or `value`); `update:modelValue` emits that id, or null\n * when cleared. Searching is the host's: listen to `search` and pass new\n * `options`, with `filterable: false` when the host already filtered them.\n *\n * ```vue\n * <CnSearchSelect\n * v-model=\"team\"\n * inputLabel=\"Nieuw team\"\n * :options=\"[{ id: 'legal', label: 'Juridische zaken', secondary: '6 leden · bezwaar, beroep en Woo-advies', avatar: true }]\" />\n * ```\n */\nexport default {\n\tname: 'CnSearchSelect',\n\n\tcomponents: { Check, CnIcon, Magnify, NcSelect },\n\n\tprops: {\n\t\t/** The chosen option's id, or the option itself. */\n\t\tmodelValue: {\n\t\t\ttype: [String, Number, Object],\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * The options: `{ id, label, secondary?, icon?, avatar? }`.\n\t\t *\n\t\t * @type {Array<{id: (string|number), label: string, secondary?: string, icon?: string, avatar?: boolean}>}\n\t\t */\n\t\toptions: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t\t/** The field's label. */\n\t\tinputLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** Draw the label above the field instead of inside it. */\n\t\tlabelOutside: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/** The input's id. */\n\t\tinputId: {\n\t\t\ttype: String,\n\t\t\tdefault: undefined,\n\t\t},\n\n\t\t/** Placeholder text; defaults to \"Search…\". */\n\t\tplaceholder: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** Show the loading spinner. */\n\t\tloading: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/** Offer a clear button. */\n\t\tclearable: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true,\n\t\t},\n\n\t\t/** Disable the field. */\n\t\tdisabled: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/** Filter the options on the typed text; false when the host searches. */\n\t\tfilterable: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true,\n\t\t},\n\t},\n\n\temits: ['update:modelValue', 'search'],\n\n\tcomputed: {\n\t\t/**\n\t\t * The option matching `modelValue`, or a bare one carrying it.\n\t\t *\n\t\t * @return {object|null}\n\t\t */\n\t\tselectedOption() {\n\t\t\tconst value = this.modelValue\n\t\t\tif (value === null || value === undefined || value === '') {\n\t\t\t\treturn null\n\t\t\t}\n\t\t\tif (typeof value === 'object') {\n\t\t\t\treturn value\n\t\t\t}\n\t\t\treturn this.options.find((o) => this.idOf(o) === String(value)) || { id: value, label: String(value) }\n\t\t},\n\n\t\t/** @return {string} The placeholder. */\n\t\tresolvedPlaceholder() {\n\t\t\treturn this.placeholder || t('nextcloud-vue', 'Search…')\n\t\t},\n\t},\n\n\tmethods: {\n\t\tinitialsOf(option) {\n\t\t\treturn initialsOf(option.label || '')\n\t\t},\n\n\t\t/**\n\t\t * @param {object} option An option.\n\t\t * @return {string} Its id as a string, '' without one.\n\t\t */\n\t\tidOf(option) {\n\t\t\tconst id = option && (option.id ?? option.value)\n\t\t\treturn id === null || id === undefined ? '' : String(id)\n\t\t},\n\n\t\t/**\n\t\t * @param {object} option An option.\n\t\t * @return {boolean} Whether it is the chosen one.\n\t\t */\n\t\tisSelected(option) {\n\t\t\treturn this.selectedOption !== null && this.idOf(option) !== '' && this.idOf(option) === this.idOf(this.selectedOption)\n\t\t},\n\n\t\t/**\n\t\t * @param {object|null} option The picked option.\n\t\t */\n\t\tonInput(option) {\n\t\t\tconst id = option ? (option.id ?? option.value ?? null) : null\n\t\t\t/** @event update:modelValue The picked option's id, or null when cleared. */\n\t\t\tthis.$emit('update:modelValue', id)\n\t\t},\n\n\t\t/**\n\t\t * @param {string} query The typed text.\n\t\t */\n\t\tonSearch(query) {\n\t\t\t/** @event search The typed text, for a host that searches itself. */\n\t\t\tthis.$emit('search', query)\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-search-select {\n\tposition: relative;\n}\n\n/* The field takes the row: NcSelect is an inline block of at least 260px,\n which left the magnifier, placed at the row's end, outside the field\n (DqOverdragen \"Nieuw team\"). */\n.cn-search-select :deep(.v-select) {\n\twidth: 100%;\n}\n\n/* The magnifier sits where the chevron was: in the field, at its end. */\n.cn-search-select__magnifier {\n\tposition: absolute;\n\tinset-inline-end: 12px;\n\tbottom: 0;\n\theight: var(--default-clickable-area, 34px);\n\tdisplay: flex;\n\talign-items: center;\n\tz-index: 1;\n\tcolor: var(--color-text-maxcontrast);\n\tpointer-events: none;\n}\n\n.cn-search-select :deep(.vs__open-indicator),\n.cn-search-select :deep(.vs__open-indicator-button) {\n\tdisplay: none;\n}\n\n.cn-search-select :deep(.vs__actions) {\n\tpadding-inline-end: 36px;\n}\n\n.cn-search-select__row {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 10px;\n\twidth: 100%;\n\tmin-width: 0;\n\tpadding: 0;\n}\n\n.cn-search-select__lead {\n\tflex: 0 0 32px;\n\twidth: 32px;\n\theight: 32px;\n\tborder-radius: 50%;\n\tdisplay: inline-flex;\n\talign-items: center;\n\tjustify-content: center;\n\tbackground: var(--color-primary-element-light);\n\tcolor: var(--color-primary-element-light-text);\n\tfont-size: 13px;\n\tfont-weight: 600;\n}\n\n.cn-search-select__text {\n\tdisplay: flex;\n\tflex-direction: column;\n\tflex: 1 1 auto;\n\tmin-width: 0;\n}\n\n.cn-search-select__name {\n\tfont-weight: 600;\n\tline-height: normal;\n\toverflow-wrap: anywhere;\n}\n\n.cn-search-select__secondary {\n\tfont-size: 13px;\n\tline-height: normal;\n\tcolor: var(--color-text-maxcontrast);\n\toverflow-wrap: anywhere;\n}\n\n.cn-search-select__check {\n\tflex: 0 0 auto;\n\tcolor: var(--color-primary-element);\n}\n</style>\n"],"names":["_normalizeClass","_withCtx","_createElementVNode","_createElementBlock","_createBlock","_Fragment","_createTextVNode","_toDisplayString","_openBlock"],"mappings":";;;AAyBU,EAAA,KAAM,EAAA,uBAAuB;AAAC,EAAA,aAAW,EAAC,sBAAsB;;AAShE,MAAA,UAAA,GAAA,EAAA,KAAA,EAAA,wBAAA,GAAA;AACE,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,wBAAY,GAAA;;;AACM,EAAA,KAAA,EAAA,6BAAA;;;;;;;;;;IA3B9B,KAAK,EAAAA,cAAA,CAAA,CAAC,kBAAkB,EAAA,EAAA,iCAAA,EAAA,MAAA,CAAA,YAAA,EAAA,CAAA,CAAA;AAAA,IAAA,aAAA,EAAA,kBAAA;;;AAE1B,MAAA,OAAO,EAAE,MAAO,CAAA,OAAA;AAChB,MAAA,UAAU,EAAE,MAAI,CAAA,UAAA;AAChB,MAAA,YAAY,EAAE,MAAM,CAAA,YAAA;AACpB,MAA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;AACZ,YAAA,CAAA,MAAM,CAAC,SAAS;AAA5B,iBAAAC,SAAA,EAAA,EAAAL,kBAAA,CAA8B,MAA9B,EAAA,UAA8B,EAAAI,eAAA,CAAA,MAAA,CAAA,SAAA,CAAA,EAAA,CAAA,YAAA;;;AAG1B,UAAA,CAAA,QAAA,CAAA,UAAA,CAAA,MAAA,CAAA;4BADJH,WAIuC,CAAA,gBAAA,EAAA;;AAFvC,gBAAA,KAAK,EAAC,yBAAC;AACN,gBAAA,IAAI,EAAC,EAAA;AACN,gBAAA,aAAW,EAAC,wBAAwB;;;;;;;;;;;;;;;;;"}
@@ -2,7 +2,7 @@ import script from './CnStagesWidget.vue2.js';
2
2
  import { render } from './CnStagesWidget.vue3.js';
3
3
 
4
4
  script.render = render;
5
- script.__scopeId = "data-v-3946def5";
5
+ script.__scopeId = "data-v-83c4783a";
6
6
  const __sfc_main = script;
7
7
 
8
8
  export { __sfc_main as default };
@@ -85,6 +85,9 @@ function userError(message) {
85
85
  * labelField?, descriptionField?, finalField?, limit? }`, an OpenRegister
86
86
  * query whose filter takes the same tokens.
87
87
  *
88
+ * Both take `offPathField`: a stage whose row holds true there is a side
89
+ * status, left off the strip unless the record is in it.
90
+ *
88
91
  * `datesSource`: `{ url, method?, params?, path?, idField?, dateField? }`, an
89
92
  * endpoint (same token grammar) answering the date the record reached each
90
93
  * stage, when the stage list does not carry it: the case type's statuses list
@@ -462,7 +465,7 @@ var script = {
462
465
  const cfg = this.stageConfig;
463
466
  const rows = this.endpointStages ? getByPath(this.stagesBody, cfg.path) : this.sourceRows;
464
467
  const orderField = cfg.orderField || (this.endpointStages ? '' : cfg.orderBy);
465
- return normalizeStages(rows, { ...cfg, orderField })
468
+ return normalizeStages(rows, { ...cfg, orderField, currentId: this.currentStageId })
466
469
  },
467
470
 
468
471
  /**