@conduction/nextcloud-vue 2.129.0 → 2.130.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/dist/esm/components/CnActionsBar/CnActionsBar.vue2.js +23 -1
  2. package/dist/esm/components/CnActionsBar/CnActionsBar.vue2.js.map +1 -1
  3. package/dist/esm/components/CnActionsBar/CnActionsBar.vue3.js +87 -4
  4. package/dist/esm/components/CnActionsBar/CnActionsBar.vue3.js.map +1 -1
  5. package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHost.vue.js +1 -1
  6. package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHost.vue2.js +29 -3
  7. package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHost.vue2.js.map +1 -1
  8. package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHost.vue3.js +68 -14
  9. package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHost.vue3.js.map +1 -1
  10. package/dist/esm/components/CnEventsCard/CnEventsCard.vue.js +1 -1
  11. package/dist/esm/components/CnEventsCard/CnEventsCard.vue2.js +16 -5
  12. package/dist/esm/components/CnEventsCard/CnEventsCard.vue2.js.map +1 -1
  13. package/dist/esm/components/CnEventsCard/CnEventsCard.vue3.js.map +1 -1
  14. package/dist/esm/components/CnFilesCard/CnFilesCard.vue.js +1 -1
  15. package/dist/esm/components/CnFilesCard/CnFilesCard.vue2.js.map +1 -1
  16. package/dist/esm/components/CnFilesCard/CnFilesCard.vue3.js +11 -2
  17. package/dist/esm/components/CnFilesCard/CnFilesCard.vue3.js.map +1 -1
  18. package/dist/esm/components/CnIcon/semanticIcons.js +2 -0
  19. package/dist/esm/components/CnIcon/semanticIcons.js.map +1 -1
  20. package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js +32 -2
  21. package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js.map +1 -1
  22. package/dist/esm/components/CnIndexPage/CnIndexPage.vue3.js +3 -1
  23. package/dist/esm/components/CnIndexPage/CnIndexPage.vue3.js.map +1 -1
  24. package/dist/esm/components/CnObjectListWidget/CnObjectListWidget.vue.js +1 -1
  25. package/dist/esm/components/CnObjectListWidget/CnObjectListWidget.vue2.js.map +1 -1
  26. package/dist/esm/components/CnObjectListWidget/CnObjectListWidget.vue3.js +4 -1
  27. package/dist/esm/components/CnObjectListWidget/CnObjectListWidget.vue3.js.map +1 -1
  28. package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue.js +1 -1
  29. package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue2.js +62 -2
  30. package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue2.js.map +1 -1
  31. package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue3.js +515 -356
  32. package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue3.js.map +1 -1
  33. package/dist/esm/integrations/builtin/calendar/CnCalendarCard.vue.js +1 -1
  34. package/dist/esm/integrations/builtin/calendar/CnCalendarCard.vue2.js +6 -1
  35. package/dist/esm/integrations/builtin/calendar/CnCalendarCard.vue2.js.map +1 -1
  36. package/dist/esm/integrations/builtin/calendar/CnCalendarCard.vue3.js +17 -9
  37. package/dist/esm/integrations/builtin/calendar/CnCalendarCard.vue3.js.map +1 -1
  38. package/dist/esm/library-style.js +1 -1
  39. package/dist/esm/nextcloud-vue.css +323 -165
  40. package/dist/esm/utils/boardReferenceColumns.js +38 -1
  41. package/dist/esm/utils/boardReferenceColumns.js.map +1 -1
  42. package/dist/esm/utils/validateManifestV2.compiled.js +3 -3
  43. package/dist/esm/utils/validateManifestV2.compiled.js.map +1 -1
  44. package/dist/nextcloud-vue.cjs.js +989 -479
  45. package/dist/nextcloud-vue.cjs.js.map +2 -2
  46. package/dist/nextcloud-vue.css +323 -165
  47. package/package.json +1 -1
  48. package/src/components/CnActionsBar/CnActionsBar.vue +67 -3
  49. package/src/components/CnDetailWidgetHost/CnDetailWidgetHost.vue +59 -8
  50. package/src/components/CnEventsCard/CnEventsCard.vue +16 -5
  51. package/src/components/CnFilesCard/CnFilesCard.vue +7 -0
  52. package/src/components/CnIcon/semanticIcons.js +2 -0
  53. package/src/components/CnIndexPage/CnIndexPage.vue +34 -1
  54. package/src/components/CnObjectListWidget/CnObjectListWidget.vue +1 -1
  55. package/src/components/CnRecordListWidget/CnRecordListWidget.vue +186 -8
  56. package/src/css/look-board-detail.css +27 -2
  57. package/src/css/look-board-index.css +50 -2
  58. package/src/css/look-board.css +52 -2
  59. package/src/integrations/builtin/calendar/CnCalendarCard.vue +12 -3
  60. package/src/integrations/builtin/calendar/__tests__/CnCalendarCardHeaderActions.spec.js +12 -1
  61. package/src/schemas/app-manifest-v2.schema.json +27 -3
  62. package/src/utils/boardReferenceColumns.js +37 -0
  63. package/src/utils/validateManifestV2.compiled.js +3 -3
@@ -93,6 +93,43 @@ function columnFieldsOf(board) {
93
93
  moveTargetsHandler: typeof entry.moveTargetsHandler === 'string' ? entry.moveTargetsHandler : '',
94
94
  valueLabels: entry.valueLabels && typeof entry.valueLabels === 'object' ? entry.valueLabels : null,
95
95
  emptyLabel: typeof entry.emptyLabel === 'string' ? entry.emptyLabel : '',
96
+ states: Array.isArray(entry.states) ? entry.states : null,
97
+ }))
98
+ }
99
+
100
+ /**
101
+ * The columns a page declares for a column field (`states`), normalised to
102
+ * the `{ key, label, hidden, closed, color? }` entries `stagesOf()` reads.
103
+ * The active column field's own `states` win; on the board's `statusField`
104
+ * `board.states` applies. A referenced or values column has no declared
105
+ * states: its columns are rows or values.
106
+ *
107
+ * @param {object} board The board configuration (manifest `config.board`).
108
+ * @param {object|null} active The active column field from `columnFieldsOf`, or null.
109
+ * @param {string} field The field the columns come from.
110
+ * @return {Array<{key: string, label: string, hidden: boolean, closed: boolean, color?: string}>|null} The states, or null when none are declared.
111
+ * @spec openspec/changes/board-declared-states/specs/board-view/spec.md#requirement-a-board-can-declare-the-states-its-columns-come-from
112
+ */
113
+ function declaredStatesOf(board, active, field) {
114
+ if (active && active.kind !== 'schema') {
115
+ return null
116
+ }
117
+ let declared = active && Array.isArray(active.states) ? active.states : null;
118
+ if (declared === null && field !== '' && field === board?.statusField && Array.isArray(board?.states)) {
119
+ declared = board.states;
120
+ }
121
+ if (declared === null || declared.length === 0) {
122
+ return null
123
+ }
124
+ return declared
125
+ .map((entry) => (typeof entry === 'string' ? { key: entry } : entry))
126
+ .filter((entry) => entry && typeof entry === 'object' && String(entry.key ?? '') !== '')
127
+ .map((entry) => ({
128
+ key: String(entry.key),
129
+ label: typeof entry.label === 'string' && entry.label !== '' ? entry.label : String(entry.key),
130
+ hidden: entry.hidden === true,
131
+ closed: entry.closed === true,
132
+ ...(typeof entry.color === 'string' && entry.color !== '' ? { color: entry.color } : {}),
96
133
  }))
97
134
  }
98
135
 
@@ -423,5 +460,5 @@ async function fetchReferenceObjects({ register, schema, filter = {}, limit = 50
423
460
  return Array.isArray(data?.results) ? data.results : (Array.isArray(data) ? data : [])
424
461
  }
425
462
 
426
- export { NO_VALUE_KEY, buildReferenceStages, buildValueStages, capacityOfRef, columnFieldsOf, columnKeyOfRow, fetchReferenceObjects, flattenItemRefs, fullTargetOf, mappedColor, mergedColumnColor, refIdOf, referenceTargetOf, resolveDropValue };
463
+ export { NO_VALUE_KEY, buildReferenceStages, buildValueStages, capacityOfRef, columnFieldsOf, columnKeyOfRow, declaredStatesOf, fetchReferenceObjects, flattenItemRefs, fullTargetOf, mappedColor, mergedColumnColor, refIdOf, referenceTargetOf, resolveDropValue };
427
464
  //# sourceMappingURL=boardReferenceColumns.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"boardReferenceColumns.js","sources":["../../../src/utils/boardReferenceColumns.js"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2026 Conduction B.V. <info@conduction.nl>\n * SPDX-License-Identifier: EUPL-1.2\n *\n * Board columns from a REFERENCED field (screens-board-reference-columns).\n *\n * A status that is an enum or a lifecycle list carries its stages on the\n * field, and `boardColumns.js` reads them there. A status that is a reference\n * to another object (a case's `status` pointing at a statusType row) carries\n * nothing on the field: the stages are the rows of the referenced schema. This\n * module turns those rows into the same `states` list `stagesOf()` reads, plus\n * the map from a row's raw value (the referenced id) to its column.\n *\n * 🔴 THE COLUMNS ARE STILL THE SCHEMA'S, NOT THE DATA'S. They are the\n * referenced rows, fetched, not the values present on the loaded cards, so an\n * empty stage is still a column to drop a card into. The one exception is a\n * field with no referenced schema at all (a Nextcloud user id): there the\n * values present are all there is, and a \"nobody\" column is always added so\n * work without an owner stays visible and can be dropped back to nobody.\n *\n * 🔴 MERGED COLUMNS RESOLVE PER CARD. Referenced rows are often per parent\n * (every case type has its own \"In behandeling\"). Merged by name they make one\n * column, and a drop must then write the row of THAT card's parent. A column\n * with no row for the card's parent is not a place the card can go, and the\n * drop is refused rather than written to some other parent's row.\n *\n * Pure apart from `fetchReferenceObjects`: no store, no Vue.\n */\n\nimport { capacityValue } from './boardColumns.js'\nimport { buildHeaders, buildQueryString, prefixUrl } from './headers.js'\nimport { readPath } from './readPath.js'\nimport { schemaRefSlug } from './schemaRefSlug.js'\n\n/** The column of cards with no value, for a `values` column field. */\nexport const NO_VALUE_KEY = '__none__'\n\n/**\n * The id a reference value carries: a string as is, an object by its `id`,\n * `uuid` or `@self.id`.\n *\n * @param {unknown} value A reference as a row holds it.\n * @return {string} The id, '' when there is none.\n */\nexport function refIdOf(value) {\n\tif (value === null || value === undefined) {\n\t\treturn ''\n\t}\n\tif (typeof value === 'object') {\n\t\tconst id = value.id ?? value.uuid ?? value['@self']?.id ?? value.value ?? ''\n\t\treturn id === null || id === undefined ? '' : String(id)\n\t}\n\treturn String(value)\n}\n\n/**\n * A value as text: a string or number as is, an object by its name.\n *\n * @param {unknown} value The raw value.\n * @return {string} The text.\n */\nfunction textOf(value) {\n\tif (value === null || value === undefined) {\n\t\treturn ''\n\t}\n\tif (typeof value === 'object') {\n\t\treturn String(value.displayName ?? value.name ?? value.title ?? value.label ?? '').trim()\n\t}\n\treturn String(value).trim()\n}\n\n/**\n * The column fields a board offers, normalised. Without `columnFields` the\n * board has one, its `statusField`, read from the schema as before.\n *\n * @param {object} board The board configuration (manifest `config.board`).\n * @return {Array<{field: string, label: string, source: (object|null), kind: string, readOnly: boolean, moveHandler: string, moveTargetsHandler: string}>} The fields.\n * @spec openspec/changes/screens-board-reference-columns/specs/board-view/spec.md#requirement-a-board-can-switch-the-field-its-columns-come-from\n */\nexport function columnFieldsOf(board) {\n\tconst declared = Array.isArray(board?.columnFields) ? board.columnFields : []\n\treturn declared\n\t\t.map((entry) => (typeof entry === 'string' ? { field: entry } : entry))\n\t\t.filter((entry) => entry && typeof entry.field === 'string' && entry.field !== '')\n\t\t.map((entry) => ({\n\t\t\tfield: entry.field,\n\t\t\tlabel: typeof entry.label === 'string' && entry.label !== '' ? entry.label : entry.field,\n\t\t\tsource: entry.source && typeof entry.source === 'object' ? entry.source : null,\n\t\t\tkind: entry.kind === 'values' ? 'values' : (entry.source ? 'reference' : 'schema'),\n\t\t\treadOnly: entry.readOnly === true,\n\t\t\tmoveHandler: typeof entry.moveHandler === 'string' ? entry.moveHandler : '',\n\t\t\tmoveTargetsHandler: typeof entry.moveTargetsHandler === 'string' ? entry.moveTargetsHandler : '',\n\t\t\tvalueLabels: entry.valueLabels && typeof entry.valueLabels === 'object' ? entry.valueLabels : null,\n\t\t\temptyLabel: typeof entry.emptyLabel === 'string' ? entry.emptyLabel : '',\n\t\t}))\n}\n\n/**\n * The register and schema a reference column reads its rows from: the\n * source's own, else the page's register and the property's `$ref`.\n *\n * @param {object} source The column field's `source`.\n * @param {object} options The context.\n * @param {string} options.register The page's register.\n * @param {object} [options.property] The field's schema property.\n * @return {{register: string, schema: string}} Both, '' when unknown.\n */\nexport function referenceTargetOf(source, { register = '', property = null } = {}) {\n\tconst schema = source?.schema || schemaRefSlug(property?.$ref ?? property?.items?.$ref ?? '')\n\treturn {\n\t\tregister: String(source?.register || register || ''),\n\t\tschema: schema === '' || schema === null || schema === undefined ? '' : String(schema),\n\t}\n}\n\n/**\n * The stages of a referenced field: the referenced rows, narrowed to one\n * parent when asked, ordered, and merged by a field when asked.\n *\n * @param {object} options The call.\n * @param {Array<object>} options.refs The referenced rows.\n * @param {string} [options.labelField] The row field that names a column.\n * @param {string} [options.orderField] The numeric row field the columns are ordered by.\n * @param {string} [options.colorField] The row field that holds the dot colour.\n * @param {string} [options.mergeBy] The row field whose equal values make one column.\n * @param {{field: string, rowField: string}|null} [options.narrowBy] The parent link.\n * @param {string} [options.narrowValue] The parent the board is narrowed to, '' for all.\n * @param {string} [options.capacityField] The numeric row field that holds a column's limit.\n * A column merged from two or more rows shows none: each row has its own limit.\n * @param {string} [options.neutralColor] The colour a row holds when nobody chose one. A merged\n * column then takes its first row colour that is not this one, and this one only when no row\n * has another. Compared as written: \"Grey\" is not \"grey\", and a hex value is not a name.\n * @param {object} [options.colorMap] A stored colour to the CSS colour a column is drawn in,\n * applied after the merge. A colour it does not map is kept as stored.\n * @param {string} [options.closedField] The row field that marks a stage closed (a won or\n * lost deal): its column starts collapsed. A merged column is closed when all its rows are.\n * @return {{states: Array<{key: string, label: string, color: string, capacity?: (number|null), closed?: boolean}>, keyByValue: Map<string, string>, refsByKey: Map<string, Array<object>>}} The stages.\n * @spec openspec/changes/screens-board-reference-columns/specs/board-view/spec.md#requirement-columns-can-be-the-rows-a-field-references\n * @spec openspec/changes/pl4-board-list-stages/specs/pl4-board-list-stages/spec.md#requirement-a-closed-stage-starts-collapsed\n */\nexport function buildReferenceStages({\n\trefs = [],\n\tlabelField = '',\n\torderField = '',\n\tcolorField = '',\n\tmergeBy = '',\n\tnarrowBy = null,\n\tnarrowValue = '',\n\tcapacityField = '',\n\tneutralColor = '',\n\tcolorMap = null,\n\tclosedField = '',\n} = {}) {\n\tconst list = (Array.isArray(refs) ? refs : []).filter((ref) => ref && typeof ref === 'object' && refIdOf(ref) !== '')\n\tconst narrowed = narrowBy && narrowBy.field && narrowValue !== ''\n\t\t? list.filter((ref) => refIdOf(readPath(ref, narrowBy.field)) === String(narrowValue))\n\t\t: list\n\n\tconst orderOf = (ref) => {\n\t\tconst n = Number(orderField ? readPath(ref, orderField) : NaN)\n\t\treturn Number.isFinite(n) ? n : Number.MAX_SAFE_INTEGER\n\t}\n\tconst ordered = narrowed\n\t\t.map((ref, index) => ({ ref, index }))\n\t\t.sort((a, b) => (orderOf(a.ref) - orderOf(b.ref)) || (a.index - b.index))\n\t\t.map((entry) => entry.ref)\n\n\tconst states = []\n\tconst keyByValue = new Map()\n\tconst refsByKey = new Map()\n\tfor (const ref of ordered) {\n\t\tconst id = refIdOf(ref)\n\t\tconst label = textOf(labelField ? readPath(ref, labelField) : (ref.name ?? ref.title)) || id\n\t\tconst key = mergeBy ? (textOf(readPath(ref, mergeBy)) || id) : id\n\t\tkeyByValue.set(id, key)\n\t\tif (!refsByKey.has(key)) {\n\t\t\trefsByKey.set(key, [])\n\t\t\tconst state = { key, label, color: colorOfRef(ref, colorField) }\n\t\t\tif (capacityField) {\n\t\t\t\tstate.capacity = capacityOfRef(ref, capacityField)\n\t\t\t}\n\t\t\tstates.push(state)\n\t\t}\n\t\trefsByKey.get(key).push(ref)\n\t}\n\tfor (const state of states) {\n\t\tconst rows = refsByKey.get(state.key)\n\t\tif (capacityField && rows.length > 1) {\n\t\t\tstate.capacity = null\n\t\t}\n\t\tif (neutralColor && rows.length > 1) {\n\t\t\tstate.color = mergedColumnColor(rows.map((ref) => colorOfRef(ref, colorField)), neutralColor, state.color)\n\t\t}\n\t\tstate.color = mappedColor(state.color, colorMap)\n\t\tif (closedField) {\n\t\t\tstate.closed = rows.every((ref) => Boolean(readPath(ref, closedField)))\n\t\t}\n\t}\n\treturn { states, keyByValue, refsByKey }\n}\n\n/**\n * The items of a list on each parent row (a pipeline's `stages`) as rows a\n * reference column can be built from: each keyed by its `keyField` value, the\n * value a card stores, and linked to its parent under `_parent`, so\n * `narrowBy: { field: \"_parent\", rowField }` narrows the columns to the parent\n * the page filters on. An item without a key is dropped.\n *\n * @param {Array<object>} rows The parent rows.\n * @param {object} options The call.\n * @param {string} options.itemsPath Where each parent holds its list.\n * @param {string} options.keyField The item field a card stores.\n * @return {Array<object>} The items as rows.\n * @spec openspec/changes/pl4-board-list-stages/specs/pl4-board-list-stages/spec.md#requirement-columns-can-be-a-list-on-a-parent-row\n */\nexport function flattenItemRefs(rows, { itemsPath, keyField } = {}) {\n\tconst out = []\n\tfor (const parent of Array.isArray(rows) ? rows : []) {\n\t\tconst items = readPath(parent, itemsPath)\n\t\tif (!Array.isArray(items)) {\n\t\t\tcontinue\n\t\t}\n\t\tfor (const item of items) {\n\t\t\tconst key = item && typeof item === 'object' ? textOf(readPath(item, keyField)) : ''\n\t\t\tif (key !== '') {\n\t\t\t\tout.push({ ...item, id: key, _parent: refIdOf(parent) })\n\t\t\t}\n\t\t}\n\t}\n\treturn out\n}\n\n/**\n * The colour one referenced row carries.\n *\n * @param {object} ref The referenced row.\n * @param {string} colorField The row field that holds the colour, '' for `color`.\n * @return {string} The colour, '' when it has none.\n */\nfunction colorOfRef(ref, colorField) {\n\tconst color = colorField ? readPath(ref, colorField) : ref.color\n\treturn typeof color === 'string' ? color : ''\n}\n\n/**\n * The colour a column merged from several rows takes when a neutral colour\n * is declared: the first chosen colour, so a row stored with the default\n * never outranks one somebody picked, whatever order the rows come in.\n *\n * @param {Array<string>} colors The rows' colours, in column order.\n * @param {string} neutralColor The colour a row holds when nobody chose one.\n * @param {string} fallback The colour when no row has a chosen or neutral one.\n * @return {string} The column's colour.\n * @spec openspec/changes/board-neutral-column-colour/specs/board-view/spec.md#requirement-a-merged-column-prefers-a-chosen-colour\n */\nexport function mergedColumnColor(colors, neutralColor, fallback = '') {\n\tconst chosen = colors.find((color) => color !== '' && color !== neutralColor)\n\tif (chosen !== undefined) {\n\t\treturn chosen\n\t}\n\treturn colors.includes(neutralColor) ? neutralColor : fallback\n}\n\n/**\n * The CSS colour a stored colour maps to, so a palette name such as\n * \"orange\" or \"grey-light\" can draw a theme token.\n *\n * @param {string} color The stored colour.\n * @param {object|null} colorMap A stored colour to a CSS colour.\n * @return {string} The mapped colour, else the stored one.\n * @spec openspec/changes/board-column-colour-map/specs/board-view/spec.md#requirement-a-column-colour-can-be-mapped-to-a-css-colour\n */\nexport function mappedColor(color, colorMap) {\n\tif (!colorMap || typeof colorMap !== 'object' || color === '' || !Object.hasOwn(colorMap, color)) {\n\t\treturn color\n\t}\n\tconst mapped = colorMap[color]\n\treturn typeof mapped === 'string' && mapped !== '' ? mapped : color\n}\n\n/**\n * The limit one referenced row declares.\n *\n * @param {object} ref The referenced row.\n * @param {string} capacityField The row field that holds the limit.\n * @return {number|null} The limit, or null when it has none.\n * @spec openspec/changes/board-column-capacity/specs/board-view/spec.md#requirement-a-column-can-carry-a-capacity\n */\nexport function capacityOfRef(ref, capacityField) {\n\treturn capacityField ? capacityValue(readPath(ref, capacityField)) : null\n}\n\n/**\n * Whether a drop fills a referenced row past its limit: the cards that\n * already carry that row, counted against the row's own limit. Counted per\n * row, not per column, so a column merged from several rows still refuses\n * the one that is full.\n *\n * @param {object} options The call.\n * @param {object} options.target The referenced row the drop would write.\n * @param {object} options.card The card being moved.\n * @param {Array<object>} options.rows The cards the board holds.\n * @param {string} options.field The row field the columns come from.\n * @param {string} options.capacityField The referenced row's limit field.\n * @param {string} [options.rowKey] The row key, so the moving card is not counted.\n * @return {{count: number, capacity: number}|null} The count and limit when full, else null.\n * @spec openspec/changes/board-column-capacity/specs/board-view/spec.md#requirement-a-drop-into-a-full-column-is-refused\n */\nexport function fullTargetOf({ target, card, rows = [], field, capacityField, rowKey = 'id' } = {}) {\n\tconst capacity = capacityOfRef(target, capacityField)\n\tif (capacity === null) {\n\t\treturn null\n\t}\n\tconst id = refIdOf(target)\n\tconst self = String(card?.[rowKey] ?? '')\n\tconst count = (Array.isArray(rows) ? rows : []).filter((row) => String(row?.[rowKey] ?? '') !== self && refIdOf(readPath(row, field)) === id).length\n\treturn count >= capacity ? { count, capacity } : null\n}\n\n/**\n * The stages of a field with no referenced schema (a user id): the values\n * present on the rows, by label, then one column for no value.\n *\n * @param {object} options The call.\n * @param {Array<object>} options.rows The rows the list holds.\n * @param {string} options.field The row field.\n * @param {object} [options.valueLabels] Raw value to the label to show.\n * @param {string} [options.emptyLabel] The no-value column's label.\n * @return {{states: Array<{key: string, label: string, color: string}>, keyByValue: Map<string, string>, refsByKey: Map<string, Array<object>>}} The stages.\n * @spec openspec/changes/screens-board-reference-columns/specs/board-view/spec.md#requirement-a-field-without-a-referenced-schema-takes-its-values\n */\nexport function buildValueStages({ rows = [], field = '', valueLabels = null, emptyLabel = 'Nobody' } = {}) {\n\tconst labels = valueLabels && typeof valueLabels === 'object' ? valueLabels : {}\n\tconst seen = new Map()\n\tfor (const row of Array.isArray(rows) ? rows : []) {\n\t\tconst raw = readPath(row, field)\n\t\tconst id = refIdOf(raw)\n\t\tif (id !== '' && !seen.has(id)) {\n\t\t\tseen.set(id, typeof labels[id] === 'string' ? labels[id] : (textOf(raw) || id))\n\t\t}\n\t}\n\tconst states = [...seen.entries()]\n\t\t.sort((a, b) => a[1].localeCompare(b[1]))\n\t\t.map(([key, label]) => ({ key, label, color: '' }))\n\tstates.push({ key: NO_VALUE_KEY, label: emptyLabel, color: '' })\n\tconst keyByValue = new Map(states.map((state) => [state.key, state.key]))\n\tkeyByValue.set('', NO_VALUE_KEY)\n\treturn { states, keyByValue, refsByKey: new Map() }\n}\n\n/**\n * The column a row sits in, under a value-to-column map.\n *\n * @param {object} row The row.\n * @param {string} field The row field.\n * @param {Map<string, string>} keyByValue The value-to-column map.\n * @return {string} The column key, or the raw value when the map has none\n * (which lands the card in the off-board column).\n */\nexport function columnKeyOfRow(row, field, keyByValue) {\n\tconst id = refIdOf(readPath(row, field))\n\treturn keyByValue.has(id) ? keyByValue.get(id) : id\n}\n\n/**\n * What a drop on a column writes for one card: the referenced row of that\n * column which belongs to the card's parent, or null when the column has none\n * (the card cannot go there).\n *\n * @param {object} options The call.\n * @param {object} options.card The card.\n * @param {string} options.toKey The column it was dropped on.\n * @param {string} options.kind `reference` or `values`.\n * @param {Map<string, Array<object>>} [options.refsByKey] The column's rows.\n * @param {{field: string, rowField: string}|null} [options.narrowBy] The parent link.\n * @return {{value: (string|null), target: (object|null)}|null} The value to write and its row, or null.\n * @spec openspec/changes/screens-board-reference-columns/specs/board-view/spec.md#requirement-a-drop-writes-the-reference\n */\nexport function resolveDropValue({ card, toKey, kind, refsByKey = new Map(), narrowBy = null } = {}) {\n\tif (kind === 'values') {\n\t\treturn { value: toKey === NO_VALUE_KEY ? null : String(toKey), target: null }\n\t}\n\tconst candidates = refsByKey.get(String(toKey)) || []\n\tif (candidates.length === 0) {\n\t\treturn null\n\t}\n\tif (narrowBy && narrowBy.field && narrowBy.rowField) {\n\t\tconst parent = refIdOf(readPath(card, narrowBy.rowField))\n\t\tconst match = candidates.find((ref) => refIdOf(readPath(ref, narrowBy.field)) === parent)\n\t\treturn match ? { value: refIdOf(match), target: match } : null\n\t}\n\treturn { value: refIdOf(candidates[0]), target: candidates[0] }\n}\n\n/**\n * Fetch the rows a reference column is built from, one list request.\n *\n * @param {object} options The call.\n * @param {string} options.register The register slug.\n * @param {string} options.schema The schema slug.\n * @param {object} [options.filter] Equality filters, e.g. `{ isFinal: false }`.\n * @param {number} [options.limit] The page size, 500 by default.\n * @return {Promise<Array<object>>} The rows.\n * @spec openspec/changes/screens-board-reference-columns/specs/board-view/spec.md#requirement-columns-can-be-the-rows-a-field-references\n */\nexport async function fetchReferenceObjects({ register, schema, filter = {}, limit = 500 } = {}) {\n\tif (!register || !schema) {\n\t\treturn []\n\t}\n\tconst params = { _limit: limit }\n\tfor (const [key, value] of Object.entries(filter || {})) {\n\t\tif (value !== undefined && value !== null && typeof value !== 'object') {\n\t\t\tparams[key] = typeof value === 'boolean' ? String(value) : value\n\t\t}\n\t}\n\tconst url = prefixUrl(`/apps/openregister/api/objects/${encodeURIComponent(register)}/${encodeURIComponent(schema)}${buildQueryString(params)}`)\n\tconst response = await fetch(url, { headers: buildHeaders() })\n\tif (!response.ok) {\n\t\tthrow new Error(`list returned ${response.status}`)\n\t}\n\tconst data = await response.json()\n\treturn Array.isArray(data?.results) ? data.results : (Array.isArray(data) ? data : [])\n}\n"],"names":[],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAKA;AACA;AACY,MAAC,YAAY,GAAG,WAAU;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,OAAO,CAAC,KAAK,EAAE;AAC/B,CAAC,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,EAAE;AAC5C,EAAE,OAAO,EAAE;AACX,EAAE;AACF,CAAC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AAChC,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC,EAAE,IAAI,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,EAAE,EAAE,IAAI,KAAK,CAAC,KAAK,IAAI,GAAE;AAC9E,EAAE,OAAO,EAAE,KAAK,IAAI,IAAI,EAAE,KAAK,SAAS,GAAG,EAAE,GAAG,MAAM,CAAC,EAAE,CAAC;AAC1D,EAAE;AACF,CAAC,OAAO,MAAM,CAAC,KAAK,CAAC;AACrB,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,MAAM,CAAC,KAAK,EAAE;AACvB,CAAC,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,EAAE;AAC5C,EAAE,OAAO,EAAE;AACX,EAAE;AACF,CAAC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AAChC,EAAE,OAAO,MAAM,CAAC,KAAK,CAAC,WAAW,IAAI,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,KAAK,IAAI,EAA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AAM,MAAM,GAAG,EAAE,MAAM,EAAE,KAAK,GAAE;AACjC,CAAC,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,IAAI,EAAE,CAAC,EAAE;AAC1D,EAAE,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AAC1E,GAAG,MAAM,CAAC,GAAG,CAAC,GAAG,OAAO,KAAK,KAAK,SAAS,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,MAAK;AACnE,GAAG;AACH,EAAE;AACF,CAAC,MAAM,GAAG,GAAG,SAAS,CAAC,CAAC,+BAA+B,EAAE,kBAAkB,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,kBAAkB,CAAC,MAAM,CAAC,CAAC,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC,EAAC;AACjJ,CAAC,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,EAAC;AAC/D,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE;AACnB,EAAE,MAAM,IAAI,KAAK,CAAC,CAAC,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;AACrD,EAAE;AACF,CAAC,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,GAAE;AACnC,CAAC,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,GAAG,EAAE,CAAC;AACvF;;;;"}
1
+ {"version":3,"file":"boardReferenceColumns.js","sources":["../../../src/utils/boardReferenceColumns.js"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2026 Conduction B.V. <info@conduction.nl>\n * SPDX-License-Identifier: EUPL-1.2\n *\n * Board columns from a REFERENCED field (screens-board-reference-columns).\n *\n * A status that is an enum or a lifecycle list carries its stages on the\n * field, and `boardColumns.js` reads them there. A status that is a reference\n * to another object (a case's `status` pointing at a statusType row) carries\n * nothing on the field: the stages are the rows of the referenced schema. This\n * module turns those rows into the same `states` list `stagesOf()` reads, plus\n * the map from a row's raw value (the referenced id) to its column.\n *\n * 🔴 THE COLUMNS ARE STILL THE SCHEMA'S, NOT THE DATA'S. They are the\n * referenced rows, fetched, not the values present on the loaded cards, so an\n * empty stage is still a column to drop a card into. The one exception is a\n * field with no referenced schema at all (a Nextcloud user id): there the\n * values present are all there is, and a \"nobody\" column is always added so\n * work without an owner stays visible and can be dropped back to nobody.\n *\n * 🔴 MERGED COLUMNS RESOLVE PER CARD. Referenced rows are often per parent\n * (every case type has its own \"In behandeling\"). Merged by name they make one\n * column, and a drop must then write the row of THAT card's parent. A column\n * with no row for the card's parent is not a place the card can go, and the\n * drop is refused rather than written to some other parent's row.\n *\n * Pure apart from `fetchReferenceObjects`: no store, no Vue.\n */\n\nimport { capacityValue } from './boardColumns.js'\nimport { buildHeaders, buildQueryString, prefixUrl } from './headers.js'\nimport { readPath } from './readPath.js'\nimport { schemaRefSlug } from './schemaRefSlug.js'\n\n/** The column of cards with no value, for a `values` column field. */\nexport const NO_VALUE_KEY = '__none__'\n\n/**\n * The id a reference value carries: a string as is, an object by its `id`,\n * `uuid` or `@self.id`.\n *\n * @param {unknown} value A reference as a row holds it.\n * @return {string} The id, '' when there is none.\n */\nexport function refIdOf(value) {\n\tif (value === null || value === undefined) {\n\t\treturn ''\n\t}\n\tif (typeof value === 'object') {\n\t\tconst id = value.id ?? value.uuid ?? value['@self']?.id ?? value.value ?? ''\n\t\treturn id === null || id === undefined ? '' : String(id)\n\t}\n\treturn String(value)\n}\n\n/**\n * A value as text: a string or number as is, an object by its name.\n *\n * @param {unknown} value The raw value.\n * @return {string} The text.\n */\nfunction textOf(value) {\n\tif (value === null || value === undefined) {\n\t\treturn ''\n\t}\n\tif (typeof value === 'object') {\n\t\treturn String(value.displayName ?? value.name ?? value.title ?? value.label ?? '').trim()\n\t}\n\treturn String(value).trim()\n}\n\n/**\n * The column fields a board offers, normalised. Without `columnFields` the\n * board has one, its `statusField`, read from the schema as before.\n *\n * @param {object} board The board configuration (manifest `config.board`).\n * @return {Array<{field: string, label: string, source: (object|null), kind: string, readOnly: boolean, moveHandler: string, moveTargetsHandler: string}>} The fields.\n * @spec openspec/changes/screens-board-reference-columns/specs/board-view/spec.md#requirement-a-board-can-switch-the-field-its-columns-come-from\n */\nexport function columnFieldsOf(board) {\n\tconst declared = Array.isArray(board?.columnFields) ? board.columnFields : []\n\treturn declared\n\t\t.map((entry) => (typeof entry === 'string' ? { field: entry } : entry))\n\t\t.filter((entry) => entry && typeof entry.field === 'string' && entry.field !== '')\n\t\t.map((entry) => ({\n\t\t\tfield: entry.field,\n\t\t\tlabel: typeof entry.label === 'string' && entry.label !== '' ? entry.label : entry.field,\n\t\t\tsource: entry.source && typeof entry.source === 'object' ? entry.source : null,\n\t\t\tkind: entry.kind === 'values' ? 'values' : (entry.source ? 'reference' : 'schema'),\n\t\t\treadOnly: entry.readOnly === true,\n\t\t\tmoveHandler: typeof entry.moveHandler === 'string' ? entry.moveHandler : '',\n\t\t\tmoveTargetsHandler: typeof entry.moveTargetsHandler === 'string' ? entry.moveTargetsHandler : '',\n\t\t\tvalueLabels: entry.valueLabels && typeof entry.valueLabels === 'object' ? entry.valueLabels : null,\n\t\t\temptyLabel: typeof entry.emptyLabel === 'string' ? entry.emptyLabel : '',\n\t\t\tstates: Array.isArray(entry.states) ? entry.states : null,\n\t\t}))\n}\n\n/**\n * The columns a page declares for a column field (`states`), normalised to\n * the `{ key, label, hidden, closed, color? }` entries `stagesOf()` reads.\n * The active column field's own `states` win; on the board's `statusField`\n * `board.states` applies. A referenced or values column has no declared\n * states: its columns are rows or values.\n *\n * @param {object} board The board configuration (manifest `config.board`).\n * @param {object|null} active The active column field from `columnFieldsOf`, or null.\n * @param {string} field The field the columns come from.\n * @return {Array<{key: string, label: string, hidden: boolean, closed: boolean, color?: string}>|null} The states, or null when none are declared.\n * @spec openspec/changes/board-declared-states/specs/board-view/spec.md#requirement-a-board-can-declare-the-states-its-columns-come-from\n */\nexport function declaredStatesOf(board, active, field) {\n\tif (active && active.kind !== 'schema') {\n\t\treturn null\n\t}\n\tlet declared = active && Array.isArray(active.states) ? active.states : null\n\tif (declared === null && field !== '' && field === board?.statusField && Array.isArray(board?.states)) {\n\t\tdeclared = board.states\n\t}\n\tif (declared === null || declared.length === 0) {\n\t\treturn null\n\t}\n\treturn declared\n\t\t.map((entry) => (typeof entry === 'string' ? { key: entry } : entry))\n\t\t.filter((entry) => entry && typeof entry === 'object' && String(entry.key ?? '') !== '')\n\t\t.map((entry) => ({\n\t\t\tkey: String(entry.key),\n\t\t\tlabel: typeof entry.label === 'string' && entry.label !== '' ? entry.label : String(entry.key),\n\t\t\thidden: entry.hidden === true,\n\t\t\tclosed: entry.closed === true,\n\t\t\t...(typeof entry.color === 'string' && entry.color !== '' ? { color: entry.color } : {}),\n\t\t}))\n}\n\n/**\n * The register and schema a reference column reads its rows from: the\n * source's own, else the page's register and the property's `$ref`.\n *\n * @param {object} source The column field's `source`.\n * @param {object} options The context.\n * @param {string} options.register The page's register.\n * @param {object} [options.property] The field's schema property.\n * @return {{register: string, schema: string}} Both, '' when unknown.\n */\nexport function referenceTargetOf(source, { register = '', property = null } = {}) {\n\tconst schema = source?.schema || schemaRefSlug(property?.$ref ?? property?.items?.$ref ?? '')\n\treturn {\n\t\tregister: String(source?.register || register || ''),\n\t\tschema: schema === '' || schema === null || schema === undefined ? '' : String(schema),\n\t}\n}\n\n/**\n * The stages of a referenced field: the referenced rows, narrowed to one\n * parent when asked, ordered, and merged by a field when asked.\n *\n * @param {object} options The call.\n * @param {Array<object>} options.refs The referenced rows.\n * @param {string} [options.labelField] The row field that names a column.\n * @param {string} [options.orderField] The numeric row field the columns are ordered by.\n * @param {string} [options.colorField] The row field that holds the dot colour.\n * @param {string} [options.mergeBy] The row field whose equal values make one column.\n * @param {{field: string, rowField: string}|null} [options.narrowBy] The parent link.\n * @param {string} [options.narrowValue] The parent the board is narrowed to, '' for all.\n * @param {string} [options.capacityField] The numeric row field that holds a column's limit.\n * A column merged from two or more rows shows none: each row has its own limit.\n * @param {string} [options.neutralColor] The colour a row holds when nobody chose one. A merged\n * column then takes its first row colour that is not this one, and this one only when no row\n * has another. Compared as written: \"Grey\" is not \"grey\", and a hex value is not a name.\n * @param {object} [options.colorMap] A stored colour to the CSS colour a column is drawn in,\n * applied after the merge. A colour it does not map is kept as stored.\n * @param {string} [options.closedField] The row field that marks a stage closed (a won or\n * lost deal): its column starts collapsed. A merged column is closed when all its rows are.\n * @return {{states: Array<{key: string, label: string, color: string, capacity?: (number|null), closed?: boolean}>, keyByValue: Map<string, string>, refsByKey: Map<string, Array<object>>}} The stages.\n * @spec openspec/changes/screens-board-reference-columns/specs/board-view/spec.md#requirement-columns-can-be-the-rows-a-field-references\n * @spec openspec/changes/pl4-board-list-stages/specs/pl4-board-list-stages/spec.md#requirement-a-closed-stage-starts-collapsed\n */\nexport function buildReferenceStages({\n\trefs = [],\n\tlabelField = '',\n\torderField = '',\n\tcolorField = '',\n\tmergeBy = '',\n\tnarrowBy = null,\n\tnarrowValue = '',\n\tcapacityField = '',\n\tneutralColor = '',\n\tcolorMap = null,\n\tclosedField = '',\n} = {}) {\n\tconst list = (Array.isArray(refs) ? refs : []).filter((ref) => ref && typeof ref === 'object' && refIdOf(ref) !== '')\n\tconst narrowed = narrowBy && narrowBy.field && narrowValue !== ''\n\t\t? list.filter((ref) => refIdOf(readPath(ref, narrowBy.field)) === String(narrowValue))\n\t\t: list\n\n\tconst orderOf = (ref) => {\n\t\tconst n = Number(orderField ? readPath(ref, orderField) : NaN)\n\t\treturn Number.isFinite(n) ? n : Number.MAX_SAFE_INTEGER\n\t}\n\tconst ordered = narrowed\n\t\t.map((ref, index) => ({ ref, index }))\n\t\t.sort((a, b) => (orderOf(a.ref) - orderOf(b.ref)) || (a.index - b.index))\n\t\t.map((entry) => entry.ref)\n\n\tconst states = []\n\tconst keyByValue = new Map()\n\tconst refsByKey = new Map()\n\tfor (const ref of ordered) {\n\t\tconst id = refIdOf(ref)\n\t\tconst label = textOf(labelField ? readPath(ref, labelField) : (ref.name ?? ref.title)) || id\n\t\tconst key = mergeBy ? (textOf(readPath(ref, mergeBy)) || id) : id\n\t\tkeyByValue.set(id, key)\n\t\tif (!refsByKey.has(key)) {\n\t\t\trefsByKey.set(key, [])\n\t\t\tconst state = { key, label, color: colorOfRef(ref, colorField) }\n\t\t\tif (capacityField) {\n\t\t\t\tstate.capacity = capacityOfRef(ref, capacityField)\n\t\t\t}\n\t\t\tstates.push(state)\n\t\t}\n\t\trefsByKey.get(key).push(ref)\n\t}\n\tfor (const state of states) {\n\t\tconst rows = refsByKey.get(state.key)\n\t\tif (capacityField && rows.length > 1) {\n\t\t\tstate.capacity = null\n\t\t}\n\t\tif (neutralColor && rows.length > 1) {\n\t\t\tstate.color = mergedColumnColor(rows.map((ref) => colorOfRef(ref, colorField)), neutralColor, state.color)\n\t\t}\n\t\tstate.color = mappedColor(state.color, colorMap)\n\t\tif (closedField) {\n\t\t\tstate.closed = rows.every((ref) => Boolean(readPath(ref, closedField)))\n\t\t}\n\t}\n\treturn { states, keyByValue, refsByKey }\n}\n\n/**\n * The items of a list on each parent row (a pipeline's `stages`) as rows a\n * reference column can be built from: each keyed by its `keyField` value, the\n * value a card stores, and linked to its parent under `_parent`, so\n * `narrowBy: { field: \"_parent\", rowField }` narrows the columns to the parent\n * the page filters on. An item without a key is dropped.\n *\n * @param {Array<object>} rows The parent rows.\n * @param {object} options The call.\n * @param {string} options.itemsPath Where each parent holds its list.\n * @param {string} options.keyField The item field a card stores.\n * @return {Array<object>} The items as rows.\n * @spec openspec/changes/pl4-board-list-stages/specs/pl4-board-list-stages/spec.md#requirement-columns-can-be-a-list-on-a-parent-row\n */\nexport function flattenItemRefs(rows, { itemsPath, keyField } = {}) {\n\tconst out = []\n\tfor (const parent of Array.isArray(rows) ? rows : []) {\n\t\tconst items = readPath(parent, itemsPath)\n\t\tif (!Array.isArray(items)) {\n\t\t\tcontinue\n\t\t}\n\t\tfor (const item of items) {\n\t\t\tconst key = item && typeof item === 'object' ? textOf(readPath(item, keyField)) : ''\n\t\t\tif (key !== '') {\n\t\t\t\tout.push({ ...item, id: key, _parent: refIdOf(parent) })\n\t\t\t}\n\t\t}\n\t}\n\treturn out\n}\n\n/**\n * The colour one referenced row carries.\n *\n * @param {object} ref The referenced row.\n * @param {string} colorField The row field that holds the colour, '' for `color`.\n * @return {string} The colour, '' when it has none.\n */\nfunction colorOfRef(ref, colorField) {\n\tconst color = colorField ? readPath(ref, colorField) : ref.color\n\treturn typeof color === 'string' ? color : ''\n}\n\n/**\n * The colour a column merged from several rows takes when a neutral colour\n * is declared: the first chosen colour, so a row stored with the default\n * never outranks one somebody picked, whatever order the rows come in.\n *\n * @param {Array<string>} colors The rows' colours, in column order.\n * @param {string} neutralColor The colour a row holds when nobody chose one.\n * @param {string} fallback The colour when no row has a chosen or neutral one.\n * @return {string} The column's colour.\n * @spec openspec/changes/board-neutral-column-colour/specs/board-view/spec.md#requirement-a-merged-column-prefers-a-chosen-colour\n */\nexport function mergedColumnColor(colors, neutralColor, fallback = '') {\n\tconst chosen = colors.find((color) => color !== '' && color !== neutralColor)\n\tif (chosen !== undefined) {\n\t\treturn chosen\n\t}\n\treturn colors.includes(neutralColor) ? neutralColor : fallback\n}\n\n/**\n * The CSS colour a stored colour maps to, so a palette name such as\n * \"orange\" or \"grey-light\" can draw a theme token.\n *\n * @param {string} color The stored colour.\n * @param {object|null} colorMap A stored colour to a CSS colour.\n * @return {string} The mapped colour, else the stored one.\n * @spec openspec/changes/board-column-colour-map/specs/board-view/spec.md#requirement-a-column-colour-can-be-mapped-to-a-css-colour\n */\nexport function mappedColor(color, colorMap) {\n\tif (!colorMap || typeof colorMap !== 'object' || color === '' || !Object.hasOwn(colorMap, color)) {\n\t\treturn color\n\t}\n\tconst mapped = colorMap[color]\n\treturn typeof mapped === 'string' && mapped !== '' ? mapped : color\n}\n\n/**\n * The limit one referenced row declares.\n *\n * @param {object} ref The referenced row.\n * @param {string} capacityField The row field that holds the limit.\n * @return {number|null} The limit, or null when it has none.\n * @spec openspec/changes/board-column-capacity/specs/board-view/spec.md#requirement-a-column-can-carry-a-capacity\n */\nexport function capacityOfRef(ref, capacityField) {\n\treturn capacityField ? capacityValue(readPath(ref, capacityField)) : null\n}\n\n/**\n * Whether a drop fills a referenced row past its limit: the cards that\n * already carry that row, counted against the row's own limit. Counted per\n * row, not per column, so a column merged from several rows still refuses\n * the one that is full.\n *\n * @param {object} options The call.\n * @param {object} options.target The referenced row the drop would write.\n * @param {object} options.card The card being moved.\n * @param {Array<object>} options.rows The cards the board holds.\n * @param {string} options.field The row field the columns come from.\n * @param {string} options.capacityField The referenced row's limit field.\n * @param {string} [options.rowKey] The row key, so the moving card is not counted.\n * @return {{count: number, capacity: number}|null} The count and limit when full, else null.\n * @spec openspec/changes/board-column-capacity/specs/board-view/spec.md#requirement-a-drop-into-a-full-column-is-refused\n */\nexport function fullTargetOf({ target, card, rows = [], field, capacityField, rowKey = 'id' } = {}) {\n\tconst capacity = capacityOfRef(target, capacityField)\n\tif (capacity === null) {\n\t\treturn null\n\t}\n\tconst id = refIdOf(target)\n\tconst self = String(card?.[rowKey] ?? '')\n\tconst count = (Array.isArray(rows) ? rows : []).filter((row) => String(row?.[rowKey] ?? '') !== self && refIdOf(readPath(row, field)) === id).length\n\treturn count >= capacity ? { count, capacity } : null\n}\n\n/**\n * The stages of a field with no referenced schema (a user id): the values\n * present on the rows, by label, then one column for no value.\n *\n * @param {object} options The call.\n * @param {Array<object>} options.rows The rows the list holds.\n * @param {string} options.field The row field.\n * @param {object} [options.valueLabels] Raw value to the label to show.\n * @param {string} [options.emptyLabel] The no-value column's label.\n * @return {{states: Array<{key: string, label: string, color: string}>, keyByValue: Map<string, string>, refsByKey: Map<string, Array<object>>}} The stages.\n * @spec openspec/changes/screens-board-reference-columns/specs/board-view/spec.md#requirement-a-field-without-a-referenced-schema-takes-its-values\n */\nexport function buildValueStages({ rows = [], field = '', valueLabels = null, emptyLabel = 'Nobody' } = {}) {\n\tconst labels = valueLabels && typeof valueLabels === 'object' ? valueLabels : {}\n\tconst seen = new Map()\n\tfor (const row of Array.isArray(rows) ? rows : []) {\n\t\tconst raw = readPath(row, field)\n\t\tconst id = refIdOf(raw)\n\t\tif (id !== '' && !seen.has(id)) {\n\t\t\tseen.set(id, typeof labels[id] === 'string' ? labels[id] : (textOf(raw) || id))\n\t\t}\n\t}\n\tconst states = [...seen.entries()]\n\t\t.sort((a, b) => a[1].localeCompare(b[1]))\n\t\t.map(([key, label]) => ({ key, label, color: '' }))\n\tstates.push({ key: NO_VALUE_KEY, label: emptyLabel, color: '' })\n\tconst keyByValue = new Map(states.map((state) => [state.key, state.key]))\n\tkeyByValue.set('', NO_VALUE_KEY)\n\treturn { states, keyByValue, refsByKey: new Map() }\n}\n\n/**\n * The column a row sits in, under a value-to-column map.\n *\n * @param {object} row The row.\n * @param {string} field The row field.\n * @param {Map<string, string>} keyByValue The value-to-column map.\n * @return {string} The column key, or the raw value when the map has none\n * (which lands the card in the off-board column).\n */\nexport function columnKeyOfRow(row, field, keyByValue) {\n\tconst id = refIdOf(readPath(row, field))\n\treturn keyByValue.has(id) ? keyByValue.get(id) : id\n}\n\n/**\n * What a drop on a column writes for one card: the referenced row of that\n * column which belongs to the card's parent, or null when the column has none\n * (the card cannot go there).\n *\n * @param {object} options The call.\n * @param {object} options.card The card.\n * @param {string} options.toKey The column it was dropped on.\n * @param {string} options.kind `reference` or `values`.\n * @param {Map<string, Array<object>>} [options.refsByKey] The column's rows.\n * @param {{field: string, rowField: string}|null} [options.narrowBy] The parent link.\n * @return {{value: (string|null), target: (object|null)}|null} The value to write and its row, or null.\n * @spec openspec/changes/screens-board-reference-columns/specs/board-view/spec.md#requirement-a-drop-writes-the-reference\n */\nexport function resolveDropValue({ card, toKey, kind, refsByKey = new Map(), narrowBy = null } = {}) {\n\tif (kind === 'values') {\n\t\treturn { value: toKey === NO_VALUE_KEY ? null : String(toKey), target: null }\n\t}\n\tconst candidates = refsByKey.get(String(toKey)) || []\n\tif (candidates.length === 0) {\n\t\treturn null\n\t}\n\tif (narrowBy && narrowBy.field && narrowBy.rowField) {\n\t\tconst parent = refIdOf(readPath(card, narrowBy.rowField))\n\t\tconst match = candidates.find((ref) => refIdOf(readPath(ref, narrowBy.field)) === parent)\n\t\treturn match ? { value: refIdOf(match), target: match } : null\n\t}\n\treturn { value: refIdOf(candidates[0]), target: candidates[0] }\n}\n\n/**\n * Fetch the rows a reference column is built from, one list request.\n *\n * @param {object} options The call.\n * @param {string} options.register The register slug.\n * @param {string} options.schema The schema slug.\n * @param {object} [options.filter] Equality filters, e.g. `{ isFinal: false }`.\n * @param {number} [options.limit] The page size, 500 by default.\n * @return {Promise<Array<object>>} The rows.\n * @spec openspec/changes/screens-board-reference-columns/specs/board-view/spec.md#requirement-columns-can-be-the-rows-a-field-references\n */\nexport async function fetchReferenceObjects({ register, schema, filter = {}, limit = 500 } = {}) {\n\tif (!register || !schema) {\n\t\treturn []\n\t}\n\tconst params = { _limit: limit }\n\tfor (const [key, value] of Object.entries(filter || {})) {\n\t\tif (value !== undefined && value !== null && typeof value !== 'object') {\n\t\t\tparams[key] = typeof value === 'boolean' ? String(value) : value\n\t\t}\n\t}\n\tconst url = prefixUrl(`/apps/openregister/api/objects/${encodeURIComponent(register)}/${encodeURIComponent(schema)}${buildQueryString(params)}`)\n\tconst response = await fetch(url, { headers: buildHeaders() })\n\tif (!response.ok) {\n\t\tthrow new Error(`list returned ${response.status}`)\n\t}\n\tconst data = await response.json()\n\treturn Array.isArray(data?.results) ? data.results : (Array.isArray(data) ? data : [])\n}\n"],"names":[],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A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