@conduction/nextcloud-vue 2.167.0 → 2.168.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.
@@ -2,7 +2,7 @@ import script from './CnRecordNoteRows.vue2.js';
2
2
  import { render } from './CnRecordNoteRows.vue3.js';
3
3
 
4
4
  script.render = render;
5
- script.__scopeId = "data-v-0a89078f";
5
+ script.__scopeId = "data-v-9dce26e6";
6
6
  const __sfc_main = script;
7
7
 
8
8
  export { __sfc_main as default };
@@ -53,7 +53,7 @@ var script = {
53
53
  required: true,
54
54
  },
55
55
 
56
- /** `recordAll`, already translated: `{ label, title?, text?, icon?, cancel?: { label, to }, placement?: { widget } }`, or null. */
56
+ /** `recordAll`, already translated: `{ label, title?, text?: (string|{ zero?, one?, other }), icon?, cancel?: { label, to }, placement?: { widget, sentence? } }`, or null. */
57
57
  recordAll: {
58
58
  type: Object,
59
59
  default: null,
@@ -86,6 +86,27 @@ var script = {
86
86
  return this.items.filter((item) => this.hasDraft(item.key)).length
87
87
  },
88
88
 
89
+ /**
90
+ * The record-all sentence for the notes filled in now: a plain
91
+ * sentence as it is, else the `zero`, `one` or `other` form with
92
+ * `{count}` filled in.
93
+ *
94
+ * @return {string}
95
+ * @spec openspec/changes/record-all-counted-sentence/specs/record-list-notes/spec.md
96
+ */
97
+ allSentence() {
98
+ const text = this.recordAll?.text;
99
+ if (typeof text === 'string') {
100
+ return text
101
+ }
102
+ if (!text || typeof text !== 'object') {
103
+ return ''
104
+ }
105
+ const count = this.readyCount;
106
+ const form = (count === 0 && text.zero) || (count === 1 && text.one) || text.other || text.one || '';
107
+ return form.replace(/\{count\}/g, String(count))
108
+ },
109
+
89
110
  /** @return {string} The label of the ready figure. */
90
111
  readyLabel() {
91
112
  return this.action.readyLabel || translate('nextcloud-vue', 'filled in, not recorded yet')
@@ -1 +1 @@
1
- {"version":3,"file":"CnRecordNoteRows.vue2.js","sources":["../../../../src/components/CnRecordListWidget/CnRecordNoteRows.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n\n<template>\n\t<div class=\"cn-record-notes\" data-testid=\"cn-record-list-notes\">\n\t\t<p class=\"cn-record-notes__ready\" data-testid=\"cn-record-list-notes-ready\">\n\t\t\t<span class=\"cn-record-notes__ready-figure\">{{ readyCount }}</span>\n\t\t\t<span class=\"cn-record-notes__ready-label\">{{ readyLabel }}</span>\n\t\t</p>\n\t\t<div\n\t\t\tv-for=\"item in items\"\n\t\t\t:key=\"item.key\"\n\t\t\tclass=\"cn-record-notes__row\"\n\t\t\tdata-testid=\"cn-record-list-item\">\n\t\t\t<div class=\"cn-record-notes__head\">\n\t\t\t\t<CnStatusBadge\n\t\t\t\t\tv-if=\"item.pill\"\n\t\t\t\t\t:label=\"item.pill.label\"\n\t\t\t\t\t:variant=\"item.pill.variant\"\n\t\t\t\t\tsize=\"small\" />\n\t\t\t\t<component\n\t\t\t\t\t:is=\"item.tag\"\n\t\t\t\t\tv-if=\"item.title\"\n\t\t\t\t\tclass=\"cn-record-notes__title\"\n\t\t\t\t\t:class=\"{ 'cn-record-notes__title--link': item.tag !== 'div' }\"\n\t\t\t\t\tv-bind=\"item.attrs\">\n\t\t\t\t\t{{ item.title }}\n\t\t\t\t</component>\n\t\t\t\t<span v-if=\"item.meta\" class=\"cn-record-notes__meta\">{{ item.meta }}</span>\n\t\t\t\t<span class=\"cn-record-notes__spacer\" />\n\t\t\t\t<span\n\t\t\t\t\tv-if=\"item.due\"\n\t\t\t\t\tclass=\"cn-record-notes__due\"\n\t\t\t\t\t:class=\"`cn-record-notes__due--${dueToneOf(item.due)}`\"\n\t\t\t\t\tdata-testid=\"cn-record-list-due\">{{ item.due.text }}</span>\n\t\t\t</div>\n\t\t\t<div class=\"cn-record-notes__fields\">\n\t\t\t\t<!-- The label stands above the field, as the leaf's own beside it\n\t\t\t\t (humaniq \"Uren\"), so both fields share one line. -->\n\t\t\t\t<div class=\"cn-record-notes__field\">\n\t\t\t\t\t<label :for=\"fieldId(item.key)\" class=\"cn-record-notes__field-label\">{{ fieldLabel }}</label>\n\t\t\t\t\t<NcTextField\n\t\t\t\t\t\t:id=\"fieldId(item.key)\"\n\t\t\t\t\t\t:modelValue=\"drafts[item.key] || ''\"\n\t\t\t\t\t\t:label=\"fieldLabel\"\n\t\t\t\t\t\tlabelOutside\n\t\t\t\t\t\t:placeholder=\"placeholder\"\n\t\t\t\t\t\t:disabled=\"busy\"\n\t\t\t\t\t\t:data-testid=\"`cn-record-list-note-${item.key}`\"\n\t\t\t\t\t\t@update:modelValue=\"setDraft(item.key, $event)\" />\n\t\t\t\t</div>\n\t\t\t\t<div v-if=\"leaf && leafProvider\" class=\"cn-record-notes__leaf\" :data-testid=\"`cn-record-list-leaf-${item.key}`\">\n\t\t\t\t\t<CnLeafMountHost\n\t\t\t\t\t\tv-if=\"leafIsMount\"\n\t\t\t\t\t\t:provider=\"leafProvider\"\n\t\t\t\t\t\t:mountProps=\"leafProps(item.row)\" />\n\t\t\t\t\t<component :is=\"leafComponent\" v-else-if=\"leafComponent\" v-bind=\"leafProps(item.row)\" />\n\t\t\t\t</div>\n\t\t\t\t<NcButton\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t:disabled=\"busy || !hasDraft(item.key)\"\n\t\t\t\t\t:data-testid=\"`cn-record-list-record-${item.key}`\"\n\t\t\t\t\t@click=\"record(item)\">\n\t\t\t\t\t{{ recordLabel }}\n\t\t\t\t</NcButton>\n\t\t\t</div>\n\t\t\t<p\n\t\t\t\tv-if=\"leafUnavailable\"\n\t\t\t\tclass=\"cn-record-notes__leaf-missing\"\n\t\t\t\t:data-testid=\"`cn-record-list-leaf-missing-${item.key}`\">\n\t\t\t\t{{ leafUnavailableText }}\n\t\t\t</p>\n\t\t</div>\n\t\t<p v-if=\"error\"\n\t\t\tclass=\"cn-record-notes__error\"\n\t\t\trole=\"alert\"\n\t\t\tdata-testid=\"cn-record-list-notes-error\">\n\t\t\t{{ error }}\n\t\t</p>\n\t\t<!-- `recordAll.placement.widget`: the pair goes to the foot of that\n\t\t dashboard card, which carries the title and sentence itself. -->\n\t\t<Teleport v-if=\"recordAll\" :to=\"placedTarget || 'body'\" :disabled=\"!placedTarget\">\n\t\t\t<div\n\t\t\t\tclass=\"cn-record-notes__all\"\n\t\t\t\t:class=\"{ 'cn-record-notes__all--placed': !!placedTarget }\"\n\t\t\t\tdata-testid=\"cn-record-list-record-all\">\n\t\t\t\t<div v-if=\"!placedTarget\" class=\"cn-record-notes__all-text\">\n\t\t\t\t\t<h3 v-if=\"recordAll.title\" class=\"cn-record-notes__all-title\">\n\t\t\t\t\t\t{{ recordAll.title }}\n\t\t\t\t\t</h3>\n\t\t\t\t\t<p v-if=\"recordAll.text\" class=\"cn-record-notes__all-sentence\">\n\t\t\t\t\t\t{{ recordAll.text }}\n\t\t\t\t\t</p>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"cn-record-notes__all-actions\">\n\t\t\t\t\t<NcButton v-if=\"recordAll.cancel\" variant=\"secondary\" :to=\"recordAll.cancel.to\">\n\t\t\t\t\t\t{{ recordAll.cancel.label }}\n\t\t\t\t\t</NcButton>\n\t\t\t\t\t<NcButton\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t:disabled=\"busy || readyCount === 0\"\n\t\t\t\t\t\tdata-testid=\"cn-record-list-record-all-button\"\n\t\t\t\t\t\t@click=\"recordEvery\">\n\t\t\t\t\t\t<template v-if=\"recordAll.icon\" #icon>\n\t\t\t\t\t\t\t<CnIcon :name=\"recordAll.icon\" :size=\"20\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t{{ recordAll.label }}\n\t\t\t\t\t</NcButton>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</Teleport>\n\t</div>\n</template>\n\n<script>\nimport { emit } from '@nextcloud/event-bus'\nimport { translate as t } from '@nextcloud/l10n'\nimport { NcButton, NcTextField } from '@nextcloud/vue'\nimport CnIcon from '../CnIcon/CnIcon.vue'\nimport CnLeafMountHost from '../CnLeafMountHost/CnLeafMountHost.vue'\nimport CnStatusBadge from '../CnStatusBadge/CnStatusBadge.vue'\nimport { useIntegrationRegistry } from '../../composables/useIntegrationRegistry.js'\nimport { isAppInstalled } from '../../utils/appInstalled.js'\nimport { prefixUrl } from '../../utils/headers.js'\nimport { readPath } from '../../utils/readPath.js'\n\n/** The bus channel every endpoint-bound widget on the page refetches on. */\nconst PAGE_REFRESH_CHANNEL = 'cn:page:refresh'\n\n/**\n * The document event a recorded note sends, so a row's leaf (humaniq's\n * hours) can record what it holds for the same object at the same moment.\n * `detail` is the row's leaf props plus `note`.\n */\nconst NOTE_RECORDED_EVENT = 'cn-record-notes:recorded'\n\n/**\n * The rows of a record list drawn as notes to record (`presentation:\n * \"notes\"`, DqDagAfsluiten \"Nog open van vandaag\"): per row its pill, title,\n * meta and due text, a field for what happened, an optional integration leaf\n * (humaniq's hours) and a button that records the note on the row's own\n * notes endpoint. What is typed and not yet recorded stays in this browser\n * (session storage) and is counted as the \"ready to record\" figure; one\n * button records every filled row. After a note is recorded the page's\n * endpoint widgets refetch, so the row moves to whatever lists the server\n * keeps of recorded work.\n *\n * @spec openspec/changes/record-list-notes/specs/record-list-notes/spec.md#requirement-a-record-list-can-collect-and-record-a-note-per-row\n */\nexport default {\n\tname: 'CnRecordNoteRows',\n\n\tcomponents: { CnIcon, CnLeafMountHost, CnStatusBadge, NcButton, NcTextField },\n\n\tprops: {\n\t\t/** The list's rows as the record list builds them (`key`, `row`, `tag`, `attrs`, `title`, `meta`, `pill`, `due`). */\n\t\titems: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t\t/**\n\t\t * `noteAction`, already translated: `{ urlField?, url?, bodyField?,\n\t\t * label, fieldLabel, placeholder?, readyLabel, draftsKey?, errorText? }`.\n\t\t */\n\t\taction: {\n\t\t\ttype: Object,\n\t\t\trequired: true,\n\t\t},\n\n\t\t/** `recordAll`, already translated: `{ label, title?, text?, icon?, cancel?: { label, to }, placement?: { widget } }`, or null. */\n\t\trecordAll: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** `rowLeaf`: `{ id, app?, register?, objectIdField, schemaField?, schema?, unavailableText? }`, or null. */\n\t\tleaf: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\t},\n\n\tsetup() {\n\t\tconst { getById } = useIntegrationRegistry()\n\t\treturn { getProvider: getById }\n\t},\n\n\tdata() {\n\t\treturn { drafts: this.readDrafts(), busy: false, error: '', placedTarget: null }\n\t},\n\n\tcomputed: {\n\t\t/** @return {string} The session storage key of this list's drafts. */\n\t\tdraftsKey() {\n\t\t\treturn `cn-record-list-notes:${this.action.draftsKey || 'default'}`\n\t\t},\n\n\t\t/** @return {number} The rows with a note typed and not yet recorded. */\n\t\treadyCount() {\n\t\t\treturn this.items.filter((item) => this.hasDraft(item.key)).length\n\t\t},\n\n\t\t/** @return {string} The label of the ready figure. */\n\t\treadyLabel() {\n\t\t\treturn this.action.readyLabel || t('nextcloud-vue', 'filled in, not recorded yet')\n\t\t},\n\n\t\t/** @return {string} */\n\t\trecordLabel() {\n\t\t\treturn this.action.label || t('nextcloud-vue', 'Record')\n\t\t},\n\n\t\t/** @return {string} */\n\t\tfieldLabel() {\n\t\t\treturn this.action.fieldLabel || t('nextcloud-vue', 'Note')\n\t\t},\n\n\t\t/** @return {string} */\n\t\tplaceholder() {\n\t\t\treturn this.action.placeholder || ''\n\t\t},\n\n\t\t/** @return {object|null} The leaf's integration provider, when one is registered. */\n\t\tleafProvider() {\n\t\t\treturn this.leaf && this.leaf.id ? (this.getProvider(this.leaf.id) || null) : null\n\t\t},\n\n\t\t/** @return {boolean} Whether the leaf mounts itself (`renderMode: \"mount\"`). */\n\t\tleafIsMount() {\n\t\t\tconst provider = this.leafProvider\n\t\t\treturn Boolean(provider) && provider.renderMode === 'mount' && typeof provider.mount === 'function'\n\t\t},\n\n\t\t/** @return {object|null} The leaf's component, in component mode. */\n\t\tleafComponent() {\n\t\t\tconst provider = this.leafProvider\n\t\t\treturn provider ? (provider.tab || provider.widget || null) : null\n\t\t},\n\n\t\t/**\n\t\t * Whether the leaf's app is installed but the leaf is not available, so\n\t\t * the row says so instead of silently showing no field.\n\t\t *\n\t\t * @return {boolean}\n\t\t */\n\t\tleafUnavailable() {\n\t\t\treturn Boolean(this.leaf && this.leaf.app && !this.leafProvider && isAppInstalled(this.leaf.app))\n\t\t},\n\n\t\t/** @return {string} */\n\t\tleafUnavailableText() {\n\t\t\treturn this.leaf?.unavailableText || t('nextcloud-vue', 'This field is not available here.')\n\t\t},\n\t},\n\n\twatch: {\n\t\tdrafts: {\n\t\t\tdeep: true,\n\t\t\thandler() {\n\t\t\t\tthis.saveDrafts()\n\t\t\t},\n\t\t},\n\t},\n\n\tmounted() {\n\t\tthis.findPlacedTarget()\n\t\tthis.$nextTick(() => this.findPlacedTarget())\n\t\tthis.watchPlacedTarget()\n\t},\n\n\tbeforeUnmount() {\n\t\tif (this.placedObserver) {\n\t\t\tthis.placedObserver.disconnect()\n\t\t\tthis.placedObserver = null\n\t\t}\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * The content of the dashboard card `recordAll.placement.widget` names,\n\t\t * once it is on the page; until then (or without one) the pair stays\n\t\t * under the rows.\n\t\t *\n\t\t * @return {void}\n\t\t * @spec openspec/changes/record-all-in-its-own-card/specs/record-list-notes/spec.md\n\t\t */\n\t\tfindPlacedTarget() {\n\t\t\tconst widget = this.recordAll?.placement?.widget\n\t\t\tif ((this.placedTarget && this.placedTarget.isConnected) || typeof widget !== 'string' || widget === '' || typeof document === 'undefined') {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst card = [...document.querySelectorAll('[data-cn-widget-id]')].find((el) => el.getAttribute('data-cn-widget-id') === widget)\n\t\t\tthis.placedTarget = card ? (card.querySelector('.cn-widget-wrapper__content') || null) : null\n\t\t},\n\n\t\t/**\n\t\t * Look for the placed card again whenever the page changes: the grid\n\t\t * can draw that card after this list, or draw it again, and a pair\n\t\t * left in a card no longer on the page is not seen at all.\n\t\t *\n\t\t * @return {void}\n\t\t * @spec openspec/changes/record-all-follows-its-card/specs/record-list-notes/spec.md#requirement-the-placed-pair-follows-its-card\n\t\t */\n\t\twatchPlacedTarget() {\n\t\t\tconst widget = this.recordAll?.placement?.widget\n\t\t\tif (typeof widget !== 'string' || widget === '' || typeof MutationObserver === 'undefined' || typeof document === 'undefined') {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.placedObserver = new MutationObserver(() => this.findPlacedTarget())\n\t\t\tthis.placedObserver.observe(document.body, { childList: true, subtree: true })\n\t\t},\n\n\t\t/**\n\t\t * The drafts this browser session kept, by row key.\n\t\t *\n\t\t * @return {Object<string, string>}\n\t\t */\n\t\treadDrafts() {\n\t\t\ttry {\n\t\t\t\tconst raw = window.sessionStorage.getItem(`cn-record-list-notes:${this.action?.draftsKey || 'default'}`)\n\t\t\t\tconst parsed = raw ? JSON.parse(raw) : {}\n\t\t\t\treturn parsed && typeof parsed === 'object' && !Array.isArray(parsed) ? parsed : {}\n\t\t\t} catch {\n\t\t\t\treturn {}\n\t\t\t}\n\t\t},\n\n\t\t/** @return {void} */\n\t\tsaveDrafts() {\n\t\t\ttry {\n\t\t\t\twindow.sessionStorage.setItem(this.draftsKey, JSON.stringify(this.drafts))\n\t\t\t} catch {\n\t\t\t\t// Without session storage the drafts live as long as the page.\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * The colour of a due text: a term that ended or ends today in the\n\t\t * error colour, one still to come in the warning colour.\n\t\t *\n\t\t * @param {{tone: string}} due The due text.\n\t\t * @return {string} `error`, `warning` or `muted`.\n\t\t */\n\t\tdueToneOf(due) {\n\t\t\tif (due.tone === 'danger' || due.tone === 'today') {\n\t\t\t\treturn 'error'\n\t\t\t}\n\t\t\treturn due.tone === 'upcoming' ? 'warning' : 'muted'\n\t\t},\n\n\t\t/**\n\t\t * @param {string} key The row key.\n\t\t * @param {string} value The typed note.\n\t\t * @return {void}\n\t\t */\n\t\tsetDraft(key, value) {\n\t\t\tthis.drafts = { ...this.drafts, [key]: String(value ?? '') }\n\t\t},\n\n\t\t/**\n\t\t * The id of a row's note field, for its label.\n\t\t *\n\t\t * @param {string} key The row key.\n\t\t * @return {string} The id.\n\t\t */\n\t\tfieldId(key) {\n\t\t\treturn `cn-record-notes-${this.$.uid}-${String(key).replace(/[^A-Za-z0-9_-]/g, '-')}`\n\t\t},\n\n\t\t/**\n\t\t * @param {string} key The row key.\n\t\t * @return {boolean} Whether the row has a note typed.\n\t\t */\n\t\thasDraft(key) {\n\t\t\treturn String(this.drafts[key] ?? '').trim() !== ''\n\t\t},\n\n\t\t/**\n\t\t * The props the row's leaf gets: the row's object, register and schema.\n\t\t *\n\t\t * @param {object} row The row.\n\t\t * @return {object}\n\t\t */\n\t\tleafProps(row) {\n\t\t\tconst leaf = this.leaf || {}\n\t\t\treturn {\n\t\t\t\tobjectId: String(readPath(row, leaf.objectIdField || 'id') ?? ''),\n\t\t\t\tregister: leaf.register || '',\n\t\t\t\tschema: leaf.schemaField ? String(readPath(row, leaf.schemaField) ?? '') : (leaf.schema || ''),\n\t\t\t\tsurface: 'row',\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * The row's notes endpoint: the row's `urlField`, else `url` with\n\t\t * `{field}` filled from the row.\n\t\t *\n\t\t * @param {object} row The row.\n\t\t * @return {string} The URL, or ''.\n\t\t */\n\t\turlOf(row) {\n\t\t\tif (this.action.urlField) {\n\t\t\t\treturn String(readPath(row, this.action.urlField) ?? '')\n\t\t\t}\n\t\t\tconst template = String(this.action.url || '')\n\t\t\treturn template.replace(/\\{([A-Za-z0-9_.]+)\\}/g, (_, path) => encodeURIComponent(String(readPath(row, path) ?? '')))\n\t\t},\n\n\t\t/**\n\t\t * Record one row's note, then let the page refetch.\n\t\t *\n\t\t * @param {object} item The row item.\n\t\t * @param {boolean} [refresh] Whether to refresh the page after it.\n\t\t * @return {Promise<boolean>} Whether it was recorded.\n\t\t */\n\t\tasync record(item, refresh = true) {\n\t\t\tconst text = String(this.drafts[item.key] ?? '').trim()\n\t\t\tconst url = this.urlOf(item.row)\n\t\t\tif (text === '' || url === '') {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tthis.busy = true\n\t\t\tthis.error = ''\n\t\t\ttry {\n\t\t\t\tconst { default: axios } = await import('@nextcloud/axios')\n\t\t\t\tawait axios.post(prefixUrl(url), { [this.action.bodyField || 'message']: text })\n\t\t\t\tif (this.leaf) {\n\t\t\t\t\tdocument.dispatchEvent(new CustomEvent(NOTE_RECORDED_EVENT, { detail: { ...this.leafProps(item.row), note: text } }))\n\t\t\t\t}\n\t\t\t\tconst { [item.key]: done, ...rest } = this.drafts\n\t\t\t\tthis.drafts = rest\n\t\t\t\tif (refresh) {\n\t\t\t\t\temit(PAGE_REFRESH_CHANNEL, {})\n\t\t\t\t}\n\t\t\t\treturn true\n\t\t\t} catch {\n\t\t\t\tthis.error = this.action.errorText || t('nextcloud-vue', 'The note could not be recorded. It is kept here; try again.')\n\t\t\t\treturn false\n\t\t\t} finally {\n\t\t\t\tthis.busy = false\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Record every row with a note, one after another, then refresh once.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync recordEvery() {\n\t\t\tconst filled = this.items.filter((item) => this.hasDraft(item.key))\n\t\t\tlet any = false\n\t\t\tfor (const item of filled) {\n\t\t\t\tany = (await this.record(item, false)) || any\n\t\t\t}\n\t\t\tif (any) {\n\t\t\t\temit(PAGE_REFRESH_CHANNEL, {})\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-record-notes {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 0;\n}\n\n.cn-record-notes__ready {\n\tdisplay: flex;\n\talign-items: baseline;\n\tgap: 6px;\n\tmargin: 0 0 8px;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-record-notes__ready-figure {\n\tfont-weight: 700;\n\tcolor: var(--color-main-text);\n}\n\n.cn-record-notes__row {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 10px;\n\tpadding: 14px 0;\n\tborder-top: 1px solid var(--color-border);\n}\n\n.cn-record-notes__head {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\talign-items: center;\n\tgap: 8px;\n}\n\n.cn-record-notes__title {\n\tfont-weight: 600;\n\tcolor: var(--color-main-text);\n}\n\n.cn-record-notes__title--link {\n\ttext-decoration: underline;\n}\n\n.cn-record-notes__meta {\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 13px;\n}\n\n.cn-record-notes__spacer {\n\tflex: 1 1 auto;\n}\n\n.cn-record-notes__due {\n\tfont-weight: 600;\n}\n\n.cn-record-notes__due--error {\n\tcolor: var(--color-error-text);\n}\n\n.cn-record-notes__due--warning {\n\tcolor: var(--color-warning-text);\n}\n\n.cn-record-notes__due--muted {\n\tcolor: var(--color-text-maxcontrast);\n\tfont-weight: 400;\n}\n\n.cn-record-notes__fields {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\talign-items: flex-end;\n\tgap: 10px;\n}\n\n.cn-record-notes__field {\n\tdisplay: flex;\n\tflex: 1 1 260px;\n\tflex-direction: column;\n\tgap: 6px;\n}\n\n.cn-record-notes__field-label {\n\tcolor: var(--color-main-text);\n\tfont-size: 14px;\n\tfont-weight: 600;\n}\n\n.cn-record-notes__leaf {\n\tflex: 0 0 auto;\n}\n\n.cn-record-notes__leaf-missing,\n.cn-record-notes__error {\n\tmargin: 0;\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 13px;\n}\n\n.cn-record-notes__error {\n\tcolor: var(--color-error-text);\n}\n\n.cn-record-notes__all {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\talign-items: center;\n\tjustify-content: space-between;\n\tgap: 12px;\n\tmargin-top: 8px;\n\tpadding-top: 14px;\n\tborder-top: 1px solid var(--color-border);\n}\n\n.cn-record-notes__all-title {\n\tmargin: 0;\n\tfont-size: 16px;\n}\n\n.cn-record-notes__all-sentence {\n\tmargin: 4px 0 0;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-record-notes__all-actions {\n\tdisplay: flex;\n\tgap: 8px;\n}\n</style>\n"],"names":["CnIcon","CnLeafMountHost","CnStatusBadge","t"],"mappings":";;;;;;;;;;;AAgIA;AACA,MAAM,oBAAqB,GAAE,kBAAgB;;AAE7C;;;AAGC;;AAED,MAAM,mBAAoB,GAAE,2BAAyB;;AAErD;;AAEC;AACA;;;;;;AAMA;AACA;AACA;;AAED,aAAe;CACd,IAAI,EAAE,kBAAkB;;AAExB,CAAA,UAAU,EAAE,UAAEA,UAAM,mBAAEC,YAAe,iBAAEC,YAAa,EAAE,QAAQ,EAAE,aAAa;;AAE7E,CAAA,KAAK,EAAE;;AAEN,EAAA,KAAK,EAAE;GACN,IAAI,EAAE,KAAK;AACX,GAAA,OAAO,EAAE,MAAM,EAAE;GACjB;;AAED;;AAEC;;AAED,EAAA,MAAM,EAAE;GACP,IAAI,EAAE,MAAM;GACZ,QAAQ,EAAE,IAAI;GACd;;;EAGD,SAAS,EAAE;GACV,IAAI,EAAE,MAAM;GACZ,OAAO,EAAE,IAAI;GACb;;;EAGD,IAAI,EAAE;GACL,IAAI,EAAE,MAAM;GACZ,OAAO,EAAE,IAAI;GACb;EACD;;AAED,CAAA,KAAK,GAAG;AACP,EAAA,MAAM,EAAE,OAAQ,EAAA,GAAI,sBAAsB,GAAC;EAC3C,OAAO,EAAE,WAAW,EAAE,OAAQ,EAAA;EAC9B;;AAED,CAAA,IAAI,GAAG;AACN,EAAA,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,UAAU,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,YAAY,EAAE,IAAK,EAAA;EAC/E;;AAED,CAAA,QAAQ,EAAE;;EAET,SAAS,GAAG;AACX,GAAA,OAAO,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,IAAI,CAAC,oBAAoB,EAAE,EAAE,EAAA;AAC9B,IAAA;GACA;EACD;AACF;;;;"}
1
+ {"version":3,"file":"CnRecordNoteRows.vue2.js","sources":["../../../../src/components/CnRecordListWidget/CnRecordNoteRows.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n\n<template>\n\t<div class=\"cn-record-notes\" data-testid=\"cn-record-list-notes\">\n\t\t<p class=\"cn-record-notes__ready\" data-testid=\"cn-record-list-notes-ready\">\n\t\t\t<span class=\"cn-record-notes__ready-figure\">{{ readyCount }}</span>\n\t\t\t<span class=\"cn-record-notes__ready-label\">{{ readyLabel }}</span>\n\t\t</p>\n\t\t<div\n\t\t\tv-for=\"item in items\"\n\t\t\t:key=\"item.key\"\n\t\t\tclass=\"cn-record-notes__row\"\n\t\t\tdata-testid=\"cn-record-list-item\">\n\t\t\t<div class=\"cn-record-notes__head\">\n\t\t\t\t<CnStatusBadge\n\t\t\t\t\tv-if=\"item.pill\"\n\t\t\t\t\t:label=\"item.pill.label\"\n\t\t\t\t\t:variant=\"item.pill.variant\"\n\t\t\t\t\tsize=\"small\" />\n\t\t\t\t<component\n\t\t\t\t\t:is=\"item.tag\"\n\t\t\t\t\tv-if=\"item.title\"\n\t\t\t\t\tclass=\"cn-record-notes__title\"\n\t\t\t\t\t:class=\"{ 'cn-record-notes__title--link': item.tag !== 'div' }\"\n\t\t\t\t\tv-bind=\"item.attrs\">\n\t\t\t\t\t{{ item.title }}\n\t\t\t\t</component>\n\t\t\t\t<span v-if=\"item.meta\" class=\"cn-record-notes__meta\">{{ item.meta }}</span>\n\t\t\t\t<span class=\"cn-record-notes__spacer\" />\n\t\t\t\t<span\n\t\t\t\t\tv-if=\"item.due\"\n\t\t\t\t\tclass=\"cn-record-notes__due\"\n\t\t\t\t\t:class=\"`cn-record-notes__due--${dueToneOf(item.due)}`\"\n\t\t\t\t\tdata-testid=\"cn-record-list-due\">{{ item.due.text }}</span>\n\t\t\t</div>\n\t\t\t<div class=\"cn-record-notes__fields\">\n\t\t\t\t<!-- The label stands above the field, as the leaf's own beside it\n\t\t\t\t (humaniq \"Uren\"), so both fields share one line. -->\n\t\t\t\t<div class=\"cn-record-notes__field\">\n\t\t\t\t\t<label :for=\"fieldId(item.key)\" class=\"cn-record-notes__field-label\">{{ fieldLabel }}</label>\n\t\t\t\t\t<NcTextField\n\t\t\t\t\t\t:id=\"fieldId(item.key)\"\n\t\t\t\t\t\t:modelValue=\"drafts[item.key] || ''\"\n\t\t\t\t\t\t:label=\"fieldLabel\"\n\t\t\t\t\t\tlabelOutside\n\t\t\t\t\t\t:placeholder=\"placeholder\"\n\t\t\t\t\t\t:disabled=\"busy\"\n\t\t\t\t\t\t:data-testid=\"`cn-record-list-note-${item.key}`\"\n\t\t\t\t\t\t@update:modelValue=\"setDraft(item.key, $event)\" />\n\t\t\t\t</div>\n\t\t\t\t<div v-if=\"leaf && leafProvider\" class=\"cn-record-notes__leaf\" :data-testid=\"`cn-record-list-leaf-${item.key}`\">\n\t\t\t\t\t<CnLeafMountHost\n\t\t\t\t\t\tv-if=\"leafIsMount\"\n\t\t\t\t\t\t:provider=\"leafProvider\"\n\t\t\t\t\t\t:mountProps=\"leafProps(item.row)\" />\n\t\t\t\t\t<component :is=\"leafComponent\" v-else-if=\"leafComponent\" v-bind=\"leafProps(item.row)\" />\n\t\t\t\t</div>\n\t\t\t\t<NcButton\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t:disabled=\"busy || !hasDraft(item.key)\"\n\t\t\t\t\t:data-testid=\"`cn-record-list-record-${item.key}`\"\n\t\t\t\t\t@click=\"record(item)\">\n\t\t\t\t\t{{ recordLabel }}\n\t\t\t\t</NcButton>\n\t\t\t</div>\n\t\t\t<p\n\t\t\t\tv-if=\"leafUnavailable\"\n\t\t\t\tclass=\"cn-record-notes__leaf-missing\"\n\t\t\t\t:data-testid=\"`cn-record-list-leaf-missing-${item.key}`\">\n\t\t\t\t{{ leafUnavailableText }}\n\t\t\t</p>\n\t\t</div>\n\t\t<p v-if=\"error\"\n\t\t\tclass=\"cn-record-notes__error\"\n\t\t\trole=\"alert\"\n\t\t\tdata-testid=\"cn-record-list-notes-error\">\n\t\t\t{{ error }}\n\t\t</p>\n\t\t<!-- `recordAll.placement.widget`: the pair goes to the foot of that\n\t\t dashboard card, which carries the title and sentence itself. -->\n\t\t<Teleport v-if=\"recordAll\" :to=\"placedTarget || 'body'\" :disabled=\"!placedTarget\">\n\t\t\t<p\n\t\t\t\tv-if=\"placedTarget && recordAll.placement && recordAll.placement.sentence && allSentence\"\n\t\t\t\tclass=\"cn-record-notes__all-sentence cn-record-notes__all-sentence--placed\"\n\t\t\t\tdata-testid=\"cn-record-list-record-all-sentence\">\n\t\t\t\t{{ allSentence }}\n\t\t\t</p>\n\t\t\t<div\n\t\t\t\tclass=\"cn-record-notes__all\"\n\t\t\t\t:class=\"{ 'cn-record-notes__all--placed': !!placedTarget }\"\n\t\t\t\tdata-testid=\"cn-record-list-record-all\">\n\t\t\t\t<div v-if=\"!placedTarget\" class=\"cn-record-notes__all-text\">\n\t\t\t\t\t<h3 v-if=\"recordAll.title\" class=\"cn-record-notes__all-title\">\n\t\t\t\t\t\t{{ recordAll.title }}\n\t\t\t\t\t</h3>\n\t\t\t\t\t<p v-if=\"allSentence\" class=\"cn-record-notes__all-sentence\">\n\t\t\t\t\t\t{{ allSentence }}\n\t\t\t\t\t</p>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"cn-record-notes__all-actions\">\n\t\t\t\t\t<NcButton v-if=\"recordAll.cancel\" variant=\"secondary\" :to=\"recordAll.cancel.to\">\n\t\t\t\t\t\t{{ recordAll.cancel.label }}\n\t\t\t\t\t</NcButton>\n\t\t\t\t\t<NcButton\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t:disabled=\"busy || readyCount === 0\"\n\t\t\t\t\t\tdata-testid=\"cn-record-list-record-all-button\"\n\t\t\t\t\t\t@click=\"recordEvery\">\n\t\t\t\t\t\t<template v-if=\"recordAll.icon\" #icon>\n\t\t\t\t\t\t\t<CnIcon :name=\"recordAll.icon\" :size=\"20\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t{{ recordAll.label }}\n\t\t\t\t\t</NcButton>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</Teleport>\n\t</div>\n</template>\n\n<script>\nimport { emit } from '@nextcloud/event-bus'\nimport { translate as t } from '@nextcloud/l10n'\nimport { NcButton, NcTextField } from '@nextcloud/vue'\nimport CnIcon from '../CnIcon/CnIcon.vue'\nimport CnLeafMountHost from '../CnLeafMountHost/CnLeafMountHost.vue'\nimport CnStatusBadge from '../CnStatusBadge/CnStatusBadge.vue'\nimport { useIntegrationRegistry } from '../../composables/useIntegrationRegistry.js'\nimport { isAppInstalled } from '../../utils/appInstalled.js'\nimport { prefixUrl } from '../../utils/headers.js'\nimport { readPath } from '../../utils/readPath.js'\n\n/** The bus channel every endpoint-bound widget on the page refetches on. */\nconst PAGE_REFRESH_CHANNEL = 'cn:page:refresh'\n\n/**\n * The document event a recorded note sends, so a row's leaf (humaniq's\n * hours) can record what it holds for the same object at the same moment.\n * `detail` is the row's leaf props plus `note`.\n */\nconst NOTE_RECORDED_EVENT = 'cn-record-notes:recorded'\n\n/**\n * The rows of a record list drawn as notes to record (`presentation:\n * \"notes\"`, DqDagAfsluiten \"Nog open van vandaag\"): per row its pill, title,\n * meta and due text, a field for what happened, an optional integration leaf\n * (humaniq's hours) and a button that records the note on the row's own\n * notes endpoint. What is typed and not yet recorded stays in this browser\n * (session storage) and is counted as the \"ready to record\" figure; one\n * button records every filled row. After a note is recorded the page's\n * endpoint widgets refetch, so the row moves to whatever lists the server\n * keeps of recorded work.\n *\n * @spec openspec/changes/record-list-notes/specs/record-list-notes/spec.md#requirement-a-record-list-can-collect-and-record-a-note-per-row\n */\nexport default {\n\tname: 'CnRecordNoteRows',\n\n\tcomponents: { CnIcon, CnLeafMountHost, CnStatusBadge, NcButton, NcTextField },\n\n\tprops: {\n\t\t/** The list's rows as the record list builds them (`key`, `row`, `tag`, `attrs`, `title`, `meta`, `pill`, `due`). */\n\t\titems: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t\t/**\n\t\t * `noteAction`, already translated: `{ urlField?, url?, bodyField?,\n\t\t * label, fieldLabel, placeholder?, readyLabel, draftsKey?, errorText? }`.\n\t\t */\n\t\taction: {\n\t\t\ttype: Object,\n\t\t\trequired: true,\n\t\t},\n\n\t\t/** `recordAll`, already translated: `{ label, title?, text?: (string|{ zero?, one?, other }), icon?, cancel?: { label, to }, placement?: { widget, sentence? } }`, or null. */\n\t\trecordAll: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** `rowLeaf`: `{ id, app?, register?, objectIdField, schemaField?, schema?, unavailableText? }`, or null. */\n\t\tleaf: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\t},\n\n\tsetup() {\n\t\tconst { getById } = useIntegrationRegistry()\n\t\treturn { getProvider: getById }\n\t},\n\n\tdata() {\n\t\treturn { drafts: this.readDrafts(), busy: false, error: '', placedTarget: null }\n\t},\n\n\tcomputed: {\n\t\t/** @return {string} The session storage key of this list's drafts. */\n\t\tdraftsKey() {\n\t\t\treturn `cn-record-list-notes:${this.action.draftsKey || 'default'}`\n\t\t},\n\n\t\t/** @return {number} The rows with a note typed and not yet recorded. */\n\t\treadyCount() {\n\t\t\treturn this.items.filter((item) => this.hasDraft(item.key)).length\n\t\t},\n\n\t\t/**\n\t\t * The record-all sentence for the notes filled in now: a plain\n\t\t * sentence as it is, else the `zero`, `one` or `other` form with\n\t\t * `{count}` filled in.\n\t\t *\n\t\t * @return {string}\n\t\t * @spec openspec/changes/record-all-counted-sentence/specs/record-list-notes/spec.md\n\t\t */\n\t\tallSentence() {\n\t\t\tconst text = this.recordAll?.text\n\t\t\tif (typeof text === 'string') {\n\t\t\t\treturn text\n\t\t\t}\n\t\t\tif (!text || typeof text !== 'object') {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tconst count = this.readyCount\n\t\t\tconst form = (count === 0 && text.zero) || (count === 1 && text.one) || text.other || text.one || ''\n\t\t\treturn form.replace(/\\{count\\}/g, String(count))\n\t\t},\n\n\t\t/** @return {string} The label of the ready figure. */\n\t\treadyLabel() {\n\t\t\treturn this.action.readyLabel || t('nextcloud-vue', 'filled in, not recorded yet')\n\t\t},\n\n\t\t/** @return {string} */\n\t\trecordLabel() {\n\t\t\treturn this.action.label || t('nextcloud-vue', 'Record')\n\t\t},\n\n\t\t/** @return {string} */\n\t\tfieldLabel() {\n\t\t\treturn this.action.fieldLabel || t('nextcloud-vue', 'Note')\n\t\t},\n\n\t\t/** @return {string} */\n\t\tplaceholder() {\n\t\t\treturn this.action.placeholder || ''\n\t\t},\n\n\t\t/** @return {object|null} The leaf's integration provider, when one is registered. */\n\t\tleafProvider() {\n\t\t\treturn this.leaf && this.leaf.id ? (this.getProvider(this.leaf.id) || null) : null\n\t\t},\n\n\t\t/** @return {boolean} Whether the leaf mounts itself (`renderMode: \"mount\"`). */\n\t\tleafIsMount() {\n\t\t\tconst provider = this.leafProvider\n\t\t\treturn Boolean(provider) && provider.renderMode === 'mount' && typeof provider.mount === 'function'\n\t\t},\n\n\t\t/** @return {object|null} The leaf's component, in component mode. */\n\t\tleafComponent() {\n\t\t\tconst provider = this.leafProvider\n\t\t\treturn provider ? (provider.tab || provider.widget || null) : null\n\t\t},\n\n\t\t/**\n\t\t * Whether the leaf's app is installed but the leaf is not available, so\n\t\t * the row says so instead of silently showing no field.\n\t\t *\n\t\t * @return {boolean}\n\t\t */\n\t\tleafUnavailable() {\n\t\t\treturn Boolean(this.leaf && this.leaf.app && !this.leafProvider && isAppInstalled(this.leaf.app))\n\t\t},\n\n\t\t/** @return {string} */\n\t\tleafUnavailableText() {\n\t\t\treturn this.leaf?.unavailableText || t('nextcloud-vue', 'This field is not available here.')\n\t\t},\n\t},\n\n\twatch: {\n\t\tdrafts: {\n\t\t\tdeep: true,\n\t\t\thandler() {\n\t\t\t\tthis.saveDrafts()\n\t\t\t},\n\t\t},\n\t},\n\n\tmounted() {\n\t\tthis.findPlacedTarget()\n\t\tthis.$nextTick(() => this.findPlacedTarget())\n\t\tthis.watchPlacedTarget()\n\t},\n\n\tbeforeUnmount() {\n\t\tif (this.placedObserver) {\n\t\t\tthis.placedObserver.disconnect()\n\t\t\tthis.placedObserver = null\n\t\t}\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * The content of the dashboard card `recordAll.placement.widget` names,\n\t\t * once it is on the page; until then (or without one) the pair stays\n\t\t * under the rows.\n\t\t *\n\t\t * @return {void}\n\t\t * @spec openspec/changes/record-all-in-its-own-card/specs/record-list-notes/spec.md\n\t\t */\n\t\tfindPlacedTarget() {\n\t\t\tconst widget = this.recordAll?.placement?.widget\n\t\t\tif ((this.placedTarget && this.placedTarget.isConnected) || typeof widget !== 'string' || widget === '' || typeof document === 'undefined') {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst card = [...document.querySelectorAll('[data-cn-widget-id]')].find((el) => el.getAttribute('data-cn-widget-id') === widget)\n\t\t\tthis.placedTarget = card ? (card.querySelector('.cn-widget-wrapper__content') || null) : null\n\t\t},\n\n\t\t/**\n\t\t * Look for the placed card again whenever the page changes: the grid\n\t\t * can draw that card after this list, or draw it again, and a pair\n\t\t * left in a card no longer on the page is not seen at all.\n\t\t *\n\t\t * @return {void}\n\t\t * @spec openspec/changes/record-all-follows-its-card/specs/record-list-notes/spec.md#requirement-the-placed-pair-follows-its-card\n\t\t */\n\t\twatchPlacedTarget() {\n\t\t\tconst widget = this.recordAll?.placement?.widget\n\t\t\tif (typeof widget !== 'string' || widget === '' || typeof MutationObserver === 'undefined' || typeof document === 'undefined') {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.placedObserver = new MutationObserver(() => this.findPlacedTarget())\n\t\t\tthis.placedObserver.observe(document.body, { childList: true, subtree: true })\n\t\t},\n\n\t\t/**\n\t\t * The drafts this browser session kept, by row key.\n\t\t *\n\t\t * @return {Object<string, string>}\n\t\t */\n\t\treadDrafts() {\n\t\t\ttry {\n\t\t\t\tconst raw = window.sessionStorage.getItem(`cn-record-list-notes:${this.action?.draftsKey || 'default'}`)\n\t\t\t\tconst parsed = raw ? JSON.parse(raw) : {}\n\t\t\t\treturn parsed && typeof parsed === 'object' && !Array.isArray(parsed) ? parsed : {}\n\t\t\t} catch {\n\t\t\t\treturn {}\n\t\t\t}\n\t\t},\n\n\t\t/** @return {void} */\n\t\tsaveDrafts() {\n\t\t\ttry {\n\t\t\t\twindow.sessionStorage.setItem(this.draftsKey, JSON.stringify(this.drafts))\n\t\t\t} catch {\n\t\t\t\t// Without session storage the drafts live as long as the page.\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * The colour of a due text: a term that ended or ends today in the\n\t\t * error colour, one still to come in the warning colour.\n\t\t *\n\t\t * @param {{tone: string}} due The due text.\n\t\t * @return {string} `error`, `warning` or `muted`.\n\t\t */\n\t\tdueToneOf(due) {\n\t\t\tif (due.tone === 'danger' || due.tone === 'today') {\n\t\t\t\treturn 'error'\n\t\t\t}\n\t\t\treturn due.tone === 'upcoming' ? 'warning' : 'muted'\n\t\t},\n\n\t\t/**\n\t\t * @param {string} key The row key.\n\t\t * @param {string} value The typed note.\n\t\t * @return {void}\n\t\t */\n\t\tsetDraft(key, value) {\n\t\t\tthis.drafts = { ...this.drafts, [key]: String(value ?? '') }\n\t\t},\n\n\t\t/**\n\t\t * The id of a row's note field, for its label.\n\t\t *\n\t\t * @param {string} key The row key.\n\t\t * @return {string} The id.\n\t\t */\n\t\tfieldId(key) {\n\t\t\treturn `cn-record-notes-${this.$.uid}-${String(key).replace(/[^A-Za-z0-9_-]/g, '-')}`\n\t\t},\n\n\t\t/**\n\t\t * @param {string} key The row key.\n\t\t * @return {boolean} Whether the row has a note typed.\n\t\t */\n\t\thasDraft(key) {\n\t\t\treturn String(this.drafts[key] ?? '').trim() !== ''\n\t\t},\n\n\t\t/**\n\t\t * The props the row's leaf gets: the row's object, register and schema.\n\t\t *\n\t\t * @param {object} row The row.\n\t\t * @return {object}\n\t\t */\n\t\tleafProps(row) {\n\t\t\tconst leaf = this.leaf || {}\n\t\t\treturn {\n\t\t\t\tobjectId: String(readPath(row, leaf.objectIdField || 'id') ?? ''),\n\t\t\t\tregister: leaf.register || '',\n\t\t\t\tschema: leaf.schemaField ? String(readPath(row, leaf.schemaField) ?? '') : (leaf.schema || ''),\n\t\t\t\tsurface: 'row',\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * The row's notes endpoint: the row's `urlField`, else `url` with\n\t\t * `{field}` filled from the row.\n\t\t *\n\t\t * @param {object} row The row.\n\t\t * @return {string} The URL, or ''.\n\t\t */\n\t\turlOf(row) {\n\t\t\tif (this.action.urlField) {\n\t\t\t\treturn String(readPath(row, this.action.urlField) ?? '')\n\t\t\t}\n\t\t\tconst template = String(this.action.url || '')\n\t\t\treturn template.replace(/\\{([A-Za-z0-9_.]+)\\}/g, (_, path) => encodeURIComponent(String(readPath(row, path) ?? '')))\n\t\t},\n\n\t\t/**\n\t\t * Record one row's note, then let the page refetch.\n\t\t *\n\t\t * @param {object} item The row item.\n\t\t * @param {boolean} [refresh] Whether to refresh the page after it.\n\t\t * @return {Promise<boolean>} Whether it was recorded.\n\t\t */\n\t\tasync record(item, refresh = true) {\n\t\t\tconst text = String(this.drafts[item.key] ?? '').trim()\n\t\t\tconst url = this.urlOf(item.row)\n\t\t\tif (text === '' || url === '') {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tthis.busy = true\n\t\t\tthis.error = ''\n\t\t\ttry {\n\t\t\t\tconst { default: axios } = await import('@nextcloud/axios')\n\t\t\t\tawait axios.post(prefixUrl(url), { [this.action.bodyField || 'message']: text })\n\t\t\t\tif (this.leaf) {\n\t\t\t\t\tdocument.dispatchEvent(new CustomEvent(NOTE_RECORDED_EVENT, { detail: { ...this.leafProps(item.row), note: text } }))\n\t\t\t\t}\n\t\t\t\tconst { [item.key]: done, ...rest } = this.drafts\n\t\t\t\tthis.drafts = rest\n\t\t\t\tif (refresh) {\n\t\t\t\t\temit(PAGE_REFRESH_CHANNEL, {})\n\t\t\t\t}\n\t\t\t\treturn true\n\t\t\t} catch {\n\t\t\t\tthis.error = this.action.errorText || t('nextcloud-vue', 'The note could not be recorded. It is kept here; try again.')\n\t\t\t\treturn false\n\t\t\t} finally {\n\t\t\t\tthis.busy = false\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Record every row with a note, one after another, then refresh once.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync recordEvery() {\n\t\t\tconst filled = this.items.filter((item) => this.hasDraft(item.key))\n\t\t\tlet any = false\n\t\t\tfor (const item of filled) {\n\t\t\t\tany = (await this.record(item, false)) || any\n\t\t\t}\n\t\t\tif (any) {\n\t\t\t\temit(PAGE_REFRESH_CHANNEL, {})\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-record-notes {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 0;\n}\n\n.cn-record-notes__ready {\n\tdisplay: flex;\n\talign-items: baseline;\n\tgap: 6px;\n\tmargin: 0 0 8px;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-record-notes__ready-figure {\n\tfont-weight: 700;\n\tcolor: var(--color-main-text);\n}\n\n.cn-record-notes__row {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 10px;\n\tpadding: 14px 0;\n\tborder-top: 1px solid var(--color-border);\n}\n\n.cn-record-notes__head {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\talign-items: center;\n\tgap: 8px;\n}\n\n.cn-record-notes__title {\n\tfont-weight: 600;\n\tcolor: var(--color-main-text);\n}\n\n.cn-record-notes__title--link {\n\ttext-decoration: underline;\n}\n\n.cn-record-notes__meta {\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 13px;\n}\n\n.cn-record-notes__spacer {\n\tflex: 1 1 auto;\n}\n\n.cn-record-notes__due {\n\tfont-weight: 600;\n}\n\n.cn-record-notes__due--error {\n\tcolor: var(--color-error-text);\n}\n\n.cn-record-notes__due--warning {\n\tcolor: var(--color-warning-text);\n}\n\n.cn-record-notes__due--muted {\n\tcolor: var(--color-text-maxcontrast);\n\tfont-weight: 400;\n}\n\n.cn-record-notes__fields {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\talign-items: flex-end;\n\tgap: 10px;\n}\n\n.cn-record-notes__field {\n\tdisplay: flex;\n\tflex: 1 1 260px;\n\tflex-direction: column;\n\tgap: 6px;\n}\n\n.cn-record-notes__field-label {\n\tcolor: var(--color-main-text);\n\tfont-size: 14px;\n\tfont-weight: 600;\n}\n\n.cn-record-notes__leaf {\n\tflex: 0 0 auto;\n}\n\n.cn-record-notes__leaf-missing,\n.cn-record-notes__error {\n\tmargin: 0;\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 13px;\n}\n\n.cn-record-notes__error {\n\tcolor: var(--color-error-text);\n}\n\n.cn-record-notes__all {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\talign-items: center;\n\tjustify-content: space-between;\n\tgap: 12px;\n\tmargin-top: 8px;\n\tpadding-top: 14px;\n\tborder-top: 1px solid var(--color-border);\n}\n\n.cn-record-notes__all-title {\n\tmargin: 0;\n\tfont-size: 16px;\n}\n\n.cn-record-notes__all-sentence {\n\tmargin: 4px 0 0;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-record-notes__all-sentence--placed {\n\tmargin: 0;\n\tpadding: 0 0 12px;\n\tcolor: var(--color-main-text);\n}\n\n.cn-record-notes__all-actions {\n\tdisplay: flex;\n\tgap: 8px;\n}\n</style>\n"],"names":["CnIcon","CnLeafMountHost","CnStatusBadge","t"],"mappings":";;;;;;;;;;;AAsIA;AACA,MAAM,oBAAqB,GAAE,kBAAgB;;AAE7C;;;AAGC;;AAED,MAAM,mBAAoB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AI,KAAK,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,EAAA;GAClE,IAAI,MAAM,MAAI;GACd,KAAK,MAAM,IAAK,IAAG,MAAM,EAAE;AAC1B,IAAA,GAAI,GAAE,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,KAAK,IAAE;AAC7C,IAAA;AACA,GAAA,IAAI,GAAG,EAAE;IACR,IAAI,CAAC,oBAAoB,EAAE,EAAE,EAAA;AAC9B,IAAA;GACA;EACD;AACF;;;;"}
@@ -28,17 +28,22 @@ const _hoisted_12 = {
28
28
  };
29
29
  const _hoisted_13 = {
30
30
  key: 0,
31
- class: "cn-record-notes__all-text"
31
+ class: "cn-record-notes__all-sentence cn-record-notes__all-sentence--placed",
32
+ "data-testid": "cn-record-list-record-all-sentence"
32
33
  };
33
34
  const _hoisted_14 = {
34
35
  key: 0,
35
- class: "cn-record-notes__all-title"
36
+ class: "cn-record-notes__all-text"
36
37
  };
37
38
  const _hoisted_15 = {
39
+ key: 0,
40
+ class: "cn-record-notes__all-title"
41
+ };
42
+ const _hoisted_16 = {
38
43
  key: 1,
39
44
  class: "cn-record-notes__all-sentence"
40
45
  };
41
- const _hoisted_16 = { class: "cn-record-notes__all-actions" };
46
+ const _hoisted_17 = { class: "cn-record-notes__all-actions" };
42
47
 
43
48
  function render(_ctx, _cache, $props, $setup, $data, $options) {
44
49
  const _component_CnStatusBadge = resolveComponent("CnStatusBadge");
@@ -157,21 +162,24 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
157
162
  to: $data.placedTarget || 'body',
158
163
  disabled: !$data.placedTarget
159
164
  }, [
165
+ ($data.placedTarget && $props.recordAll.placement && $props.recordAll.placement.sentence && $options.allSentence)
166
+ ? (openBlock(), createElementBlock("p", _hoisted_13, toDisplayString($options.allSentence), 1 /* TEXT */))
167
+ : createCommentVNode("v-if", true),
160
168
  createElementVNode("div", {
161
169
  class: normalizeClass(["cn-record-notes__all", { 'cn-record-notes__all--placed': !!$data.placedTarget }]),
162
170
  "data-testid": "cn-record-list-record-all"
163
171
  }, [
164
172
  (!$data.placedTarget)
165
- ? (openBlock(), createElementBlock("div", _hoisted_13, [
173
+ ? (openBlock(), createElementBlock("div", _hoisted_14, [
166
174
  ($props.recordAll.title)
167
- ? (openBlock(), createElementBlock("h3", _hoisted_14, toDisplayString($props.recordAll.title), 1 /* TEXT */))
175
+ ? (openBlock(), createElementBlock("h3", _hoisted_15, toDisplayString($props.recordAll.title), 1 /* TEXT */))
168
176
  : createCommentVNode("v-if", true),
169
- ($props.recordAll.text)
170
- ? (openBlock(), createElementBlock("p", _hoisted_15, toDisplayString($props.recordAll.text), 1 /* TEXT */))
177
+ ($options.allSentence)
178
+ ? (openBlock(), createElementBlock("p", _hoisted_16, toDisplayString($options.allSentence), 1 /* TEXT */))
171
179
  : createCommentVNode("v-if", true)
172
180
  ]))
173
181
  : createCommentVNode("v-if", true),
174
- createElementVNode("div", _hoisted_16, [
182
+ createElementVNode("div", _hoisted_17, [
175
183
  ($props.recordAll.cancel)
176
184
  ? (openBlock(), createBlock(_component_NcButton, {
177
185
  key: 0,
@@ -1 +1 @@
1
- {"version":3,"file":"CnRecordNoteRows.vue3.js","sources":["../../../../src/components/CnRecordListWidget/CnRecordNoteRows.vue?vue&type=template&id=0a89078f&lang.js"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n\n<template>\n\t<div class=\"cn-record-notes\" data-testid=\"cn-record-list-notes\">\n\t\t<p class=\"cn-record-notes__ready\" data-testid=\"cn-record-list-notes-ready\">\n\t\t\t<span class=\"cn-record-notes__ready-figure\">{{ readyCount }}</span>\n\t\t\t<span class=\"cn-record-notes__ready-label\">{{ readyLabel }}</span>\n\t\t</p>\n\t\t<div\n\t\t\tv-for=\"item in items\"\n\t\t\t:key=\"item.key\"\n\t\t\tclass=\"cn-record-notes__row\"\n\t\t\tdata-testid=\"cn-record-list-item\">\n\t\t\t<div class=\"cn-record-notes__head\">\n\t\t\t\t<CnStatusBadge\n\t\t\t\t\tv-if=\"item.pill\"\n\t\t\t\t\t:label=\"item.pill.label\"\n\t\t\t\t\t:variant=\"item.pill.variant\"\n\t\t\t\t\tsize=\"small\" />\n\t\t\t\t<component\n\t\t\t\t\t:is=\"item.tag\"\n\t\t\t\t\tv-if=\"item.title\"\n\t\t\t\t\tclass=\"cn-record-notes__title\"\n\t\t\t\t\t:class=\"{ 'cn-record-notes__title--link': item.tag !== 'div' }\"\n\t\t\t\t\tv-bind=\"item.attrs\">\n\t\t\t\t\t{{ item.title }}\n\t\t\t\t</component>\n\t\t\t\t<span v-if=\"item.meta\" class=\"cn-record-notes__meta\">{{ item.meta }}</span>\n\t\t\t\t<span class=\"cn-record-notes__spacer\" />\n\t\t\t\t<span\n\t\t\t\t\tv-if=\"item.due\"\n\t\t\t\t\tclass=\"cn-record-notes__due\"\n\t\t\t\t\t:class=\"`cn-record-notes__due--${dueToneOf(item.due)}`\"\n\t\t\t\t\tdata-testid=\"cn-record-list-due\">{{ item.due.text }}</span>\n\t\t\t</div>\n\t\t\t<div class=\"cn-record-notes__fields\">\n\t\t\t\t<!-- The label stands above the field, as the leaf's own beside it\n\t\t\t\t (humaniq \"Uren\"), so both fields share one line. -->\n\t\t\t\t<div class=\"cn-record-notes__field\">\n\t\t\t\t\t<label :for=\"fieldId(item.key)\" class=\"cn-record-notes__field-label\">{{ fieldLabel }}</label>\n\t\t\t\t\t<NcTextField\n\t\t\t\t\t\t:id=\"fieldId(item.key)\"\n\t\t\t\t\t\t:modelValue=\"drafts[item.key] || ''\"\n\t\t\t\t\t\t:label=\"fieldLabel\"\n\t\t\t\t\t\tlabelOutside\n\t\t\t\t\t\t:placeholder=\"placeholder\"\n\t\t\t\t\t\t:disabled=\"busy\"\n\t\t\t\t\t\t:data-testid=\"`cn-record-list-note-${item.key}`\"\n\t\t\t\t\t\t@update:modelValue=\"setDraft(item.key, $event)\" />\n\t\t\t\t</div>\n\t\t\t\t<div v-if=\"leaf && leafProvider\" class=\"cn-record-notes__leaf\" :data-testid=\"`cn-record-list-leaf-${item.key}`\">\n\t\t\t\t\t<CnLeafMountHost\n\t\t\t\t\t\tv-if=\"leafIsMount\"\n\t\t\t\t\t\t:provider=\"leafProvider\"\n\t\t\t\t\t\t:mountProps=\"leafProps(item.row)\" />\n\t\t\t\t\t<component :is=\"leafComponent\" v-else-if=\"leafComponent\" v-bind=\"leafProps(item.row)\" />\n\t\t\t\t</div>\n\t\t\t\t<NcButton\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t:disabled=\"busy || !hasDraft(item.key)\"\n\t\t\t\t\t:data-testid=\"`cn-record-list-record-${item.key}`\"\n\t\t\t\t\t@click=\"record(item)\">\n\t\t\t\t\t{{ recordLabel }}\n\t\t\t\t</NcButton>\n\t\t\t</div>\n\t\t\t<p\n\t\t\t\tv-if=\"leafUnavailable\"\n\t\t\t\tclass=\"cn-record-notes__leaf-missing\"\n\t\t\t\t:data-testid=\"`cn-record-list-leaf-missing-${item.key}`\">\n\t\t\t\t{{ leafUnavailableText }}\n\t\t\t</p>\n\t\t</div>\n\t\t<p v-if=\"error\"\n\t\t\tclass=\"cn-record-notes__error\"\n\t\t\trole=\"alert\"\n\t\t\tdata-testid=\"cn-record-list-notes-error\">\n\t\t\t{{ error }}\n\t\t</p>\n\t\t<!-- `recordAll.placement.widget`: the pair goes to the foot of that\n\t\t dashboard card, which carries the title and sentence itself. -->\n\t\t<Teleport v-if=\"recordAll\" :to=\"placedTarget || 'body'\" :disabled=\"!placedTarget\">\n\t\t\t<div\n\t\t\t\tclass=\"cn-record-notes__all\"\n\t\t\t\t:class=\"{ 'cn-record-notes__all--placed': !!placedTarget }\"\n\t\t\t\tdata-testid=\"cn-record-list-record-all\">\n\t\t\t\t<div v-if=\"!placedTarget\" class=\"cn-record-notes__all-text\">\n\t\t\t\t\t<h3 v-if=\"recordAll.title\" class=\"cn-record-notes__all-title\">\n\t\t\t\t\t\t{{ recordAll.title }}\n\t\t\t\t\t</h3>\n\t\t\t\t\t<p v-if=\"recordAll.text\" class=\"cn-record-notes__all-sentence\">\n\t\t\t\t\t\t{{ recordAll.text }}\n\t\t\t\t\t</p>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"cn-record-notes__all-actions\">\n\t\t\t\t\t<NcButton v-if=\"recordAll.cancel\" variant=\"secondary\" :to=\"recordAll.cancel.to\">\n\t\t\t\t\t\t{{ recordAll.cancel.label }}\n\t\t\t\t\t</NcButton>\n\t\t\t\t\t<NcButton\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t:disabled=\"busy || readyCount === 0\"\n\t\t\t\t\t\tdata-testid=\"cn-record-list-record-all-button\"\n\t\t\t\t\t\t@click=\"recordEvery\">\n\t\t\t\t\t\t<template v-if=\"recordAll.icon\" #icon>\n\t\t\t\t\t\t\t<CnIcon :name=\"recordAll.icon\" :size=\"20\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t{{ recordAll.label }}\n\t\t\t\t\t</NcButton>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</Teleport>\n\t</div>\n</template>\n\n<script>\nimport { emit } from '@nextcloud/event-bus'\nimport { translate as t } from '@nextcloud/l10n'\nimport { NcButton, NcTextField } from '@nextcloud/vue'\nimport CnIcon from '../CnIcon/CnIcon.vue'\nimport CnLeafMountHost from '../CnLeafMountHost/CnLeafMountHost.vue'\nimport CnStatusBadge from '../CnStatusBadge/CnStatusBadge.vue'\nimport { useIntegrationRegistry } from '../../composables/useIntegrationRegistry.js'\nimport { isAppInstalled } from '../../utils/appInstalled.js'\nimport { prefixUrl } from '../../utils/headers.js'\nimport { readPath } from '../../utils/readPath.js'\n\n/** The bus channel every endpoint-bound widget on the page refetches on. */\nconst PAGE_REFRESH_CHANNEL = 'cn:page:refresh'\n\n/**\n * The document event a recorded note sends, so a row's leaf (humaniq's\n * hours) can record what it holds for the same object at the same moment.\n * `detail` is the row's leaf props plus `note`.\n */\nconst NOTE_RECORDED_EVENT = 'cn-record-notes:recorded'\n\n/**\n * The rows of a record list drawn as notes to record (`presentation:\n * \"notes\"`, DqDagAfsluiten \"Nog open van vandaag\"): per row its pill, title,\n * meta and due text, a field for what happened, an optional integration leaf\n * (humaniq's hours) and a button that records the note on the row's own\n * notes endpoint. What is typed and not yet recorded stays in this browser\n * (session storage) and is counted as the \"ready to record\" figure; one\n * button records every filled row. After a note is recorded the page's\n * endpoint widgets refetch, so the row moves to whatever lists the server\n * keeps of recorded work.\n *\n * @spec openspec/changes/record-list-notes/specs/record-list-notes/spec.md#requirement-a-record-list-can-collect-and-record-a-note-per-row\n */\nexport default {\n\tname: 'CnRecordNoteRows',\n\n\tcomponents: { CnIcon, CnLeafMountHost, CnStatusBadge, NcButton, NcTextField },\n\n\tprops: {\n\t\t/** The list's rows as the record list builds them (`key`, `row`, `tag`, `attrs`, `title`, `meta`, `pill`, `due`). */\n\t\titems: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t\t/**\n\t\t * `noteAction`, already translated: `{ urlField?, url?, bodyField?,\n\t\t * label, fieldLabel, placeholder?, readyLabel, draftsKey?, errorText? }`.\n\t\t */\n\t\taction: {\n\t\t\ttype: Object,\n\t\t\trequired: true,\n\t\t},\n\n\t\t/** `recordAll`, already translated: `{ label, title?, text?, icon?, cancel?: { label, to }, placement?: { widget } }`, or null. */\n\t\trecordAll: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** `rowLeaf`: `{ id, app?, register?, objectIdField, schemaField?, schema?, unavailableText? }`, or null. */\n\t\tleaf: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\t},\n\n\tsetup() {\n\t\tconst { getById } = useIntegrationRegistry()\n\t\treturn { getProvider: getById }\n\t},\n\n\tdata() {\n\t\treturn { drafts: this.readDrafts(), busy: false, error: '', placedTarget: null }\n\t},\n\n\tcomputed: {\n\t\t/** @return {string} The session storage key of this list's drafts. */\n\t\tdraftsKey() {\n\t\t\treturn `cn-record-list-notes:${this.action.draftsKey || 'default'}`\n\t\t},\n\n\t\t/** @return {number} The rows with a note typed and not yet recorded. */\n\t\treadyCount() {\n\t\t\treturn this.items.filter((item) => this.hasDraft(item.key)).length\n\t\t},\n\n\t\t/** @return {string} The label of the ready figure. */\n\t\treadyLabel() {\n\t\t\treturn this.action.readyLabel || t('nextcloud-vue', 'filled in, not recorded yet')\n\t\t},\n\n\t\t/** @return {string} */\n\t\trecordLabel() {\n\t\t\treturn this.action.label || t('nextcloud-vue', 'Record')\n\t\t},\n\n\t\t/** @return {string} */\n\t\tfieldLabel() {\n\t\t\treturn this.action.fieldLabel || t('nextcloud-vue', 'Note')\n\t\t},\n\n\t\t/** @return {string} */\n\t\tplaceholder() {\n\t\t\treturn this.action.placeholder || ''\n\t\t},\n\n\t\t/** @return {object|null} The leaf's integration provider, when one is registered. */\n\t\tleafProvider() {\n\t\t\treturn this.leaf && this.leaf.id ? (this.getProvider(this.leaf.id) || null) : null\n\t\t},\n\n\t\t/** @return {boolean} Whether the leaf mounts itself (`renderMode: \"mount\"`). */\n\t\tleafIsMount() {\n\t\t\tconst provider = this.leafProvider\n\t\t\treturn Boolean(provider) && provider.renderMode === 'mount' && typeof provider.mount === 'function'\n\t\t},\n\n\t\t/** @return {object|null} The leaf's component, in component mode. */\n\t\tleafComponent() {\n\t\t\tconst provider = this.leafProvider\n\t\t\treturn provider ? (provider.tab || provider.widget || null) : null\n\t\t},\n\n\t\t/**\n\t\t * Whether the leaf's app is installed but the leaf is not available, so\n\t\t * the row says so instead of silently showing no field.\n\t\t *\n\t\t * @return {boolean}\n\t\t */\n\t\tleafUnavailable() {\n\t\t\treturn Boolean(this.leaf && this.leaf.app && !this.leafProvider && isAppInstalled(this.leaf.app))\n\t\t},\n\n\t\t/** @return {string} */\n\t\tleafUnavailableText() {\n\t\t\treturn this.leaf?.unavailableText || t('nextcloud-vue', 'This field is not available here.')\n\t\t},\n\t},\n\n\twatch: {\n\t\tdrafts: {\n\t\t\tdeep: true,\n\t\t\thandler() {\n\t\t\t\tthis.saveDrafts()\n\t\t\t},\n\t\t},\n\t},\n\n\tmounted() {\n\t\tthis.findPlacedTarget()\n\t\tthis.$nextTick(() => this.findPlacedTarget())\n\t\tthis.watchPlacedTarget()\n\t},\n\n\tbeforeUnmount() {\n\t\tif (this.placedObserver) {\n\t\t\tthis.placedObserver.disconnect()\n\t\t\tthis.placedObserver = null\n\t\t}\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * The content of the dashboard card `recordAll.placement.widget` names,\n\t\t * once it is on the page; until then (or without one) the pair stays\n\t\t * under the rows.\n\t\t *\n\t\t * @return {void}\n\t\t * @spec openspec/changes/record-all-in-its-own-card/specs/record-list-notes/spec.md\n\t\t */\n\t\tfindPlacedTarget() {\n\t\t\tconst widget = this.recordAll?.placement?.widget\n\t\t\tif ((this.placedTarget && this.placedTarget.isConnected) || typeof widget !== 'string' || widget === '' || typeof document === 'undefined') {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst card = [...document.querySelectorAll('[data-cn-widget-id]')].find((el) => el.getAttribute('data-cn-widget-id') === widget)\n\t\t\tthis.placedTarget = card ? (card.querySelector('.cn-widget-wrapper__content') || null) : null\n\t\t},\n\n\t\t/**\n\t\t * Look for the placed card again whenever the page changes: the grid\n\t\t * can draw that card after this list, or draw it again, and a pair\n\t\t * left in a card no longer on the page is not seen at all.\n\t\t *\n\t\t * @return {void}\n\t\t * @spec openspec/changes/record-all-follows-its-card/specs/record-list-notes/spec.md#requirement-the-placed-pair-follows-its-card\n\t\t */\n\t\twatchPlacedTarget() {\n\t\t\tconst widget = this.recordAll?.placement?.widget\n\t\t\tif (typeof widget !== 'string' || widget === '' || typeof MutationObserver === 'undefined' || typeof document === 'undefined') {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.placedObserver = new MutationObserver(() => this.findPlacedTarget())\n\t\t\tthis.placedObserver.observe(document.body, { childList: true, subtree: true })\n\t\t},\n\n\t\t/**\n\t\t * The drafts this browser session kept, by row key.\n\t\t *\n\t\t * @return {Object<string, string>}\n\t\t */\n\t\treadDrafts() {\n\t\t\ttry {\n\t\t\t\tconst raw = window.sessionStorage.getItem(`cn-record-list-notes:${this.action?.draftsKey || 'default'}`)\n\t\t\t\tconst parsed = raw ? JSON.parse(raw) : {}\n\t\t\t\treturn parsed && typeof parsed === 'object' && !Array.isArray(parsed) ? parsed : {}\n\t\t\t} catch {\n\t\t\t\treturn {}\n\t\t\t}\n\t\t},\n\n\t\t/** @return {void} */\n\t\tsaveDrafts() {\n\t\t\ttry {\n\t\t\t\twindow.sessionStorage.setItem(this.draftsKey, JSON.stringify(this.drafts))\n\t\t\t} catch {\n\t\t\t\t// Without session storage the drafts live as long as the page.\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * The colour of a due text: a term that ended or ends today in the\n\t\t * error colour, one still to come in the warning colour.\n\t\t *\n\t\t * @param {{tone: string}} due The due text.\n\t\t * @return {string} `error`, `warning` or `muted`.\n\t\t */\n\t\tdueToneOf(due) {\n\t\t\tif (due.tone === 'danger' || due.tone === 'today') {\n\t\t\t\treturn 'error'\n\t\t\t}\n\t\t\treturn due.tone === 'upcoming' ? 'warning' : 'muted'\n\t\t},\n\n\t\t/**\n\t\t * @param {string} key The row key.\n\t\t * @param {string} value The typed note.\n\t\t * @return {void}\n\t\t */\n\t\tsetDraft(key, value) {\n\t\t\tthis.drafts = { ...this.drafts, [key]: String(value ?? '') }\n\t\t},\n\n\t\t/**\n\t\t * The id of a row's note field, for its label.\n\t\t *\n\t\t * @param {string} key The row key.\n\t\t * @return {string} The id.\n\t\t */\n\t\tfieldId(key) {\n\t\t\treturn `cn-record-notes-${this.$.uid}-${String(key).replace(/[^A-Za-z0-9_-]/g, '-')}`\n\t\t},\n\n\t\t/**\n\t\t * @param {string} key The row key.\n\t\t * @return {boolean} Whether the row has a note typed.\n\t\t */\n\t\thasDraft(key) {\n\t\t\treturn String(this.drafts[key] ?? '').trim() !== ''\n\t\t},\n\n\t\t/**\n\t\t * The props the row's leaf gets: the row's object, register and schema.\n\t\t *\n\t\t * @param {object} row The row.\n\t\t * @return {object}\n\t\t */\n\t\tleafProps(row) {\n\t\t\tconst leaf = this.leaf || {}\n\t\t\treturn {\n\t\t\t\tobjectId: String(readPath(row, leaf.objectIdField || 'id') ?? ''),\n\t\t\t\tregister: leaf.register || '',\n\t\t\t\tschema: leaf.schemaField ? String(readPath(row, leaf.schemaField) ?? '') : (leaf.schema || ''),\n\t\t\t\tsurface: 'row',\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * The row's notes endpoint: the row's `urlField`, else `url` with\n\t\t * `{field}` filled from the row.\n\t\t *\n\t\t * @param {object} row The row.\n\t\t * @return {string} The URL, or ''.\n\t\t */\n\t\turlOf(row) {\n\t\t\tif (this.action.urlField) {\n\t\t\t\treturn String(readPath(row, this.action.urlField) ?? '')\n\t\t\t}\n\t\t\tconst template = String(this.action.url || '')\n\t\t\treturn template.replace(/\\{([A-Za-z0-9_.]+)\\}/g, (_, path) => encodeURIComponent(String(readPath(row, path) ?? '')))\n\t\t},\n\n\t\t/**\n\t\t * Record one row's note, then let the page refetch.\n\t\t *\n\t\t * @param {object} item The row item.\n\t\t * @param {boolean} [refresh] Whether to refresh the page after it.\n\t\t * @return {Promise<boolean>} Whether it was recorded.\n\t\t */\n\t\tasync record(item, refresh = true) {\n\t\t\tconst text = String(this.drafts[item.key] ?? '').trim()\n\t\t\tconst url = this.urlOf(item.row)\n\t\t\tif (text === '' || url === '') {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tthis.busy = true\n\t\t\tthis.error = ''\n\t\t\ttry {\n\t\t\t\tconst { default: axios } = await import('@nextcloud/axios')\n\t\t\t\tawait axios.post(prefixUrl(url), { [this.action.bodyField || 'message']: text })\n\t\t\t\tif (this.leaf) {\n\t\t\t\t\tdocument.dispatchEvent(new CustomEvent(NOTE_RECORDED_EVENT, { detail: { ...this.leafProps(item.row), note: text } }))\n\t\t\t\t}\n\t\t\t\tconst { [item.key]: done, ...rest } = this.drafts\n\t\t\t\tthis.drafts = rest\n\t\t\t\tif (refresh) {\n\t\t\t\t\temit(PAGE_REFRESH_CHANNEL, {})\n\t\t\t\t}\n\t\t\t\treturn true\n\t\t\t} catch {\n\t\t\t\tthis.error = this.action.errorText || t('nextcloud-vue', 'The note could not be recorded. It is kept here; try again.')\n\t\t\t\treturn false\n\t\t\t} finally {\n\t\t\t\tthis.busy = false\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Record every row with a note, one after another, then refresh once.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync recordEvery() {\n\t\t\tconst filled = this.items.filter((item) => this.hasDraft(item.key))\n\t\t\tlet any = false\n\t\t\tfor (const item of filled) {\n\t\t\t\tany = (await this.record(item, false)) || any\n\t\t\t}\n\t\t\tif (any) {\n\t\t\t\temit(PAGE_REFRESH_CHANNEL, {})\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-record-notes {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 0;\n}\n\n.cn-record-notes__ready {\n\tdisplay: flex;\n\talign-items: baseline;\n\tgap: 6px;\n\tmargin: 0 0 8px;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-record-notes__ready-figure {\n\tfont-weight: 700;\n\tcolor: var(--color-main-text);\n}\n\n.cn-record-notes__row {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 10px;\n\tpadding: 14px 0;\n\tborder-top: 1px solid var(--color-border);\n}\n\n.cn-record-notes__head {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\talign-items: center;\n\tgap: 8px;\n}\n\n.cn-record-notes__title {\n\tfont-weight: 600;\n\tcolor: var(--color-main-text);\n}\n\n.cn-record-notes__title--link {\n\ttext-decoration: underline;\n}\n\n.cn-record-notes__meta {\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 13px;\n}\n\n.cn-record-notes__spacer {\n\tflex: 1 1 auto;\n}\n\n.cn-record-notes__due {\n\tfont-weight: 600;\n}\n\n.cn-record-notes__due--error {\n\tcolor: var(--color-error-text);\n}\n\n.cn-record-notes__due--warning {\n\tcolor: var(--color-warning-text);\n}\n\n.cn-record-notes__due--muted {\n\tcolor: var(--color-text-maxcontrast);\n\tfont-weight: 400;\n}\n\n.cn-record-notes__fields {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\talign-items: flex-end;\n\tgap: 10px;\n}\n\n.cn-record-notes__field {\n\tdisplay: flex;\n\tflex: 1 1 260px;\n\tflex-direction: column;\n\tgap: 6px;\n}\n\n.cn-record-notes__field-label {\n\tcolor: var(--color-main-text);\n\tfont-size: 14px;\n\tfont-weight: 600;\n}\n\n.cn-record-notes__leaf {\n\tflex: 0 0 auto;\n}\n\n.cn-record-notes__leaf-missing,\n.cn-record-notes__error {\n\tmargin: 0;\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 13px;\n}\n\n.cn-record-notes__error {\n\tcolor: var(--color-error-text);\n}\n\n.cn-record-notes__all {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\talign-items: center;\n\tjustify-content: space-between;\n\tgap: 12px;\n\tmargin-top: 8px;\n\tpadding-top: 14px;\n\tborder-top: 1px solid var(--color-border);\n}\n\n.cn-record-notes__all-title {\n\tmargin: 0;\n\tfont-size: 16px;\n}\n\n.cn-record-notes__all-sentence {\n\tmargin: 4px 0 0;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-record-notes__all-actions {\n\tdisplay: flex;\n\tgap: 8px;\n}\n</style>\n"],"names":["_openBlock","_createElementBlock","_createElementVNode","_toDisplayString","_Fragment","_renderList","_createBlock","_resolveDynamicComponent","_mergeProps","_createTextVNode","_createVNode","_normalizeClass"],"mappings":";;;AAWK,EAAA,KAAA,EAAA,iBAAA;AAAA,EAAA,aAAA,EAAA,sBAAA;;;AACA,EAAA,KAAK,EAAC,wB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,MAAA,CAAA,SAAQ,CAAC,IAAI;AAAvB,uBAAAH,SAAA,EAAA,EAAAC,kBAAA,CAEI,GAFJ,EAAA,WAEI,EADAE,eAAA,CAAA,MAAA,CAAA,SAAS,CAAC,IAAI,CAAA,EAAA,CAAA,YAAA;;;;AAGjB,YAAAD,kBAAA,QAAA;AACc,cAAA,CAAA,MAAA,CAAA,SAAU,CAAC,MAAM;gCAA/BI,WAEU,CAAA,mBAAA,EAAA;;2BAFyB,EAAA,WAAA;AAAA,oBAAA,EAAA,EAAA,MAAA,CAAA,SAAA,CAAA,MAAA,CAAA,EAAA;;qCACnC,MAA4B;sDAAzB,MAAS,CAAA,SAAA,CAAC,MAAM,CAAC,KAAK,CAAA,EAAA,CAAA,YAAA;;;;;cAEzBI;AACC,gBAAA,OAAM,WAAU;gBAChB,QAAQ,EAAC,KAAA,CAAA,IAAA,IAAA,QAAA,CAAA,UAAA,KAAA,CAAA;AACV,gBAAA,aAAW,EAAC,kCAAQ;AACnB,gBAAA,OAAK,EAAE,QAAC,CAAA,WAAA;;iCAGH,MACN;kCADM,GACN,GAAAP,eAAA,CAAA,MAAA,CAAA,SAAA,CAAA,KAAA,CAAA,EAAA,CAAA,YAAA;;;;AAHG,gBAAA,CAAA,MAAA,CAAA,SAAA,CAAA,IAAA;;4BAAA,MAAA;kCACF,MAAC;wBAADO,WAAC,CAAA,iBAAA,EAAA;0BAAA,IAAA,EAAA,MAAA,CAAA,SAAA,CAAA,IAAA;AAAA,0BAAA,IAAA,EAAA,EAAA;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"CnRecordNoteRows.vue3.js","sources":["../../../../src/components/CnRecordListWidget/CnRecordNoteRows.vue?vue&type=template&id=9dce26e6&lang.js"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n\n<template>\n\t<div class=\"cn-record-notes\" data-testid=\"cn-record-list-notes\">\n\t\t<p class=\"cn-record-notes__ready\" data-testid=\"cn-record-list-notes-ready\">\n\t\t\t<span class=\"cn-record-notes__ready-figure\">{{ readyCount }}</span>\n\t\t\t<span class=\"cn-record-notes__ready-label\">{{ readyLabel }}</span>\n\t\t</p>\n\t\t<div\n\t\t\tv-for=\"item in items\"\n\t\t\t:key=\"item.key\"\n\t\t\tclass=\"cn-record-notes__row\"\n\t\t\tdata-testid=\"cn-record-list-item\">\n\t\t\t<div class=\"cn-record-notes__head\">\n\t\t\t\t<CnStatusBadge\n\t\t\t\t\tv-if=\"item.pill\"\n\t\t\t\t\t:label=\"item.pill.label\"\n\t\t\t\t\t:variant=\"item.pill.variant\"\n\t\t\t\t\tsize=\"small\" />\n\t\t\t\t<component\n\t\t\t\t\t:is=\"item.tag\"\n\t\t\t\t\tv-if=\"item.title\"\n\t\t\t\t\tclass=\"cn-record-notes__title\"\n\t\t\t\t\t:class=\"{ 'cn-record-notes__title--link': item.tag !== 'div' }\"\n\t\t\t\t\tv-bind=\"item.attrs\">\n\t\t\t\t\t{{ item.title }}\n\t\t\t\t</component>\n\t\t\t\t<span v-if=\"item.meta\" class=\"cn-record-notes__meta\">{{ item.meta }}</span>\n\t\t\t\t<span class=\"cn-record-notes__spacer\" />\n\t\t\t\t<span\n\t\t\t\t\tv-if=\"item.due\"\n\t\t\t\t\tclass=\"cn-record-notes__due\"\n\t\t\t\t\t:class=\"`cn-record-notes__due--${dueToneOf(item.due)}`\"\n\t\t\t\t\tdata-testid=\"cn-record-list-due\">{{ item.due.text }}</span>\n\t\t\t</div>\n\t\t\t<div class=\"cn-record-notes__fields\">\n\t\t\t\t<!-- The label stands above the field, as the leaf's own beside it\n\t\t\t\t (humaniq \"Uren\"), so both fields share one line. -->\n\t\t\t\t<div class=\"cn-record-notes__field\">\n\t\t\t\t\t<label :for=\"fieldId(item.key)\" class=\"cn-record-notes__field-label\">{{ fieldLabel }}</label>\n\t\t\t\t\t<NcTextField\n\t\t\t\t\t\t:id=\"fieldId(item.key)\"\n\t\t\t\t\t\t:modelValue=\"drafts[item.key] || ''\"\n\t\t\t\t\t\t:label=\"fieldLabel\"\n\t\t\t\t\t\tlabelOutside\n\t\t\t\t\t\t:placeholder=\"placeholder\"\n\t\t\t\t\t\t:disabled=\"busy\"\n\t\t\t\t\t\t:data-testid=\"`cn-record-list-note-${item.key}`\"\n\t\t\t\t\t\t@update:modelValue=\"setDraft(item.key, $event)\" />\n\t\t\t\t</div>\n\t\t\t\t<div v-if=\"leaf && leafProvider\" class=\"cn-record-notes__leaf\" :data-testid=\"`cn-record-list-leaf-${item.key}`\">\n\t\t\t\t\t<CnLeafMountHost\n\t\t\t\t\t\tv-if=\"leafIsMount\"\n\t\t\t\t\t\t:provider=\"leafProvider\"\n\t\t\t\t\t\t:mountProps=\"leafProps(item.row)\" />\n\t\t\t\t\t<component :is=\"leafComponent\" v-else-if=\"leafComponent\" v-bind=\"leafProps(item.row)\" />\n\t\t\t\t</div>\n\t\t\t\t<NcButton\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t:disabled=\"busy || !hasDraft(item.key)\"\n\t\t\t\t\t:data-testid=\"`cn-record-list-record-${item.key}`\"\n\t\t\t\t\t@click=\"record(item)\">\n\t\t\t\t\t{{ recordLabel }}\n\t\t\t\t</NcButton>\n\t\t\t</div>\n\t\t\t<p\n\t\t\t\tv-if=\"leafUnavailable\"\n\t\t\t\tclass=\"cn-record-notes__leaf-missing\"\n\t\t\t\t:data-testid=\"`cn-record-list-leaf-missing-${item.key}`\">\n\t\t\t\t{{ leafUnavailableText }}\n\t\t\t</p>\n\t\t</div>\n\t\t<p v-if=\"error\"\n\t\t\tclass=\"cn-record-notes__error\"\n\t\t\trole=\"alert\"\n\t\t\tdata-testid=\"cn-record-list-notes-error\">\n\t\t\t{{ error }}\n\t\t</p>\n\t\t<!-- `recordAll.placement.widget`: the pair goes to the foot of that\n\t\t dashboard card, which carries the title and sentence itself. -->\n\t\t<Teleport v-if=\"recordAll\" :to=\"placedTarget || 'body'\" :disabled=\"!placedTarget\">\n\t\t\t<p\n\t\t\t\tv-if=\"placedTarget && recordAll.placement && recordAll.placement.sentence && allSentence\"\n\t\t\t\tclass=\"cn-record-notes__all-sentence cn-record-notes__all-sentence--placed\"\n\t\t\t\tdata-testid=\"cn-record-list-record-all-sentence\">\n\t\t\t\t{{ allSentence }}\n\t\t\t</p>\n\t\t\t<div\n\t\t\t\tclass=\"cn-record-notes__all\"\n\t\t\t\t:class=\"{ 'cn-record-notes__all--placed': !!placedTarget }\"\n\t\t\t\tdata-testid=\"cn-record-list-record-all\">\n\t\t\t\t<div v-if=\"!placedTarget\" class=\"cn-record-notes__all-text\">\n\t\t\t\t\t<h3 v-if=\"recordAll.title\" class=\"cn-record-notes__all-title\">\n\t\t\t\t\t\t{{ recordAll.title }}\n\t\t\t\t\t</h3>\n\t\t\t\t\t<p v-if=\"allSentence\" class=\"cn-record-notes__all-sentence\">\n\t\t\t\t\t\t{{ allSentence }}\n\t\t\t\t\t</p>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"cn-record-notes__all-actions\">\n\t\t\t\t\t<NcButton v-if=\"recordAll.cancel\" variant=\"secondary\" :to=\"recordAll.cancel.to\">\n\t\t\t\t\t\t{{ recordAll.cancel.label }}\n\t\t\t\t\t</NcButton>\n\t\t\t\t\t<NcButton\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t:disabled=\"busy || readyCount === 0\"\n\t\t\t\t\t\tdata-testid=\"cn-record-list-record-all-button\"\n\t\t\t\t\t\t@click=\"recordEvery\">\n\t\t\t\t\t\t<template v-if=\"recordAll.icon\" #icon>\n\t\t\t\t\t\t\t<CnIcon :name=\"recordAll.icon\" :size=\"20\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t{{ recordAll.label }}\n\t\t\t\t\t</NcButton>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</Teleport>\n\t</div>\n</template>\n\n<script>\nimport { emit } from '@nextcloud/event-bus'\nimport { translate as t } from '@nextcloud/l10n'\nimport { NcButton, NcTextField } from '@nextcloud/vue'\nimport CnIcon from '../CnIcon/CnIcon.vue'\nimport CnLeafMountHost from '../CnLeafMountHost/CnLeafMountHost.vue'\nimport CnStatusBadge from '../CnStatusBadge/CnStatusBadge.vue'\nimport { useIntegrationRegistry } from '../../composables/useIntegrationRegistry.js'\nimport { isAppInstalled } from '../../utils/appInstalled.js'\nimport { prefixUrl } from '../../utils/headers.js'\nimport { readPath } from '../../utils/readPath.js'\n\n/** The bus channel every endpoint-bound widget on the page refetches on. */\nconst PAGE_REFRESH_CHANNEL = 'cn:page:refresh'\n\n/**\n * The document event a recorded note sends, so a row's leaf (humaniq's\n * hours) can record what it holds for the same object at the same moment.\n * `detail` is the row's leaf props plus `note`.\n */\nconst NOTE_RECORDED_EVENT = 'cn-record-notes:recorded'\n\n/**\n * The rows of a record list drawn as notes to record (`presentation:\n * \"notes\"`, DqDagAfsluiten \"Nog open van vandaag\"): per row its pill, title,\n * meta and due text, a field for what happened, an optional integration leaf\n * (humaniq's hours) and a button that records the note on the row's own\n * notes endpoint. What is typed and not yet recorded stays in this browser\n * (session storage) and is counted as the \"ready to record\" figure; one\n * button records every filled row. After a note is recorded the page's\n * endpoint widgets refetch, so the row moves to whatever lists the server\n * keeps of recorded work.\n *\n * @spec openspec/changes/record-list-notes/specs/record-list-notes/spec.md#requirement-a-record-list-can-collect-and-record-a-note-per-row\n */\nexport default {\n\tname: 'CnRecordNoteRows',\n\n\tcomponents: { CnIcon, CnLeafMountHost, CnStatusBadge, NcButton, NcTextField },\n\n\tprops: {\n\t\t/** The list's rows as the record list builds them (`key`, `row`, `tag`, `attrs`, `title`, `meta`, `pill`, `due`). */\n\t\titems: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t\t/**\n\t\t * `noteAction`, already translated: `{ urlField?, url?, bodyField?,\n\t\t * label, fieldLabel, placeholder?, readyLabel, draftsKey?, errorText? }`.\n\t\t */\n\t\taction: {\n\t\t\ttype: Object,\n\t\t\trequired: true,\n\t\t},\n\n\t\t/** `recordAll`, already translated: `{ label, title?, text?: (string|{ zero?, one?, other }), icon?, cancel?: { label, to }, placement?: { widget, sentence? } }`, or null. */\n\t\trecordAll: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** `rowLeaf`: `{ id, app?, register?, objectIdField, schemaField?, schema?, unavailableText? }`, or null. */\n\t\tleaf: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\t},\n\n\tsetup() {\n\t\tconst { getById } = useIntegrationRegistry()\n\t\treturn { getProvider: getById }\n\t},\n\n\tdata() {\n\t\treturn { drafts: this.readDrafts(), busy: false, error: '', placedTarget: null }\n\t},\n\n\tcomputed: {\n\t\t/** @return {string} The session storage key of this list's drafts. */\n\t\tdraftsKey() {\n\t\t\treturn `cn-record-list-notes:${this.action.draftsKey || 'default'}`\n\t\t},\n\n\t\t/** @return {number} The rows with a note typed and not yet recorded. */\n\t\treadyCount() {\n\t\t\treturn this.items.filter((item) => this.hasDraft(item.key)).length\n\t\t},\n\n\t\t/**\n\t\t * The record-all sentence for the notes filled in now: a plain\n\t\t * sentence as it is, else the `zero`, `one` or `other` form with\n\t\t * `{count}` filled in.\n\t\t *\n\t\t * @return {string}\n\t\t * @spec openspec/changes/record-all-counted-sentence/specs/record-list-notes/spec.md\n\t\t */\n\t\tallSentence() {\n\t\t\tconst text = this.recordAll?.text\n\t\t\tif (typeof text === 'string') {\n\t\t\t\treturn text\n\t\t\t}\n\t\t\tif (!text || typeof text !== 'object') {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\tconst count = this.readyCount\n\t\t\tconst form = (count === 0 && text.zero) || (count === 1 && text.one) || text.other || text.one || ''\n\t\t\treturn form.replace(/\\{count\\}/g, String(count))\n\t\t},\n\n\t\t/** @return {string} The label of the ready figure. */\n\t\treadyLabel() {\n\t\t\treturn this.action.readyLabel || t('nextcloud-vue', 'filled in, not recorded yet')\n\t\t},\n\n\t\t/** @return {string} */\n\t\trecordLabel() {\n\t\t\treturn this.action.label || t('nextcloud-vue', 'Record')\n\t\t},\n\n\t\t/** @return {string} */\n\t\tfieldLabel() {\n\t\t\treturn this.action.fieldLabel || t('nextcloud-vue', 'Note')\n\t\t},\n\n\t\t/** @return {string} */\n\t\tplaceholder() {\n\t\t\treturn this.action.placeholder || ''\n\t\t},\n\n\t\t/** @return {object|null} The leaf's integration provider, when one is registered. */\n\t\tleafProvider() {\n\t\t\treturn this.leaf && this.leaf.id ? (this.getProvider(this.leaf.id) || null) : null\n\t\t},\n\n\t\t/** @return {boolean} Whether the leaf mounts itself (`renderMode: \"mount\"`). */\n\t\tleafIsMount() {\n\t\t\tconst provider = this.leafProvider\n\t\t\treturn Boolean(provider) && provider.renderMode === 'mount' && typeof provider.mount === 'function'\n\t\t},\n\n\t\t/** @return {object|null} The leaf's component, in component mode. */\n\t\tleafComponent() {\n\t\t\tconst provider = this.leafProvider\n\t\t\treturn provider ? (provider.tab || provider.widget || null) : null\n\t\t},\n\n\t\t/**\n\t\t * Whether the leaf's app is installed but the leaf is not available, so\n\t\t * the row says so instead of silently showing no field.\n\t\t *\n\t\t * @return {boolean}\n\t\t */\n\t\tleafUnavailable() {\n\t\t\treturn Boolean(this.leaf && this.leaf.app && !this.leafProvider && isAppInstalled(this.leaf.app))\n\t\t},\n\n\t\t/** @return {string} */\n\t\tleafUnavailableText() {\n\t\t\treturn this.leaf?.unavailableText || t('nextcloud-vue', 'This field is not available here.')\n\t\t},\n\t},\n\n\twatch: {\n\t\tdrafts: {\n\t\t\tdeep: true,\n\t\t\thandler() {\n\t\t\t\tthis.saveDrafts()\n\t\t\t},\n\t\t},\n\t},\n\n\tmounted() {\n\t\tthis.findPlacedTarget()\n\t\tthis.$nextTick(() => this.findPlacedTarget())\n\t\tthis.watchPlacedTarget()\n\t},\n\n\tbeforeUnmount() {\n\t\tif (this.placedObserver) {\n\t\t\tthis.placedObserver.disconnect()\n\t\t\tthis.placedObserver = null\n\t\t}\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * The content of the dashboard card `recordAll.placement.widget` names,\n\t\t * once it is on the page; until then (or without one) the pair stays\n\t\t * under the rows.\n\t\t *\n\t\t * @return {void}\n\t\t * @spec openspec/changes/record-all-in-its-own-card/specs/record-list-notes/spec.md\n\t\t */\n\t\tfindPlacedTarget() {\n\t\t\tconst widget = this.recordAll?.placement?.widget\n\t\t\tif ((this.placedTarget && this.placedTarget.isConnected) || typeof widget !== 'string' || widget === '' || typeof document === 'undefined') {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst card = [...document.querySelectorAll('[data-cn-widget-id]')].find((el) => el.getAttribute('data-cn-widget-id') === widget)\n\t\t\tthis.placedTarget = card ? (card.querySelector('.cn-widget-wrapper__content') || null) : null\n\t\t},\n\n\t\t/**\n\t\t * Look for the placed card again whenever the page changes: the grid\n\t\t * can draw that card after this list, or draw it again, and a pair\n\t\t * left in a card no longer on the page is not seen at all.\n\t\t *\n\t\t * @return {void}\n\t\t * @spec openspec/changes/record-all-follows-its-card/specs/record-list-notes/spec.md#requirement-the-placed-pair-follows-its-card\n\t\t */\n\t\twatchPlacedTarget() {\n\t\t\tconst widget = this.recordAll?.placement?.widget\n\t\t\tif (typeof widget !== 'string' || widget === '' || typeof MutationObserver === 'undefined' || typeof document === 'undefined') {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.placedObserver = new MutationObserver(() => this.findPlacedTarget())\n\t\t\tthis.placedObserver.observe(document.body, { childList: true, subtree: true })\n\t\t},\n\n\t\t/**\n\t\t * The drafts this browser session kept, by row key.\n\t\t *\n\t\t * @return {Object<string, string>}\n\t\t */\n\t\treadDrafts() {\n\t\t\ttry {\n\t\t\t\tconst raw = window.sessionStorage.getItem(`cn-record-list-notes:${this.action?.draftsKey || 'default'}`)\n\t\t\t\tconst parsed = raw ? JSON.parse(raw) : {}\n\t\t\t\treturn parsed && typeof parsed === 'object' && !Array.isArray(parsed) ? parsed : {}\n\t\t\t} catch {\n\t\t\t\treturn {}\n\t\t\t}\n\t\t},\n\n\t\t/** @return {void} */\n\t\tsaveDrafts() {\n\t\t\ttry {\n\t\t\t\twindow.sessionStorage.setItem(this.draftsKey, JSON.stringify(this.drafts))\n\t\t\t} catch {\n\t\t\t\t// Without session storage the drafts live as long as the page.\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * The colour of a due text: a term that ended or ends today in the\n\t\t * error colour, one still to come in the warning colour.\n\t\t *\n\t\t * @param {{tone: string}} due The due text.\n\t\t * @return {string} `error`, `warning` or `muted`.\n\t\t */\n\t\tdueToneOf(due) {\n\t\t\tif (due.tone === 'danger' || due.tone === 'today') {\n\t\t\t\treturn 'error'\n\t\t\t}\n\t\t\treturn due.tone === 'upcoming' ? 'warning' : 'muted'\n\t\t},\n\n\t\t/**\n\t\t * @param {string} key The row key.\n\t\t * @param {string} value The typed note.\n\t\t * @return {void}\n\t\t */\n\t\tsetDraft(key, value) {\n\t\t\tthis.drafts = { ...this.drafts, [key]: String(value ?? '') }\n\t\t},\n\n\t\t/**\n\t\t * The id of a row's note field, for its label.\n\t\t *\n\t\t * @param {string} key The row key.\n\t\t * @return {string} The id.\n\t\t */\n\t\tfieldId(key) {\n\t\t\treturn `cn-record-notes-${this.$.uid}-${String(key).replace(/[^A-Za-z0-9_-]/g, '-')}`\n\t\t},\n\n\t\t/**\n\t\t * @param {string} key The row key.\n\t\t * @return {boolean} Whether the row has a note typed.\n\t\t */\n\t\thasDraft(key) {\n\t\t\treturn String(this.drafts[key] ?? '').trim() !== ''\n\t\t},\n\n\t\t/**\n\t\t * The props the row's leaf gets: the row's object, register and schema.\n\t\t *\n\t\t * @param {object} row The row.\n\t\t * @return {object}\n\t\t */\n\t\tleafProps(row) {\n\t\t\tconst leaf = this.leaf || {}\n\t\t\treturn {\n\t\t\t\tobjectId: String(readPath(row, leaf.objectIdField || 'id') ?? ''),\n\t\t\t\tregister: leaf.register || '',\n\t\t\t\tschema: leaf.schemaField ? String(readPath(row, leaf.schemaField) ?? '') : (leaf.schema || ''),\n\t\t\t\tsurface: 'row',\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * The row's notes endpoint: the row's `urlField`, else `url` with\n\t\t * `{field}` filled from the row.\n\t\t *\n\t\t * @param {object} row The row.\n\t\t * @return {string} The URL, or ''.\n\t\t */\n\t\turlOf(row) {\n\t\t\tif (this.action.urlField) {\n\t\t\t\treturn String(readPath(row, this.action.urlField) ?? '')\n\t\t\t}\n\t\t\tconst template = String(this.action.url || '')\n\t\t\treturn template.replace(/\\{([A-Za-z0-9_.]+)\\}/g, (_, path) => encodeURIComponent(String(readPath(row, path) ?? '')))\n\t\t},\n\n\t\t/**\n\t\t * Record one row's note, then let the page refetch.\n\t\t *\n\t\t * @param {object} item The row item.\n\t\t * @param {boolean} [refresh] Whether to refresh the page after it.\n\t\t * @return {Promise<boolean>} Whether it was recorded.\n\t\t */\n\t\tasync record(item, refresh = true) {\n\t\t\tconst text = String(this.drafts[item.key] ?? '').trim()\n\t\t\tconst url = this.urlOf(item.row)\n\t\t\tif (text === '' || url === '') {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tthis.busy = true\n\t\t\tthis.error = ''\n\t\t\ttry {\n\t\t\t\tconst { default: axios } = await import('@nextcloud/axios')\n\t\t\t\tawait axios.post(prefixUrl(url), { [this.action.bodyField || 'message']: text })\n\t\t\t\tif (this.leaf) {\n\t\t\t\t\tdocument.dispatchEvent(new CustomEvent(NOTE_RECORDED_EVENT, { detail: { ...this.leafProps(item.row), note: text } }))\n\t\t\t\t}\n\t\t\t\tconst { [item.key]: done, ...rest } = this.drafts\n\t\t\t\tthis.drafts = rest\n\t\t\t\tif (refresh) {\n\t\t\t\t\temit(PAGE_REFRESH_CHANNEL, {})\n\t\t\t\t}\n\t\t\t\treturn true\n\t\t\t} catch {\n\t\t\t\tthis.error = this.action.errorText || t('nextcloud-vue', 'The note could not be recorded. It is kept here; try again.')\n\t\t\t\treturn false\n\t\t\t} finally {\n\t\t\t\tthis.busy = false\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Record every row with a note, one after another, then refresh once.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync recordEvery() {\n\t\t\tconst filled = this.items.filter((item) => this.hasDraft(item.key))\n\t\t\tlet any = false\n\t\t\tfor (const item of filled) {\n\t\t\t\tany = (await this.record(item, false)) || any\n\t\t\t}\n\t\t\tif (any) {\n\t\t\t\temit(PAGE_REFRESH_CHANNEL, {})\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-record-notes {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 0;\n}\n\n.cn-record-notes__ready {\n\tdisplay: flex;\n\talign-items: baseline;\n\tgap: 6px;\n\tmargin: 0 0 8px;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-record-notes__ready-figure {\n\tfont-weight: 700;\n\tcolor: var(--color-main-text);\n}\n\n.cn-record-notes__row {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 10px;\n\tpadding: 14px 0;\n\tborder-top: 1px solid var(--color-border);\n}\n\n.cn-record-notes__head {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\talign-items: center;\n\tgap: 8px;\n}\n\n.cn-record-notes__title {\n\tfont-weight: 600;\n\tcolor: var(--color-main-text);\n}\n\n.cn-record-notes__title--link {\n\ttext-decoration: underline;\n}\n\n.cn-record-notes__meta {\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 13px;\n}\n\n.cn-record-notes__spacer {\n\tflex: 1 1 auto;\n}\n\n.cn-record-notes__due {\n\tfont-weight: 600;\n}\n\n.cn-record-notes__due--error {\n\tcolor: var(--color-error-text);\n}\n\n.cn-record-notes__due--warning {\n\tcolor: var(--color-warning-text);\n}\n\n.cn-record-notes__due--muted {\n\tcolor: var(--color-text-maxcontrast);\n\tfont-weight: 400;\n}\n\n.cn-record-notes__fields {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\talign-items: flex-end;\n\tgap: 10px;\n}\n\n.cn-record-notes__field {\n\tdisplay: flex;\n\tflex: 1 1 260px;\n\tflex-direction: column;\n\tgap: 6px;\n}\n\n.cn-record-notes__field-label {\n\tcolor: var(--color-main-text);\n\tfont-size: 14px;\n\tfont-weight: 600;\n}\n\n.cn-record-notes__leaf {\n\tflex: 0 0 auto;\n}\n\n.cn-record-notes__leaf-missing,\n.cn-record-notes__error {\n\tmargin: 0;\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 13px;\n}\n\n.cn-record-notes__error {\n\tcolor: var(--color-error-text);\n}\n\n.cn-record-notes__all {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\talign-items: center;\n\tjustify-content: space-between;\n\tgap: 12px;\n\tmargin-top: 8px;\n\tpadding-top: 14px;\n\tborder-top: 1px solid var(--color-border);\n}\n\n.cn-record-notes__all-title {\n\tmargin: 0;\n\tfont-size: 16px;\n}\n\n.cn-record-notes__all-sentence {\n\tmargin: 4px 0 0;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-record-notes__all-sentence--placed {\n\tmargin: 0;\n\tpadding: 0 0 12px;\n\tcolor: var(--color-main-text);\n}\n\n.cn-record-notes__all-actions {\n\tdisplay: flex;\n\tgap: 8px;\n}\n</style>\n"],"names":["_openBlock","_createElementBlock","_createElementVNode","_toDisplayString","_Fragment","_renderList","_createBlock","_resolveDynamicComponent","_mergeProps","_createTextVNode","_createVNode","_normalizeClass"],"mappings":";;;AAWK,EAAA,KAAA,EAAA,iBAAA;AAAA,EAAA,aAAA,EAAA,sBAAA;;;AACA,EAAA,KAAK,EAAC,wBAAY;AAAA,EAAA,aAAA,EAAA,4BAAA;;AACd,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,+BAAE,GAAA;AACR,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,8BAAe,GAAA;AAOtB,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,uBAAK,GAAA;;;AAcQ,EAAA,KAAK,EAAC,uBAAuB;;A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AA,CAAA,SAAA,CAAA,KAAA,CAAA,EAAA,CAAA,YAAA;;mBAEM,QAAU,CAAA,WAAA;oCAApBF,kBAEI,CAAA,GAAA,EAFJ,WAEI,EAAAE,eAAA,CADA,QAAW,CAAA,WAAA,CAAA,EAAA,CAAA,YAAA;;;;AAGd,YAAAD,kBAAA,QAAA;AACc,cAAA,CAAA,MAAA,CAAA,SAAU,CAAC,MAAM;gCAA/BI,WAEU,CAAA,mBAAA,EAAA;;2BAFyB,EAAA,WAAA;AAAA,oBAAA,EAAA,EAAA,MAAA,CAAA,SAAA,CAAA,MAAA,CAAA,EAAA;;qCACnC,MAA4B;sDAAzB,MAAS,CAAA,SAAA,CAAC,MAAM,CAAC,KAAK,CAAA,EAAA,CAAA,YAAA;;;;;cAEzBI;AACC,gBAAA,OAAM,WAAU;gBAChB,QAAQ,EAAC,KAAA,CAAA,IAAA,IAAA,QAAA,CAAA,UAAA,KAAA,CAAA;AACV,gBAAA,aAAW,EAAC,kCAAQ;AACnB,gBAAA,OAAK,EAAE,QAAC,CAAA,WAAA;;iCAGH,MACN;kCADM,GACN,GAAAP,eAAA,CAAA,MAAA,CAAA,SAAA,CAAA,KAAA,CAAA,EAAA,CAAA,YAAA;;;;AAHG,gBAAA,CAAA,MAAA,CAAA,SAAA,CAAA,IAAA;;4BAAA,MAAA;kCACF,MAAC;wBAADO,WAAC,CAAA,iBAAA,EAAA;0BAAA,IAAA,EAAA,MAAA,CAAA,SAAA,CAAA,IAAA;AAAA,0BAAA,IAAA,EAAA,EAAA;;;;;;;;;;;;;;;;"}
@@ -108,6 +108,9 @@ function useListView(objectTypeOrOptions, options) {
108
108
  // current ones.
109
109
  const error = ref(null);
110
110
  let refreshSeq = 0;
111
+ // The mount's schema request, and whether it is still in flight.
112
+ let schemaLoading = null;
113
+ let schemaPending = false;
111
114
  let pendingRefreshes = 0;
112
115
 
113
116
  let searchTimeout = null;
@@ -197,8 +200,15 @@ function useListView(objectTypeOrOptions, options) {
197
200
  *
198
201
  * @param {number} [page] Page to fetch
199
202
  * @return {Promise<void>}
203
+ * @spec openspec/changes/list-waits-for-its-schema/specs/list-waits-for-its-schema/spec.md#requirement-a-list-fetch-waits-for-the-schema-the-mount-is-loading
200
204
  */
201
205
  async function refresh(page = 1) {
206
+ // The store asks for facets only once it holds the schema, so a refresh
207
+ // that starts while the mount is still loading it (a watcher applying
208
+ // default filters, say) waits for it.
209
+ if (schemaPending) {
210
+ await schemaLoading.catch(() => null);
211
+ }
202
212
  const seq = ++refreshSeq;
203
213
  // This call's own result. `errors[getType()]` is shared by every call
204
214
  // for the type and is not cleared on success, so it cannot say which
@@ -378,7 +388,13 @@ function useListView(objectTypeOrOptions, options) {
378
388
 
379
389
  onMounted(async () => {
380
390
  try {
381
- schema.value = await objectStore.fetchSchema(getType());
391
+ schemaPending = true;
392
+ schemaLoading = Promise.resolve(objectStore.fetchSchema(getType()));
393
+ try {
394
+ schema.value = await schemaLoading;
395
+ } finally {
396
+ schemaPending = false;
397
+ }
382
398
  if (sidebarState) {
383
399
  setupSidebar();
384
400
  }
@@ -1 +1 @@
1
- {"version":3,"file":"useListView.js","sources":["../../../src/composables/useListView.js"],"sourcesContent":["import { computed, isRef, onBeforeUnmount, onMounted, ref, watch } from 'vue'\nimport { useObjectStore } from '../store/index.js'\nimport { facetFilterParams } from '../utils/facets.js'\n\n/**\n * Composable for managing list view state with full objectStore integration.\n *\n * When called with an `objectType` string, connects to the objectStore and handles\n * schema loading, collection fetching, sidebar wiring, and all event handlers\n * automatically. Everything a `CnIndexPage`-based list view needs is returned\n * directly — no additional computed properties or methods required in the component.\n *\n * Backward-compatible: existing `useListView(options)` and `useListView()` calls\n * continue to work without modification.\n *\n * @param {string|Function|object} [objectTypeOrOptions] Object type slug (new API), a getter or ref returning one (the list follows it when it changes), or a legacy options object\n * @param {object} [options] Options (new API only)\n * @param {object|null} [options.objectStore] Custom object store instance (from createObjectStore). When provided, uses this store instead of the default useObjectStore(). Required when the app uses createObjectStore with a custom store ID.\n * @param {object|null} [options.sidebarState] Sidebar state object from `inject('sidebarState')`. When provided, the composable wires and unwires the sidebar automatically on mount/unmount.\n * @param {number} [options.defaultPageSize] Default `_limit` sent to the API\n * @param {number} [options.debounceMs] Search debounce in milliseconds\n * @param {object} [options.defaultSort] Default sort applied on mount e.g. `{ key: 'createdAt', order: 'desc' }`\n * @param {Array<{key: string, order: 'asc'|'desc'}>} [options.defaultSortKeys] Default MULTI-column sort applied on mount (ordered priority list). Takes precedence over `defaultSort` when both are given; used e.g. to restore a sort persisted in the route query.\n * @param {Array<string>|null} [options.defaultVisibleColumns] Initial visible-column key set. Seeds the sidebar's Columns tab with the curated default (e.g. a manifest `columns` list) so toggles add/remove from it. Omit (or `null`) for schema-driven tables where every column starts visible.\n * @param {object} [options.defaultActiveFilters] Initial facet-filter map, e.g. to restore filters persisted in the route query on mount.\n * @param {string} [options.defaultSearchTerm] Initial search term, e.g. to restore `_search` from the route query on mount.\n * @param {object|(() => object)} [options.fixedFilters] A filter map (or getter returning one) merged into every fetch AFTER the user's facet filters, so the fixed entries always win. Used e.g. by `CnIndexPage` to apply a route-param-scoped `pages[].config.filter`. Default `{}` — omitting it is behaviourally identical to before.\n * @param {Array<string>|(() => Array<string>)} [options.extend] OpenRegister `_extend[]` values (or a getter returning them) forwarded on every fetch, e.g. `['calculations']` so a schema's `materialise: false` calculations are evaluated and can be shown as columns. Default `[]` — omitting it sends no `_extend` at all, exactly as before.\n * @return {object} Reactive state and event handlers\n *\n * @example\n * // New API — minimal\n * const { schema, objects, loading, pagination,\n * onSearch, onSort, onFilterChange, onPageChange, refresh } = useListView('client')\n *\n * @example\n * // New API — with sidebar wiring\n * const list = useListView('client', {\n * sidebarState: inject('sidebarState', null),\n * })\n *\n * @example\n * // Legacy API — still works\n * const { searchTerm, filters, onSearchInput, toggleSort } = useListView({\n * objectType: 'client',\n * fetchFn: (type, params) => objectStore.fetchCollection(type, params),\n * })\n */\nexport function useListView(objectTypeOrOptions, options) {\n\t// Backward compat: if first arg is an object or absent, delegate to legacy implementation\n\tif (!objectTypeOrOptions || (typeof objectTypeOrOptions === 'object' && !isRef(objectTypeOrOptions))) {\n\t\treturn useLegacyListView(objectTypeOrOptions || {})\n\t}\n\n\t// ── New API ──────────────────────────────────────────────────────────\n\t// A string, a ref or a getter: a getter lets the page switch object type\n\t// (a folder carrying its own schema) without re-creating the list.\n\tconst typeSource = objectTypeOrOptions\n\tconst isDynamicType = typeof typeSource !== 'string'\n\tconst getType = () => (isRef(typeSource) ? typeSource.value : (typeof typeSource === 'function' ? typeSource() : typeSource))\n\tconst opts = options || {}\n\tconst sidebarState = opts.sidebarState || null\n\n\tconst objectStore = opts.objectStore || useObjectStore()\n\n\t// ── State refs ───────────────────────────────────────────────────────\n\tconst schema = ref(null)\n\tconst searchTerm = ref(opts.defaultSearchTerm || '')\n\t// `sortKeys` is the source of truth (ordered multi-column priority list);\n\t// `sortKey`/`sortOrder` are kept as a primary-entry mirror so every\n\t// existing reader of the pre-multi-sort refs keeps working unchanged.\n\tconst initialSortKeys = Array.isArray(opts.defaultSortKeys) && opts.defaultSortKeys.length > 0\n\t\t? opts.defaultSortKeys\n\t\t: (opts.defaultSort?.key ? [{ key: opts.defaultSort.key, order: opts.defaultSort.order || 'asc' }] : [])\n\tconst sortKeys = ref(initialSortKeys)\n\tconst sortKey = ref(initialSortKeys[0]?.key || null)\n\tconst sortOrder = ref(initialSortKeys[0]?.order || 'asc')\n\tconst activeFilters = ref((opts.defaultActiveFilters && typeof opts.defaultActiveFilters === 'object') ? opts.defaultActiveFilters : {})\n\t// Seed the visible-column set to the configured columns so the sidebar's\n\t// Columns tab reflects the curated default and toggles add/remove from it.\n\t// `null` (no seed) means \"all columns visible\" (schema-driven tables).\n\tconst visibleColumns = ref(opts.defaultVisibleColumns ?? null)\n\tconst pageSize = ref(opts.defaultPageSize || 20)\n\n\t// ── Computed refs from the store ─────────────────────────────────────\n\tconst objects = computed(() => objectStore.collections[getType()] || [])\n\t// True from creation until the mount sequence below has issued its first\n\t// fetch. The store's own flag only goes up once `fetchCollection` runs, and\n\t// `onMounted` awaits `fetchSchema()` first — so for the length of that round\n\t// trip the list was \"not loading\" with zero rows, and every consumer\n\t// rendered its empty state (\"No log entries to show\") before any data had\n\t// been asked for. Folded into `loading` rather than exposed separately so\n\t// existing consumers get the fix without touching their templates.\n\tconst bootstrapping = ref(true)\n\tconst loading = computed(() => bootstrapping.value || objectStore.loading[getType()] || false)\n\tconst pagination = computed(() => objectStore.pagination[getType()] || { total: 0, page: 1, pages: 1, limit: 20 })\n\t// Facets are computed by the platform over the whole query rather than the\n\t// loaded page, so anything that needs the complete set of values for a\n\t// field (a folder pane grouping by it, say) reads them here rather than\n\t// deriving them from `objects`, which is only the current page.\n\tconst facets = computed(() => objectStore.facets[getType()] || {})\n\t// Personal-lens reports of the latest response (`{ recent: { available, reason } }`).\n\t// @spec openspec/changes/lens-says-why-it-is-empty/specs/personal-lens-availability/spec.md#requirement-a-list-response-carries-the-report-of-the-lenses-it-was-asked-for\n\tconst lenses = computed(() => (objectStore.lenses && objectStore.lenses[getType()]) || {})\n\t// Outcome of the latest `refresh()`: the store's error for it, or null once\n\t// it succeeded or a later fetch stored new rows. The store keeps the previous\n\t// rows on a failed fetch, so this is how a consumer tells stale rows from\n\t// current ones.\n\tconst error = ref(null)\n\tlet refreshSeq = 0\n\tlet pendingRefreshes = 0\n\n\tlet searchTimeout = null\n\n\t// ── Param construction ───────────────────────────────────────────────\n\n\t/**\n\t * Resolve `opts.fixedFilters` to a plain map. Accepts a plain object OR a\n\t * function/getter returning one (so callers can derive it from reactive\n\t * sources — e.g. route params — and have it re-read on every fetch).\n\t *\n\t * @return {object} The fixed-filter map (may be empty).\n\t */\n\tfunction resolveFixedFilters() {\n\t\tconst f = typeof opts.fixedFilters === 'function' ? opts.fixedFilters() : opts.fixedFilters\n\t\treturn (f && typeof f === 'object') ? f : {}\n\t}\n\n\t/**\n\t * Resolve `opts.extend` to a list of non-empty strings.\n\t *\n\t * Accepts an array or a getter returning one, so a caller can re-scope it\n\t * between fetches the way `fixedFilters` allows.\n\t *\n\t * @return {Array<string>} The `_extend[]` values, possibly empty.\n\t */\n\tfunction resolveExtend() {\n\t\tconst e = typeof opts.extend === 'function' ? opts.extend() : opts.extend\n\t\tif (!Array.isArray(e)) {\n\t\t\treturn []\n\t\t}\n\t\treturn e.filter((v) => typeof v === 'string' && v !== '')\n\t}\n\n\t/**\n\t * Build API fetch params from current reactive state.\n\t *\n\t * @param {number} page Page number to request\n\t * @return {object} Params object ready to pass to fetchCollection\n\t */\n\tfunction buildParams(page) {\n\t\tconst params = { _limit: pageSize.value, _page: page }\n\n\t\tif (searchTerm.value) {\n\t\t\tparams._search = searchTerm.value\n\t\t}\n\n\t\tif (sortKeys.value.length > 0) {\n\t\t\t// Object key insertion order = sort priority order, matching\n\t\t\t// OpenRegister's `_order` format exactly (`ObjectsController::\n\t\t\t// normalizeOrderParameter` / `MagicMapper`'s ordering loop). A\n\t\t\t// single active key produces byte-identical output to before.\n\t\t\tparams._order = Object.fromEntries(sortKeys.value.map((k) => [k.key, k.order]))\n\t\t}\n\n\t\tfor (const [key, values] of Object.entries(activeFilters.value)) {\n\t\t\t// Single-value arrays are unwrapped to scalar params; the\n\t\t\t// missing-value option becomes `<key>_isnull=true`.\n\t\t\tObject.assign(params, facetFilterParams(key, values))\n\t\t}\n\n\t\t// Fixed filters (e.g. a route-param-scoped `pages[].config.filter`) are\n\t\t// merged LAST so they always win over a colliding facet `activeFilter`.\n\t\t// Repeated `_extend[]`, serialized by the shared query builder. Set\n\t\t// before the fixed filters so an explicit `_extend` in a filter map\n\t\t// still wins, matching every other key's precedence here.\n\t\tconst extend = resolveExtend()\n\t\tif (extend.length > 0) {\n\t\t\tparams._extend = extend\n\t\t}\n\n\t\tfor (const [key, value] of Object.entries(resolveFixedFilters())) {\n\t\t\tif (value !== undefined && value !== null && value !== '') {\n\t\t\t\tparams[key] = value\n\t\t\t}\n\t\t}\n\n\t\treturn params\n\t}\n\n\t// ── Fetch ────────────────────────────────────────────────────────────\n\n\t/**\n\t * Fetch the collection using current state params and update sidebar facet data.\n\t * Only the most recently started refresh sets `error`, so an older response\n\t * settling late cannot override a newer one's outcome.\n\t *\n\t * @param {number} [page] Page to fetch\n\t * @return {Promise<void>}\n\t */\n\tasync function refresh(page = 1) {\n\t\tconst seq = ++refreshSeq\n\t\t// This call's own result. `errors[getType()]` is shared by every call\n\t\t// for the type and is not cleared on success, so it cannot say which\n\t\t// request failed; it is only the fallback for a store that ignores\n\t\t// `options.outcome`.\n\t\tconst outcome = {}\n\t\tpendingRefreshes++\n\t\ttry {\n\t\t\tawait objectStore.fetchCollection(getType(), buildParams(page), { outcome })\n\t\t} catch (e) {\n\t\t\tif (seq === refreshSeq) {\n\t\t\t\terror.value = e\n\t\t\t}\n\t\t\tthrow e\n\t\t} finally {\n\t\t\tpendingRefreshes--\n\t\t}\n\t\tif (seq === refreshSeq) {\n\t\t\terror.value = ('error' in outcome) ? outcome.error : (objectStore.errors?.[getType()] || null)\n\t\t}\n\t}\n\n\t// A fetch outside `refresh()` (e.g. the live-updates refetch) that stores\n\t// new rows recovers the list from an earlier failure. Rows written while\n\t// a refresh is pending are left to that refresh, which decides `error`.\n\twatch(\n\t\t() => objectStore.collections[getType()],\n\t\t() => {\n\t\t\tif (pendingRefreshes === 0) {\n\t\t\t\terror.value = null\n\t\t\t}\n\t\t},\n\t\t{ flush: 'sync' },\n\t)\n\n\t// ── Event handlers ───────────────────────────────────────────────────\n\n\t/**\n\t * Handle search input. Debounced by `options.debounceMs` (default 300 ms).\n\t *\n\t * @param {string} value New search string\n\t */\n\tfunction onSearch(value) {\n\t\tsearchTerm.value = value\n\t\tclearTimeout(searchTimeout)\n\t\tsearchTimeout = setTimeout(() => refresh(1), opts.debounceMs || 300)\n\t}\n\n\t/**\n\t * Handle sort change. Updates sort state and triggers refresh.\n\t *\n\t * Accepts CnDataTable's extended `sort` event payload: `keys` (the full\n\t * ordered multi-column list) is used when present; a legacy caller\n\t * passing only `{ key, order }` (no `keys`) still works exactly as\n\t * before — it's normalised to a single-entry `sortKeys` list.\n\t *\n\t * @param {{key: string|null, order: string|null, keys?: Array<{key: string, order: string}>}} sort New sort definition.\n\t */\n\tfunction onSort({ key, order, keys }) {\n\t\tconst nextKeys = Array.isArray(keys) ? keys : (key ? [{ key, order: order || 'asc' }] : [])\n\t\tsortKeys.value = nextKeys\n\t\tsortKey.value = nextKeys[0]?.key ?? null\n\t\tsortOrder.value = nextKeys[0]?.order ?? 'asc'\n\t\trefresh(1)\n\t}\n\n\t/**\n\t * Handle filter change for a single key. Empty arrays remove the key.\n\t *\n\t * @param {string} key Filter key (maps to API param name)\n\t * @param {Array} values Selected filter values\n\t */\n\tfunction onFilterChange(key, values) {\n\t\tif (!values || values.length === 0) {\n\t\t\tconst updated = { ...activeFilters.value }\n\t\t\tdelete updated[key]\n\t\t\tactiveFilters.value = updated\n\t\t} else {\n\t\t\tactiveFilters.value = { ...activeFilters.value, [key]: values }\n\t\t}\n\t\trefresh(1)\n\t}\n\n\t/**\n\t * Handle page navigation.\n\t *\n\t * @param {number} page Page number to navigate to\n\t */\n\tfunction onPageChange(page) {\n\t\trefresh(page)\n\t}\n\n\t/**\n\t * Add the next page after the rows already loaded, for a view that shows\n\t * every row at once (the board). Does nothing on the last page. A refresh\n\t * started while the page is in flight drops it.\n\t *\n\t * @return {Promise<void>}\n\t */\n\tasync function loadMore() {\n\t\tconst current = pagination.value\n\t\tconst next = Number(current.page || 1) + 1\n\t\tif (next > Number(current.pages || 1)) {\n\t\t\treturn\n\t\t}\n\t\tconst seq = refreshSeq\n\t\tawait objectStore.fetchCollection(getType(), buildParams(next), {\n\t\t\tappend: true,\n\t\t\tisCurrent: () => seq === refreshSeq,\n\t\t})\n\t}\n\n\t/**\n\t * Handle page-size change. Resets to page 1.\n\t *\n\t * @param {number} size New page size\n\t */\n\tfunction onPageSizeChange(size) {\n\t\tpageSize.value = size\n\t\trefresh(1)\n\t}\n\n\t// ── Sidebar wiring ───────────────────────────────────────────────────\n\n\tfunction setupSidebar() {\n\t\tif (!sidebarState) {\n\t\t\treturn\n\t\t}\n\t\tsidebarState.active = true\n\t\tsidebarState.schema = schema.value\n\t\tsidebarState.searchValue = searchTerm.value\n\t\tsidebarState.activeFilters = {}\n\t\tsidebarState.onSearch = onSearch\n\t\tsidebarState.onColumnsChange = (cols) => {\n\t\t\tvisibleColumns.value = cols\n\t\t}\n\t\tsidebarState.onFilterChange = ({ key, values }) => onFilterChange(key, values)\n\t}\n\n\tfunction teardownSidebar() {\n\t\tif (!sidebarState) {\n\t\t\treturn\n\t\t}\n\t\tsidebarState.active = false\n\t\tsidebarState.schema = null\n\t\tsidebarState.activeFilters = {}\n\t\tsidebarState.facetData = {}\n\t\tsidebarState.onSearch = null\n\t\tsidebarState.onColumnsChange = null\n\t\tsidebarState.onFilterChange = null\n\t}\n\n\t// Push facet data to sidebar after each store update\n\tif (sidebarState) {\n\t\twatch(\n\t\t\t() => objectStore.facets[getType()],\n\t\t\t(facets) => {\n\t\t\t\tsidebarState.facetData = facets || {}\n\t\t\t},\n\t\t)\n\t}\n\n\t// A dynamic object type that changes starts that type's list from page 1\n\t// with its own schema.\n\tif (isDynamicType) {\n\t\twatch(getType, async (next, prev) => {\n\t\t\tif (!next || next === prev) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tschema.value = null\n\t\t\tschema.value = await objectStore.fetchSchema(next)\n\t\t\tawait refresh(1)\n\t\t})\n\t}\n\n\t// ── Lifecycle ────────────────────────────────────────────────────────\n\n\tonMounted(async () => {\n\t\ttry {\n\t\t\tschema.value = await objectStore.fetchSchema(getType())\n\t\t\tif (sidebarState) {\n\t\t\t\tsetupSidebar()\n\t\t\t}\n\t\t\tawait refresh(1)\n\t\t} finally {\n\t\t\t// Hand the loading state back to the store either way: a schema\n\t\t\t// fetch that rejects must not leave the list spinning forever.\n\t\t\tbootstrapping.value = false\n\t\t}\n\t})\n\n\tonBeforeUnmount(() => {\n\t\tclearTimeout(searchTimeout)\n\t\tteardownSidebar()\n\t})\n\n\t// ── Return value ─────────────────────────────────────────────────────\n\n\treturn {\n\t\t// Store-derived\n\t\tschema,\n\t\tobjects,\n\t\tloading,\n\t\tpagination,\n\t\tfacets,\n\t\tlenses,\n\t\terror,\n\t\t// Local state\n\t\tsearchTerm,\n\t\tsortKey,\n\t\tsortOrder,\n\t\tsortKeys,\n\t\tactiveFilters,\n\t\tvisibleColumns,\n\t\tpageSize,\n\t\t// Event handlers\n\t\tonSearch,\n\t\tonSort,\n\t\tonFilterChange,\n\t\tonPageChange,\n\t\tonPageSizeChange,\n\t\t// Explicit fetch\n\t\trefresh,\n\t\tloadMore,\n\t\t// The query the list sends (search, sort, facet filters, fixed filters),\n\t\t// built from the current state, for an export that must follow the list.\n\t\tbuildParams,\n\t}\n}\n\n// ── Legacy implementation ─────────────────────────────────────────────────────\n\n/**\n * Legacy `useListView(options)` implementation.\n * Preserved verbatim for backward compatibility.\n *\n * @param {object} options Legacy options object\n * @param {string} [options.objectType] The registered object type slug\n * @param {(type: string, params: object) => Promise<Array<object>>} [options.fetchFn] Function to call: (type, params) => Promise<Array>\n * @param {number} [options.debounceMs] Search debounce in milliseconds\n * @param {number} [options.pageSize] Default page size\n * @param {object} [options.defaultSort] Default sort: { key: string, order: 'asc'|'desc' }\n * @return {object} Reactive state and methods\n */\nfunction useLegacyListView(options) {\n\tconst searchTerm = ref('')\n\tconst filters = ref({})\n\tconst sortKey = ref(options.defaultSort?.key || null)\n\tconst sortOrder = ref(options.defaultSort?.order || 'asc')\n\tconst currentPage = ref(1)\n\tconst pageSize = ref(options.pageSize || 20)\n\n\tlet searchTimeout = null\n\n\tfunction buildFetchParams() {\n\t\tconst params = {\n\t\t\t_limit: pageSize.value,\n\t\t\t_page: currentPage.value,\n\t\t}\n\n\t\tif (searchTerm.value) {\n\t\t\tparams._search = searchTerm.value\n\t\t}\n\n\t\tif (sortKey.value) {\n\t\t\tparams._order = { [sortKey.value]: sortOrder.value }\n\t\t}\n\n\t\tfor (const [key, value] of Object.entries(filters.value)) {\n\t\t\tif (value !== null && value !== '' && value !== false) {\n\t\t\t\tparams[key] = value\n\t\t\t}\n\t\t}\n\n\t\treturn params\n\t}\n\n\tasync function fetchData(page) {\n\t\tif (page !== undefined) {\n\t\t\tcurrentPage.value = page\n\t\t}\n\t\tconst params = buildFetchParams()\n\t\tif (options.fetchFn) {\n\t\t\treturn options.fetchFn(options.objectType, params)\n\t\t}\n\t}\n\n\tfunction onSearchInput(value) {\n\t\tsearchTerm.value = value\n\t\tclearTimeout(searchTimeout)\n\t\tsearchTimeout = setTimeout(() => fetchData(1), options.debounceMs || 300)\n\t}\n\n\tfunction toggleSort(key) {\n\t\tif (sortKey.value === key) {\n\t\t\tif (sortOrder.value === 'asc') {\n\t\t\t\tsortOrder.value = 'desc'\n\t\t\t} else {\n\t\t\t\tsortKey.value = null\n\t\t\t\tsortOrder.value = 'asc'\n\t\t\t}\n\t\t} else {\n\t\t\tsortKey.value = key\n\t\t\tsortOrder.value = 'asc'\n\t\t}\n\t\tfetchData(1)\n\t}\n\n\tfunction setFilter(key, value) {\n\t\tfilters.value = { ...filters.value, [key]: value }\n\t\tfetchData(1)\n\t}\n\n\tfunction clearAllFilters() {\n\t\tsearchTerm.value = ''\n\t\tfilters.value = {}\n\t\tsortKey.value = options.defaultSort?.key || null\n\t\tsortOrder.value = options.defaultSort?.order || 'asc'\n\t\tfetchData(1)\n\t}\n\n\tfunction goToPage(page) {\n\t\tcurrentPage.value = page\n\t\tfetchData()\n\t}\n\n\tonBeforeUnmount(() => clearTimeout(searchTimeout))\n\n\treturn {\n\t\tsearchTerm,\n\t\tfilters,\n\t\tsortKey,\n\t\tsortOrder,\n\t\tcurrentPage,\n\t\tpageSize,\n\t\tonSearchInput,\n\t\ttoggleSort,\n\t\tsetFilter,\n\t\tclearAllFilters,\n\t\tgoToPage,\n\t\tfetch: fetchData,\n\t\tbuildFetchParams,\n\t}\n}\n"],"names":[],"mappings":";;;;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G,GAAE;AACpB,EAAE,OAAO,CAAC,KAAK,GAAG,OAAO,CAAC,WAAW,EAAE,GAAG,IAAI,KAAI;AAClD,EAAE,SAAS,CAAC,KAAK,GAAG,OAAO,CAAC,WAAW,EAAE,KAAK,IAAI,MAAK;AACvD,EAAE,SAAS,CAAC,CAAC,EAAC;AACd,EAAE;AACF;AACA,CAAC,SAAS,QAAQ,CAAC,IAAI,EAAE;AACzB,EAAE,WAAW,CAAC,KAAK,GAAG,KAAI;AAC1B,EAAE,SAAS,GAAE;AACb,EAAE;AACF;AACA,CAAC,eAAe,CAAC,MAAM,YAAY,CAAC,aAAa,CAAC,EAAC;AACnD;AACA,CAAC,OAAO;AACR,EAAE,UAAU;AACZ,EAAE,OAAO;AACT,EAAE,OAAO;AACT,EAAE,SAAS;AACX,EAAE,WAAW;AACb,EAAE,QAAQ;AACV,EAAE,aAAa;AACf,EAAE,UAAU;AACZ,EAAE,SAAS;AACX,EAAE,eAAe;AACjB,EAAE,QAAQ;AACV,EAAE,KAAK,EAAE,SAAS;AAClB,EAAE,gBAAgB;AAClB,EAAE;AACF;;;;"}
1
+ {"version":3,"file":"useListView.js","sources":["../../../src/composables/useListView.js"],"sourcesContent":["import { computed, isRef, onBeforeUnmount, onMounted, ref, watch } from 'vue'\nimport { useObjectStore } from '../store/index.js'\nimport { facetFilterParams } from '../utils/facets.js'\n\n/**\n * Composable for managing list view state with full objectStore integration.\n *\n * When called with an `objectType` string, connects to the objectStore and handles\n * schema loading, collection fetching, sidebar wiring, and all event handlers\n * automatically. Everything a `CnIndexPage`-based list view needs is returned\n * directly — no additional computed properties or methods required in the component.\n *\n * Backward-compatible: existing `useListView(options)` and `useListView()` calls\n * continue to work without modification.\n *\n * @param {string|Function|object} [objectTypeOrOptions] Object type slug (new API), a getter or ref returning one (the list follows it when it changes), or a legacy options object\n * @param {object} [options] Options (new API only)\n * @param {object|null} [options.objectStore] Custom object store instance (from createObjectStore). When provided, uses this store instead of the default useObjectStore(). Required when the app uses createObjectStore with a custom store ID.\n * @param {object|null} [options.sidebarState] Sidebar state object from `inject('sidebarState')`. When provided, the composable wires and unwires the sidebar automatically on mount/unmount.\n * @param {number} [options.defaultPageSize] Default `_limit` sent to the API\n * @param {number} [options.debounceMs] Search debounce in milliseconds\n * @param {object} [options.defaultSort] Default sort applied on mount e.g. `{ key: 'createdAt', order: 'desc' }`\n * @param {Array<{key: string, order: 'asc'|'desc'}>} [options.defaultSortKeys] Default MULTI-column sort applied on mount (ordered priority list). Takes precedence over `defaultSort` when both are given; used e.g. to restore a sort persisted in the route query.\n * @param {Array<string>|null} [options.defaultVisibleColumns] Initial visible-column key set. Seeds the sidebar's Columns tab with the curated default (e.g. a manifest `columns` list) so toggles add/remove from it. Omit (or `null`) for schema-driven tables where every column starts visible.\n * @param {object} [options.defaultActiveFilters] Initial facet-filter map, e.g. to restore filters persisted in the route query on mount.\n * @param {string} [options.defaultSearchTerm] Initial search term, e.g. to restore `_search` from the route query on mount.\n * @param {object|(() => object)} [options.fixedFilters] A filter map (or getter returning one) merged into every fetch AFTER the user's facet filters, so the fixed entries always win. Used e.g. by `CnIndexPage` to apply a route-param-scoped `pages[].config.filter`. Default `{}` — omitting it is behaviourally identical to before.\n * @param {Array<string>|(() => Array<string>)} [options.extend] OpenRegister `_extend[]` values (or a getter returning them) forwarded on every fetch, e.g. `['calculations']` so a schema's `materialise: false` calculations are evaluated and can be shown as columns. Default `[]` — omitting it sends no `_extend` at all, exactly as before.\n * @return {object} Reactive state and event handlers\n *\n * @example\n * // New API — minimal\n * const { schema, objects, loading, pagination,\n * onSearch, onSort, onFilterChange, onPageChange, refresh } = useListView('client')\n *\n * @example\n * // New API — with sidebar wiring\n * const list = useListView('client', {\n * sidebarState: inject('sidebarState', null),\n * })\n *\n * @example\n * // Legacy API — still works\n * const { searchTerm, filters, onSearchInput, toggleSort } = useListView({\n * objectType: 'client',\n * fetchFn: (type, params) => objectStore.fetchCollection(type, params),\n * })\n */\nexport function useListView(objectTypeOrOptions, options) {\n\t// Backward compat: if first arg is an object or absent, delegate to legacy implementation\n\tif (!objectTypeOrOptions || (typeof objectTypeOrOptions === 'object' && !isRef(objectTypeOrOptions))) {\n\t\treturn useLegacyListView(objectTypeOrOptions || {})\n\t}\n\n\t// ── New API ──────────────────────────────────────────────────────────\n\t// A string, a ref or a getter: a getter lets the page switch object type\n\t// (a folder carrying its own schema) without re-creating the list.\n\tconst typeSource = objectTypeOrOptions\n\tconst isDynamicType = typeof typeSource !== 'string'\n\tconst getType = () => (isRef(typeSource) ? typeSource.value : (typeof typeSource === 'function' ? typeSource() : typeSource))\n\tconst opts = options || {}\n\tconst sidebarState = opts.sidebarState || null\n\n\tconst objectStore = opts.objectStore || useObjectStore()\n\n\t// ── State refs ───────────────────────────────────────────────────────\n\tconst schema = ref(null)\n\tconst searchTerm = ref(opts.defaultSearchTerm || '')\n\t// `sortKeys` is the source of truth (ordered multi-column priority list);\n\t// `sortKey`/`sortOrder` are kept as a primary-entry mirror so every\n\t// existing reader of the pre-multi-sort refs keeps working unchanged.\n\tconst initialSortKeys = Array.isArray(opts.defaultSortKeys) && opts.defaultSortKeys.length > 0\n\t\t? opts.defaultSortKeys\n\t\t: (opts.defaultSort?.key ? [{ key: opts.defaultSort.key, order: opts.defaultSort.order || 'asc' }] : [])\n\tconst sortKeys = ref(initialSortKeys)\n\tconst sortKey = ref(initialSortKeys[0]?.key || null)\n\tconst sortOrder = ref(initialSortKeys[0]?.order || 'asc')\n\tconst activeFilters = ref((opts.defaultActiveFilters && typeof opts.defaultActiveFilters === 'object') ? opts.defaultActiveFilters : {})\n\t// Seed the visible-column set to the configured columns so the sidebar's\n\t// Columns tab reflects the curated default and toggles add/remove from it.\n\t// `null` (no seed) means \"all columns visible\" (schema-driven tables).\n\tconst visibleColumns = ref(opts.defaultVisibleColumns ?? null)\n\tconst pageSize = ref(opts.defaultPageSize || 20)\n\n\t// ── Computed refs from the store ─────────────────────────────────────\n\tconst objects = computed(() => objectStore.collections[getType()] || [])\n\t// True from creation until the mount sequence below has issued its first\n\t// fetch. The store's own flag only goes up once `fetchCollection` runs, and\n\t// `onMounted` awaits `fetchSchema()` first — so for the length of that round\n\t// trip the list was \"not loading\" with zero rows, and every consumer\n\t// rendered its empty state (\"No log entries to show\") before any data had\n\t// been asked for. Folded into `loading` rather than exposed separately so\n\t// existing consumers get the fix without touching their templates.\n\tconst bootstrapping = ref(true)\n\tconst loading = computed(() => bootstrapping.value || objectStore.loading[getType()] || false)\n\tconst pagination = computed(() => objectStore.pagination[getType()] || { total: 0, page: 1, pages: 1, limit: 20 })\n\t// Facets are computed by the platform over the whole query rather than the\n\t// loaded page, so anything that needs the complete set of values for a\n\t// field (a folder pane grouping by it, say) reads them here rather than\n\t// deriving them from `objects`, which is only the current page.\n\tconst facets = computed(() => objectStore.facets[getType()] || {})\n\t// Personal-lens reports of the latest response (`{ recent: { available, reason } }`).\n\t// @spec openspec/changes/lens-says-why-it-is-empty/specs/personal-lens-availability/spec.md#requirement-a-list-response-carries-the-report-of-the-lenses-it-was-asked-for\n\tconst lenses = computed(() => (objectStore.lenses && objectStore.lenses[getType()]) || {})\n\t// Outcome of the latest `refresh()`: the store's error for it, or null once\n\t// it succeeded or a later fetch stored new rows. The store keeps the previous\n\t// rows on a failed fetch, so this is how a consumer tells stale rows from\n\t// current ones.\n\tconst error = ref(null)\n\tlet refreshSeq = 0\n\t// The mount's schema request, and whether it is still in flight.\n\tlet schemaLoading = null\n\tlet schemaPending = false\n\tlet pendingRefreshes = 0\n\n\tlet searchTimeout = null\n\n\t// ── Param construction ───────────────────────────────────────────────\n\n\t/**\n\t * Resolve `opts.fixedFilters` to a plain map. Accepts a plain object OR a\n\t * function/getter returning one (so callers can derive it from reactive\n\t * sources — e.g. route params — and have it re-read on every fetch).\n\t *\n\t * @return {object} The fixed-filter map (may be empty).\n\t */\n\tfunction resolveFixedFilters() {\n\t\tconst f = typeof opts.fixedFilters === 'function' ? opts.fixedFilters() : opts.fixedFilters\n\t\treturn (f && typeof f === 'object') ? f : {}\n\t}\n\n\t/**\n\t * Resolve `opts.extend` to a list of non-empty strings.\n\t *\n\t * Accepts an array or a getter returning one, so a caller can re-scope it\n\t * between fetches the way `fixedFilters` allows.\n\t *\n\t * @return {Array<string>} The `_extend[]` values, possibly empty.\n\t */\n\tfunction resolveExtend() {\n\t\tconst e = typeof opts.extend === 'function' ? opts.extend() : opts.extend\n\t\tif (!Array.isArray(e)) {\n\t\t\treturn []\n\t\t}\n\t\treturn e.filter((v) => typeof v === 'string' && v !== '')\n\t}\n\n\t/**\n\t * Build API fetch params from current reactive state.\n\t *\n\t * @param {number} page Page number to request\n\t * @return {object} Params object ready to pass to fetchCollection\n\t */\n\tfunction buildParams(page) {\n\t\tconst params = { _limit: pageSize.value, _page: page }\n\n\t\tif (searchTerm.value) {\n\t\t\tparams._search = searchTerm.value\n\t\t}\n\n\t\tif (sortKeys.value.length > 0) {\n\t\t\t// Object key insertion order = sort priority order, matching\n\t\t\t// OpenRegister's `_order` format exactly (`ObjectsController::\n\t\t\t// normalizeOrderParameter` / `MagicMapper`'s ordering loop). A\n\t\t\t// single active key produces byte-identical output to before.\n\t\t\tparams._order = Object.fromEntries(sortKeys.value.map((k) => [k.key, k.order]))\n\t\t}\n\n\t\tfor (const [key, values] of Object.entries(activeFilters.value)) {\n\t\t\t// Single-value arrays are unwrapped to scalar params; the\n\t\t\t// missing-value option becomes `<key>_isnull=true`.\n\t\t\tObject.assign(params, facetFilterParams(key, values))\n\t\t}\n\n\t\t// Fixed filters (e.g. a route-param-scoped `pages[].config.filter`) are\n\t\t// merged LAST so they always win over a colliding facet `activeFilter`.\n\t\t// Repeated `_extend[]`, serialized by the shared query builder. Set\n\t\t// before the fixed filters so an explicit `_extend` in a filter map\n\t\t// still wins, matching every other key's precedence here.\n\t\tconst extend = resolveExtend()\n\t\tif (extend.length > 0) {\n\t\t\tparams._extend = extend\n\t\t}\n\n\t\tfor (const [key, value] of Object.entries(resolveFixedFilters())) {\n\t\t\tif (value !== undefined && value !== null && value !== '') {\n\t\t\t\tparams[key] = value\n\t\t\t}\n\t\t}\n\n\t\treturn params\n\t}\n\n\t// ── Fetch ────────────────────────────────────────────────────────────\n\n\t/**\n\t * Fetch the collection using current state params and update sidebar facet data.\n\t * Only the most recently started refresh sets `error`, so an older response\n\t * settling late cannot override a newer one's outcome.\n\t *\n\t * @param {number} [page] Page to fetch\n\t * @return {Promise<void>}\n\t * @spec openspec/changes/list-waits-for-its-schema/specs/list-waits-for-its-schema/spec.md#requirement-a-list-fetch-waits-for-the-schema-the-mount-is-loading\n\t */\n\tasync function refresh(page = 1) {\n\t\t// The store asks for facets only once it holds the schema, so a refresh\n\t\t// that starts while the mount is still loading it (a watcher applying\n\t\t// default filters, say) waits for it.\n\t\tif (schemaPending) {\n\t\t\tawait schemaLoading.catch(() => null)\n\t\t}\n\t\tconst seq = ++refreshSeq\n\t\t// This call's own result. `errors[getType()]` is shared by every call\n\t\t// for the type and is not cleared on success, so it cannot say which\n\t\t// request failed; it is only the fallback for a store that ignores\n\t\t// `options.outcome`.\n\t\tconst outcome = {}\n\t\tpendingRefreshes++\n\t\ttry {\n\t\t\tawait objectStore.fetchCollection(getType(), buildParams(page), { outcome })\n\t\t} catch (e) {\n\t\t\tif (seq === refreshSeq) {\n\t\t\t\terror.value = e\n\t\t\t}\n\t\t\tthrow e\n\t\t} finally {\n\t\t\tpendingRefreshes--\n\t\t}\n\t\tif (seq === refreshSeq) {\n\t\t\terror.value = ('error' in outcome) ? outcome.error : (objectStore.errors?.[getType()] || null)\n\t\t}\n\t}\n\n\t// A fetch outside `refresh()` (e.g. the live-updates refetch) that stores\n\t// new rows recovers the list from an earlier failure. Rows written while\n\t// a refresh is pending are left to that refresh, which decides `error`.\n\twatch(\n\t\t() => objectStore.collections[getType()],\n\t\t() => {\n\t\t\tif (pendingRefreshes === 0) {\n\t\t\t\terror.value = null\n\t\t\t}\n\t\t},\n\t\t{ flush: 'sync' },\n\t)\n\n\t// ── Event handlers ───────────────────────────────────────────────────\n\n\t/**\n\t * Handle search input. Debounced by `options.debounceMs` (default 300 ms).\n\t *\n\t * @param {string} value New search string\n\t */\n\tfunction onSearch(value) {\n\t\tsearchTerm.value = value\n\t\tclearTimeout(searchTimeout)\n\t\tsearchTimeout = setTimeout(() => refresh(1), opts.debounceMs || 300)\n\t}\n\n\t/**\n\t * Handle sort change. Updates sort state and triggers refresh.\n\t *\n\t * Accepts CnDataTable's extended `sort` event payload: `keys` (the full\n\t * ordered multi-column list) is used when present; a legacy caller\n\t * passing only `{ key, order }` (no `keys`) still works exactly as\n\t * before — it's normalised to a single-entry `sortKeys` list.\n\t *\n\t * @param {{key: string|null, order: string|null, keys?: Array<{key: string, order: string}>}} sort New sort definition.\n\t */\n\tfunction onSort({ key, order, keys }) {\n\t\tconst nextKeys = Array.isArray(keys) ? keys : (key ? [{ key, order: order || 'asc' }] : [])\n\t\tsortKeys.value = nextKeys\n\t\tsortKey.value = nextKeys[0]?.key ?? null\n\t\tsortOrder.value = nextKeys[0]?.order ?? 'asc'\n\t\trefresh(1)\n\t}\n\n\t/**\n\t * Handle filter change for a single key. Empty arrays remove the key.\n\t *\n\t * @param {string} key Filter key (maps to API param name)\n\t * @param {Array} values Selected filter values\n\t */\n\tfunction onFilterChange(key, values) {\n\t\tif (!values || values.length === 0) {\n\t\t\tconst updated = { ...activeFilters.value }\n\t\t\tdelete updated[key]\n\t\t\tactiveFilters.value = updated\n\t\t} else {\n\t\t\tactiveFilters.value = { ...activeFilters.value, [key]: values }\n\t\t}\n\t\trefresh(1)\n\t}\n\n\t/**\n\t * Handle page navigation.\n\t *\n\t * @param {number} page Page number to navigate to\n\t */\n\tfunction onPageChange(page) {\n\t\trefresh(page)\n\t}\n\n\t/**\n\t * Add the next page after the rows already loaded, for a view that shows\n\t * every row at once (the board). Does nothing on the last page. A refresh\n\t * started while the page is in flight drops it.\n\t *\n\t * @return {Promise<void>}\n\t */\n\tasync function loadMore() {\n\t\tconst current = pagination.value\n\t\tconst next = Number(current.page || 1) + 1\n\t\tif (next > Number(current.pages || 1)) {\n\t\t\treturn\n\t\t}\n\t\tconst seq = refreshSeq\n\t\tawait objectStore.fetchCollection(getType(), buildParams(next), {\n\t\t\tappend: true,\n\t\t\tisCurrent: () => seq === refreshSeq,\n\t\t})\n\t}\n\n\t/**\n\t * Handle page-size change. Resets to page 1.\n\t *\n\t * @param {number} size New page size\n\t */\n\tfunction onPageSizeChange(size) {\n\t\tpageSize.value = size\n\t\trefresh(1)\n\t}\n\n\t// ── Sidebar wiring ───────────────────────────────────────────────────\n\n\tfunction setupSidebar() {\n\t\tif (!sidebarState) {\n\t\t\treturn\n\t\t}\n\t\tsidebarState.active = true\n\t\tsidebarState.schema = schema.value\n\t\tsidebarState.searchValue = searchTerm.value\n\t\tsidebarState.activeFilters = {}\n\t\tsidebarState.onSearch = onSearch\n\t\tsidebarState.onColumnsChange = (cols) => {\n\t\t\tvisibleColumns.value = cols\n\t\t}\n\t\tsidebarState.onFilterChange = ({ key, values }) => onFilterChange(key, values)\n\t}\n\n\tfunction teardownSidebar() {\n\t\tif (!sidebarState) {\n\t\t\treturn\n\t\t}\n\t\tsidebarState.active = false\n\t\tsidebarState.schema = null\n\t\tsidebarState.activeFilters = {}\n\t\tsidebarState.facetData = {}\n\t\tsidebarState.onSearch = null\n\t\tsidebarState.onColumnsChange = null\n\t\tsidebarState.onFilterChange = null\n\t}\n\n\t// Push facet data to sidebar after each store update\n\tif (sidebarState) {\n\t\twatch(\n\t\t\t() => objectStore.facets[getType()],\n\t\t\t(facets) => {\n\t\t\t\tsidebarState.facetData = facets || {}\n\t\t\t},\n\t\t)\n\t}\n\n\t// A dynamic object type that changes starts that type's list from page 1\n\t// with its own schema.\n\tif (isDynamicType) {\n\t\twatch(getType, async (next, prev) => {\n\t\t\tif (!next || next === prev) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tschema.value = null\n\t\t\tschema.value = await objectStore.fetchSchema(next)\n\t\t\tawait refresh(1)\n\t\t})\n\t}\n\n\t// ── Lifecycle ────────────────────────────────────────────────────────\n\n\tonMounted(async () => {\n\t\ttry {\n\t\t\tschemaPending = true\n\t\t\tschemaLoading = Promise.resolve(objectStore.fetchSchema(getType()))\n\t\t\ttry {\n\t\t\t\tschema.value = await schemaLoading\n\t\t\t} finally {\n\t\t\t\tschemaPending = false\n\t\t\t}\n\t\t\tif (sidebarState) {\n\t\t\t\tsetupSidebar()\n\t\t\t}\n\t\t\tawait refresh(1)\n\t\t} finally {\n\t\t\t// Hand the loading state back to the store either way: a schema\n\t\t\t// fetch that rejects must not leave the list spinning forever.\n\t\t\tbootstrapping.value = false\n\t\t}\n\t})\n\n\tonBeforeUnmount(() => {\n\t\tclearTimeout(searchTimeout)\n\t\tteardownSidebar()\n\t})\n\n\t// ── Return value ─────────────────────────────────────────────────────\n\n\treturn {\n\t\t// Store-derived\n\t\tschema,\n\t\tobjects,\n\t\tloading,\n\t\tpagination,\n\t\tfacets,\n\t\tlenses,\n\t\terror,\n\t\t// Local state\n\t\tsearchTerm,\n\t\tsortKey,\n\t\tsortOrder,\n\t\tsortKeys,\n\t\tactiveFilters,\n\t\tvisibleColumns,\n\t\tpageSize,\n\t\t// Event handlers\n\t\tonSearch,\n\t\tonSort,\n\t\tonFilterChange,\n\t\tonPageChange,\n\t\tonPageSizeChange,\n\t\t// Explicit fetch\n\t\trefresh,\n\t\tloadMore,\n\t\t// The query the list sends (search, sort, facet filters, fixed filters),\n\t\t// built from the current state, for an export that must follow the list.\n\t\tbuildParams,\n\t}\n}\n\n// ── Legacy implementation ─────────────────────────────────────────────────────\n\n/**\n * Legacy `useListView(options)` implementation.\n * Preserved verbatim for backward compatibility.\n *\n * @param {object} options Legacy options object\n * @param {string} [options.objectType] The registered object type slug\n * @param {(type: string, params: object) => Promise<Array<object>>} [options.fetchFn] Function to call: (type, params) => Promise<Array>\n * @param {number} [options.debounceMs] Search debounce in milliseconds\n * @param {number} [options.pageSize] Default page size\n * @param {object} [options.defaultSort] Default sort: { key: string, order: 'asc'|'desc' }\n * @return {object} Reactive state and methods\n */\nfunction useLegacyListView(options) {\n\tconst searchTerm = ref('')\n\tconst filters = ref({})\n\tconst sortKey = ref(options.defaultSort?.key || null)\n\tconst sortOrder = ref(options.defaultSort?.order || 'asc')\n\tconst currentPage = ref(1)\n\tconst pageSize = ref(options.pageSize || 20)\n\n\tlet searchTimeout = null\n\n\tfunction buildFetchParams() {\n\t\tconst params = {\n\t\t\t_limit: pageSize.value,\n\t\t\t_page: currentPage.value,\n\t\t}\n\n\t\tif (searchTerm.value) {\n\t\t\tparams._search = searchTerm.value\n\t\t}\n\n\t\tif (sortKey.value) {\n\t\t\tparams._order = { [sortKey.value]: sortOrder.value }\n\t\t}\n\n\t\tfor (const [key, value] of Object.entries(filters.value)) {\n\t\t\tif (value !== null && value !== '' && value !== false) {\n\t\t\t\tparams[key] = value\n\t\t\t}\n\t\t}\n\n\t\treturn params\n\t}\n\n\tasync function fetchData(page) {\n\t\tif (page !== undefined) {\n\t\t\tcurrentPage.value = page\n\t\t}\n\t\tconst params = buildFetchParams()\n\t\tif (options.fetchFn) {\n\t\t\treturn options.fetchFn(options.objectType, params)\n\t\t}\n\t}\n\n\tfunction onSearchInput(value) {\n\t\tsearchTerm.value = value\n\t\tclearTimeout(searchTimeout)\n\t\tsearchTimeout = setTimeout(() => fetchData(1), options.debounceMs || 300)\n\t}\n\n\tfunction toggleSort(key) {\n\t\tif (sortKey.value === key) {\n\t\t\tif (sortOrder.value === 'asc') {\n\t\t\t\tsortOrder.value = 'desc'\n\t\t\t} else {\n\t\t\t\tsortKey.value = null\n\t\t\t\tsortOrder.value = 'asc'\n\t\t\t}\n\t\t} else {\n\t\t\tsortKey.value = key\n\t\t\tsortOrder.value = 'asc'\n\t\t}\n\t\tfetchData(1)\n\t}\n\n\tfunction setFilter(key, value) {\n\t\tfilters.value = { ...filters.value, [key]: value }\n\t\tfetchData(1)\n\t}\n\n\tfunction clearAllFilters() {\n\t\tsearchTerm.value = ''\n\t\tfilters.value = {}\n\t\tsortKey.value = options.defaultSort?.key || null\n\t\tsortOrder.value = options.defaultSort?.order || 'asc'\n\t\tfetchData(1)\n\t}\n\n\tfunction goToPage(page) {\n\t\tcurrentPage.value = page\n\t\tfetchData()\n\t}\n\n\tonBeforeUnmount(() => clearTimeout(searchTimeout))\n\n\treturn {\n\t\tsearchTerm,\n\t\tfilters,\n\t\tsortKey,\n\t\tsortOrder,\n\t\tcurrentPage,\n\t\tpageSize,\n\t\tonSearchInput,\n\t\ttoggleSort,\n\t\tsetFilter,\n\t\tclearAllFilters,\n\t\tgoToPage,\n\t\tfetch: fetchData,\n\t\tbuildFetchParams,\n\t}\n}\n"],"names":[],"mappings":";;;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,WAAW,CAAC,mBAAmB,EAAE,OAAO,EAAE;AAC1D;AACA,CAAC,IAAI,CAAC,mBAAmB,KAAK,OAAO,mBAAmB,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC,EAAE;AACvG,EAAE,OAAO,iBAAiB,CAAC,mBAAmB,IAAI,EAAE,CAAC;AACrD,EAAE;AACF;AACA;AACA;AACA;AACA,CAAC,MAAM,UAAU,GAAG,oBAAmB;AACvC,CAAC,MAAM,aAAa,GAAG,OAAO,UAAU,KAAK,SAAQ;AACrD,CAAC,MAAM,OAAO,GAAG,OAAO,KAAK,CAAC,UAAU,CAAC,GAAG,UAAU,CAAC,KAAK,IAAI,OAAO,UAAU,KAAK,UAAU,GAAG,UAAU,EAAE,GAAG,UAAU,CAAC,EAAC;AAC9H,CAAC,MAAM,IAAI,GAAG,OAAO,IAAI,GAAE;AAC3B,CAAC,MAAM,YAAY,GAAG,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